From 4a247b2a7d6741bfec9fbdb387c9313d7b6381d1 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Thu, 23 Jun 2022 03:23:39 +0200 Subject: [PATCH] chore: remove global mixing --- src/components/home/TheNavigation.vue | 2 ++ src/main.ts | 13 ------------- src/views/labels/ListLabels.vue | 3 ++- src/views/labels/NewLabel.vue | 3 ++- src/views/list/settings/background.vue | 2 +- src/views/migrator/MigrateService.vue | 3 ++- src/views/namespaces/ListNamespaces.vue | 5 ++++- src/views/namespaces/NewNamespace.vue | 3 ++- src/views/namespaces/settings/archive.vue | 3 ++- src/views/namespaces/settings/delete.vue | 3 ++- src/views/tasks/TaskDetailView.vue | 8 ++++++-- src/views/teams/NewTeam.vue | 4 +++- src/views/user/Login.vue | 3 ++- 13 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/components/home/TheNavigation.vue b/src/components/home/TheNavigation.vue index fbdf2e04..e8f72952 100644 --- a/src/components/home/TheNavigation.vue +++ b/src/components/home/TheNavigation.vue @@ -103,6 +103,8 @@ import Logo from '@/components/home/Logo.vue' import BaseButton from '@/components/base/BaseButton.vue' import MenuButton from '@/components/home/MenuButton.vue' +import {getListTitle} from '@/helpers/getListTitle' + const store = useStore() const userInfo = computed(() => store.state.auth.info) diff --git a/src/main.ts b/src/main.ts index 9af01404..b24a216d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -67,19 +67,6 @@ app.component('x-button', Button) app.component('modal', Modal) app.component('card', Card) -// Mixins -import {getNamespaceTitle} from './helpers/getNamespaceTitle' -import {getListTitle} from './helpers/getListTitle' -import {setTitle} from './helpers/setTitle' - -app.mixin({ - methods: { - getNamespaceTitle, - getListTitle, - setTitle, - }, -}) - app.config.errorHandler = (err, vm, info) => { if (import.meta.env.DEV) { console.error(err, vm, info) diff --git a/src/views/labels/ListLabels.vue b/src/views/labels/ListLabels.vue index 61ac2fe5..ad9fae05 100644 --- a/src/views/labels/ListLabels.vue +++ b/src/views/labels/ListLabels.vue @@ -119,6 +119,7 @@ import {LOADING, LOADING_MODULE} from '@/store/mutation-types' import BaseButton from '@/components/base/BaseButton.vue' import AsyncEditor from '@/components/input/AsyncEditor' import ColorPicker from '@/components/input/colorPicker.vue' +import { setTitle } from '@/helpers/setTitle' export default defineComponent({ name: 'ListLabels', @@ -140,7 +141,7 @@ export default defineComponent({ this.$store.dispatch('labels/loadAllLabels') }, mounted() { - this.setTitle(this.$t('label.title')) + setTitle(this.$t('label.title')) }, computed: mapState({ userInfo: state => state.auth.info, diff --git a/src/views/labels/NewLabel.vue b/src/views/labels/NewLabel.vue index 423e1391..0798b359 100644 --- a/src/views/labels/NewLabel.vue +++ b/src/views/labels/NewLabel.vue @@ -41,6 +41,7 @@ import CreateEdit from '@/components/misc/create-edit.vue' import ColorPicker from '../../components/input/colorPicker.vue' import {mapState} from 'vuex' import {LOADING, LOADING_MODULE} from '@/store/mutation-types' +import { setTitle } from '@/helpers/setTitle' export default defineComponent({ name: 'NewLabel', @@ -55,7 +56,7 @@ export default defineComponent({ ColorPicker, }, mounted() { - this.setTitle(this.$t('label.create.title')) + setTitle(this.$t('label.create.title')) }, computed: mapState({ loading: state => state[LOADING] && state[LOADING_MODULE] === 'labels', diff --git a/src/views/list/settings/background.vue b/src/views/list/settings/background.vue index e1770658..16a1c10b 100644 --- a/src/views/list/settings/background.vue +++ b/src/views/list/settings/background.vue @@ -109,7 +109,7 @@ import BaseButton from '@/components/base/BaseButton.vue' import BackgroundUnsplashService from '@/services/backgroundUnsplash' import BackgroundUploadService from '@/services/backgroundUpload' import ListService from '@/services/list' -import BackgroundImageModel from '@/models/backgroundImage' +import type BackgroundImageModel from '@/models/backgroundImage' import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash' import {useTitle} from '@/composables/useTitle' diff --git a/src/views/migrator/MigrateService.vue b/src/views/migrator/MigrateService.vue index 0025415a..d5138d13 100644 --- a/src/views/migrator/MigrateService.vue +++ b/src/views/migrator/MigrateService.vue @@ -72,6 +72,7 @@ import AbstractMigrationService from '@/services/migrator/abstractMigration' import AbstractMigrationFileService from '@/services/migrator/abstractMigrationFile' import Logo from '@/assets/logo.svg?component' import Message from '@/components/misc/message.vue' +import { setTitle } from '@/helpers/setTitle' import {formatDateLong} from '@/helpers/time/formatDate' @@ -116,7 +117,7 @@ export default defineComponent({ }, mounted() { - this.setTitle(this.$t('migrate.titleService', {name: this.migrator.name})) + setTitle(this.$t('migrate.titleService', {name: this.migrator.name})) }, methods: { diff --git a/src/views/namespaces/ListNamespaces.vue b/src/views/namespaces/ListNamespaces.vue index 5314c696..c9d2e4ac 100644 --- a/src/views/namespaces/ListNamespaces.vue +++ b/src/views/namespaces/ListNamespaces.vue @@ -75,6 +75,8 @@ import {mapState} from 'vuex' import Fancycheckbox from '../../components/input/fancycheckbox.vue' import {LOADING} from '@/store/mutation-types' import ListCard from '@/components/list/partials/list-card.vue' +import {getNamespaceTitle} from '@/helpers/getNamespaceTitle' +import { setTitle } from '@/helpers/setTitle' export default defineComponent({ name: 'ListNamespaces', @@ -88,7 +90,7 @@ export default defineComponent({ } }, mounted() { - this.setTitle(this.$t('namespace.title')) + setTitle(this.$t('namespace.title')) }, computed: mapState({ namespaces(state) { @@ -101,6 +103,7 @@ export default defineComponent({ loading: LOADING, }), methods: { + getNamespaceTitle, saveShowArchivedState() { localStorage.setItem('showArchived', JSON.stringify(this.showArchived)) }, diff --git a/src/views/namespaces/NewNamespace.vue b/src/views/namespaces/NewNamespace.vue index 19ffb16c..02ed7b03 100644 --- a/src/views/namespaces/NewNamespace.vue +++ b/src/views/namespaces/NewNamespace.vue @@ -48,6 +48,7 @@ import NamespaceModel from '../../models/namespace' import NamespaceService from '../../services/namespace' import CreateEdit from '@/components/misc/create-edit.vue' import ColorPicker from '../../components/input/colorPicker.vue' +import { setTitle } from '@/helpers/setTitle' export default defineComponent({ name: 'NewNamespace', @@ -64,7 +65,7 @@ export default defineComponent({ CreateEdit, }, mounted() { - this.setTitle(this.$t('namespace.create.title')) + setTitle(this.$t('namespace.create.title')) }, methods: { async newNamespace() { diff --git a/src/views/namespaces/settings/archive.vue b/src/views/namespaces/settings/archive.vue index 23fc6de9..7903ef61 100644 --- a/src/views/namespaces/settings/archive.vue +++ b/src/views/namespaces/settings/archive.vue @@ -17,6 +17,7 @@ import {defineComponent} from 'vue' import NamespaceService from '@/services/namespace' +import { setTitle } from '@/helpers/setTitle' export default defineComponent({ name: 'namespace-setting-archive', @@ -33,7 +34,7 @@ export default defineComponent({ this.title = this.namespace.isArchived ? this.$t('namespace.archive.titleUnarchive', {namespace: this.namespace.title}) : this.$t('namespace.archive.titleArchive', {namespace: this.namespace.title}) - this.setTitle(this.title) + setTitle(this.title) }, methods: { diff --git a/src/views/namespaces/settings/delete.vue b/src/views/namespaces/settings/delete.vue index b27d2533..b778e66a 100644 --- a/src/views/namespaces/settings/delete.vue +++ b/src/views/namespaces/settings/delete.vue @@ -14,6 +14,7 @@