mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-26 13:00:18 +00:00
#195 Settings Group undefined not translated
This commit is contained in:
parent
c3f1a27694
commit
b640f112a7
2 changed files with 10 additions and 7 deletions
|
@ -88,7 +88,7 @@
|
|||
Token: this.$store.getters.getAuthToken,
|
||||
Address: this.$store.getters.getSelectedServerAddress});
|
||||
log.debug('Options are: ' + JSON.stringify(Object.keys(this.$store.getters.getPMSSettings)))
|
||||
this.selSectionOptions = Object.keys(this.$store.getters.getPMSSettings);
|
||||
this.selSectionOptions = Object.keys(this.$store.getters.getPMSSettings).sort();
|
||||
},
|
||||
changedOptions() {
|
||||
log.debug('Updating OnlyHidden Setting');
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import axios from 'axios';
|
||||
import {wtconfig, wtutils} from '../../components/modules/General/wtutils';
|
||||
import i18n from '../../i18n';
|
||||
|
||||
const log = require('electron-log');
|
||||
const {JSONPath} = require('jsonpath-plus');
|
||||
|
@ -48,13 +49,13 @@ const actions = {
|
|||
log.debug('Show all settings');
|
||||
}
|
||||
var PMSSettings = {};
|
||||
PMSSettings['Undefined'] = {};
|
||||
PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')] = {};
|
||||
filteredResult.forEach(group => {
|
||||
group = JSONPath({path: '$.group', json: group})[0]
|
||||
if (group !== "") {
|
||||
PMSSettings[group] = {};
|
||||
}
|
||||
})
|
||||
})
|
||||
filteredResult.forEach(element => {
|
||||
var id = JSONPath({path: '$.id', json: element});
|
||||
var jNode = {};
|
||||
|
@ -63,16 +64,18 @@ const actions = {
|
|||
jNode['type'] = JSONPath({path: '$.type', json: element})[0];
|
||||
jNode['default'] = JSONPath({path: '$.default', json: element})[0];
|
||||
jNode['value'] = JSONPath({path: '$.value', json: element})[0];
|
||||
if (JSONPath({path: '$.group', json: element}) == ""){
|
||||
PMSSettings['Undefined'][id] = jNode;
|
||||
if (JSONPath({path: '$.group', json: element}) == ""){
|
||||
log.debug('Ged: ' + i18n.t('Modules.PMS.Settings.Undefined'))
|
||||
|
||||
PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')][id] = jNode;
|
||||
}
|
||||
else {
|
||||
PMSSettings[JSONPath({path: '$.group', json: element})][id] = jNode;
|
||||
}
|
||||
});
|
||||
// Remove undefined category, if empty
|
||||
if (Object.keys(PMSSettings['Undefined']).length === 0){
|
||||
delete PMSSettings['Undefined'];
|
||||
if (Object.keys(PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')]).length === 0){
|
||||
delete PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')];
|
||||
}
|
||||
commit('UPDATE_PMS_SETTINGS', PMSSettings);
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue