forked from AkkomaGang/admin-fe
Fix wrapping values with type map and keyword
This commit is contained in:
parent
0bc5cf9f6b
commit
b6a66ebe20
2 changed files with 9 additions and 8 deletions
|
@ -233,13 +233,13 @@ export const wrapUpdatedSettings = (group, settings, currentState) => {
|
|||
const wrapValues = (settings, currentState) => {
|
||||
return Object.keys(settings).map(setting => {
|
||||
const [type, value] = settings[setting]
|
||||
if (
|
||||
type === 'keyword' ||
|
||||
if (type === 'keyword' ||
|
||||
(Array.isArray(type) && (
|
||||
type.includes('keyword') ||
|
||||
(type.includes('tuple') && type.includes('list')) ||
|
||||
setting === ':replace' ||
|
||||
(type.includes('map') && type.includes('string')) ||
|
||||
type.includes('map') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1
|
||||
))
|
||||
) {
|
||||
return { 'tuple': [setting, wrapValues(value, currentState)] }
|
||||
} else if (type === 'atom' && value.length > 0) {
|
||||
|
|
|
@ -73,7 +73,8 @@ export default {
|
|||
return this.setting.type.includes('keyword') && this.setting.type.includes('integer')
|
||||
},
|
||||
editableKeywordWithSelect() {
|
||||
return this.setting.type.includes('map') && this.setting.type.findIndex(el => el.includes('list') && el.includes('string')) !== -1
|
||||
return (this.setting.type.includes('map') && this.setting.type.findIndex(el => el.includes('list') && el.includes('string')) !== -1) ||
|
||||
(this.setting.type.includes('keyword') && this.setting.type.findIndex(el => el.includes('list') && el.includes('string')) !== -1)
|
||||
},
|
||||
editableKeywordWithString() {
|
||||
return this.setting.key !== ':crontab' && (
|
||||
|
|
Loading…
Reference in a new issue