From 06bb22f45d526c33231a4be0904d4c00e016c30c Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 24 Apr 2023 18:05:07 +0200 Subject: [PATCH 1/8] args: reflect pydantic `visible` changes --- app/src/helpers/yunohostArguments.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/helpers/yunohostArguments.js b/app/src/helpers/yunohostArguments.js index 641ae376..4bfe37ab 100644 --- a/app/src/helpers/yunohostArguments.js +++ b/app/src/helpers/yunohostArguments.js @@ -131,7 +131,7 @@ export function formatYunoHostArgument(arg) { arg.ask = formatI18nField(arg.ask) const field = { is: arg.readonly ? 'ReadOnlyField' : 'FormField', - visible: [undefined, true, '"true"'].includes(arg.visible), + visible: arg.visible, props: { label: arg.ask, component: undefined, @@ -433,12 +433,12 @@ export function formatYunoHostConfigPanels(data) { const section = { id: _section.id, isActionSection: _section.is_action_section, - visible: [undefined, true, '"true"'].includes(_section.visible), + visible: _section.visible } if (_section.help) section.help = formatI18nField(_section.help) if (_section.name) section.name = formatI18nField(_section.name) - if (_section.visible && ![false, '"false"'].includes(_section.visible)) { - addEvaluationGetter('visible', section, _section.visible, result.forms) + if (typeof _section.visible === "string") { + addEvaluationGetter('visible', section, section.visible, result.forms) } const { form, fields, validations, errors } = formatYunoHostArguments( From 60934cf77287607649b8690599b5118a120ee2e5 Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 24 Apr 2023 18:06:32 +0200 Subject: [PATCH 2/8] args: remove `current_value` and remove the need for int parsing for option prop min + max --- app/src/helpers/yunohostArguments.js | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/app/src/helpers/yunohostArguments.js b/app/src/helpers/yunohostArguments.js index 4bfe37ab..0d79520a 100644 --- a/app/src/helpers/yunohostArguments.js +++ b/app/src/helpers/yunohostArguments.js @@ -120,12 +120,7 @@ function addEvaluationGetter(prop, obj, expr, ctx, nested) { * @return {Object} an formated argument containing formItem props, validation and base value. */ export function formatYunoHostArgument(arg) { - let value = - arg.value !== undefined - ? arg.value - : arg.current_value !== undefined - ? arg.current_value - : null + let value = arg.value !== undefined ? arg.value : null const validation = {} const error = { message: null } arg.ask = formatI18nField(arg.ask) @@ -168,11 +163,11 @@ export function formatYunoHostArgument(arg) { name: 'InputItem', props: defaultProps.concat(['type', 'min', 'max', 'step']), callback: function () { - if (!isNaN(parseInt(arg.min))) { - validation.minValue = validators.minValue(parseInt(arg.min)) + if (arg.min !== undefined) { + validation.minValue = validators.minValue(arg.min) } - if (!isNaN(parseInt(arg.max))) { - validation.maxValue = validators.maxValue(parseInt(arg.max)) + if (arg.max !== undefined) { + validation.maxValue = validators.maxValue(arg.max) } validation.numValue = validators.integer }, @@ -277,11 +272,12 @@ export function formatYunoHostArgument(arg) { ] // Default type management if no one is filled - if (arg.choices && arg.choices.length) { - arg.type = 'select' - } if (arg.type === undefined) { - arg.type = 'string' + if (arg.choices && arg.choices.length) { + arg.type = 'select' + } else { + arg.type = 'string' + } } // Search the component bind to the type @@ -328,9 +324,6 @@ export function formatYunoHostArgument(arg) { } // Default value if still `null` - if (value === null && arg.current_value) { - value = arg.current_value - } if (value === null && arg.default) { value = arg.default } From 9dd29dff18249bf806b831f38b5c263d9b7e78d6 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Fri, 12 May 2023 16:21:06 +0000 Subject: [PATCH 3/8] Update changelog for 12.0.0 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 452e1921..dc646f7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yunohost (12.0.0) unstable; urgency=low + + - Tmp changelog to prepare Bookworm + + -- Tagada Fri, 12 May 2023 16:20:28 +0000 + yunohost-admin (11.2.4.1) stable; urgency=low - [i18n] Translations updated for Arabic, Basque, Catalan, Chinese (Simplified), English, French, Galician, German, Italian, Kabyle, Korean, Occitan, Spanish, Ukrainian From 8db7691fe2546162f13b4be6942d896600b1252d Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Fri, 12 May 2023 16:46:33 +0000 Subject: [PATCH 4/8] s/bullseye/bookworm --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 02aeba18..f34fca5c 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ TMPDIR = $$(pwd)/debian/yunohost-admin override_dh_auto_build: /usr/bin/curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null /usr/bin/curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/yarn.gpg >/dev/null - echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x bullseye main' > /etc/apt/sources.list.d/nodesource.list + echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x bookworm main' > /etc/apt/sources.list.d/nodesource.list echo "deb [signed-by=/etc/apt/trusted.gpg.d/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list /usr/bin/apt update /usr/bin/apt install nodejs yarn -y From 1d892350cd90e6956645325f62300d05bdc4f12d Mon Sep 17 00:00:00 2001 From: axolotle Date: Fri, 29 Dec 2023 17:53:53 +0100 Subject: [PATCH 5/8] do not logout when trying to reconnect to the server since the session should still be valid --- app/src/api/api.js | 6 +++--- app/src/i18n/locales/en.json | 2 +- app/src/store/info.js | 3 +-- app/src/views/_partials/ReconnectingDisplay.vue | 14 +++++++++----- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/src/api/api.js b/app/src/api/api.js index daeb56b0..e7c8e061 100644 --- a/app/src/api/api.js +++ b/app/src/api/api.js @@ -217,12 +217,12 @@ export default { const api = this function reconnect(n) { - api - .get('logout', {}, { key: 'reconnecting' }) + store + .dispatch('GET_YUNOHOST_INFOS') .then(resolve) .catch((err) => { if (err.name === 'APIUnauthorizedError') { - resolve() + reject(err) } else if (n < 1) { reject(err) } else { diff --git a/app/src/i18n/locales/en.json b/app/src/i18n/locales/en.json index 3e476204..d32f28b2 100644 --- a/app/src/i18n/locales/en.json +++ b/app/src/i18n/locales/en.json @@ -31,7 +31,7 @@ "unknown": "Connection with the server has been closed for unknown reasons.", "upgrade_system": "Connection with the server has been closed due to YunoHost upgrade. Waiting for the server to be reachable again…" }, - "success": "The server is now reachable! You can try to login", + "session_expired": "The server is now reachable! But it looks like your session expired, please login.", "title": "Trying to communicate with the server…" } }, diff --git a/app/src/store/info.js b/app/src/store/info.js index 9bed6a85..5bc5ce3f 100644 --- a/app/src/store/info.js +++ b/app/src/store/info.js @@ -179,10 +179,9 @@ export default { return api.get('logout') }, - TRY_TO_RECONNECT({ commit, dispatch }, args = {}) { + TRY_TO_RECONNECT({ commit }, args = {}) { // FIXME This is very ugly arguments forwarding, will use proper component way of doing this when switching to Vue 3 (teleport) commit('SET_RECONNECTING', args) - dispatch('RESET_CONNECTED') }, GET_YUNOHOST_INFOS({ commit }) { diff --git a/app/src/views/_partials/ReconnectingDisplay.vue b/app/src/views/_partials/ReconnectingDisplay.vue index 5d33778a..65e94c4a 100644 --- a/app/src/views/_partials/ReconnectingDisplay.vue +++ b/app/src/views/_partials/ReconnectingDisplay.vue @@ -28,8 +28,8 @@ -