Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/navikt/etterlevelse into …
Browse files Browse the repository at this point in the history
…ds-varsel
  • Loading branch information
PaulMartinKokseter committed Oct 30, 2023
2 parents b920e88 + fe805fd commit f072fa9
Show file tree
Hide file tree
Showing 19 changed files with 344 additions and 392 deletions.
2 changes: 1 addition & 1 deletion apps/backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<flexmark.version>0.64.8</flexmark.version>

<microsoft-graph.version>5.75.0</microsoft-graph.version>
<msal4j.version>1.13.10</msal4j.version>
<msal4j.version>1.14.0</msal4j.version>

<!-- transitive versions -->
<commons-compress.version>1.24.0</commons-compress.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ public Map<String, BkatProcess> getProcessesById(Collection<String> ids) {
}

public List<BkatProcess> findProcesses(String search) {
if (search.toLowerCase().matches("b[0-9]+(.*)")) {
return processSearchCache.get(search.substring(1));
} else {
return processSearchCache.get(search);
}
return processSearchCache.get(search);
}

public List<BkatProcess> getProcessesForTeam(String teamId) {
Expand Down
18 changes: 9 additions & 9 deletions apps/frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { intl } from '../util/intl/intl'
import { user } from '../services/User'
import { writeLog } from '../api/LogApi'
import MainSearch from './search/MainSearch'
import { informationIcon, logo, warningAlert } from './Images'
import { informationIcon, warningAlert } from './Images'
import { Portrait } from './common/Portrait'
import SkipToContent from './common/SkipToContent/SkipToContent'
import { AlertType, Melding, MeldingStatus, MeldingType } from '../constants'
Expand Down Expand Up @@ -37,7 +37,7 @@ const LoggedInHeader = () => {

const roller = (
<div>
<Button size={'xsmall'} variant="tertiary" onClick={() => setViewRoller(!viewRoller)} icon={viewRoller ? <ChevronUpIcon /> : <ChevronDownIcon />}>
<Button size={'xsmall'} variant="tertiary" onClick={() => setViewRoller(!viewRoller)} icon={viewRoller ? <ChevronUpIcon area-label="" aria-hidden /> : <ChevronDownIcon area-label="" aria-hidden />}>
Endre aktive roller
</Button>
<div className={`mt-2 ${viewRoller ? 'block' : 'hidden'}`}>
Expand Down Expand Up @@ -71,18 +71,18 @@ const LoggedInHeader = () => {

return (
<div className="flex items-center justify-center">
<Menu pages={[[{ label: <UserInfo /> }], kravPages, adminPages, [{ label: roller }]]} title={user.getIdent()} icon={<PersonIcon />} />
<Menu pages={[[{ label: <UserInfo /> }], kravPages, adminPages, [{ label: roller }]]} title={user.getIdent()} icon={<PersonIcon area-label="" aria-hidden/>} />

<div className="w-3" />

<Menu
icon={<MenuHamburgerIcon />}
icon={<MenuHamburgerIcon area-label="" aria-hidden/>}
pages={[
[{ label: 'Forsiden', href: '/', icon: <HouseIcon /> }],
[{ label: 'Dokumentere etterlevelse', href: '/dokumentasjoner', icon: <DocPencilIcon /> }],
[{ label: 'Status i organisasjonen', href: '//metabase.intern.nav.no/dashboard/116-dashboard-for-etterlevelse', icon: <BarChartIcon /> }],
[{ label: 'Forstå kravene', href: '/tema', icon: <ReceiptIcon /> }],
[{ label: 'Mer om etterlevelse i NAV', href: '/omstottetiletterlevelse', icon: <InformationIcon /> }],
[{ label: 'Forsiden', href: '/', icon: <HouseIcon area-label="" aria-hidden/> }],
[{ label: 'Dokumentere etterlevelse', href: '/dokumentasjoner', icon: <DocPencilIcon area-label="" aria-hidden /> }],
[{ label: 'Status i organisasjonen', href: '//metabase.intern.nav.no/dashboard/116-dashboard-for-etterlevelse', icon: <BarChartIcon area-label="" aria-hidden /> }],
[{ label: 'Forstå kravene', href: '/tema', icon: <ReceiptIcon area-label="" aria-hidden/> }],
[{ label: 'Mer om etterlevelse i NAV', href: '/omstottetiletterlevelse', icon: <InformationIcon area-label="" aria-hidden /> }],
]}
title={'Meny'}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const CodeListPage = () => {
})}
</Select>
{listname && (
<Button icon={<PlusIcon />} variant="tertiary" onClick={() => setCreateCodeListModal(!createCodeListModal)}>
<Button icon={<PlusIcon area-label="" aria-hidden />} variant="tertiary" onClick={() => setCreateCodeListModal(!createCodeListModal)}>
Opprett ny kode
</Button>
)}
Expand Down
3 changes: 0 additions & 3 deletions apps/frontend/src/components/admin/audit/AuditButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faHistory } from '@fortawesome/free-solid-svg-icons'
import { user } from '../../../services/User'
import RouteLink from '../../common/RouteLink'
import { intl } from '../../../util/intl/intl'
import { Button, ButtonProps, Link, Tooltip } from '@navikt/ds-react'
import { ClockDashedIcon } from '@navikt/aksel-icons'
Expand Down
44 changes: 16 additions & 28 deletions apps/frontend/src/components/admin/audit/AuditComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
import { Block, BlockProps } from 'baseui/block'
import { LabelMedium, LabelSmall } from 'baseui/typography'
import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { PLACEMENT, StatefulTooltip } from 'baseui/tooltip'
import { faInfoCircle, faMinusCircle, faPlusCircle } from '@fortawesome/free-solid-svg-icons'
import { theme } from '../../../util'
import { intl } from '../../../util/intl/intl'
import { AuditAction } from './AuditTypes'
import { Label, Tooltip } from '@navikt/ds-react'
import { InformationSquareIcon, MinusCircleIcon, PlusCircleIcon } from '@navikt/aksel-icons'

const labelBlockProps: BlockProps = {
display: ['flex', 'block', 'block', 'flex'],
width: ['20%', '100%', '100%', '20%'],
alignSelf: 'flex-start',
}

export const AuditLabel = (props: { label: string; children: any }) => {
return (
<Block display="flex">
<Block {...labelBlockProps}>
<LabelMedium>{props.label}</LabelMedium>
</Block>
<Block>
<LabelSmall>{props.children}</LabelSmall>
</Block>
</Block>
<div className="flex">
<div className="flex w-1/5 self-center">
<Label>{props.label}</Label>
</div>
{props.children}
</div>
)
}

export const AuditActionIcon = (props: { action: AuditAction; withText?: boolean }) => {
const icon = (props.action === AuditAction.CREATE && { icon: faPlusCircle, color: theme.colors.positive300 }) ||
(props.action === AuditAction.UPDATE && { icon: faInfoCircle, color: theme.colors.warning300 }) ||
(props.action === AuditAction.DELETE && { icon: faMinusCircle, color: theme.colors.negative400 }) || { icon: undefined, color: undefined }
const icon = (props.action === AuditAction.CREATE && <PlusCircleIcon area-label="" aria-hidden color="#007C2E" />) ||
(props.action === AuditAction.UPDATE && <InformationSquareIcon area-label="" aria-hidden color="#C77300" />) ||
(props.action === AuditAction.DELETE && <MinusCircleIcon area-label="" aria-hidden color="#C30000" />) || <div />

return (
<StatefulTooltip content={() => intl[props.action]} placement={PLACEMENT.top}>
<Block marginRight=".5rem" display="inline">
<FontAwesomeIcon icon={icon.icon!} color={icon.color} /> {props.withText && intl[props.action]}
</Block>
</StatefulTooltip>
<Tooltip content={intl[props.action]} placement="top">
<div className="mr-2 flex justify-center items-center">
{icon} {props.withText && intl[props.action]}
</div>
</Tooltip>
)
}
28 changes: 13 additions & 15 deletions apps/frontend/src/components/admin/audit/AuditPage.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { Block } from 'baseui/block'
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import _ from 'lodash'
import { HeadingXXLarge, ParagraphMedium } from 'baseui/typography'
import { AuditLog } from './AuditTypes'
import { getAuditLog } from '../../../api/AuditApi'
import { AuditView } from './AuditView'
import { AuditRecentTable } from './AuditRecentTable'
import { AuditLabel } from './AuditComponents'
import { useDebouncedState } from '../../../util/hooks'
import { intl } from '../../../util/intl/intl'
import CustomInput from '../../common/CustomizedInput'
import { responsivePaddingSmall, responsiveWidthSmall } from '../../../util/theme'
import { Helmet } from 'react-helmet'
import { BodyLong, Heading, TextField } from '@navikt/ds-react'

const format = (id: string) => _.trim(id, '"')

Expand All @@ -25,7 +22,7 @@ export const AuditPage = () => {
const [idSearch, setIdInput, idInput] = useDebouncedState(params.id || '', 400)

const lookupVersion = (id?: string) => {
;(async () => {
; (async () => {
if (id === auditLog?.id) {
return
}
Expand Down Expand Up @@ -53,27 +50,28 @@ export const AuditPage = () => {
useEffect(() => lookupVersion(idSearch), [idSearch])

return (
<Block width={responsiveWidthSmall} paddingLeft={responsivePaddingSmall} paddingRight={responsivePaddingSmall} overrides={{ Block: { props: { role: 'main' } } }}>
<div role="main" id="content" className="px-8 w-full max-w-7xl">
<Helmet>
<meta charSet="utf-8" />
<title>Versjonering</title>
</Helmet>
<HeadingXXLarge>{intl.audit}</HeadingXXLarge>
<Block marginBottom="1rem">
<Heading size="xlarge">{intl.audit}</Heading>
<div className="my-4">
<AuditLabel label={intl.searchId}>
<CustomInput
size="compact"
<TextField
label={intl.searchId}
hideLabel
value={idInput}
overrides={{ Input: { style: { width: '300px' } } }}
placeholder={intl.id}
onChange={(e) => setIdInput(format((e.target as HTMLInputElement).value))}
className="w-72"
/>
</AuditLabel>
</Block>
</div>

{error && <ParagraphMedium>{_.escape(error)}</ParagraphMedium>}
{error && <BodyLong>{_.escape(error)}</BodyLong>}
{idInput && <AuditView auditLog={auditLog} auditId={params.auditId} loading={loading} viewId={lookupVersion} />}
<AuditRecentTable show={!idInput} />
</Block>
</div>
)
}
Loading

0 comments on commit f072fa9

Please sign in to comment.