From aa2be727081bea2bd4fab143c6a746ff1930ea84 Mon Sep 17 00:00:00 2001 From: Wilhelm Date: Wed, 11 Oct 2023 19:46:21 +0200 Subject: [PATCH] feat(api-codegen): replaced with new more excplicit codegen. Added react-query. Refactored app.tsx. Updated linting --- .eslintrc.json | 40 +- .github/workflows/on-tag.yaml | 2 +- .github/workflows/publish.yaml | 1 - .github/workflows/tests.yaml | 4 +- .prettierrc.js | 6 +- README.md | 10 +- package.json | 5 +- public/index.html | 10 +- radixconfig.yaml | 38 +- src/App.styled.tsx | 6 +- src/App.test.tsx | 8 +- src/App.tsx | 28 +- src/api/generated/core/ApiError.ts | 29 + src/api/generated/core/ApiRequestOptions.ts | 24 + src/api/generated/core/ApiResult.ts | 11 + src/api/generated/core/CancelablePromise.ts | 130 +++ src/api/generated/core/OpenAPI.ts | 32 + src/api/generated/core/request.ts | 364 +++++++ src/api/generated/index.ts | 75 ++ .../AddAnalogueModelParameterCommandForm.ts | 10 + ...ddAnalogueModelParameterCommandResponse.ts | 14 + .../models/AddAnalogueModelParameterDto.ts | 14 + src/api/generated/models/AddParameterDto.ts | 9 + src/api/generated/models/AnalogueList.ts | 10 + .../generated/models/AnalogueModelDetail.ts | 18 + src/api/generated/models/AnalogueModelList.ts | 14 + .../models/AnalogueModelSourceType.ts | 9 + .../models/ConvertAnalogueModelCommand.ts | 8 + .../ConvertAnalogueModelCommandResponse.ts | 14 + .../models/ConvertAnalogueModelDto.ts | 14 + .../generated/models/CreateAnalogueCommand.ts | 9 + .../models/CreateAnalogueCommandResponse.ts | 14 + src/api/generated/models/CreateAnalogueDto.ts | 10 + .../models/CreateAnalogueModelCommand.ts | 10 + .../CreateAnalogueModelCommandResponse.ts | 14 + .../models/CreateAnalogueModelDto.ts | 10 + .../models/CreateParameterCommand.ts | 10 + src/api/generated/models/ErrorResponse.ts | 12 + .../models/EstimateChannelCommand.ts | 8 + .../models/GetAnalogueListQueryResponse.ts | 14 + .../GetAnalogueModelListQueryResponse.ts | 14 + .../models/GetAnalogueModelQueryResponse.ts | 14 + .../GetCurrentJobStatusCommandResponse.ts | 14 + .../models/GetCurrentJobStatusDto.ts | 14 + .../models/GetCurrentJobStatusListCommand.ts | 6 + .../models/GetJobDetailQueryResponse.ts | 14 + .../models/GetJobListQueryResponse.ts | 14 + .../models/GetParameterDetailQueryResponse.ts | 14 + .../models/GetParameterListQueryResponse.ts | 14 + .../models/GetUploadDetailQueryResponse.ts | 14 + .../models/GetUploadListQueryResponse.ts | 14 + src/api/generated/models/JobDetail.ts | 14 + src/api/generated/models/JobList.ts | 17 + src/api/generated/models/JobListUploadsDto.ts | 13 + src/api/generated/models/JobStatus.ts | 14 + src/api/generated/models/JobType.ts | 10 + src/api/generated/models/Operation.ts | 14 + src/api/generated/models/OperationType.ts | 14 + src/api/generated/models/ParameterDetail.ts | 11 + src/api/generated/models/ParameterList.ts | 11 + .../PatchAnalogueModelCommandResponse.ts | 14 + .../generated/models/PatchAnalogueModelDto.ts | 10 + .../models/PatchParameterCommandResponse.ts | 14 + src/api/generated/models/PatchParameterDto.ts | 11 + .../models/UpdateAnalogueModelCommandBody.ts | 10 + .../UpdateAnalogueModelCommandResponse.ts | 14 + .../models/UpdateAnalogueModelDto.ts | 11 + .../models/UpdateJobStatusCommand.ts | 11 + .../models/UpdateParameterCommandBody.ts | 10 + .../models/UpdateParameterCommandResponse.ts | 14 + .../generated/models/UpdateParameterDto.ts | 11 + .../UploadAnalogueModelCommandResponse.ts | 14 + .../models/UploadAnalogueModelDto.ts | 16 + src/api/generated/models/UploadDetail.ts | 16 + .../generated/models/UploadFileCategory.ts | 10 + src/api/generated/models/UploadFileType.ts | 10 + src/api/generated/models/UploadList.ts | 17 + src/api/generated/models/UploadStatus.ts | 12 + .../AnalogueModelParametersService.ts | 33 + .../services/AnalogueModelsService.ts | 191 ++++ .../generated/services/AnaloguesService.ts | 40 + src/api/generated/services/JobsService.ts | 127 +++ .../generated/services/ParametersService.ts | 143 +++ src/api/generated/services/UploadsService.ts | 61 ++ src/auth/apiClient.ts | 9 - src/auth/authConfig.ts | 12 +- src/auth/msalClient.ts | 20 +- src/auth/queryClient.ts | 4 +- src/components/IconButton/IconButton.test.tsx | 20 +- src/components/IconButton/IconButton.tsx | 22 +- src/components/ImageView/ImageView.styled.tsx | 8 +- src/components/ImageView/ImageView.tsx | 12 +- .../InfoPageComponent.style.tsx | 10 +- .../InfoPageComponent/InfoPageComponent.tsx | 12 +- src/components/MenuIcon/MenuIcon.test.tsx | 46 +- src/components/MenuIcon/MenuIcon.tsx | 24 +- src/components/Table.styled.ts | 6 +- src/components/Table.tsx | 24 +- src/context/ApiClientProvider.tsx | 22 - .../AddModelDialog/AddModelDialog.styled.ts | 14 +- .../AddModelDialog/AddModelDialog.tsx | 28 +- src/features/AppBar/AppBar.styled.ts | 10 +- src/features/AppBar/AppBar.test.tsx | 30 +- src/features/AppBar/AppBar.tsx | 14 +- src/features/AppBar/Icons/Icons.styled.ts | 6 +- src/features/AppBar/Icons/Icons.tsx | 20 +- .../AppBar/Navigation/Navigation.styled.ts | 10 +- src/features/AppBar/Navigation/Navigation.tsx | 20 +- .../CaseCard/CaseCard.styled.tsx | 14 +- .../ComputeVariogram/CaseCard/CaseCard.tsx | 54 +- .../CaseCardButtons.styled.tsx | 6 +- .../CaseCardButtons/CaseCardButtons.tsx | 8 +- .../CaseCardInputs/CaseCardInputs.styled.tsx | 6 +- .../CaseCardInputs/CaseCardInputs.tsx | 18 +- .../CaseCardParameters.styled.tsx | 8 +- .../CaseCardParameters/CaseCardParameters.tsx | 40 +- .../ComputeCaseInfoActions.styled.tsx | 10 +- .../ComputeCaseInfoActions.tsx | 8 +- .../FileUploader/FileUploader.styled.ts | 12 +- src/features/FileUploader/FileUploader.tsx | 28 +- src/features/Footer/Footer.styled.tsx | 10 +- src/features/Footer/Footer.tsx | 10 +- .../ModelInputFilesTable.tsx | 58 +- .../ModelMetadata/ModelMetadata.styled.ts | 6 +- src/features/ModelMetadata/ModelMetadata.tsx | 10 +- .../ModelMetadataView/ModelMetadataView.tsx | 25 +- .../ModelNameFrame/ModelNameFrame.styled.tsx | 8 +- .../ModelNameFrame/ModelNameFrame.tsx | 9 +- .../ModelNavigationBar.styled.tsx | 16 +- .../ModelNavigationBar/ModelNavigationBar.tsx | 34 +- .../ModelSourceView/ModelSourceView.tsx | 27 +- src/features/ModelView/ModelView.styled.tsx | 8 +- src/features/ModelView/ModelView.tsx | 14 +- src/hooks/useAccessToken.tsx | 30 +- src/hooks/useAnalogueModels.tsx | 70 -- src/index.tsx | 42 +- src/models/schema.d.ts | 966 ------------------ src/models/types.d.ts | 5 - src/pages/About/About.tsx | 8 +- src/pages/Api/Api.tsx | 10 +- src/pages/Browse/Browse.styled.tsx | 6 +- src/pages/Browse/Browse.tsx | 68 +- src/pages/InvalidURL/InvalidURL.tsx | 12 +- src/pages/Layout.tsx | 27 + .../Compute/ComputeObject/ComputeObject.tsx | 4 +- .../ComputeVariogram.styled.tsx | 14 +- .../ComputeVariogram/ComputeVariogram.tsx | 10 +- src/pages/ModelPages/Model/Model.styled.tsx | 8 +- src/pages/ModelPages/Model/Model.tsx | 25 +- src/pages/ModelPages/Results/Results.tsx | 4 +- src/pages/NoAccess/NoAccess.tsx | 12 +- src/reportWebVitals.ts | 18 +- src/router.tsx | 32 +- src/setupTests.ts | 4 +- src/tokens/spacings.ts | 6 +- src/tokens/theme.ts | 12 +- tsconfig.json | 2 +- yarn.lock | 690 ++++++------- 158 files changed, 3046 insertions(+), 2041 deletions(-) create mode 100644 src/api/generated/core/ApiError.ts create mode 100644 src/api/generated/core/ApiRequestOptions.ts create mode 100644 src/api/generated/core/ApiResult.ts create mode 100644 src/api/generated/core/CancelablePromise.ts create mode 100644 src/api/generated/core/OpenAPI.ts create mode 100644 src/api/generated/core/request.ts create mode 100644 src/api/generated/index.ts create mode 100644 src/api/generated/models/AddAnalogueModelParameterCommandForm.ts create mode 100644 src/api/generated/models/AddAnalogueModelParameterCommandResponse.ts create mode 100644 src/api/generated/models/AddAnalogueModelParameterDto.ts create mode 100644 src/api/generated/models/AddParameterDto.ts create mode 100644 src/api/generated/models/AnalogueList.ts create mode 100644 src/api/generated/models/AnalogueModelDetail.ts create mode 100644 src/api/generated/models/AnalogueModelList.ts create mode 100644 src/api/generated/models/AnalogueModelSourceType.ts create mode 100644 src/api/generated/models/ConvertAnalogueModelCommand.ts create mode 100644 src/api/generated/models/ConvertAnalogueModelCommandResponse.ts create mode 100644 src/api/generated/models/ConvertAnalogueModelDto.ts create mode 100644 src/api/generated/models/CreateAnalogueCommand.ts create mode 100644 src/api/generated/models/CreateAnalogueCommandResponse.ts create mode 100644 src/api/generated/models/CreateAnalogueDto.ts create mode 100644 src/api/generated/models/CreateAnalogueModelCommand.ts create mode 100644 src/api/generated/models/CreateAnalogueModelCommandResponse.ts create mode 100644 src/api/generated/models/CreateAnalogueModelDto.ts create mode 100644 src/api/generated/models/CreateParameterCommand.ts create mode 100644 src/api/generated/models/ErrorResponse.ts create mode 100644 src/api/generated/models/EstimateChannelCommand.ts create mode 100644 src/api/generated/models/GetAnalogueListQueryResponse.ts create mode 100644 src/api/generated/models/GetAnalogueModelListQueryResponse.ts create mode 100644 src/api/generated/models/GetAnalogueModelQueryResponse.ts create mode 100644 src/api/generated/models/GetCurrentJobStatusCommandResponse.ts create mode 100644 src/api/generated/models/GetCurrentJobStatusDto.ts create mode 100644 src/api/generated/models/GetCurrentJobStatusListCommand.ts create mode 100644 src/api/generated/models/GetJobDetailQueryResponse.ts create mode 100644 src/api/generated/models/GetJobListQueryResponse.ts create mode 100644 src/api/generated/models/GetParameterDetailQueryResponse.ts create mode 100644 src/api/generated/models/GetParameterListQueryResponse.ts create mode 100644 src/api/generated/models/GetUploadDetailQueryResponse.ts create mode 100644 src/api/generated/models/GetUploadListQueryResponse.ts create mode 100644 src/api/generated/models/JobDetail.ts create mode 100644 src/api/generated/models/JobList.ts create mode 100644 src/api/generated/models/JobListUploadsDto.ts create mode 100644 src/api/generated/models/JobStatus.ts create mode 100644 src/api/generated/models/JobType.ts create mode 100644 src/api/generated/models/Operation.ts create mode 100644 src/api/generated/models/OperationType.ts create mode 100644 src/api/generated/models/ParameterDetail.ts create mode 100644 src/api/generated/models/ParameterList.ts create mode 100644 src/api/generated/models/PatchAnalogueModelCommandResponse.ts create mode 100644 src/api/generated/models/PatchAnalogueModelDto.ts create mode 100644 src/api/generated/models/PatchParameterCommandResponse.ts create mode 100644 src/api/generated/models/PatchParameterDto.ts create mode 100644 src/api/generated/models/UpdateAnalogueModelCommandBody.ts create mode 100644 src/api/generated/models/UpdateAnalogueModelCommandResponse.ts create mode 100644 src/api/generated/models/UpdateAnalogueModelDto.ts create mode 100644 src/api/generated/models/UpdateJobStatusCommand.ts create mode 100644 src/api/generated/models/UpdateParameterCommandBody.ts create mode 100644 src/api/generated/models/UpdateParameterCommandResponse.ts create mode 100644 src/api/generated/models/UpdateParameterDto.ts create mode 100644 src/api/generated/models/UploadAnalogueModelCommandResponse.ts create mode 100644 src/api/generated/models/UploadAnalogueModelDto.ts create mode 100644 src/api/generated/models/UploadDetail.ts create mode 100644 src/api/generated/models/UploadFileCategory.ts create mode 100644 src/api/generated/models/UploadFileType.ts create mode 100644 src/api/generated/models/UploadList.ts create mode 100644 src/api/generated/models/UploadStatus.ts create mode 100644 src/api/generated/services/AnalogueModelParametersService.ts create mode 100644 src/api/generated/services/AnalogueModelsService.ts create mode 100644 src/api/generated/services/AnaloguesService.ts create mode 100644 src/api/generated/services/JobsService.ts create mode 100644 src/api/generated/services/ParametersService.ts create mode 100644 src/api/generated/services/UploadsService.ts delete mode 100644 src/auth/apiClient.ts delete mode 100644 src/context/ApiClientProvider.tsx delete mode 100644 src/hooks/useAnalogueModels.tsx delete mode 100644 src/models/schema.d.ts delete mode 100644 src/models/types.d.ts create mode 100644 src/pages/Layout.tsx diff --git a/.eslintrc.json b/.eslintrc.json index b0d42baf..558f1506 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,7 +17,9 @@ ], "parser": "@typescript-eslint/parser", "parserOptions": { - "ecmaFeatures": { "jsx": true }, + "ecmaFeatures": { + "jsx": true + }, "ecmaVersion": "latest", "sourceType": "module" }, @@ -33,17 +35,32 @@ "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "error", "react/boolean-prop-naming": "warn", - "prettier/prettier": "error", + "prettier/prettier": "warn", "@tanstack/query/exhaustive-deps": "error", "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/ban-ts-comment": [ "error", - { "ts-ignore": { "descriptionFormat": "^ because .+$" } } + { + "ts-ignore": { + "descriptionFormat": "^ because .+$" + } + } + ], + "camelcase": [ + "error", + { + "ignoreImports": true + } ], - "camelcase": ["error", { "ignoreImports": true }], "max-depth": "warn", "max-lines": "warn", - "max-lines-per-function": ["warn", { "max": 60, "skipBlankLines": true }], + "max-lines-per-function": [ + "warn", + { + "max": 60, + "skipBlankLines": true + } + ], "no-console": "warn", "no-duplicate-imports": "error", "no-self-compare": "error", @@ -51,8 +68,17 @@ "prefer-const": "error", "sort-imports": [ "error", - { "ignoreCase": true, "ignoreDeclarationSort": true } + { + "ignoreCase": true, + "ignoreDeclarationSort": true + } ], - "spaced-comment": ["warn", "always", { "markers": ["/"] }] + "spaced-comment": [ + "warn", + "always", + { + "markers": ["/"] + } + ] } } diff --git a/.github/workflows/on-tag.yaml b/.github/workflows/on-tag.yaml index 51e01fd6..d82aac3d 100644 --- a/.github/workflows/on-tag.yaml +++ b/.github/workflows/on-tag.yaml @@ -29,4 +29,4 @@ jobs: needs: [set-tag-ref] uses: ./.github/workflows/publish.yaml with: - IMAGE_TAG: ${{ needs.set-tag-ref.outputs.tag-ref }} \ No newline at end of file + IMAGE_TAG: ${{ needs.set-tag-ref.outputs.tag-ref }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 43e2f9ee..9de9497d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,4 +22,3 @@ jobs: - name: Publish Container Image run: IMAGE_TAG=${{inputs.IMAGE_TAG}} docker compose push - diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e6b1b34e..bdf318e0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -name: "CI" +name: 'CI' on: push: @@ -27,4 +27,4 @@ jobs: yarn test yarn build env: - CI: false \ No newline at end of file + CI: false diff --git a/.prettierrc.js b/.prettierrc.js index 57aed2bf..a0a06fd5 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,8 +1,8 @@ // default config module.exports = { - trailingComma: 'es5', + trailingComma: 'all', tabWidth: 2, - semi: false, + semi: true, singleQuote: true, endOfLine: 'auto', -} \ No newline at end of file +}; diff --git a/README.md b/README.md index 323abeb7..008181d6 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,25 @@ # PEPM-UI + User Interface for **Parameter Estimation from Process Models**. ## :zap: Getting started + Clone the repository. Make sure you have [Node](https://nodejs.org/en/) and [yarn](https://yarnpkg.com/) installed. In the root folder of the application, run available scripts: ### Install dependencies Install third-party packages for local development. + ```sh yarn install ``` ### Run locally + > **Note:** To run successfully, local overrides of `.env` must be defined, for instance in `.env.local`, or [see what other .env files can be used.](https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used) This will by default run the application in your standard web browser at `localhost:3000`. + ```sh yarn start ``` @@ -24,6 +29,7 @@ yarn start > **Note:** This step requires a `.env.development.local` file, with local overrides of `.env` for your local environment. Build and run docker image for local development. + ```sh docker compose -f compose-dev.yaml up --build ``` @@ -31,9 +37,11 @@ docker compose -f compose-dev.yaml up --build ### Husky pre-commit We use [husky](https://typicode.github.io/husky/#/) to automatically run tests, linting and formatting on commits, but you can also use the command below to run pre-commit manually. + ```sh yarn pre-commit ``` ## Authentication -Authentication is implemented with [Microsoft Oauth2 for React](https://learn.microsoft.com/en-us/azure/active-directory/develop/single-page-app-tutorial-01-register-app) \ No newline at end of file + +Authentication is implemented with [Microsoft Oauth2 for React](https://learn.microsoft.com/en-us/azure/active-directory/develop/single-page-app-tutorial-01-register-app) diff --git a/package.json b/package.json index 02047e8f..cc30b246 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@equinor/eds-icons": "^0.19.1", "@equinor/eds-tokens": "^0.9.0", "@tanstack/react-query": "^4.32.6", + "@tanstack/react-query-devtools": "^4.36.1", "@tanstack/react-table": "^8.9.1", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^13.0.0", @@ -20,6 +21,7 @@ "@types/react-dom": "^18.0.0", "axios": "^1.5.0", "openapi-fetch": "^0.7.2", + "openapi-typescript-codegen": "^0.25.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.8.0", @@ -35,6 +37,7 @@ "test:ts": "tsc --noEmit", "eject": "react-scripts eject", "lint": "eslint --fix --ext .ts,.tsx .", + "prettier:fix": "prettier . --write", "prepare": "husky install", "pre-commit": "yarn test --watchAll=false && yarn lint-staged", "generate-schema:radix": "npx openapi-typescript https://api-pepm-dev.radix.equinor.com/swagger/v1/swagger.yaml -o src/models/schema.d.ts" @@ -67,4 +70,4 @@ "openapi-typescript": "^6.3.9", "prettier": "^2.8.2" } -} +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 171bf0d7..1bafa9c6 100644 --- a/public/index.html +++ b/public/index.html @@ -2,13 +2,19 @@ - + - + PEPM diff --git a/radixconfig.yaml b/radixconfig.yaml index d7358957..b1f19dce 100644 --- a/radixconfig.yaml +++ b/radixconfig.yaml @@ -18,11 +18,11 @@ spec: - name: http port: 3000 variables: - REACT_APP_AAD_TENANT_ID: "" - REACT_APP_AAD_CLIENT_ID: "" - REACT_APP_AAD_REDIRECT_URI: "" - REACT_APP_BACKEND_URL: "" - REACT_APP_BACKEND_API_SCOPE: "" + REACT_APP_AAD_TENANT_ID: '' + REACT_APP_AAD_CLIENT_ID: '' + REACT_APP_AAD_REDIRECT_URI: '' + REACT_APP_BACKEND_URL: '' + REACT_APP_BACKEND_API_SCOPE: '' environmentConfig: - environment: dev - environment: test @@ -42,30 +42,30 @@ spec: - environment: dev imageTagName: latest variables: - ASPNETCORE_ENVIRONMENT: "Development" + ASPNETCORE_ENVIRONMENT: 'Development' - environment: test imageTagName: latest variables: - ASPNETCORE_ENVIRONMENT: "Test" + ASPNETCORE_ENVIRONMENT: 'Test' - environment: prod imageTagName: latest variables: - ASPNETCORE_ENVIRONMENT: "Production" + ASPNETCORE_ENVIRONMENT: 'Production' jobs: - name: pepm-nrresqml image: ghcr.io/equinor/pepm-worker-api/pepm-nrresqml:latest schedulerPort: 8090 resources: requests: - memory: "2048Mi" - cpu: "1000m" + memory: '2048Mi' + cpu: '1000m' limits: - memory: "4096Mi" - cpu: "2000m" + memory: '4096Mi' + cpu: '2000m' payload: path: /app/args variables: - MODELS_PATH: "/mnt/azure-storage/models" + MODELS_PATH: '/mnt/azure-storage/models' environmentConfig: - environment: dev volumeMounts: @@ -86,15 +86,15 @@ spec: schedulerPort: 8090 resources: requests: - memory: "4096Mi" - cpu: "1000m" + memory: '4096Mi' + cpu: '1000m' limits: - memory: "8192Mi" - cpu: "2000m" + memory: '8192Mi' + cpu: '2000m' payload: path: /app/args variables: - MODELS_PATH: "/mnt/azure-storage/models" + MODELS_PATH: '/mnt/azure-storage/models' environmentConfig: - environment: dev volumeMounts: @@ -113,4 +113,4 @@ spec: privateImageHubs: ghcr.io: username: hakoneriksson - email: hake@equinor.com \ No newline at end of file + email: hake@equinor.com diff --git a/src/App.styled.tsx b/src/App.styled.tsx index fc9d37ba..1be2fe45 100644 --- a/src/App.styled.tsx +++ b/src/App.styled.tsx @@ -1,7 +1,7 @@ -import styled from 'styled-components' +import styled from 'styled-components'; const StyledOutletWrapper = styled.section` height: calc(100% - 128px); overflow: scroll; -` -export { StyledOutletWrapper as OutletWrapper } +`; +export { StyledOutletWrapper as OutletWrapper }; diff --git a/src/App.test.tsx b/src/App.test.tsx index 1e96f51c..a0d135cb 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,6 +1,6 @@ -import { render } from '@testing-library/react' -import { App } from './App' +import { render } from '@testing-library/react'; +import { App } from './App'; test('renders without crashing', () => { - render() -}) + render(); +}); diff --git a/src/App.tsx b/src/App.tsx index c7153fbe..966b588e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,31 +1,25 @@ import { AuthenticatedTemplate, UnauthenticatedTemplate, - useMsal, -} from '@azure/msal-react' -import { Outlet } from 'react-router-dom' -import * as Styled from './App.styled' -import AppBar from './features/AppBar/AppBar' -import { Footer } from './features/Footer/Footer' -import { NoAccess } from './pages/NoAccess/NoAccess' + useMsalAuthentication, +} from '@azure/msal-react'; +import { InteractionType } from '@azure/msal-browser'; +import { Layout } from './pages/Layout'; +import { OpenAPI } from './api/generated'; +import { apiConfig } from './auth/authConfig'; export function App() { - const { instance } = useMsal() + useMsalAuthentication(InteractionType.Redirect); + OpenAPI.BASE = apiConfig.baseUrl; return ( <> - - - - -