Skip to content

Commit

Permalink
Merge branch 'master' into feature/endre-slett-attr-med-master-pdl
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran authored May 7, 2024
2 parents be9ea24 + a8b79bc commit 9e6f02f
Show file tree
Hide file tree
Showing 79 changed files with 2,988 additions and 3,694 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app.organisasjon-tilgang-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: ./.github/workflows/common.workflow.frontend.yml
with:
working-directory: "apps/organisasjon-tilgang-frontend"
deploy-tag: "#deploy-test-organisasjon-tilgang-frontend"
deploy-tag: "#deploy-organisasjon-tilgang-frontend"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.dokarkiv-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
cluster: "dev-fss"
working-directory: "proxies/dokarkiv-proxy"
deploy-tag: "#deploy-proxy"
deploy-tag: "#deploy-dokarkiv-proxy"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.pdl-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
cluster: "dev-fss"
working-directory: "proxies/pdl-proxy"
deploy-tag: "#deploy-proxy"
deploy-tag: "#deploy-pdl-proxy"
permissions:
contents: read
id-token: write
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-backend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
- application: testnav-batch-bestilling-service
- application: testnav-dollystatus
- application: testnav-oversikt-frontend
- application: testnav-tenor-search-service
outbound:
rules:
- application: generer-navn-service
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-backend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
- application: testnav-dollystatus
- application: testnav-helsepersonell-service
- application: testnav-oversikt-frontend
- application: testnav-tenor-search-service
- application: etterlatte-testdata
namespace: etterlatte
outbound:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public static void main(String[] args) {

SpringApplication.run(DollyBackendApplicationStarter.class, args);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import ma.glasnost.orika.MapperFacade;
import no.nav.dolly.bestilling.service.GjenopprettIdentService;
import no.nav.dolly.bestilling.service.OppdaterPersonService;
import no.nav.testnav.libs.dto.dolly.v1.FinnesDTO;
import no.nav.dolly.domain.dto.TestidentDTO;
import no.nav.dolly.domain.jpa.Bestilling;
import no.nav.dolly.domain.resultset.RsDollyUpdateRequest;
Expand Down Expand Up @@ -142,6 +143,13 @@ public Boolean finnesTestident(@PathVariable String ident) {
return identService.exists(ident);
}

@Operation(description = "Sjekk om testpersoner finnes i Dolly")
@GetMapping("/finnes")
public FinnesDTO finnesTestident(@RequestParam List<String> identer) {

return identService.exists(identer);
}

@Operation(description = "Send ønsket testperson til miljø")
@Transactional
@PostMapping("/ident/{ident}/ordre")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import no.nav.dolly.repository.IdentRepository;
import no.nav.dolly.repository.IdentRepository.GruppeBestillingIdent;
import no.nav.dolly.repository.TransaksjonMappingRepository;
import no.nav.testnav.libs.dto.dolly.v1.FinnesDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
Expand All @@ -17,6 +18,7 @@

import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import static java.lang.String.format;

Expand Down Expand Up @@ -130,4 +132,21 @@ public List<Testident> getTestidenterByGruppe(Long id) {

return identRepository.findByTestgruppe(id);
}

public FinnesDTO exists(List<String> identer) {

var finnes = FinnesDTO.builder()
.iBruk(identRepository.findByIdentIn(identer).stream()
.map(Testident::getIdent)
.collect(Collectors.toMap(ident -> ident, ident -> true)))
.build();

identer.forEach(ident -> {
if (!finnes.getIBruk().containsKey(ident)) {
finnes.getIBruk().put(ident, false);
}
});

return finnes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ private Function<PredicateSpec, Buildable<Route>> createRoute(String segment, St
.filters(filter, addUserJwtHeaderFilter())
).uri(host);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export const Steg3 = () => {
const importTestnorge = opts.is.importTestnorge

const erOrganisasjon = formMethods.getValues('organisasjon')
const erQ2MiljoeAvhengig =
formMethods.watch('pdldata.person.fullmakt') ||
formMethods.watch('pdldata.person.falskIdentitet') ||
formMethods.watch('pdldata.person.falskIdentitet') ||
formMethods.watch('pdldata.person.utenlandskIdentifikasjonsnummer') ||
formMethods.watch('pdldata.person.kontaktinformasjonForDoedsbo')

const bankIdBruker = currentBruker?.brukertype === 'BANKID'

Expand All @@ -50,9 +44,9 @@ export const Steg3 = () => {
if (loading) {
return []
} else if (bankIdBruker) {
return tilgjengeligMiljoe ? [tilgjengeligMiljoe] : ['q1']
return tilgjengeligMiljoe ? tilgjengeligMiljoe.split(',') : ['q1']
}
return erQ2MiljoeAvhengig ? ['q2'] : []
return []
}

const erQ1EllerQ2MiljoeAvhengig = (values: any) => {
Expand All @@ -73,8 +67,6 @@ export const Steg3 = () => {
formMethods.setValue('environments', ['q1', 'q2'])
} else if (formMethods.getValues()?.sykemelding) {
formMethods.setValue('environments', ['q1'])
} else if (erQ2MiljoeAvhengig) {
formMethods.setValue('environments', alleredeValgtMiljoe())
} else if (!formMethods.getValues()?.environments) {
formMethods.setValue('environments', [])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const AaregVisning = ({
})

const filteredData =
tilgjengeligMiljoe && arbeidsforhold?.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && arbeidsforhold?.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

const manglerArbeidsforholdData = sjekkManglerAaregData(arbeidsforhold)
const arbeidsforholdFeil =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import { useBestilteMiljoer } from '@/utils/hooks/useBestilling'
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary'
import { Alert } from '@navikt/ds-react'
import { MiljoTabs } from '@/components/ui/miljoTabs/MiljoTabs'
import {useNavEnheter} from "@/utils/hooks/useNorg2";
import {usePensjonVedtak} from "@/utils/hooks/usePensjon";
import { useNavEnheter } from '@/utils/hooks/useNorg2'
import { usePensjonVedtak } from '@/utils/hooks/usePensjon'

export const sjekkManglerApData = (apData) => {
return apData?.length < 1 || apData?.every((miljoData) => !miljoData.data)
}

const DataVisning = ({ data, miljo }) => {

const { navEnheter } = useNavEnheter()
const navEnhetLabel = navEnheter?.find((enhet) => enhet.value === data?.navEnhetId?.toString())
?.label
const navEnhetLabel = navEnheter?.find(
(enhet) => enhet.value === data?.navEnhetId?.toString(),
)?.label

const { vedtakData } = usePensjonVedtak(data?.fnr, miljo)

Expand Down Expand Up @@ -61,7 +61,7 @@ export const AlderspensjonVisning = ({ data, loading, bestillingIdListe, tilgjen
const forsteMiljo = data.find((miljoData) => miljoData?.data)?.miljo

const filteredData =
tilgjengeligMiljoe && data.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && data.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

return (
<ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const ArenaVisning = ({ data, ident, bestillingIdListe, loading, tilgjeng
})

const filteredData =
tilgjengeligMiljoe && data?.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && data?.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

const forsteMiljo = data?.find((miljoData) => miljoData?.data)?.miljo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default ({ data, bestillingIdListe, loading, tilgjengeligMiljoe }: Form)
const mergedData = mergeData()

const filteredData =
tilgjengeligMiljoe && mergedData?.filter((item) => item?.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && mergedData?.filter((item) => tilgjengeligMiljoe.includes(item?.miljo))

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getSortedData = (data) => {
const datoB = new Date(b.startdato)

return datoA < datoB ? 1 : datoA > datoB ? -1 : 0
})
})
: data
}

Expand Down Expand Up @@ -47,7 +47,7 @@ export const InstVisning = ({ data, loading, bestillingIdListe, tilgjengeligMilj
})

const filteredData =
tilgjengeligMiljoe && sortedData.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && sortedData.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

return (
<ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const PensjonVisning = ({ data, loading, bestillingIdListe, tilgjengeligM
const forsteMiljo = data.find((miljoData) => miljoData?.data?.inntekter?.length > 0)?.miljo

const filteredData =
tilgjengeligMiljoe && data.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && data.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

return (
<ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const SykemeldingVisning = ({
const forsteMiljo = data?.find((miljoData) => miljoData?.data)?.miljo

const filteredData =
tilgjengeligMiljoe && data?.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && data?.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

return (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const TpVisning = ({ data, loading, bestillingIdListe, tilgjengeligMiljoe
const forsteMiljo = data.find((miljoData) => miljoData?.data?.length > 0)?.miljo

const filteredData =
tilgjengeligMiljoe && data.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && data.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

return (
<ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ const BarnetilleggInntektVisning = ({ data, tittel }) => {

const DataVisning = ({ data, miljo }) => {
const { navEnheter } = useNavEnheter()
const navEnhetLabel = navEnheter?.find((enhet) => enhet.value === data?.navEnhetId?.toString())
?.label
const navEnhetLabel = navEnheter?.find(
(enhet) => enhet.value === data?.navEnhetId?.toString(),
)?.label

const { vedtakData } = usePensjonVedtak(data?.fnr, miljo)

Expand Down Expand Up @@ -111,7 +112,7 @@ export const UforetrygdVisning = ({ data, loading, bestillingIdListe, tilgjengel
const forsteMiljo = data.find((miljoData) => miljoData?.data)?.miljo

const filteredData =
tilgjengeligMiljoe && data.filter((item) => item.miljo === tilgjengeligMiljoe)
tilgjengeligMiljoe && data.filter((item) => tilgjengeligMiljoe.includes(item.miljo))

return (
<ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ const StyledH3 = styled.h3`
align-items: center;
`

const bankIdQ1 = [
{
id: 'q1',
label: 'Q1',
},
]
const bankIdQ1 = {
id: 'q1',
label: 'Q1',
}

const bankIdQ2 = [
{
id: 'q2',
label: 'Q2',
},
]
const bankIdQ2 = {
id: 'q2',
label: 'Q2',
}

const miljoeavhengig = [
'aareg',
Expand All @@ -54,13 +50,7 @@ const erMiljouavhengig = (bestilling) => {
return miljoeNotRequired
}

export const MiljoVelger = ({
bestillingsdata,
heading,
bankIdBruker,
orgTilgang,
alleredeValgtMiljoe,
}) => {
export const MiljoVelger = ({ bestillingsdata, heading, bankIdBruker, alleredeValgtMiljoe }) => {
const { dollyEnvironments, loading } = useDollyEnvironments()
const formMethods = useFormContext()

Expand All @@ -70,9 +60,19 @@ export const MiljoVelger = ({

const filterEnvironments = (miljoer, erBankIdBruker) => {
if (erBankIdBruker) {
const tilgjengeligMiljo = orgTilgang?.miljoe
if (tilgjengeligMiljo === 'q1') return bankIdQ1
return bankIdQ2
var bankMiljoer = []
for (var i = 0; i < alleredeValgtMiljoe.length; i++) {
switch (alleredeValgtMiljoe[i]) {
case 'q1':
bankMiljoer.push(bankIdQ1)
break
case 'q2':
bankMiljoer.push(bankIdQ2)
break
}
}

return bankMiljoer
}
return miljoer.Q.filter((env: any) => env.id !== 'qx')
}
Expand Down
Loading

0 comments on commit 9e6f02f

Please sign in to comment.