From 4dfc99a9dbb61f513ee0fb3cc91202d7d19a3605 Mon Sep 17 00:00:00 2001 From: Vincent Auger Date: Wed, 27 Sep 2023 15:01:57 -0300 Subject: [PATCH 1/3] add publication "tab" --- .eslintrc.js | 25 ----------- .eslintrc.json | 26 ++++++++++++ .prettierrc | 3 ++ package.json | 2 +- pnpm-lock.yaml | 15 ++++--- resources/src/auto-imports.d.ts | 3 +- resources/src/locales/en.json | 3 +- resources/src/locales/fr.json | 3 +- .../views/ManagementReviewStepsView.vue | 5 +++ .../views/ManuscriptRecordFormView.vue | 9 ++++ .../views/ManuscriptRecordProgressView.vue | 14 +++++-- resources/src/pages/ManuscriptRecordPage.vue | 42 +++++++++++++------ 12 files changed, 98 insertions(+), 52 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 .eslintrc.json create mode 100644 .prettierrc diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5699d014..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - root: true, - env: { node: true }, - // https://github.com/vuejs/vue-eslint-parser#parseroptionsparser - parser: 'vue-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser', - }, - plugins: ['@typescript-eslint', 'prettier', 'quasar'], - extends: [ - 'plugin:@typescript-eslint/recommended', - // https://github.com/vuejs/eslint-plugin-vue/blob/44ff0e02cd0fd08b8cd7dee0127dbb5590446323/docs/user-guide/README.md#conflict-with-prettier - 'plugin:vue/vue3-recommended', - 'prettier', - ], - rules: { - 'prettier/prettier': [ - 'warn', - { - singleQuote: true, - }, - ], - }, - ignorePatterns: ['auto-imports.d.ts'], -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..5b701e93 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,26 @@ +{ + "root": true, + "env": { "node": true }, + // https://github.com/vuejs/vue-eslint-parser#parseroptionsparser + "parser": "vue-eslint-parser", + "parserOptions": { + "parser": "@typescript-eslint/parser" + }, + "plugins": ["@typescript-eslint", "prettier", "quasar"], + "extends": [ + "plugin:@typescript-eslint/recommended", + // https://github.com/vuejs/eslint-plugin-vue/blob/44ff0e02cd0fd08b8cd7dee0127dbb5590446323/docs/user-guide/README.md#conflict-with-prettier + "plugin:vue/vue3-recommended", + "prettier" + ], + "rules": { + "prettier/prettier": [ + "warn", + { + "singleQuote": true, + "jsxSingleQuote": true + } + ] + }, + "ignorePatterns": ["auto-imports.d.ts"] +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..dc2fb828 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} \ No newline at end of file diff --git a/package.json b/package.json index 32bd1c7d..4f67cbd2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.0", + "eslint-plugin-quasar": "^1.1.0", "eslint-plugin-vue": "^9.17.0", "laravel-vite-plugin": "^0.8.0", "lodash": "^4.17.21", @@ -35,7 +36,6 @@ "@vitejs/plugin-vue": "^4.3.4", "@vueuse/core": "^10.4.1", "dompurify": "^3.0.5", - "eslint-plugin-quasar": "^1.1.0", "pinia": "^2.1.6", "plugin-vue@latest": "link:@@vitejs/plugin-vue@latest", "quasar": "^2.12.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df6af417..51f53dff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,9 +20,6 @@ dependencies: dompurify: specifier: ^3.0.5 version: 3.0.5 - eslint-plugin-quasar: - specifier: ^1.1.0 - version: 1.1.0 pinia: specifier: ^2.1.6 version: 2.1.6(typescript@5.2.2)(vue@3.3.4) @@ -73,6 +70,9 @@ devDependencies: eslint-plugin-prettier: specifier: ^5.0.0 version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.50.0)(prettier@3.0.3) + eslint-plugin-quasar: + specifier: ^1.1.0 + version: 1.1.0 eslint-plugin-vue: specifier: ^9.17.0 version: 9.17.0(eslint@8.50.0) @@ -100,6 +100,9 @@ devDependencies: vite: specifier: ^4.4.9 version: 4.4.9(@types/node@20.7.0)(sass@1.32.13) + vue-eslint-parser: + specifier: ^9.3.1 + version: 9.3.1(eslint@8.50.0) vue-tsc: specifier: ^1.8.15 version: 1.8.15(typescript@5.2.2) @@ -1483,7 +1486,7 @@ packages: dependencies: requireindex: 1.2.0 semver-compare: 1.0.0 - dev: false + dev: true /eslint-plugin-vue@9.17.0(eslint@8.50.0): resolution: {integrity: sha512-r7Bp79pxQk9I5XDP0k2dpUC7Ots3OSWgvGZNu3BxmKK6Zg7NgVtcOB6OCna5Kb9oQwJPl5hq183WD0SY5tZtIQ==} @@ -2635,7 +2638,7 @@ packages: /requireindex@1.2.0: resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} engines: {node: '>=0.10.5'} - dev: false + dev: true /requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} @@ -2724,7 +2727,7 @@ packages: /semver-compare@1.0.0: resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} - dev: false + dev: true /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} diff --git a/resources/src/auto-imports.d.ts b/resources/src/auto-imports.d.ts index 39578900..5b99e6f3 100644 --- a/resources/src/auto-imports.d.ts +++ b/resources/src/auto-imports.d.ts @@ -157,6 +157,7 @@ declare global { const useCssVar: typeof import('@vueuse/core')['useCssVar'] const useCssVars: typeof import('vue')['useCssVars'] const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement'] + const useCurrentMRFStore: typeof import('./stores/CurrentMRFStore')['useCurrentMRFStore'] const useCycleList: typeof import('@vueuse/core')['useCycleList'] const useDark: typeof import('@vueuse/core')['useDark'] const useDateFormat: typeof import('@vueuse/core')['useDateFormat'] @@ -315,7 +316,7 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' } // for vue template auto import import { UnwrapRef } from 'vue' diff --git a/resources/src/locales/en.json b/resources/src/locales/en.json index 0eaf7187..758c49e0 100644 --- a/resources/src/locales/en.json +++ b/resources/src/locales/en.json @@ -231,7 +231,8 @@ "your-email": "Your email", "your-first-name": "Your first name", "your-last-name": "Your last name", - "your-password": "Your password" + "your-password": "Your password", + "publication": "Publication" }, "create-author-dialog": { "title": "Create a new author" diff --git a/resources/src/locales/fr.json b/resources/src/locales/fr.json index 1f1d0313..39899d23 100644 --- a/resources/src/locales/fr.json +++ b/resources/src/locales/fr.json @@ -231,7 +231,8 @@ "your-email": "Votre courriel", "your-first-name": "Ton prénom", "your-last-name": "Votre nom de famille", - "your-password": "Votre mot de passe" + "your-password": "Votre mot de passe", + "publication": "Publication" }, "create-author-dialog": { "title": "Créer un nouvel auteur" diff --git a/resources/src/models/ManagementReviewStep/views/ManagementReviewStepsView.vue b/resources/src/models/ManagementReviewStep/views/ManagementReviewStepsView.vue index 456fa562..0631c52d 100644 --- a/resources/src/models/ManagementReviewStep/views/ManagementReviewStepsView.vue +++ b/resources/src/models/ManagementReviewStep/views/ManagementReviewStepsView.vue @@ -111,6 +111,10 @@ const props = defineProps<{ id: number; }>(); +const emit = defineEmits<{ + (e: 'update-manuscript', manuscript: ManuscriptRecordResource): void; +}>(); + const managementReviewSteps: Ref = ref(null); const manuscriptRecord: Ref = ref(null); @@ -206,6 +210,7 @@ async function getManuscriptRecord() { await ManuscriptRecordService.find(props.id) .then((response) => { manuscriptRecord.value = response; + emit('update-manuscript', manuscriptRecord.value); }) .catch((error) => { console.log(error); diff --git a/resources/src/models/ManuscriptRecord/views/ManuscriptRecordFormView.vue b/resources/src/models/ManuscriptRecord/views/ManuscriptRecordFormView.vue index 7dfcb81d..821387b1 100644 --- a/resources/src/models/ManuscriptRecord/views/ManuscriptRecordFormView.vue +++ b/resources/src/models/ManuscriptRecord/views/ManuscriptRecordFormView.vue @@ -388,6 +388,10 @@ const props = defineProps<{ id: number; }>(); +const emit = defineEmits<{ + (e: 'update-manuscript', manuscript: ManuscriptRecordResource): void; +}>(); + const loading = ref(true); const manuscriptResource: Ref = ref(null); const manuscriptAuthorsCard = ref { await ManuscriptRecordService.find(props.id) .then((response) => { manuscriptResource.value = response; + emit('update-manuscript', manuscriptResource.value); }) .catch((error) => { if (error.status == 403) { @@ -479,6 +484,10 @@ const save = async () => { console.log(error); }) .finally(() => { + //emit the event to the parent + if (manuscriptResource.value) { + emit('update-manuscript', manuscriptResource.value); + } loading.value = false; isDirty.value = false; }); diff --git a/resources/src/models/ManuscriptRecord/views/ManuscriptRecordProgressView.vue b/resources/src/models/ManuscriptRecord/views/ManuscriptRecordProgressView.vue index ff933772..4318d164 100644 --- a/resources/src/models/ManuscriptRecord/views/ManuscriptRecordProgressView.vue +++ b/resources/src/models/ManuscriptRecord/views/ManuscriptRecordProgressView.vue @@ -180,6 +180,11 @@ const { t } = useI18n(); const props = defineProps<{ id: number; }>(); + +const emit = defineEmits<{ + (e: 'update-manuscript', manuscript: ManuscriptRecordResource): void; +}>(); + const manuscriptRecord: Ref = ref(null); const createdSubtitle = computed(() => { @@ -330,7 +335,7 @@ const showSubmittedToJournalDialog = ref(false); function submittedToJournal(record: ManuscriptRecordResource) { manuscriptRecord.value = record; showSubmittedToJournalDialog.value = false; - showUpdatedNotification(); + showUpdatedNotification(record); } // accept for publication @@ -339,7 +344,7 @@ const showAcceptedByJournalDialog = ref(false); function acceptedToJournal(record: ManuscriptRecordResource) { manuscriptRecord.value = record; showAcceptedByJournalDialog.value = false; - showUpdatedNotification(); + showUpdatedNotification(record); } // withdraw manuscript const showWithdrawManuscriptDialog = ref(false); @@ -347,10 +352,11 @@ const showWithdrawManuscriptDialog = ref(false); function withdrawManuscript(record: ManuscriptRecordResource) { manuscriptRecord.value = record; showWithdrawManuscriptDialog.value = false; - showUpdatedNotification(); + showUpdatedNotification(record); } -function showUpdatedNotification() { +function showUpdatedNotification(record: ManuscriptRecordResource) { + emit('update-manuscript', record); $q.notify({ message: t('manuscript-progress-view.manuscript-status-updated'), color: 'positive', diff --git a/resources/src/pages/ManuscriptRecordPage.vue b/resources/src/pages/ManuscriptRecordPage.vue index 1df67267..c43a726a 100644 --- a/resources/src/pages/ManuscriptRecordPage.vue +++ b/resources/src/pages/ManuscriptRecordPage.vue @@ -73,11 +73,27 @@ }} + + + + + + {{ + $t('common.publication') + }} + +
- +
@@ -86,23 +102,23 @@