From 49adc3c46ebfe14b7b31489f9a1018dd9a9bd707 Mon Sep 17 00:00:00 2001 From: Frank Niessink Date: Tue, 7 Jan 2025 10:41:35 +0100 Subject: [PATCH] Migrate SUIR components to MUI. Closes #9796. --- components/frontend/package-lock.json | 189 +--------- components/frontend/package.json | 3 - components/frontend/src/App.css | 20 +- components/frontend/src/App.js | 12 +- components/frontend/src/AppUI.js | 98 +++-- components/frontend/src/PageContent.js | 35 +- components/frontend/src/PageContent.test.js | 4 +- components/frontend/src/app_ui_settings.js | 26 -- components/frontend/src/context/DarkMode.js | 3 - .../frontend/src/context/Permissions.js | 7 +- .../frontend/src/context/Permissions.test.js | 24 ++ .../src/dashboard/CardDashboard.test.js | 13 +- .../frontend/src/dashboard/ExportCard.css | 35 -- .../frontend/src/dashboard/ExportCard.js | 79 ---- .../src/dashboard/FilterCardWithTable.js | 6 +- .../frontend/src/dashboard/IssuesCard.js | 23 +- .../frontend/src/dashboard/LegendCard.js | 9 +- .../src/dashboard/MetricSummaryCard.js | 9 +- .../dashboard/MetricsRequiringActionCard.js | 34 +- .../frontend/src/dashboard/PageHeader.js | 43 +++ ...{ExportCard.test.js => PageHeader.test.js} | 28 +- components/frontend/src/errorMessage.js | 26 -- components/frontend/src/fields/Comment.js | 21 -- .../frontend/src/fields/Comment.test.js | 8 - .../frontend/src/fields/CommentField.js | 23 ++ components/frontend/src/fields/DateInput.css | 16 - components/frontend/src/fields/DateInput.js | 60 ---- .../frontend/src/fields/DateInput.test.js | 69 ---- components/frontend/src/fields/Input.js | 54 --- components/frontend/src/fields/Input.test.js | 70 ---- .../frontend/src/fields/IntegerInput.js | 102 ------ .../frontend/src/fields/IntegerInput.test.js | 121 ------- .../src/fields/MultipleChoiceField.js | 64 ++++ .../src/fields/MultipleChoiceInput.js | 84 ----- .../src/fields/MultipleChoiceInput.test.js | 81 ----- .../frontend/src/fields/PasswordInput.js | 26 -- .../frontend/src/fields/PasswordInput.test.js | 17 - .../frontend/src/fields/ReadOnlyInput.js | 34 -- .../frontend/src/fields/ReadOnlyInput.test.js | 34 -- .../frontend/src/fields/SingleChoiceInput.js | 70 ---- .../src/fields/SingleChoiceInput.test.js | 107 ------ components/frontend/src/fields/StringInput.js | 78 ---- .../frontend/src/fields/StringInput.test.js | 95 ----- components/frontend/src/fields/TextField.js | 99 ++++++ components/frontend/src/fields/TextInput.js | 76 ---- .../frontend/src/fields/TextInput.test.js | 76 ---- .../frontend/src/header_footer/Footer.css | 11 - .../frontend/src/header_footer/Footer.js | 9 +- .../src/header_footer/buttons/HomeButton.js | 2 +- components/frontend/src/index.js | 1 - components/frontend/src/issue/IssueStatus.js | 141 +++++--- .../frontend/src/issue/IssueStatus.test.js | 48 +-- components/frontend/src/issue/IssuesRows.js | 131 +++---- .../frontend/src/issue/IssuesRows.test.js | 8 +- .../src/measurement/MeasurementSources.js | 3 +- .../measurement/MeasurementSources.test.js | 3 +- .../src/measurement/MeasurementTarget.js | 11 +- .../src/measurement/MeasurementValue.js | 97 ++--- .../src/measurement/MeasurementValue.test.js | 3 - .../frontend/src/measurement/Overrun.js | 115 +++--- .../frontend/src/measurement/SourceStatus.js | 22 +- .../frontend/src/measurement/StatusIcon.js | 4 +- .../frontend/src/measurement/TimeLeft.js | 14 +- .../src/measurement/TrendSparkline.js | 7 +- .../src/measurement/TrendSparkline.test.js | 10 - .../metric/MetricConfigurationParameters.js | 246 +++++++------ .../MetricConfigurationParameters.test.js | 4 +- .../src/metric/MetricDebtParameters.js | 160 ++++----- .../src/metric/MetricDebtParameters.test.js | 69 ++-- .../frontend/src/metric/MetricDetails.js | 152 ++++---- .../frontend/src/metric/MetricDetails.test.js | 59 +-- components/frontend/src/metric/MetricType.js | 38 +- .../frontend/src/metric/MetricType.test.js | 23 +- .../frontend/src/metric/MetricTypeHeader.js | 24 -- .../src/metric/MetricTypeHeader.test.js | 27 -- components/frontend/src/metric/Target.js | 314 ++-------------- components/frontend/src/metric/Target.test.js | 266 +------------- .../frontend/src/metric/TargetVisualiser.js | 225 ++++++++++++ .../src/metric/TargetVisualiser.test.js | 250 +++++++++++++ components/frontend/src/metric/TrendGraph.js | 47 +-- .../frontend/src/metric/TrendGraph.test.js | 23 +- components/frontend/src/metric/status.js | 9 - .../notification/NotificationDestinations.js | 102 +++--- .../NotificationDestinations.test.js | 2 +- .../frontend/src/report/IssueTracker.js | 336 +++++++++--------- .../frontend/src/report/IssueTracker.test.js | 48 +-- components/frontend/src/report/Report.js | 50 +-- .../frontend/src/report/ReportErrorMessage.js | 33 -- components/frontend/src/report/ReportTitle.js | 221 ++++++------ .../frontend/src/report/ReportTitle.test.js | 76 ++-- .../frontend/src/report/ReportsOverview.js | 19 +- .../src/report/ReportsOverview.test.js | 2 +- .../src/report/ReportsOverviewTitle.js | 164 +++++---- .../src/report/ReportsOverviewTitle.test.js | 6 +- .../src/semantic_ui_react_wrappers.js | 10 - .../src/semantic_ui_react_wrappers/Card.css | 11 - .../src/semantic_ui_react_wrappers/Card.js | 17 - .../semantic_ui_react_wrappers/Dropdown.css | 3 - .../semantic_ui_react_wrappers/Dropdown.js | 16 - .../src/semantic_ui_react_wrappers/Form.css | 59 --- .../src/semantic_ui_react_wrappers/Form.js | 23 -- .../semantic_ui_react_wrappers/Form.test.js | 28 -- .../src/semantic_ui_react_wrappers/Header.css | 3 - .../src/semantic_ui_react_wrappers/Header.js | 13 - .../src/semantic_ui_react_wrappers/Label.css | 15 - .../src/semantic_ui_react_wrappers/Label.js | 13 - .../src/semantic_ui_react_wrappers/Message.js | 14 - .../src/semantic_ui_react_wrappers/Popup.css | 14 - .../src/semantic_ui_react_wrappers/Popup.js | 12 - .../semantic_ui_react_wrappers/Segment.css | 12 - .../src/semantic_ui_react_wrappers/Segment.js | 10 - .../src/semantic_ui_react_wrappers/Tab.css | 3 - .../src/semantic_ui_react_wrappers/Tab.js | 17 - .../src/semantic_ui_react_wrappers/Table.css | 20 -- .../src/semantic_ui_react_wrappers/Table.js | 17 - .../semantic_ui_react_wrappers/dark_mode.js | 8 - .../dark_mode.test.js | 15 - components/frontend/src/sharedPropTypes.js | 2 + components/frontend/src/source/Logo.js | 13 +- components/frontend/src/source/Source.js | 118 +++--- components/frontend/src/source/Source.test.js | 2 +- .../frontend/src/source/SourceEntities.css | 8 - .../frontend/src/source/SourceEntities.js | 102 +++--- .../src/source/SourceEntities.test.js | 2 +- .../frontend/src/source/SourceEntity.css | 43 --- .../frontend/src/source/SourceEntity.js | 28 +- .../frontend/src/source/SourceEntity.test.js | 37 +- .../src/source/SourceEntityDetails.js | 133 +++---- .../src/source/SourceEntityDetails.test.js | 62 ++-- .../frontend/src/source/SourceParameter.js | 207 ++++++----- .../src/source/SourceParameter.test.js | 115 +++--- .../frontend/src/source/SourceParameters.js | 25 +- .../src/source/SourceParameters.test.js | 4 +- components/frontend/src/source/SourceType.js | 55 ++- .../frontend/src/source/SourceType.test.js | 30 +- .../frontend/src/source/SourceTypeHeader.js | 35 -- .../src/source/SourceTypeHeader.test.js | 55 --- components/frontend/src/source/Sources.js | 15 +- .../frontend/src/source/Sources.test.js | 10 +- components/frontend/src/subject/Subject.css | 2 +- components/frontend/src/subject/Subject.js | 6 +- .../frontend/src/subject/SubjectParameters.js | 84 ++--- .../frontend/src/subject/SubjectTable.css | 120 +------ .../frontend/src/subject/SubjectTable.js | 60 ++-- .../frontend/src/subject/SubjectTable.test.js | 7 +- .../frontend/src/subject/SubjectTableBody.js | 6 +- .../src/subject/SubjectTableFooter.js | 14 +- .../src/subject/SubjectTableFooter.test.js | 2 +- .../src/subject/SubjectTableHeader.js | 76 ++-- .../src/subject/SubjectTableHeader.test.js | 12 +- .../frontend/src/subject/SubjectTableRow.js | 75 ++-- .../src/subject/SubjectTableRow.test.js | 6 +- .../frontend/src/subject/SubjectTitle.js | 65 +--- .../frontend/src/subject/SubjectTitle.test.js | 11 +- .../frontend/src/subject/SubjectType.js | 32 +- .../frontend/src/subject/SubjectsButtonRow.js | 2 +- components/frontend/src/theme.js | 136 +++++++ components/frontend/src/utils.js | 5 - components/frontend/src/utils.test.js | 32 -- .../frontend/src/widgets/CommentSegment.js | 9 +- .../frontend/src/widgets/DatePicker.css | 3 - components/frontend/src/widgets/DatePicker.js | 38 -- .../frontend/src/widgets/ErrorMessage.js | 23 ++ components/frontend/src/widgets/Header.js | 18 + .../src/widgets/HeaderWithDetails.css | 9 - .../frontend/src/widgets/HeaderWithDetails.js | 65 ++-- .../src/widgets/HeaderWithDetails.test.js | 10 +- components/frontend/src/widgets/HyperLink.js | 1 + components/frontend/src/widgets/Label.js | 28 ++ .../frontend/src/widgets/LabelWithDate.js | 38 -- .../frontend/src/widgets/LabelWithDropdown.js | 31 -- .../src/widgets/LabelWithDropdown.test.js | 80 ----- .../frontend/src/widgets/LabelWithHelp.js | 27 -- .../src/widgets/LabelWithHelp.test.js | 17 - .../src/widgets/LabelWithHyperLink.js | 21 -- .../src/widgets/LabelWithHyperLink.test.js | 8 - .../frontend/src/widgets/ReadTheDocsLink.js | 7 +- components/frontend/src/widgets/TabPane.css | 14 - components/frontend/src/widgets/TabPane.js | 57 --- .../frontend/src/widgets/TabPane.test.js | 41 --- .../frontend/src/widgets/TableHeaderCell.js | 30 +- .../src/widgets/TableHeaderCell.test.js | 18 +- .../src/widgets/TableRowWithDetails.js | 33 +- .../src/widgets/TableRowWithDetails.test.js | 6 +- components/frontend/src/widgets/Tabs.js | 51 +++ .../frontend/src/widgets/WarningMessage.js | 37 +- .../src/widgets/WarningMessage.test.js | 6 +- components/frontend/src/widgets/icons.js | 2 +- components/frontend/src/widgets/toast.js | 2 +- components/frontend/src/widgets/toast.test.js | 8 +- tests/application_tests/src/test_report.py | 6 +- 191 files changed, 3275 insertions(+), 5522 deletions(-) delete mode 100644 components/frontend/src/context/DarkMode.js delete mode 100644 components/frontend/src/dashboard/ExportCard.css delete mode 100644 components/frontend/src/dashboard/ExportCard.js create mode 100644 components/frontend/src/dashboard/PageHeader.js rename components/frontend/src/dashboard/{ExportCard.test.js => PageHeader.test.js} (65%) delete mode 100644 components/frontend/src/errorMessage.js delete mode 100644 components/frontend/src/fields/Comment.js delete mode 100644 components/frontend/src/fields/Comment.test.js create mode 100644 components/frontend/src/fields/CommentField.js delete mode 100644 components/frontend/src/fields/DateInput.css delete mode 100644 components/frontend/src/fields/DateInput.js delete mode 100644 components/frontend/src/fields/DateInput.test.js delete mode 100644 components/frontend/src/fields/Input.js delete mode 100644 components/frontend/src/fields/Input.test.js delete mode 100644 components/frontend/src/fields/IntegerInput.js delete mode 100644 components/frontend/src/fields/IntegerInput.test.js create mode 100644 components/frontend/src/fields/MultipleChoiceField.js delete mode 100644 components/frontend/src/fields/MultipleChoiceInput.js delete mode 100644 components/frontend/src/fields/MultipleChoiceInput.test.js delete mode 100644 components/frontend/src/fields/PasswordInput.js delete mode 100644 components/frontend/src/fields/PasswordInput.test.js delete mode 100644 components/frontend/src/fields/ReadOnlyInput.js delete mode 100644 components/frontend/src/fields/ReadOnlyInput.test.js delete mode 100644 components/frontend/src/fields/SingleChoiceInput.js delete mode 100644 components/frontend/src/fields/SingleChoiceInput.test.js delete mode 100644 components/frontend/src/fields/StringInput.js delete mode 100644 components/frontend/src/fields/StringInput.test.js create mode 100644 components/frontend/src/fields/TextField.js delete mode 100644 components/frontend/src/fields/TextInput.js delete mode 100644 components/frontend/src/fields/TextInput.test.js delete mode 100644 components/frontend/src/header_footer/Footer.css delete mode 100644 components/frontend/src/metric/MetricTypeHeader.js delete mode 100644 components/frontend/src/metric/MetricTypeHeader.test.js create mode 100644 components/frontend/src/metric/TargetVisualiser.js create mode 100644 components/frontend/src/metric/TargetVisualiser.test.js delete mode 100644 components/frontend/src/report/ReportErrorMessage.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Card.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Card.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Dropdown.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Dropdown.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Form.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Form.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Form.test.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Header.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Header.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Label.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Label.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Message.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Popup.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Popup.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Segment.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Segment.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Tab.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Tab.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Table.css delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/Table.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/dark_mode.js delete mode 100644 components/frontend/src/semantic_ui_react_wrappers/dark_mode.test.js delete mode 100644 components/frontend/src/source/SourceEntity.css delete mode 100644 components/frontend/src/source/SourceTypeHeader.js delete mode 100644 components/frontend/src/source/SourceTypeHeader.test.js create mode 100644 components/frontend/src/theme.js delete mode 100644 components/frontend/src/widgets/DatePicker.css delete mode 100644 components/frontend/src/widgets/DatePicker.js create mode 100644 components/frontend/src/widgets/ErrorMessage.js create mode 100644 components/frontend/src/widgets/Header.js delete mode 100644 components/frontend/src/widgets/HeaderWithDetails.css create mode 100644 components/frontend/src/widgets/Label.js delete mode 100644 components/frontend/src/widgets/LabelWithDate.js delete mode 100644 components/frontend/src/widgets/LabelWithDropdown.js delete mode 100644 components/frontend/src/widgets/LabelWithDropdown.test.js delete mode 100644 components/frontend/src/widgets/LabelWithHelp.js delete mode 100644 components/frontend/src/widgets/LabelWithHelp.test.js delete mode 100644 components/frontend/src/widgets/LabelWithHyperLink.js delete mode 100644 components/frontend/src/widgets/LabelWithHyperLink.test.js delete mode 100644 components/frontend/src/widgets/TabPane.css delete mode 100644 components/frontend/src/widgets/TabPane.js delete mode 100644 components/frontend/src/widgets/TabPane.test.js create mode 100644 components/frontend/src/widgets/Tabs.js diff --git a/components/frontend/package-lock.json b/components/frontend/package-lock.json index 439ad7d235..5a35f43f2b 100644 --- a/components/frontend/package-lock.json +++ b/components/frontend/package-lock.json @@ -16,18 +16,15 @@ "@mui/x-date-pickers": "^7.23.6", "crypto-js": "^4.2.0", "dayjs": "^1.11.13", - "fomantic-ui-css": "^2.9.3", "history": "^5.3.0", "prop-types": "^15.8.1", "react": "^18.3.1", - "react-datepicker": "^7.6.0", "react-dom": "^18.3.1", "react-grid-layout": "^1.5.0", "react-hash-link": "1.0.2", "react-is": "^18.3.1", "react-timeago": "^7.2.0", "react-toastify": "^11.0.2", - "semantic-ui-react": "^2.1.5", "victory": "^37.3.6" }, "devDependencies": { @@ -2486,21 +2483,6 @@ "@floating-ui/utils": "^0.2.8" } }, - "node_modules/@floating-ui/react": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.3.tgz", - "integrity": "sha512-CLHnes3ixIFFKVQDdICjel8muhFLOBdQH7fgtHNPY8UbCNqbeKZ262G7K66lGQOUQWWnYocf7ZbUsLJgGfsLHg==", - "license": "MIT", - "dependencies": { - "@floating-ui/react-dom": "^2.1.2", - "@floating-ui/utils": "^0.2.9", - "tabbable": "^6.0.0" - }, - "peerDependencies": { - "react": ">=17.0.0", - "react-dom": ">=17.0.0" - } - }, "node_modules/@floating-ui/react-dom": { "version": "2.1.2", "license": "MIT", @@ -2513,42 +2495,7 @@ } }, "node_modules/@floating-ui/utils": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.9.tgz", - "integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==", - "license": "MIT" - }, - "node_modules/@fluentui/react-component-event-listener": { - "version": "0.63.1", - "resolved": "https://registry.npmjs.org/@fluentui/react-component-event-listener/-/react-component-event-listener-0.63.1.tgz", - "integrity": "sha512-gSMdOh6tI3IJKZFqxfQwbTpskpME0CvxdxGM2tdglmf6ZPVDi0L4+KKIm+2dN8nzb8Ya1A8ZT+Ddq0KmZtwVQg==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.10.4" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17 || ^18", - "react-dom": "^16.8.0 || ^17 || ^18" - } - }, - "node_modules/@fluentui/react-component-ref": { - "version": "0.63.1", - "resolved": "https://registry.npmjs.org/@fluentui/react-component-ref/-/react-component-ref-0.63.1.tgz", - "integrity": "sha512-8MkXX4+R3i80msdbD4rFpEB4WWq2UDvGwG386g3ckIWbekdvN9z2kWAd9OXhRGqB7QeOsoAGWocp6gAMCivRlw==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.10.4", - "react-is": "^16.6.3" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17 || ^18", - "react-dom": "^16.8.0 || ^17 || ^18" - } - }, - "node_modules/@fluentui/react-component-ref/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "version": "0.2.8", "license": "MIT" }, "node_modules/@humanfs/core": { @@ -3708,20 +3655,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@semantic-ui-react/event-stack": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@semantic-ui-react/event-stack/-/event-stack-3.1.3.tgz", - "integrity": "sha512-FdTmJyWvJaYinHrKRsMLDrz4tTMGdFfds299Qory53hBugiDvGC0tEJf+cHsi5igDwWb/CLOgOiChInHwq8URQ==", - "license": "MIT", - "dependencies": { - "exenv": "^1.2.2", - "prop-types": "^15.6.2" - }, - "peerDependencies": { - "react": "^16.0.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/@sinclair/typebox": { "version": "0.24.51", "dev": true, @@ -6907,6 +6840,8 @@ "node_modules/date-fns": { "version": "3.6.0", "license": "MIT", + "optional": true, + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/kossnocorp" @@ -8248,12 +8183,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exenv": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz", - "integrity": "sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==", - "license": "BSD-3-Clause" - }, "node_modules/exit": { "version": "0.1.2", "dev": true, @@ -8601,15 +8530,6 @@ } } }, - "node_modules/fomantic-ui-css": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/fomantic-ui-css/-/fomantic-ui-css-2.9.3.tgz", - "integrity": "sha512-7bM6p3QRpfZFofg7Fd3crzox2E/nBsPyyWDN+N4lnTjNMxgKltSaXJTfhLoK5xBA+wEoNtcmm6w6FQ5Drj+27A==", - "license": "MIT", - "dependencies": { - "jquery": "^3.4.0" - } - }, "node_modules/for-each": { "version": "0.3.3", "dev": true, @@ -11012,12 +10932,6 @@ "jiti": "bin/jiti.js" } }, - "node_modules/jquery": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", - "license": "MIT" - }, "node_modules/js-tokens": { "version": "4.0.0", "license": "MIT" @@ -11223,12 +11137,6 @@ "node": ">=4.0" } }, - "node_modules/keyboard-key": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/keyboard-key/-/keyboard-key-1.1.0.tgz", - "integrity": "sha512-qkBzPTi3rlAKvX7k0/ub44sqOfXeLc/jcnGGmj5c7BJpU8eDrEVPyhCvNYAaoubbsLm9uGWwQJO1ytQK1a9/dQ==", - "license": "MIT" - }, "node_modules/keyv": { "version": "4.5.4", "dev": true, @@ -11376,12 +11284,6 @@ "version": "4.17.21", "license": "MIT" }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "license": "MIT" - }, "node_modules/lodash.debounce": { "version": "4.0.8", "dev": true, @@ -13821,21 +13723,6 @@ "node": ">=14" } }, - "node_modules/react-datepicker": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-7.6.0.tgz", - "integrity": "sha512-9cQH6Z/qa4LrGhzdc3XoHbhrxNcMi9MKjZmYgF/1MNNaJwvdSjv3Xd+jjvrEEbKEf71ZgCA3n7fQbdwd70qCRw==", - "license": "MIT", - "dependencies": { - "@floating-ui/react": "^0.27.0", - "clsx": "^2.1.1", - "date-fns": "^3.6.0" - }, - "peerDependencies": { - "react": "^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc", - "react-dom": "^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc" - } - }, "node_modules/react-dev-utils": { "version": "12.0.1", "dev": true, @@ -13957,21 +13844,6 @@ "react": "*" } }, - "node_modules/react-popper": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz", - "integrity": "sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==", - "license": "MIT", - "dependencies": { - "react-fast-compare": "^3.0.1", - "warning": "^4.0.2" - }, - "peerDependencies": { - "@popperjs/core": "^2.0.0", - "react": "^16.8.0 || ^17 || ^18", - "react-dom": "^16.8.0 || ^17 || ^18" - } - }, "node_modules/react-refresh": { "version": "0.11.0", "dev": true, @@ -15263,40 +15135,6 @@ "node": ">=10" } }, - "node_modules/semantic-ui-react": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/semantic-ui-react/-/semantic-ui-react-2.1.5.tgz", - "integrity": "sha512-nIqmmUNpFHfovEb+RI2w3E2/maZQutd8UIWyRjf1SLse+XF51hI559xbz/sLN3O6RpLjr/echLOOXwKCirPy3Q==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.10.5", - "@fluentui/react-component-event-listener": "~0.63.0", - "@fluentui/react-component-ref": "~0.63.0", - "@popperjs/core": "^2.6.0", - "@semantic-ui-react/event-stack": "^3.1.3", - "clsx": "^1.1.1", - "keyboard-key": "^1.1.0", - "lodash": "^4.17.21", - "lodash-es": "^4.17.21", - "prop-types": "^15.7.2", - "react-is": "^16.8.6 || ^17.0.0 || ^18.0.0", - "react-popper": "^2.3.0", - "shallowequal": "^1.1.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, - "node_modules/semantic-ui-react/node_modules/clsx": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", - "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/semver": { "version": "6.3.1", "dev": true, @@ -15476,12 +15314,6 @@ "dev": true, "license": "ISC" }, - "node_modules/shallowequal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", - "license": "MIT" - }, "node_modules/shebang-command": { "version": "2.0.0", "dev": true, @@ -16329,12 +16161,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/tabbable": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", - "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", - "license": "MIT" - }, "node_modules/tailwindcss": { "version": "3.4.14", "dev": true, @@ -17573,15 +17399,6 @@ "makeerror": "1.0.12" } }, - "node_modules/warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/watchpack": { "version": "2.4.2", "dev": true, diff --git a/components/frontend/package.json b/components/frontend/package.json index 0dd8aa0499..2e033bff38 100644 --- a/components/frontend/package.json +++ b/components/frontend/package.json @@ -12,18 +12,15 @@ "@mui/x-date-pickers": "^7.23.6", "crypto-js": "^4.2.0", "dayjs": "^1.11.13", - "fomantic-ui-css": "^2.9.3", "history": "^5.3.0", "prop-types": "^15.8.1", "react": "^18.3.1", - "react-datepicker": "^7.6.0", "react-dom": "^18.3.1", "react-grid-layout": "^1.5.0", "react-hash-link": "1.0.2", "react-is": "^18.3.1", "react-timeago": "^7.2.0", "react-toastify": "^11.0.2", - "semantic-ui-react": "^2.1.5", "victory": "^37.3.6" }, "scripts": { diff --git a/components/frontend/src/App.css b/components/frontend/src/App.css index 610c057fed..95ccba6113 100644 --- a/components/frontend/src/App.css +++ b/components/frontend/src/App.css @@ -1,21 +1,3 @@ -.MainContainer { - flex: 1; - margin-top: 6em; - padding-left: 1em; - padding-right: 1em; -} - -@media print { - .MainContainer { - margin-top: 0em; - } -} - html { - scroll-padding-top: 163px; /* height of sticky header */ -} - -:root { - --inverted-menu-background-color: #1b1c1d; - --selection-color: #2185d0; + scroll-padding-top: 176px; /* height of sticky header */ } diff --git a/components/frontend/src/App.js b/components/frontend/src/App.js index 6ee06731d5..db92afcc38 100644 --- a/components/frontend/src/App.js +++ b/components/frontend/src/App.js @@ -1,6 +1,7 @@ import "./App.css" -import { createTheme, ThemeProvider } from "@mui/material/styles" +import { CssBaseline } from "@mui/material" +import { ThemeProvider } from "@mui/material/styles" import { Action } from "history" import history from "history/browser" import { Component } from "react" @@ -11,16 +12,10 @@ import { nr_measurements_api } from "./api/measurement" import { get_report, get_reports_overview } from "./api/report" import { AppUI } from "./AppUI" import { registeredURLSearchParams } from "./hooks/url_search_query" +import { theme } from "./theme" import { isValidDate_YYYYMMDD, toISODateStringInCurrentTZ } from "./utils" import { showConnectionMessage, showMessage } from "./widgets/toast" -const theme = createTheme({ - colorSchemes: { - dark: true, // Add a dark theme (light theme is available by default) - }, - components: { MuiTooltip: { defaultProps: { arrow: true }, styleOverrides: { tooltip: { fontSize: "1em" } } } }, -}) - class App extends Component { constructor(props) { super(props) @@ -245,6 +240,7 @@ class App extends Component { render() { return ( + - - - - + + + } + settings={settings} + setUIMode={setMode} + uiMode={mode} + /> + + + + - } + reports={reports} + reports_overview={reports_overview} settings={settings} - setUIMode={setMode} - uiMode={mode} /> - - - - - - -