Skip to content
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

Merged
merged 10 commits into from Nov 13, 2018

Conversation

tobias-istvan
Copy link
Member

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:

PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 269 of 269 SUCCESS (9.276 secs / 9.178 secs)
✨  Done in 35.58s.

Please review Ambari Contributing Guide before opening a pull request.

@asfgit
Copy link

asfgit commented Oct 8, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/7/
Test PASSed.

Copy link
Contributor

@oleewere oleewere left a 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;
Copy link
Contributor

@aBabiichuk aBabiichuk Oct 8, 2018

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

@asfgit
Copy link

asfgit commented Oct 9, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/9/
Test PASSed.

if (startIndex === -1) {
startIndex = allItems.length;
}
if (endIndex === -1) {
Copy link
Contributor

@aBabiichuk aBabiichuk Oct 9, 2018

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.

@asfgit
Copy link

asfgit commented Oct 30, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/21/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Nov 8, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/28/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Nov 9, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/29/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Nov 10, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/35/
Test FAILed.
Test FAILured.

…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
@asfgit
Copy link

asfgit commented Nov 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/38/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Nov 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/39/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Nov 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/40/
Test FAILed.
Test FAILured.

…doing or redoing several history steps - cleaning up the branch, writing tests fixing issues revealed by unit tests.
@asfgit
Copy link

asfgit commented Nov 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/41/
Test PASSed.

@tobias-istvan
Copy link
Member Author

@aBabiichuk
I completely refactored the history manager. The initial reason was to simplify the business logic around the history management, also make it more URL handling compatible since the history is connected to the linkable URL.

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 ControlValueAccessor interface.

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.

@asfgit
Copy link

asfgit commented Nov 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/42/
Test PASSed.

Copy link
Contributor

@aBabiichuk aBabiichuk left a 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

…doing or redoing several history steps - PR change requests
@asfgit
Copy link

asfgit commented Nov 13, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-LogSearch-Github-PR-Builder/44/
Test PASSed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants