feat: locales availability + IE display mode

This commit is contained in:
Nick
2019-07-12 23:56:44 -04:00
parent ca06a15bf3
commit b6f1e1805e
31 changed files with 1015 additions and 71 deletions

View File

@@ -13,7 +13,7 @@ module.exports = {
LocalizationQuery: {
async locales(obj, args, context, info) {
let remoteLocales = await WIKI.cache.get('locales')
let localLocales = await WIKI.models.locales.query().select('code', 'isRTL', 'name', 'nativeName', 'createdAt', 'updatedAt')
let localLocales = await WIKI.models.locales.query().select('code', 'isRTL', 'name', 'nativeName', 'createdAt', 'updatedAt', 'availability')
remoteLocales = remoteLocales || localLocales
return _.map(remoteLocales, rl => {
let isInstalled = _.some(localLocales, ['code', rl.code])

View File

@@ -95,6 +95,16 @@ module.exports = {
} catch (err) {
return graphHelper.generateError(err)
}
},
async migrateToLocale(obj, args, context) {
try {
return {
responseResult: graphHelper.generateSuccess('Migrated all content to target locale successfully.')
}
} catch (err) {
return graphHelper.generateError(err)
}
}
},
Page: {

View File

@@ -42,6 +42,7 @@ type LocalizationMutation {
# -----------------------------------------------
type LocalizationLocale {
availability: Int!
code: String!
createdAt: Date!
installDate: Date

View File

@@ -73,6 +73,8 @@ type PageMutation {
): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
flushCache: DefaultResponse @auth(requires: ["manage:system"])
migrateToLocale: DefaultResponse @auth(requires: ["manage:system"])
}
# -----------------------------------------------