-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: fix blueprint operation inconsistency for zone #36980
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
Changes from all commits
311aae8
d7b7cf5
d36fa97
76a6df8
26279c8
8a385ee
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 |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ import log from "loglevel"; | |
| import { generateDefaultLayoutPreset } from "layoutSystems/anvil/layoutComponents/presets/DefaultLayoutPreset"; | ||
| import { addWidgetsToPreset } from "layoutSystems/anvil/utils/layouts/update/additionUtils"; | ||
| import { addNewAnvilWidgetToDSL } from "./helpers"; | ||
| import { klona } from "klona"; | ||
|
|
||
| // The suggested widget functionality allows users to bind data from the Query pane | ||
| // to a new or existing widget on the Canvas. | ||
|
|
@@ -109,7 +110,8 @@ export function* getUpdatedListOfWidgetsAfterAddingNewWidget( | |
| isSection: boolean, // Indicates if the drop zone is a section | ||
| ) { | ||
| const { alignment, canvasId } = highlight; | ||
| const allWidgets: CanvasWidgetsReduxState = yield select(getWidgets); | ||
| const allWidgetsFromRedux: CanvasWidgetsReduxState = yield select(getWidgets); | ||
| const allWidgets = klona(allWidgetsFromRedux) as CanvasWidgetsReduxState; | ||
|
Contributor
Author
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. @riodeuno Is this safe? The use case is aichatwidget wants to modify the parent zone's elevatedBackground to false. ( that code is written in aichatbot blueprint operation ).
Contributor
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. @jsartisan This is a problem because we will quickly lose track of where the original values were updated. Ideally, we should let the functions return what needs to be updated, then in this function we should use something like I'm not a 100% sure of what is happening in this PR, so I can't provide an alternative. Could you elaborate in the description on "how" we're going about changing the zone's
Contributor
Author
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. @riodeuno Updated the description. Let me know if you need more info. |
||
|
|
||
| const parentWidgetWithLayout = allWidgets[canvasId]; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ import { addNewAnvilWidgetToDSL } from "layoutSystems/anvil/integrations/sagas/a | |
| export function* createSectionAndAddWidget( | ||
| allWidgets: CanvasWidgetsReduxState, | ||
| highlight: AnvilHighlightInfo, | ||
| widgets: WidgetLayoutProps[], | ||
| draggedWidgets: WidgetLayoutProps[], | ||
|
Contributor
Author
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. used better contextual name to avoid confusion. |
||
| parentId: string, | ||
| ) { | ||
| /** | ||
|
|
@@ -48,7 +48,7 @@ export function* createSectionAndAddWidget( | |
| yield call( | ||
| addWidgetsToSection, | ||
| updatedWidgets, | ||
| widgets, | ||
| draggedWidgets, | ||
| highlight, | ||
| sectionProps, | ||
| ); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.