From 370cc7311b11ef4fb034d8c6fa6ac0b2537be257 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Tue, 1 Nov 2022 22:10:27 +0100 Subject: [PATCH 01/44] refactor: rename breadCrumb to breadcrumb in routes --- app/routes/activities/destroy.js | 2 +- app/routes/activities/edit.js | 2 +- app/routes/activities/generate-alias.js | 2 +- app/routes/activities/ical.js | 2 +- app/routes/activities/index.js | 2 +- app/routes/activities/new.js | 2 +- app/routes/activities/print-enrolled.js | 2 +- app/routes/activities/show.js | 2 +- app/routes/article-comments/destroy.js | 2 +- app/routes/articles/destroy.js | 2 +- app/routes/articles/edit.js | 2 +- app/routes/articles/index.js | 2 +- app/routes/articles/new.js | 2 +- app/routes/articles/show.js | 2 +- app/routes/books/destroy.js | 2 +- app/routes/books/edit.js | 2 +- app/routes/books/index.js | 2 +- app/routes/books/new.js | 2 +- app/routes/books/show.js | 2 +- app/routes/debit.js | 2 +- app/routes/debit/collections/destroy.js | 2 +- app/routes/debit/collections/edit.js | 2 +- app/routes/debit/collections/index.js | 2 +- app/routes/debit/collections/new.js | 2 +- app/routes/debit/collections/sepa.js | 2 +- app/routes/debit/collections/show.js | 2 +- app/routes/debit/mandates/edit.js | 2 +- app/routes/debit/mandates/index.js | 2 +- app/routes/debit/mandates/new.js | 2 +- app/routes/debit/mandates/show.js | 2 +- app/routes/debit/transactions/destroy.js | 2 +- app/routes/debit/transactions/edit.js | 2 +- app/routes/form.js | 2 +- app/routes/form/responses.js | 2 +- app/routes/form/responses/destroy.js | 2 +- app/routes/forum/categories.js | 2 +- app/routes/forum/categories/category.js | 2 +- app/routes/forum/categories/category/destroy.js | 2 +- app/routes/forum/categories/category/edit.js | 2 +- app/routes/forum/categories/category/threads.js | 2 +- app/routes/forum/categories/category/threads/index.js | 2 +- app/routes/forum/categories/category/threads/new.js | 2 +- app/routes/forum/categories/category/threads/thread.js | 2 +- app/routes/forum/categories/category/threads/thread/destroy.js | 2 +- app/routes/forum/categories/category/threads/thread/edit.js | 2 +- app/routes/forum/categories/category/threads/thread/posts.js | 2 +- .../forum/categories/category/threads/thread/posts/destroy.js | 2 +- .../forum/categories/category/threads/thread/posts/edit.js | 2 +- .../forum/categories/category/threads/thread/posts/index.js | 2 +- app/routes/forum/categories/index.js | 2 +- app/routes/forum/categories/new.js | 2 +- app/routes/groups/edit.js | 2 +- app/routes/groups/export.js | 2 +- app/routes/groups/index.js | 2 +- app/routes/groups/new.js | 2 +- app/routes/groups/show.js | 2 +- app/routes/mail-aliases/destroy.js | 2 +- app/routes/mail-aliases/edit.js | 2 +- app/routes/mail-aliases/index.js | 2 +- app/routes/mail-aliases/new.js | 2 +- app/routes/mail-aliases/show.js | 2 +- app/routes/mail-moderations/accept.js | 2 +- app/routes/mail-moderations/destroy.js | 2 +- app/routes/mail-moderations/index.js | 2 +- app/routes/mail-moderations/reject.js | 2 +- app/routes/mail-moderations/show.js | 2 +- app/routes/photo-albums.js | 2 +- app/routes/photo-albums/index.js | 2 +- app/routes/photo-albums/new.js | 2 +- app/routes/photo-albums/photo-album.js | 2 +- app/routes/photo-albums/photo-album/destroy.js | 2 +- app/routes/photo-albums/photo-album/edit.js | 2 +- app/routes/photo-albums/photo-album/photos.js | 2 +- app/routes/photo-albums/photo-album/photos/destroy.js | 2 +- app/routes/photo-albums/photo-album/photos/index.js | 2 +- app/routes/photo-albums/photo-album/photos/show.js | 2 +- app/routes/photo-comments/destroy.js | 2 +- app/routes/photo-comments/index.js | 2 +- app/routes/polls/destroy.js | 2 +- app/routes/polls/edit.js | 2 +- app/routes/polls/index.js | 2 +- app/routes/polls/new.js | 2 +- app/routes/polls/show.js | 2 +- app/routes/quickpost.js | 2 +- app/routes/sog/index.js | 2 +- app/routes/sog/name-trainer.js | 2 +- app/routes/static-pages/destroy.js | 2 +- app/routes/static-pages/edit.js | 2 +- app/routes/static-pages/index.js | 2 +- app/routes/static-pages/new.js | 2 +- app/routes/static-pages/show.js | 2 +- app/routes/users/batch.js | 2 +- app/routes/users/batch/new.js | 2 +- app/routes/users/destroy.js | 2 +- app/routes/users/edit.js | 2 +- app/routes/users/index.js | 2 +- app/routes/users/members.js | 2 +- app/routes/users/new.js | 2 +- app/routes/users/resend-activation.js | 2 +- app/routes/users/show.js | 2 +- app/routes/users/webdav.js | 2 +- 101 files changed, 101 insertions(+), 101 deletions(-) diff --git a/app/routes/activities/destroy.js b/app/routes/activities/destroy.js index 952f24c72..88566341a 100644 --- a/app/routes/activities/destroy.js +++ b/app/routes/activities/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyActivityRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Activiteit verwijderen' }; + breadcrumb = { title: 'Activiteit verwijderen' }; canAccess() { return this.abilities.can('destroy activities'); diff --git a/app/routes/activities/edit.js b/app/routes/activities/edit.js index 1a8845f1e..8cd8c0647 100644 --- a/app/routes/activities/edit.js +++ b/app/routes/activities/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EdityActivityRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Activiteit aanpassen' }; + breadcrumb = { title: 'Activiteit aanpassen' }; canAccess(model) { return this.abilities.can('edit activity', model); diff --git a/app/routes/activities/generate-alias.js b/app/routes/activities/generate-alias.js index cb4ff2e1d..96f0aa0e6 100644 --- a/app/routes/activities/generate-alias.js +++ b/app/routes/activities/generate-alias.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class GenerateAliasRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Creëer mailalias' }; + breadcrumb = { title: 'Creëer mailalias' }; canAccess(model) { return this.abilities.can('generate alias for activity', model); diff --git a/app/routes/activities/ical.js b/app/routes/activities/ical.js index 87aeea0ec..d836dd3bc 100644 --- a/app/routes/activities/ical.js +++ b/app/routes/activities/ical.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class IcalRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Agenda Ical' }; + breadcrumb = { title: 'Agenda Ical' }; canAccess() { return this.abilities.can('show ical activities'); diff --git a/app/routes/activities/index.js b/app/routes/activities/index.js index 664764953..2d1ad66ae 100644 --- a/app/routes/activities/index.js +++ b/app/routes/activities/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ActivityIndexRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Activiteiten' }; + breadcrumb = { title: 'Activiteiten' }; queryParams = { search: { diff --git a/app/routes/activities/new.js b/app/routes/activities/new.js index 29220c9c8..516f5a6f2 100644 --- a/app/routes/activities/new.js +++ b/app/routes/activities/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewActivityRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Activiteit aanmaken' }; + breadcrumb = { title: 'Activiteit aanmaken' }; canAccess() { return this.abilities.can('create activities'); diff --git a/app/routes/activities/print-enrolled.js b/app/routes/activities/print-enrolled.js index 9b971600e..45498dcf6 100644 --- a/app/routes/activities/print-enrolled.js +++ b/app/routes/activities/print-enrolled.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class PrintEnrolledRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Print inschrijvingen/streeplijst' }; + breadcrumb = { title: 'Print inschrijvingen/streeplijst' }; canAccess(model) { return this.abilities.can('edit activity', model); diff --git a/app/routes/activities/show.js b/app/routes/activities/show.js index 611ecac2f..a6c98feff 100644 --- a/app/routes/activities/show.js +++ b/app/routes/activities/show.js @@ -11,7 +11,7 @@ export default class ShowActivityRoute extends AuthenticatedRoute { this.formLoadOrCreateUtil = new FormLoadOrCreateUtil(this); } - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.activity.title }; } diff --git a/app/routes/article-comments/destroy.js b/app/routes/article-comments/destroy.js index 858e095ab..75caa8be3 100644 --- a/app/routes/article-comments/destroy.js +++ b/app/routes/article-comments/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyArticleCommentRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Artikel comment verwijderen' }; + breadcrumb = { title: 'Artikel comment verwijderen' }; canAccess() { return this.abilities.can('destroy article-comments'); diff --git a/app/routes/articles/destroy.js b/app/routes/articles/destroy.js index 95193a0e8..62f5623d2 100644 --- a/app/routes/articles/destroy.js +++ b/app/routes/articles/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyArticleRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Artikel verwijderen' }; + breadcrumb = { title: 'Artikel verwijderen' }; canAccess() { return this.abilities.can('destroy articles'); diff --git a/app/routes/articles/edit.js b/app/routes/articles/edit.js index 08c9970a4..419fb892a 100644 --- a/app/routes/articles/edit.js +++ b/app/routes/articles/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditArticleRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Activiteit aanpassen' }; + breadcrumb = { title: 'Activiteit aanpassen' }; canAccess(model) { return this.abilities.can('edit article', model); diff --git a/app/routes/articles/index.js b/app/routes/articles/index.js index baa92ee31..0ffc5d709 100644 --- a/app/routes/articles/index.js +++ b/app/routes/articles/index.js @@ -5,7 +5,7 @@ import { inject as service } from '@ember/service'; export default class ArticlesIndexRoute extends ApplicationRoute { @service intl; - get breadCrumb() { + get breadcrumb() { return { title: capitalize(this.intl.t('model.article.name.other').toString()), }; diff --git a/app/routes/articles/new.js b/app/routes/articles/new.js index f676c1397..46594270e 100644 --- a/app/routes/articles/new.js +++ b/app/routes/articles/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewArticleRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Artikel aanmaken' }; + breadcrumb = { title: 'Artikel aanmaken' }; canAccess() { return this.abilities.can('create articles'); diff --git a/app/routes/articles/show.js b/app/routes/articles/show.js index 91b8ad564..6c8cf4b3f 100644 --- a/app/routes/articles/show.js +++ b/app/routes/articles/show.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class ShowArticleRoute extends ApplicationRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/books/destroy.js b/app/routes/books/destroy.js index 5afe9cf41..46263420b 100644 --- a/app/routes/books/destroy.js +++ b/app/routes/books/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyBookRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Boek verwijderen' }; + breadcrumb = { title: 'Boek verwijderen' }; canAccess() { return this.abilities.can('destroy books'); diff --git a/app/routes/books/edit.js b/app/routes/books/edit.js index 8d5826ddb..aa5e83c13 100644 --- a/app/routes/books/edit.js +++ b/app/routes/books/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditBookRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Boek aanpassen' }; + breadcrumb = { title: 'Boek aanpassen' }; canAccess(model) { return this.abilities.can('edit book', model); diff --git a/app/routes/books/index.js b/app/routes/books/index.js index c8e0f6c87..ac3323a12 100644 --- a/app/routes/books/index.js +++ b/app/routes/books/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class IndexBookRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Boeken' }; + breadcrumb = { title: 'Boeken' }; queryParams = { search: { diff --git a/app/routes/books/new.js b/app/routes/books/new.js index ef44c4bde..eb933f078 100644 --- a/app/routes/books/new.js +++ b/app/routes/books/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewBookRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Boek aanmaken' }; + breadcrumb = { title: 'Boek aanmaken' }; canAccess() { return this.abilities.can('create books'); diff --git a/app/routes/books/show.js b/app/routes/books/show.js index a65235ddb..a5f3bf4a6 100644 --- a/app/routes/books/show.js +++ b/app/routes/books/show.js @@ -10,7 +10,7 @@ export default class ShowBookRoute extends AuthenticatedRoute { this.formLoadOrCreateUtil = new FormLoadOrCreateUtil(this); } - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/debit.js b/app/routes/debit.js index ba811f73d..512599f33 100644 --- a/app/routes/debit.js +++ b/app/routes/debit.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class DebitRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/debit/collections/destroy.js b/app/routes/debit/collections/destroy.js index b769e1d0f..e6001ad16 100644 --- a/app/routes/debit/collections/destroy.js +++ b/app/routes/debit/collections/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyCollectionsRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Incasso aanpassen' }; + breadcrumb = { title: 'Incasso aanpassen' }; canAccess() { return this.abilities.can('destroy debit/collections'); diff --git a/app/routes/debit/collections/edit.js b/app/routes/debit/collections/edit.js index 533d4f079..a495ac883 100644 --- a/app/routes/debit/collections/edit.js +++ b/app/routes/debit/collections/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditCollectionRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Incasso aanpassen' }; + breadcrumb = { title: 'Incasso aanpassen' }; canAccess() { return this.abilities.can('edit debit/collections'); diff --git a/app/routes/debit/collections/index.js b/app/routes/debit/collections/index.js index dc619cb69..4d07ab94f 100644 --- a/app/routes/debit/collections/index.js +++ b/app/routes/debit/collections/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class CollectionsIndexRoute extends AuthenticatedRoute { - breadCrumb = { title: "Incasso's" }; + breadcrumb = { title: "Incasso's" }; get pageActions() { return [ diff --git a/app/routes/debit/collections/new.js b/app/routes/debit/collections/new.js index 03461dcdf..86dd848dd 100644 --- a/app/routes/debit/collections/new.js +++ b/app/routes/debit/collections/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewCollectionRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Incasso aanmaken' }; + breadcrumb = { title: 'Incasso aanmaken' }; canAccess() { return this.abilities.can('create debit/collections'); diff --git a/app/routes/debit/collections/sepa.js b/app/routes/debit/collections/sepa.js index bec3b7d58..ffad0670c 100644 --- a/app/routes/debit/collections/sepa.js +++ b/app/routes/debit/collections/sepa.js @@ -6,7 +6,7 @@ export default class SepaRoute extends AuthenticatedRoute { @service fetch; @service('file-saver') fileSaver; - breadCrumb = { title: 'Sepa downloaden' }; + breadcrumb = { title: 'Sepa downloaden' }; canAccess() { return this.abilities.can('download sepa debit/collections'); diff --git a/app/routes/debit/collections/show.js b/app/routes/debit/collections/show.js index 806efce3b..3b6002b14 100644 --- a/app/routes/debit/collections/show.js +++ b/app/routes/debit/collections/show.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class CollectionsIndexRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.name }; } diff --git a/app/routes/debit/mandates/edit.js b/app/routes/debit/mandates/edit.js index 6462f1067..bed39d385 100644 --- a/app/routes/debit/mandates/edit.js +++ b/app/routes/debit/mandates/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditMandateRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Mandaat aanpassen' }; + breadcrumb = { title: 'Mandaat aanpassen' }; canAccess() { return this.abilities.can('edit debit/mandates'); diff --git a/app/routes/debit/mandates/index.js b/app/routes/debit/mandates/index.js index 43cbc2b86..69f9d63e5 100644 --- a/app/routes/debit/mandates/index.js +++ b/app/routes/debit/mandates/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class MandatesRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Incasso mandaten' }; + breadcrumb = { title: 'Incasso mandaten' }; get pageActions() { return [ diff --git a/app/routes/debit/mandates/new.js b/app/routes/debit/mandates/new.js index 84332ec49..7ea8199c2 100644 --- a/app/routes/debit/mandates/new.js +++ b/app/routes/debit/mandates/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewMandateRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Mandaat aanmaken' }; + breadcrumb = { title: 'Mandaat aanmaken' }; canAccess() { return this.abilities.can('create debit/mandates'); diff --git a/app/routes/debit/mandates/show.js b/app/routes/debit/mandates/show.js index 3c8119f4c..0b42e51c3 100644 --- a/app/routes/debit/mandates/show.js +++ b/app/routes/debit/mandates/show.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class CollectionsIndexRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.id }; } diff --git a/app/routes/debit/transactions/destroy.js b/app/routes/debit/transactions/destroy.js index 14e7a3a58..c8c9323b3 100644 --- a/app/routes/debit/transactions/destroy.js +++ b/app/routes/debit/transactions/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyTransactionRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Transactie verwijderen' }; + breadcrumb = { title: 'Transactie verwijderen' }; canAccess() { return this.abilities.can('destroy debit/transactions'); diff --git a/app/routes/debit/transactions/edit.js b/app/routes/debit/transactions/edit.js index 311688dc6..3c4dbe36f 100644 --- a/app/routes/debit/transactions/edit.js +++ b/app/routes/debit/transactions/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditTransactionRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Transactie aanpassen' }; + breadcrumb = { title: 'Transactie aanpassen' }; canAccess() { return this.abilities.can('edit debit/transactions'); diff --git a/app/routes/form.js b/app/routes/form.js index 57f1cd412..f2c27c85f 100644 --- a/app/routes/form.js +++ b/app/routes/form.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class FormRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/form/responses.js b/app/routes/form/responses.js index fce25c16a..36d0b16ff 100644 --- a/app/routes/form/responses.js +++ b/app/routes/form/responses.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class FormResponseRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/form/responses/destroy.js b/app/routes/form/responses/destroy.js index b7580c6be..f3233d979 100644 --- a/app/routes/form/responses/destroy.js +++ b/app/routes/form/responses/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyFormResponseRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Formulierantwoord verwijderen' }; + breadcrumb = { title: 'Formulierantwoord verwijderen' }; canAccess(model) { return this.abilities.can('destroy form/response', model); diff --git a/app/routes/forum/categories.js b/app/routes/forum/categories.js index aadd45ccb..503ebb5e2 100644 --- a/app/routes/forum/categories.js +++ b/app/routes/forum/categories.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class CategoriesRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/forum/categories/category.js b/app/routes/forum/categories/category.js index 2105bc875..9e9ed1a66 100644 --- a/app/routes/forum/categories/category.js +++ b/app/routes/forum/categories/category.js @@ -3,7 +3,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class CategoryRoute extends AuthenticatedRoute { queryParams = {}; - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.name }; } diff --git a/app/routes/forum/categories/category/destroy.js b/app/routes/forum/categories/category/destroy.js index 0b54302ae..6c172713a 100644 --- a/app/routes/forum/categories/category/destroy.js +++ b/app/routes/forum/categories/category/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyCategoryRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Categorie verwijderen' }; + breadcrumb = { title: 'Categorie verwijderen' }; canAccess() { return this.abilities.can('destroy forum/categories'); diff --git a/app/routes/forum/categories/category/edit.js b/app/routes/forum/categories/category/edit.js index 83cac32bb..b113dbe9f 100644 --- a/app/routes/forum/categories/category/edit.js +++ b/app/routes/forum/categories/category/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditCategoryRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Categorie aanpassen' }; + breadcrumb = { title: 'Categorie aanpassen' }; canAccess() { return this.abilities.can('edit forum/categories'); diff --git a/app/routes/forum/categories/category/threads.js b/app/routes/forum/categories/category/threads.js index 96ab0ce36..7932c5c42 100644 --- a/app/routes/forum/categories/category/threads.js +++ b/app/routes/forum/categories/category/threads.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class ThreadsRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/forum/categories/category/threads/index.js b/app/routes/forum/categories/category/threads/index.js index ef53fc107..25c67a181 100644 --- a/app/routes/forum/categories/category/threads/index.js +++ b/app/routes/forum/categories/category/threads/index.js @@ -2,7 +2,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; import { assign } from '@ember/polyfills'; export default class ThreadIndexRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.name }; } diff --git a/app/routes/forum/categories/category/threads/new.js b/app/routes/forum/categories/category/threads/new.js index 4ddd41ac6..d1c7ae78f 100644 --- a/app/routes/forum/categories/category/threads/new.js +++ b/app/routes/forum/categories/category/threads/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewTopicRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Topic aanmaken' }; + breadcrumb = { title: 'Topic aanmaken' }; canAccess() { return this.abilities.can('create forum/thread'); diff --git a/app/routes/forum/categories/category/threads/thread.js b/app/routes/forum/categories/category/threads/thread.js index a93f01537..c045b58f0 100644 --- a/app/routes/forum/categories/category/threads/thread.js +++ b/app/routes/forum/categories/category/threads/thread.js @@ -3,7 +3,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ThreadRoute extends AuthenticatedRoute { queryParams = {}; - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/forum/categories/category/threads/thread/destroy.js b/app/routes/forum/categories/category/threads/thread/destroy.js index 724faea4a..fd0344837 100644 --- a/app/routes/forum/categories/category/threads/thread/destroy.js +++ b/app/routes/forum/categories/category/threads/thread/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyTopicRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Topic verwijderen' }; + breadcrumb = { title: 'Topic verwijderen' }; canAccess() { return this.abilities.can('destroy forum/threads'); diff --git a/app/routes/forum/categories/category/threads/thread/edit.js b/app/routes/forum/categories/category/threads/thread/edit.js index 2662be6f3..eddd644d4 100644 --- a/app/routes/forum/categories/category/threads/thread/edit.js +++ b/app/routes/forum/categories/category/threads/thread/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditTopicRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Topic aanpassen' }; + breadcrumb = { title: 'Topic aanpassen' }; canAccess() { return this.abilities.can('edit forum/threads'); diff --git a/app/routes/forum/categories/category/threads/thread/posts.js b/app/routes/forum/categories/category/threads/thread/posts.js index de97256e9..ae8d25492 100644 --- a/app/routes/forum/categories/category/threads/thread/posts.js +++ b/app/routes/forum/categories/category/threads/thread/posts.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class PostsRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/forum/categories/category/threads/thread/posts/destroy.js b/app/routes/forum/categories/category/threads/thread/posts/destroy.js index d88a0acc2..25a3308e9 100644 --- a/app/routes/forum/categories/category/threads/thread/posts/destroy.js +++ b/app/routes/forum/categories/category/threads/thread/posts/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyPostRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Forumbericht verwijderen' }; + breadcrumb = { title: 'Forumbericht verwijderen' }; canAccess() { return this.abilities.can('destroy forum/posts'); diff --git a/app/routes/forum/categories/category/threads/thread/posts/edit.js b/app/routes/forum/categories/category/threads/thread/posts/edit.js index ca1b86c2d..a2642b866 100644 --- a/app/routes/forum/categories/category/threads/thread/posts/edit.js +++ b/app/routes/forum/categories/category/threads/thread/posts/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditPostRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Forumbericht aanpassen' }; + breadcrumb = { title: 'Forumbericht aanpassen' }; canAccess(model) { return this.abilities.can('edit forum/post', model); diff --git a/app/routes/forum/categories/category/threads/thread/posts/index.js b/app/routes/forum/categories/category/threads/thread/posts/index.js index dc8ca0346..013c7b40a 100644 --- a/app/routes/forum/categories/category/threads/thread/posts/index.js +++ b/app/routes/forum/categories/category/threads/thread/posts/index.js @@ -10,7 +10,7 @@ export default class PostIndexRoute extends AuthenticatedRoute { @service router; @service fetch; - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/forum/categories/index.js b/app/routes/forum/categories/index.js index aa440d304..787a3a697 100644 --- a/app/routes/forum/categories/index.js +++ b/app/routes/forum/categories/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ForumIndexRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Forum' }; + breadcrumb = { title: 'Forum' }; get pageActions() { return [ diff --git a/app/routes/forum/categories/new.js b/app/routes/forum/categories/new.js index a23a33af1..c83b218b3 100644 --- a/app/routes/forum/categories/new.js +++ b/app/routes/forum/categories/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewCategoryRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Categorie aanmaken' }; + breadcrumb = { title: 'Categorie aanmaken' }; canAccess() { return this.abilities.can('create forum/categories'); diff --git a/app/routes/groups/edit.js b/app/routes/groups/edit.js index d0088d360..1c79dccd9 100644 --- a/app/routes/groups/edit.js +++ b/app/routes/groups/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewGroupRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Groep aanpassen' }; + breadcrumb = { title: 'Groep aanpassen' }; canAccess(model) { return this.abilities.can('edit group', model); diff --git a/app/routes/groups/export.js b/app/routes/groups/export.js index f2e5d8354..12e8efee9 100644 --- a/app/routes/groups/export.js +++ b/app/routes/groups/export.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ExportGroupRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: `${this.controller.model.name} exporteren` }; } diff --git a/app/routes/groups/index.js b/app/routes/groups/index.js index dfec544e8..9a249da27 100644 --- a/app/routes/groups/index.js +++ b/app/routes/groups/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class GroupIndexRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Groepen' }; + breadcrumb = { title: 'Groepen' }; queryParams = { search: { diff --git a/app/routes/groups/new.js b/app/routes/groups/new.js index 005ff0627..4e7ff7313 100644 --- a/app/routes/groups/new.js +++ b/app/routes/groups/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewGroupRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Groep aanmaken' }; + breadcrumb = { title: 'Groep aanmaken' }; canAccess() { return this.abilities.can('create groups'); diff --git a/app/routes/groups/show.js b/app/routes/groups/show.js index 7b0611ecd..e9defb649 100644 --- a/app/routes/groups/show.js +++ b/app/routes/groups/show.js @@ -2,7 +2,7 @@ import { all } from 'rsvp'; import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ShowGroupRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.name }; } diff --git a/app/routes/mail-aliases/destroy.js b/app/routes/mail-aliases/destroy.js index 7c9141e9f..877059737 100644 --- a/app/routes/mail-aliases/destroy.js +++ b/app/routes/mail-aliases/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyMailAliasRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Mail-alias verwijderen' }; + breadcrumb = { title: 'Mail-alias verwijderen' }; canAccess() { return this.abilities.can('destroy mail-aliases'); diff --git a/app/routes/mail-aliases/edit.js b/app/routes/mail-aliases/edit.js index 6364ab773..bea1b700f 100644 --- a/app/routes/mail-aliases/edit.js +++ b/app/routes/mail-aliases/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditMailAliasRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Mail-alias aanpassen' }; + breadcrumb = { title: 'Mail-alias aanpassen' }; canAccess(model) { return this.abilities.can('edit mail-alias', model); diff --git a/app/routes/mail-aliases/index.js b/app/routes/mail-aliases/index.js index 4bfb8679d..73d3302df 100644 --- a/app/routes/mail-aliases/index.js +++ b/app/routes/mail-aliases/index.js @@ -3,7 +3,7 @@ import { inject as service } from '@ember/service'; export default class MailAliasIndexRoute extends ApplicationRoute { @service intl; - breadCrumb = { title: 'Mail-aliassen' }; + breadcrumb = { title: 'Mail-aliassen' }; get pageActions() { return [ diff --git a/app/routes/mail-aliases/new.js b/app/routes/mail-aliases/new.js index 51e772c01..ea99b8434 100644 --- a/app/routes/mail-aliases/new.js +++ b/app/routes/mail-aliases/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewMailAliasRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Mail-alias aanmaken' }; + breadcrumb = { title: 'Mail-alias aanmaken' }; canAccess() { return this.abilities.can('create mail-aliases'); diff --git a/app/routes/mail-aliases/show.js b/app/routes/mail-aliases/show.js index c53051945..7eefc12ca 100644 --- a/app/routes/mail-aliases/show.js +++ b/app/routes/mail-aliases/show.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ShowMailAliasRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.email }; } diff --git a/app/routes/mail-moderations/accept.js b/app/routes/mail-moderations/accept.js index e58f57008..df0402b2c 100644 --- a/app/routes/mail-moderations/accept.js +++ b/app/routes/mail-moderations/accept.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class AcceptModerationRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Moderatieverzoek goedkeuren' }; + breadcrumb = { title: 'Moderatieverzoek goedkeuren' }; canAccess() { return this.abilities.can('accept mail-moderations'); diff --git a/app/routes/mail-moderations/destroy.js b/app/routes/mail-moderations/destroy.js index 9b572fcd2..41b2473dc 100644 --- a/app/routes/mail-moderations/destroy.js +++ b/app/routes/mail-moderations/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyModerationRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Moderatieverzoek negeren' }; + breadcrumb = { title: 'Moderatieverzoek negeren' }; canAccess() { return this.abilities.can('destroy mail-moderations'); diff --git a/app/routes/mail-moderations/index.js b/app/routes/mail-moderations/index.js index 44fc81474..9a363b729 100644 --- a/app/routes/mail-moderations/index.js +++ b/app/routes/mail-moderations/index.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class ModerationIndexRoute extends ApplicationRoute { - breadCrumb = { title: 'Mailmoderatie' }; + breadcrumb = { title: 'Mailmoderatie' }; canAccess() { return this.abilities.can('show mail-moderations'); diff --git a/app/routes/mail-moderations/reject.js b/app/routes/mail-moderations/reject.js index ccc7af73f..91742a345 100644 --- a/app/routes/mail-moderations/reject.js +++ b/app/routes/mail-moderations/reject.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class RejectModerationRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Moderatieverzoek afwijzen' }; + breadcrumb = { title: 'Moderatieverzoek afwijzen' }; canAccess() { return this.abilities.can('reject mail-moderations'); diff --git a/app/routes/mail-moderations/show.js b/app/routes/mail-moderations/show.js index 156d65be3..5330903e3 100644 --- a/app/routes/mail-moderations/show.js +++ b/app/routes/mail-moderations/show.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ShowModerationRoute extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.subject }; } diff --git a/app/routes/photo-albums.js b/app/routes/photo-albums.js index 11063579c..c25bb7718 100644 --- a/app/routes/photo-albums.js +++ b/app/routes/photo-albums.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class PhotoAlbumsRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/photo-albums/index.js b/app/routes/photo-albums/index.js index e882c9a8e..0754f1b0c 100644 --- a/app/routes/photo-albums/index.js +++ b/app/routes/photo-albums/index.js @@ -5,7 +5,7 @@ import { inject as service } from '@ember/service'; export default class ArticlesIndexRoute extends ApplicationRoute { @service intl; - get breadCrumb() { + get breadcrumb() { return { title: capitalize(this.intl.t('model.photoAlbum.name.other').toString()), }; diff --git a/app/routes/photo-albums/new.js b/app/routes/photo-albums/new.js index 22ae62e24..0bdf0238a 100644 --- a/app/routes/photo-albums/new.js +++ b/app/routes/photo-albums/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewPhotoAlbumRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Foto album aanmaken' }; + breadcrumb = { title: 'Foto album aanmaken' }; canAccess() { return this.abilities.can('create photo-album'); diff --git a/app/routes/photo-albums/photo-album.js b/app/routes/photo-albums/photo-album.js index 49eb2c85e..35d3d8542 100644 --- a/app/routes/photo-albums/photo-album.js +++ b/app/routes/photo-albums/photo-album.js @@ -2,7 +2,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class PhotoAlbumSubRoute extends ApplicationRoute { queryParams = {}; - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/photo-albums/photo-album/destroy.js b/app/routes/photo-albums/photo-album/destroy.js index 20437d1a6..d2a10a9bb 100644 --- a/app/routes/photo-albums/photo-album/destroy.js +++ b/app/routes/photo-albums/photo-album/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyArticleRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Foto album verwijderen' }; + breadcrumb = { title: 'Foto album verwijderen' }; canAccess() { return this.abilities.can('destroy photo-albums'); diff --git a/app/routes/photo-albums/photo-album/edit.js b/app/routes/photo-albums/photo-album/edit.js index 65170cb29..655d6e277 100644 --- a/app/routes/photo-albums/photo-album/edit.js +++ b/app/routes/photo-albums/photo-album/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditPhotoAlbumRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Foto album aanpassen' }; + breadcrumb = { title: 'Foto album aanpassen' }; canAccess(model) { return this.abilities.can('edit photo-albums', model); diff --git a/app/routes/photo-albums/photo-album/photos.js b/app/routes/photo-albums/photo-album/photos.js index 48eaa53f0..72f9bd22c 100644 --- a/app/routes/photo-albums/photo-album/photos.js +++ b/app/routes/photo-albums/photo-album/photos.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class PhotosRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/photo-albums/photo-album/photos/destroy.js b/app/routes/photo-albums/photo-album/photos/destroy.js index 7d54abcd5..34742923c 100644 --- a/app/routes/photo-albums/photo-album/photos/destroy.js +++ b/app/routes/photo-albums/photo-album/photos/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyArticleRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Foto verwijderen' }; + breadcrumb = { title: 'Foto verwijderen' }; canAccess() { return this.abilities.can('destroy photos'); diff --git a/app/routes/photo-albums/photo-album/photos/index.js b/app/routes/photo-albums/photo-album/photos/index.js index 4358784f6..c612f0d86 100644 --- a/app/routes/photo-albums/photo-album/photos/index.js +++ b/app/routes/photo-albums/photo-album/photos/index.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class PhotosIndexRoute extends ApplicationRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/photo-albums/photo-album/photos/show.js b/app/routes/photo-albums/photo-album/photos/show.js index 90842d78f..ca41ba8fb 100644 --- a/app/routes/photo-albums/photo-album/photos/show.js +++ b/app/routes/photo-albums/photo-album/photos/show.js @@ -9,7 +9,7 @@ import { export default class ShowPhotosRoute extends ApplicationRoute { @service intl; - get breadCrumb() { + get breadcrumb() { const photo = this.controller.model; const allAlbumPhotos = this.controller.model.photoAlbum.get('sortedPhotos'); const photoAlbumPhotosLength = allAlbumPhotos.get('length'); diff --git a/app/routes/photo-comments/destroy.js b/app/routes/photo-comments/destroy.js index 16913b218..e84659321 100644 --- a/app/routes/photo-comments/destroy.js +++ b/app/routes/photo-comments/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyArticleRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Fotoreactie verwijderen' }; + breadcrumb = { title: 'Fotoreactie verwijderen' }; canAccess() { return this.abilities.can('destroy photo-comments'); diff --git a/app/routes/photo-comments/index.js b/app/routes/photo-comments/index.js index 54a98b0cd..dbb416410 100644 --- a/app/routes/photo-comments/index.js +++ b/app/routes/photo-comments/index.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class PhotoCommentsIndexRoute extends ApplicationRoute { - breadCrumb = { title: 'Fotoreacties' }; + breadcrumb = { title: 'Fotoreacties' }; canAccess() { return this.abilities.can('show photo-comments'); diff --git a/app/routes/polls/destroy.js b/app/routes/polls/destroy.js index b2841ab66..27edf1c26 100644 --- a/app/routes/polls/destroy.js +++ b/app/routes/polls/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyPollRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Poll verwijderen' }; + breadcrumb = { title: 'Poll verwijderen' }; canAccess() { return this.abilities.can('destroy polls'); diff --git a/app/routes/polls/edit.js b/app/routes/polls/edit.js index 69344befb..ef7ea7d31 100644 --- a/app/routes/polls/edit.js +++ b/app/routes/polls/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditMailAliasRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Poll aanpassen' }; + breadcrumb = { title: 'Poll aanpassen' }; canAccess(model) { return this.abilities.can('edit poll', model); diff --git a/app/routes/polls/index.js b/app/routes/polls/index.js index a7c97c2e5..4e17db81d 100644 --- a/app/routes/polls/index.js +++ b/app/routes/polls/index.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class MailAliasIndexRoute extends ApplicationRoute { - breadCrumb = { title: 'Polls' }; + breadcrumb = { title: 'Polls' }; get pageActions() { return [ diff --git a/app/routes/polls/new.js b/app/routes/polls/new.js index 5e39423ab..edf225159 100644 --- a/app/routes/polls/new.js +++ b/app/routes/polls/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewPollRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Poll aanmaken' }; + breadcrumb = { title: 'Poll aanmaken' }; canAccess() { return this.abilities.can('create polls'); diff --git a/app/routes/polls/show.js b/app/routes/polls/show.js index 54906dd31..47bd5bf5a 100644 --- a/app/routes/polls/show.js +++ b/app/routes/polls/show.js @@ -11,7 +11,7 @@ export default class ShowPollsRoute extends AuthenticatedRoute { this.formLoadOrCreateUtil = new FormLoadOrCreateUtil(this); } - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.poll.question.question }; } diff --git a/app/routes/quickpost.js b/app/routes/quickpost.js index 5767ea5e1..170104311 100644 --- a/app/routes/quickpost.js +++ b/app/routes/quickpost.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class QuickpostRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Quickpost' }; + breadcrumb = { title: 'Quickpost' }; canAccess() { return this.abilities.can('show quickpost-messages'); diff --git a/app/routes/sog/index.js b/app/routes/sog/index.js index e9ebd3b76..6e9f15827 100644 --- a/app/routes/sog/index.js +++ b/app/routes/sog/index.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class SogIndexRoute extends ApplicationRoute { - breadCrumb = { title: 'SOG' }; + breadcrumb = { title: 'SOG' }; canAccess() { return this.abilities.can('show sog'); diff --git a/app/routes/sog/name-trainer.js b/app/routes/sog/name-trainer.js index 3ca2f3db9..46f4a351e 100644 --- a/app/routes/sog/name-trainer.js +++ b/app/routes/sog/name-trainer.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class SogIndexRoute extends ApplicationRoute { - breadCrumb = { title: 'Namen leren' }; + breadcrumb = { title: 'Namen leren' }; canAccess() { return this.abilities.can('show sog/name-trainer'); diff --git a/app/routes/static-pages/destroy.js b/app/routes/static-pages/destroy.js index 6ac0c3ad0..472b3f1e9 100644 --- a/app/routes/static-pages/destroy.js +++ b/app/routes/static-pages/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyStaticPageRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Informatie pagina verwijderen' }; + breadcrumb = { title: 'Informatie pagina verwijderen' }; canAccess() { return this.abilities.can('destroy static-pages'); diff --git a/app/routes/static-pages/edit.js b/app/routes/static-pages/edit.js index 0070ab635..336a2d8f1 100644 --- a/app/routes/static-pages/edit.js +++ b/app/routes/static-pages/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditStaticPageRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Informatie pagina aanpassen' }; + breadcrumb = { title: 'Informatie pagina aanpassen' }; canAccess() { return this.abilities.can('edit static-pages'); diff --git a/app/routes/static-pages/index.js b/app/routes/static-pages/index.js index 2dc91126a..c885d8aa0 100644 --- a/app/routes/static-pages/index.js +++ b/app/routes/static-pages/index.js @@ -5,7 +5,7 @@ import { capitalize } from '@ember/string'; export default class StaticPagesIndexRoute extends ApplicationRoute { @service intl; - get breadCrumb() { + get breadcrumb() { return { title: capitalize(this.intl.t('model.staticPage.name.other').toString()), }; diff --git a/app/routes/static-pages/new.js b/app/routes/static-pages/new.js index 94522722e..00c11e81c 100644 --- a/app/routes/static-pages/new.js +++ b/app/routes/static-pages/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewStaticPageRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Informatie pagina aanmaken' }; + breadcrumb = { title: 'Informatie pagina aanmaken' }; canAccess() { return this.abilities.can('create static-pages'); diff --git a/app/routes/static-pages/show.js b/app/routes/static-pages/show.js index ccb7c7a4a..959a21841 100644 --- a/app/routes/static-pages/show.js +++ b/app/routes/static-pages/show.js @@ -1,7 +1,7 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; export default class ShowStaticPagesRoute extends ApplicationRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.title }; } diff --git a/app/routes/users/batch.js b/app/routes/users/batch.js index 2e59471b6..c06f82ac0 100644 --- a/app/routes/users/batch.js +++ b/app/routes/users/batch.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; export default class BatchRoute extends Route { - breadCrumb = null; + breadcrumb = null; } diff --git a/app/routes/users/batch/new.js b/app/routes/users/batch/new.js index 19a543fab..9b8ca4e51 100644 --- a/app/routes/users/batch/new.js +++ b/app/routes/users/batch/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditStaticPageRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Batch gebruikers uploaden' }; + breadcrumb = { title: 'Batch gebruikers uploaden' }; canAccess() { return this.abilities.can('batch upload users'); diff --git a/app/routes/users/destroy.js b/app/routes/users/destroy.js index 648375f81..e00925381 100644 --- a/app/routes/users/destroy.js +++ b/app/routes/users/destroy.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class DestroyUserRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Lid verwijderen' }; + breadcrumb = { title: 'Lid verwijderen' }; canAccess(model) { return this.abilities.can('destroy user', model); diff --git a/app/routes/users/edit.js b/app/routes/users/edit.js index 1037fa213..1bce12dcb 100644 --- a/app/routes/users/edit.js +++ b/app/routes/users/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditUserRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Lid aanpassen' }; + breadcrumb = { title: 'Lid aanpassen' }; get tabItems() { const user = this.controller.model; diff --git a/app/routes/users/index.js b/app/routes/users/index.js index ad760a9f0..502d0a300 100644 --- a/app/routes/users/index.js +++ b/app/routes/users/index.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class UserIndexRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Gebruikers' }; + breadcrumb = { title: 'Gebruikers' }; get pageActions() { return [ diff --git a/app/routes/users/members.js b/app/routes/users/members.js index 84204e6de..e5e9fe80e 100644 --- a/app/routes/users/members.js +++ b/app/routes/users/members.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class MembersRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Leden' }; + breadcrumb = { title: 'Leden' }; get pageActions() { return [ diff --git a/app/routes/users/new.js b/app/routes/users/new.js index c6124d0ab..f6f7aa4e2 100644 --- a/app/routes/users/new.js +++ b/app/routes/users/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewUserRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Gebruiker aanmaken' }; + breadcrumb = { title: 'Gebruiker aanmaken' }; canAccess() { return this.abilities.can('create users'); diff --git a/app/routes/users/resend-activation.js b/app/routes/users/resend-activation.js index b3aa96c2f..95fca1c78 100644 --- a/app/routes/users/resend-activation.js +++ b/app/routes/users/resend-activation.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ResendActivationRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Activatiecode hersturen' }; + breadcrumb = { title: 'Activatiecode hersturen' }; canAccess(model) { return this.abilities.can('resend activation code of user', model); diff --git a/app/routes/users/show.js b/app/routes/users/show.js index d9c47844d..ca043aa13 100644 --- a/app/routes/users/show.js +++ b/app/routes/users/show.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ShowUserRouter extends AuthenticatedRoute { - get breadCrumb() { + get breadcrumb() { return { title: this.controller.model.fullName }; } diff --git a/app/routes/users/webdav.js b/app/routes/users/webdav.js index f64b63e23..43739ac88 100644 --- a/app/routes/users/webdav.js +++ b/app/routes/users/webdav.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class WebdavRoute extends AuthenticatedRoute { - breadCrumb = { title: 'Contactsynchronisatie' }; + breadcrumb = { title: 'Contactsynchronisatie' }; canAccess() { return this.abilities.can('show webdav users'); From b9d05242b21eeca5a768f003eb524221fe469b37 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Tue, 1 Nov 2022 22:10:59 +0100 Subject: [PATCH 02/44] refactor: merge breadcrumb with route metadata --- app/routes/application/application.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/routes/application/application.js b/app/routes/application/application.js index 399a33741..3ed3e2ba7 100644 --- a/app/routes/application/application.js +++ b/app/routes/application/application.js @@ -26,6 +26,12 @@ export class ApplicationRoute extends Route { controller.pageActions = this.pageActions; controller.tabItems = this.tabItems; } + + buildRouteInfoMetadata() { + return { + breadcrumb: this.breadcrumb, + }; + } } export class AuthenticatedRoute extends ApplicationRoute { From d21fc6f42ccea426d9b10627d04789437f194f66 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Tue, 1 Nov 2022 22:13:45 +0100 Subject: [PATCH 03/44] fix: edit article title --- app/routes/articles/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/articles/edit.js b/app/routes/articles/edit.js index 419fb892a..06e6d2c1d 100644 --- a/app/routes/articles/edit.js +++ b/app/routes/articles/edit.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class EditArticleRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Activiteit aanpassen' }; + breadcrumb = { title: 'Artikel aanpassen' }; canAccess(model) { return this.abilities.can('edit article', model); From 37727546b116e0d4ecdbbf67a9d53695eb56e66a Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Tue, 1 Nov 2022 22:25:27 +0100 Subject: [PATCH 04/44] refactor: remove `ember-crumbly` and update BreadCrumbs component --- app/components/bread-crumbs.hbs | 16 +- app/components/bread-crumbs.js | 3 - app/components/header-nav.hbs | 33 ++- app/controllers/application.js | 21 +- app/templates/application.hbs | 2 +- package.json | 2 +- yarn.lock | 392 +++++++++++++++++++++++++++++--- 7 files changed, 411 insertions(+), 58 deletions(-) delete mode 100644 app/components/bread-crumbs.js diff --git a/app/components/bread-crumbs.hbs b/app/components/bread-crumbs.hbs index 3a22524c6..83175c79a 100644 --- a/app/components/bread-crumbs.hbs +++ b/app/components/bread-crumbs.hbs @@ -1,11 +1,15 @@ \ No newline at end of file diff --git a/app/components/bread-crumbs.js b/app/components/bread-crumbs.js deleted file mode 100644 index 057907951..000000000 --- a/app/components/bread-crumbs.js +++ /dev/null @@ -1,3 +0,0 @@ -import BreadCrumbs from 'ember-crumbly/components/bread-crumbs'; - -export default class CustomBreadCrumbs extends BreadCrumbs {} diff --git a/app/components/header-nav.hbs b/app/components/header-nav.hbs index 6f84dbfbf..fc882f11d 100644 --- a/app/components/header-nav.hbs +++ b/app/components/header-nav.hbs @@ -1,5 +1,11 @@ - \ No newline at end of file diff --git a/app/controllers/application.js b/app/controllers/application.js index 9f28d3646..70ded4cbd 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -1,7 +1,18 @@ -import { inject as service } from '@ember/service'; import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; + +export default class ApplicationController extends Controller { + @service layoutManager; + @service router; + @service session; + + get routeInfos() { + const linkListToArray = (route) => { + return route ? [...linkListToArray(route.parent), route] : []; + }; -export default Controller.extend({ - session: service(), - layoutManager: service('layout-manager'), -}); + return linkListToArray(this.router.currentRoute).filter( + (routeInfo) => routeInfo.metadata?.breadcrumb + ); + } +} diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 598dce650..92dab66e5 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1,5 +1,5 @@
- +
diff --git a/package.json b/package.json index 696a6f0a7..6e4dc8101 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.2", "ember-cli-update": "^1.0.1", + "ember-composable-helpers": "^5.0.0", "ember-concurrency": "^2.3.7", - "ember-crumbly": "^3.0.1", "ember-data": "~3.27.1", "ember-fetch": "^8.1.1", "ember-file-upload": "^7.1.0", diff --git a/yarn.lock b/yarn.lock index 8e10b9a30..ca3df1789 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,6 +32,15 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/code-frame@npm:7.18.6" + dependencies: + "@babel/highlight": ^7.18.6 + checksum: 195e2be3172d7684bf95cff69ae3b7a15a9841ea9d27d3c843662d50cdd7d6470fd9c8e64be84d031117e4a4083486effba39f9aef6bbb2c89f7f21bcfba33ba + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.13.0, @babel/compat-data@npm:^7.13.11, @babel/compat-data@npm:^7.16.8, @babel/compat-data@npm:^7.17.0, @babel/compat-data@npm:^7.17.7": version: 7.17.7 resolution: "@babel/compat-data@npm:7.17.7" @@ -39,6 +48,36 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.20.0": + version: 7.20.0 + resolution: "@babel/compat-data@npm:7.20.0" + checksum: 325148e2961edcfc17d53ec4b27f85ebdd6be1aa33d1d297acf84fb5879f58c0a18bfb6418f9f108b4c84a98606adb1668250a15fd4fab2cc84c537b454b9a42 + languageName: node + linkType: hard + +"@babel/core@npm:^7.0.0": + version: 7.19.6 + resolution: "@babel/core@npm:7.19.6" + dependencies: + "@ampproject/remapping": ^2.1.0 + "@babel/code-frame": ^7.18.6 + "@babel/generator": ^7.19.6 + "@babel/helper-compilation-targets": ^7.19.3 + "@babel/helper-module-transforms": ^7.19.6 + "@babel/helpers": ^7.19.4 + "@babel/parser": ^7.19.6 + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.19.6 + "@babel/types": ^7.19.4 + convert-source-map: ^1.7.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.1 + semver: ^6.3.0 + checksum: 85c0bd38d0ef180aa2d23c3db6840a0baec88d2e05c30e7ffc3dfeb6b2b89d6e4864922f04997a1f4ce55f9dd469bf2e76518d5c7ae744b98516709d32769b73 + languageName: node + linkType: hard + "@babel/core@npm:^7.1.6, @babel/core@npm:^7.12.0, @babel/core@npm:^7.13.8, @babel/core@npm:^7.16.7, @babel/core@npm:^7.3.4": version: 7.17.7 resolution: "@babel/core@npm:7.17.7" @@ -73,6 +112,17 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.19.6, @babel/generator@npm:^7.20.0": + version: 7.20.0 + resolution: "@babel/generator@npm:7.20.0" + dependencies: + "@babel/types": ^7.20.0 + "@jridgewell/gen-mapping": ^0.3.2 + jsesc: ^2.5.1 + checksum: df2fef0ac305cf031013e311d4582b15b5c297fd538bec71e6cae3b689189ac4be6055482487b06da1be2f007b8985d5162a84e14e43a20435b8c89551910509 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-annotate-as-pure@npm:7.16.7" @@ -106,6 +156,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.19.3": + version: 7.20.0 + resolution: "@babel/helper-compilation-targets@npm:7.20.0" + dependencies: + "@babel/compat-data": ^7.20.0 + "@babel/helper-validator-option": ^7.18.6 + browserslist: ^4.21.3 + semver: ^6.3.0 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: bc183f2109648849c8fde0b3c5cf08adf2f7ad6dc617b546fd20f34c8ef574ee5ee293c8d1bd0ed0221212e8f5907cdc2c42097870f1dcc769a654107d82c95b + languageName: node + linkType: hard + "@babel/helper-create-class-features-plugin@npm:^7.13.0, @babel/helper-create-class-features-plugin@npm:^7.16.10, @babel/helper-create-class-features-plugin@npm:^7.16.7, @babel/helper-create-class-features-plugin@npm:^7.17.1, @babel/helper-create-class-features-plugin@npm:^7.17.6, @babel/helper-create-class-features-plugin@npm:^7.5.5, @babel/helper-create-class-features-plugin@npm:^7.8.3": version: 7.17.6 resolution: "@babel/helper-create-class-features-plugin@npm:7.17.6" @@ -180,6 +244,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.18.9": + version: 7.18.9 + resolution: "@babel/helper-environment-visitor@npm:7.18.9" + checksum: b25101f6162ddca2d12da73942c08ad203d7668e06663df685634a8fde54a98bc015f6f62938e8554457a592a024108d45b8f3e651fd6dcdb877275b73cc4420 + languageName: node + linkType: hard + "@babel/helper-explode-assignable-expression@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-explode-assignable-expression@npm:7.16.7" @@ -200,6 +271,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.19.0": + version: 7.19.0 + resolution: "@babel/helper-function-name@npm:7.19.0" + dependencies: + "@babel/template": ^7.18.10 + "@babel/types": ^7.19.0 + checksum: eac1f5db428ba546270c2b8d750c24eb528b8fcfe50c81de2e0bdebf0e20f24bec688d4331533b782e4a907fad435244621ca2193cfcf80a86731299840e0f6e + languageName: node + linkType: hard + "@babel/helper-get-function-arity@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-get-function-arity@npm:7.16.7" @@ -218,6 +299,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-hoist-variables@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-hoist-variables@npm:7.18.6" + dependencies: + "@babel/types": ^7.18.6 + checksum: fd9c35bb435fda802bf9ff7b6f2df06308a21277c6dec2120a35b09f9de68f68a33972e2c15505c1a1a04b36ec64c9ace97d4a9e26d6097b76b4396b7c5fa20f + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.16.7": version: 7.17.7 resolution: "@babel/helper-member-expression-to-functions@npm:7.17.7" @@ -236,6 +326,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-module-imports@npm:7.18.6" + dependencies: + "@babel/types": ^7.18.6 + checksum: f393f8a3b3304b1b7a288a38c10989de754f01d29caf62ce7c4e5835daf0a27b81f3ac687d9d2780d39685aae7b55267324b512150e7b2be967b0c493b6a1def + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.16.7, @babel/helper-module-transforms@npm:^7.17.7": version: 7.17.7 resolution: "@babel/helper-module-transforms@npm:7.17.7" @@ -252,6 +351,22 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.19.6": + version: 7.19.6 + resolution: "@babel/helper-module-transforms@npm:7.19.6" + dependencies: + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-module-imports": ^7.18.6 + "@babel/helper-simple-access": ^7.19.4 + "@babel/helper-split-export-declaration": ^7.18.6 + "@babel/helper-validator-identifier": ^7.19.1 + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.19.6 + "@babel/types": ^7.19.4 + checksum: c28692b37d4b5abacc775bcab52a74f44a493f38c58cb72b56a6c6d67a97485dd8aff6f26905abd1a924d3261a171d0214a9fb76f48d8598f1e35b8b29284792 + languageName: node + linkType: hard + "@babel/helper-optimise-call-expression@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-optimise-call-expression@npm:7.16.7" @@ -301,6 +416,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.19.4": + version: 7.19.4 + resolution: "@babel/helper-simple-access@npm:7.19.4" + dependencies: + "@babel/types": ^7.19.4 + checksum: 964cb1ec36b69aabbb02f8d5ee1d680ebbb628611a6740958d9b05107ab16c0492044e430618ae42b1f8ea73e4e1bafe3750e8ebc959d6f3277d9cfbe1a94880 + languageName: node + linkType: hard + "@babel/helper-skip-transparent-expression-wrappers@npm:^7.16.0": version: 7.16.0 resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.16.0" @@ -319,6 +443,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-split-export-declaration@npm:7.18.6" + dependencies: + "@babel/types": ^7.18.6 + checksum: c6d3dede53878f6be1d869e03e9ffbbb36f4897c7cc1527dc96c56d127d834ffe4520a6f7e467f5b6f3c2843ea0e81a7819d66ae02f707f6ac057f3d57943a2b + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.18.10": version: 7.18.10 resolution: "@babel/helper-string-parser@npm:7.18.10" @@ -326,6 +459,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.19.4": + version: 7.19.4 + resolution: "@babel/helper-string-parser@npm:7.19.4" + checksum: b2f8a3920b30dfac81ec282ac4ad9598ea170648f8254b10f475abe6d944808fb006aab325d3eb5a8ad3bea8dfa888cfa6ef471050dae5748497c110ec060943 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-validator-identifier@npm:7.16.7" @@ -340,6 +480,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.19.1": + version: 7.19.1 + resolution: "@babel/helper-validator-identifier@npm:7.19.1" + checksum: 0eca5e86a729162af569b46c6c41a63e18b43dbe09fda1d2a3c8924f7d617116af39cac5e4cd5d431bb760b4dca3c0970e0c444789b1db42bcf1fa41fbad0a3a + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-validator-option@npm:7.16.7" @@ -347,6 +494,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/helper-validator-option@npm:7.18.6" + checksum: f9cc6eb7cc5d759c5abf006402180f8d5e4251e9198197428a97e05d65eb2f8ae5a0ce73b1dfd2d35af41d0eb780627a64edf98a4e71f064eeeacef8de58f2cf + languageName: node + linkType: hard + "@babel/helper-wrap-function@npm:^7.16.8": version: 7.16.8 resolution: "@babel/helper-wrap-function@npm:7.16.8" @@ -370,6 +524,17 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.19.4": + version: 7.20.0 + resolution: "@babel/helpers@npm:7.20.0" + dependencies: + "@babel/template": ^7.18.10 + "@babel/traverse": ^7.20.0 + "@babel/types": ^7.20.0 + checksum: a68f271474eabc06d64db3d22f435068c3451ba55828f22b72db0e392dff911a6813de3c7bb783e6e4756fd97f8910904d6d647de92a3dc3bfae14688a1a907a + languageName: node + linkType: hard + "@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.16.7": version: 7.16.10 resolution: "@babel/highlight@npm:7.16.10" @@ -381,6 +546,17 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/highlight@npm:7.18.6" + dependencies: + "@babel/helper-validator-identifier": ^7.18.6 + chalk: ^2.0.0 + js-tokens: ^4.0.0 + checksum: 92d8ee61549de5ff5120e945e774728e5ccd57fd3b2ed6eace020ec744823d4a98e242be1453d21764a30a14769ecd62170fba28539b211799bbaf232bbb2789 + languageName: node + linkType: hard + "@babel/parser@npm:^7.16.7, @babel/parser@npm:^7.17.3, @babel/parser@npm:^7.17.7, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.7.0": version: 7.17.7 resolution: "@babel/parser@npm:7.17.7" @@ -390,6 +566,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.18.10, @babel/parser@npm:^7.19.6, @babel/parser@npm:^7.20.0": + version: 7.20.0 + resolution: "@babel/parser@npm:7.20.0" + bin: + parser: ./bin/babel-parser.js + checksum: d54d68e45ff1b9a0c50a3f79d9031f482eb58f18928525949dc20da5b1658ee79167e756129371fd75d3e8fc7e218ab707727145a68958636be9672c7b71768e + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.16.7": version: 7.16.7 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.16.7" @@ -1378,6 +1563,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.18.10": + version: 7.18.10 + resolution: "@babel/template@npm:7.18.10" + dependencies: + "@babel/code-frame": ^7.18.6 + "@babel/parser": ^7.18.10 + "@babel/types": ^7.18.10 + checksum: 93a6aa094af5f355a72bd55f67fa1828a046c70e46f01b1606e6118fa1802b6df535ca06be83cc5a5e834022be95c7b714f0a268b5f20af984465a71e28f1473 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.16.7, @babel/traverse@npm:^7.16.8, @babel/traverse@npm:^7.17.3, @babel/traverse@npm:^7.4.5, @babel/traverse@npm:^7.7.0": version: 7.17.3 resolution: "@babel/traverse@npm:7.17.3" @@ -1396,6 +1592,24 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.19.6, @babel/traverse@npm:^7.20.0": + version: 7.20.0 + resolution: "@babel/traverse@npm:7.20.0" + dependencies: + "@babel/code-frame": ^7.18.6 + "@babel/generator": ^7.20.0 + "@babel/helper-environment-visitor": ^7.18.9 + "@babel/helper-function-name": ^7.19.0 + "@babel/helper-hoist-variables": ^7.18.6 + "@babel/helper-split-export-declaration": ^7.18.6 + "@babel/parser": ^7.20.0 + "@babel/types": ^7.20.0 + debug: ^4.1.0 + globals: ^11.1.0 + checksum: 19615ec2c3467f929dfa2ae98494961a2c7b333b6628e1c7643188d936abc167c41f5af541b692b1ca776a4d066291a7eb8b22f98aba3d496f362bae4c2082cd + languageName: node + linkType: hard + "@babel/types@npm:^7.1.6, @babel/types@npm:^7.16.0, @babel/types@npm:^7.16.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.4.4, @babel/types@npm:^7.7.0, @babel/types@npm:^7.7.2, @babel/types@npm:^7.8.3": version: 7.17.0 resolution: "@babel/types@npm:7.17.0" @@ -1417,6 +1631,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.18.10, @babel/types@npm:^7.18.6, @babel/types@npm:^7.19.0, @babel/types@npm:^7.19.4, @babel/types@npm:^7.20.0": + version: 7.20.0 + resolution: "@babel/types@npm:7.20.0" + dependencies: + "@babel/helper-string-parser": ^7.19.4 + "@babel/helper-validator-identifier": ^7.19.1 + to-fast-properties: ^2.0.0 + checksum: 8729b1114c707a03625cd79e3ae3a28d69b36ddcf804cb0a4599af226e5e9fad71665bdc0e56c43527ecfcabc545d9c797231f5ce718ae1ab52d31a57b6c2024 + languageName: node + linkType: hard + "@cnakazawa/watch@npm:^1.0.3": version: 1.0.4 resolution: "@cnakazawa/watch@npm:1.0.4" @@ -2234,6 +2459,24 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.2": + version: 0.3.2 + resolution: "@jridgewell/gen-mapping@npm:0.3.2" + dependencies: + "@jridgewell/set-array": ^1.0.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 1832707a1c476afebe4d0fbbd4b9434fdb51a4c3e009ab1e9938648e21b7a97049fa6009393bdf05cab7504108413441df26d8a3c12193996e65493a4efb6882 + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:3.1.0": + version: 3.1.0 + resolution: "@jridgewell/resolve-uri@npm:3.1.0" + checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.0.3": version: 3.0.5 resolution: "@jridgewell/resolve-uri@npm:3.0.5" @@ -2241,6 +2484,20 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.0.1": + version: 1.1.2 + resolution: "@jridgewell/set-array@npm:1.1.2" + checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:1.4.14": + version: 1.4.14 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" + checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:^1.4.10": version: 1.4.11 resolution: "@jridgewell/sourcemap-codec@npm:1.4.11" @@ -2258,6 +2515,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.17 + resolution: "@jridgewell/trace-mapping@npm:0.3.17" + dependencies: + "@jridgewell/resolve-uri": 3.1.0 + "@jridgewell/sourcemap-codec": 1.4.14 + checksum: 9d703b859cff5cd83b7308fd457a431387db5db96bd781a63bf48e183418dd9d3d44e76b9e4ae13237f6abeeb25d739ec9215c1d5bfdd08f66f750a50074a339 + languageName: node + linkType: hard + "@miragejs/pretender-node-polyfill@npm:^0.1.0": version: 0.1.2 resolution: "@miragejs/pretender-node-polyfill@npm:0.1.2" @@ -3625,8 +3892,8 @@ __metadata: ember-cli-sri: ^2.1.1 ember-cli-terser: ^4.0.2 ember-cli-update: ^1.0.1 + ember-composable-helpers: ^5.0.0 ember-concurrency: ^2.3.7 - ember-crumbly: ^3.0.1 ember-data: ~3.27.1 ember-fetch: ^8.1.1 ember-file-upload: ^7.1.0 @@ -5651,6 +5918,27 @@ __metadata: languageName: node linkType: hard +"broccoli-funnel@npm:2.0.1": + version: 2.0.1 + resolution: "broccoli-funnel@npm:2.0.1" + dependencies: + array-equal: ^1.0.0 + blank-object: ^1.0.1 + broccoli-plugin: ^1.3.0 + debug: ^2.2.0 + fast-ordered-set: ^1.0.0 + fs-tree-diff: ^0.5.3 + heimdalljs: ^0.2.0 + minimatch: ^3.0.0 + mkdirp: ^0.5.0 + path-posix: ^1.0.0 + rimraf: ^2.4.3 + symlink-or-copy: ^1.0.0 + walk-sync: ^0.3.1 + checksum: 415257006360c6015835a513c7946f1bc356ea5ed6bd960382bad1f511d81758539690ccbd7cecdc740b7e91f1719088b5bb8f5c024ca4dda089efec229ce0b7 + languageName: node + linkType: hard + "broccoli-funnel@npm:^1.0.1, broccoli-funnel@npm:^1.1.0, broccoli-funnel@npm:^1.2.0": version: 1.2.0 resolution: "broccoli-funnel@npm:1.2.0" @@ -6286,6 +6574,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.21.3": + version: 4.21.4 + resolution: "browserslist@npm:4.21.4" + dependencies: + caniuse-lite: ^1.0.30001400 + electron-to-chromium: ^1.4.251 + node-releases: ^2.0.6 + update-browserslist-db: ^1.0.9 + bin: + browserslist: cli.js + checksum: 4af3793704dbb4615bcd29059ab472344dc7961c8680aa6c4bb84f05340e14038d06a5aead58724eae69455b8fade8b8c69f1638016e87e5578969d74c078b79 + languageName: node + linkType: hard + "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -6685,6 +6987,13 @@ __metadata: languageName: node linkType: hard +"caniuse-lite@npm:^1.0.30001400": + version: 1.0.30001427 + resolution: "caniuse-lite@npm:1.0.30001427" + checksum: 7b21a7d1f10c07130cecb7e7c7c38fd031f3dbd49afaee53fa4bb07355f9765686cad14f6296fbb49838f525c35292278b2c5ee9109c363edea5e134514ab6bb + languageName: node + linkType: hard + "capture-exit@npm:^2.0.0": version: 2.0.0 resolution: "capture-exit@npm:2.0.0" @@ -8139,6 +8448,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.4.251": + version: 1.4.284 + resolution: "electron-to-chromium@npm:1.4.284" + checksum: be496e9dca6509dbdbb54dc32146fc99f8eb716d28a7ee8ccd3eba0066561df36fc51418d8bd7cf5a5891810bf56c0def3418e74248f51ea4a843d423603d10a + languageName: node + linkType: hard + "elliptic@npm:^6.5.3": version: 6.5.4 resolution: "elliptic@npm:6.5.4" @@ -8643,18 +8959,6 @@ __metadata: languageName: node linkType: hard -"ember-cli-htmlbars@npm:^2.0.1": - version: 2.0.5 - resolution: "ember-cli-htmlbars@npm:2.0.5" - dependencies: - broccoli-persistent-filter: ^1.4.3 - hash-for-dep: ^1.2.3 - json-stable-stringify: ^1.0.0 - strip-bom: ^3.0.0 - checksum: c9f2e1c9ea1de80ca9b4d6336798a724b3c4d3d0de7f5cd05b8b6b0bf3655a5d922ccef8b94769613d5d8531511a2292f5a505202c6976f36a7bf4305c324b34 - languageName: node - linkType: hard - "ember-cli-htmlbars@npm:^4.3.1": version: 4.4.1 resolution: "ember-cli-htmlbars@npm:4.4.1" @@ -9203,6 +9507,18 @@ __metadata: languageName: node linkType: hard +"ember-composable-helpers@npm:^5.0.0": + version: 5.0.0 + resolution: "ember-composable-helpers@npm:5.0.0" + dependencies: + "@babel/core": ^7.0.0 + broccoli-funnel: 2.0.1 + ember-cli-babel: ^7.26.3 + resolve: ^1.10.0 + checksum: 8fdceade42f025cb75cb3718de4a6f3836b1a74eca8d30ca7a8c0313fccdce6663ce6fa5e5bd14fd905ecac2a330d55c169f21f559f092a5900d08ddc290fff6 + languageName: node + linkType: hard + "ember-concurrency-decorators@npm:^2.0.0": version: 2.0.3 resolution: "ember-concurrency-decorators@npm:2.0.3" @@ -9254,26 +9570,6 @@ __metadata: languageName: node linkType: hard -"ember-copy@npm:^1.0.0": - version: 1.0.0 - resolution: "ember-copy@npm:1.0.0" - dependencies: - ember-cli-babel: ^6.6.0 - checksum: 41da1aa03148e7de299013f7db3d6356bf28a35a40c14af445149d864baa9e48f1227e0e6a281fd457748ea07047afb6f377db45ea88123e045ba773e93c06f9 - languageName: node - linkType: hard - -"ember-crumbly@npm:^3.0.1": - version: 3.0.1 - resolution: "ember-crumbly@npm:3.0.1" - dependencies: - ember-cli-babel: ^6.6.0 - ember-cli-htmlbars: ^2.0.1 - ember-copy: ^1.0.0 - checksum: 2a87c3a36502f0f173c12ebaa8f3aaedd363118c6ecc7df936896cdd135775a32983854ee3e46aed225638bda906f76bcd09b344b9276ad08878e11676f1d8e7 - languageName: node - linkType: hard - "ember-data@npm:~3.27.1": version: 3.27.1 resolution: "ember-data@npm:3.27.1" @@ -13826,6 +14122,15 @@ __metadata: languageName: node linkType: hard +"json5@npm:^2.2.1": + version: 2.2.1 + resolution: "json5@npm:2.2.1" + bin: + json5: lib/cli.js + checksum: 74b8a23b102a6f2bf2d224797ae553a75488b5adbaee9c9b6e5ab8b510a2fc6e38f876d4c77dea672d4014a44b2399e15f2051ac2b37b87f74c0c7602003543b + languageName: node + linkType: hard + "jsonfile@npm:^2.1.0": version: 2.4.0 resolution: "jsonfile@npm:2.4.0" @@ -15886,6 +16191,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.6": + version: 2.0.6 + resolution: "node-releases@npm:2.0.6" + checksum: e86a926dc9fbb3b41b4c4a89d998afdf140e20a4e8dbe6c0a807f7b2948b42ea97d7fd3ad4868041487b6e9ee98409829c6e4d84a734a4215dff060a7fbeb4bf + languageName: node + linkType: hard + "node-watch@npm:0.7.3": version: 0.7.3 resolution: "node-watch@npm:0.7.3" @@ -21001,6 +21313,20 @@ __metadata: languageName: node linkType: hard +"update-browserslist-db@npm:^1.0.9": + version: 1.0.10 + resolution: "update-browserslist-db@npm:1.0.10" + dependencies: + escalade: ^3.1.1 + picocolors: ^1.0.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + browserslist-lint: cli.js + checksum: 12db73b4f63029ac407b153732e7cd69a1ea8206c9100b482b7d12859cd3cd0bc59c602d7ae31e652706189f1acb90d42c53ab24a5ba563ed13aebdddc5561a0 + languageName: node + linkType: hard + "update-notifier@npm:^2.3.0": version: 2.5.0 resolution: "update-notifier@npm:2.5.0" From e4e00f0d71093119eaada89c6f6b8efffcabcf4e Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Tue, 1 Nov 2022 22:57:04 +0100 Subject: [PATCH 05/44] refactor: static-pages routes to new structure static-pages.static-page.show doesn't work yet. --- app/components/header-nav.hbs | 5 ++++- app/components/header-nav.js | 2 +- app/components/index/public/about-alpha.hbs | 2 +- app/components/index/public/action-buttons.hbs | 2 +- app/components/index/sponsorkliks-alert.hbs | 4 +++- app/controllers/static-pages/index.js | 2 +- app/controllers/static-pages/new.js | 2 +- .../static-pages/{ => static-page}/destroy.js | 2 +- app/controllers/static-pages/{ => static-page}/edit.js | 2 +- app/router.js | 9 ++++++--- app/templates/static-pages/index.hbs | 2 +- app/templates/static-pages/{ => static-page}/destroy.hbs | 0 app/templates/static-pages/{ => static-page}/edit.hbs | 0 app/templates/static-pages/{ => static-page}/show.hbs | 0 14 files changed, 21 insertions(+), 13 deletions(-) rename app/controllers/static-pages/{ => static-page}/destroy.js (77%) rename app/controllers/static-pages/{ => static-page}/edit.js (88%) rename app/templates/static-pages/{ => static-page}/destroy.hbs (100%) rename app/templates/static-pages/{ => static-page}/edit.hbs (100%) rename app/templates/static-pages/{ => static-page}/show.hbs (100%) diff --git a/app/components/header-nav.hbs b/app/components/header-nav.hbs index fc882f11d..6edaeeaa6 100644 --- a/app/components/header-nav.hbs +++ b/app/components/header-nav.hbs @@ -26,7 +26,10 @@ {{#each-in staticPagesForDropdown as |id title|}} - + {{title}} diff --git a/app/components/header-nav.js b/app/components/header-nav.js index db3376e10..a830745e6 100644 --- a/app/components/header-nav.js +++ b/app/components/header-nav.js @@ -95,7 +95,7 @@ export default Component.extend({ addStaticPageOption: function (list, id, localeName) { if (this.availableStaticPages && this.availableStaticPages[id]) { list.push({ - link: 'static-pages.show', + link: 'static-pages.static-page.show', linkArgument: id, title: this.intl.t('component.headerNav.' + localeName), icon: '', diff --git a/app/components/index/public/about-alpha.hbs b/app/components/index/public/about-alpha.hbs index 54ea96523..1fa5627f8 100644 --- a/app/components/index/public/about-alpha.hbs +++ b/app/components/index/public/about-alpha.hbs @@ -6,7 +6,7 @@

diff --git a/app/components/index/public/action-buttons.hbs b/app/components/index/public/action-buttons.hbs index fcaa0feb5..0913f0bfb 100644 --- a/app/components/index/public/action-buttons.hbs +++ b/app/components/index/public/action-buttons.hbs @@ -11,7 +11,7 @@ {{t 'component.index.public.actionButtons.memberButton'}} diff --git a/app/components/index/sponsorkliks-alert.hbs b/app/components/index/sponsorkliks-alert.hbs index 68f7275d8..436837af2 100644 --- a/app/components/index/sponsorkliks-alert.hbs +++ b/app/components/index/sponsorkliks-alert.hbs @@ -17,7 +17,9 @@ bij verschillende webshops verdient Alpha er ook nog wat aan. De uitgebreide uitleg vind je - hier + + hier + .
diff --git a/app/controllers/static-pages/index.js b/app/controllers/static-pages/index.js index 93bb46328..f6a67bbfb 100644 --- a/app/controllers/static-pages/index.js +++ b/app/controllers/static-pages/index.js @@ -11,7 +11,7 @@ export default class StaticPagesIndexController extends FilterableAndSortableCon @tracked sortedAttribute = 'title'; queryParams = ['search', 'sort']; - routeOnEnter = 'static-pages.show'; + routeOnEnter = 'static-pages.static-page.show'; sortableAttributes = [ { value: 'title', diff --git a/app/controllers/static-pages/new.js b/app/controllers/static-pages/new.js index 297dee018..8a42cb21a 100644 --- a/app/controllers/static-pages/new.js +++ b/app/controllers/static-pages/new.js @@ -1,4 +1,4 @@ -import EditStaticPageController from './edit'; +import EditStaticPageController from './static-page/edit'; export default class NewStaticPageController extends EditStaticPageController { successMessage = 'Infopagina aangemaakt!'; diff --git a/app/controllers/static-pages/destroy.js b/app/controllers/static-pages/static-page/destroy.js similarity index 77% rename from app/controllers/static-pages/destroy.js rename to app/controllers/static-pages/static-page/destroy.js index 00adb245e..3cf25d512 100644 --- a/app/controllers/static-pages/destroy.js +++ b/app/controllers/static-pages/static-page/destroy.js @@ -2,5 +2,5 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class StaticPageDestroyController extends DestroyController { successTransitionTarget = 'static-pages.index'; - cancelTransitionTarget = 'static-pages.show'; + cancelTransitionTarget = 'static-pages.static-page.show'; } diff --git a/app/controllers/static-pages/edit.js b/app/controllers/static-pages/static-page/edit.js similarity index 88% rename from app/controllers/static-pages/edit.js rename to app/controllers/static-pages/static-page/edit.js index 7d5633991..ebd96bc1b 100644 --- a/app/controllers/static-pages/edit.js +++ b/app/controllers/static-pages/static-page/edit.js @@ -4,7 +4,7 @@ import { capitalize } from '@ember/string'; export default class EditStaticPageController extends EditController { successMessage = 'Infopagina aangepast!'; - successTransitionTarget = 'static-pages.show'; + successTransitionTarget = 'static-pages.static-page.show'; get staticPageCategoryOptions() { return StaticPageCategories.map((pageCategory) => { diff --git a/app/router.js b/app/router.js index f3dcce67a..1327f7ad9 100644 --- a/app/router.js +++ b/app/router.js @@ -41,10 +41,13 @@ Router.map(function () { this.route('profile'); this.route('static-pages', function () { - this.route('show', { path: '/:id' }); this.route('new'); - this.route('edit', { path: '/:id/edit' }); - this.route('destroy', { path: '/:id/destroy' }); + + this.route('static-page', { path: ':id' }, function () { + this.route('show', { path: '/' }); + this.route('edit'); + this.route('destroy'); + }); }); this.route('quickpost'); diff --git a/app/templates/static-pages/index.hbs b/app/templates/static-pages/index.hbs index 13a8e9c6a..c005ccdd6 100644 --- a/app/templates/static-pages/index.hbs +++ b/app/templates/static-pages/index.hbs @@ -18,7 +18,7 @@
{{#each group.items as |staticPage|}} - +
{{staticPage.title}}
diff --git a/app/templates/static-pages/destroy.hbs b/app/templates/static-pages/static-page/destroy.hbs similarity index 100% rename from app/templates/static-pages/destroy.hbs rename to app/templates/static-pages/static-page/destroy.hbs diff --git a/app/templates/static-pages/edit.hbs b/app/templates/static-pages/static-page/edit.hbs similarity index 100% rename from app/templates/static-pages/edit.hbs rename to app/templates/static-pages/static-page/edit.hbs diff --git a/app/templates/static-pages/show.hbs b/app/templates/static-pages/static-page/show.hbs similarity index 100% rename from app/templates/static-pages/show.hbs rename to app/templates/static-pages/static-page/show.hbs From 97acd515be28fbe9ba7b1d445ca4485e8b8f8a7f Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 6 Nov 2022 19:55:28 +0100 Subject: [PATCH 06/44] refactor: change static-pages routes to new structure --- app/components/header-nav.hbs | 5 +---- app/components/header-nav.js | 2 +- app/components/index/public/about-alpha.hbs | 2 +- app/components/index/public/action-buttons.hbs | 2 +- app/components/index/sponsorkliks-alert.hbs | 2 +- app/controllers/static-pages/index.js | 2 +- .../static-pages/static-page/destroy.js | 2 +- .../static-pages/static-page/edit.js | 2 +- app/router.js | 1 - app/routes/static-pages.js | 15 +++++++++++++++ app/routes/static-pages/destroy.js | 13 ------------- app/routes/static-pages/index.js | 14 -------------- app/routes/static-pages/new.js | 2 +- app/routes/static-pages/static-page.js | 13 +++++++++++++ app/routes/static-pages/static-page/destroy.js | 9 +++++++++ .../static-pages/{ => static-page}/edit.js | 8 ++------ .../{show.js => static-page/index.js} | 18 +++--------------- app/templates/static-pages/index.hbs | 2 +- .../static-page/{show.hbs => index.hbs} | 0 19 files changed, 52 insertions(+), 62 deletions(-) create mode 100644 app/routes/static-pages.js delete mode 100644 app/routes/static-pages/destroy.js create mode 100644 app/routes/static-pages/static-page.js create mode 100644 app/routes/static-pages/static-page/destroy.js rename app/routes/static-pages/{ => static-page}/edit.js (54%) rename app/routes/static-pages/{show.js => static-page/index.js} (55%) rename app/templates/static-pages/static-page/{show.hbs => index.hbs} (100%) diff --git a/app/components/header-nav.hbs b/app/components/header-nav.hbs index 6edaeeaa6..3725ea29e 100644 --- a/app/components/header-nav.hbs +++ b/app/components/header-nav.hbs @@ -26,10 +26,7 @@ {{#each-in staticPagesForDropdown as |id title|}} - + {{title}} diff --git a/app/components/header-nav.js b/app/components/header-nav.js index a830745e6..002f0bfd7 100644 --- a/app/components/header-nav.js +++ b/app/components/header-nav.js @@ -95,7 +95,7 @@ export default Component.extend({ addStaticPageOption: function (list, id, localeName) { if (this.availableStaticPages && this.availableStaticPages[id]) { list.push({ - link: 'static-pages.static-page.show', + link: 'static-pages.static-page', linkArgument: id, title: this.intl.t('component.headerNav.' + localeName), icon: '', diff --git a/app/components/index/public/about-alpha.hbs b/app/components/index/public/about-alpha.hbs index 1fa5627f8..d4f2f847b 100644 --- a/app/components/index/public/about-alpha.hbs +++ b/app/components/index/public/about-alpha.hbs @@ -6,7 +6,7 @@

diff --git a/app/components/index/public/action-buttons.hbs b/app/components/index/public/action-buttons.hbs index 0913f0bfb..f672885b5 100644 --- a/app/components/index/public/action-buttons.hbs +++ b/app/components/index/public/action-buttons.hbs @@ -11,7 +11,7 @@ {{t 'component.index.public.actionButtons.memberButton'}} diff --git a/app/components/index/sponsorkliks-alert.hbs b/app/components/index/sponsorkliks-alert.hbs index 436837af2..b8790be7e 100644 --- a/app/components/index/sponsorkliks-alert.hbs +++ b/app/components/index/sponsorkliks-alert.hbs @@ -17,7 +17,7 @@ bij verschillende webshops verdient Alpha er ook nog wat aan. De uitgebreide uitleg vind je - + hier . diff --git a/app/controllers/static-pages/index.js b/app/controllers/static-pages/index.js index f6a67bbfb..7596bb4df 100644 --- a/app/controllers/static-pages/index.js +++ b/app/controllers/static-pages/index.js @@ -11,7 +11,7 @@ export default class StaticPagesIndexController extends FilterableAndSortableCon @tracked sortedAttribute = 'title'; queryParams = ['search', 'sort']; - routeOnEnter = 'static-pages.static-page.show'; + routeOnEnter = 'static-pages.static-page'; sortableAttributes = [ { value: 'title', diff --git a/app/controllers/static-pages/static-page/destroy.js b/app/controllers/static-pages/static-page/destroy.js index 3cf25d512..42b6bbc93 100644 --- a/app/controllers/static-pages/static-page/destroy.js +++ b/app/controllers/static-pages/static-page/destroy.js @@ -2,5 +2,5 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class StaticPageDestroyController extends DestroyController { successTransitionTarget = 'static-pages.index'; - cancelTransitionTarget = 'static-pages.static-page.show'; + cancelTransitionTarget = 'static-pages.static-page'; } diff --git a/app/controllers/static-pages/static-page/edit.js b/app/controllers/static-pages/static-page/edit.js index ebd96bc1b..20904c65e 100644 --- a/app/controllers/static-pages/static-page/edit.js +++ b/app/controllers/static-pages/static-page/edit.js @@ -4,7 +4,7 @@ import { capitalize } from '@ember/string'; export default class EditStaticPageController extends EditController { successMessage = 'Infopagina aangepast!'; - successTransitionTarget = 'static-pages.static-page.show'; + successTransitionTarget = 'static-pages.static-page'; get staticPageCategoryOptions() { return StaticPageCategories.map((pageCategory) => { diff --git a/app/router.js b/app/router.js index 1327f7ad9..c51dae81a 100644 --- a/app/router.js +++ b/app/router.js @@ -44,7 +44,6 @@ Router.map(function () { this.route('new'); this.route('static-page', { path: ':id' }, function () { - this.route('show', { path: '/' }); this.route('edit'); this.route('destroy'); }); diff --git a/app/routes/static-pages.js b/app/routes/static-pages.js new file mode 100644 index 000000000..6fe99a940 --- /dev/null +++ b/app/routes/static-pages.js @@ -0,0 +1,15 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; +import { capitalize } from '@ember/string'; +import { inject as service } from '@ember/service'; + +export default class StaticPagesRoute extends ApplicationRoute { + @service intl; + + queryParams = {}; + + get breadcrumb() { + return { + title: capitalize(this.intl.t('model.staticPage.name.other').toString()), + }; + } +} diff --git a/app/routes/static-pages/destroy.js b/app/routes/static-pages/destroy.js deleted file mode 100644 index 472b3f1e9..000000000 --- a/app/routes/static-pages/destroy.js +++ /dev/null @@ -1,13 +0,0 @@ -import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; - -export default class DestroyStaticPageRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Informatie pagina verwijderen' }; - - canAccess() { - return this.abilities.can('destroy static-pages'); - } - - model(params) { - return this.store.findRecord('static-page', params.id, params); - } -} diff --git a/app/routes/static-pages/index.js b/app/routes/static-pages/index.js index c885d8aa0..46530fe6c 100644 --- a/app/routes/static-pages/index.js +++ b/app/routes/static-pages/index.js @@ -1,16 +1,6 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; -import { inject as service } from '@ember/service'; -import { capitalize } from '@ember/string'; export default class StaticPagesIndexRoute extends ApplicationRoute { - @service intl; - - get breadcrumb() { - return { - title: capitalize(this.intl.t('model.staticPage.name.other').toString()), - }; - } - get pageActions() { return [ { @@ -22,10 +12,6 @@ export default class StaticPagesIndexRoute extends ApplicationRoute { ]; } - canAccess() { - return this.abilities.can('show static-pages'); - } - model(params) { return this.store.query('static-page', params); } diff --git a/app/routes/static-pages/new.js b/app/routes/static-pages/new.js index 00c11e81c..9cd9bb007 100644 --- a/app/routes/static-pages/new.js +++ b/app/routes/static-pages/new.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class NewStaticPageRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Informatie pagina aanmaken' }; + breadcrumb = { title: 'Infopagina aanmaken' }; canAccess() { return this.abilities.can('create static-pages'); diff --git a/app/routes/static-pages/static-page.js b/app/routes/static-pages/static-page.js new file mode 100644 index 000000000..68e3077cc --- /dev/null +++ b/app/routes/static-pages/static-page.js @@ -0,0 +1,13 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class StaticPageRoute extends ApplicationRoute { + queryParams = {}; + + get breadcrumb() { + return { title: this.controller.model.title }; + } + + model(params) { + return this.store.findRecord('static-page', params.id, params); + } +} diff --git a/app/routes/static-pages/static-page/destroy.js b/app/routes/static-pages/static-page/destroy.js new file mode 100644 index 000000000..71a6fc099 --- /dev/null +++ b/app/routes/static-pages/static-page/destroy.js @@ -0,0 +1,9 @@ +import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; + +export default class StaticPageDestroyRoute extends AuthenticatedRoute { + breadcrumb = { title: 'Infopagina verwijderen' }; + + canAccess() { + return this.abilities.can('destroy static-pages'); + } +} diff --git a/app/routes/static-pages/edit.js b/app/routes/static-pages/static-page/edit.js similarity index 54% rename from app/routes/static-pages/edit.js rename to app/routes/static-pages/static-page/edit.js index 336a2d8f1..043c438cd 100644 --- a/app/routes/static-pages/edit.js +++ b/app/routes/static-pages/static-page/edit.js @@ -1,16 +1,12 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class EditStaticPageRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Informatie pagina aanpassen' }; +export default class StaticPageEditRoute extends AuthenticatedRoute { + breadcrumb = { title: 'Infopagina aanpassen' }; canAccess() { return this.abilities.can('edit static-pages'); } - model(params) { - return this.store.findRecord('static-page', params.id, params); - } - deactivate() { super.deactivate(); this.controller.model?.rollbackAttributes(); diff --git a/app/routes/static-pages/show.js b/app/routes/static-pages/static-page/index.js similarity index 55% rename from app/routes/static-pages/show.js rename to app/routes/static-pages/static-page/index.js index 959a21841..ed88bb172 100644 --- a/app/routes/static-pages/show.js +++ b/app/routes/static-pages/static-page/index.js @@ -1,21 +1,17 @@ import { ApplicationRoute } from 'amber-ui/routes/application/application'; -export default class ShowStaticPagesRoute extends ApplicationRoute { - get breadcrumb() { - return { title: this.controller.model.title }; - } - +export default class StaticPageIndexRoute extends ApplicationRoute { get pageActions() { return [ { - link: 'static-pages.edit', + link: 'static-pages.static-page.edit', title: 'Wijzigen', icon: 'pencil', linkArgument: this.controller.model, canAccess: this.abilities.can('edit static-pages'), }, { - link: 'static-pages.destroy', + link: 'static-pages.static-page.destroy', title: 'Verwijderen', icon: 'trash', linkArgument: this.controller.model, @@ -23,12 +19,4 @@ export default class ShowStaticPagesRoute extends ApplicationRoute { }, ]; } - - canAccess() { - return this.abilities.can('show static-pages'); - } - - model(params) { - return this.store.findRecord('static-page', params.id, params); - } } diff --git a/app/templates/static-pages/index.hbs b/app/templates/static-pages/index.hbs index c005ccdd6..fe7100e68 100644 --- a/app/templates/static-pages/index.hbs +++ b/app/templates/static-pages/index.hbs @@ -18,7 +18,7 @@ {{#each group.items as |staticPage|}} - +
{{staticPage.title}}
diff --git a/app/templates/static-pages/static-page/show.hbs b/app/templates/static-pages/static-page/index.hbs similarity index 100% rename from app/templates/static-pages/static-page/show.hbs rename to app/templates/static-pages/static-page/index.hbs From 7e62b6decf0a33029f4a2ab4fba38e34c04e20d4 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 6 Nov 2022 20:07:57 +0100 Subject: [PATCH 07/44] refactor(package): remove workerpool resolution --- package.json | 3 +-- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6e4dc8101..d0b0680de 100644 --- a/package.json +++ b/package.json @@ -113,8 +113,7 @@ "webpack": "^5.65.0" }, "resolutions": { - "@embroider/macros": "^1.0.0", - "workerpool@^2.3.0": "^2.3.4" + "@embroider/macros": "^1.0.0" }, "engines": { "node": "14.* || >= 16" diff --git a/yarn.lock b/yarn.lock index ca3df1789..632dd5d0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21943,7 +21943,7 @@ __metadata: languageName: node linkType: hard -"workerpool@npm:^2.3.4": +"workerpool@npm:^2.3.0": version: 2.3.4 resolution: "workerpool@npm:2.3.4" dependencies: From 92fec0a4631e92bb3dfbc72823e4bb19618e7bb7 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 6 Nov 2022 20:12:15 +0100 Subject: [PATCH 08/44] fix: optional chain on controller in breadcrumb --- app/routes/static-pages/static-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/static-pages/static-page.js b/app/routes/static-pages/static-page.js index 68e3077cc..ea9e5afee 100644 --- a/app/routes/static-pages/static-page.js +++ b/app/routes/static-pages/static-page.js @@ -4,7 +4,7 @@ export default class StaticPageRoute extends ApplicationRoute { queryParams = {}; get breadcrumb() { - return { title: this.controller.model.title }; + return { title: this.controller?.model.title }; } model(params) { From 78d7c6f9abf4e00f8bdd9bef130092f2d2be9a54 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 6 Nov 2022 20:24:05 +0100 Subject: [PATCH 09/44] refactor: finishing touches on static pages controllers/routes --- app/controllers/static-pages/new.js | 8 +++----- app/controllers/static-pages/static-page/destroy.js | 2 +- app/controllers/static-pages/static-page/edit.js | 2 +- app/routes/static-pages/new.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/controllers/static-pages/new.js b/app/controllers/static-pages/new.js index 8a42cb21a..8c8f97de0 100644 --- a/app/controllers/static-pages/new.js +++ b/app/controllers/static-pages/new.js @@ -1,10 +1,8 @@ import EditStaticPageController from './static-page/edit'; -export default class NewStaticPageController extends EditStaticPageController { +export default class StaticPagesNewController extends EditStaticPageController { successMessage = 'Infopagina aangemaakt!'; cancelMessage = 'Aanmaken geannuleerd.'; - cancelTransitionTarget = 'static-pages.index'; - get cancelTransitionModel() { - return null; - } + cancelTransitionTarget = 'static-pages'; + cancelTransitionModel = null; } diff --git a/app/controllers/static-pages/static-page/destroy.js b/app/controllers/static-pages/static-page/destroy.js index 42b6bbc93..3a1f09856 100644 --- a/app/controllers/static-pages/static-page/destroy.js +++ b/app/controllers/static-pages/static-page/destroy.js @@ -1,6 +1,6 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class StaticPageDestroyController extends DestroyController { - successTransitionTarget = 'static-pages.index'; + successTransitionTarget = 'static-pages'; cancelTransitionTarget = 'static-pages.static-page'; } diff --git a/app/controllers/static-pages/static-page/edit.js b/app/controllers/static-pages/static-page/edit.js index 20904c65e..2231096e0 100644 --- a/app/controllers/static-pages/static-page/edit.js +++ b/app/controllers/static-pages/static-page/edit.js @@ -2,7 +2,7 @@ import EditController from 'amber-ui/controllers/application/edit'; import { StaticPageCategories } from 'amber-ui/constants'; import { capitalize } from '@ember/string'; -export default class EditStaticPageController extends EditController { +export default class StaticPageEditController extends EditController { successMessage = 'Infopagina aangepast!'; successTransitionTarget = 'static-pages.static-page'; diff --git a/app/routes/static-pages/new.js b/app/routes/static-pages/new.js index 9cd9bb007..7ea4942fe 100644 --- a/app/routes/static-pages/new.js +++ b/app/routes/static-pages/new.js @@ -1,6 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class NewStaticPageRoute extends AuthenticatedRoute { +export default class StaticPagesNewRoute extends AuthenticatedRoute { breadcrumb = { title: 'Infopagina aanmaken' }; canAccess() { From f380c5e929ef2492e7d78264af5512e947742323 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 6 Nov 2022 21:53:42 +0100 Subject: [PATCH 10/44] fix: skip breadcrumb when model not loaded --- app/controllers/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application.js b/app/controllers/application.js index 70ded4cbd..45cb09e45 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -12,7 +12,7 @@ export default class ApplicationController extends Controller { }; return linkListToArray(this.router.currentRoute).filter( - (routeInfo) => routeInfo.metadata?.breadcrumb + (routeInfo) => routeInfo.metadata?.breadcrumb?.title ); } } From 5b346cbf79a8942f32509eb8e1f462d2ba648342 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Mon, 7 Nov 2022 22:52:31 +0100 Subject: [PATCH 11/44] refactor: restructure activities controllers and routes --- .../form/response/response-card.hbs | 2 +- app/components/model-form/file-input.js | 2 +- app/components/tools/closing-activities.hbs | 4 +-- app/components/tools/upcoming-activities.hbs | 4 +-- .../activities/{ => activity}/destroy.js | 4 +-- .../activities/{ => activity}/edit.js | 8 +++--- .../{ => activity}/generate-alias.js | 0 .../activities/{show.js => activity/index.js} | 0 .../{ => activity}/print-enrolled.js | 0 app/controllers/activities/ical.js | 2 +- app/controllers/activities/index.js | 3 ++- app/controllers/activities/new.js | 10 +++---- app/controllers/form/responses/destroy.js | 4 +-- app/controllers/polls/edit.js | 2 +- app/controllers/static-pages/index.js | 1 + app/controllers/static-pages/new.js | 4 +-- app/controllers/users/batch/new.js | 2 +- app/router.js | 16 +++++++----- app/routes/activities.js | 6 +++++ app/routes/activities/activity.js | 13 ++++++++++ .../activities/{ => activity}/destroy.js | 6 +---- app/routes/activities/{ => activity}/edit.js | 6 ++--- .../{ => activity}/generate-alias.js | 10 +++---- .../activities/{show.js => activity/index.js} | 26 +++++++------------ .../{ => activity}/print-enrolled.js | 6 +---- app/routes/activities/ical.js | 4 +-- app/routes/activities/index.js | 4 +-- .../activities/{ => activity}/destroy.hbs | 8 ++---- .../activities/{ => activity}/edit.hbs | 0 .../{ => activity}/generate-alias.hbs | 0 .../{show.hbs => activity/index.hbs} | 0 .../{ => activity}/print-enrolled.hbs | 2 +- app/templates/activities/index.hbs | 2 +- 33 files changed, 81 insertions(+), 80 deletions(-) rename app/controllers/activities/{ => activity}/destroy.js (61%) rename app/controllers/activities/{ => activity}/edit.js (87%) rename app/controllers/activities/{ => activity}/generate-alias.js (100%) rename app/controllers/activities/{show.js => activity/index.js} (100%) rename app/controllers/activities/{ => activity}/print-enrolled.js (100%) create mode 100644 app/routes/activities.js create mode 100644 app/routes/activities/activity.js rename app/routes/activities/{ => activity}/destroy.js (58%) rename app/routes/activities/{ => activity}/edit.js (67%) rename app/routes/activities/{ => activity}/generate-alias.js (50%) rename app/routes/activities/{show.js => activity/index.js} (79%) rename app/routes/activities/{ => activity}/print-enrolled.js (58%) rename app/templates/activities/{ => activity}/destroy.hbs (85%) rename app/templates/activities/{ => activity}/edit.hbs (100%) rename app/templates/activities/{ => activity}/generate-alias.hbs (100%) rename app/templates/activities/{show.hbs => activity/index.hbs} (100%) rename app/templates/activities/{ => activity}/print-enrolled.hbs (99%) diff --git a/app/components/form/response/response-card.hbs b/app/components/form/response/response-card.hbs index d62b1c521..9d2176f53 100644 --- a/app/components/form/response/response-card.hbs +++ b/app/components/form/response/response-card.hbs @@ -15,7 +15,7 @@ @inputLayout='vertical' > {{#if form.questions}} - + Annuleren Vragen met een * zijn verplicht diff --git a/app/components/model-form/file-input.js b/app/components/model-form/file-input.js index ad9a5767b..1a6d85aac 100644 --- a/app/components/model-form/file-input.js +++ b/app/components/model-form/file-input.js @@ -1,6 +1,6 @@ import { computed } from '@ember/object'; import EmberArray from '@ember/array'; -import ENV from '../../config/environment'; +import ENV from 'amber-ui/config/environment'; import ModelFormTextInputComponent from './text-input'; export default ModelFormTextInputComponent.extend({ diff --git a/app/components/tools/closing-activities.hbs b/app/components/tools/closing-activities.hbs index 772a545ac..1dfca8771 100644 --- a/app/components/tools/closing-activities.hbs +++ b/app/components/tools/closing-activities.hbs @@ -2,7 +2,7 @@
- +
Sluitende inschrijflijsten
@@ -34,7 +34,7 @@
    {{#each activities as |activity|}} - +
  • {{activity.title}}
    diff --git a/app/components/tools/upcoming-activities.hbs b/app/components/tools/upcoming-activities.hbs index ae3e442bf..b625d976d 100644 --- a/app/components/tools/upcoming-activities.hbs +++ b/app/components/tools/upcoming-activities.hbs @@ -1,7 +1,7 @@
    - +
    Komende activiteiten
    @@ -33,7 +33,7 @@
      {{#each activities as |activity|}} - +
    • {{activity.title}}
      diff --git a/app/controllers/activities/destroy.js b/app/controllers/activities/activity/destroy.js similarity index 61% rename from app/controllers/activities/destroy.js rename to app/controllers/activities/activity/destroy.js index 8673e0f8a..8972ad596 100644 --- a/app/controllers/activities/destroy.js +++ b/app/controllers/activities/activity/destroy.js @@ -1,6 +1,6 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class ActivityDestroyController extends DestroyController { - successTransitionTarget = 'activities.index'; - cancelTransitionTarget = 'activities.show'; + successTransitionTarget = 'activities'; + cancelTransitionTarget = 'activities.activity'; } diff --git a/app/controllers/activities/edit.js b/app/controllers/activities/activity/edit.js similarity index 87% rename from app/controllers/activities/edit.js rename to app/controllers/activities/activity/edit.js index 7a938961a..b1a01797e 100644 --- a/app/controllers/activities/edit.js +++ b/app/controllers/activities/activity/edit.js @@ -4,12 +4,12 @@ import { ActivityCategories } from 'amber-ui/constants'; import { isNone } from '@ember/utils'; import { inject as service } from '@ember/service'; // eslint-disable-next-line ember/no-computed-properties-in-native-classes -import EditController from '../application/edit'; -import { union } from '../../utils/array-operations'; +import EditController from 'amber-ui/controllers/application/edit'; +import { union } from 'amber-ui/utils/array-operations'; -export default class EditActivityController extends EditController { +export default class ActivityEditController extends EditController { successMessage = 'Activiteit opgeslagen!'; - successTransitionTarget = 'activities.show'; + successTransitionTarget = 'activities.activity'; @service session; @service abilities; diff --git a/app/controllers/activities/generate-alias.js b/app/controllers/activities/activity/generate-alias.js similarity index 100% rename from app/controllers/activities/generate-alias.js rename to app/controllers/activities/activity/generate-alias.js diff --git a/app/controllers/activities/show.js b/app/controllers/activities/activity/index.js similarity index 100% rename from app/controllers/activities/show.js rename to app/controllers/activities/activity/index.js diff --git a/app/controllers/activities/print-enrolled.js b/app/controllers/activities/activity/print-enrolled.js similarity index 100% rename from app/controllers/activities/print-enrolled.js rename to app/controllers/activities/activity/print-enrolled.js diff --git a/app/controllers/activities/ical.js b/app/controllers/activities/ical.js index 8f6583911..4e87259ee 100644 --- a/app/controllers/activities/ical.js +++ b/app/controllers/activities/ical.js @@ -5,7 +5,7 @@ import { inject as service } from '@ember/service'; import { ActivityCategories } from 'amber-ui/constants'; import { tracked } from '@glimmer/tracking'; -export default class IcalController extends Controller { +export default class ActivitiesIcalController extends Controller { @service session; @tracked activityCategoryOptions; diff --git a/app/controllers/activities/index.js b/app/controllers/activities/index.js index d6c7f7e4f..0ad739b5c 100644 --- a/app/controllers/activities/index.js +++ b/app/controllers/activities/index.js @@ -5,7 +5,8 @@ export default class ActivitiesIndexController extends FilterableAndSortableCont @tracked sortedAttribute = 'start_time'; queryParams = ['search', 'sort', 'page']; - routeOnEnter = 'activities.show'; + + routeOnEnter = 'activities.activity'; sortableAttributes = [ { value: 'title', diff --git a/app/controllers/activities/new.js b/app/controllers/activities/new.js index 480e91672..da5d7cdfe 100644 --- a/app/controllers/activities/new.js +++ b/app/controllers/activities/new.js @@ -1,10 +1,8 @@ -import EditActivityController from './edit'; +import ActivityEditController from './activity/edit'; -export default class NewActivityController extends EditActivityController { +export default class ActivityNewController extends ActivityEditController { successMessage = 'Aanmaken gelukt!'; cancelMessage = 'Aanmaken geannuleerd.'; - cancelTransitionTarget = 'activities.index'; - get cancelTransitionModel() { - return null; - } + cancelTransitionTarget = 'activities'; + cancelTransitionModel = null; } diff --git a/app/controllers/form/responses/destroy.js b/app/controllers/form/responses/destroy.js index 4a90b0673..feadc0065 100644 --- a/app/controllers/form/responses/destroy.js +++ b/app/controllers/form/responses/destroy.js @@ -5,8 +5,8 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class FormResponseDestroyController extends DestroyController { @service store; successMessage = 'Je inschrijving is verwijderd.'; - successTransitionTarget = 'activities.index'; - cancelTransitionTarget = 'activities.index'; + successTransitionTarget = 'activities'; + cancelTransitionTarget = 'activities'; // important note: there is no way (currently) to redirect from a form response to the activity, since the models // are not designed with this in mind. // I would not mind this being enabled by a slight redesign in the future, though. diff --git a/app/controllers/polls/edit.js b/app/controllers/polls/edit.js index e3e8baf58..752ec5021 100644 --- a/app/controllers/polls/edit.js +++ b/app/controllers/polls/edit.js @@ -1,6 +1,6 @@ import EditController from '../application/edit'; import { action } from '@ember/object'; -import { union } from '../../utils/array-operations'; +import { union } from 'amber-ui/utils/array-operations'; export default class EditPollController extends EditController { successMessage = 'Poll opgeslagen!'; diff --git a/app/controllers/static-pages/index.js b/app/controllers/static-pages/index.js index 7596bb4df..836ab0c94 100644 --- a/app/controllers/static-pages/index.js +++ b/app/controllers/static-pages/index.js @@ -11,6 +11,7 @@ export default class StaticPagesIndexController extends FilterableAndSortableCon @tracked sortedAttribute = 'title'; queryParams = ['search', 'sort']; + routeOnEnter = 'static-pages.static-page'; sortableAttributes = [ { diff --git a/app/controllers/static-pages/new.js b/app/controllers/static-pages/new.js index 8c8f97de0..82cc6ec98 100644 --- a/app/controllers/static-pages/new.js +++ b/app/controllers/static-pages/new.js @@ -1,6 +1,6 @@ -import EditStaticPageController from './static-page/edit'; +import StaticPageEditController from './static-page/edit'; -export default class StaticPagesNewController extends EditStaticPageController { +export default class StaticPagesNewController extends StaticPageEditController { successMessage = 'Infopagina aangemaakt!'; cancelMessage = 'Aanmaken geannuleerd.'; cancelTransitionTarget = 'static-pages'; diff --git a/app/controllers/users/batch/new.js b/app/controllers/users/batch/new.js index d3a32db56..31b90630e 100644 --- a/app/controllers/users/batch/new.js +++ b/app/controllers/users/batch/new.js @@ -3,7 +3,7 @@ import EmberArray, { A } from '@ember/array'; import { action } from '@ember/object'; import { tracked } from '@glimmer/tracking'; import { isInvalidResponse } from 'ember-fetch/errors'; -import NewController from '../../application/new'; +import NewController from 'amber-ui/controllers//application/new'; export default class NewUserBatchController extends NewController { successMessage = 'Gebruikers aanmaken gelukt!'; diff --git a/app/router.js b/app/router.js index c51dae81a..d5d6d6324 100644 --- a/app/router.js +++ b/app/router.js @@ -158,13 +158,17 @@ Router.map(function () { }); this.route('activities', function () { - this.route('show', { path: '/:id' }); - this.route('ical'); this.route('new'); - this.route('edit', { path: '/:id/edit' }); - this.route('destroy', { path: '/:id/destroy' }); - this.route('generate-alias', { path: '/:id/generate-alias' }); - this.route('print-enrolled', { path: '/:id/print-enrolled' }); + + this.route('ical'); + + this.route('activity', { path: ':id' }, function () { + this.route('edit'); + this.route('destroy'); + + this.route('generate-alias'); + this.route('print-enrolled'); + }); }); this.route('debit', function () { diff --git a/app/routes/activities.js b/app/routes/activities.js new file mode 100644 index 000000000..3108e44d2 --- /dev/null +++ b/app/routes/activities.js @@ -0,0 +1,6 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class ActivitiesRoute extends ApplicationRoute { + breadcrumb = { title: 'Activiteiten' }; + queryParams = {}; +} diff --git a/app/routes/activities/activity.js b/app/routes/activities/activity.js new file mode 100644 index 000000000..e1efa7673 --- /dev/null +++ b/app/routes/activities/activity.js @@ -0,0 +1,13 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class ActivityRoute extends ApplicationRoute { + queryParams = {}; + + get breadcrumb() { + return { title: this.controller?.model.title }; + } + + model(params) { + return this.store.findRecord('activity', params.id, params); + } +} diff --git a/app/routes/activities/destroy.js b/app/routes/activities/activity/destroy.js similarity index 58% rename from app/routes/activities/destroy.js rename to app/routes/activities/activity/destroy.js index 88566341a..58a80d61d 100644 --- a/app/routes/activities/destroy.js +++ b/app/routes/activities/activity/destroy.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class DestroyActivityRoute extends AuthenticatedRoute { +export default class ActivityDestroyRoute extends AuthenticatedRoute { breadcrumb = { title: 'Activiteit verwijderen' }; canAccess() { return this.abilities.can('destroy activities'); } - - model(params) { - return this.store.findRecord('activity', params.id, params); - } } diff --git a/app/routes/activities/edit.js b/app/routes/activities/activity/edit.js similarity index 67% rename from app/routes/activities/edit.js rename to app/routes/activities/activity/edit.js index 8cd8c0647..70fecf079 100644 --- a/app/routes/activities/edit.js +++ b/app/routes/activities/activity/edit.js @@ -1,14 +1,14 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class EdityActivityRoute extends AuthenticatedRoute { +export default class ActivityEditRoute extends AuthenticatedRoute { breadcrumb = { title: 'Activiteit aanpassen' }; canAccess(model) { return this.abilities.can('edit activity', model); } - async model(params) { - const activity = await this.store.findRecord('activity', params.id, params); + async model() { + const activity = this.modelFor('activities.activity'); await activity.form; return activity; } diff --git a/app/routes/activities/generate-alias.js b/app/routes/activities/activity/generate-alias.js similarity index 50% rename from app/routes/activities/generate-alias.js rename to app/routes/activities/activity/generate-alias.js index 96f0aa0e6..f19c05933 100644 --- a/app/routes/activities/generate-alias.js +++ b/app/routes/activities/activity/generate-alias.js @@ -1,15 +1,15 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class GenerateAliasRoute extends AuthenticatedRoute { +export default class ActivityGenerateAliasRoute extends AuthenticatedRoute { breadcrumb = { title: 'Creëer mailalias' }; canAccess(model) { return this.abilities.can('generate alias for activity', model); } - model(params) { - return this.store - .findRecord('activity', params.id, params) - .then((activity) => activity.get('form').then(() => activity)); + async model() { + const activity = this.modelFor('activities.activity'); + await activity.form; + return activity; } } diff --git a/app/routes/activities/show.js b/app/routes/activities/activity/index.js similarity index 79% rename from app/routes/activities/show.js rename to app/routes/activities/activity/index.js index a6c98feff..edf151322 100644 --- a/app/routes/activities/show.js +++ b/app/routes/activities/activity/index.js @@ -3,7 +3,7 @@ import { inject as service } from '@ember/service'; import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; import FormLoadOrCreateUtil from 'amber-ui/utils/form-load-or-create'; -export default class ShowActivityRoute extends AuthenticatedRoute { +export default class ActivityIndexRoute extends AuthenticatedRoute { @service store; constructor() { @@ -11,29 +11,25 @@ export default class ShowActivityRoute extends AuthenticatedRoute { this.formLoadOrCreateUtil = new FormLoadOrCreateUtil(this); } - get breadcrumb() { - return { title: this.controller.model.activity.title }; - } - get pageActions() { const { activity } = this.controller.model; return [ { - link: 'activities.edit', + link: 'activities.activity.edit', title: 'Wijzigen', icon: 'pencil', linkArgument: activity, canAccess: this.abilities.can('edit activity', activity), }, { - link: 'activities.destroy', + link: 'activities.activity.destroy', title: 'Verwijderen', icon: 'trash', linkArgument: activity, canAccess: this.abilities.can('destroy activities'), }, { - link: 'activities.print-enrolled', + link: 'activities.activity.print-enrolled', title: 'Print ingeschrevenen', icon: 'print', linkArgument: activity, @@ -43,7 +39,7 @@ export default class ShowActivityRoute extends AuthenticatedRoute { ), }, { - link: 'activities.generate-alias', + link: 'activities.activity.generate-alias', title: 'Mail ingeschrevenen', icon: 'paper-plane', linkArgument: activity, @@ -57,19 +53,15 @@ export default class ShowActivityRoute extends AuthenticatedRoute { return this.abilities.can('show activities'); } - model(params) { - const activityPromise = this.store.findRecord( - 'activity', - params.id, - params - ); + model() { + const activity = this.modelFor('activities.activity'); let formPromise, responsePromise; if ( this.abilities.can('show form/forms') && this.abilities.can('show form/responses') ) { - formPromise = activityPromise.then((activity) => activity.get('form')); + formPromise = activity.form; responsePromise = formPromise // Load or create the response .then((form) => @@ -86,7 +78,7 @@ export default class ShowActivityRoute extends AuthenticatedRoute { } return hash({ - activity: activityPromise, + activity, form: formPromise, currentUserResponse: responsePromise, }); diff --git a/app/routes/activities/print-enrolled.js b/app/routes/activities/activity/print-enrolled.js similarity index 58% rename from app/routes/activities/print-enrolled.js rename to app/routes/activities/activity/print-enrolled.js index 45498dcf6..15e554eb8 100644 --- a/app/routes/activities/print-enrolled.js +++ b/app/routes/activities/activity/print-enrolled.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class PrintEnrolledRoute extends AuthenticatedRoute { +export default class ActivityPrintEnrolledRoute extends AuthenticatedRoute { breadcrumb = { title: 'Print inschrijvingen/streeplijst' }; canAccess(model) { return this.abilities.can('edit activity', model); } - - model(params) { - return this.store.findRecord('activity', params.id, params); - } } diff --git a/app/routes/activities/ical.js b/app/routes/activities/ical.js index d836dd3bc..57130242f 100644 --- a/app/routes/activities/ical.js +++ b/app/routes/activities/ical.js @@ -1,7 +1,7 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class IcalRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Agenda Ical' }; +export default class ActivitiesIcalRoute extends AuthenticatedRoute { + breadcrumb = { title: 'Agenda iCal' }; canAccess() { return this.abilities.can('show ical activities'); diff --git a/app/routes/activities/index.js b/app/routes/activities/index.js index 2d1ad66ae..3ade20f67 100644 --- a/app/routes/activities/index.js +++ b/app/routes/activities/index.js @@ -1,8 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; export default class ActivityIndexRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Activiteiten' }; - queryParams = { search: { refreshModel: true, @@ -28,7 +26,7 @@ export default class ActivityIndexRoute extends AuthenticatedRoute { }, { link: 'activities.ical', - title: 'Ical link', + title: 'iCal link', icon: 'calendar-days', canAccess: this.abilities.can('show ical activities'), }, diff --git a/app/templates/activities/destroy.hbs b/app/templates/activities/activity/destroy.hbs similarity index 85% rename from app/templates/activities/destroy.hbs rename to app/templates/activities/activity/destroy.hbs index a5e42fadb..5e086e865 100644 --- a/app/templates/activities/destroy.hbs +++ b/app/templates/activities/activity/destroy.hbs @@ -8,7 +8,7 @@ Je kunt deze activiteit niet verwijderen, omdat er al reacties zijn!
    @@ -23,11 +23,7 @@ - {{#if errorMessage}} diff --git a/app/templates/activities/edit.hbs b/app/templates/activities/activity/edit.hbs similarity index 100% rename from app/templates/activities/edit.hbs rename to app/templates/activities/activity/edit.hbs diff --git a/app/templates/activities/generate-alias.hbs b/app/templates/activities/activity/generate-alias.hbs similarity index 100% rename from app/templates/activities/generate-alias.hbs rename to app/templates/activities/activity/generate-alias.hbs diff --git a/app/templates/activities/show.hbs b/app/templates/activities/activity/index.hbs similarity index 100% rename from app/templates/activities/show.hbs rename to app/templates/activities/activity/index.hbs diff --git a/app/templates/activities/print-enrolled.hbs b/app/templates/activities/activity/print-enrolled.hbs similarity index 99% rename from app/templates/activities/print-enrolled.hbs rename to app/templates/activities/activity/print-enrolled.hbs index de6d7f119..0d3f1ec4c 100644 --- a/app/templates/activities/print-enrolled.hbs +++ b/app/templates/activities/activity/print-enrolled.hbs @@ -132,7 +132,7 @@ Afdrukken diff --git a/app/templates/activities/index.hbs b/app/templates/activities/index.hbs index 08c9e51f4..5b939f681 100644 --- a/app/templates/activities/index.hbs +++ b/app/templates/activities/index.hbs @@ -32,7 +32,7 @@ {{#each model as |activity|}} From ed2e26e69bf0d3850c84e1a92bfa98f0c663c4ab Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Mon, 7 Nov 2022 23:13:19 +0100 Subject: [PATCH 12/44] refactor: restructure articles controllers and routes --- app/components/cards/article-card.hbs | 4 ++-- app/components/cards/frontpage-article-card.hbs | 2 +- app/components/index/special-promo.hbs | 2 +- app/controllers/article-comments/destroy.js | 6 +++--- app/controllers/articles/{ => article}/destroy.js | 4 ++-- app/controllers/articles/{ => article}/edit.js | 8 ++++---- .../articles/{show.js => article/index.js} | 0 app/controllers/articles/index.js | 2 +- app/controllers/articles/new.js | 8 +++----- app/controllers/groups/edit.js | 2 +- app/controllers/polls/edit.js | 2 +- app/router.js | 8 +++++--- app/routes/article-comments/destroy.js | 2 +- app/routes/articles.js | 15 +++++++++++++++ app/routes/articles/article.js | 13 +++++++++++++ app/routes/articles/{ => article}/destroy.js | 6 +----- app/routes/articles/{ => article}/edit.js | 6 +----- app/routes/articles/{show.js => article/index.js} | 14 +++----------- app/routes/articles/index.js | 14 -------------- app/routes/articles/new.js | 2 +- app/templates/articles/{ => article}/destroy.hbs | 0 app/templates/articles/{ => article}/edit.hbs | 0 .../articles/{show.hbs => article/index.hbs} | 0 app/templates/articles/index.hbs | 2 +- 24 files changed, 60 insertions(+), 62 deletions(-) rename app/controllers/articles/{ => article}/destroy.js (62%) rename app/controllers/articles/{ => article}/edit.js (88%) rename app/controllers/articles/{show.js => article/index.js} (100%) create mode 100644 app/routes/articles.js create mode 100644 app/routes/articles/article.js rename app/routes/articles/{ => article}/destroy.js (57%) rename app/routes/articles/{ => article}/edit.js (66%) rename app/routes/articles/{show.js => article/index.js} (66%) rename app/templates/articles/{ => article}/destroy.hbs (100%) rename app/templates/articles/{ => article}/edit.hbs (100%) rename app/templates/articles/{show.hbs => article/index.hbs} (100%) diff --git a/app/components/cards/article-card.hbs b/app/components/cards/article-card.hbs index 3fb0372e6..d81740d13 100644 --- a/app/components/cards/article-card.hbs +++ b/app/components/cards/article-card.hbs @@ -23,7 +23,7 @@
    - +

    {{#if article.pinned}}{{/if}} {{article.title}} @@ -101,7 +101,7 @@ }} {{#if useMaxHeight}} -

  • {{else}}
  • - +
    - {{user.fullNameWithNickname}} + + {{user.fullNameWithNickname}} + {{moment-format user.birthday 'DD-MMM'}} diff --git a/app/components/user-comment.hbs b/app/components/user-comment.hbs index 3be062bfa..1f3db6a73 100644 --- a/app/components/user-comment.hbs +++ b/app/components/user-comment.hbs @@ -1,5 +1,5 @@
    - +
    {{#if (can 'show users')}} - + {{comment.author.fullNameWithNickname}} {{else}} diff --git a/app/components/users/password-settings.js b/app/components/users/password-settings.js index 2e67dc67e..03053b9f6 100644 --- a/app/components/users/password-settings.js +++ b/app/components/users/password-settings.js @@ -46,7 +46,7 @@ export default Component.extend({ this.set('password', ''); this.set('passwordConfirmation', ''); this.flashNotice.sendSuccess('Wachtwoord succesvol aangepast!'); - this.transitionToRoute('users.show-security', userId); + this.transitionToRoute('users.user.security', userId); } else if (isInvalidResponse(response)) { let json = await response.json(); this.set( diff --git a/app/controllers/groups/group/index.js b/app/controllers/groups/group/index.js index 448212f1b..1ede07e47 100644 --- a/app/controllers/groups/group/index.js +++ b/app/controllers/groups/group/index.js @@ -25,7 +25,7 @@ export default class GroupIndexController extends GroupMembershipsController { selectFirstItem() { if (this.filteredModels.length > 0) { this.transitionToRoute( - 'users.show', + 'users.user', this.filteredModels.firstObject.user.get('id') ); } diff --git a/app/controllers/mail-aliases/index.js b/app/controllers/mail-aliases/index.js index f42348485..319da12ae 100644 --- a/app/controllers/mail-aliases/index.js +++ b/app/controllers/mail-aliases/index.js @@ -5,7 +5,7 @@ export default class MailAliasesIndexController extends FilterableAndSortableCon @tracked sortedAttribute = 'email'; queryParams = ['search', 'sort']; - routeOnEnter = 'users.show'; + routeOnEnter = 'users.user'; sortableAttributes = [ { value: 'email', diff --git a/app/controllers/users/batch/new.js b/app/controllers/users/batch/new.js index ee7ee94ef..f8ac9aebc 100644 --- a/app/controllers/users/batch/new.js +++ b/app/controllers/users/batch/new.js @@ -1,20 +1,13 @@ -import { inject as service } from '@ember/service'; import EmberArray, { A } from '@ember/array'; +import NewController from 'amber-ui/controllers/application/new'; import { action } from '@ember/object'; -import { tracked } from '@glimmer/tracking'; import { isInvalidResponse } from 'ember-fetch/errors'; -import NewController from 'amber-ui/controllers//application/new'; - -export default class NewUserBatchController extends NewController { - successMessage = 'Gebruikers aanmaken gelukt!'; - cancelMessage = 'Gebruikers aanmaken geannuleerd.'; - cancelTransitionTarget = 'users.index'; - successTransitionTarget = 'users.index'; - get successTransitionModel() { - return null; - } +import { inject as service } from '@ember/service'; +import { tracked } from '@glimmer/tracking'; +export default class BatchNewController extends NewController { @service fetch; + @tracked importFile = null; @tracked addToGroup = null; @tracked reviewing = false; @@ -22,6 +15,12 @@ export default class NewUserBatchController extends NewController { @tracked importErrors = A(); @tracked properties = A(); + successMessage = 'Gebruikers aanmaken gelukt!'; + cancelMessage = 'Gebruikers aanmaken geannuleerd.'; + cancelTransitionTarget = 'users'; + successTransitionTarget = 'users'; + successTransitionModel = null; + validMimetypes = EmberArray.apply([ 'text/csv', 'application/vnd.oasis.opendocument.spreadsheet', @@ -92,7 +91,7 @@ export default class NewUserBatchController extends NewController { if (response.ok) { this.flashNotice.sendSuccess('Gebruikers opgeslagen'); - this.transitionToRoute('users.index'); + this.transitionToRoute('users'); } else { this.flashNotice.sendError('Gebruikers niet opgeslagen'); this.transitionToRoute('users.batch.new'); diff --git a/app/controllers/users/edit-permissions.js b/app/controllers/users/edit-permissions.js deleted file mode 100644 index bb04d09f3..000000000 --- a/app/controllers/users/edit-permissions.js +++ /dev/null @@ -1,6 +0,0 @@ -import UserEditController from 'amber-ui/controllers/users/edit'; - -export default class EditUserPermissionsController extends UserEditController { - successMessage = 'Rechten gewijzigd!'; - successTransitionTarget = 'users.show-permissions'; -} diff --git a/app/controllers/users/edit-privacy.js b/app/controllers/users/edit-privacy.js deleted file mode 100644 index abc416fbb..000000000 --- a/app/controllers/users/edit-privacy.js +++ /dev/null @@ -1,3 +0,0 @@ -import EditUserController from './edit'; - -export default class EditUserPrivacyController extends EditUserController {} diff --git a/app/controllers/users/forgot-password.js b/app/controllers/users/forgot-password.js index 2af0ab845..b181f2782 100644 --- a/app/controllers/users/forgot-password.js +++ b/app/controllers/users/forgot-password.js @@ -3,7 +3,7 @@ import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import { tracked } from '@glimmer/tracking'; -export default class UserForgotPasswordController extends Controller { +export default class UsersForgotPasswordController extends Controller { @service fetch; @tracked errorMessage = null; diff --git a/app/controllers/users/index.js b/app/controllers/users/index.js index def31b4e8..a0c4579ee 100644 --- a/app/controllers/users/index.js +++ b/app/controllers/users/index.js @@ -5,7 +5,8 @@ export default class UsersIndexController extends FilterableAndSortableControlle @tracked sortedAttribute = 'first_name'; queryParams = ['search', 'sort', 'page']; - routeOnEnter = 'users.show'; + + routeOnEnter = 'users.user'; sortableAttributes = [ { value: 'username', diff --git a/app/controllers/users/members.js b/app/controllers/users/members.js index a9208fa19..cd33fa87c 100644 --- a/app/controllers/users/members.js +++ b/app/controllers/users/members.js @@ -5,7 +5,8 @@ export default class UsersMembersController extends FilterableAndSortableControl @tracked sortedAttribute = 'first_name'; queryParams = ['search', 'sort']; - routeOnEnter = 'users.show'; + + routeOnEnter = 'users.user'; sortableAttributes = [ { value: 'username', diff --git a/app/controllers/users/new.js b/app/controllers/users/new.js index 3cc800e61..d2c2141c1 100644 --- a/app/controllers/users/new.js +++ b/app/controllers/users/new.js @@ -1,10 +1,8 @@ -import EditUserController from './edit'; +import EditIndexController from './user/edit'; -export default class NewUserController extends EditUserController { +export default class UsersNewController extends EditIndexController { successMessage = 'Gebruiker aangemaakt!'; cancelMessage = 'Gebruiker aanmaken geannuleerd.'; - cancelTransitionTarget = 'users.index'; - get cancelTransitionModel() { - return null; - } + cancelTransitionTarget = 'users'; + cancelTransitionModel = null; } diff --git a/app/controllers/users/activate-account.js b/app/controllers/users/user/activate-account.js similarity index 100% rename from app/controllers/users/activate-account.js rename to app/controllers/users/user/activate-account.js index 7191e69bb..3b4b42e1a 100644 --- a/app/controllers/users/activate-account.js +++ b/app/controllers/users/user/activate-account.js @@ -1,7 +1,7 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; -import { isNone } from '@ember/utils'; import { isNotFoundResponse } from 'ember-fetch/errors'; +import { isNone } from '@ember/utils'; import { run } from '@ember/runloop'; import { inject as service } from '@ember/service'; import { tracked } from '@glimmer/tracking'; diff --git a/app/controllers/users/edit.js b/app/controllers/users/user/edit/index.js similarity index 90% rename from app/controllers/users/edit.js rename to app/controllers/users/user/edit/index.js index 110c0f0e3..d2eaf63d8 100644 --- a/app/controllers/users/edit.js +++ b/app/controllers/users/user/edit/index.js @@ -1,16 +1,16 @@ -import { action } from '@ember/object'; import { DigtusSubscriptionPreferenceTypes, AlmanakSubscriptionPreferenceTypes, } from 'amber-ui/constants'; import EditController from 'amber-ui/controllers/application/edit'; +import { action } from '@ember/object'; import { inject as service } from '@ember/service'; -export default class EditUserController extends EditController { +export default class EditIndexController extends EditController { @service session; successMessage = 'Gegevens gewijzigd!'; - successTransitionTarget = 'users.show'; + successTransitionTarget = 'users.user'; get canEditOnlyOwnProperties() { return ( diff --git a/app/controllers/users/user/edit/permissions.js b/app/controllers/users/user/edit/permissions.js new file mode 100644 index 000000000..33fe23cb0 --- /dev/null +++ b/app/controllers/users/user/edit/permissions.js @@ -0,0 +1,6 @@ +import EditIndexController from '.'; + +export default class EditPermissionsController extends EditIndexController { + successMessage = 'Rechten gewijzigd!'; + successTransitionTarget = 'users.user.permissions'; +} diff --git a/app/controllers/users/user/edit/privacy.js b/app/controllers/users/user/edit/privacy.js new file mode 100644 index 000000000..9bdf30521 --- /dev/null +++ b/app/controllers/users/user/edit/privacy.js @@ -0,0 +1,3 @@ +import EditIndexController from '.'; + +export default class EditPrivacyController extends EditIndexController {} diff --git a/app/controllers/users/show-groups.js b/app/controllers/users/user/groups.js similarity index 99% rename from app/controllers/users/show-groups.js rename to app/controllers/users/user/groups.js index c430cd513..ade2ab3ef 100644 --- a/app/controllers/users/show-groups.js +++ b/app/controllers/users/user/groups.js @@ -7,7 +7,6 @@ export default class UsersShowGroupsController extends GroupMembershipsControlle @tracked showAdministrativeGroups = false; filterableAttributes = ['group.name']; - sortableAttributes = [ { value: 'group.name', diff --git a/app/controllers/users/resend-activation.js b/app/controllers/users/user/resend-activation-code.js similarity index 79% rename from app/controllers/users/resend-activation.js rename to app/controllers/users/user/resend-activation-code.js index f0b72c9e9..2cfd269b2 100644 --- a/app/controllers/users/resend-activation.js +++ b/app/controllers/users/user/resend-activation-code.js @@ -4,19 +4,19 @@ import { isNotFoundResponse } from 'ember-fetch/errors'; import { inject as service } from '@ember/service'; import { tracked } from '@glimmer/tracking'; -export default class UserResendActivationController extends Controller { +export default class UserResendActivationCodeController extends Controller { @service fetch; @tracked errorMessage = null; @action - async resendActivation() { + async resendActivationCode() { this.errorMessage = null; const response = await this.fetch.post( `/users/${this.model.id}/resend_activation_mail` ); if (response.ok) { - this.transitionToRoute('users.show', this.model); + this.transitionToRoute('users.user', this.model); } else if (isNotFoundResponse(response)) { this.errorMessage = 'Deze gebruiker is al geactiveerd!'; } else { diff --git a/app/controllers/users/webdav.js b/app/controllers/users/webdav.js index 01613938b..92eb84a00 100644 --- a/app/controllers/users/webdav.js +++ b/app/controllers/users/webdav.js @@ -2,7 +2,7 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; -export default class UserWebdavController extends Controller { +export default class UsersWebdavController extends Controller { @service fetch; @service session; diff --git a/app/router.js b/app/router.js index c53b00999..f8e89d98f 100644 --- a/app/router.js +++ b/app/router.js @@ -100,30 +100,32 @@ Router.map(function () { }); this.route('users', function () { - this.route('members'); - this.route('new'); - this.route('edit', { path: '/:id/edit' }); - this.route('edit-permissions', { path: '/:id/edit/permissions' }); - this.route('edit-privacy', { path: '/:id/edit/privacy' }); - this.route('edit-security', { path: '/:id/edit/security' }); - this.route('show', { path: '/:id' }); - this.route('show-groups', { path: '/:id/groups' }); - this.route('show-settings', { path: '/:id/settings' }); - this.route('show-mail', { path: '/:id/mail' }); - this.route('show-mandates', { path: '/:id/mandates' }); - this.route('show-permissions', { path: '/:id/permissions' }); - this.route('destroy', { path: '/:id/destroy' }); + this.route('forgot-password'); + this.route('members'); this.route('webdav'); - this.route('forgot_password'); - this.route('activate_account', { path: '/:id/activate_account' }); - this.route('resend_activation', { path: '/:id/resend_activation' }); + this.route('user', { path: ':id' }, function () { + this.route('edit', function () { + this.route('permissions'); + this.route('privacy'); + this.route('security'); + }); + this.route('destroy'); + + this.route('groups'); + this.route('mail'); + this.route('mandates'); + this.route('permissions'); + this.route('settings'); + + this.route('activate-account'); + this.route('resend-activation-code'); + }); this.route('batch', function () { this.route('new'); - this.route('confirm'); }); }); diff --git a/app/routes/profile.js b/app/routes/profile.js index 994126849..bfcbea805 100644 --- a/app/routes/profile.js +++ b/app/routes/profile.js @@ -9,6 +9,6 @@ export default class ProfileRoute extends AuthenticatedRoute { } redirect() { - this.router.transitionTo('users.show', this.session.currentUser.id); + this.router.transitionTo('users.user', this.session.currentUser.id); } } diff --git a/app/routes/users.js b/app/routes/users.js new file mode 100644 index 000000000..9142de30d --- /dev/null +++ b/app/routes/users.js @@ -0,0 +1,7 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class UsersRoute extends ApplicationRoute { + queryParams = {}; + + breadcrumb = { title: 'Gebruikers' }; +} diff --git a/app/routes/users/activate-account.js b/app/routes/users/activate-account.js deleted file mode 100644 index 3e6b5e7da..000000000 --- a/app/routes/users/activate-account.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default Route; diff --git a/app/routes/users/batch.js b/app/routes/users/batch.js deleted file mode 100644 index c06f82ac0..000000000 --- a/app/routes/users/batch.js +++ /dev/null @@ -1,5 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class BatchRoute extends Route { - breadcrumb = null; -} diff --git a/app/routes/users/batch/new.js b/app/routes/users/batch/new.js index 9b8ca4e51..2ec7520e7 100644 --- a/app/routes/users/batch/new.js +++ b/app/routes/users/batch/new.js @@ -1,6 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class EditStaticPageRoute extends AuthenticatedRoute { +export default class BatchNewRoute extends AuthenticatedRoute { breadcrumb = { title: 'Batch gebruikers uploaden' }; canAccess() { diff --git a/app/routes/users/edit-permissions.js b/app/routes/users/edit-permissions.js deleted file mode 100644 index 3533de386..000000000 --- a/app/routes/users/edit-permissions.js +++ /dev/null @@ -1,7 +0,0 @@ -import EditUserRoute from 'amber-ui/routes/users/edit'; - -export default class EditUserPermissionsRoute extends EditUserRoute { - canAccess() { - return this.abilities.can('create permissions-users'); - } -} diff --git a/app/routes/users/edit-privacy.js b/app/routes/users/edit-privacy.js deleted file mode 100644 index 5ad74fe3d..000000000 --- a/app/routes/users/edit-privacy.js +++ /dev/null @@ -1,3 +0,0 @@ -import EditUserRoute from 'amber-ui/routes/users/edit'; - -export default EditUserRoute; diff --git a/app/routes/users/edit-security.js b/app/routes/users/edit-security.js deleted file mode 100644 index 5ad74fe3d..000000000 --- a/app/routes/users/edit-security.js +++ /dev/null @@ -1,3 +0,0 @@ -import EditUserRoute from 'amber-ui/routes/users/edit'; - -export default EditUserRoute; diff --git a/app/routes/users/forgot-password.js b/app/routes/users/forgot-password.js deleted file mode 100644 index 3e6b5e7da..000000000 --- a/app/routes/users/forgot-password.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default Route; diff --git a/app/routes/users/members.js b/app/routes/users/members.js index e5e9fe80e..55b916f26 100644 --- a/app/routes/users/members.js +++ b/app/routes/users/members.js @@ -1,6 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class MembersRoute extends AuthenticatedRoute { +export default class UsersMembersRoute extends AuthenticatedRoute { breadcrumb = { title: 'Leden' }; get pageActions() { diff --git a/app/routes/users/new.js b/app/routes/users/new.js index f6f7aa4e2..99045651f 100644 --- a/app/routes/users/new.js +++ b/app/routes/users/new.js @@ -1,6 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class NewUserRoute extends AuthenticatedRoute { +export default class UsersNewRoute extends AuthenticatedRoute { breadcrumb = { title: 'Gebruiker aanmaken' }; canAccess() { diff --git a/app/routes/users/show-groups.js b/app/routes/users/show-groups.js deleted file mode 100644 index d082da4eb..000000000 --- a/app/routes/users/show-groups.js +++ /dev/null @@ -1,5 +0,0 @@ -import ShowUserRouter from 'amber-ui/routes/users/show'; - -export default class ShowUserGroupsRoute extends ShowUserRouter { - pageActions = null; -} diff --git a/app/routes/users/show-mail.js b/app/routes/users/show-mail.js deleted file mode 100644 index 5198630db..000000000 --- a/app/routes/users/show-mail.js +++ /dev/null @@ -1,9 +0,0 @@ -import ShowUserRouter from 'amber-ui/routes/users/show'; - -export default class ShowUserMailRoute extends ShowUserRouter { - pageActions = null; - - canAccess() { - return this.abilities.can('show mail-aliases'); - } -} diff --git a/app/routes/users/show-mandates.js b/app/routes/users/show-mandates.js deleted file mode 100644 index 30cbd768a..000000000 --- a/app/routes/users/show-mandates.js +++ /dev/null @@ -1,5 +0,0 @@ -import ShowUserRouter from 'amber-ui/routes/users/show'; - -export default class ShowUserMandatesRoute extends ShowUserRouter { - pageActions = null; -} diff --git a/app/routes/users/user.js b/app/routes/users/user.js new file mode 100644 index 000000000..78baa9038 --- /dev/null +++ b/app/routes/users/user.js @@ -0,0 +1,17 @@ +import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; + +export default class UserRoute extends AuthenticatedRoute { + queryParams = {}; + + get breadcrumb() { + return { title: this.controller?.model.fullName }; + } + + canAccess() { + return this.abilities.can('show users'); + } + + model(params) { + return this.store.findRecord('user', params.id, params); + } +} diff --git a/app/routes/users/destroy.js b/app/routes/users/user/destroy.js similarity index 58% rename from app/routes/users/destroy.js rename to app/routes/users/user/destroy.js index e00925381..0331370df 100644 --- a/app/routes/users/destroy.js +++ b/app/routes/users/user/destroy.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class DestroyUserRoute extends AuthenticatedRoute { +export default class UserDestroyRoute extends AuthenticatedRoute { breadcrumb = { title: 'Lid verwijderen' }; canAccess(model) { return this.abilities.can('destroy user', model); } - - model(params) { - return this.store.findRecord('user', params.id, params); - } } diff --git a/app/routes/users/user/edit.js b/app/routes/users/user/edit.js new file mode 100644 index 000000000..389b2dcf1 --- /dev/null +++ b/app/routes/users/user/edit.js @@ -0,0 +1,7 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class UserEditRoute extends ApplicationRoute { + queryParams = {}; + + breadcrumb = { title: 'Lid aanpassen' }; +} diff --git a/app/routes/users/edit.js b/app/routes/users/user/edit/index.js similarity index 70% rename from app/routes/users/edit.js rename to app/routes/users/user/edit/index.js index 1bce12dcb..c6d05ee15 100644 --- a/app/routes/users/edit.js +++ b/app/routes/users/user/edit/index.js @@ -1,31 +1,29 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class EditUserRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Lid aanpassen' }; - +export default class EditIndexRoute extends AuthenticatedRoute { get tabItems() { const user = this.controller.model; return [ { - link: 'users.edit', + link: 'users.user.edit.index', title: 'Algemeen', linkArgument: user, canAccess: true, }, { - link: 'users.edit-permissions', + link: 'users.user.edit.permissions', title: 'Rechten', linkArgument: user, canAccess: this.abilities.can('create permissions-users'), }, { - link: 'users.edit-privacy', + link: 'users.user.edit.privacy', title: 'Privacy', linkArgument: user, canAccess: this.session.currentUser === user, }, { - link: 'users.edit-security', + link: 'users.user.edit.security', title: 'Beveiliging', linkArgument: user, canAccess: this.session.currentUser === user, @@ -37,10 +35,6 @@ export default class EditUserRoute extends AuthenticatedRoute { return this.abilities.can('edit user', model); } - async model(params) { - return await this.store.findRecord('user', params.id, params); - } - deactivate() { super.deactivate(); this.controller.model?.rollbackAttributes(); diff --git a/app/routes/users/user/edit/permissions.js b/app/routes/users/user/edit/permissions.js new file mode 100644 index 000000000..13b78f7fd --- /dev/null +++ b/app/routes/users/user/edit/permissions.js @@ -0,0 +1,7 @@ +import EditIndexRoute from './index'; + +export default class EditPermissionsRoute extends EditIndexRoute { + canAccess() { + return this.abilities.can('create permissions-users'); + } +} diff --git a/app/routes/users/user/edit/privacy.js b/app/routes/users/user/edit/privacy.js new file mode 100644 index 000000000..22cadb533 --- /dev/null +++ b/app/routes/users/user/edit/privacy.js @@ -0,0 +1,3 @@ +import EditIndexRoute from './index'; + +export default class EditPrivacyRoute extends EditIndexRoute {} diff --git a/app/routes/users/user/edit/security.js b/app/routes/users/user/edit/security.js new file mode 100644 index 000000000..70f538ff2 --- /dev/null +++ b/app/routes/users/user/edit/security.js @@ -0,0 +1,3 @@ +import EditIndexRoute from './index'; + +export default class EditSecurityRoute extends EditIndexRoute {} diff --git a/app/routes/users/user/groups.js b/app/routes/users/user/groups.js new file mode 100644 index 000000000..7bc0ce859 --- /dev/null +++ b/app/routes/users/user/groups.js @@ -0,0 +1,5 @@ +import UserIndexRoute from './index'; + +export default class UserGroupsRoute extends UserIndexRoute { + pageActions = null; +} diff --git a/app/routes/users/show.js b/app/routes/users/user/index.js similarity index 74% rename from app/routes/users/show.js rename to app/routes/users/user/index.js index 4df2c78d7..097b306cc 100644 --- a/app/routes/users/show.js +++ b/app/routes/users/user/index.js @@ -1,22 +1,18 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class ShowUserRouter extends AuthenticatedRoute { - get breadcrumb() { - return { title: this.controller.model.fullName }; - } - +export default class UserIndexRoute extends AuthenticatedRoute { get pageActions() { const user = this.controller.model; return [ { - link: 'users.edit', + link: 'users.user.edit', title: 'Wijzigen', icon: 'pencil', linkArgument: user, canAccess: this.abilities.can('edit user', user), }, { - link: 'users.resend_activation', + link: 'users.user.resend-activation-code', title: 'Verstuur activatie code', icon: 'paper-plane', linkArgument: user, @@ -29,37 +25,37 @@ export default class ShowUserRouter extends AuthenticatedRoute { const user = this.controller.model; return [ { - link: 'users.show', + link: 'users.user.index', title: 'Algemeen', linkArgument: user, canAccess: this.abilities.can('show users'), }, { - link: 'users.show-groups', + link: 'users.user.groups', title: 'Groepen', linkArgument: user, canAccess: this.abilities.can('show memberships'), }, { - link: 'users.show-settings', + link: 'users.user.settings', title: 'Instellingen', linkArgument: user, canAccess: this.abilities.can('edit user', user), }, { - link: 'users.show-mail', + link: 'users.user.mail', title: 'Mail aliassen', linkArgument: user, canAccess: this.abilities.can('show mail-aliases'), }, { - link: 'users.show-mandates', + link: 'users.user.mandates', title: 'Incasso mandaten', linkArgument: user, canAccess: true, }, { - link: 'users.show-permissions', + link: 'users.user.permissions', title: 'Rechten', linkArgument: user, canAccess: this.abilities.can('show permissions-users'), @@ -70,8 +66,4 @@ export default class ShowUserRouter extends AuthenticatedRoute { canAccess() { return this.abilities.can('show individual users'); } - - model(params) { - return this.store.findRecord('user', params.id, params); - } } diff --git a/app/routes/users/user/mail.js b/app/routes/users/user/mail.js new file mode 100644 index 000000000..4a1761eff --- /dev/null +++ b/app/routes/users/user/mail.js @@ -0,0 +1,9 @@ +import UserIndexRoute from './index'; + +export default class UserMailRoute extends UserIndexRoute { + pageActions = null; + + canAccess() { + return this.abilities.can('show mail-aliases'); + } +} diff --git a/app/routes/users/user/mandates.js b/app/routes/users/user/mandates.js new file mode 100644 index 000000000..748466e52 --- /dev/null +++ b/app/routes/users/user/mandates.js @@ -0,0 +1,5 @@ +import UserIndexRoute from './index'; + +export default class UserMandatesRoute extends UserIndexRoute { + pageActions = null; +} diff --git a/app/routes/users/show-permissions.js b/app/routes/users/user/permissions.js similarity index 66% rename from app/routes/users/show-permissions.js rename to app/routes/users/user/permissions.js index 9f86099cf..7c4e7d1f9 100644 --- a/app/routes/users/show-permissions.js +++ b/app/routes/users/user/permissions.js @@ -1,11 +1,11 @@ -import ShowUserRouter from 'amber-ui/routes/users/show'; +import UserIndexRoute from './index'; -export default class ShowUserPermissions extends ShowUserRouter { +export default class UserPermissionsRoute extends UserIndexRoute { get pageActions() { const user = this.controller.model; return [ { - link: 'users.edit-permissions', + link: 'users.user.edit.permissions', title: 'Wijzigen', icon: 'pencil', linkArgument: user, diff --git a/app/routes/users/resend-activation.js b/app/routes/users/user/resend-activation-code.js similarity index 59% rename from app/routes/users/resend-activation.js rename to app/routes/users/user/resend-activation-code.js index 95fca1c78..7a730520b 100644 --- a/app/routes/users/resend-activation.js +++ b/app/routes/users/user/resend-activation-code.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class ResendActivationRoute extends AuthenticatedRoute { +export default class UserResendActivationCodeRoute extends AuthenticatedRoute { breadcrumb = { title: 'Activatiecode hersturen' }; canAccess(model) { return this.abilities.can('resend activation code of user', model); } - - model(params) { - return this.store.findRecord('user', params.id, params); - } } diff --git a/app/routes/users/show-settings.js b/app/routes/users/user/settings.js similarity index 67% rename from app/routes/users/show-settings.js rename to app/routes/users/user/settings.js index 0bf51dc9d..6c78e7ee0 100644 --- a/app/routes/users/show-settings.js +++ b/app/routes/users/user/settings.js @@ -1,11 +1,11 @@ -import ShowUserRouter from 'amber-ui/routes/users/show'; +import UserIndexRoute from './index'; -export default class ShowUserSettings extends ShowUserRouter { +export default class UserSettingsRoute extends UserIndexRoute { get pageActions() { const user = this.controller.model; return [ { - link: 'users.edit-privacy', + link: 'users.user.edit.privacy', title: 'Wijzigen', icon: 'pencil', linkArgument: user, diff --git a/app/routes/users/webdav.js b/app/routes/users/webdav.js index 43739ac88..3b7ac4709 100644 --- a/app/routes/users/webdav.js +++ b/app/routes/users/webdav.js @@ -1,6 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class WebdavRoute extends AuthenticatedRoute { +export default class UsersWebdavRoute extends AuthenticatedRoute { breadcrumb = { title: 'Contactsynchronisatie' }; canAccess() { diff --git a/app/templates/debit/collections/collection/index.hbs b/app/templates/debit/collections/collection/index.hbs index b50355d92..b26fe74ad 100644 --- a/app/templates/debit/collections/collection/index.hbs +++ b/app/templates/debit/collections/collection/index.hbs @@ -17,7 +17,7 @@
    {{#each this.groupedTransactions as |transactionGroup|}} - +
    {{transactionGroup.user.fullName}}
    diff --git a/app/templates/debit/mandates/index.hbs b/app/templates/debit/mandates/index.hbs index 7070b161e..ae2c1f938 100644 --- a/app/templates/debit/mandates/index.hbs +++ b/app/templates/debit/mandates/index.hbs @@ -39,7 +39,7 @@ {{moment-format mandate.endDate 'DD-M-YYYY'}} - + Gebruiker: {{mandate.user.fullName}} diff --git a/app/templates/debit/mandates/mandate/index.hbs b/app/templates/debit/mandates/mandate/index.hbs index 1d6903314..1dad0f09b 100644 --- a/app/templates/debit/mandates/mandate/index.hbs +++ b/app/templates/debit/mandates/mandate/index.hbs @@ -32,7 +32,7 @@ Gebruiker - + {{@model.user.fullName}} diff --git a/app/templates/forum/categories/category/threads/index.hbs b/app/templates/forum/categories/category/threads/index.hbs index 061ad0020..77de6d7a1 100644 --- a/app/templates/forum/categories/category/threads/index.hbs +++ b/app/templates/forum/categories/category/threads/index.hbs @@ -32,7 +32,7 @@ {{thread.title}} - + {{thread.author.fullNameWithNickname}} diff --git a/app/templates/forum/categories/index.hbs b/app/templates/forum/categories/index.hbs index 27544299c..c9fe744ab 100644 --- a/app/templates/forum/categories/index.hbs +++ b/app/templates/forum/categories/index.hbs @@ -20,7 +20,7 @@ {{thread.title}} - + {{thread.author.fullNameWithNickname}} diff --git a/app/templates/groups/group/index.hbs b/app/templates/groups/group/index.hbs index 602fc5271..adb4e49db 100644 --- a/app/templates/groups/group/index.hbs +++ b/app/templates/groups/group/index.hbs @@ -82,7 +82,7 @@
    {{#each filteredModels as |membership|}} diff --git a/app/templates/login.hbs b/app/templates/login.hbs index 6f15b34ae..bac6f3a7a 100644 --- a/app/templates/login.hbs +++ b/app/templates/login.hbs @@ -58,7 +58,7 @@
    {{t 'template.login.forgotPassword'}} diff --git a/app/templates/mail-aliases/index.hbs b/app/templates/mail-aliases/index.hbs index 8dfcecd02..f6982288d 100644 --- a/app/templates/mail-aliases/index.hbs +++ b/app/templates/mail-aliases/index.hbs @@ -55,7 +55,7 @@ {{mailAlias.group.name}} {{else}} - + {{mailAlias.user.fullNameWithNickname}} diff --git a/app/templates/mail-aliases/show.hbs b/app/templates/mail-aliases/show.hbs index a577ef5ad..181544836 100644 --- a/app/templates/mail-aliases/show.hbs +++ b/app/templates/mail-aliases/show.hbs @@ -62,7 +62,7 @@ Gebruiker {{#if @model.user}} - + {{@model.user.fullNameWithNickname}} {{else}} diff --git a/app/templates/polls/show.hbs b/app/templates/polls/show.hbs index 9f0b17aef..d23690a3d 100644 --- a/app/templates/polls/show.hbs +++ b/app/templates/polls/show.hbs @@ -53,7 +53,7 @@ diff --git a/app/templates/users/index.hbs b/app/templates/users/index.hbs index 71125079e..cda4e3d74 100644 --- a/app/templates/users/index.hbs +++ b/app/templates/users/index.hbs @@ -18,7 +18,7 @@ {{#each model as |user|}} {{! only pass id when force reload is required, see http://emberigniter.com/force-store-reload-data-api-backend/ }} diff --git a/app/templates/users/members.hbs b/app/templates/users/members.hbs index 9f976871a..995db5eb4 100644 --- a/app/templates/users/members.hbs +++ b/app/templates/users/members.hbs @@ -17,7 +17,7 @@
    {{#each model as |user|}} diff --git a/app/templates/users/activate-account.hbs b/app/templates/users/user/activate-account.hbs similarity index 100% rename from app/templates/users/activate-account.hbs rename to app/templates/users/user/activate-account.hbs diff --git a/app/templates/users/destroy.hbs b/app/templates/users/user/destroy.hbs similarity index 100% rename from app/templates/users/destroy.hbs rename to app/templates/users/user/destroy.hbs diff --git a/app/templates/users/edit.hbs b/app/templates/users/user/edit/index.hbs similarity index 100% rename from app/templates/users/edit.hbs rename to app/templates/users/user/edit/index.hbs diff --git a/app/templates/users/edit-permissions.hbs b/app/templates/users/user/edit/permissions.hbs similarity index 100% rename from app/templates/users/edit-permissions.hbs rename to app/templates/users/user/edit/permissions.hbs diff --git a/app/templates/users/edit-privacy.hbs b/app/templates/users/user/edit/privacy.hbs similarity index 100% rename from app/templates/users/edit-privacy.hbs rename to app/templates/users/user/edit/privacy.hbs diff --git a/app/templates/users/edit-security.hbs b/app/templates/users/user/edit/security.hbs similarity index 100% rename from app/templates/users/edit-security.hbs rename to app/templates/users/user/edit/security.hbs diff --git a/app/templates/users/show-groups.hbs b/app/templates/users/user/groups.hbs similarity index 100% rename from app/templates/users/show-groups.hbs rename to app/templates/users/user/groups.hbs diff --git a/app/templates/users/show.hbs b/app/templates/users/user/index.hbs similarity index 100% rename from app/templates/users/show.hbs rename to app/templates/users/user/index.hbs diff --git a/app/templates/users/show-mail.hbs b/app/templates/users/user/mail.hbs similarity index 100% rename from app/templates/users/show-mail.hbs rename to app/templates/users/user/mail.hbs diff --git a/app/templates/users/show-mandates.hbs b/app/templates/users/user/mandates.hbs similarity index 100% rename from app/templates/users/show-mandates.hbs rename to app/templates/users/user/mandates.hbs diff --git a/app/templates/users/show-permissions.hbs b/app/templates/users/user/permissions.hbs similarity index 100% rename from app/templates/users/show-permissions.hbs rename to app/templates/users/user/permissions.hbs diff --git a/app/templates/users/resend-activation.hbs b/app/templates/users/user/resend-activation.hbs similarity index 66% rename from app/templates/users/resend-activation.hbs rename to app/templates/users/user/resend-activation.hbs index b0ba380c5..7d856bf32 100644 --- a/app/templates/users/resend-activation.hbs +++ b/app/templates/users/user/resend-activation.hbs @@ -4,10 +4,10 @@ opnieuw wil versturen? Dit zal de oude activatiecode ongeldig maken.

    - - + Nee diff --git a/app/templates/users/show-settings.hbs b/app/templates/users/user/settings.hbs similarity index 100% rename from app/templates/users/show-settings.hbs rename to app/templates/users/user/settings.hbs diff --git a/app/templates/vacancies/index.hbs b/app/templates/vacancies/index.hbs index 64634de23..9242af429 100644 --- a/app/templates/vacancies/index.hbs +++ b/app/templates/vacancies/index.hbs @@ -49,7 +49,7 @@ {{else}} @@ -69,29 +69,33 @@
    - {{!-- Table without style --}} - + {{! Table without style }} +
    {{#if vacancy.deadline}} - - + + {{/if}} {{#if vacancy.workload}} - + {{/if}} {{#if vacancy.workloadPeak}} - + {{/if}}
    Deadline:{{moment-format vacancy.deadline 'DD-MM-YYYY' }}Deadline:{{moment-format vacancy.deadline 'DD-MM-YYYY'}}
    Werklast:Werklast: {{vacancy.workload}}
    Piekmoment:Piekmoment: {{vacancy.workloadPeak}}
    -
    diff --git a/app/templates/vacancies/show.hbs b/app/templates/vacancies/show.hbs index c33c564b5..76503bd66 100644 --- a/app/templates/vacancies/show.hbs +++ b/app/templates/vacancies/show.hbs @@ -2,16 +2,15 @@ -
    + class='card-header + {{if + @model.coverPhotoUrl + "card-header--overlay" + "card-header--no-overlay" + }}' + > {{#if @model.coverPhotoUrl}} {{/if}} @@ -20,20 +19,20 @@
    {{#if @model.group}} {{@model.group.fullName}} + src='{{@model.group.avatarThumbUrlOrDefault}}' + class='profile-picture-medium profile-picture-margin' + alt='{{@model.group.fullName}}' + height='60px' + style='display: inline;' + /> {{else}} {{@model.author.fullName}} + src='{{@model.author.avatarThumbUrlOrDefault}}' + class='profile-picture-medium profile-picture-margin' + alt='{{@model.author.fullName}}' + height='60px' + style='display: inline;' + /> {{/if}}
    @@ -45,18 +44,18 @@ {{#if @model.group}} + @route='groups.show' + @model={{@model.group.id}} + class='link-to card-subtitle-link' + > {{@model.group.name}} {{else}} + @route='users.user' + @model={{@model.author.id}} + class='link-to card-subtitle-link' + > {{@model.author.fullName}} {{/if}} @@ -67,16 +66,16 @@
    - {{#if @model.deadline }} + {{#if @model.deadline}}
    Deadline: - {{moment-format @model.deadline 'DD-MM-YYYY' }} + {{moment-format @model.deadline 'DD-MM-YYYY'}}
    {{/if}} - {{#if @model.workload }} + {{#if @model.workload}}
    Werklast: @@ -85,7 +84,7 @@
    {{/if}} - {{#if @model.workloadPeak }} + {{#if @model.workloadPeak}}
    Piekmoment: @@ -103,14 +102,14 @@ }} {{#if @model.contact}} -
    +
    Contact: {{#if (is-phone @model.contact)}} {{@model.contact}} {{else if (is-email @model.contact)}} {{@model.contact}} {{else if (is-url @model.contact)}} - {{@model.contact}} + {{@model.contact}} {{else}} {{@model.contact}} {{/if}} From bfaffe50c2914891ac8ecb1344c9fc252b721db3 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 30 Dec 2022 18:26:55 +0100 Subject: [PATCH 30/44] refactor: restructure polls controllers and routes --- app/components/tools/recent-polls.hbs | 4 ++-- app/controllers/debit/mandates/new.js | 4 ++-- app/controllers/polls/index.js | 3 ++- app/controllers/polls/new.js | 10 ++++----- app/controllers/polls/{ => poll}/destroy.js | 4 ++-- app/controllers/polls/{ => poll}/edit.js | 4 ++-- .../polls/{show.js => poll/index.js} | 0 app/router.js | 8 ++++--- app/routes/polls.js | 7 ++++++ app/routes/polls/index.js | 6 ++--- app/routes/polls/new.js | 2 +- app/routes/polls/poll.js | 17 ++++++++++++++ app/routes/polls/{ => poll}/destroy.js | 6 +---- app/routes/polls/{ => poll}/edit.js | 6 +---- app/routes/polls/{show.js => poll/index.js} | 22 ++++++++----------- app/routes/users/index.js | 4 +--- app/templates/polls/index.hbs | 2 +- app/templates/polls/{ => poll}/destroy.hbs | 8 ++++--- app/templates/polls/{ => poll}/edit.hbs | 0 .../polls/{show.hbs => poll/index.hbs} | 2 +- 20 files changed, 65 insertions(+), 54 deletions(-) rename app/controllers/polls/{ => poll}/destroy.js (73%) rename app/controllers/polls/{ => poll}/edit.js (82%) rename app/controllers/polls/{show.js => poll/index.js} (100%) create mode 100644 app/routes/polls.js create mode 100644 app/routes/polls/poll.js rename app/routes/polls/{ => poll}/destroy.js (57%) rename app/routes/polls/{ => poll}/edit.js (66%) rename app/routes/polls/{show.js => poll/index.js} (77%) rename app/templates/polls/{ => poll}/destroy.hbs (75%) rename app/templates/polls/{ => poll}/edit.hbs (100%) rename app/templates/polls/{show.hbs => poll/index.hbs} (98%) diff --git a/app/components/tools/recent-polls.hbs b/app/components/tools/recent-polls.hbs index 5f348ff3b..914978535 100644 --- a/app/components/tools/recent-polls.hbs +++ b/app/components/tools/recent-polls.hbs @@ -1,13 +1,13 @@
    - +
    Polls
      {{#each polls as |poll|}} - +
    • diff --git a/app/controllers/debit/mandates/new.js b/app/controllers/debit/mandates/new.js index 9ca0ffd52..3aec32271 100644 --- a/app/controllers/debit/mandates/new.js +++ b/app/controllers/debit/mandates/new.js @@ -1,6 +1,6 @@ -import EditMandateController from './mandate/edit'; +import MandateEditController from './mandate/edit'; -export default class MandatesNewController extends EditMandateController { +export default class MandatesNewController extends MandateEditController { successMessage = 'Aanmaken gelukt!'; cancelMessage = 'Aanmaken geannuleerd.'; cancelTransitionTarget = 'debit.mandates'; diff --git a/app/controllers/polls/index.js b/app/controllers/polls/index.js index 6f6665508..dc57f6582 100644 --- a/app/controllers/polls/index.js +++ b/app/controllers/polls/index.js @@ -5,8 +5,9 @@ export default class PollsIndexController extends FilterableAndSortableControlle @tracked sortedAttribute = 'created_at'; @tracked sortedAscending = false; - routeOnEnter = 'polls.show'; queryParams = ['search', 'sort', 'page']; + + routeOnEnter = 'polls.poll'; sortableAttributes = [ { value: 'created_at', diff --git a/app/controllers/polls/new.js b/app/controllers/polls/new.js index c3ab7785f..e662d8177 100644 --- a/app/controllers/polls/new.js +++ b/app/controllers/polls/new.js @@ -1,10 +1,8 @@ -import EditPollController from './edit'; +import PollEditController from './poll/edit'; -export default class NewPollController extends EditPollController { +export default class PollsNewController extends PollEditController { successMessage = 'Aanmaken gelukt!'; cancelMessage = 'Aanmaken geannuleerd.'; - cancelTransitionTarget = 'polls.index'; - get cancelTransitionModel() { - return null; - } + cancelTransitionTarget = 'polls'; + cancelTransitionModel = null; } diff --git a/app/controllers/polls/destroy.js b/app/controllers/polls/poll/destroy.js similarity index 73% rename from app/controllers/polls/destroy.js rename to app/controllers/polls/poll/destroy.js index 185fc2534..bafb26a2a 100644 --- a/app/controllers/polls/destroy.js +++ b/app/controllers/polls/poll/destroy.js @@ -3,6 +3,6 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class PollDestroyController extends DestroyController { successMessage = 'Poll verwijderd!'; cancelMessage = 'Poll verwijderen geannuleerd.'; - successTransitionTarget = 'polls.index'; - cancelTransitionTarget = 'polls.show'; + successTransitionTarget = 'polls'; + cancelTransitionTarget = 'polls.poll'; } diff --git a/app/controllers/polls/edit.js b/app/controllers/polls/poll/edit.js similarity index 82% rename from app/controllers/polls/edit.js rename to app/controllers/polls/poll/edit.js index 67524628c..8c8caf60f 100644 --- a/app/controllers/polls/edit.js +++ b/app/controllers/polls/poll/edit.js @@ -2,9 +2,9 @@ import EditController from 'amber-ui/controllers/application/edit'; import { action } from '@ember/object'; import { union } from 'amber-ui/utils/array-operations'; -export default class EditPollController extends EditController { +export default class PollEditController extends EditController { successMessage = 'Poll opgeslagen!'; - successTransitionTarget = 'polls.show'; + successTransitionTarget = 'polls.poll'; @action async submit() { diff --git a/app/controllers/polls/show.js b/app/controllers/polls/poll/index.js similarity index 100% rename from app/controllers/polls/show.js rename to app/controllers/polls/poll/index.js diff --git a/app/router.js b/app/router.js index f8e89d98f..3599f3f1b 100644 --- a/app/router.js +++ b/app/router.js @@ -146,9 +146,11 @@ Router.map(function () { this.route('polls', function () { this.route('new'); - this.route('edit', { path: '/:id/edit' }); - this.route('show', { path: '/:id' }); - this.route('destroy', { path: '/:id/destroy' }); + + this.route('poll', { path: ':id' }, function () { + this.route('edit'); + this.route('destroy'); + }); }); this.route('mail-aliases', function () { diff --git a/app/routes/polls.js b/app/routes/polls.js new file mode 100644 index 000000000..2786f429d --- /dev/null +++ b/app/routes/polls.js @@ -0,0 +1,7 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class PollsRoute extends ApplicationRoute { + queryParams = {}; + + breadcrumb = { title: 'Polls' }; +} diff --git a/app/routes/polls/index.js b/app/routes/polls/index.js index 4e17db81d..e33d7f9a3 100644 --- a/app/routes/polls/index.js +++ b/app/routes/polls/index.js @@ -1,8 +1,6 @@ -import { ApplicationRoute } from 'amber-ui/routes/application/application'; - -export default class MailAliasIndexRoute extends ApplicationRoute { - breadcrumb = { title: 'Polls' }; +import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; +export default class PollsIndexRoute extends AuthenticatedRoute { get pageActions() { return [ { diff --git a/app/routes/polls/new.js b/app/routes/polls/new.js index edf225159..1317b3b80 100644 --- a/app/routes/polls/new.js +++ b/app/routes/polls/new.js @@ -1,6 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class NewPollRoute extends AuthenticatedRoute { +export default class PollsNewRoute extends AuthenticatedRoute { breadcrumb = { title: 'Poll aanmaken' }; canAccess() { diff --git a/app/routes/polls/poll.js b/app/routes/polls/poll.js new file mode 100644 index 000000000..0bddc43ad --- /dev/null +++ b/app/routes/polls/poll.js @@ -0,0 +1,17 @@ +import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; + +export default class PollRoute extends AuthenticatedRoute { + queryParams = {}; + + get breadcrumb() { + return { title: this.controller?.model.question.question }; + } + + canAccess() { + return this.abilities.can('show polls'); + } + + model(params) { + return this.store.findRecord('poll', params.id, params); + } +} diff --git a/app/routes/polls/destroy.js b/app/routes/polls/poll/destroy.js similarity index 57% rename from app/routes/polls/destroy.js rename to app/routes/polls/poll/destroy.js index 27edf1c26..b9c5912dd 100644 --- a/app/routes/polls/destroy.js +++ b/app/routes/polls/poll/destroy.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class DestroyPollRoute extends AuthenticatedRoute { +export default class PollDestroyRoute extends AuthenticatedRoute { breadcrumb = { title: 'Poll verwijderen' }; canAccess() { return this.abilities.can('destroy polls'); } - - model(params) { - return this.store.findRecord('poll', params.id, params); - } } diff --git a/app/routes/polls/edit.js b/app/routes/polls/poll/edit.js similarity index 66% rename from app/routes/polls/edit.js rename to app/routes/polls/poll/edit.js index ef7ea7d31..62d5acb27 100644 --- a/app/routes/polls/edit.js +++ b/app/routes/polls/poll/edit.js @@ -1,16 +1,12 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class EditMailAliasRoute extends AuthenticatedRoute { +export default class PollEditRoute extends AuthenticatedRoute { breadcrumb = { title: 'Poll aanpassen' }; canAccess(model) { return this.abilities.can('edit poll', model); } - model(params) { - return this.store.findRecord('poll', params.id, params); - } - deactivate() { super.deactivate(); this.controller.model?.rollbackAttributes(); diff --git a/app/routes/polls/show.js b/app/routes/polls/poll/index.js similarity index 77% rename from app/routes/polls/show.js rename to app/routes/polls/poll/index.js index 47bd5bf5a..623c97358 100644 --- a/app/routes/polls/show.js +++ b/app/routes/polls/poll/index.js @@ -1,9 +1,9 @@ -import { hash } from 'rsvp'; -import { inject as service } from '@ember/service'; import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; import FormLoadOrCreateUtil from 'amber-ui/utils/form-load-or-create'; +import { hash } from 'rsvp'; +import { inject as service } from '@ember/service'; -export default class ShowPollsRoute extends AuthenticatedRoute { +export default class PollIndexRoute extends AuthenticatedRoute { @service store; constructor() { @@ -11,22 +11,18 @@ export default class ShowPollsRoute extends AuthenticatedRoute { this.formLoadOrCreateUtil = new FormLoadOrCreateUtil(this); } - get breadcrumb() { - return { title: this.controller.model.poll.question.question }; - } - get pageActions() { const { poll } = this.controller.model; return [ { - link: 'polls.edit', + link: 'polls.poll.edit', title: 'Wijzigen', icon: 'pencil', linkArgument: poll, canAccess: this.abilities.can('edit poll', poll), }, { - link: 'polls.destroy', + link: 'polls.poll.destroy', title: 'Verwijderen', icon: 'trash', linkArgument: poll, @@ -39,9 +35,9 @@ export default class ShowPollsRoute extends AuthenticatedRoute { return this.abilities.can('show polls'); } - model(params) { - const pollPromise = this.store.findRecord('poll', params.id, params); - const formPromise = pollPromise.then((poll) => poll.get('form')); + model() { + const poll = this.modelFor('polls.poll'); + const formPromise = poll.form; const responsePromise = formPromise // Load or create the response .then((form) => @@ -57,7 +53,7 @@ export default class ShowPollsRoute extends AuthenticatedRoute { ); return hash({ - poll: pollPromise, + poll, form: formPromise, currentUserResponse: responsePromise, }); diff --git a/app/routes/users/index.js b/app/routes/users/index.js index 502d0a300..ab0684d84 100644 --- a/app/routes/users/index.js +++ b/app/routes/users/index.js @@ -1,8 +1,6 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class UserIndexRoute extends AuthenticatedRoute { - breadcrumb = { title: 'Gebruikers' }; - +export default class UsersIndexRoute extends AuthenticatedRoute { get pageActions() { return [ { diff --git a/app/templates/polls/index.hbs b/app/templates/polls/index.hbs index c4294bc4e..19f2e43d6 100644 --- a/app/templates/polls/index.hbs +++ b/app/templates/polls/index.hbs @@ -22,7 +22,7 @@
      {{#each model as |poll|}} - +
      {{form/status-icon poll.form}} diff --git a/app/templates/polls/destroy.hbs b/app/templates/polls/poll/destroy.hbs similarity index 75% rename from app/templates/polls/destroy.hbs rename to app/templates/polls/poll/destroy.hbs index 448498c2d..4bffd052d 100644 --- a/app/templates/polls/destroy.hbs +++ b/app/templates/polls/poll/destroy.hbs @@ -2,7 +2,7 @@
      Je kunt deze poll niet verwijderen, omdat er al reacties zijn!
      - + Terug {{else}} @@ -11,8 +11,10 @@ verwijderen?

      - - + + Nee diff --git a/app/templates/polls/edit.hbs b/app/templates/polls/poll/edit.hbs similarity index 100% rename from app/templates/polls/edit.hbs rename to app/templates/polls/poll/edit.hbs diff --git a/app/templates/polls/show.hbs b/app/templates/polls/poll/index.hbs similarity index 98% rename from app/templates/polls/show.hbs rename to app/templates/polls/poll/index.hbs index d23690a3d..73fa0074b 100644 --- a/app/templates/polls/show.hbs +++ b/app/templates/polls/poll/index.hbs @@ -73,7 +73,7 @@ @submitButtonLabel='Opslaan' @inputLayout='vertical' > - + Annuleren From 1b879b57df3e7b2a8fe77bfa54d9acb50b892d65 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 30 Dec 2022 18:41:34 +0100 Subject: [PATCH 31/44] refactor: restructure mail aliases controllers and routes --- app/components/menu-sidebar.hbs | 2 +- app/controllers/mail-aliases/index.js | 1 + .../mail-aliases/{ => mail-alias}/destroy.js | 4 ++-- .../mail-aliases/{ => mail-alias}/edit.js | 4 ++-- app/controllers/mail-aliases/new.js | 14 ++++++-------- app/router.js | 8 +++++--- app/routes/mail-aliases.js | 7 +++++++ app/routes/mail-aliases/destroy.js | 13 ------------- app/routes/mail-aliases/index.js | 10 +++------- app/routes/mail-aliases/mail-alias.js | 17 +++++++++++++++++ app/routes/mail-aliases/mail-alias/destroy.js | 9 +++++++++ .../mail-aliases/{ => mail-alias}/edit.js | 8 ++------ .../{show.js => mail-alias/index.js} | 14 +++----------- app/routes/mail-aliases/new.js | 4 ++-- app/templates/groups/group/index.hbs | 5 ++++- app/templates/mail-aliases/index.hbs | 2 +- .../mail-aliases/{ => mail-alias}/destroy.hbs | 0 .../mail-aliases/{ => mail-alias}/edit.hbs | 0 .../{show.hbs => mail-alias/index.hbs} | 0 app/templates/users/user/mail.hbs | 4 ++-- translations/en.yaml | 6 +++--- translations/nl.yaml | 6 +++--- 22 files changed, 73 insertions(+), 65 deletions(-) rename app/controllers/mail-aliases/{ => mail-alias}/destroy.js (60%) rename app/controllers/mail-aliases/{ => mail-alias}/edit.js (85%) create mode 100644 app/routes/mail-aliases.js delete mode 100644 app/routes/mail-aliases/destroy.js create mode 100644 app/routes/mail-aliases/mail-alias.js create mode 100644 app/routes/mail-aliases/mail-alias/destroy.js rename app/routes/mail-aliases/{ => mail-alias}/edit.js (56%) rename app/routes/mail-aliases/{show.js => mail-alias/index.js} (64%) rename app/templates/mail-aliases/{ => mail-alias}/destroy.hbs (100%) rename app/templates/mail-aliases/{ => mail-alias}/edit.hbs (100%) rename app/templates/mail-aliases/{show.hbs => mail-alias/index.hbs} (100%) diff --git a/app/components/menu-sidebar.hbs b/app/components/menu-sidebar.hbs index de2f1ab41..9c995f950 100644 --- a/app/components/menu-sidebar.hbs +++ b/app/components/menu-sidebar.hbs @@ -55,7 +55,7 @@ @link='mail-aliases' @hasPermission={{can 'show mail-aliases'}} @icon='envelope' - @title={{t 'mixin.menuItems.mailaliases'}} + @title={{t 'mixin.menuItems.mailAliases'}} @minor={{true}} /> {{#if (can 'edit mail-aliases')}} - +
      {{#each model as |mailAlias|}} - +
      {{mailAlias.email}} diff --git a/app/templates/mail-aliases/destroy.hbs b/app/templates/mail-aliases/mail-alias/destroy.hbs similarity index 100% rename from app/templates/mail-aliases/destroy.hbs rename to app/templates/mail-aliases/mail-alias/destroy.hbs diff --git a/app/templates/mail-aliases/edit.hbs b/app/templates/mail-aliases/mail-alias/edit.hbs similarity index 100% rename from app/templates/mail-aliases/edit.hbs rename to app/templates/mail-aliases/mail-alias/edit.hbs diff --git a/app/templates/mail-aliases/show.hbs b/app/templates/mail-aliases/mail-alias/index.hbs similarity index 100% rename from app/templates/mail-aliases/show.hbs rename to app/templates/mail-aliases/mail-alias/index.hbs diff --git a/app/templates/users/user/mail.hbs b/app/templates/users/user/mail.hbs index 4aab056cc..3bb07f341 100644 --- a/app/templates/users/user/mail.hbs +++ b/app/templates/users/user/mail.hbs @@ -18,7 +18,7 @@ {{#each @model.mailAliases as |alias|}} - + {{alias.email}} @@ -30,7 +30,7 @@ {{#each @model.groupMailAliases as |alias|}} - + {{alias.email}} diff --git a/translations/en.yaml b/translations/en.yaml index 50d863405..c91210329 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -27,8 +27,8 @@ model: other: groups mailAlias: name: - one: mail-alias - other: mail-aliases + one: mail alias + other: mail aliases mailModeration: name: one: mail-moderation @@ -219,7 +219,7 @@ mixin: sponsorkliks: Sponsorkliks profile: Profile settings: Settings - mailaliases: Mail aliases + mailAliases: Mail aliases collections: Collections mailModerations: Mail Moderations mandates: Mandates diff --git a/translations/nl.yaml b/translations/nl.yaml index e8ae3e166..34be642c0 100644 --- a/translations/nl.yaml +++ b/translations/nl.yaml @@ -27,8 +27,8 @@ model: other: groepen mailAlias: name: - one: mail-alias - other: mail-aliassen + one: mail alias + other: mail aliassen mailModeration: name: one: mail-moderatie @@ -221,7 +221,7 @@ mixin: sponsorkliks: Sponsorkliks profile: Profiel settings: Instellingen - mailaliases: Mail aliassen + mailAliases: Mail aliassen collections: Incasso's mailModerations: Mail moderaties mandates: Mandaten From be13c259919313ee1077b5d4dd8144e9bb2ca92a Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 30 Dec 2022 18:53:24 +0100 Subject: [PATCH 32/44] refactor: restructure mail moderations controllers and routes --- app/controllers/mail-moderations/index.js | 2 +- .../{ => mail-moderation}/accept.js | 2 +- .../{ => mail-moderation}/destroy.js | 4 +-- .../{ => mail-moderation}/reject.js | 2 +- app/router.js | 10 +++++--- app/routes/mail-moderations.js | 7 ++++++ app/routes/mail-moderations/index.js | 6 ++--- .../mail-moderations/mail-moderation.js | 17 +++++++++++++ .../{ => mail-moderation}/accept.js | 6 +---- .../{ => mail-moderation}/destroy.js | 6 +---- .../{show.js => mail-moderation/index.js} | 16 +++--------- .../{ => mail-moderation}/reject.js | 6 +---- app/templates/mail-moderations/accept.hbs | 2 +- app/templates/mail-moderations/destroy.hbs | 8 ++++-- app/templates/mail-moderations/index.hbs | 25 +++++++++++++++---- app/templates/mail-moderations/reject.hbs | 2 +- app/templates/vacancies/index.hbs | 4 +-- app/templates/vacancies/show.hbs | 2 +- translations/en.yaml | 6 ++--- translations/nl.yaml | 4 +-- 20 files changed, 80 insertions(+), 57 deletions(-) rename app/controllers/mail-moderations/{ => mail-moderation}/accept.js (92%) rename app/controllers/mail-moderations/{ => mail-moderation}/destroy.js (68%) rename app/controllers/mail-moderations/{ => mail-moderation}/reject.js (93%) create mode 100644 app/routes/mail-moderations.js create mode 100644 app/routes/mail-moderations/mail-moderation.js rename app/routes/mail-moderations/{ => mail-moderation}/accept.js (57%) rename app/routes/mail-moderations/{ => mail-moderation}/destroy.js (56%) rename app/routes/mail-moderations/{show.js => mail-moderation/index.js} (67%) rename app/routes/mail-moderations/{ => mail-moderation}/reject.js (56%) diff --git a/app/controllers/mail-moderations/index.js b/app/controllers/mail-moderations/index.js index 6da73a427..485cd1357 100644 --- a/app/controllers/mail-moderations/index.js +++ b/app/controllers/mail-moderations/index.js @@ -4,5 +4,5 @@ import { tracked } from '@glimmer/tracking'; export default class MailModerationsIndexController extends FilterableAndSortableController { @tracked sortedAttribute = 'received_at'; - routeOnEnter = 'mail-moderations.show'; + routeOnEnter = 'mail-moderations.mail-moderation'; } diff --git a/app/controllers/mail-moderations/accept.js b/app/controllers/mail-moderations/mail-moderation/accept.js similarity index 92% rename from app/controllers/mail-moderations/accept.js rename to app/controllers/mail-moderations/mail-moderation/accept.js index 027e60991..c1af5fada 100644 --- a/app/controllers/mail-moderations/accept.js +++ b/app/controllers/mail-moderations/mail-moderation/accept.js @@ -17,7 +17,7 @@ export default class MailModerationAcceptController extends Controller { ); if (response.ok) { this.model.unloadRecord(); - this.transitionToRoute('mail-moderations.index'); + this.transitionToRoute('mail-moderations'); } else if (isInvalidResponse(response)) { const json = await response.json(); this.errorMessage = json.errors[0].detail; diff --git a/app/controllers/mail-moderations/destroy.js b/app/controllers/mail-moderations/mail-moderation/destroy.js similarity index 68% rename from app/controllers/mail-moderations/destroy.js rename to app/controllers/mail-moderations/mail-moderation/destroy.js index 1260169c8..4e2c147fb 100644 --- a/app/controllers/mail-moderations/destroy.js +++ b/app/controllers/mail-moderations/mail-moderation/destroy.js @@ -3,6 +3,6 @@ import DestroyController from 'amber-ui/controllers/application/destroy'; export default class MailModerationDestroyController extends DestroyController { successMessage = 'Mail is genegeerd.'; cancelMessage = 'Wijzigingen geannuleerd.'; - successTransitionTarget = 'mail-moderations.index'; - cancelTransitionTarget = 'mail-moderations.show'; + successTransitionTarget = 'mail-moderations'; + cancelTransitionTarget = 'mail-moderations.mail-moderation'; } diff --git a/app/controllers/mail-moderations/reject.js b/app/controllers/mail-moderations/mail-moderation/reject.js similarity index 93% rename from app/controllers/mail-moderations/reject.js rename to app/controllers/mail-moderations/mail-moderation/reject.js index 0e9488223..54291d910 100644 --- a/app/controllers/mail-moderations/reject.js +++ b/app/controllers/mail-moderations/mail-moderation/reject.js @@ -20,7 +20,7 @@ export default class MailModerationRejectController extends Controller { if (response.ok) { this.flashNotice.sendSuccess('Mail moderatie afgewezen!'); this.model.unloadRecord(); - this.transitionToRoute('mail-moderations.index'); + this.transitionToRoute('mail-moderations'); } else if (isInvalidResponse(response)) { const json = await response.json(); this.errorMessage = json.error; diff --git a/app/router.js b/app/router.js index c4147cb9e..51167dd82 100644 --- a/app/router.js +++ b/app/router.js @@ -163,10 +163,12 @@ Router.map(function () { }); this.route('mail-moderations', function () { - this.route('show', { path: '/:id' }); - this.route('destroy', { path: '/:id/destroy' }); - this.route('accept', { path: '/:id/accept' }); - this.route('reject', { path: '/:id/reject' }); + this.route('mail-moderation', { path: ':id' }, function () { + this.route('destroy'); + + this.route('accept'); + this.route('reject'); + }); }); this.route('activities', function () { diff --git a/app/routes/mail-moderations.js b/app/routes/mail-moderations.js new file mode 100644 index 000000000..820140741 --- /dev/null +++ b/app/routes/mail-moderations.js @@ -0,0 +1,7 @@ +import { ApplicationRoute } from 'amber-ui/routes/application/application'; + +export default class MailModerationsRoute extends ApplicationRoute { + queryParams = {}; + + breadcrumb = { title: 'Mail moderatie' }; +} diff --git a/app/routes/mail-moderations/index.js b/app/routes/mail-moderations/index.js index 9a363b729..606d5a41c 100644 --- a/app/routes/mail-moderations/index.js +++ b/app/routes/mail-moderations/index.js @@ -1,8 +1,6 @@ -import { ApplicationRoute } from 'amber-ui/routes/application/application'; - -export default class ModerationIndexRoute extends ApplicationRoute { - breadcrumb = { title: 'Mailmoderatie' }; +import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; +export default class MailModerationsIndexRoute extends AuthenticatedRoute { canAccess() { return this.abilities.can('show mail-moderations'); } diff --git a/app/routes/mail-moderations/mail-moderation.js b/app/routes/mail-moderations/mail-moderation.js new file mode 100644 index 000000000..fc7284bc7 --- /dev/null +++ b/app/routes/mail-moderations/mail-moderation.js @@ -0,0 +1,17 @@ +import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; + +export default class MailModerationRoute extends AuthenticatedRoute { + queryParams = {}; + + get breadcrumb() { + return { title: this.controller?.model.subject }; + } + + canAccess() { + return this.abilities.can('show mail-moderations'); + } + + model(params) { + return this.store.findRecord('stored-mail', params.id, params); + } +} diff --git a/app/routes/mail-moderations/accept.js b/app/routes/mail-moderations/mail-moderation/accept.js similarity index 57% rename from app/routes/mail-moderations/accept.js rename to app/routes/mail-moderations/mail-moderation/accept.js index df0402b2c..cfc6c3b13 100644 --- a/app/routes/mail-moderations/accept.js +++ b/app/routes/mail-moderations/mail-moderation/accept.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class AcceptModerationRoute extends AuthenticatedRoute { +export default class MailModerationAcceptRoute extends AuthenticatedRoute { breadcrumb = { title: 'Moderatieverzoek goedkeuren' }; canAccess() { return this.abilities.can('accept mail-moderations'); } - - model(params) { - return this.store.findRecord('stored-mail', params.id, params); - } } diff --git a/app/routes/mail-moderations/destroy.js b/app/routes/mail-moderations/mail-moderation/destroy.js similarity index 56% rename from app/routes/mail-moderations/destroy.js rename to app/routes/mail-moderations/mail-moderation/destroy.js index 41b2473dc..71b75f66e 100644 --- a/app/routes/mail-moderations/destroy.js +++ b/app/routes/mail-moderations/mail-moderation/destroy.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class DestroyModerationRoute extends AuthenticatedRoute { +export default class MailModerationDestroyRoute extends AuthenticatedRoute { breadcrumb = { title: 'Moderatieverzoek negeren' }; canAccess() { return this.abilities.can('destroy mail-moderations'); } - - model(params) { - return this.store.findRecord('stored-mail', params.id, params); - } } diff --git a/app/routes/mail-moderations/show.js b/app/routes/mail-moderations/mail-moderation/index.js similarity index 67% rename from app/routes/mail-moderations/show.js rename to app/routes/mail-moderations/mail-moderation/index.js index 5330903e3..d95e9d1ff 100644 --- a/app/routes/mail-moderations/show.js +++ b/app/routes/mail-moderations/mail-moderation/index.js @@ -1,28 +1,24 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class ShowModerationRoute extends AuthenticatedRoute { - get breadcrumb() { - return { title: this.controller.model.subject }; - } - +export default class MailModerationIndexRoute extends AuthenticatedRoute { get pageActions() { return [ { - link: 'mail-moderations.accept', + link: 'mail-moderations.mail-moderation.accept', title: 'Goedkeuren', icon: 'check', linkArgument: this.controller.model, canAccess: this.abilities.can('accept mail-moderations'), }, { - link: 'mail-moderations.reject', + link: 'mail-moderations.mail-moderation.reject', title: 'Afkeuren', icon: 'circle-minus', linkArgument: this.controller.model, canAccess: this.abilities.can('reject mail-moderations'), }, { - link: 'mail-moderations.destroy', + link: 'mail-moderations.mail-moderation.destroy', title: 'Negeren', icon: 'trash', linkArgument: this.controller.model, @@ -34,8 +30,4 @@ export default class ShowModerationRoute extends AuthenticatedRoute { canAccess() { return this.abilities.can('show mail-moderations'); } - - model(params) { - return this.store.findRecord('stored-mail', params.id, params); - } } diff --git a/app/routes/mail-moderations/reject.js b/app/routes/mail-moderations/mail-moderation/reject.js similarity index 56% rename from app/routes/mail-moderations/reject.js rename to app/routes/mail-moderations/mail-moderation/reject.js index 91742a345..64117011b 100644 --- a/app/routes/mail-moderations/reject.js +++ b/app/routes/mail-moderations/mail-moderation/reject.js @@ -1,13 +1,9 @@ import { AuthenticatedRoute } from 'amber-ui/routes/application/application'; -export default class RejectModerationRoute extends AuthenticatedRoute { +export default class MailModerationRejectRoute extends AuthenticatedRoute { breadcrumb = { title: 'Moderatieverzoek afwijzen' }; canAccess() { return this.abilities.can('reject mail-moderations'); } - - model(params) { - return this.store.findRecord('stored-mail', params.id, params); - } } diff --git a/app/templates/mail-moderations/accept.hbs b/app/templates/mail-moderations/accept.hbs index ee67246f2..b87dd72b5 100644 --- a/app/templates/mail-moderations/accept.hbs +++ b/app/templates/mail-moderations/accept.hbs @@ -5,7 +5,7 @@ diff --git a/app/templates/mail-moderations/destroy.hbs b/app/templates/mail-moderations/destroy.hbs index 8dd94bbee..dd31f321f 100644 --- a/app/templates/mail-moderations/destroy.hbs +++ b/app/templates/mail-moderations/destroy.hbs @@ -1,9 +1,13 @@

      Weet je zeker dat je deze mail ({{@model.subject}}) wil negeren?

      Er wordt geen bericht gestuurd naar de afzender.

      - + diff --git a/app/templates/mail-moderations/index.hbs b/app/templates/mail-moderations/index.hbs index 27e9f1ebe..d1c7f40b4 100644 --- a/app/templates/mail-moderations/index.hbs +++ b/app/templates/mail-moderations/index.hbs @@ -14,27 +14,42 @@ {{#each model as |storedMail|}} - + {{storedMail.id}} - + {{moment-format storedMail.date 'ddd D MMM YYYY hh:mm'}} - + {{storedMail.subject}} - + {{storedMail.sender}} - + {{storedMail.mailAlias.email}} diff --git a/app/templates/mail-moderations/reject.hbs b/app/templates/mail-moderations/reject.hbs index ec4e02de8..2532314c7 100644 --- a/app/templates/mail-moderations/reject.hbs +++ b/app/templates/mail-moderations/reject.hbs @@ -3,7 +3,7 @@ diff --git a/app/templates/vacancies/index.hbs b/app/templates/vacancies/index.hbs index 9242af429..a804ecbbf 100644 --- a/app/templates/vacancies/index.hbs +++ b/app/templates/vacancies/index.hbs @@ -35,7 +35,7 @@

      {{#if vacancy.group}} @@ -92,7 +92,7 @@