From 6bbe4665586eb005ea2f07186a6658b67c366c95 Mon Sep 17 00:00:00 2001 From: Lord Andre Groseth Date: Thu, 11 Jul 2024 12:59:03 +0200 Subject: [PATCH 01/34] REFACTOR: Block to div Co-authored-by: Jeremiah Uy --- apps/frontend/src/AppRoutes.tsx | 4 +-- .../AaregAvtale/AAregHjemmelDataText.tsx | 10 +++--- .../AaregAvtale/AaregAvtaleTable.tsx | 24 ++++++------- apps/frontend/src/components/Header.tsx | 16 ++++----- .../src/components/audit/AuditComponents.tsx | 16 ++++----- .../src/components/audit/AuditRecentTable.tsx | 22 ++++++------ .../src/components/audit/AuditView.tsx | 36 +++++++++---------- apps/frontend/src/main.js | 20 +++++------ 8 files changed, 72 insertions(+), 76 deletions(-) diff --git a/apps/frontend/src/AppRoutes.tsx b/apps/frontend/src/AppRoutes.tsx index 5c7df723b..9ec41ec00 100644 --- a/apps/frontend/src/AppRoutes.tsx +++ b/apps/frontend/src/AppRoutes.tsx @@ -109,12 +109,12 @@ const AppRoutes = (): JSX.Element => ( ) const NotFound = () => ( - +
Oida 404! Fant ikke den siden der nei - {useLocation().pathname} 404 Finner ikke den siden - +
) const processUrl = async (id: string) => { diff --git a/apps/frontend/src/components/AaregAvtale/AAregHjemmelDataText.tsx b/apps/frontend/src/components/AaregAvtale/AAregHjemmelDataText.tsx index 43738919d..e82c0ccf3 100644 --- a/apps/frontend/src/components/AaregAvtale/AAregHjemmelDataText.tsx +++ b/apps/frontend/src/components/AaregAvtale/AAregHjemmelDataText.tsx @@ -14,7 +14,7 @@ export const AAregHjemmelDataText = (props: AAregHjemmelDataTextProps) => { const processorList = rawData.filter((d) => d.match('Behandlingsgrunnlag:')).map((a) => a.replace('Behandlingsgrunnlag:', '')) return ( - +
{ {purposeList.map((a, i) => ( - {a} +
{a}
- {authoryList[i]} +
{authoryList[i]}
- {processorList[i]} +
{processorList[i]}
))}
- +
) } export default AAregHjemmelDataText diff --git a/apps/frontend/src/components/AaregAvtale/AaregAvtaleTable.tsx b/apps/frontend/src/components/AaregAvtale/AaregAvtaleTable.tsx index 58f21233e..bcb13d30f 100644 --- a/apps/frontend/src/components/AaregAvtale/AaregAvtaleTable.tsx +++ b/apps/frontend/src/components/AaregAvtale/AaregAvtaleTable.tsx @@ -18,14 +18,13 @@ type AaregAvtaleTableProps = { aaregAvtaler: AaregAvtale[] } -const marginBottom = '1rem' const marginTop = '2rem' const CustomPanelLabel = ({ text }: { text: any }) => { return ( - +
{text} - +
) } @@ -77,7 +76,7 @@ export const AaregAvtaleTable = (props: AaregAvtaleTableProps) => { +
{expanded ? : } @@ -85,7 +84,7 @@ export const AaregAvtaleTable = (props: AaregAvtaleTableProps) => { {a.virksomhet} - (Avtalenummer-{a.avtalenummer.replace('AVT-', '')}) - +
} overrides={{ ToggleIcon: { @@ -103,12 +102,9 @@ export const AaregAvtaleTable = (props: AaregAvtaleTableProps) => { }, }} > - - +
@@ -130,14 +126,14 @@ export const AaregAvtaleTable = (props: AaregAvtaleTableProps) => { - - +
+
) })} - +
( @@ -165,7 +161,7 @@ export const AaregAvtaleTable = (props: AaregAvtaleTableProps) => { onPageChange={(a) => setPage(a.nextPage)} labels={{ nextButton: 'Neste', preposition: 'av', prevButton: 'Forrige' }} /> - +
) } diff --git a/apps/frontend/src/components/Header.tsx b/apps/frontend/src/components/Header.tsx index e4aca8eeb..4c59490cd 100644 --- a/apps/frontend/src/components/Header.tsx +++ b/apps/frontend/src/components/Header.tsx @@ -29,17 +29,17 @@ const LoggedInHeader = () => { return ( +
Navn: {user.getName()} Grupper: {user.getGroupsHumanReadable().join(', ')} - +
Logg ut - - +
+
} > {newestAudit?.action !== AuditAction.DELETE && ( 'Vis'}> - +
- +
)} 'Lukk'}> - +
- +
-
-
+ + {auditLog && auditLog.audits.map((audit, index) => { const time = moment(audit.time) return ( - - - +
+
+
- - +
+
( @@ -127,8 +127,8 @@ export const AuditView = (props: AuditViewProps) => {
- - +
+
{ ;(sel.name === 'id' || sel.name?.endsWith('Id')) && viewId(sel.value as string) }} /> -
+ ) })} diff --git a/apps/frontend/src/main.js b/apps/frontend/src/main.js index d210e7b93..823efb107 100644 --- a/apps/frontend/src/main.js +++ b/apps/frontend/src/main.js @@ -26,19 +26,19 @@ const Main = (props) => { - - +
+
- - - +
+
+
- - +
+
- - - +
+
+
From de202b286a4faeaedfb2dd1eee0087315eb2cbb1 Mon Sep 17 00:00:00 2001 From: Lord Andre Groseth Date: Thu, 11 Jul 2024 13:46:34 +0200 Subject: [PATCH 02/34] REFACTOR: Block to div Co-authored-by: Jeremiah Uy --- apps/frontend/src/components/Charts/Chart.tsx | 44 +++++++++---------- .../src/components/audit/LastEvents.tsx | 32 +++++++------- .../components/audit/RecentEditsByUser.tsx | 14 +++--- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/apps/frontend/src/components/Charts/Chart.tsx b/apps/frontend/src/components/Charts/Chart.tsx index b71d47035..beb5cd324 100644 --- a/apps/frontend/src/components/Charts/Chart.tsx +++ b/apps/frontend/src/components/Charts/Chart.tsx @@ -108,13 +108,13 @@ export const Chart = (props: ChartProps) => { return ( <> {headerTitle && ( - +
{headerTitle} - +
)} - +
- +
) } @@ -135,7 +135,7 @@ const Visualization = (props: VisualizationProps) => { let noChartData = !data.length || !data.reduce((p, c) => p + c.size, 0) return ( - +
{ }} >
setHover(-1)}> - +
{!noChartData && ( - +
{type === 'pie' && } {type === 'bar' && } - +
)} - +
{chartTitle} {!noChartData && data.map((d, idx) => (
setHover(idx)} onClick={d.onClick}> - +
- +
{d.size} - +
{!hidePercent && ( - +
{(d.fraction * 100).toFixed(0)}% - +
)} - {d.label} -
+
{d.label}
+
))} - {noChartData && Ingen} - - + {noChartData &&
Ingen
} +
+
- +
- +
- +
) } diff --git a/apps/frontend/src/components/audit/LastEvents.tsx b/apps/frontend/src/components/audit/LastEvents.tsx index 54c64b858..be7cc55ef 100644 --- a/apps/frontend/src/components/audit/LastEvents.tsx +++ b/apps/frontend/src/components/audit/LastEvents.tsx @@ -25,26 +25,26 @@ export const LastEvents = () => { }, [table, action]) const content = events?.content.map((event, index) => ( - +
- - +
+
{event.name} - - +
+
{moment(event.time).fromNow()} - - +
+
- +
)) return ( - - +
+
Siste hendelser - +
Hendelsestype { }, }} /> - - - +
+
+
setTable(args.activeKey as ObjectType)}> {[ObjectType.PROCESS, ObjectType.INFORMATION_TYPE, ObjectType.DISCLOSURE, ObjectType.DOCUMENT].map((tableName) => ( @@ -71,7 +71,7 @@ export const LastEvents = () => { ))} - - +
+
) } diff --git a/apps/frontend/src/components/audit/RecentEditsByUser.tsx b/apps/frontend/src/components/audit/RecentEditsByUser.tsx index 3f34ed41f..643d8fc39 100644 --- a/apps/frontend/src/components/audit/RecentEditsByUser.tsx +++ b/apps/frontend/src/components/audit/RecentEditsByUser.tsx @@ -19,21 +19,21 @@ export const RecentEditsByUser = () => { }, []) return ( - +
Mine siste endringer {recentEdits .slice(0, 10) .sort((a, b) => moment(b.time).valueOf() - moment(a.time).valueOf()) .map((ps) => ( - - {ps.process.name} - +
+
{ps.process.name}
+
{moment(ps.time).fromNow()} - - +
+
))} - +
) } From 41b5c3582097f8e00f3e50cc6a0edf70dbab22e9 Mon Sep 17 00:00:00 2001 From: Lord Andre Groseth Date: Thu, 11 Jul 2024 14:47:26 +0200 Subject: [PATCH 03/34] REFACTOR: Block to div Co-authored-by: Jeremiah Uy --- apps/frontend/src/components/Charts/Chart.tsx | 2 +- apps/frontend/src/components/Charts/Charts.tsx | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/frontend/src/components/Charts/Chart.tsx b/apps/frontend/src/components/Charts/Chart.tsx index beb5cd324..e7517e0de 100644 --- a/apps/frontend/src/components/Charts/Chart.tsx +++ b/apps/frontend/src/components/Charts/Chart.tsx @@ -160,7 +160,7 @@ const Visualization = (props: VisualizationProps) => { {!noChartData && data.map((d, idx) => (
setHover(idx)} onClick={d.onClick}> -
+
{d.size} diff --git a/apps/frontend/src/components/Charts/Charts.tsx b/apps/frontend/src/components/Charts/Charts.tsx index fe05063d3..cff07d328 100644 --- a/apps/frontend/src/components/Charts/Charts.tsx +++ b/apps/frontend/src/components/Charts/Charts.tsx @@ -39,15 +39,22 @@ const Charts = (props: ChartsProps) => { } const all = chartData as AllDashCount + const chartCardStyle='' + {/* marginTop: theme.sizing.scale600, + width: ['95%', '45%', '30%', '30%'], + backgroundColor: 'white', + $style: { + boxShadow: '0px 0px 6px 3px rgba(0,0,0,0.08)', + padding: '15px', */} return ( - - +
+
Ref. til PVK ikke angitt: {chartData.dpiaReferenceMissing} - +
{ - +
) } From 4a8553f502c816ad83e282534d16ba588a7e53ae Mon Sep 17 00:00:00 2001 From: Lord Andre Groseth Date: Thu, 11 Jul 2024 14:54:22 +0200 Subject: [PATCH 04/34] REFACTOR: Block to div Co-authored-by: Jeremiah Uy --- .../frontend/src/components/Charts/Charts.tsx | 73 +++++++++---------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/apps/frontend/src/components/Charts/Charts.tsx b/apps/frontend/src/components/Charts/Charts.tsx index cff07d328..e8616f2c5 100644 --- a/apps/frontend/src/components/Charts/Charts.tsx +++ b/apps/frontend/src/components/Charts/Charts.tsx @@ -1,16 +1,14 @@ -import * as React from 'react' +import { Card } from 'baseui/card' +import { ParagraphLarge, ParagraphMedium } from 'baseui/typography' import { useNavigate } from 'react-router-dom' -import { Block } from 'baseui/block' -import { cardShadow, chartCardProps } from '../common/Style' import { AllDashCount, DepartmentDashCount, ProcessField, ProcessState, ProcessStatusFilter, ProductAreaDashCount } from '../../constants' -import TriChart from './TriChart' -import { Chart } from './Chart' +import { Section } from '../../pages/ProcessPage' import { clickOnPieChartSlice } from '../../util/dashboard' import { chartColor } from '../../util/theme' -import { ParagraphLarge, ParagraphMedium } from 'baseui/typography' import RouteLink from '../common/RouteLink' -import { Section } from '../../pages/ProcessPage' -import { Card } from 'baseui/card' +import { cardShadow } from '../common/Style' +import { Chart } from './Chart' +import TriChart from './TriChart' const chartSize = 80 @@ -39,46 +37,40 @@ const Charts = (props: ChartsProps) => { } const all = chartData as AllDashCount - const chartCardStyle='' + const chartCardStyle = 'mt-4 w-[95%] sm:w-[45%] md:w-[30%] lg:w-[30%] bg-white p-4 shadow-[0px_0px_6px_3px_rgba(0,0,0,0.08)]' - {/* marginTop: theme.sizing.scale600, - width: ['95%', '45%', '30%', '30%'], - backgroundColor: 'white', - $style: { - boxShadow: '0px 0px 6px 3px rgba(0,0,0,0.08)', - padding: '15px', */} return (
-
- +
+ Ref. til PVK ikke angitt: {chartData.dpiaReferenceMissing}
- +
- +
- +
- +
- +
{ }, ]} /> - +
- +
Behandlinger med ufullstendig lagringstid: {chartData.retentionDataIncomplete} - +
- +
- +
{all.disclosures !== undefined && ( - +
{ Utleveringer: {all.disclosures} - +
)} - +
- +
- Behandlinger hvor NAV er felles behandlingsansvarlig med ekstern part: {chartData.commonExternalProcessResponsible} + Behandlinger hvor NAV er felles behandlingsansvarlig med ekstern part:{' '} + {chartData.commonExternalProcessResponsible} Behandlinger hvor NAV er databehandler: {chartData.dpProcesses} - +
- +
) } From 78ae60867f0db99c5a8dc8f0c83520b158148d02 Mon Sep 17 00:00:00 2001 From: Lord Andre Groseth Date: Mon, 15 Jul 2024 10:29:44 +0200 Subject: [PATCH 05/34] REFACTOR: Block to div and implement tailwind Co-authored-by: Jeremiah Uy --- .../CodeList/CodeListStyledTable.tsx | 4 +-- .../src/components/CodeList/CodeListUsage.tsx | 12 +++---- .../CodeList/ModalCreateCodeList.tsx | 34 ++++++------------- 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/apps/frontend/src/components/CodeList/CodeListStyledTable.tsx b/apps/frontend/src/components/CodeList/CodeListStyledTable.tsx index cb2e1b26e..e5f58bf9d 100644 --- a/apps/frontend/src/components/CodeList/CodeListStyledTable.tsx +++ b/apps/frontend/src/components/CodeList/CodeListStyledTable.tsx @@ -86,7 +86,7 @@ const CodeListTable = ({ tableData, refresh }: TableCodelistProps) => { {row.shortName} {row.description} - +
- +
))} diff --git a/apps/frontend/src/components/CodeList/CodeListUsage.tsx b/apps/frontend/src/components/CodeList/CodeListUsage.tsx index b382ecf78..625712ef0 100644 --- a/apps/frontend/src/components/CodeList/CodeListUsage.tsx +++ b/apps/frontend/src/components/CodeList/CodeListUsage.tsx @@ -155,18 +155,18 @@ export const Usage = (props: { usage?: CodeUsage; refresh: () => void }) => { } return ( - - +
+
Bruk {!!usage?.inUse && ( )} - +
{showReplace && usage && usage.listName && ( - +
} /> - +
- +
Short name: } /> - +
- +
Description: