|
|
@ -3,11 +3,30 @@
|
|
|
|
v-toolbar(flat, color='primary', dark, dense)
|
|
|
|
v-toolbar(flat, color='primary', dark, dense)
|
|
|
|
.subheading {{ $t('admin:utilities.contentTitle') }}
|
|
|
|
.subheading {{ $t('admin:utilities.contentTitle') }}
|
|
|
|
v-card-text
|
|
|
|
v-card-text
|
|
|
|
v-subheader.pl-0.primary--text Migrate all pages to base language
|
|
|
|
v-subheader.pl-0.primary--text Migrate all pages to target locale
|
|
|
|
.body-1 If you created content before selecting a different locale and activating the namespacing capabilities, you may want to transfer all content to the base locale.
|
|
|
|
.body-1 If you created content before selecting a different locale and activating the namespacing capabilities, you may want to transfer all content to the base locale.
|
|
|
|
.body-1.red--text: strong This operation is destructive and cannot be reversed! Make sure you have proper backups!
|
|
|
|
.body-1.red--text: strong This operation is destructive and cannot be reversed! Make sure you have proper backups!
|
|
|
|
.body-1.mt-3 Based on your current configuration, all pages will be migrated to the locale #[v-chip(label, small): strong {{currentLocale.toUpperCase()}}]
|
|
|
|
v-toolbar.radius-7.mt-3.wiki-form(flat, color='grey lighten-4', height='80')
|
|
|
|
.body-1.mt-3 Pages that are already in the target locale will not be touched. If a page already exists at the target, the source page will not be modified as it would create a conflict. If you want to overwrite the target content, you must first delete that page.
|
|
|
|
v-select(
|
|
|
|
|
|
|
|
label='Source Locale'
|
|
|
|
|
|
|
|
outline
|
|
|
|
|
|
|
|
hide-details
|
|
|
|
|
|
|
|
:items='locales'
|
|
|
|
|
|
|
|
item-text='name'
|
|
|
|
|
|
|
|
item-value='code'
|
|
|
|
|
|
|
|
v-model='sourceLocale'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
v-icon.mx-3(large) arrow_forward
|
|
|
|
|
|
|
|
v-select(
|
|
|
|
|
|
|
|
label='Target Locale'
|
|
|
|
|
|
|
|
outline
|
|
|
|
|
|
|
|
hide-details
|
|
|
|
|
|
|
|
:items='locales'
|
|
|
|
|
|
|
|
item-text='name'
|
|
|
|
|
|
|
|
item-value='code'
|
|
|
|
|
|
|
|
v-model='targetLocale'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.body-1.mt-3 Pages that are already in the target locale will not be touched. If a page already exists at the target, the source page will not be modified as it would create a conflict. If you want to overwrite the target page, you must first delete it.
|
|
|
|
v-btn(outline, color='primary', @click='migrateToLocale', :disabled='loading').ml-0.mt-3
|
|
|
|
v-btn(outline, color='primary', @click='migrateToLocale', :disabled='loading').ml-0.mt-3
|
|
|
|
v-icon(left) build
|
|
|
|
v-icon(left) build
|
|
|
|
span Proceed
|
|
|
|
span Proceed
|
|
|
@ -17,17 +36,22 @@
|
|
|
|
import _ from 'lodash'
|
|
|
|
import _ from 'lodash'
|
|
|
|
import utilityContentMigrateLocaleMutation from 'gql/admin/utilities/utilities-mutation-content-migratelocale.gql'
|
|
|
|
import utilityContentMigrateLocaleMutation from 'gql/admin/utilities/utilities-mutation-content-migratelocale.gql'
|
|
|
|
|
|
|
|
|
|
|
|
/* global siteLang */
|
|
|
|
/* global siteLangs, siteConfig */
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data: () => {
|
|
|
|
data: () => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
loading: false
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
sourceLocale: '',
|
|
|
|
|
|
|
|
targetLocale: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
currentLocale () {
|
|
|
|
currentLocale () {
|
|
|
|
return siteConfig.lang
|
|
|
|
return siteConfig.lang
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
locales () {
|
|
|
|
|
|
|
|
return siteLangs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
@ -39,7 +63,8 @@ export default {
|
|
|
|
const respRaw = await this.$apollo.mutate({
|
|
|
|
const respRaw = await this.$apollo.mutate({
|
|
|
|
mutation: utilityContentMigrateLocaleMutation,
|
|
|
|
mutation: utilityContentMigrateLocaleMutation,
|
|
|
|
variables: {
|
|
|
|
variables: {
|
|
|
|
targetLocale: siteConfig.lang
|
|
|
|
sourceLocale: this.sourceLocale,
|
|
|
|
|
|
|
|
targetLocale: this.targetLocale
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const resp = _.get(respRaw, 'data.pages.migrateToLocale.responseResult', {})
|
|
|
|
const resp = _.get(respRaw, 'data.pages.migrateToLocale.responseResult', {})
|
|
|
|