-
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
[Datahub] Add search filter for organisations #717
Conversation
Affected libs:
|
…isations-filter.component
and revert adding emails to organisations
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.
Excellent, I start to like the dynamic, clear UX and sharp implementation.
I am wondering if we should have a number of char limit, like 2 or 3 chars.
You just missed one thing, the margin between the search info and the results. It should be bigger, and aligned with the dataset tab.
👌
@@ -33,8 +33,14 @@ export class OrganisationsSortComponent { | |||
}, | |||
] | |||
@Output() sortBy = new EventEmitter<SortByField>() | |||
@Output() filterByValueChange = new EventEmitter<string>() |
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.
Is it really it an output ?
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.
Ah good catch, completely forgot about it when refactoring
|
||
selectOrderToDisplay(selectValue: string) { | ||
this.sortBy.emit(selectValue.split(',') as SortByField) | ||
} | ||
|
||
filterOrganisations(inputValue: string) { |
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.
Note that the children output is an Observable, which you could reach with a @ChildView
component ref.
Parent output would just be childrenOutput.pipe(debounce(300)
, no event handling with the component, no event emission, just propagation.
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.
Interesting idea! I guess I'd need an ngOnInit
for this to update the ouput, though, no?
As doing the following, the @Output()
's initialization accesses too early the searchInput
:
@ViewChild('search') searchInput
@Output() filterBy = this.searchInput.valueChange.pipe(debounceTime(300))
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, the ViewChild
are only accessible afterViewInit
.
Thanks for the review @fgravin ! I did some testing introducing a minimum number of chars, but as we don't launch requests here, I finally decided against it. This way the user immediately gets a feedback that something is happening, when he/she stops typing, which seems more intuitive to me. |
PR adds a search filter for the organisations:
Todos:
Funded by SwissTopo geocat.ch