Skip to content

Conversation

@stacey-gammon
Copy link

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

@stacey-gammon
Copy link
Author

Jenkins, test this

@Bargs Bargs self-assigned this Oct 5, 2016
Copy link
Contributor

@Bargs Bargs left a 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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use const where possible

Copy link
Contributor

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);

Copy link
Contributor

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

Copy link
Contributor

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 :)

Copy link
Contributor

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)?

Copy link
Contributor

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.

Copy link
Author

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 tylersmalley self-assigned this Oct 6, 2016
Copy link
Member

@tylersmalley tylersmalley left a 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.

Copy link
Member

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?

@Bargs Bargs removed their assignment Oct 6, 2016
@Bargs
Copy link
Contributor

Bargs commented Oct 7, 2016

@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 :)

@stacey-gammon stacey-gammon force-pushed the fix-dashboard-panel-order branch from 2dc012d to e531aef Compare October 7, 2016 20:26
@stacey-gammon stacey-gammon merged commit 98ab43e into elastic:master Oct 7, 2016
epixa pushed a commit to epixa/kibana that referenced this pull request Oct 7, 2016
epixa pushed a commit to epixa/kibana that referenced this pull request Oct 7, 2016
@stacey-gammon stacey-gammon deleted the fix-dashboard-panel-order branch December 19, 2016 15:45
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants