-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content profile icons #4594
Merged
petrjasek
merged 12 commits into
superdesk:develop
from
tomaskikutis:content-profile-icons
Aug 15, 2024
Merged
Content profile icons #4594
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a5e8013
content profile edit view supports custom icon
tomaskikutis db021bb
groundwork
tomaskikutis 5c1e3a4
add contentProfileId to TypeIcon
tomaskikutis c06d9b9
add content profile filters next to content type filters
tomaskikutis cb23e0e
add e2e test
tomaskikutis d9bd5df
fix lint issues
tomaskikutis 8cc0879
fix compilation error
tomaskikutis 79a726a
Merge branch 'develop' into content-profile-icons
tomaskikutis d7d99e0
update existing API to be sync
tomaskikutis 9ea6e12
Merge branch 'develop' into content-profile-icons
tomaskikutis 9013a16
remove useless navigation
tomaskikutis 2ddb84e
see if this fixes e2e
tomaskikutis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import {Monitoring} from './page-object-models/monitoring'; | ||
import {restoreDatabaseSnapshot, s} from './utils'; | ||
|
||
test('content profile icon', async ({page}) => { | ||
const monitoring = new Monitoring(page); | ||
|
||
await restoreDatabaseSnapshot(); | ||
|
||
// expect an article to have a regular text icon | ||
|
||
await page.goto('/#/workspace/monitoring'); | ||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await expect( | ||
page.locator(s( | ||
'monitoring-group=Sports / Working Stage', | ||
'article-item=test sports story', | ||
'type-icon', | ||
)), | ||
).toHaveAttribute('data-test-value', 'text'); | ||
|
||
|
||
// go to content profile and set icon to "map-marker" | ||
|
||
await page.goto('/#/settings/content-profiles'); | ||
await page.locator(s('content-profile=Story', 'content-profile-actions')).click(); | ||
await page.locator(s('content-profile-actions--options')).getByRole('button', {name: 'Edit'}).click(); | ||
|
||
await page.locator(s('content-profile-edit-view')).getByLabel('Icon').getByRole('button').click(); | ||
await page.getByRole('button', {name: 'map-marker'}).click(); | ||
await page.locator(s('content-profile-edit-view--footer')).getByRole('button', {name: 'Save'}).click(); | ||
|
||
await expect(page.locator(s('content-profile=Story', 'icon'))).toHaveAttribute('data-test-value', 'map-marker'); | ||
|
||
|
||
// go back to monitoring and test whether the newly set icon is being used | ||
|
||
await page.goto('/#/workspace/monitoring'); | ||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await expect( | ||
page.locator(s( | ||
'monitoring-group=Sports / Working Stage', | ||
'article-item=test sports story', | ||
'type-icon', | ||
)), | ||
).toHaveAttribute('data-test-value', 'map-marker', {timeout: 10000}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import {IContentProfile} from 'superdesk-api'; | ||
import ng from 'core/services/ng'; | ||
import {dataStore} from 'data-store'; | ||
|
||
interface IContentProfilesApi { | ||
get(id: IContentProfile['_id']): Promise<IContentProfile>; | ||
get(id: IContentProfile['_id']): IContentProfile; | ||
} | ||
|
||
export const contentProfiles: IContentProfilesApi = { | ||
get: (id) => ng.get('content').getType(id), | ||
get: (id) => dataStore.contentProfiles.get(id), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {IScope} from 'angular'; | ||
|
||
export function findParentScope(scope: IScope, predicate: (scope: IScope) => boolean): IScope | null { | ||
let current = scope.$parent; | ||
|
||
while (current != null) { | ||
if (predicate(current) === true) { | ||
return current; | ||
} else { | ||
current = current.$parent; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing gettext in
aria-label