]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15338 Adapt to the new way of detecting secured settings being set
authorMathieu Suen <mathieu.suen@sonarsource.com>
Thu, 16 Sep 2021 09:06:38 +0000 (11:06 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 16 Sep 2021 20:03:31 +0000 (20:03 +0000)
server/sonar-web/src/main/js/api/settings.ts
server/sonar-web/src/main/js/types/settings.ts

index f4069b816aebbbd65ef9bda2c7361f9c79bb7c8d..8d85d3fc1dd4c37253ac7dd1fa72e5a72a6815f3 100644 (file)
@@ -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<SettingCategoryDefinition[]> {
   return getJSON('/api/settings/list_definitions', { component }).then(
@@ -34,7 +39,10 @@ export function getDefinitions(component?: string): Promise<SettingCategoryDefin
 export function getValues(
   data: { keys: string; component?: string } & BranchParameters
 ): Promise<SettingValue[]> {
-  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(
index db89872a34543a8c73f3626f614f9c4090d8f777..82098ddfc3dcf287698cb0e9e2930b7d319f8701 100644 (file)
@@ -64,6 +64,11 @@ export interface SettingCategoryDefinition extends SettingDefinition {
   subCategory: string;
 }
 
+export interface SettingValueResponse {
+  settings: SettingValue[];
+  setSecuredSettings: string[];
+}
+
 export interface SettingValue {
   fieldValues?: Array<T.Dict<string>>;
   inherited?: boolean;