-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KAIZEN-0] Sørge for korrekt saksoversikt komponent
- Loading branch information
1 parent
72d237e
commit 8fb532b
Showing
12 changed files
with
471 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/app/personside/infotabs/oversikt/SakerOversiktFactory.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { ReactNode } from 'react'; | ||
import IfFeatureToggleOff from '../../../../components/featureToggle/IfFeatureToggleOff'; | ||
import IfFeatureToggleOn from '../../../../components/featureToggle/IfFeatureToggleOn'; | ||
import { FeatureToggles } from '../../../../components/featureToggle/toggleIDs'; | ||
import SakerOversiktV2 from './SakerOversiktV2'; | ||
import SakerOversikt from './SakerOversikt'; | ||
|
||
interface Props { | ||
setHeaderContent: (content: ReactNode) => void; | ||
} | ||
|
||
function SakerOversiktFactory(props: Props) { | ||
return ( | ||
<> | ||
<IfFeatureToggleOn toggleID={FeatureToggles.BrukSoknadsstatus}> | ||
<SakerOversiktV2 setHeaderContent={props.setHeaderContent} /> | ||
</IfFeatureToggleOn> | ||
<IfFeatureToggleOff toggleID={FeatureToggles.BrukSoknadsstatus}> | ||
<SakerOversikt setHeaderContent={props.setHeaderContent} /> | ||
</IfFeatureToggleOff> | ||
</> | ||
); | ||
} | ||
|
||
export default SakerOversiktFactory; |
35 changes: 35 additions & 0 deletions
35
src/app/personside/infotabs/saksoversikt/SakerFullscreenLenkeV2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { useInfotabsDyplenker } from '../dyplenker'; | ||
import styled from 'styled-components'; | ||
import LenkepanelPersonoversikt from '../../../../utils/LenkepanelPersonoversikt'; | ||
import theme from '../../../../styles/personOversiktTheme'; | ||
import { useHentAlleSakstemaFraResourceV2, useSakstemaURLStateV2 } from './useSakstemaURLState'; | ||
import { aggregertSakstemaV2 } from './utils/saksoversiktUtilsV2'; | ||
|
||
const StyledLenkepanelPersonoversikt = styled(LenkepanelPersonoversikt)` | ||
margin-bottom: ${theme.margin.layout}; | ||
`; | ||
|
||
function reactrouterLink(props: React.AnchorHTMLAttributes<HTMLAnchorElement>) { | ||
const { href, ...rest } = props; | ||
return <Link to={href!} {...rest} target="_blank" />; | ||
} | ||
|
||
function SakerFullscreenLenkeV2() { | ||
const { alleSakstema } = useHentAlleSakstemaFraResourceV2(); | ||
const { valgteSakstemaer, valgtDokument } = useSakstemaURLStateV2(alleSakstema); | ||
const dyplenker = useInfotabsDyplenker(); | ||
const aggregertSak = aggregertSakstemaV2(alleSakstema, valgteSakstemaer); | ||
|
||
return ( | ||
<StyledLenkepanelPersonoversikt | ||
linkCreator={reactrouterLink} | ||
url={dyplenker.saker.link(aggregertSak, valgtDokument, true)} | ||
> | ||
Åpne i fullscreen | ||
</StyledLenkepanelPersonoversikt> | ||
); | ||
} | ||
|
||
export default SakerFullscreenLenkeV2; |
25 changes: 25 additions & 0 deletions
25
src/app/personside/infotabs/saksoversikt/SakerFullscreenProxy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import IfFeatureToggleOn from '../../../../components/featureToggle/IfFeatureToggleOn'; | ||
import { FeatureToggles } from '../../../../components/featureToggle/toggleIDs'; | ||
import IfFeatureToggleOff from '../../../../components/featureToggle/IfFeatureToggleOff'; | ||
import SakerFullscreen from './SakerFullscreen'; | ||
import SakerFullscreenV2 from './SakerFullscreenV2'; | ||
|
||
interface Props { | ||
fnr: string; | ||
} | ||
|
||
function SakerFullscreenProxy(props: Props) { | ||
return ( | ||
<> | ||
<IfFeatureToggleOn toggleID={FeatureToggles.BrukSoknadsstatus}> | ||
<SakerFullscreenV2 fnr={props.fnr} /> | ||
</IfFeatureToggleOn> | ||
<IfFeatureToggleOff toggleID={FeatureToggles.BrukSoknadsstatus}> | ||
<SakerFullscreen fnr={props.fnr} /> | ||
</IfFeatureToggleOff> | ||
</> | ||
); | ||
} | ||
|
||
export default SakerFullscreenProxy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.