Fix layout on empty settings

This commit is contained in:
Benedikt Kulmann
2020-04-24 07:01:02 +02:00
parent ac67fee09a
commit 1635e5d92f
3 changed files with 26 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@@ -7,8 +7,8 @@
</div>
<hr />
<oc-alert v-if="extensions.length === 0" variation="primary" no-close>
<p>
<oc-icon name="info" />
<p class="uk-flex uk-flex-middle">
<oc-icon name="info" class="uk-margin-xsmall-right" />
<translate>No settings available</translate>
</p>
</oc-alert>

View File

@@ -39,24 +39,28 @@ const actions = {
if (response.status === 200) {
// the settings markup has implicit typing. inject an explicit type variable here
const settingsBundles = response.data.settingsBundles
settingsBundles.forEach(bundle => {
bundle.settings.forEach(setting => {
if (setting['intValue']) {
setting.type = 'number'
} else if (setting['stringValue']) {
setting.type = 'string'
} else if (setting['boolValue']) {
setting.type = 'boolean'
} else if (setting['singleChoiceValue']) {
setting.type = 'singleChoice'
} else if (setting['multiChoiceValue']) {
setting.type = 'multiChoice'
} else {
setting.type = 'unknown'
}
if (settingsBundles) {
settingsBundles.forEach(bundle => {
bundle.settings.forEach(setting => {
if (setting['intValue']) {
setting.type = 'number'
} else if (setting['stringValue']) {
setting.type = 'string'
} else if (setting['boolValue']) {
setting.type = 'boolean'
} else if (setting['singleChoiceValue']) {
setting.type = 'singleChoice'
} else if (setting['multiChoiceValue']) {
setting.type = 'multiChoice'
} else {
setting.type = 'unknown'
}
})
})
})
commit('SET_SETTINGS_BUNDLES', settingsBundles)
commit('SET_SETTINGS_BUNDLES', settingsBundles)
} else {
commit('SET_SETTINGS_BUNDLES', [])
}
} else {
dispatch('showMessage', {
title: 'Failed to fetch settings bundles.',