-
Notifications
You must be signed in to change notification settings - Fork 817
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
Add Drag & Drop Across Axis Functionality to Vis Builder #7107
base: main
Are you sure you want to change the base?
Conversation
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7107 +/- ##
==========================================
- Coverage 67.45% 67.37% -0.08%
==========================================
Files 3442 3450 +8
Lines 67816 68057 +241
Branches 11027 11086 +59
==========================================
+ Hits 45742 45853 +111
- Misses 19408 19531 +123
- Partials 2666 2673 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6e1483e
to
56e4202
Compare
4b31db9
to
bd08a03
Compare
src/plugins/vis_builder/public/application/components/data_tab/config_panel.tsx
Outdated
Show resolved
Hide resolved
src/plugins/vis_builder/public/application/components/data_tab/index.tsx
Outdated
Show resolved
Hide resolved
|
||
export const DATA_TAB_ID = 'data_tab'; | ||
|
||
const getIndexPatternField = (indexFieldName: string, availableFields: IndexPatternField[]) => |
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.
Duplicate of
Line 214 in 5ee6f58
const getIndexPatternField = (indexFieldName: string, availableFields: IndexPatternField[]) => |
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.
I have consolidated the common functions into a util and reused it across required components.
}) | ||
.filter((aggType) => (isCountField ? true : aggType.name !== 'count')) | ||
// `types` can be either a Bucket or Metric aggType, but both types have the name property. | ||
.map((aggType) => (aggType as BucketAggType).name) |
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.
I don't quite get this part. If types can be both metric or bucket agg, why we assign only bucket agg type here aggType as BucketAggType
?
src/plugins/vis_builder/public/application/components/data_tab/index.tsx
Outdated
Show resolved
Hide resolved
src/plugins/vis_builder/public/application/components/data_tab/index.tsx
Outdated
Show resolved
Hide resolved
src/plugins/vis_builder/public/application/components/data_tab/index.tsx
Show resolved
Hide resolved
} | ||
}; | ||
|
||
const handleConfigurationPanelTransition = ({ |
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.
nit: should we memorize this computation func with useCallback? same question for handleFieldSelectorToConfigurationPanelTransition
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.
In my opinion that might not work here. The params that we have are source, destination, combine which have droppableId of the area and an index that to the fieldAggregation i.e being moved around. So ideally for 2 differrent transitions the index value may remain same but the underlying fieldAggreagtion can be different. In those scenarios the memoization can prove to be detrimental.
src/plugins/vis_builder/public/application/components/data_tab/index.tsx
Outdated
Show resolved
Hide resolved
src/plugins/vis_builder/public/application/components/data_tab/schema_to_dropbox.tsx
Outdated
Show resolved
Hide resolved
0fb02ce
to
a602190
Compare
Signed-off-by: Suchit Sahoo <[email protected]>
a602190
to
7e41206
Compare
Description
This change aims to enhance the drag and drop functionality present within Vis-Builder. The enhancements are
To support the Drag and Drop functionality the custom Drag and Drop containers were converted to Draggable and Droppable Components (part of OUI). Besides the OUIAccordion didn't support Dragging of the elements present within the accordion hence instead of using it a custom version of Accordion was used.
Issues Resolved
#7015
Screenshot
EditedEnhancementVisBUilder.mp4
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration