diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-09-25 14:38:35 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-09-26 23:49:38 +0200 |
commit | 00e284b921a3803b23fd10a74188c40e45e1f39a (patch) | |
tree | 7218723b1e147e1b7c0fd1f1db79c850bdfe7edf /server/sonar-web/src/main/js/apps/system/utils.ts | |
parent | 051aa4a1defb22c593d368c26438575c12f0fe7a (diff) | |
download | sonarqube-00e284b921a3803b23fd10a74188c40e45e1f39a.tar.gz sonarqube-00e284b921a3803b23fd10a74188c40e45e1f39a.zip |
SONAR-9802 Apply UI feedback
* Add tooltips on health status
* Replace boolean icons with black check and close icons
* Move log level warning next to the title of the card
* Hide Plugins section
* Retrieve correctly log levels when sections are missing.
* Display State fields as Health status
* Update IT
Diffstat (limited to 'server/sonar-web/src/main/js/apps/system/utils.ts')
-rw-r--r-- | server/sonar-web/src/main/js/apps/system/utils.ts | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/system/utils.ts b/server/sonar-web/src/main/js/apps/system/utils.ts index 5d98c9e74f8..5514ae4e705 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -42,9 +42,11 @@ export const LOGS_LEVELS = ['INFO', 'DEBUG', 'TRACE']; export const HA_FIELD = 'High Availability'; export const HEALTH_FIELD = 'Health'; export const HEALTHCAUSES_FIELD = 'Health Causes'; +export const PLUGINS_FIELD = 'Plugins'; +export const SETTINGS_FIELD = 'Settings'; export function ignoreInfoFields(sysInfoObject: SysValueObject): SysValueObject { - return omit(sysInfoObject, [HEALTH_FIELD, HEALTHCAUSES_FIELD, 'Name', 'Settings']); + return omit(sysInfoObject, [HEALTH_FIELD, HEALTHCAUSES_FIELD, 'Name', SETTINGS_FIELD]); } export function getHealth(sysInfoObject: SysValueObject): HealthType { @@ -55,18 +57,21 @@ export function getHealthCauses(sysInfoObject: SysValueObject): string[] { return sysInfoObject[HEALTHCAUSES_FIELD] as string[]; } -export function getLogsLevel(sysInfoObject: SysValueObject): string { - if (sysInfoObject['Web Logging']) { +export function getLogsLevel(sysInfoObject?: SysValueObject): string { + if (!sysInfoObject) { + return LOGS_LEVELS[0]; + } + if (sysInfoObject['Web Logging'] || sysInfoObject['Compute Engine Logging']) { return sortBy( [ - (sysInfoObject as NodeInfo)['Compute Engine Logging']['Logs Level'], - (sysInfoObject as NodeInfo)['Web Logging']['Logs Level'] + getLogsLevel((sysInfoObject as NodeInfo)['Web Logging']), + getLogsLevel((sysInfoObject as NodeInfo)['Compute Engine Logging']) ], logLevel => LOGS_LEVELS.indexOf(logLevel) )[1]; } if (sysInfoObject['System']) { - return (sysInfoObject as SysInfo)['System']['Logs Level']; + return getLogsLevel((sysInfoObject as SysInfo)['System']); } return (sysInfoObject['Logs Level'] || LOGS_LEVELS[0]) as string; } @@ -110,9 +115,9 @@ export function getClusterMainCardSection(sysInfoData: ClusterSysInfo): SysValue ...sysInfoData['System'], ...omit(sysInfoData, [ 'Application Nodes', - 'Plugins', + PLUGINS_FIELD, 'Search Nodes', - 'Settings', + SETTINGS_FIELD, 'Statistics', 'System' ]) @@ -126,7 +131,7 @@ export function getStandaloneMainSections(sysInfoData: SysInfo): SysValueObject sysInfoData, (value, key) => value == null || - ['Plugins', 'Settings', 'Statistics', 'System'].includes(key) || + [PLUGINS_FIELD, SETTINGS_FIELD, 'Statistics', 'System'].includes(key) || key.startsWith('Compute Engine') || key.startsWith('Search') || key.startsWith('Web') |