Skip to content

Add Components dynamic values ( props - attributes )#6351

Merged
artf merged 50 commits intodevfrom
components-dynamic-values
Dec 30, 2024
Merged

Add Components dynamic values ( props - attributes )#6351
artf merged 50 commits intodevfrom
components-dynamic-values

Conversation

@mohamedsalem401
Copy link
Contributor

@mohamedsalem401 mohamedsalem401 commented Dec 10, 2024

  • 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

@mohamedsalem401 mohamedsalem401 requested a review from artf December 23, 2024 04:12

private createPropertyUpdater() {
return (key: string, value: any) => {
this.component.set(key, value, { skipWatcherUpdates: false });
Copy link
Member

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.

Copy link
Member

@artf artf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 💜

@artf artf merged commit 21f51ae into dev Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants