-
Notifications
You must be signed in to change notification settings - Fork 10
StoreRecord includes a getter to return a list of names for all modified fields #4011
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
base: develop
Are you sure you want to change the base?
Conversation
…ll modified fields
|
I should add - re the fix for #3927 - I expect we'll need to look at where the store is applying these modifications, and have it do a new comparison and potentially "reset" |
@amcclain I will pick up that second ticket and work on it as part of this PR (soon) |
…t equals - ensures changing then reverting a change shows the grid as clean
@amcclain Quick update to review. I see this working in the toolbox example, but it may be simpler than what is actually needed here. |
…ssues - record changes, record length changes, new records, etc
d5e16f5
to
d471485
Compare
@@ -72,7 +73,7 @@ export class StoreRecord { | |||
|
|||
/** True if the StoreRecord has been modified since it was last committed. */ | |||
get isDirty(): boolean { | |||
return this.committedData && this.committedData !== this.data; | |||
return this.committedData && !equal(this.committedData, this.data); | |||
} |
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.
A little concerned about the performance implications of this. For grids with many StoreRecords and wide StoreRecord this is an expensive operation.
@@ -705,7 +705,7 @@ export class Store extends HoistBase { | |||
/** True if the store has changes which need to be committed. */ | |||
@computed | |||
get isDirty(): boolean { | |||
return this._current !== this._committed; | |||
return !equal(this._current, this._committed); | |||
} |
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.
So there is a whole "normalization" step (see RecordSet.normalize) that is supposed to do this evaluation after every update to _current
and _committed
and keep them pointer equivalent. the fact that the getter is computed, might mean that this is an efficient way to have the same outcome, although I will say that one benefit of the normalization step is that it just frees up memory after an edit gets committed.
#3928
develop
branch as of last change.breaking-change
label + CHANGELOG if so.