chore: remove global mixing
This commit is contained in:
parent
b0ee316a26
commit
4a247b2a7d
13 changed files with 30 additions and 25 deletions
|
@ -103,6 +103,8 @@ import Logo from '@/components/home/Logo.vue'
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import MenuButton from '@/components/home/MenuButton.vue'
|
import MenuButton from '@/components/home/MenuButton.vue'
|
||||||
|
|
||||||
|
import {getListTitle} from '@/helpers/getListTitle'
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
const userInfo = computed(() => store.state.auth.info)
|
const userInfo = computed(() => store.state.auth.info)
|
||||||
|
|
13
src/main.ts
13
src/main.ts
|
@ -67,19 +67,6 @@ app.component('x-button', Button)
|
||||||
app.component('modal', Modal)
|
app.component('modal', Modal)
|
||||||
app.component('card', Card)
|
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) => {
|
app.config.errorHandler = (err, vm, info) => {
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
console.error(err, vm, info)
|
console.error(err, vm, info)
|
||||||
|
|
|
@ -119,6 +119,7 @@ import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import AsyncEditor from '@/components/input/AsyncEditor'
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
import ColorPicker from '@/components/input/colorPicker.vue'
|
import ColorPicker from '@/components/input/colorPicker.vue'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ListLabels',
|
name: 'ListLabels',
|
||||||
|
@ -140,7 +141,7 @@ export default defineComponent({
|
||||||
this.$store.dispatch('labels/loadAllLabels')
|
this.$store.dispatch('labels/loadAllLabels')
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setTitle(this.$t('label.title'))
|
setTitle(this.$t('label.title'))
|
||||||
},
|
},
|
||||||
computed: mapState({
|
computed: mapState({
|
||||||
userInfo: state => state.auth.info,
|
userInfo: state => state.auth.info,
|
||||||
|
|
|
@ -41,6 +41,7 @@ import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
import ColorPicker from '../../components/input/colorPicker.vue'
|
import ColorPicker from '../../components/input/colorPicker.vue'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'NewLabel',
|
name: 'NewLabel',
|
||||||
|
@ -55,7 +56,7 @@ export default defineComponent({
|
||||||
ColorPicker,
|
ColorPicker,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setTitle(this.$t('label.create.title'))
|
setTitle(this.$t('label.create.title'))
|
||||||
},
|
},
|
||||||
computed: mapState({
|
computed: mapState({
|
||||||
loading: state => state[LOADING] && state[LOADING_MODULE] === 'labels',
|
loading: state => state[LOADING] && state[LOADING_MODULE] === 'labels',
|
||||||
|
|
|
@ -109,7 +109,7 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import BackgroundUnsplashService from '@/services/backgroundUnsplash'
|
import BackgroundUnsplashService from '@/services/backgroundUnsplash'
|
||||||
import BackgroundUploadService from '@/services/backgroundUpload'
|
import BackgroundUploadService from '@/services/backgroundUpload'
|
||||||
import ListService from '@/services/list'
|
import ListService from '@/services/list'
|
||||||
import BackgroundImageModel from '@/models/backgroundImage'
|
import type BackgroundImageModel from '@/models/backgroundImage'
|
||||||
|
|
||||||
import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
|
import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
|
||||||
import {useTitle} from '@/composables/useTitle'
|
import {useTitle} from '@/composables/useTitle'
|
||||||
|
|
|
@ -72,6 +72,7 @@ import AbstractMigrationService from '@/services/migrator/abstractMigration'
|
||||||
import AbstractMigrationFileService from '@/services/migrator/abstractMigrationFile'
|
import AbstractMigrationFileService from '@/services/migrator/abstractMigrationFile'
|
||||||
import Logo from '@/assets/logo.svg?component'
|
import Logo from '@/assets/logo.svg?component'
|
||||||
import Message from '@/components/misc/message.vue'
|
import Message from '@/components/misc/message.vue'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
import {formatDateLong} from '@/helpers/time/formatDate'
|
import {formatDateLong} from '@/helpers/time/formatDate'
|
||||||
|
|
||||||
|
@ -116,7 +117,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setTitle(this.$t('migrate.titleService', {name: this.migrator.name}))
|
setTitle(this.$t('migrate.titleService', {name: this.migrator.name}))
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -75,6 +75,8 @@ import {mapState} from 'vuex'
|
||||||
import Fancycheckbox from '../../components/input/fancycheckbox.vue'
|
import Fancycheckbox from '../../components/input/fancycheckbox.vue'
|
||||||
import {LOADING} from '@/store/mutation-types'
|
import {LOADING} from '@/store/mutation-types'
|
||||||
import ListCard from '@/components/list/partials/list-card.vue'
|
import ListCard from '@/components/list/partials/list-card.vue'
|
||||||
|
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ListNamespaces',
|
name: 'ListNamespaces',
|
||||||
|
@ -88,7 +90,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setTitle(this.$t('namespace.title'))
|
setTitle(this.$t('namespace.title'))
|
||||||
},
|
},
|
||||||
computed: mapState({
|
computed: mapState({
|
||||||
namespaces(state) {
|
namespaces(state) {
|
||||||
|
@ -101,6 +103,7 @@ export default defineComponent({
|
||||||
loading: LOADING,
|
loading: LOADING,
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
|
getNamespaceTitle,
|
||||||
saveShowArchivedState() {
|
saveShowArchivedState() {
|
||||||
localStorage.setItem('showArchived', JSON.stringify(this.showArchived))
|
localStorage.setItem('showArchived', JSON.stringify(this.showArchived))
|
||||||
},
|
},
|
||||||
|
|
|
@ -48,6 +48,7 @@ import NamespaceModel from '../../models/namespace'
|
||||||
import NamespaceService from '../../services/namespace'
|
import NamespaceService from '../../services/namespace'
|
||||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
import ColorPicker from '../../components/input/colorPicker.vue'
|
import ColorPicker from '../../components/input/colorPicker.vue'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'NewNamespace',
|
name: 'NewNamespace',
|
||||||
|
@ -64,7 +65,7 @@ export default defineComponent({
|
||||||
CreateEdit,
|
CreateEdit,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setTitle(this.$t('namespace.create.title'))
|
setTitle(this.$t('namespace.create.title'))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async newNamespace() {
|
async newNamespace() {
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
import {defineComponent} from 'vue'
|
import {defineComponent} from 'vue'
|
||||||
|
|
||||||
import NamespaceService from '@/services/namespace'
|
import NamespaceService from '@/services/namespace'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'namespace-setting-archive',
|
name: 'namespace-setting-archive',
|
||||||
|
@ -33,7 +34,7 @@ export default defineComponent({
|
||||||
this.title = this.namespace.isArchived ?
|
this.title = this.namespace.isArchived ?
|
||||||
this.$t('namespace.archive.titleUnarchive', {namespace: this.namespace.title}) :
|
this.$t('namespace.archive.titleUnarchive', {namespace: this.namespace.title}) :
|
||||||
this.$t('namespace.archive.titleArchive', {namespace: this.namespace.title})
|
this.$t('namespace.archive.titleArchive', {namespace: this.namespace.title})
|
||||||
this.setTitle(this.title)
|
setTitle(this.title)
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import {defineComponent} from 'vue'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'namespace-setting-delete',
|
name: 'namespace-setting-delete',
|
||||||
|
@ -31,7 +32,7 @@ export default defineComponent({
|
||||||
watch: {
|
watch: {
|
||||||
title: {
|
title: {
|
||||||
handler(title) {
|
handler(title) {
|
||||||
this.setTitle(title)
|
setTitle(title)
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -452,8 +452,10 @@ import {CURRENT_LIST} from '@/store/mutation-types'
|
||||||
import {uploadFile} from '@/helpers/attachments'
|
import {uploadFile} from '@/helpers/attachments'
|
||||||
import ChecklistSummary from '../../components/tasks/partials/checklist-summary.vue'
|
import ChecklistSummary from '../../components/tasks/partials/checklist-summary.vue'
|
||||||
import CreatedUpdated from '@/components/tasks/partials/createdUpdated.vue'
|
import CreatedUpdated from '@/components/tasks/partials/createdUpdated.vue'
|
||||||
import { setTitle } from '@/helpers/setTitle'
|
|
||||||
import type ListModel from '@/models/list'
|
import type ListModel from '@/models/list'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
|
||||||
|
import {getListTitle} from '@/helpers/getListTitle'
|
||||||
|
|
||||||
function scrollIntoView(el) {
|
function scrollIntoView(el) {
|
||||||
if (!el) {
|
if (!el) {
|
||||||
|
@ -556,7 +558,7 @@ export default defineComponent({
|
||||||
// it from the page title.
|
// it from the page title.
|
||||||
'task.title': {
|
'task.title': {
|
||||||
handler(title) {
|
handler(title) {
|
||||||
this.setTitle(title)
|
setTitle(title)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -589,6 +591,8 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getNamespaceTitle,
|
||||||
|
getListTitle,
|
||||||
attachmentUpload(...args) {
|
attachmentUpload(...args) {
|
||||||
return uploadFile(this.taskId, ...args)
|
return uploadFile(this.taskId, ...args)
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,6 +34,8 @@ import TeamModel from '../../models/team'
|
||||||
import TeamService from '../../services/team'
|
import TeamService from '../../services/team'
|
||||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
|
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'NewTeam',
|
name: 'NewTeam',
|
||||||
data() {
|
data() {
|
||||||
|
@ -47,7 +49,7 @@ export default defineComponent({
|
||||||
CreateEdit,
|
CreateEdit,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setTitle(this.$t('team.create.title'))
|
setTitle(this.$t('team.create.title'))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async newTeam() {
|
async newTeam() {
|
||||||
|
|
|
@ -113,6 +113,7 @@ import Message from '@/components/misc/message.vue'
|
||||||
import {redirectToProvider} from '../../helpers/redirectToProvider'
|
import {redirectToProvider} from '../../helpers/redirectToProvider'
|
||||||
import {getLastVisited, clearLastVisited} from '../../helpers/saveLastVisited'
|
import {getLastVisited, clearLastVisited} from '../../helpers/saveLastVisited'
|
||||||
import Password from '@/components/input/password.vue'
|
import Password from '@/components/input/password.vue'
|
||||||
|
import { setTitle } from '@/helpers/setTitle'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
|
@ -162,7 +163,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.setTitle(this.$t('user.auth.login'))
|
setTitle(this.$t('user.auth.login'))
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasOpenIdProviders() {
|
hasOpenIdProviders() {
|
||||||
|
|
Loading…
Reference in a new issue