-
Notifications
You must be signed in to change notification settings - Fork 32
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
Editor: Add a search filters summary component #1037
Conversation
Affected libs:
|
📷 Screenshots are here! |
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.
Thanks! I did put some comments on what's already there, I'm not 100% sure what is the best way, let me know if you have better ideas!
...tor/src/app/dashboard/search-filters-summary-item/search-filters-summary-item.component.html
Outdated
Show resolved
Hide resolved
...ditor/src/app/dashboard/search-filters-summary-item/search-filters-summary-item.component.ts
Outdated
Show resolved
Hide resolved
...tadata-editor/src/app/dashboard/search-filters-summary/search-filters-summary.component.html
Outdated
Show resolved
Hide resolved
...metadata-editor/src/app/dashboard/search-filters-summary/search-filters-summary.component.ts
Outdated
Show resolved
Hide resolved
...metadata-editor/src/app/dashboard/search-filters-summary/search-filters-summary.component.ts
Outdated
Show resolved
Hide resolved
Thanks for the suggestions @jahow, I'll have a look how to refactor things this way. |
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.
Thank you, this looks really good! Just a few final comments but it works well in the app and I think the implementation makes a lot of sense now.
.../feature/search/src/lib/search-filters-summary-item/search-filters-summary-item.component.ts
Outdated
Show resolved
Hide resolved
" | ||
> | ||
<mat-icon class="material-symbols-outlined leading-[1.1]">close</mat-icon> | ||
<mat-icon class="material-symbols-outlined">close</mat-icon> |
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.
hmm, we should't have mat-icons
anymore :)
2693db5
to
f95e16d
Compare
5ff9f51
to
2671c55
Compare
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.
Thank you @tkohr, this will improve the usability of the filters quite a lot!
The code looks good to me.
While testing I had some behaviors that we might need to have a look at:
-
If we do the same with
changeDate
, we see an empty search filters summary component with the "reset" button
And as mentioned to you before, the filters are only working as expected on "Metadata records" but not on "My Records". I think this is more important than the issues mentioned above. When this is fixed, you can merge from my side 🚀
@@ -42,8 +44,8 @@ export function expandQueryParams( | |||
} else if (isDateUrl(value)) { | |||
const [start, end] = value.split('..') | |||
expanded[key] = { | |||
...(start && { start: new Date(start) }), | |||
...(end && { end: new Date(end) }), | |||
...(start && { start: new Date(`${start}T00:00:00`) }), |
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.
I guess T00:00:00
stands for the time... Is the time necessary here?
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.
Yes, good point, the time is necessary here to prevent timezone issues. Actually, the URL does indeed not include the time as it is not needed, but as a Date
in the app has a time it's set to midnight when it's read from the URL. Then, within the app, the date is handled in the local time of the browser and when it's written to the browser it's "cut" again. If we don't handle the time within the app, there are conflicts between the date chosen in the datepicker and the one encoded in the URL and sent to elasticsearch.
You can test it by switching the timezone of your browser. I discovered the issue since cypress is not running in the same timezone in the CI as my machine.
…method to simplify template and align badges
move one common formatUserInfo() to utils at the same time
…f no summary label defined
and use fieldname 'user' in component
treat dates in local timezone in app and without time in URL
…lters summary fix waiting for this.searchFacade.searchFilters$ via ngOnInit at the same time both is needed for use in myRecords.component
2601dac
to
508983b
Compare
Thanks for the review and the testing @Angi-Kinas ! Good catches! I've added two commits to fix the errors you encountered. The first one (8302b76) allows to define filters that should be ignored by the summary component (like the active Both PRs are rebased again. Could you have a final look and approve the PRs if all is good for you? |
|
@tkohr thank you for addressing my comments. The issue with the empty value for a filter seems to be fixed 👍 While testing the feature on the "My Records" tab, I encountered two other issues:
I think addressing these issues will take some more time and could be worked on in a separate ticket. It would take additional complexity out of this PR. What do you think? |
Thanks for your additional tests and pointing out the resetting bug @Angi-Kinas !
This is actually expected, as the
Good catch, I've added 01d9e22 to also ignore the filters from the Crossing fingers that everything works fine now 🤞 |
…LIST also when clearing filters
01d9e22
to
75ca16b
Compare
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.
Thanks @tkohr for the adaption and the hard work on this feature!
Now the filters work as expected :) 🚀
Description
This PR introduces components to display currently selected search filter values in a zone below the search filters.
To-dos:
Screenshots
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label