diff --git a/app/src/api/handlers.js b/app/src/api/handlers.js
index b6e71596..1a7579ee 100644
--- a/app/src/api/handlers.js
+++ b/app/src/api/handlers.js
@@ -30,7 +30,9 @@ async function _getResponseContent (response) {
* @return {(Object|String)} Parsed response's json, response's text or an error.
*/
export function handleResponse (response, method) {
- store.dispatch('SERVER_RESPONDED', response.ok)
+ if (method !== 'GET') {
+ store.dispatch('SERVER_RESPONDED', response.ok)
+ }
if (!response.ok) return handleError(response, method)
// FIXME the api should always return json objects
return _getResponseContent(response)
@@ -43,7 +45,6 @@ export function handleResponse (response, method) {
* @throws Will throw a custom error with response data.
*/
export async function handleError (response, method) {
- console.log(response.url)
const message = await _getResponseContent(response)
const errorCode = response.status in errors ? response.status : undefined
const error = new errors[errorCode](method, response, message)
diff --git a/app/src/components/globals/CardForm.vue b/app/src/components/globals/CardForm.vue
index 16d61860..14458e66 100644
--- a/app/src/components/globals/CardForm.vue
+++ b/app/src/components/globals/CardForm.vue
@@ -1,10 +1,10 @@
- {{ title }}
+ {{ title }}
-
+
@@ -35,6 +35,7 @@ export default {
props: {
id: { type: String, default: 'ynh-form' },
title: { type: String, required: true },
+ titleTag: { type: String, default: 'h2' },
icon: { type: String, default: null },
submitText: { type: String, default: null },
noFooter: { type: Boolean, default: false },
diff --git a/app/src/components/globals/FormField.vue b/app/src/components/globals/FormField.vue
index 1aef26b8..98f11fdb 100644
--- a/app/src/components/globals/FormField.vue
+++ b/app/src/components/globals/FormField.vue
@@ -71,8 +71,12 @@ export default {
'label-cols-lg': 2,
'label-class': 'font-weight-bold'
}
- for (const attr in defaultAttrs) {
- if (!(attr in attrs)) attrs[attr] = defaultAttrs[attr]
+ if ('label-cols' in attrs) {
+ attrs['label-class'] = defaultAttrs['label-class']
+ } else {
+ for (const attr in defaultAttrs) {
+ if (!(attr in attrs)) attrs[attr] = defaultAttrs[attr]
+ }
}
}
return attrs
diff --git a/app/src/components/globals/formItems/CheckboxItem.vue b/app/src/components/globals/formItems/CheckboxItem.vue
index a71b0562..8df47c68 100644
--- a/app/src/components/globals/formItems/CheckboxItem.vue
+++ b/app/src/components/globals/formItems/CheckboxItem.vue
@@ -6,7 +6,7 @@
:aria-describedby="$parent.id + '__BV_description_'"
switch
>
- {{ $t(checked ? 'yes' : 'no') }}
+ {{ $t(labels[checked]) }}
@@ -16,7 +16,8 @@ export default {
props: {
value: { type: Boolean, required: true },
- id: { type: String, default: null }
+ id: { type: String, default: null },
+ labels: { type: Object, default: () => ({ true: 'yes', false: 'no' }) }
},
data () {
diff --git a/app/src/helpers/commons.js b/app/src/helpers/commons.js
index 9a498ce3..82cd9fd6 100644
--- a/app/src/helpers/commons.js
+++ b/app/src/helpers/commons.js
@@ -63,7 +63,7 @@ export function isObjectLiteral (value) {
* @return {Boolean}
*/
export function isEmptyValue (value) {
- if (value === 0) return false
+ if (typeof value === 'number') return false
return !value || value.length === 0 || Object.keys(value).length === 0
}
diff --git a/app/src/i18n/helpers.js b/app/src/i18n/helpers.js
index d57e56e9..3a4c70ad 100644
--- a/app/src/i18n/helpers.js
+++ b/app/src/i18n/helpers.js
@@ -79,7 +79,7 @@ function initDefaultLocales () {
const [locale, fallbackLocale] = getDefaultLocales()
store.dispatch('UPDATE_LOCALE', locale)
- store.dispatch('UPDATE_FALLBACK_LOCALE', fallbackLocale || 'en')
+ store.dispatch('UPDATE_FALLBACKLOCALE', fallbackLocale || 'en')
loadLocaleMessages('en')
}
diff --git a/app/src/store/settings.js b/app/src/store/settings.js
index ce3c9e05..651a9506 100644
--- a/app/src/store/settings.js
+++ b/app/src/store/settings.js
@@ -23,7 +23,7 @@ export default {
state.locale = locale
},
- 'SET_FALLBACK_LOCALE' (state, locale) {
+ 'SET_FALLBACKLOCALE' (state, locale) {
localStorage.setItem('fallbackLocale', locale)
state.fallbackLocale = locale
},
@@ -55,9 +55,9 @@ export default {
loadDateFnsLocale(locale)
},
- 'UPDATE_FALLBACK_LOCALE' ({ commit }, locale) {
+ 'UPDATE_FALLBACKLOCALE' ({ commit }, locale) {
loadLocaleMessages(locale).then(() => {
- commit('SET_FALLBACK_LOCALE', locale)
+ commit('SET_FALLBACKLOCALE', locale)
i18n.fallbackLocale = [locale, 'en']
})
}
diff --git a/app/src/views/app/AppInstall.vue b/app/src/views/app/AppInstall.vue
index 44bd6633..55c72f86 100644
--- a/app/src/views/app/AppInstall.vue
+++ b/app/src/views/app/AppInstall.vue
@@ -22,8 +22,8 @@
-
@@ -32,12 +32,10 @@
-
-
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t(currentCache ? 'enabled' : 'disabled') }}
-
-
-
- {{ $t('tools_webadmin.cache_description') }}
-
-
-
-
-
-
-
- {{ $t(currentTransitions ? 'enabled' : 'disabled') }}
-
-
-
-
-
-
-
- {{ $t('tools_webadmin.experimental') }}
-
-
-
-
- {{ $t(currentExperimental ? 'enabled' : 'disabled') }}
-
-
-
-
-
-
-
+
+
+