From 6159fb90e0c4154f596ab7e06a34be15be2270bc Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Fri, 4 Aug 2023 17:38:40 +0300 Subject: [PATCH 1/8] GN-4322: Snippet lists * Manage snippet lists connected to template * Show templates connected to snippet list in template view --- app/components/app-chrome.hbs | 1 + app/components/snippet-list-form.hbs | 29 ++++++++++++++++++- app/components/snippet-list-form.js | 6 ++-- .../regulatory-attachments/edit.js | 25 ++++++++++++++++ .../snippets-management/edit/edit-snippet.js | 9 ++++-- app/models/document-container.js | 2 ++ app/models/snippet-list-publication-task.js | 2 ++ app/models/snippet-list.js | 4 ++- app/routes/regulatory-attachments/edit.js | 1 + app/routes/snippets-management/edit.js | 7 +++-- .../snippets-management/edit/edit-snippet.js | 14 +++++---- app/styles/_shame.scss | 6 ++-- app/templates/regulatory-attachments/edit.hbs | 11 ++++++- .../snippets-management/edit/edit-snippet.hbs | 2 +- translations/en-us.yaml | 6 +++- translations/nl-BE.yaml | 6 +++- 16 files changed, 109 insertions(+), 22 deletions(-) diff --git a/app/components/app-chrome.hbs b/app/components/app-chrome.hbs index 3dd3ad97..3f7e9501 100644 --- a/app/components/app-chrome.hbs +++ b/app/components/app-chrome.hbs @@ -74,6 +74,7 @@ {{/if}} + {{yield to="leadingButtons"}} {{#if @save}} {{t "utility.save"}} {{/if}} diff --git a/app/components/snippet-list-form.hbs b/app/components/snippet-list-form.hbs index cf8db917..3ade182e 100644 --- a/app/components/snippet-list-form.hbs +++ b/app/components/snippet-list-form.hbs @@ -75,6 +75,33 @@ {{t "snippets.add-new-snippet"}} +
+ + {{t "snippets.template.heading"}} + + + + + {{t "snippets.template.table-header"}} + + + + + {{template.currentVersion.title}} + + + + + +
- \ No newline at end of file + \ No newline at end of file diff --git a/app/components/snippet-list-form.js b/app/components/snippet-list-form.js index 452f4e43..3dc3a78c 100644 --- a/app/components/snippet-list-form.js +++ b/app/components/snippet-list-form.js @@ -54,10 +54,10 @@ export default class SnippetListForm extends Component { await documentContainer.save(); await this.args.model.save(); - this.router.transitionTo( - 'snippets-management.edit.edit-snippet', + this.router.transitionTo('snippets-management.edit.edit-snippet', { documentContainer, - ); + snippetList: this.args.model, + }); }); removeSnippet = task(async () => { diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index a3a56d04..6326e664 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -78,6 +78,10 @@ export default class EditController extends Controller { @service intl; @service currentSession; @tracked citationPlugin = citationPlugin(this.config.citation); + @tracked assignedSnippetListsIds = + this.model.documentContainer.snippetLists + .toArray() + .map((snippetList) => snippetList.id) ?? []; schema = new Schema({ nodes: { @@ -279,4 +283,25 @@ export default class EditController extends Controller { await documentContainer.save(); this._editorDocument = editorDocument; }); + + setEditorDocumentSnippetLists = task(async (snippetIds) => { + if (!snippetIds || !snippetIds.length) { + this.model.documentContainer.snippetLists.setObjects([]); + this.assignedSnippetListsIds = []; + + return await this.model.documentContainer.save(); + } + + const snippetLists = await this.store.query('snippet-list', { + filter: { + ':id:': snippetIds.join(','), + }, + include: 'snippets', + }); + + this.assignedSnippetListsIds = snippetIds; + this.model.documentContainer.snippetLists.setObjects(snippetLists); + + await this.model.documentContainer.save(); + }); } diff --git a/app/controllers/snippets-management/edit/edit-snippet.js b/app/controllers/snippets-management/edit/edit-snippet.js index 57ebeb5a..89f73fda 100644 --- a/app/controllers/snippets-management/edit/edit-snippet.js +++ b/app/controllers/snippets-management/edit/edit-snippet.js @@ -244,7 +244,7 @@ export default class SnippetsManagementEditSnippetController extends Controller } currentVersion = trackedFunction(this, async () => { - return await this.model.currentVersion; + return await this.model.documentContainer.currentVersion; }); get editorDocument() { @@ -265,7 +265,7 @@ export default class SnippetsManagementEditSnippetController extends Controller editorDocument.previousVersion = currentVersion; await editorDocument.save(); - const documentContainer = this.model; + const documentContainer = this.model.documentContainer; documentContainer.currentVersion = editorDocument; await documentContainer.save(); @@ -273,19 +273,22 @@ export default class SnippetsManagementEditSnippetController extends Controller 'snippet-list-publication-task', ); publicationTask.documentContainer = documentContainer; + publicationTask.snippetList = this.model.snippetList; await publicationTask.save(); await this.muTask.waitForMuTaskTask.perform(publicationTask.id, 100); }); updateDocumentTitle = task(async () => { - const documentContainer = this.model; + const documentContainer = this.model.documentContainer; + const snippetList = this.model.snippetList; const publicationTask = this.store.createRecord( 'snippet-list-publication-task', ); publicationTask.documentContainer = documentContainer; + publicationTask.snippetList = snippetList; await publicationTask.save(); await this.muTask.waitForMuTaskTask.perform(publicationTask.id, 100); diff --git a/app/models/document-container.js b/app/models/document-container.js index aaf2c572..fd8c6596 100644 --- a/app/models/document-container.js +++ b/app/models/document-container.js @@ -19,4 +19,6 @@ export default class DocumentContainerModel extends Model { async: true, }) publishedSnippetVersion; + @hasMany('snippet-list', { inverse: 'templates', async: true }) + snippetLists; } diff --git a/app/models/snippet-list-publication-task.js b/app/models/snippet-list-publication-task.js index b9bc6bcb..bbd183e9 100644 --- a/app/models/snippet-list-publication-task.js +++ b/app/models/snippet-list-publication-task.js @@ -3,5 +3,7 @@ import Model, { attr, belongsTo } from '@ember-data/model'; export default class SnippetListPublicationTask extends Model { @belongsTo('document-container', { async: true, inverse: null }) documentContainer; + @belongsTo('snippet-list', { async: true, inverse: null }) + snippetList; @attr status; } diff --git a/app/models/snippet-list.js b/app/models/snippet-list.js index c7ff5616..6d6c6cdc 100644 --- a/app/models/snippet-list.js +++ b/app/models/snippet-list.js @@ -1,8 +1,10 @@ import Model, { attr, hasMany, belongsTo } from '@ember-data/model'; -export default class SkosConcept extends Model { +export default class SnippetList extends Model { @attr label; @attr('datetime') createdOn; @hasMany('document-container', { async: true, inverse: null }) snippets; + @hasMany('document-container', { async: true, inverse: 'snippetLists' }) + templates; @belongsTo('administrative-unit', { async: true, inverse: null }) publisher; } diff --git a/app/routes/regulatory-attachments/edit.js b/app/routes/regulatory-attachments/edit.js index 541c7bd4..839de33c 100644 --- a/app/routes/regulatory-attachments/edit.js +++ b/app/routes/regulatory-attachments/edit.js @@ -12,6 +12,7 @@ export default class EditRoute extends Route { const documentContainer = await this.store.findRecord( 'document-container', params.id, + { include: 'current-version,snippet-lists,snippet-lists.snippets' }, ); const documentId = (await documentContainer.currentVersion).id; const editorDocument = await this.store.findRecord( diff --git a/app/routes/snippets-management/edit.js b/app/routes/snippets-management/edit.js index a2493a73..73e4b9bd 100644 --- a/app/routes/snippets-management/edit.js +++ b/app/routes/snippets-management/edit.js @@ -5,10 +5,11 @@ export default class SnippetsManagementEditRoute extends Route { @service store; async model(params) { - let snippetList = await this.store.findRecord('snippet-list', params.id); - await snippetList.snippets; - return snippetList; + return await this.store.findRecord('snippet-list', params.id, { + include: 'snippets,templates,templates.current-version', + }); } + resetController(controller, isExiting, transition) { if (isExiting && transition.targetName !== 'error') { controller.model.rollbackAttributes(); diff --git a/app/routes/snippets-management/edit/edit-snippet.js b/app/routes/snippets-management/edit/edit-snippet.js index bf5f7bb1..8484f8c1 100644 --- a/app/routes/snippets-management/edit/edit-snippet.js +++ b/app/routes/snippets-management/edit/edit-snippet.js @@ -1,15 +1,19 @@ import Route from '@ember/routing/route'; import { service } from '@ember/service'; - +import { hash } from 'rsvp'; export default class SnippetsManagementEditSnippetRoute extends Route { @service store; @service session; async model(params) { - const container = await this.store.query('document-container', { - 'filter[id]': params.snippet_id, - include: 'current-version', + return hash({ + documentContainer: ( + await this.store.query('document-container', { + 'filter[id]': params.snippet_id, + include: 'current-version', + }) + )[0], + snippetList: this.modelFor('snippets-management.edit'), }); - return container[0]; } } diff --git a/app/styles/_shame.scss b/app/styles/_shame.scss index 345faba0..330117f9 100644 --- a/app/styles/_shame.scss +++ b/app/styles/_shame.scss @@ -85,7 +85,7 @@ .say-editor-hints { .au-c-card { margin-top: 10px; - + } .au-c-card__content { overflow: inherit; @@ -107,10 +107,12 @@ height: 50px; } -.snippets-table .au-c-data-table__actions--bottom { +.snippets-table .au-c-data-table__actions--bottom, +.snippet-list-template-table .au-c-data-table__actions--bottom, { display: none; } + [property='eli:title']:before { content: 'Document-titel' !important; } diff --git a/app/templates/regulatory-attachments/edit.hbs b/app/templates/regulatory-attachments/edit.hbs index fc9997d7..115df025 100644 --- a/app/templates/regulatory-attachments/edit.hbs +++ b/app/templates/regulatory-attachments/edit.hbs @@ -17,7 +17,15 @@ @returnRoute='list' @returnRouteText={{t 'reglement-edit.return'}} @isPublished={{this.model.reglement.publishedVersion}} - /> + > + <:leadingButtons> + + + {name} confirm-deletion-snippet: Confirm to delete snippet {name} delete: Delete snippet list delete-snippet: Delete snippet + template: + heading: Available in + table-header: Template + no-data: No templates connected to this snippet list attr: label: Label id: Id diff --git a/translations/nl-BE.yaml b/translations/nl-BE.yaml index e526ce04..301f7fcb 100644 --- a/translations/nl-BE.yaml +++ b/translations/nl-BE.yaml @@ -147,6 +147,10 @@ snippets: confirm-deletion-snippet: Bevestig om fragment {name} te verwijderen delete: Fragmentenlijst verwijderen delete-snippet: Fragment verwijderen + template: + heading: Beschikbaar in + table-header: Sjabloon + no-data: Geen sjablonen gekoppeld aan deze lijst met fragmenten attr: label: Label id: Id @@ -155,4 +159,4 @@ snippets: editor-document-title: placeholder: Naamloos document change-title: Titel wijzigen - title-saved: Titel opgeslagen \ No newline at end of file + title-saved: Titel opgeslagen From 2bb7c1edc7f11453d04c1a291486f8e5cbe54c8c Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Tue, 15 Aug 2023 15:27:14 +0300 Subject: [PATCH 2/8] GN-4322: Snippet lists * Manage snippet lists connected to template * Show templates connected to snippet list in template view --- .../regulatory-attachments/edit.js | 33 +++++++++++++------ app/templates/regulatory-attachments/edit.hbs | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index 6326e664..179ff889 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -78,16 +78,14 @@ export default class EditController extends Controller { @service intl; @service currentSession; @tracked citationPlugin = citationPlugin(this.config.citation); - @tracked assignedSnippetListsIds = - this.model.documentContainer.snippetLists - .toArray() - .map((snippetList) => snippetList.id) ?? []; + @tracked assignedSnippetListsIds = []; schema = new Schema({ nodes: { doc: docWithConfig({ content: 'table_of_contents? document_title? ((chapter|block)+|(title|block)+|(article|block)+)', + extraAttributes: { 'snippet-list-ids': { default: null } }, }), paragraph, document_title, @@ -213,7 +211,7 @@ export default class EditController extends Controller { interactive: true, }, snippet: { - endpoint: '/sparql', + endpoint: '/raw-sparql', }, }; } @@ -247,6 +245,7 @@ export default class EditController extends Controller { this.editor = editor; if (this.editorDocument.content) { editor.initialize(this.editorDocument.content); + this.assignedSnippetListsIds = this.documentSnippetListIds; } } @@ -284,12 +283,26 @@ export default class EditController extends Controller { this._editorDocument = editorDocument; }); - setEditorDocumentSnippetLists = task(async (snippetIds) => { + get documentSnippetListIds() { + return ( + this.editor + .getDocumentAttribute('snippet-list-ids') + ?.split(',') + .filter(Boolean) ?? [] + ); + } + + set documentSnippetListIds(snippetIds) { + this.editor.setDocumentAttribute('snippet-list-ids', snippetIds.join(',')); + this.assignedSnippetListsIds = snippetIds; + } + + setDocumentContainerSnippetLists = task(async (snippetIds) => { if (!snippetIds || !snippetIds.length) { + this.documentSnippetListIds = []; this.model.documentContainer.snippetLists.setObjects([]); - this.assignedSnippetListsIds = []; - return await this.model.documentContainer.save(); + return this.save.perform(); } const snippetLists = await this.store.query('snippet-list', { @@ -299,9 +312,9 @@ export default class EditController extends Controller { include: 'snippets', }); - this.assignedSnippetListsIds = snippetIds; + this.documentSnippetListIds = snippetIds; this.model.documentContainer.snippetLists.setObjects(snippetLists); - await this.model.documentContainer.save(); + return this.save.perform(); }); } diff --git a/app/templates/regulatory-attachments/edit.hbs b/app/templates/regulatory-attachments/edit.hbs index 115df025..ebe5eab2 100644 --- a/app/templates/regulatory-attachments/edit.hbs +++ b/app/templates/regulatory-attachments/edit.hbs @@ -21,7 +21,7 @@ <:leadingButtons> From 0b92e7716d22a62e5e5e4b5e0fa31a005f7037bd Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Tue, 22 Aug 2023 09:47:03 +0300 Subject: [PATCH 3/8] GN-4322: Bump packages --- package-lock.json | 43 ++++++++++++++++++++++++++++++++----------- package.json | 4 ++-- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1643c21a..065db15a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,8 +28,8 @@ "@lblod/ember-acmidm-login": "^2.0.0-beta.1", "@lblod/ember-environment-banner": "^0.2.0", "@lblod/ember-mock-login": "^0.7.0", - "@lblod/ember-rdfa-editor": "^4.2.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "^10.0.0", + "@lblod/ember-rdfa-editor": "^5.0.0", + "@lblod/ember-rdfa-editor-lblod-plugins": "^11.0.0", "@release-it-plugins/lerna-changelog": "^6.0.0", "broccoli-asset-rev": "^3.0.0", "ember-auto-import": "^2.4.3", @@ -4229,9 +4229,9 @@ } }, "node_modules/@lblod/ember-rdfa-editor": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor/-/ember-rdfa-editor-4.2.0.tgz", - "integrity": "sha512-giWDvGvk2UrwsViE5E+zyPEKAgPfb6YxrdNhb7NJ32w/t+n4Sv08b8IpVMDVbY25dJJuhxxJTNM+VreTc30TDQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor/-/ember-rdfa-editor-5.0.0.tgz", + "integrity": "sha512-fJLRsThsGjhR0X/FHMXVw1UEDr2TGw3oqlA/kaualbqR5Slze/VelxhdYb2U641g/hsRXTQZBTBr7t4aluFQ+w==", "dev": true, "dependencies": { "@codemirror/lang-html": "^6.1.1", @@ -4243,7 +4243,7 @@ "@ember/render-modifiers": "^2.0.5", "@glimmer/tracking": "^1.1.2", "@graphy/memory.dataset.fast": "4.3.3", - "@guardian/prosemirror-invisibles": "git+ssh://git@github.com/lblod/prosemirror-invisibles.git", + "@guardian/prosemirror-invisibles": "git+https://git@github.com/lblod/prosemirror-invisibles.git", "@lblod/marawa": "^0.8.0-beta.2", "@types/diff-match-patch": "^1.0.32", "codemirror": "^6.0.1", @@ -4301,9 +4301,9 @@ } }, "node_modules/@lblod/ember-rdfa-editor-lblod-plugins": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-10.0.0.tgz", - "integrity": "sha512-tK3oGc+hYKHdD5ZLECsRgtLurmbNk2RcaOqTiNbfcQC5VGg5odW6m6SgmcY/sWPikg6tItz8n/71F4hQQmJ6WQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-11.0.0.tgz", + "integrity": "sha512-0Dwc8fyeCVAJGugdL0pBHad+Eb6qlI1CcoXg8b+jOGAjijqOFl/28cSrnogvBkoHcNE3D9PDjrNizNWddFce2A==", "dev": true, "dependencies": { "@codemirror/lang-html": "^6.4.3", @@ -4335,7 +4335,7 @@ "rdf-validate-shacl": "^0.4.5", "stream-browserify": "^3.0.0", "tracked-built-ins": "^3.1.0", - "tracked-toolbox": "^1.2.3", + "tracked-toolbox": "^2.0.0", "uuid": "^9.0.0" }, "engines": { @@ -4343,7 +4343,7 @@ }, "peerDependencies": { "@appuniversum/ember-appuniversum": "^2.4.2", - "@lblod/ember-rdfa-editor": "^4.2.0", + "@lblod/ember-rdfa-editor": "^5.0.0", "ember-concurrency": "^2.3.7" } }, @@ -4826,6 +4826,27 @@ "node": ">=8" } }, + "node_modules/@lblod/ember-rdfa-editor-lblod-plugins/node_modules/tracked-toolbox": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tracked-toolbox/-/tracked-toolbox-2.0.0.tgz", + "integrity": "sha512-adZtX+RGN6F+pWs/5JqVuDxLhuia4uhqmQp+UlUaxpykWjDFETtAdQR+LdDJiFPXFAXnS6FBqn/tnSLJQCm3Yw==", + "dev": true, + "dependencies": { + "@embroider/addon-shim": "^1.6.0", + "ember-cache-primitive-polyfill": "^1.0.0" + }, + "engines": { + "node": "14.* || 16.* || >= 18" + }, + "peerDependencies": { + "ember-source": "*" + }, + "peerDependenciesMeta": { + "ember-source": { + "optional": true + } + } + }, "node_modules/@lblod/ember-rdfa-editor-lblod-plugins/node_modules/walk-sync": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-2.2.0.tgz", diff --git a/package.json b/package.json index 3bbd7c61..971a9c8c 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,8 @@ "@lblod/ember-acmidm-login": "^2.0.0-beta.1", "@lblod/ember-environment-banner": "^0.2.0", "@lblod/ember-mock-login": "^0.7.0", - "@lblod/ember-rdfa-editor": "^4.2.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "^10.0.0", + "@lblod/ember-rdfa-editor": "^5.0.0", + "@lblod/ember-rdfa-editor-lblod-plugins": "^11.0.0", "@release-it-plugins/lerna-changelog": "^6.0.0", "broccoli-asset-rev": "^3.0.0", "ember-auto-import": "^2.4.3", From e046a52cb04ab1d376173b167df2eb4dd65237de Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Tue, 22 Aug 2023 09:47:13 +0300 Subject: [PATCH 4/8] GN-4322: Change default endpoint to `/sparql` --- app/controllers/regulatory-attachments/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index 179ff889..cda63dc4 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -211,7 +211,7 @@ export default class EditController extends Controller { interactive: true, }, snippet: { - endpoint: '/raw-sparql', + endpoint: '/sparql', }, }; } From 843419a810ff693cd1fc156af1ed367600afba3f Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Tue, 22 Aug 2023 13:38:33 +0300 Subject: [PATCH 5/8] GN-4322: Extract `snippet-list-ids` to const --- app/controllers/regulatory-attachments/edit.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index cda63dc4..4f949646 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -69,6 +69,9 @@ import { templateCommentView, } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/template-comments-plugin'; import { docWithConfig } from '@lblod/ember-rdfa-editor/nodes/doc'; + +const SNIPPET_LISTS_IDS_DOCUMENT_ATTRIBUTE = 'snippet-list-ids'; + export default class EditController extends Controller { @service store; @service router; @@ -85,7 +88,9 @@ export default class EditController extends Controller { doc: docWithConfig({ content: 'table_of_contents? document_title? ((chapter|block)+|(title|block)+|(article|block)+)', - extraAttributes: { 'snippet-list-ids': { default: null } }, + extraAttributes: { + [SNIPPET_LISTS_IDS_DOCUMENT_ATTRIBUTE]: { default: null }, + }, }), paragraph, document_title, @@ -286,14 +291,17 @@ export default class EditController extends Controller { get documentSnippetListIds() { return ( this.editor - .getDocumentAttribute('snippet-list-ids') + .getDocumentAttribute(SNIPPET_LISTS_IDS_DOCUMENT_ATTRIBUTE) ?.split(',') .filter(Boolean) ?? [] ); } set documentSnippetListIds(snippetIds) { - this.editor.setDocumentAttribute('snippet-list-ids', snippetIds.join(',')); + this.editor.setDocumentAttribute( + SNIPPET_LISTS_IDS_DOCUMENT_ATTRIBUTE, + snippetIds.join(','), + ); this.assignedSnippetListsIds = snippetIds; } From ae693ab19d785649a495f36cd01de63b6abc858d Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Tue, 22 Aug 2023 15:12:52 +0300 Subject: [PATCH 6/8] GN-4322: Add sorting --- app/controllers/regulatory-attachments/edit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index 4f949646..e7a9687d 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -318,6 +318,7 @@ export default class EditController extends Controller { ':id:': snippetIds.join(','), }, include: 'snippets', + sort: 'created-on', }); this.documentSnippetListIds = snippetIds; From 8c91cfb6f5744599c6e0795365fd729cf78797fe Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Wed, 23 Aug 2023 18:03:38 +0300 Subject: [PATCH 7/8] GN-4322: Query `raw-sparql` for snippets --- app/controllers/regulatory-attachments/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index e7a9687d..e79273e3 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -216,7 +216,7 @@ export default class EditController extends Controller { interactive: true, }, snippet: { - endpoint: '/sparql', + endpoint: '/raw-sparql', }, }; } From 0280a6d850db50f761ca562683fa4744dd2b6e4e Mon Sep 17 00:00:00 2001 From: Deniss Kozickis Date: Wed, 23 Aug 2023 18:13:11 +0300 Subject: [PATCH 8/8] GN-4322: Remove sorting --- app/controllers/regulatory-attachments/edit.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/regulatory-attachments/edit.js b/app/controllers/regulatory-attachments/edit.js index e79273e3..6a280e79 100644 --- a/app/controllers/regulatory-attachments/edit.js +++ b/app/controllers/regulatory-attachments/edit.js @@ -318,7 +318,6 @@ export default class EditController extends Controller { ':id:': snippetIds.join(','), }, include: 'snippets', - sort: 'created-on', }); this.documentSnippetListIds = snippetIds;