diff options
author | Mathieu Suen <mathieu.suen@sonarsource.com> | 2021-09-16 11:06:38 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-09-16 20:03:31 +0000 |
commit | 9570447b337141f42432fd05c683e58bcca0dd5a (patch) | |
tree | 6b6b1404d8503d357453e833a8fa5749a844758a /server/sonar-web/src/main | |
parent | f790e5fd2320688ed331ab3f428f89f3ab3042e8 (diff) | |
download | sonarqube-9570447b337141f42432fd05c683e58bcca0dd5a.tar.gz sonarqube-9570447b337141f42432fd05c683e58bcca0dd5a.zip |
SONAR-15338 Adapt to the new way of detecting secured settings being set
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r-- | server/sonar-web/src/main/js/api/settings.ts | 12 | ||||
-rw-r--r-- | 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<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( 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<T.Dict<string>>; inherited?: boolean; |