-
Notifications
You must be signed in to change notification settings - Fork 33
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
Reactivate filtering by favorites & geometry #623
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b05a07a
refactor: move auth and avatar services to gn4 repository libs/api
jahow c63d323
feat(search): reactivate filter by favorites
jahow 26f7ef2
feat(search): reactivate filter by geometry
jahow 9fbdb45
e2e(datahub): add a test for showing favorites only
jahow ef13a25
feat(search): requestNewResults$ now aggregates actions by searchid
jahow 2d50201
e2e(datahub): add test for spatial filtering
jahow 26ed7d9
fix(ui): correctly style mat-icons in gn-ui-button
jahow d055be3
doc: better describe the effect of the filter_geometry setting
jahow 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
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,26 @@ | ||
[global] | ||
geonetwork4_api_url = "/geonetwork/srv/api" | ||
proxy_path = "" | ||
|
||
[theme] | ||
primary_color = "#c82850" | ||
secondary_color = "#001638" | ||
main_color = "#212029" # All-purpose text color | ||
background_color = "#fdfbff" | ||
|
||
[search] | ||
filter_geometry_data = ''' | ||
{ | ||
"coordinates": | ||
[[ | ||
[6.465947342741936,46.80654432188126], | ||
[6.465947342741936,45.65557605314669], | ||
[8.74050023387097,45.65557605314669], | ||
[8.74050023387097,46.80654432188126], | ||
[6.465947342741936,46.80654432188126] | ||
]], | ||
"type": "Polygon" | ||
} | ||
''' | ||
|
||
[map] |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ declare namespace Cypress { | |
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
interface Chainable<Subject> { | ||
login(): void | ||
clearFavorites(): void | ||
} | ||
} | ||
|
||
|
@@ -29,6 +30,41 @@ Cypress.Commands.add('login', () => { | |
cy.get('[name="gnSigninForm"]').submit() | ||
}) | ||
|
||
/** | ||
* This will most likely fail if the user is not logged in! | ||
*/ | ||
Cypress.Commands.add('clearFavorites', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, also really handy! I did not know this. |
||
cy.request({ | ||
url: '/geonetwork/srv/api/me', | ||
headers: { accept: 'application/json' }, | ||
}) | ||
.its('body') | ||
.its('id') | ||
.as('myId') | ||
|
||
cy.window().then(function () { | ||
cy.request({ | ||
url: `/geonetwork/srv/api/userselections/0/${this.myId}`, | ||
headers: { accept: 'application/json' }, | ||
}) | ||
.its('body') | ||
.as('favoritesId') | ||
}) | ||
|
||
cy.getCookie('XSRF-TOKEN') | ||
.its('value') | ||
.then(function (token) { | ||
const favoritesId = this.favoritesId || [] | ||
cy.request({ | ||
url: `/geonetwork/srv/api/userselections/0/${ | ||
this.myId | ||
}?uuid=${favoritesId.join('&uuid=')}`, | ||
method: 'DELETE', | ||
headers: { accept: 'application/json', 'X-XSRF-TOKEN': token }, | ||
}) | ||
}) | ||
}) | ||
|
||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
|
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
8 changes: 4 additions & 4 deletions
8
apps/metadata-editor/src/app/dashboard/search-header/search-header.component.ts
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
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
...h/src/lib/avatar/gravatar.service.spec.ts → ...src/lib/gn4/auth/gravatar.service.spec.ts
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
2 changes: 1 addition & 1 deletion
2
...e/auth/src/lib/avatar/gravatar.service.ts → ...tory/src/lib/gn4/auth/gravatar.service.ts
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,3 @@ | ||
export * from './auth.service' | ||
export * from './avatar.service.interface' | ||
export * from './gravatar.service' |
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
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.
Really handy!