Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

Merged
merged 50 commits into from
Dec 30, 2024

Conversation

mohamedsalem401
Copy link
Member

@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
packages/core/src/dom_components/model/Component.ts Outdated Show resolved Hide resolved

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
3 checks passed
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