From 9570447b337141f42432fd05c683e58bcca0dd5a Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Thu, 16 Sep 2021 11:06:38 +0200 Subject: [PATCH] SONAR-15338 Adapt to the new way of detecting secured settings being set --- server/sonar-web/src/main/js/api/settings.ts | 12 ++++++++++-- server/sonar-web/src/main/js/types/settings.ts | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/api/settings.ts b/server/sonar-web/src/main/js/api/settings.ts index f4069b816ae..8d85d3fc1dd 100644 --- a/server/sonar-web/src/main/js/api/settings.ts +++ b/server/sonar-web/src/main/js/api/settings.ts @@ -22,7 +22,12 @@ import throwGlobalError from '../app/utils/throwGlobalError'; import { isCategoryDefinition } from '../apps/settings/utils'; import { getJSON, post, postJSON, RequestData } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; -import { SettingCategoryDefinition, SettingDefinition, SettingValue } from '../types/settings'; +import { + SettingCategoryDefinition, + SettingDefinition, + SettingValue, + SettingValueResponse +} from '../types/settings'; export function getDefinitions(component?: string): Promise { return getJSON('/api/settings/list_definitions', { component }).then( @@ -34,7 +39,10 @@ export function getDefinitions(component?: string): Promise { - return getJSON('/api/settings/values', data).then(r => r.settings); + return getJSON('/api/settings/values', data).then((r: SettingValueResponse) => [ + ...r.settings, + ...r.setSecuredSettings.map(key => ({ key })) + ]); } export function setSettingValue( diff --git a/server/sonar-web/src/main/js/types/settings.ts b/server/sonar-web/src/main/js/types/settings.ts index db89872a345..82098ddfc3d 100644 --- a/server/sonar-web/src/main/js/types/settings.ts +++ b/server/sonar-web/src/main/js/types/settings.ts @@ -64,6 +64,11 @@ export interface SettingCategoryDefinition extends SettingDefinition { subCategory: string; } +export interface SettingValueResponse { + settings: SettingValue[]; + setSecuredSettings: string[]; +} + export interface SettingValue { fieldValues?: Array>; inherited?: boolean; -- 2.39.5