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
[AMBARI-24551] [Log Search UI] get rid of redundant requests after undoing or redoing several history steps #5
[AMBARI-24551] [Log Search UI] get rid of redundant requests after undoing or redoing several history steps #5
Conversation
Refer to this link for build results (access rights to CI server needed): |
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.
lgtm
@@ -292,19 +292,12 @@ export class HistoryManagerService { | |||
* @param {object} value | |||
*/ | |||
private handleUndoOrRedo(value: object): void { | |||
const filtersForm = this.logsContainerService.filtersForm; | |||
this.hasNoPendingUndoOrRedo = false; |
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.
Looks like hasNoPendingUndoOrRedo
and isUndoOrRedo
aren't needed any more, as well as onFormValueChanges
which handles those values
Refer to this link for build results (access rights to CI server needed): |
if (startIndex === -1) { | ||
startIndex = allItems.length; | ||
} | ||
if (endIndex === -1) { |
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.
This isUndoOrRedo
/endIndex
logic shouldn't be removed here. It's needed to handle the situation when after some undoing/redoing user goes on with non-historical filters changes, so there's nothing to redo. Sorry for my omission in previous comment.
P.S. Getting rid of hasNoPendingUndoOrRedo
looks OK to me.
Refer to this link for build results (access rights to CI server needed): |
227475d
to
a7c227f
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
…doing or redoing several history steps
…doing or redoing several history steps - PR fixes
…doing or redoing several history steps - fixing form control implementations
…doing or redoing several history steps - change history manager with actions/reducers/effects focused solution.
…doing or redoing several history steps - working history manager
…doing or redoing several history steps - request in progress indicators
…doing or redoing several history steps - fixing dropdown with icons, optimize code readibility, changing labels
8312ada
to
58ee472
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
58ee472
to
b080f60
Compare
Refer to this link for build results (access rights to CI server needed): |
b080f60
to
d6559bd
Compare
…doing or redoing several history steps - cleaning up the branch, writing tests fixing issues revealed by unit tests.
Refer to this link for build results (access rights to CI server needed): |
d6559bd
to
20c27ea
Compare
@aBabiichuk I followed the previous approach which is use more action/effects/reducers over services in order to decouple the direct dependencies. The main reason of the redundant request was the wrong implementation of the I also added some UX improvements to indicate when a request is in progress in the background. There is a global notification and added some specific ones for log tables and graphs. |
Refer to this link for build results (access rights to CI server needed): |
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.
History items in undo dropdown are listed incorrectly: newer entries should be higher than the older ones
...-logsearch-web/src/app/components/filter-history-manager/filter-history-manager.component.ts
Outdated
Show resolved
Hide resolved
ambari-logsearch-web/src/app/components/action-menu/action-menu.component.ts
Outdated
Show resolved
Hide resolved
…doing or redoing several history steps - PR change requests
Refer to this link for build results (access rights to CI server needed): |
What changes were proposed in this pull request?
We can prevent extra calls by using the
LogsContainerService
resetFiltersForms
method.How was this patch tested?
It was tested manually checking the Network tab in dev tools and by running unit tests:
Please review Ambari Contributing Guide before opening a pull request.