diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-25 16:53:22 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-30 09:20:37 +0100 |
commit | e4ef72e885308b113d89a7826d1b300c093134cf (patch) | |
tree | d747d066447c0924cf2cfb108bf107a8effd0144 /server/sonar-web/src/main/js/apps/system | |
parent | eea79d51b8894ef98f1cd02388d06062df343e4d (diff) | |
download | sonarqube-e4ef72e885308b113d89a7826d1b300c093134cf.tar.gz sonarqube-e4ef72e885308b113d89a7826d1b300c093134cf.zip |
update web dependencies (#2752)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/system')
14 files changed, 240 insertions, 192 deletions
diff --git a/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx b/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx index 045142edbf9..932f008b324 100644 --- a/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { setLogLevel } from '../../../api/system'; import { translate } from '../../../helpers/l10n'; import { LOGS_LEVELS } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ChangeLogLevelForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ChangeLogLevelForm-test.tsx.snap index 26e85fbe63e..a3cd26a208b 100644 --- a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ChangeLogLevelForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ChangeLogLevelForm-test.tsx.snap @@ -12,7 +12,9 @@ exports[`should display some warning messages for non INFO levels 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <form id="set-log-level-form" @@ -30,6 +32,7 @@ exports[`should display some warning messages for non INFO levels 1`] = ` > <p className="spacer-bottom" + key="INFO" > <input checked={false} @@ -49,6 +52,7 @@ exports[`should display some warning messages for non INFO levels 1`] = ` </p> <p className="spacer-bottom" + key="DEBUG" > <input checked={true} @@ -68,6 +72,7 @@ exports[`should display some warning messages for non INFO levels 1`] = ` </p> <p className="spacer-bottom" + key="TRACE" > <input checked={false} @@ -129,7 +134,9 @@ exports[`should render correctly 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <form id="set-log-level-form" @@ -147,6 +154,7 @@ exports[`should render correctly 1`] = ` > <p className="spacer-bottom" + key="INFO" > <input checked={true} @@ -166,6 +174,7 @@ exports[`should render correctly 1`] = ` </p> <p className="spacer-bottom" + key="DEBUG" > <input checked={false} @@ -185,6 +194,7 @@ exports[`should render correctly 1`] = ` </p> <p className="spacer-bottom" + key="TRACE" > <input checked={false} diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ClusterSysInfos-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ClusterSysInfos-test.tsx.snap index 6db92bdf46b..4cee8e00890 100644 --- a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ClusterSysInfos-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/ClusterSysInfos-test.tsx.snap @@ -28,6 +28,7 @@ exports[`should support more than two nodes 1`] = ` <HealthCard health="GREEN" healthCauses={Array []} + key="Bar" name="Bar" onClick={[Function]} open={false} @@ -50,6 +51,7 @@ exports[`should support more than two nodes 1`] = ` <HealthCard health="YELLOW" healthCauses={Array []} + key="Baz" name="Baz" onClick={[Function]} open={false} diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/StandaloneSysInfos-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/StandaloneSysInfos-test.tsx.snap index ba562c42b3b..13877f72b86 100644 --- a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/StandaloneSysInfos-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/StandaloneSysInfos-test.tsx.snap @@ -21,6 +21,7 @@ exports[`should render correctly 1`] = ` } /> <HealthCard + key="Web" name="Web" onClick={[Function]} open={false} @@ -33,6 +34,7 @@ exports[`should render correctly 1`] = ` } /> <HealthCard + key="Compute Engine" name="Compute Engine" onClick={[Function]} open={true} @@ -45,6 +47,7 @@ exports[`should render correctly 1`] = ` } /> <HealthCard + key="Search Engine" name="Search Engine" onClick={[Function]} open={false} diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthCard-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthCard-test.tsx.snap index 77afaf39ea2..fe7c59a4286 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthCard-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthCard-test.tsx.snap @@ -125,6 +125,7 @@ exports[`should show a main section and multiple sub sections 1`] = ` "db": "test", } } + key="Database" name="Database" /> <Section @@ -133,6 +134,7 @@ exports[`should show a main section and multiple sub sections 1`] = ` "Elastic": "search", } } + key="Elasticseach" name="Elasticseach" /> </div> diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap index 81f4aa9ba6a..6b224445797 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap @@ -28,6 +28,7 @@ exports[`should render correctly 1`] = ` className="spacer-right" health="RED" healthCause="foo" + key="0" /> <Tooltip overlay="system.current_health_of_x.Foo" @@ -51,11 +52,13 @@ exports[`should render multiple health causes 1`] = ` className="spacer-right" health="YELLOW" healthCause="foo" + key="0" /> <HealthCauseItem className="spacer-right" health="YELLOW" healthCause="bar" + key="1" /> <StatusIndicator color="yellow" diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/Section-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/Section-test.tsx.snap index 20fce92a9b7..ecbb9a4b5b3 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/Section-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/Section-test.tsx.snap @@ -8,7 +8,9 @@ exports[`should not render a title 1`] = ` className="data zebra" > <tbody> - <tr> + <tr + key="foo" + > <td className="thin" > @@ -50,7 +52,9 @@ exports[`should render correctly 1`] = ` id="foo" > <tbody> - <tr> + <tr + key="foo" + > <td className="thin" > @@ -73,7 +77,9 @@ exports[`should render correctly 1`] = ` /> </td> </tr> - <tr> + <tr + key="bar" + > <td className="thin" > @@ -96,7 +102,9 @@ exports[`should render correctly 1`] = ` /> </td> </tr> - <tr> + <tr + key="baz" + > <td className="thin" > diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap index b02b9854bdf..86c9310e1d7 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap @@ -4,192 +4,206 @@ exports[`should render object correctly 1`] = ` Array [ <ObjectItem value={ - Object { - "bar": Object { - "a": 1, - "b": "b", - }, - "baz": true, - "foo": "Far", - } + Object { + "bar": Object { + "a": 1, + "b": "b", + }, + "baz": true, + "foo": "Far", + } } -> + > <table - className="data" + className="data" > - <tbody> - <tr> - <td - className="thin nowrap" + <tbody> + <tr + key="foo" + > + <td + className="thin nowrap" + > + foo + </td> + <td> + <SysInfoItem + name="foo" + value="Far" + > + <code> + Far + </code> + </SysInfoItem> + </td> + </tr> + <tr + key="bar" + > + <td + className="thin nowrap" + > + bar + </td> + <td> + <SysInfoItem + name="bar" + value={ + Object { + "a": 1, + "b": "b", + } + } + > + <ObjectItem + value={ + Object { + "a": 1, + "b": "b", + } + } + > + <table + className="data" > - foo - </td> - <td> - <SysInfoItem - name="foo" - value="Far" + <tbody> + <tr + key="a" > - <code> - Far - </code> - </SysInfoItem> - </td> - </tr> - <tr> - <td - className="thin nowrap" - > - bar - </td> - <td> - <SysInfoItem - name="bar" - value={ - Object { - "a": 1, - "b": "b", - } - } - > - <ObjectItem - value={ - Object { - "a": 1, - "b": "b", - } - } + <td + className="thin nowrap" + > + a + </td> + <td> + <SysInfoItem + name="a" + value={1} > - <table - className="data" - > - <tbody> - <tr> - <td - className="thin nowrap" - > - a - </td> - <td> - <SysInfoItem - name="a" - value={1} - > - <code> - 1 - </code> - </SysInfoItem> - </td> - </tr> - <tr> - <td - className="thin nowrap" - > - b - </td> - <td> - <SysInfoItem - name="b" - value="b" - > - <code> - b - </code> - </SysInfoItem> - </td> - </tr> - </tbody> - </table> - </ObjectItem> - </SysInfoItem> - </td> - </tr> - <tr> - <td - className="thin nowrap" - > - baz - </td> - <td> - <SysInfoItem - name="baz" - value={true} + <code> + 1 + </code> + </SysInfoItem> + </td> + </tr> + <tr + key="b" > - <BooleanItem - value={true} + <td + className="thin nowrap" + > + b + </td> + <td> + <SysInfoItem + name="b" + value="b" > - <CheckIcon> - <svg - height={16} - viewBox="0 0 16 16" - width={16} - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M14.92 4.804q0 0.357-0.25 0.607l-7.679 7.679q-0.25 0.25-0.607 0.25t-0.607-0.25l-4.446-4.446q-0.25-0.25-0.25-0.607t0.25-0.607l1.214-1.214q0.25-0.25 0.607-0.25t0.607 0.25l2.625 2.634 5.857-5.866q0.25-0.25 0.607-0.25t0.607 0.25l1.214 1.214q0.25 0.25 0.25 0.607z" - style={ - Object { - "fill": "currentColor", - } - } - /> - ; - </svg> - </CheckIcon> - </BooleanItem> - </SysInfoItem> - </td> - </tr> - </tbody> + <code> + b + </code> + </SysInfoItem> + </td> + </tr> + </tbody> + </table> + </ObjectItem> + </SysInfoItem> + </td> + </tr> + <tr + key="baz" + > + <td + className="thin nowrap" + > + baz + </td> + <td> + <SysInfoItem + name="baz" + value={true} + > + <BooleanItem + value={true} + > + <CheckIcon> + <svg + height={16} + viewBox="0 0 16 16" + width={16} + xmlns="http://www.w3.org/2000/svg" + > + <path + d="M14.92 4.804q0 0.357-0.25 0.607l-7.679 7.679q-0.25 0.25-0.607 0.25t-0.607-0.25l-4.446-4.446q-0.25-0.25-0.25-0.607t0.25-0.607l1.214-1.214q0.25-0.25 0.607-0.25t0.607 0.25l2.625 2.634 5.857-5.866q0.25-0.25 0.607-0.25t0.607 0.25l1.214 1.214q0.25 0.25 0.25 0.607z" + style={ + Object { + "fill": "currentColor", + } + } + /> + ; + </svg> + </CheckIcon> + </BooleanItem> + </SysInfoItem> + </td> + </tr> + </tbody> </table> -</ObjectItem>, + </ObjectItem>, <ObjectItem value={ - Object { - "a": 1, - "b": "b", - } + Object { + "a": 1, + "b": "b", + } } -> + > <table - className="data" + className="data" > - <tbody> - <tr> - <td - className="thin nowrap" - > - a - </td> - <td> - <SysInfoItem - name="a" - value={1} - > - <code> - 1 - </code> - </SysInfoItem> - </td> - </tr> - <tr> - <td - className="thin nowrap" - > - b - </td> - <td> - <SysInfoItem - name="b" - value="b" - > - <code> - b - </code> - </SysInfoItem> - </td> - </tr> - </tbody> + <tbody> + <tr + key="a" + > + <td + className="thin nowrap" + > + a + </td> + <td> + <SysInfoItem + name="a" + value={1} + > + <code> + 1 + </code> + </SysInfoItem> + </td> + </tr> + <tr + key="b" + > + <td + className="thin nowrap" + > + b + </td> + <td> + <SysInfoItem + name="b" + value="b" + > + <code> + b + </code> + </SysInfoItem> + </td> + </tr> + </tbody> </table> -</ObjectItem>, + </ObjectItem>, ] `; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx index 0c508a86706..d69ff53c19b 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import SystemUpgradeItem from './SystemUpgradeItem'; import { SystemUpgrade } from '../../../../api/system'; import { translate } from '../../../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx index ccafec8a1aa..01d546ecdb1 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx @@ -54,11 +54,9 @@ export default class SystemUpgradeIntermediate extends React.PureComponent<Props className="button-link little-spacer-bottom" href="#" onClick={this.toggleIntermediatVersions}> - {showMore ? ( - translate('system.hide_intermediate_versions') - ) : ( - translate('system.show_intermediate_versions') - )} + {showMore + ? translate('system.hide_intermediate_versions') + : translate('system.show_intermediate_versions')} <i className={classNames('little-spacer-left', { 'icon-arrow-down': !showMore, diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap index 0f84689c104..86dfdda674a 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap @@ -12,7 +12,9 @@ exports[`should display correctly 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <div className="modal-head" @@ -25,6 +27,7 @@ exports[`should display correctly 1`] = ` className="modal-body" > <SystemUpgradeItem + key="6.3" systemUpgrades={ Array [ Object { @@ -48,6 +51,7 @@ exports[`should display correctly 1`] = ` type="system.latest_version" /> <SystemUpgradeItem + key="5.6.5" systemUpgrades={ Array [ Object { diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeIntermediate-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeIntermediate-test.tsx.snap index 9217e8cb640..80a70b6f48e 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeIntermediate-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeIntermediate-test.tsx.snap @@ -29,6 +29,7 @@ exports[`should display correctly 2`] = ` </a> <div className="note system-upgrade-intermediate" + key="5.6.6" > <DateFormatter date="2017-04-02" @@ -42,6 +43,7 @@ exports[`should display correctly 2`] = ` </div> <div className="note system-upgrade-intermediate" + key="5.6.5" > <DateFormatter date="2017-03-01" diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap index 15f11c439b6..e6e4afad432 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap @@ -13,7 +13,7 @@ exports[`should display correctly 1`] = ` "version": <b> SonarQube 5.6.7 - </b>, + </b>, } } /> 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 7d6ccca5a0d..613dccb9a93 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -54,7 +54,7 @@ export function ignoreInfoFields(sysInfoObject: SysValueObject): SysValueObject 'Name', PLUGINS_FIELD, SETTINGS_FIELD - ]); + ]) as SysValueObject; } export function getHealth(sysInfoObject: SysValueObject): HealthType { @@ -130,21 +130,21 @@ function getSystemData(sysInfoData: SysInfo): SysValueObject { export function getClusterMainCardSection(sysInfoData: ClusterSysInfo): SysValueObject { return { ...getSystemData(sysInfoData), - ...omit(sysInfoData, [ + ...(omit(sysInfoData, [ 'Application Nodes', PLUGINS_FIELD, 'Search Nodes', SETTINGS_FIELD, 'Statistics', 'System' - ]) + ]) as SysValueObject) }; } export function getStandaloneMainSections(sysInfoData: SysInfo): SysValueObject { return { ...getSystemData(sysInfoData), - ...omitBy( + ...(omitBy( sysInfoData, (value, key) => value == null || @@ -152,15 +152,17 @@ export function getStandaloneMainSections(sysInfoData: SysInfo): SysValueObject key.startsWith('Compute Engine') || key.startsWith('Search') || key.startsWith('Web') - ) + ) as SysValueObject) }; } export function getStandaloneSecondarySections(sysInfoData: SysInfo): SysInfoSection { return { - Web: pickBy(sysInfoData, (_, key) => key.startsWith('Web')), - 'Compute Engine': pickBy(sysInfoData, (_, key) => key.startsWith('Compute Engine')), - 'Search Engine': pickBy(sysInfoData, (_, key) => key.startsWith('Search')) + Web: pickBy(sysInfoData, (_, key) => key.startsWith('Web')) as SysValueObject, + 'Compute Engine': pickBy(sysInfoData, (_, key) => + key.startsWith('Compute Engine') + ) as SysValueObject, + 'Search Engine': pickBy(sysInfoData, (_, key) => key.startsWith('Search')) as SysValueObject }; } |