-
Notifications
You must be signed in to change notification settings - Fork 58
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
bulk update separation #356
Changes from 4 commits
8bf80a8
35f260d
ea5baf7
2b1837e
f3ba48b
d5bc709
9a0d150
19b9c9f
cedf122
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -46,9 +46,12 @@ export class SaveAsCurrentVisualization extends SavedQuerySaver { | |||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
addToPanel({ selectedPanels, saveTitle, notifications, visId }) { | ||||||||||||||||||||||||||||||||
const uuidRx = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/; | ||||||||||||||||||||||||||||||||
const soPanels = selectedPanels.filter((id) => id.panel.id.match(uuidRx)); | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicate and unused variable? |
||||||||||||||||||||||||||||||||
const opsPanels = selectedPanels.filter((id) => !id.panel.id.match(uuidRx)); | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||
this.panelClient | ||||||||||||||||||||||||||||||||
.updateBulk({ | ||||||||||||||||||||||||||||||||
selectedCustomPanels: selectedPanels, | ||||||||||||||||||||||||||||||||
selectedCustomPanels: opsPanels, | ||||||||||||||||||||||||||||||||
savedVisualizationId: visId, | ||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||
.then((res: any) => { | ||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,9 +76,12 @@ export class SaveAsNewVisualization extends SavedQuerySaver { | |
} | ||
|
||
addToPanel({ selectedPanels, saveTitle, notifications, visId }) { | ||
const uuidRx = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar comments and probably define regex globally |
||
const soPanels = selectedPanels.filter((id) => id.panel.id.match(uuidRx)); | ||
const opsPanels = selectedPanels.filter((id) => !id.panel.id.match(uuidRx)); | ||
this.panelClient | ||
.updateBulk({ | ||
selectedCustomPanels: selectedPanels, | ||
selectedCustomPanels: opsPanels, | ||
savedVisualizationId: visId, | ||
}) | ||
.then((res: any) => { | ||
|
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.
delete savedobject should be in panel_slice. Therefore, we should collapse a reference and just call
dispatch(deletePanel)
(or whatever) directly from<CustomPanelViewSO>
. Dont' pass it in.We're trying to eliminate all prop-drilling, especially functions.
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 can modify this in a follow up PR