Skip to content

Commit

Permalink
linting and changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
lagartoverde committed Aug 16, 2024
1 parent 33d31b6 commit a255765
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-dogs-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'frontend-gelinkt-notuleren': patch
---

Don't make unnecesary history changes when updating regulatory statements inside agendapoints
11 changes: 9 additions & 2 deletions app/components/editor-plugins/regulatory-statements/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ export default class ReadOnlyContentSectionComponent extends Component {
if (this.node.attrs.title !== this.currentVersion.title) {
this.args.updateAttribute('title', this.currentVersion.title);
}
if (this.node.attrs.oldContent !== this.currentVersion.htmlSafeContent.toString()) {
if (
this.node.attrs.oldContent !==
this.currentVersion.htmlSafeContent.toString()
) {
this.args.updateAttribute('content', this.currentVersion.htmlSafeContent);
} else {
this.args.updateAttribute('content', this.currentVersion.htmlSafeContent, true);
this.args.updateAttribute(
'content',
this.currentVersion.htmlSafeContent,
true,
);
}
}
get node() {
Expand Down
12 changes: 6 additions & 6 deletions app/editor-plugins/regulatory-statements-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const emberNodeConfig = {
resource: {},
title: { default: '' },
content: { default: '' },
oldContent: { default: ''}
oldContent: { default: '' },
},
toDOM: (node) => {
const parser = new DOMParser();
Expand All @@ -34,8 +34,8 @@ const emberNodeConfig = {
property: 'eli:related_to',
rev: 'dct:isPartOf',
typeof: 'besluitpublicatie:Documentonderdeel',
'data-rs-content': node.attrs['content'],
'data-rs-title': node.attrs['title']
'data-rs-content': node.attrs['content'],
'data-rs-title': node.attrs['title'],
},
['h5', {}, `Reglementaire bijlage: ${node.attrs['title']}`],
['div', {}, ...html.body.childNodes],
Expand All @@ -46,12 +46,12 @@ const emberNodeConfig = {
tag: 'div',
getAttrs(element) {
const oldContent = element.dataset.rsContent;
const title = element.dataset.rsTitle
const title = element.dataset.rsTitle;
if (element.dataset['emberNode'] === 'regulatory-statement-view') {
return {
resource: element.getAttribute('resource'),
oldContent,
title
title,
};
} else if (
element.dataset.inlineComponent ===
Expand All @@ -63,7 +63,7 @@ const emberNodeConfig = {
return {
resource: propsParsed['uri'],
oldContent,
title
title,
};
}
return false;
Expand Down

0 comments on commit a255765

Please sign in to comment.