diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 275c9e6af5..55488aad51 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -138,10 +138,10 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npm ci + - run: npm ci --no-audit working-directory: frontend - - run: npm run lint-check + - run: npm run lint:check working-directory: frontend print-eslint: @@ -162,10 +162,10 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npm ci + - run: npm ci --no-audit working-directory: print - - run: npm run lint + - run: npm run lint:check working-directory: print api-tests: @@ -312,7 +312,7 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npm ci + - run: npm ci --no-audit working-directory: frontend - run: npm run build @@ -349,7 +349,7 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npm ci + - run: npm ci --no-audit working-directory: print - run: npm run build @@ -428,10 +428,10 @@ jobs: # run end-to-end tests - run: docker run -v $PWD:/e2e -w /e2e --network host -e CYPRESS_BASE_URL=http://localhost:3000 cypress/included:10.1.0 working-directory: frontend - + # print docker container logs (good for debugging; can be disabled again lateron) - run: docker-compose logs --tail="all" - + coveralls-finished: name: "Finish coveralls report" needs: diff --git a/.gitignore b/.gitignore index 21fabe5fff..d2b1a20151 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ */.DS_Store .idea/ .vscode/ -/.print-data/ .cache/ /.caddy/ /.env diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..de461ae8b5 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "trailingComma": "es5", + "singleQuote": true, + "semi": false, + "bracketSameLine": false, + "bracketSpacing": true, + "printWidth": 90 +} diff --git a/.print-data/.gitkeep b/.print-data/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/README.md b/README.md index 764081c2f4..6092a010c5 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ ## English -*(deutsche Übersetzung weiter unten)* +_(deutsche Übersetzung weiter unten)_ eCamp is a web application for planning J+S camps, J+S courses and other camps. It helps to exchange all planned programme among the camp organizers. An older version called "eCamp v2" is productive and can be used at the following address (but only in german): [https://ecamp.pfadiluzern.ch](https://ecamp.pfadiluzern.ch/) - + eCamp3 is a project that aims to re-develop the features of eCamp v2 with modern technologies and an extensible architecture. Currently, we focus on re-building just the camp planning features, which will be released in an MVP (minimal viable product). Later, extensions for course planning and other features will follow. The following commonly requested improvements over eCamp v2 are already implemented: @@ -25,6 +25,7 @@ eCamp v3 is made up of a backend based on the PHP framework API Platform (Symfon ### Want to help? Thanks for helping! There are a few ways to get started. + - Visit our test environment at https://dev.ecamp3.ch. If you discover a bug, [open an issue](https://github.com/ecamp/ecamp3/issues/new) for it. - To run the project on your computer for development, follow one of our installation guides: - [Installation with Docker on Linux](https://github.com/ecamp/ecamp3/wiki/installation-development-linux) (German only) @@ -35,7 +36,6 @@ Thanks for helping! There are a few ways to get started. - Study the [documentation in the wiki](https://github.com/ecamp/ecamp3/wiki) - Choose an [issue labeled "good first issue"](https://github.com/ecamp/ecamp3/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and try to solve it - ## Deutsch eCamp ist eine Webapplikation, mit welcher J+S-Lager, J+S-Kurse und andere Lager geplant werden können. Dabei verfügen alle Benutzer stets über den aktuellsten Stand der Planung. @@ -57,6 +57,7 @@ eCamp v3 besteht aus einem Backend basierend auf dem PHP-Framework API Platform ### Mithelfen Danke dass du mithelfen möchtest! Es gibt ein paar verschiedene Arten wie du beginnen kannst. + - Besuche unsere Testumgebung auf https://dev.ecamp3.ch. Wenn du einen Fehler entdeckst, [eröffne ein Issue dafür](https://github.com/ecamp/ecamp3/issues/new). - Um das Projekt bei dir auf dem Computer laufen zu lassen, folge einer der Installationsanleitungen: - [Installation mit Docker auf Linux](https://github.com/ecamp/ecamp3/wiki/installation-development-linux) diff --git a/common/helpers/dateHelperVCalendar.js b/common/helpers/dateHelperVCalendar.js index c499ab355a..be3d957e47 100644 --- a/common/helpers/dateHelperVCalendar.js +++ b/common/helpers/dateHelperVCalendar.js @@ -10,7 +10,4 @@ function utcStringToTimestamp (string) { return dayjs(dayjs.utc(string).format('YYYY-MM-DD HH:mm')).valueOf() } -export { - timestampToUtcString, - utcStringToTimestamp -} +export { timestampToUtcString, utcStringToTimestamp } diff --git a/common/locales/de.json b/common/locales/de.json index cdc41afcfc..3f22a7ae18 100644 --- a/common/locales/de.json +++ b/common/locales/de.json @@ -158,4 +158,4 @@ "title": "Grobprogramm für {period}" } } -} \ No newline at end of file +} diff --git a/common/locales/en.json b/common/locales/en.json index cd181f88e1..b43a6e6d8d 100644 --- a/common/locales/en.json +++ b/common/locales/en.json @@ -176,4 +176,4 @@ "title": "Program overview for {period}" } } -} \ No newline at end of file +} diff --git a/common/locales/fr.json b/common/locales/fr.json index cb3372f333..68fc0b59ac 100644 --- a/common/locales/fr.json +++ b/common/locales/fr.json @@ -62,4 +62,4 @@ "name": "Inscription au calendrier" } } -} \ No newline at end of file +} diff --git a/common/locales/it.json b/common/locales/it.json index 2e20f3158a..44a0c0fac5 100644 --- a/common/locales/it.json +++ b/common/locales/it.json @@ -62,4 +62,4 @@ "name": "Inserimento nel programma" } } -} \ No newline at end of file +} diff --git a/docker-compose.yml b/docker-compose.yml index 629687b9f1..dee4d9a2a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,11 +6,12 @@ services: container_name: 'ecamp3-frontend' ports: - '3000:3000' - - '9229:9229' # jest debug + - '9229:9229' # jest debug stdin_open: true tty: true user: ${USER_ID:-1000} volumes: + - ./.prettierrc:/.prettierrc - ./frontend:/app:delegated - ./common:/common:delegated - ./.cache/npm:/home/node/.npm @@ -107,6 +108,7 @@ services: - '3003:3003' user: ${USER_ID:-1000} volumes: + - ./.prettierrc:/.prettierrc - ./print:/app:delegated - ./common:/common:delegated - ./.cache/npm:/home/node/.npm diff --git a/docs/UseCases.md b/docs/UseCases.md deleted file mode 100644 index 93d397cf90..0000000000 --- a/docs/UseCases.md +++ /dev/null @@ -1,159 +0,0 @@ -# Use Cases -Legende für die Bilder: -Blau: Aktion -Rot: Aktiv -Violett: Disabled - - -#### ```UC 01``` Neuregistrierter Benutzer ohne Einladung - _(Prio 10)_ - Dem Benutzer wird die Über eCamp Seite angezeigt. - - Lager erstellen - - Gruppe erstellen - - Hilfe anschauen - - ![Bild UC 1](images/UC01.png) - ---- -#### ```UC 02``` Neues Camp erstellen - _(Prio 10)_ - Name, Gruppe, Zeit (Perioden), CampType (Lager oder Kurs), Mitarbeitende. - -##### ```UC 02.1``` Benutzer hat noch keine Gruppe - Wenn der Benutzer noch keine Gruppe hat, - kann er hier eine Gruppe mit dem Namen erstellen. - Diese wird automatisch in die versteckte Übergruppe "Benutzer" erstellt. - - ![Bild UC 2.1](images/UC02_1.png) - -##### ```UC 02.2``` Benutzer hat bereits mind. eine Gruppe - Wenn der Benutzer bereits eine Gruppe hat, dann - wird automatisch die ausgewählte Gruppe ausgewählt. - - ![Bild UC 2.2](images/UC02_2.png) - -##### ```UC 02.3``` Benutzer kommt via Gruppenview auf diesen Flow - (Falls der Benutzer bereits eine vorgegebene Struktur hat (MiData / Hitobito / …) - und das Lager direkt aus der Gruppe heraus erstellt) - Hier kann der Benutzer die Gruppe nicht mehr ändern, - es wird ihm einfach angezeit, in welcher Gruppe - das Lager kreiert wird. - ---- -#### ```UC 03``` Camp finden und öffnen. - _(Prio 7)_ - - ---- -#### ```UC 04``` Anderen User zu Camp einladen. - _(Prio 9)_ - Es gibt keine öffentliche Suchmethodik für Benutzer (Datenschutzgründe) - Die Benutzer können nur über den Camp Erstellungsdialog oder - den Camp Einstellungsdialog hinzugefügt werden. - -##### ```UC 04.1``` Normale eingeladene Person - Der Benutzer kann E-Mail Adressen eingeben. - -##### ```UC 04.2``` Eingeladene Person ist in einer gemeinsamen Gruppe - Bei der Eingabe wird dem Benutzer die eingeladene Person vorgeschlagen, - weil er bereits in einer gemeinsamen Gruppe ist. - -##### ```UC 04.3``` Der Benutzer ist mit einem Identity-Provider verbunden - Falls der Benutzer einen Identity-Provider verwendet, werden die Benutzer bei - der Eingabe vorgeschlagen, die Anhand der Berechtigungen in Frage kommen könnten - ---- -#### ```UC 05``` Camp-Einladung annehmen oder ablehnen. - _(Prio 8.9)_ - Es wird in jedemfall ein E-Mail an die E-Mail-Adresse versendet. - Falls die Adresse bereits in der Datenbank vorhanden ist, - wird dem eingeladenen Benutzer die Anmeldung in der Anwendung angezeigt und er - kann sie annehmen oder ignorieren. - - //TODO - uc05.1 übereinstimmende adresse - uc05.2 nicht übereinstimmende Adresse - ---- -#### ```UC 06``` Camp-Einstellungen vornehmen. - _(Prio 6)_ - Z.B. Kopfdaten vom Camp (Ort, Name, Motto, …), Perioden, Event-Kategorien (LS / LA / LP / …). - - ---- -#### ```UC 07``` Event (Block im DP) erstellen. - _(Prio 9)_ - Der Block kann über vier verschiedene Wege erstellt werden: - -##### ```UC 07.1``` Mit zeitlichen Einordnung erstellen -Die definierte Zeit kann auch noch im Anschluss (UC09) verändert werden. - -###### ```UC 07.1a``` Via Wochenansicht -Durch drücken und ziehen kann der Block (die erste Instanz) Zeitlich erstellt werden - -###### ```UC 07.1b``` Via Tagesansicht, in der Liste auf der Seite (+) - ![Bild UC 7.1b](images/UseCases-UC07.1b.png) - - Auf der Seite wird beim drüberfahren ein Knopf auf der Seite zum hinzufügen eines Blocks angezeigt. - -##### ```UC 07.2``` Ohne zeitliche Einordnung erstellen -Hier werden je nach Ansicht Beispielswerte für die Einplanung verwendet. -Es können aber im Anschluss alle zeitlichen Einplanungen noch definiert werden. - -###### ```UC 07.2a``` Über die Wochenansicht per Button - Verschiedenen Event-Typen können ausgewählt werden. - -###### ```UC 07.2b``` Über die Tagesansicht per Button - ![Bild UC 7.2b](images/UseCases-UC07.2b.png) - - Verschiedenen Event-Typen können ausgewählt werden. - -##### ```UC 07.3``` Inhalt erfassen -Im Anschluss öffnet sich das Blockinhalt Fenster. -Hier kann Titel, Kategorie und den ganzen restlichen Inhalt erfasst werden. - - -- HTML -- Block erfassen aus Benutzersicht -- - - 0 Event-Instanzen (möglich? nötig? in v2 gibt es Lagerleiter welche einen Block ganz am Anfang des ersten Tages für Lagerregeln etc. “missbrauchen”), 1 Event-Instanz, mehrere Event-Instanzen. - - ---- -#### ```UC 08``` Event im Lager einplanen. - _(Prio 8.5)_ - Derselbe Block mit demselben DP kann an mehreren Orten im Lager eingefügt werden. Events können im Lager verschoben werden. Events können zeitlich gleichzeitig stattfinden (Buebe / Meitli, Wölfli / Pfadi, Quali-Höck / Programm). - - ---- -#### ```UC 09``` Event-Inhalt bearbeiten. - _(Prio 8)_ - Block-Kopfdaten bearbeiten (Name und Category), ContentType-Instanz hinzufügen (z.B. wenn auf dem Lager definiert ist dass ein LS mehrere SiKos haben kann, Winter, Berg, Wasser), ContentType-Instanz bearbeiten, ContentType-Instanz entfernen. - - ---- -#### ```UC 10``` Event kopieren. - _(Prio 5)_ - Innerhalb Lager und Lager-übergreifend. - - ---- -#### ```UC 11``` Tagesübersicht ansehen. - _(Prio 8)_ - - ---- -#### ```UC 12``` Wochenübersicht ansehen. - _(Prio 8)_ - - ---- -#### ```UC 13``` Lager-Materiallisten ansehen. - _(Prio 5)_ - - ---- -#### ```UC 14``` Drucken / Offline verfügbar. - _(Prio 7)_ - Wie kommt der User zu seinem gewünschten Ausdruck. NICHT: Wie sieht der Ausdruck aus. Prio 7 diff --git a/docs/images/UC01.png b/docs/images/UC01.png deleted file mode 100644 index 5b88d227b5..0000000000 Binary files a/docs/images/UC01.png and /dev/null differ diff --git a/docs/images/UC02_1.png b/docs/images/UC02_1.png deleted file mode 100644 index 5f615f32ad..0000000000 Binary files a/docs/images/UC02_1.png and /dev/null differ diff --git a/docs/images/UC02_2.png b/docs/images/UC02_2.png deleted file mode 100644 index 696f92d90c..0000000000 Binary files a/docs/images/UC02_2.png and /dev/null differ diff --git a/docs/images/UseCases-UC07.1b.png b/docs/images/UseCases-UC07.1b.png deleted file mode 100644 index 1e1e6fcc2e..0000000000 Binary files a/docs/images/UseCases-UC07.1b.png and /dev/null differ diff --git a/docs/images/UseCases-UC07.2b.png b/docs/images/UseCases-UC07.2b.png deleted file mode 100644 index 0dd6ab81ac..0000000000 Binary files a/docs/images/UseCases-UC07.2b.png and /dev/null differ diff --git a/frontend/.prettierignore b/frontend/.prettierignore new file mode 100644 index 0000000000..dc3a5b79bc --- /dev/null +++ b/frontend/.prettierignore @@ -0,0 +1,4 @@ +src/common/locales/ +src/locales/ +/dist +.vscode diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json index 3e2609877b..12b959616c 100644 --- a/frontend/.vscode/settings.json +++ b/frontend/.vscode/settings.json @@ -1,9 +1,6 @@ { - "javascript.format.enable": false, - "eslint.format.enable": true, - "i18n-ally.localesPaths": [ - "src/locales", - "src/plugins/i18n" - ], - "i18n-ally.keystyle": "nested" -} \ No newline at end of file + "javascript.format.enable": false, + "eslint.format.enable": true, + "i18n-ally.localesPaths": ["src/locales", "src/plugins/i18n"], + "i18n-ally.keystyle": "nested" +} diff --git a/frontend/README.md b/frontend/README.md index cf5a936cc7..897b0044d3 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,31 +1,37 @@ # frontend ## Project setup + ``` npm install ``` ### Compiles and hot-reloads for development + ``` npm run serve ``` ### Compiles and minifies for production + ``` npm run build ``` ### Lints and fixes files + ``` npm run lint ``` ### Run your unit tests + ``` npm run test:unit ``` ### Run your end-to-end tests + ``` npm run test:e2e ``` diff --git a/frontend/babel.config.js b/frontend/babel.config.js index ec0641c0d3..80a5649def 100644 --- a/frontend/babel.config.js +++ b/frontend/babel.config.js @@ -1,12 +1,8 @@ module.exports = { - presets: [ - '@vue/app' - ], + presets: ['@vue/app'], env: { test: { - plugins: [ - 'require-context-hook' - ] + plugins: ['require-context-hook'] } } } diff --git a/frontend/package.json b/frontend/package.json index a94d022ebf..05c45d6f45 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,8 +6,12 @@ "serve": "vite --host 0.0.0.0", "preview": "vite preview --host 0.0.0.0 --port 3000", "build": "vite build", - "lint": "vue-cli-service lint", - "lint-check": "vue-cli-service lint --no-fix", + "lint": "npm run lint:eslint && npm run lint:prettier", + "lint:eslint": "vue-cli-service lint", + "lint:prettier": "prettier --write --ignore-path .prettierignore **/*.{css,scss,json,md}", + "lint:check": "npm run lint:check:eslint && npm run lint:check:prettier", + "lint:check:eslint": "vue-cli-service lint --no-fix", + "lint:check:prettier": "prettier --check --ignore-path .prettierignore **/*.{css,scss,json,md}", "start": "vite --host 0.0.0.0", "dev": "vite --host 0.0.0.0", "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index e9b99102b7..9e46770bee 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -10,11 +10,12 @@ - - eCamp - {{ version }} - {{ deploymentTime }} + + eCamp + + {{ version }} + + {{ deploymentTime }} @@ -42,7 +43,11 @@ export default { return window.environment.VERSION || '' }, versionLink () { - return parseTemplate(window.environment.VERSION_LINK_TEMPLATE).expand({ version: this.version }) || '#' + return ( + parseTemplate(window.environment.VERSION_LINK_TEMPLATE).expand({ + version: this.version + }) || '#' + ) } }, created () { @@ -50,7 +55,7 @@ export default { }, async mounted () { if (this.$auth.isLoggedIn()) { - this.profile._meta.load.then(profile => { + this.profile._meta.load.then((profile) => { if (VueI18n.availableLocales.includes(profile.language)) { this.$store.commit('setLanguage', profile.language) } @@ -60,101 +65,103 @@ export default { } diff --git a/frontend/src/components/activity/ActivityResponsibles.vue b/frontend/src/components/activity/ActivityResponsibles.vue index ea00abd48d..0cc9e4016c 100644 --- a/frontend/src/components/activity/ActivityResponsibles.vue +++ b/frontend/src/components/activity/ActivityResponsibles.vue @@ -38,21 +38,30 @@ export default { }, computed: { isLoading () { - return this.campCollaborations._meta.loading || this.activityResponsibles._meta.loading + return ( + this.campCollaborations._meta.loading || this.activityResponsibles._meta.loading + ) }, availableCampCollaborations () { - return this.campCollaborations.items.filter(cc => { - return (cc.status !== 'inactive') || (this.currentCampCollaborationIRIs.includes(cc._meta.self)) - }).map(value => { - // following structure is defined by vuetify v-select items property - return { - value: value._meta.self, - text: campCollaborationDisplayName(value) - } - }) + return this.campCollaborations.items + .filter((cc) => { + return ( + cc.status !== 'inactive' || + this.currentCampCollaborationIRIs.includes(cc._meta.self) + ) + }) + .map((value) => { + // following structure is defined by vuetify v-select items property + return { + value: value._meta.self, + text: campCollaborationDisplayName(value) + } + }) }, currentCampCollaborationIRIs () { - return this.activityResponsibles.items.map(item => item.campCollaboration()._meta.self) + return this.activityResponsibles.items.map( + (item) => item.campCollaboration()._meta.self + ) }, activityResponsibles () { return this.activity.activityResponsibles() @@ -67,24 +76,32 @@ export default { this.selectedCampCollaborations = [...this.currentCampCollaborationIRIs] }, methods: { - onInput (value) { + onInput () { const promises = [] this.errorMessages = [] this.isSaving = true // add new items - const newItems = this.selectedCampCollaborations.filter(item => !this.oldSelectedCampCollaborations.includes(item)) - newItems.forEach(campCollaborationIRI => { - promises.push(this.activity.activityResponsibles().$post({ - activity: this.activity._meta.self, - campCollaboration: campCollaborationIRI - })) + const newItems = this.selectedCampCollaborations.filter( + (item) => !this.oldSelectedCampCollaborations.includes(item) + ) + newItems.forEach((campCollaborationIRI) => { + promises.push( + this.activity.activityResponsibles().$post({ + activity: this.activity._meta.self, + campCollaboration: campCollaborationIRI + }) + ) }) // delete removed items - const removedItems = this.oldSelectedCampCollaborations.filter(item => !this.selectedCampCollaborations.includes(item)) - removedItems.forEach(campCollaborationIRI => { - const activityResponsible = this.activityResponsibles.items.find(item => item.campCollaboration()._meta.self === campCollaborationIRI) + const removedItems = this.oldSelectedCampCollaborations.filter( + (item) => !this.selectedCampCollaborations.includes(item) + ) + removedItems.forEach((campCollaborationIRI) => { + const activityResponsible = this.activityResponsibles.items.find( + (item) => item.campCollaboration()._meta.self === campCollaborationIRI + ) if (activityResponsible !== undefined) { promises.push(activityResponsible.$del()) } @@ -93,13 +110,16 @@ export default { // reset comparison value this.oldSelectedCampCollaborations = [...this.selectedCampCollaborations] - Promise.all(promises).then(() => { - this.activityResponsibles.$reload() - }).catch(e => { - this.errorMessages.push(serverErrorToString(e)) - }).finally(() => { - this.isSaving = false - }) + Promise.all(promises) + .then(() => { + this.activityResponsibles.$reload() + }) + .catch((e) => { + this.errorMessages.push(serverErrorToString(e)) + }) + .finally(() => { + this.isSaving = false + }) } } } diff --git a/frontend/src/components/activity/ButtonNestedContentNodeAdd.vue b/frontend/src/components/activity/ButtonNestedContentNodeAdd.vue index 31df2c6a5f..64e2e6928a 100644 --- a/frontend/src/components/activity/ButtonNestedContentNodeAdd.vue +++ b/frontend/src/components/activity/ButtonNestedContentNodeAdd.vue @@ -1,26 +1,22 @@ - + diff --git a/frontend/src/components/activity/content/Storyboard.vue b/frontend/src/components/activity/content/Storyboard.vue index 2cdaf00c68..df5464cd62 100644 --- a/frontend/src/components/activity/content/Storyboard.vue +++ b/frontend/src/components/activity/content/Storyboard.vue @@ -14,7 +14,10 @@ - + @@ -48,8 +51,7 @@
- + mdi-drag-horizontal-variant
- + mdi-arrow-up-bold - + mdi-arrow-down-bold
@@ -85,13 +84,14 @@ - + mdi-plus @@ -154,8 +154,8 @@ export default { diff --git a/frontend/src/components/activity/content/Storycontext.vue b/frontend/src/components/activity/content/Storycontext.vue index 89694f17cb..b51da75973 100644 --- a/frontend/src/components/activity/content/Storycontext.vue +++ b/frontend/src/components/activity/content/Storycontext.vue @@ -15,7 +15,6 @@ - + diff --git a/frontend/src/components/activity/content/columnLayout/ColumnOperations.vue b/frontend/src/components/activity/content/columnLayout/ColumnOperations.vue index 33cf3ab704..54fd16dc17 100644 --- a/frontend/src/components/activity/content/columnLayout/ColumnOperations.vue +++ b/frontend/src/components/activity/content/columnLayout/ColumnOperations.vue @@ -20,7 +20,10 @@ - + diff --git a/frontend/src/components/buttons/ButtonBack.vue b/frontend/src/components/buttons/ButtonBack.vue index 88165da4a9..058e34e2f5 100644 --- a/frontend/src/components/buttons/ButtonBack.vue +++ b/frontend/src/components/buttons/ButtonBack.vue @@ -1,9 +1,7 @@ @@ -14,6 +12,4 @@ export default { } - + diff --git a/frontend/src/components/buttons/ButtonCancel.vue b/frontend/src/components/buttons/ButtonCancel.vue index faf6338b26..169f789b6d 100644 --- a/frontend/src/components/buttons/ButtonCancel.vue +++ b/frontend/src/components/buttons/ButtonCancel.vue @@ -1,9 +1,7 @@ diff --git a/frontend/src/components/buttons/ButtonDelete.vue b/frontend/src/components/buttons/ButtonDelete.vue index 059e71cbbd..e57f72a784 100644 --- a/frontend/src/components/buttons/ButtonDelete.vue +++ b/frontend/src/components/buttons/ButtonDelete.vue @@ -28,5 +28,4 @@ export default { } - + diff --git a/frontend/src/components/buttons/ButtonEdit.vue b/frontend/src/components/buttons/ButtonEdit.vue index 369a04f341..f2181c3e3a 100644 --- a/frontend/src/components/buttons/ButtonEdit.vue +++ b/frontend/src/components/buttons/ButtonEdit.vue @@ -1,9 +1,7 @@ - + @@ -37,15 +34,8 @@ export default { }, data () { return { - entityProperties: [ - 'short', - 'name', - 'color', - 'numberingStyle' - ], - embeddedCollections: [ - 'preferredContentTypes' - ] + entityProperties: ['short', 'name', 'color', 'numberingStyle'], + embeddedCollections: ['preferredContentTypes'] } }, watch: { @@ -59,6 +49,4 @@ export default { } - + diff --git a/frontend/src/components/campAdmin/DialogCategoryForm.vue b/frontend/src/components/campAdmin/DialogCategoryForm.vue index b3e7a921b5..7a798ba918 100644 --- a/frontend/src/components/campAdmin/DialogCategoryForm.vue +++ b/frontend/src/components/campAdmin/DialogCategoryForm.vue @@ -50,16 +50,19 @@ export default { }, computed: { numberingStyles () { - return ['1', 'a', 'A', 'i', 'I'].map(i => ({ + return ['1', 'a', 'A', 'i', 'I'].map((i) => ({ value: i, text: this.$tc('entity.category.numberingStyles.' + i) })) }, contentTypes () { - return this.api.get().contentTypes().items.map(ct => ({ - value: ct._meta.self, - text: this.$tc('contentNode.' + camelCase(ct.name) + '.name') - })) + return this.api + .get() + .contentTypes() + .items.map((ct) => ({ + value: ct._meta.self, + text: this.$tc('contentNode.' + camelCase(ct.name) + '.name') + })) }, contentTypesLoading () { return this.api.get().contentTypes()._meta.loading diff --git a/frontend/src/components/campAdmin/DialogMaterialListCreate.vue b/frontend/src/components/campAdmin/DialogMaterialListCreate.vue index 369cb8e321..580741482d 100644 --- a/frontend/src/components/campAdmin/DialogMaterialListCreate.vue +++ b/frontend/src/components/campAdmin/DialogMaterialListCreate.vue @@ -31,10 +31,7 @@ export default { }, data () { return { - entityProperties: [ - 'camp', - 'name' - ], + entityProperties: ['camp', 'name'], entityUri: '/material_lists' } }, @@ -61,6 +58,4 @@ export default { } - + diff --git a/frontend/src/components/campAdmin/DialogMaterialListEdit.vue b/frontend/src/components/campAdmin/DialogMaterialListEdit.vue index bd0fd3d46d..2632806410 100644 --- a/frontend/src/components/campAdmin/DialogMaterialListEdit.vue +++ b/frontend/src/components/campAdmin/DialogMaterialListEdit.vue @@ -30,9 +30,7 @@ export default { }, data () { return { - entityProperties: [ - 'name' - ] + entityProperties: ['name'] } }, watch: { @@ -46,6 +44,4 @@ export default { } - + diff --git a/frontend/src/components/campAdmin/DialogPeriodCreate.vue b/frontend/src/components/campAdmin/DialogPeriodCreate.vue index 7fbd1fef03..ef710b29be 100644 --- a/frontend/src/components/campAdmin/DialogPeriodCreate.vue +++ b/frontend/src/components/campAdmin/DialogPeriodCreate.vue @@ -30,12 +30,7 @@ export default { }, data () { return { - entityProperties: [ - 'camp', - 'description', - 'start', - 'end' - ], + entityProperties: ['camp', 'description', 'start', 'end'], entityUri: '/periods' } }, @@ -64,6 +59,4 @@ export default { } - + diff --git a/frontend/src/components/campAdmin/DialogPeriodEdit.vue b/frontend/src/components/campAdmin/DialogPeriodEdit.vue index ce9a6c9025..7eb69b5377 100644 --- a/frontend/src/components/campAdmin/DialogPeriodEdit.vue +++ b/frontend/src/components/campAdmin/DialogPeriodEdit.vue @@ -13,64 +13,75 @@ - - - - + + + + width="14" + height="70" class="day-background" /> + width="28" + height="70" class="day-background" /> + width="28" + height="70" class="day-background" /> + width="28" + height="70" class="day-background" /> + width="28" + height="70" class="day-background" /> + width="28" + height="70" class="day-background" /> + width="28" + height="70" class="day-background" /> - - - + width="14" + height="70" class="day-background" /> + + + + width="22" + height="32" class="category1" /> + width="22" + height="32" class="category2" /> + width="22" + height="32" class="category1" /> + width="22" + height="32" class="category2" /> - + - + @@ -89,12 +100,7 @@ export default { }, data () { return { - entityProperties: [ - 'description', - 'start', - 'end', - 'moveScheduleEntries' - ] + entityProperties: ['description', 'start', 'end', 'moveScheduleEntries'] } }, watch: { @@ -114,75 +120,131 @@ export default { diff --git a/frontend/src/components/collaborator/CollaboratorListItem.vue b/frontend/src/components/collaborator/CollaboratorListItem.vue index ab2b77e0f1..d970de413c 100644 --- a/frontend/src/components/collaborator/CollaboratorListItem.vue +++ b/frontend/src/components/collaborator/CollaboratorListItem.vue @@ -11,9 +11,7 @@ {{ collaborator.inviteEmail }} - +
+
- {{ $tc("components.camp.collaboratorListItem.cannotAssignAnotherRoleToLastManager") }} + {{ + $tc('components.camp.collaboratorListItem.cannotAssignAnotherRoleToLastManager') + }} - {{ $tc("components.camp.collaboratorListItem.cannotRemoveLastManager") }} + {{ + $tc('components.camp.collaboratorListItem.cannotRemoveLastManager') + }} @@ -90,12 +88,12 @@ export default { if (this.collaborator.status !== 'established') return false if (this.collaborator.role !== 'manager') return false const camp = this.collaborator.camp() - return camp - ?.campCollaborations() - ?.items - ?.filter(collaborator => collaborator.status === 'established') - .filter(collaborator => collaborator.role === 'manager') - .length <= 1 + return ( + camp + ?.campCollaborations() + ?.items?.filter((collaborator) => collaborator.status === 'established') + .filter((collaborator) => collaborator.role === 'manager').length <= 1 + ) }, isOwnCampCollaboration () { if (!(typeof this.collaborator.user === 'function')) { @@ -107,11 +105,15 @@ export default { methods: { resendInvitation () { this.resendingEmail = true - this.api.href(this.api.get(), 'campCollaborations', { - id: this.collaborator.id, - action: 'resend_invitation' - }).then(postUrl => this.api.patch(postUrl, {})) - .finally(() => { this.resendingEmail = false }) + this.api + .href(this.api.get(), 'campCollaborations', { + id: this.collaborator.id, + action: 'resend_invitation' + }) + .then((postUrl) => this.api.patch(postUrl, {})) + .finally(() => { + this.resendingEmail = false + }) }, deactivateUser () { const ok = this.api.patch(this.collaborator, { status: 'inactive' }) @@ -125,5 +127,4 @@ export default { } - + diff --git a/frontend/src/components/collaborator/InactiveCollaboratorListItem.vue b/frontend/src/components/collaborator/InactiveCollaboratorListItem.vue index 74fef4eeb8..78b2b77a51 100644 --- a/frontend/src/components/collaborator/InactiveCollaboratorListItem.vue +++ b/frontend/src/components/collaborator/InactiveCollaboratorListItem.vue @@ -16,7 +16,7 @@ color="normal" icon="mdi-refresh" :disabled="disabled" - @click="api.patch(collaborator, {status: 'invited'})"> + @click="api.patch(collaborator, { status: 'invited' })"> {{ $tc('components.camp.inactiveCampCollaboratorListItem.inviteAgain') }} @@ -42,7 +42,6 @@ - + diff --git a/frontend/src/components/dialog/DialogForm.vue b/frontend/src/components/dialog/DialogForm.vue index 7bbc16559a..f9f0af43cf 100644 --- a/frontend/src/components/dialog/DialogForm.vue +++ b/frontend/src/components/dialog/DialogForm.vue @@ -21,10 +21,12 @@ {{ title }} - + mdi-close {{ $tc('global.button.cancel') }} @@ -36,11 +38,9 @@ - + color="warning" icon="mdi-alert"> @@ -65,9 +65,7 @@ type="submit" :loading="isSaving" :disabled="!submitEnabled"> - + {{ submitIcon }} {{ $tc(submitLabel) }} @@ -81,7 +79,6 @@ diff --git a/frontend/src/components/form/ServerError.vue b/frontend/src/components/form/ServerError.vue index bc31ffe816..52394bc069 100644 --- a/frontend/src/components/form/ServerError.vue +++ b/frontend/src/components/form/ServerError.vue @@ -1,13 +1,12 @@ diff --git a/frontend/src/components/form/ServerErrorContent.vue b/frontend/src/components/form/ServerErrorContent.vue index f827ee50fe..d17dfb0da5 100644 --- a/frontend/src/components/form/ServerErrorContent.vue +++ b/frontend/src/components/form/ServerErrorContent.vue @@ -1,11 +1,18 @@