-
Notifications
You must be signed in to change notification settings - Fork 12
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 context for remote typeahead #403
Conversation
Adds the currently edited record PID to suggestions backend request, to be able to do a specific process with the given PID. Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
constructor( | ||
private _remoteTypeaheadService: RemoteTypeaheadService | ||
) { | ||
constructor(private _remoteTypeaheadService: RemoteTypeaheadService, private _route: ActivatedRoute) { |
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.
Seems better to have each constructor argument on separate line.
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.
Prettier
says no...
@@ -102,12 +104,18 @@ export class RemoteTypeaheadService { | |||
}) | |||
); | |||
} else { | |||
const filters: any = {}; | |||
if (currentPid) { | |||
filters.currentPid = currentPid; |
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 didn't well understand how this filter can impact the search result.
If I'm right, using this syntax the url sended to backend will be something like :
http://endpoint/api/resource?q=[...]¤tPid=[currentPid]
So the currentPid
url argument must be manage by the query handler into backend ? (it seems not the case for RERO-ILS, maybe OK for sonar ?)
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.
You're right, it has to be managed in backend query. In most cases it's OK without that, but I have a collections
resource in SONAR that can be hierarchical. A collection can have a parent collection. And I want to avoid to suggest the same collection as the current one.
Adds the currently edited record PID to suggestions backend request, to be able to do a specific process with the given PID.
Co-Authored-by: Sébastien Délèze sebastien.deleze@rero.ch