From a179601b97d6fe73c96e4deff0f5415826b7ef5b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 15 Feb 2023 16:02:49 +0100 Subject: [PATCH] (quality) lint code --- .../_undefined_notification.json.jbuilder | 2 ++ app/views/api/notifications/index.json.jbuilder | 4 +++- config/locales/app.logged.fr.yml | 2 +- setup/upgrade.sh | 11 ++++++----- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/views/api/notifications/_undefined_notification.json.jbuilder b/app/views/api/notifications/_undefined_notification.json.jbuilder index 8249b95db..802d06c66 100644 --- a/app/views/api/notifications/_undefined_notification.json.jbuilder +++ b/app/views/api/notifications/_undefined_notification.json.jbuilder @@ -1,3 +1,5 @@ +# frozen_string_literal: true + json.title t('.unknown_notification') json.description t('.notification_ID_wrong_type_TYPE_unknown', ID: notification.id, diff --git a/app/views/api/notifications/index.json.jbuilder b/app/views/api/notifications/index.json.jbuilder index aafcdb02d..32b74649e 100644 --- a/app/views/api/notifications/index.json.jbuilder +++ b/app/views/api/notifications/index.json.jbuilder @@ -1,3 +1,5 @@ +# frozen_string_literal: true + json.totals @totals json.notifications(@notifications) do |notification| json.extract! notification, :id, :notification_type_id, :notification_type, :created_at, :is_read @@ -9,4 +11,4 @@ json.notifications(@notifications) do |notification| json.partial! "/api/notifications/#{notification.notification_type}", notification: notification end end -end.delete_if {|n| n['id'] == nil } +end diff --git a/config/locales/app.logged.fr.yml b/config/locales/app.logged.fr.yml index 7c98d303b..a40ec7453 100644 --- a/config/locales/app.logged.fr.yml +++ b/config/locales/app.logged.fr.yml @@ -312,7 +312,7 @@ fr: notify_admin_when_project_published: "Un projet a été publié" notify_admin_abuse_reported: "Un contenu abusif a été rapporté" notify_admin_close_period_reminder: "L’exercice comptable arrive à échéance" - notify_admin_archive_complete: "Une archive est terminée" + notify_admin_archive_complete: "Une archive comptable est prête" notify_admin_training_auto_cancelled: "Une formation a été automatiquement annulée" notify_admin_export_complete: "Un export est disponible" notify_user_when_invoice_ready: "Une facture est disponible" diff --git a/setup/upgrade.sh b/setup/upgrade.sh index 143b8ab46..527e91f4b 100644 --- a/setup/upgrade.sh +++ b/setup/upgrade.sh @@ -110,12 +110,13 @@ config() echo -e "\e[91m[ ❌ ] docker-compose.yml was not found in ${PWD}. Please run this script from the Fab-manager's installation folder. Exiting... \e[39m" exit 1 fi - echo "Checking docker version..." - DOCKER_VERSION=$(docker -v | grep -oP "([0-9]{1,}\.)+[0-9]{1,}") - if verlt "$DOCKER_VERSION" 20.10; then - echo -e "\e[91m[ ❌ ] The installed docker version ($DOCKER_VERSION) is lower than the minimum required version (20.10). Exiting...\e[39m" && exit 1 - fi + echo "Checking docker version..." + DOCKER_VERSION=$(docker -v | grep -oP "([0-9]{1,}\.)+[0-9]{1,}") + if verlt "$DOCKER_VERSION" 20.10; then + echo -e "\e[91m[ ❌ ] The installed docker version ($DOCKER_VERSION) is lower than the minimum required version (20.10). Exiting...\e[39m" && exit 1 + fi + echo "Checking fabmanager service..." SERVICE="$(yq eval '.services.*.image | select(. == "sleede/fab-manager*") | path | .[-2]' docker-compose.yml)" YES_ALL=${Y:-false} # COMMANDS, SCRIPTS and ENVIRONMENTS are set by parseparams