diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2022-03-03 16:17:30 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-03-04 20:02:47 +0000 |
commit | bc489aa9897b982a6b85aaa30f713336ce3cdfbf (patch) | |
tree | 5760e387bc1080798631861806ad4c41a04d4058 /server/sonar-web/src/main/js/app | |
parent | b9059604204d2b3045d8050fd4ffb9a0029a600f (diff) | |
download | sonarqube-bc489aa9897b982a6b85aaa30f713336ce3cdfbf.tar.gz sonarqube-bc489aa9897b982a6b85aaa30f713336ce3cdfbf.zip |
[NO JIRA] Treat some Code Smells
Diffstat (limited to 'server/sonar-web/src/main/js/app')
6 files changed, 20 insertions, 20 deletions
diff --git a/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx b/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx index d00fbc0cf73..52a5eccf943 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx @@ -26,8 +26,8 @@ import GlobalFooter from './GlobalFooter'; import GlobalMessagesContainer from './GlobalMessagesContainer'; import IndexationContextProvider from './indexation/IndexationContextProvider'; import IndexationNotification from './indexation/IndexationNotification'; -import LanguageContextProvider from './languages/LanguagesContextProvider'; -import MetricContextProvider from './metrics/MetricsContextProvider'; +import LanguagesContextProvider from './languages/LanguagesContextProvider'; +import MetricsContextProvider from './metrics/MetricsContextProvider'; import GlobalNav from './nav/global/GlobalNav'; import PromotionNotification from './promotion-notification/PromotionNotification'; import StartupModal from './StartupModal'; @@ -52,15 +52,15 @@ export default function GlobalContainer(props: Props) { <div className="page-container"> <Workspace> <IndexationContextProvider> - <LanguageContextProvider> - <MetricContextProvider> + <LanguagesContextProvider> + <MetricsContextProvider> <GlobalNav location={props.location} /> <GlobalMessagesContainer /> <IndexationNotification /> <UpdateNotification dismissable={true} /> {props.children} - </MetricContextProvider> - </LanguageContextProvider> + </MetricsContextProvider> + </LanguagesContextProvider> </IndexationContextProvider> </Workspace> </div> diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalContainer-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalContainer-test.tsx.snap index 58f58f0bfd2..cf997f458f2 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalContainer-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalContainer-test.tsx.snap @@ -17,8 +17,8 @@ exports[`should render correctly 1`] = ` > <Workspace> <withAppStateContext(IndexationContextProvider)> - <LanguageContextProvider> - <MetricContextProvider> + <LanguagesContextProvider> + <MetricsContextProvider> <Connect(GlobalNav) location={ Object { @@ -38,8 +38,8 @@ exports[`should render correctly 1`] = ` dismissable={true} /> <ChildComponent /> - </MetricContextProvider> - </LanguageContextProvider> + </MetricsContextProvider> + </LanguagesContextProvider> </withAppStateContext(IndexationContextProvider)> </Workspace> </div> diff --git a/server/sonar-web/src/main/js/app/components/languages/LanguagesContextProvider.tsx b/server/sonar-web/src/main/js/app/components/languages/LanguagesContextProvider.tsx index 9e83ad94454..72b531e6b60 100644 --- a/server/sonar-web/src/main/js/app/components/languages/LanguagesContextProvider.tsx +++ b/server/sonar-web/src/main/js/app/components/languages/LanguagesContextProvider.tsx @@ -27,7 +27,7 @@ interface State { languages: Languages; } -export default class LanguageContextProvider extends React.PureComponent<{}, State> { +export default class LanguagesContextProvider extends React.PureComponent<{}, State> { mounted = false; state: State = { languages: {} diff --git a/server/sonar-web/src/main/js/app/components/languages/__tests__/LanguagesContextProvider-test.tsx b/server/sonar-web/src/main/js/app/components/languages/__tests__/LanguagesContextProvider-test.tsx index feb859ac1d8..a25d44bda93 100644 --- a/server/sonar-web/src/main/js/app/components/languages/__tests__/LanguagesContextProvider-test.tsx +++ b/server/sonar-web/src/main/js/app/components/languages/__tests__/LanguagesContextProvider-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getLanguages } from '../../../../api/languages'; import { waitAndUpdate } from '../../../../helpers/testUtils'; -import LanguageContextProvider from '../LanguagesContextProvider'; +import LanguagesContextProvider from '../LanguagesContextProvider'; jest.mock('../../../../api/languages', () => ({ getLanguages: jest.fn().mockResolvedValue({}) @@ -38,9 +38,9 @@ it('should call language', async () => { }); function shallowRender() { - return shallow<LanguageContextProvider>( - <LanguageContextProvider> + return shallow<LanguagesContextProvider>( + <LanguagesContextProvider> <div /> - </LanguageContextProvider> + </LanguagesContextProvider> ); } diff --git a/server/sonar-web/src/main/js/app/components/metrics/MetricsContextProvider.tsx b/server/sonar-web/src/main/js/app/components/metrics/MetricsContextProvider.tsx index 8e3e2395b77..0567e7da9f9 100644 --- a/server/sonar-web/src/main/js/app/components/metrics/MetricsContextProvider.tsx +++ b/server/sonar-web/src/main/js/app/components/metrics/MetricsContextProvider.tsx @@ -28,7 +28,7 @@ interface State { metrics: Dict<Metric>; } -export default class MetricContextProvider extends React.PureComponent<{}, State> { +export default class MetricsContextProvider extends React.PureComponent<{}, State> { mounted = false; state: State = { metrics: {} diff --git a/server/sonar-web/src/main/js/app/components/metrics/__tests__/MetricsContextProvider-test.tsx b/server/sonar-web/src/main/js/app/components/metrics/__tests__/MetricsContextProvider-test.tsx index 753d73b2e52..be30d4fa999 100644 --- a/server/sonar-web/src/main/js/app/components/metrics/__tests__/MetricsContextProvider-test.tsx +++ b/server/sonar-web/src/main/js/app/components/metrics/__tests__/MetricsContextProvider-test.tsx @@ -23,7 +23,7 @@ import * as React from 'react'; import { getAllMetrics } from '../../../../api/metrics'; import { mockMetric } from '../../../../helpers/testMocks'; import { waitAndUpdate } from '../../../../helpers/testUtils'; -import MetricContextProvider from '../MetricsContextProvider'; +import MetricsContextProvider from '../MetricsContextProvider'; jest.mock('../../../../api/metrics', () => ({ getAllMetrics: jest.fn().mockResolvedValue({}) @@ -40,9 +40,9 @@ it('should call metric', async () => { }); function shallowRender() { - return shallow<MetricContextProvider>( - <MetricContextProvider> + return shallow<MetricsContextProvider>( + <MetricsContextProvider> <div /> - </MetricContextProvider> + </MetricsContextProvider> ); } |