-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Draggable rework #8442
Draggable rework #8442
Conversation
LGTM. These changes make it so that your new use case doesn't need any special handling, too, right? |
Correct. Not really sure how it was working correctly with the vis editor. :) |
It's a wonder how anything ever works |
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.
Awesome! LGTM. 1 small suggestion. I did find a bug when trying to reorder the metrics buckets. The preview doesn't show up when you drag them. Is that within the scope of this PR?
|
||
//the aggs have been reordered in [group] and we need | ||
//to apply that ordering to [vis.aggs] | ||
const baseIndex = $scope.vis.aggs.indexOf($scope.group[0]); |
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.
It took me awhile to work out the role of this variable but once I did it made perfect sense. Totally going out on a limb here but do you think offsetIndex
might be clearer/as clear? If not, then forget 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.
renamed to indexOffset
. Is that more clear?
You can ignore my comment about a problem with reordering metrics buckets. I just tried to repro and wasn't able to so it must have been user error the first time around. |
Yup! Thanks! On Friday, September 23, 2016, Jim Unger [email protected] wrote:
|
--------- **Commit 1:** re-adds the dragula base styles * Original sha: ee6962c * Authored by Jim Unger <[email protected]> on 2016-09-22T21:57:29Z **Commit 2:** used string templates for test descriptors * Original sha: 6797ca5 * Authored by Jim Unger <[email protected]> on 2016-09-22T22:00:01Z **Commit 3:** fixed some re-ordering edge cases and agg_group now uses group instead of vis.aggs * Original sha: f4717fa * Authored by Jim Unger <[email protected]> on 2016-09-22T22:01:18Z **Commit 4:** renamed baseIndex to indexOffset * Original sha: 5d5b581 * Authored by Jim Unger <[email protected]> on 2016-09-23T18:09:38Z
--------- **Commit 1:** re-adds the dragula base styles * Original sha: ee6962c * Authored by Jim Unger <[email protected]> on 2016-09-22T21:57:29Z **Commit 2:** used string templates for test descriptors * Original sha: 6797ca5 * Authored by Jim Unger <[email protected]> on 2016-09-22T22:00:01Z **Commit 3:** fixed some re-ordering edge cases and agg_group now uses group instead of vis.aggs * Original sha: f4717fa * Authored by Jim Unger <[email protected]> on 2016-09-22T22:01:18Z **Commit 4:** renamed baseIndex to indexOffset * Original sha: 5d5b581 * Authored by Jim Unger <[email protected]> on 2016-09-23T18:09:38Z
--------- **Commit 1:** re-adds the dragula base styles * Original sha: 5b0ed5c6609c3ac5cca014207d2b02873f6c9bcb [formerly ee6962c] * Authored by Jim Unger <[email protected]> on 2016-09-22T21:57:29Z **Commit 2:** used string templates for test descriptors * Original sha: 4bb21e6f606f15c45e580911e1df10e75ba19726 [formerly 6797ca5] * Authored by Jim Unger <[email protected]> on 2016-09-22T22:00:01Z **Commit 3:** fixed some re-ordering edge cases and agg_group now uses group instead of vis.aggs * Original sha: 2863994eca01cfc5dda347500fc5ccfbe52c2647 [formerly f4717fa] * Authored by Jim Unger <[email protected]> on 2016-09-22T22:01:18Z **Commit 4:** renamed baseIndex to indexOffset * Original sha: d21c636beca0e28e96c09954a6c47c36af53592e [formerly 5d5b581] * Authored by Jim Unger <[email protected]> on 2016-09-23T18:09:38Z Former-commit-id: e9c030e
[backport] PR elastic#8442 to 5.x Former-commit-id: a4c3203
original PR: #6566
I attempted to consume the draggable-collection directives in the pipeline and ran into some weird behavior. This lead me to dig in a little deeper.
Changes
agg_group.html
to consume thegroup
collection as thedraggable-collection
instead ofvis.aggs
.vis-aggs
contains both the metrics and buckets aggregations. This caused the index manipulation to be erratic. (since the ui was based on a different, smaller array than the collection that was being manipulated)agg-group.js
so that it re-orders the items invis.aggs
according to the modified order ingroup
(reference)
modifier tobase.less
to actually include the styles fromdragula.css
. Thanks @cjcenizal!!