-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Add Components dynamic values ( props - attributes ) #6351
Conversation
mohamedsalem401
commented
Dec 10, 2024
•
edited
Loading
edited
- Disable dynamic values for traits ( until we decide if we should keep it ) ( Update: we won't )
- Add dynamic values for props and attributes
- Add unit tests for both dynamic values for props and attributes
- Make traits dependent on component values for props and attributes
…nents-dynamic-values
…nents-dynamic-values
packages/core/test/specs/data_sources/dynamic_values/attributes.ts
Outdated
Show resolved
Hide resolved
packages/core/test/specs/data_sources/model/conditional_variables/ConditionalTraits.ts
Outdated
Show resolved
Hide resolved
packages/core/src/dom_components/model/ComponentDynamicValueListener.ts
Outdated
Show resolved
Hide resolved
.../test/specs/data_sources/model/conditional_variables/__snapshots__/ConditionalTraits.ts.snap
Outdated
Show resolved
Hide resolved
packages/core/src/dom_components/model/ComponentDynamicValueListener.ts
Outdated
Show resolved
Hide resolved
packages/core/test/specs/data_sources/dynamic_values/attributes.ts
Outdated
Show resolved
Hide resolved
|
||
private createPropertyUpdater() { | ||
return (key: string, value: any) => { | ||
this.component.set(key, value, { skipWatcherUpdates: false }); |
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 think when we update the component from data sources changes, we don't want this change to be counted as a dirty change and skip it from the undoManager (avoidStore
option should already handle both cases).
Probably DataSource itself could define if it needs to trigger the dirty change and if the change is undoable.
For example, a data source with external records (eg. REST API) could retrigger the fetch of all records on a specific interval. The editor would update components with new data but I'd not expect changes on the project data itself.
In case of static data source records (records stored in the project JSON), their update will trigger the dirty change and could be defined as an undoable action.
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 💜