-
Notifications
You must be signed in to change notification settings - Fork 61
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
WEBUI-1385-BACKPORT: Fix update of Template properties #2172
WEBUI-1385-BACKPORT: Fix update of Template properties #2172
Conversation
39f8b43
to
a9160f9
Compare
@@ -191,7 +192,8 @@ Polymer({ | |||
_documentChanged() { | |||
if (this.document) { | |||
this.set('document.properties.tmpl:templateType', this.document.properties['tmpl:templateType'] || 'auto'); | |||
this.set('editedDocument', JSON.parse(JSON.stringify(this.document))); | |||
this.set('editedDocument', this._parseJSON(this.document)); | |||
if (this.unmodifiedDocument === undefined) this.unmodifiedDocument = this._parseJSON(this.document); |
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.
Use ternary operator for this condition
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.
got lint issue if used ternary operator
@@ -175,6 +175,7 @@ Polymer({ | |||
type: String, | |||
value: 'view', | |||
}, | |||
unmodifiedDocument: Object, |
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.
Change name to originalDocument
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.
changed
delete this.editedDocument.properties['dc:contributors']; | ||
return this.$.doc.put(); | ||
const modified = this._parseJSON(this.editedDocument.properties); | ||
const org = this._parseJSON(this.unmodifiedDocument.properties); |
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.
Name should be meaningful. Change this to "orig" or "originalDocument"
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.
changed
6a4fd8f
to
8e5bc04
Compare
4c8a35c
to
a9da972
Compare
this.set('editedDocument', this._parseJSON(this.document)); | ||
}, | ||
|
||
_findChangedValues(object1, object2) { |
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.
please change object1, object2 parameter names to something that is understandable in context of the code.
4153fad
4153fad
to
ae57f55
Compare
ae57f55
to
95d0530
Compare
No description provided.