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

WEBUI-1385-BACKPORT: Fix update of Template properties #2172

Conversation

alokhyland
Copy link
Contributor

No description provided.

@alokhyland alokhyland requested a review from a team as a code owner February 7, 2024 06:41
@alokhyland alokhyland requested review from MohinishSah and poonamyadav252 and removed request for MohinishSah and poonamyadav252 February 7, 2024 06:41
@alokhyland alokhyland changed the title WEBUI-1385: Fix update of Template properties WEBUI-1385-BACKPORT: Fix update of Template properties Feb 7, 2024
@alokhyland alokhyland force-pushed the fix-WEBUI-1385-BACKPORT-fix-update-of-template-properties branch from 39f8b43 to a9160f9 Compare February 21, 2024 09:29
@@ -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);
Copy link
Contributor

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

Copy link
Contributor Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Change name to originalDocument

Copy link
Contributor Author

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);
Copy link
Contributor

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

@alokhyland alokhyland force-pushed the fix-WEBUI-1385-BACKPORT-fix-update-of-template-properties branch 2 times, most recently from 6a4fd8f to 8e5bc04 Compare February 22, 2024 11:39
@rahuljain-dev rahuljain-dev force-pushed the fix-WEBUI-1385-BACKPORT-fix-update-of-template-properties branch 2 times, most recently from 4c8a35c to a9da972 Compare February 26, 2024 10:18
Nishant0928
Nishant0928 previously approved these changes Feb 27, 2024
this.set('editedDocument', this._parseJSON(this.document));
},

_findChangedValues(object1, object2) {
Copy link
Contributor

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.

@alokhyland alokhyland force-pushed the fix-WEBUI-1385-BACKPORT-fix-update-of-template-properties branch 2 times, most recently from 4153fad to ae57f55 Compare February 27, 2024 08:12
swarnadipa-dev
swarnadipa-dev previously approved these changes Feb 27, 2024
@alokhyland alokhyland force-pushed the fix-WEBUI-1385-BACKPORT-fix-update-of-template-properties branch from ae57f55 to 95d0530 Compare February 27, 2024 12:29
@Nishant0928 Nishant0928 self-requested a review February 28, 2024 06:25
@alokhyland alokhyland merged commit aa1770f into maintenance-3.0.x Mar 5, 2024
10 checks passed
@alokhyland alokhyland deleted the fix-WEBUI-1385-BACKPORT-fix-update-of-template-properties branch March 5, 2024 09:36
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.

4 participants