From: Mathieu Suen Date: Thu, 16 Sep 2021 09:06:38 +0000 (+0200) Subject: SONAR-15338 Adapt to the new way of detecting secured settings being set X-Git-Tag: 9.1.0.47736~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9570447b337141f42432fd05c683e58bcca0dd5a;p=sonarqube.git SONAR-15338 Adapt to the new way of detecting secured settings being set --- 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;