diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2022-06-13 11:39:21 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-06-28 20:02:53 +0000 |
commit | 54732569670fc345367062d5b20fcca83d9f7692 (patch) | |
tree | 8a3d86a9b76fbc056b74ac68ff8b38db9cee2cb1 /server/sonar-web/src/main/js/apps/projectDump | |
parent | 26675093303e38f1973f3ee9da5750aeeb2a5a5f (diff) | |
download | sonarqube-54732569670fc345367062d5b20fcca83d9f7692.tar.gz sonarqube-54732569670fc345367062d5b20fcca83d9f7692.zip |
SONAR-16045 Migrate react-router to 6.3.0
Co-authored-by: Jeremy Davis <jeremy.davis@sonarsource.com>
Co-authored-by: Guillaume Péoc'h <guillaume.peoch@sonarsource.com>
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectDump')
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx | 3 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectDump/components/Import.tsx | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectDump/components/__tests__/__snapshots__/Import-test.tsx.snap | 9 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectDump/routes.tsx (renamed from server/sonar-web/src/main/js/apps/projectDump/routes.ts) | 8 |
4 files changed, 8 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx b/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx index 43c17531ec2..6342f16940a 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx @@ -21,6 +21,7 @@ import * as React from 'react'; import { getActivity } from '../../api/ce'; import { getStatus } from '../../api/project-dump'; import withAppStateContext from '../../app/components/app-state/withAppStateContext'; +import withComponentContext from '../../app/components/componentContext/withComponentContext'; import { throwGlobalError } from '../../helpers/error'; import { translate } from '../../helpers/l10n'; import { AppState } from '../../types/appstate'; @@ -199,4 +200,4 @@ export class ProjectDumpApp extends React.Component<Props, State> { } } -export default withAppStateContext(ProjectDumpApp); +export default withComponentContext(withAppStateContext(ProjectDumpApp)); diff --git a/server/sonar-web/src/main/js/apps/projectDump/components/Import.tsx b/server/sonar-web/src/main/js/apps/projectDump/components/Import.tsx index 000906deebe..39a28c846ef 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/components/Import.tsx +++ b/server/sonar-web/src/main/js/apps/projectDump/components/Import.tsx @@ -19,7 +19,7 @@ */ import classNames from 'classnames'; import * as React from 'react'; -import { Link } from 'react-router'; +import { Link } from 'react-router-dom'; import { doImport } from '../../../api/project-dump'; import { Button } from '../../../components/controls/buttons'; import DateFromNow from '../../../components/intl/DateFromNow'; diff --git a/server/sonar-web/src/main/js/apps/projectDump/components/__tests__/__snapshots__/Import-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectDump/components/__tests__/__snapshots__/Import-test.tsx.snap index 6073edbe109..0c62310f98d 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/components/__tests__/__snapshots__/Import-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectDump/components/__tests__/__snapshots__/Import-test.tsx.snap @@ -43,16 +43,11 @@ exports[`should render correctly: failed 1`] = ` project_dump.failed_import <Link className="spacer-left" - onlyActiveOnIndex={false} - style={Object {}} to={ Object { + "hash": "", "pathname": "/project/background_tasks", - "query": Object { - "id": "key", - "status": "FAILED", - "taskType": "PROJECT_IMPORT", - }, + "search": "?id=key&status=FAILED&taskType=PROJECT_IMPORT", } } > diff --git a/server/sonar-web/src/main/js/apps/projectDump/routes.ts b/server/sonar-web/src/main/js/apps/projectDump/routes.tsx index db889495b12..331c7789909 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectDump/routes.tsx @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import React from 'react'; +import { Route } from 'react-router-dom'; import ProjectDumpApp from './ProjectDumpApp'; -const routes = [ - { - indexRoute: { component: ProjectDumpApp } - } -]; +const routes = () => <Route path="import_export" element={<ProjectDumpApp />} />; export default routes; |