From 8fde0e140bca3d26a1566cf7a291cd9ef917d4b2 Mon Sep 17 00:00:00 2001 From: guillaume-peoch-sonarsource Date: Thu, 28 Sep 2023 17:42:08 +0200 Subject: [PATCH] SONAR-20532 Confirmation toast after saving github roles --- server/sonar-web/src/main/js/queries/identity-provider.ts | 5 +++++ server/sonar-web/src/main/js/queries/settings.ts | 4 ++++ sonar-core/src/main/resources/org/sonar/l10n/core.properties | 2 ++ 3 files changed, 11 insertions(+) diff --git a/server/sonar-web/src/main/js/queries/identity-provider.ts b/server/sonar-web/src/main/js/queries/identity-provider.ts index 85e8d706bae..c37a6248494 100644 --- a/server/sonar-web/src/main/js/queries/identity-provider.ts +++ b/server/sonar-web/src/main/js/queries/identity-provider.ts @@ -37,6 +37,8 @@ import { } from '../api/provisioning'; import { getSystemInfo } from '../api/system'; import { AvailableFeaturesContext } from '../app/components/available-features/AvailableFeaturesContext'; +import { addGlobalSuccessMessage } from '../helpers/globalMessages'; +import { translate } from '../helpers/l10n'; import { mapReactQueryResult } from '../helpers/react-query'; import { Feature } from '../types/features'; import { GitHubMapping } from '../types/provisioning'; @@ -175,6 +177,9 @@ export function useGithubRolesMappingMutation() { ); client.setQueryData(queryKey, newData); } + addGlobalSuccessMessage( + translate('settings.authentication.github.configuration.roles_mapping.save_success'), + ); }, }); } diff --git a/server/sonar-web/src/main/js/queries/settings.ts b/server/sonar-web/src/main/js/queries/settings.ts index c55f7f1f53c..0d6eac585c7 100644 --- a/server/sonar-web/src/main/js/queries/settings.ts +++ b/server/sonar-web/src/main/js/queries/settings.ts @@ -19,6 +19,8 @@ */ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { getValue, getValues, resetSettingValue, setSettingValue } from '../api/settings'; +import { addGlobalSuccessMessage } from '../helpers/globalMessages'; +import { translate } from '../helpers/l10n'; import { ExtendedSettingDefinition } from '../types/settings'; type SettingValue = string | boolean | string[]; @@ -74,6 +76,7 @@ export function useSaveValuesMutation() { onSuccess: (data) => { if (data.length > 0) { queryClient.invalidateQueries(['settings']); + addGlobalSuccessMessage(translate('settings.authentication.form.settings.save_success')); } }, }); @@ -97,6 +100,7 @@ export function useSaveValueMutation() { }, onSuccess: () => { queryClient.invalidateQueries(['settings']); + addGlobalSuccessMessage(translate('settings.authentication.form.settings.save_success')); }, }); } diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 47fddcc4e35..193f4c37ff1 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -1487,6 +1487,7 @@ settings.authentication.form.disable=Disable configuration settings.authentication.form.provisioning=Provisioning settings.authentication.form.provisioning_at_login=Just-in-Time user and group provisioning (default) settings.authentication.form.other_provisioning_enabled=Already enabled for another provider. Only one identity provider can have automatic users and groups provisioning enabled. +settings.authentication.form.settings.save_success=Settings saved successfully. # GITHUB settings.authentication.form.create.github=New GitHub Configuration @@ -1544,6 +1545,7 @@ settings.authentication.github.configuration.roles_mapping.dialog.custom_roles_d settings.authentication.github.configuration.roles_mapping.dialog.delete_custom_role=Delete custom role {0} settings.authentication.github.configuration.roles_mapping.role_exists=Role already exists. settings.authentication.github.configuration.roles_mapping.empty_custom_role=Custom roles should have some permissions. +settings.authentication.github.configuration.roles_mapping.save_success=GitHub roles mapping saved successfully. settings.authentication.github.configuration.unsaved_changes=You have unsaved changes. # SAML -- 2.39.5