From a57beb5e2ecf87e5c19f69e3099989cf62a8344f Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 12 Dec 2024 11:09:46 +0100 Subject: [PATCH 1/5] Add copy parts to the agendapoint --- app/controllers/agendapoints/copy.js | 18 ++++++++++ app/router.js | 1 + app/routes/agendapoints/copy.js | 14 ++++++++ app/templates/agendapoints/copy.hbs | 50 ++++++++++++++++++++++++++++ app/templates/agendapoints/edit.hbs | 4 +++ translations/en-us.yaml | 2 ++ translations/nl-BE.yaml | 2 ++ 7 files changed, 91 insertions(+) create mode 100644 app/controllers/agendapoints/copy.js create mode 100644 app/routes/agendapoints/copy.js create mode 100644 app/templates/agendapoints/copy.hbs diff --git a/app/controllers/agendapoints/copy.js b/app/controllers/agendapoints/copy.js new file mode 100644 index 000000000..5d567aafa --- /dev/null +++ b/app/controllers/agendapoints/copy.js @@ -0,0 +1,18 @@ +import Controller from '@ember/controller'; +import { action } from '@ember/object'; +import { htmlSafe } from '@ember/template'; +import { generateExportTextFromEditorDocument } from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document'; +import { copyStringToClipboard } from 'frontend-gelinkt-notuleren/utils/copy-string-to-clipboard'; + +export default class MeetingsDownloadCopyController extends Controller { + @action + async copyToClipboard(text) { + await copyStringToClipboard({ html: text }); + } + + get previewDocument() { + return htmlSafe( + generateExportTextFromEditorDocument(this.model.document, true), + ); + } +} diff --git a/app/router.js b/app/router.js index dfd852279..43941b615 100644 --- a/app/router.js +++ b/app/router.js @@ -51,6 +51,7 @@ Router.map(function () { this.route('attachments'); this.route('show'); this.route('revisions'); + this.route('copy'); }); this.route('meetings', function () { diff --git a/app/routes/agendapoints/copy.js b/app/routes/agendapoints/copy.js new file mode 100644 index 000000000..ada6124df --- /dev/null +++ b/app/routes/agendapoints/copy.js @@ -0,0 +1,14 @@ +import Route from '@ember/routing/route'; +import { service } from '@ember/service'; + +export default class MeetingsDownloadCopyRoute extends Route { + @service store; + async model(params) { + const { documentContainer, returnToMeeting } = + this.modelFor('agendapoints'); + const document = await documentContainer.currentVersion; + console.log(document); + console.log(documentContainer); + return { container: documentContainer, document }; + } +} diff --git a/app/templates/agendapoints/copy.hbs b/app/templates/agendapoints/copy.hbs new file mode 100644 index 000000000..9b577d614 --- /dev/null +++ b/app/templates/agendapoints/copy.hbs @@ -0,0 +1,50 @@ +
+ + + + + {{t 'agendapoint.back-to-agendapoint'}} + + {{t 'copy-options.heading'}} + {{@model.document.title}} + + +
+ + + + + + {{t 'copy-options.heading'}} + {{@model.document.title}} + + + + + + +

{{t + 'copy-options.disclaimer' + }}

+
+ +
+
+
\ No newline at end of file diff --git a/app/templates/agendapoints/edit.hbs b/app/templates/agendapoints/edit.hbs index 22142aa39..734e465a1 100644 --- a/app/templates/agendapoints/edit.hbs +++ b/app/templates/agendapoints/edit.hbs @@ -36,6 +36,10 @@ @document={{this.editorDocument}} @forPublish={{true}} /> + + + {{t 'agendapoint.copy-parts-link'}} + Date: Thu, 12 Dec 2024 11:32:40 +0100 Subject: [PATCH 2/5] linting and changeset --- .changeset/quiet-news-compete.md | 5 +++++ app/routes/agendapoints/copy.js | 7 ++----- app/templates/agendapoints/copy.hbs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .changeset/quiet-news-compete.md diff --git a/.changeset/quiet-news-compete.md b/.changeset/quiet-news-compete.md new file mode 100644 index 000000000..a5a3c3f70 --- /dev/null +++ b/.changeset/quiet-news-compete.md @@ -0,0 +1,5 @@ +--- +'frontend-gelinkt-notuleren': minor +--- + +Add copy parts link to the agendapoint file options diff --git a/app/routes/agendapoints/copy.js b/app/routes/agendapoints/copy.js index ada6124df..d54e75cd0 100644 --- a/app/routes/agendapoints/copy.js +++ b/app/routes/agendapoints/copy.js @@ -3,12 +3,9 @@ import { service } from '@ember/service'; export default class MeetingsDownloadCopyRoute extends Route { @service store; - async model(params) { - const { documentContainer, returnToMeeting } = - this.modelFor('agendapoints'); + async model() { + const { documentContainer } = this.modelFor('agendapoints'); const document = await documentContainer.currentVersion; - console.log(document); - console.log(documentContainer); return { container: documentContainer, document }; } } diff --git a/app/templates/agendapoints/copy.hbs b/app/templates/agendapoints/copy.hbs index 9b577d614..72f60e63b 100644 --- a/app/templates/agendapoints/copy.hbs +++ b/app/templates/agendapoints/copy.hbs @@ -7,7 +7,7 @@ - {{t 'agendapoint.back-to-agendapoint'}} + {{t 'agendapoint.back-to-agendapoint'}} {{t 'copy-options.heading'}} {{@model.document.title}} From 189f366dd33f5687d9f56d8a98c84379a01c8e41 Mon Sep 17 00:00:00 2001 From: Oscar Date: Mon, 23 Dec 2024 11:43:34 +0100 Subject: [PATCH 3/5] move shared code to component --- app/components/decision-copy.gjs | 71 +++++++++++++++++++++++ app/controllers/agendapoints/copy.js | 17 +----- app/controllers/meetings/download/copy.js | 17 +----- app/templates/agendapoints/copy.hbs | 53 +++-------------- app/templates/meetings/download/copy.hbs | 53 +++-------------- 5 files changed, 89 insertions(+), 122 deletions(-) create mode 100644 app/components/decision-copy.gjs diff --git a/app/components/decision-copy.gjs b/app/components/decision-copy.gjs new file mode 100644 index 000000000..e81c67b6a --- /dev/null +++ b/app/components/decision-copy.gjs @@ -0,0 +1,71 @@ +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { htmlSafe } from '@ember/template'; +import { generateExportTextFromEditorDocument } from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document'; +import { copyStringToClipboard } from 'frontend-gelinkt-notuleren/utils/copy-string-to-clipboard'; +import AuToolbar from '@appuniversum/ember-appuniversum/components/au-toolbar'; +import AuMainContainer from '@appuniversum/ember-appuniversum/components/au-main-container'; +import AuHeading from '@appuniversum/ember-appuniversum/components/au-heading'; +import DownloadMeetingPart from './download-meeting-part'; +import DecisionCopyParts from './decision-copy-parts'; +import t from 'ember-intl/helpers/t'; +export default class DecisionCopy extends Component { + @action + async copyToClipboard(text) { + await copyStringToClipboard({ html: text }); + } + + get previewDocument() { + return htmlSafe( + generateExportTextFromEditorDocument(this.model.document, true), + ); + } + + +} diff --git a/app/controllers/agendapoints/copy.js b/app/controllers/agendapoints/copy.js index 5d567aafa..f24984f44 100644 --- a/app/controllers/agendapoints/copy.js +++ b/app/controllers/agendapoints/copy.js @@ -1,18 +1,3 @@ import Controller from '@ember/controller'; -import { action } from '@ember/object'; -import { htmlSafe } from '@ember/template'; -import { generateExportTextFromEditorDocument } from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document'; -import { copyStringToClipboard } from 'frontend-gelinkt-notuleren/utils/copy-string-to-clipboard'; -export default class MeetingsDownloadCopyController extends Controller { - @action - async copyToClipboard(text) { - await copyStringToClipboard({ html: text }); - } - - get previewDocument() { - return htmlSafe( - generateExportTextFromEditorDocument(this.model.document, true), - ); - } -} +export default class MeetingsDownloadCopyController extends Controller {} diff --git a/app/controllers/meetings/download/copy.js b/app/controllers/meetings/download/copy.js index 8c98c43fb..f24984f44 100644 --- a/app/controllers/meetings/download/copy.js +++ b/app/controllers/meetings/download/copy.js @@ -1,18 +1,3 @@ import Controller from '@ember/controller'; -import { action } from '@ember/object'; -import { htmlSafe } from '@ember/template'; -import { generateExportTextFromEditorDocument } from '../../../utils/generate-export-from-editor-document'; -import { copyStringToClipboard } from '../../../utils/copy-string-to-clipboard'; -export default class MeetingsDownloadCopyController extends Controller { - @action - async copyToClipboard(text) { - await copyStringToClipboard({ html: text }); - } - - get previewDocument() { - return htmlSafe( - generateExportTextFromEditorDocument(this.model.document, true), - ); - } -} +export default class MeetingsDownloadCopyController extends Controller {} diff --git a/app/templates/agendapoints/copy.hbs b/app/templates/agendapoints/copy.hbs index 72f60e63b..35affeab1 100644 --- a/app/templates/agendapoints/copy.hbs +++ b/app/templates/agendapoints/copy.hbs @@ -1,50 +1,13 @@ -
- - - + + <:links> + {{t 'agendapoint.back-to-agendapoint'}} {{t 'copy-options.heading'}} {{@model.document.title}} - - -
- - - - - - {{t 'copy-options.heading'}} - {{@model.document.title}} - - - - - - -

{{t - 'copy-options.disclaimer' - }}

-
- -
-
-
\ No newline at end of file + + \ No newline at end of file diff --git a/app/templates/meetings/download/copy.hbs b/app/templates/meetings/download/copy.hbs index 02ad2553d..5710a5b0f 100644 --- a/app/templates/meetings/download/copy.hbs +++ b/app/templates/meetings/download/copy.hbs @@ -1,11 +1,9 @@ -
- - - + <:links> + {{t 'copy-options.heading'}} {{@model.document.title}} - - -
- - - - - - {{t 'copy-options.heading'}} - {{@model.document.title}} - - - - - - -

{{t - 'copy-options.disclaimer' - }}

-
- -
-
-
\ No newline at end of file + + \ No newline at end of file From 402d29935cb15c8eb4e59e31ad0aa9800417d76e Mon Sep 17 00:00:00 2001 From: Oscar Date: Mon, 23 Dec 2024 11:49:41 +0100 Subject: [PATCH 4/5] prettier --- app/templates/agendapoints/copy.hbs | 15 ++++----- app/templates/meetings/download/copy.hbs | 41 +++++++++++------------- 2 files changed, 25 insertions(+), 31 deletions(-) diff --git a/app/templates/agendapoints/copy.hbs b/app/templates/agendapoints/copy.hbs index 35affeab1..baebcbbdc 100644 --- a/app/templates/agendapoints/copy.hbs +++ b/app/templates/agendapoints/copy.hbs @@ -1,13 +1,10 @@ - + <:links> - - {{t 'agendapoint.back-to-agendapoint'}} - - {{t 'copy-options.heading'}} - {{@model.document.title}} + + {{t 'agendapoint.back-to-agendapoint'}} + + {{t 'copy-options.heading'}} + {{@model.document.title}} \ No newline at end of file diff --git a/app/templates/meetings/download/copy.hbs b/app/templates/meetings/download/copy.hbs index 5710a5b0f..e42e0590a 100644 --- a/app/templates/meetings/download/copy.hbs +++ b/app/templates/meetings/download/copy.hbs @@ -1,26 +1,23 @@ - + <:links> - {{t 'download.back-to-meeting'}} - - - {{t 'download.back-to-download'}} - - {{t 'copy-options.heading'}} - {{@model.document.title}} + @route='meetings.edit' + @model={{@model.zitting.id}} + @skin='secondary' + @icon='arrow-left' + @iconAlignment='left' + > + {{t 'download.back-to-meeting'}} + + + {{t 'download.back-to-download'}} + + {{t 'copy-options.heading'}} + {{@model.document.title}} \ No newline at end of file From 7dba367309544aeace2f8ae89769875ca721c846 Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 2 Jan 2025 11:12:22 +0100 Subject: [PATCH 5/5] cleanup --- app/controllers/agendapoints/copy.js | 3 --- app/controllers/meetings/download/copy.js | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 app/controllers/agendapoints/copy.js delete mode 100644 app/controllers/meetings/download/copy.js diff --git a/app/controllers/agendapoints/copy.js b/app/controllers/agendapoints/copy.js deleted file mode 100644 index f24984f44..000000000 --- a/app/controllers/agendapoints/copy.js +++ /dev/null @@ -1,3 +0,0 @@ -import Controller from '@ember/controller'; - -export default class MeetingsDownloadCopyController extends Controller {} diff --git a/app/controllers/meetings/download/copy.js b/app/controllers/meetings/download/copy.js deleted file mode 100644 index f24984f44..000000000 --- a/app/controllers/meetings/download/copy.js +++ /dev/null @@ -1,3 +0,0 @@ -import Controller from '@ember/controller'; - -export default class MeetingsDownloadCopyController extends Controller {}