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 @@ @@ -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 @@ - - + - - - - + +