-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Ensure dashboard panels appear in the correct order #8540
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
Ensure dashboard panels appear in the correct order #8540
Conversation
|
Jenkins, test this |
Bargs
left a comment
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.
Couple of minor inline comments, but functionality looks good!
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.
Use const where possible
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 should be expect(foo8Panel).to.not.be(null);
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 to work (chai 3.5)? http://chaijs.com/api/bdd/#method_null
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.
We don't use Chai we use expect.js :)
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, where are we using chai then (we have dependency on it)?
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.
Looking at the Git blame, it looks like Rashid added that dependency when merging timelion, so I guess timelion uses chai.
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.
Good catch, indeed, expect(null).to.not.be.null; passes. Comments addressed.
tylersmalley
left a comment
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. This PR definitely fixes the issue, which many will rejoice about. It does open up an issue I see which is our use of the Gridster library, which mostly stems from it being a jQuery library, being abandonded and not consisting of any tests. At some point it would make sense to either roll our own or find Angular library to replace it with.
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.
To keep the project consistent, mind removing this blank line?
|
@stacey-gammon before merging, would you mind squashing everything into one commit? The commit history is a little tough to follow for the number of changes that actually exist in this PR :) |
2dc012d to
e531aef
Compare
Backports elastic#8540 Former-commit-id: 50d41a2
Gridster apparently has an issue with rendering panels in the correct order. A work around is to pre-order the panels before passing them to gridster. See ducksboard/gridster.js#147 for reference.
Tests added that verify, at minimum, the reproducible scenario described by @Bargs in the issue #2138 is solved.
Note that this change may abruptly rearrange dashboards for some users. The reason is that the data is stored correctly, but displayed incorrectly. So for instance, someone created a dashboard, then attempted to swap vizA with vizB. They save the dashboard and the move failed to persist, so the user continues to see the original order. The data is still stored as if vizA was indeed swapped with vizB, which means with this change, the next time they load the data they will see their original intention manifested. Depending on how long ago they made that swap, this may come as a surprise. Probably something we will want to document.
Fixes #2138