Skip to content

Commit

Permalink
fix(details): api/distributions cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lillebo committed Nov 22, 2024
1 parent 05945f7 commit b615879
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ExternalLinkIcon } from '@navikt/aksel-icons';
import Badge from '@fdk-frontend/ui/badge';
import HStack from '@fdk-frontend/ui/hstack';
import VStack from '@fdk-frontend/ui/vstack';
import { BrandDivider } from '@fdk-frontend/ui/divider';
import { Subtext } from '@fdk-frontend/ui/typography';

import styles from './community-tab.module.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ContactDetails from './components/contact-details';
import ContentDetails from './components/content-details';
import LegalDetails from './components/legal-details';
import ConceptDetails from './components/concept-details';
import RelationDetails from './components/relation-details';
// import RelationDetails from './components/relation-details';

import styles from './dataset-details.module.scss';

Expand All @@ -23,7 +23,7 @@ const DatasetDetails = ({ details }: any) => {
const content = sections.find((s: any) => s.sectionTitle === 'Innhold');
const legal = sections.find((s: any) => s.sectionTitle === 'Lovhjemler');
const concept = sections.find((s: any) => s.sectionTitle === 'Begreper brukt i datasett');
const relation = sections.find((s: any) => s.sectionTitle === 'Relasjoner til datasett');
// const relation = sections.find((s: any) => s.sectionTitle === 'Relasjoner til datasett');

return (
<DatasetDetailsContext.Provider value={{ showEmptyRows }}>
Expand Down Expand Up @@ -51,7 +51,7 @@ const DatasetDetails = ({ details }: any) => {
<ContentDetails fields={content.fields} />
<LegalDetails fields={legal.fields} />
<ConceptDetails fields={concept.fields} />
<RelationDetails fields={relation.fields} />
{/*<RelationDetails fields={relation.fields} />*/}
<section className={styles.section}>
<Heading
level={2}
Expand Down
123 changes: 102 additions & 21 deletions apps/data-norge/src/app/components/details/details-page/api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { type Dictionary, type LocaleCodes } from '@fdk-frontend/dictionaries';
import Breadcrumbs from '@fdk-frontend/ui/breadcrumbs';
import Badge from '@fdk-frontend/ui/badge';
import StarButton from '@fdk-frontend/ui/star-button';
import { BrandDivider } from '@fdk-frontend/ui/divider';
import {
Heading,
Button,
Expand Down Expand Up @@ -49,6 +50,42 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
},
];

const relatedDatasets = [
{ name: "Vannverk - transportsystem", publisher: "Mattilsynet", accessLevel: "open" },
{ name: "Grunnboken", publisher: "Kartverket", accessLevel: "open" },
{ name: "Kjøretøyopplysninger", publisher: "Statens vegvesen", accessLevel: "limited" },
// { name: "Merverdiavgiftsregisteret", publisher: "Skatteetaten", accessLevel: "open" },
// { name: "Bemanningsforetak som er godkjent av Arbeidstilsynet", publisher: "Arbeidstilsynet", accessLevel: "open" },
// { name: "Tilda tilsynsrapport", publisher: "Arbeidstilsynet", accessLevel: "open" },
// { name: "Tilda tilsynskoordinering", publisher: "Arbeidstilsynet", accessLevel: "limited" },
// { name: "Tilda trender", publisher: "Arbeidstilsynet", accessLevel: "limited" },
// { name: "Foretaksregisteret", publisher: "Brønnøysundregistrene", accessLevel: "restricted" },
// { name: "Tilda melding til annen myndighet", publisher: "Arbeidstilsynet", accessLevel: "open" },
// { name: "Enhetsregisteret", publisher: "Brønnøysundregistrene", accessLevel: "open" },
// { name: "Folkeregisteret", publisher: "Skatteetaten", accessLevel: "restricted" },
// { name: "Renholdsvirksomheter godkjent av Arbeidstilsynet", publisher: "Arbeidstilsynet", accessLevel: "restricted" },
// { name: "Oppgaveregisteret", publisher: "Brønnøysundregistrene", accessLevel: "open" },
// { name: "Matrikkelen - Adresse", publisher: "Kartverket", accessLevel: "open" },
];

const getColorFromAccessLevel = (accessLevel: any) => {
switch (accessLevel) {
case 'open': return 'success';
case 'limited': return 'warning';
case 'restricted': return 'danger';
default: return 'success';
}
}

const getLabelFromAccessLevel = (accessLevel: any) => {
switch (accessLevel) {
case 'open': return 'Åpne data';
case 'limited': return 'Begrenset tilgang';
case 'restricted': return 'Ikke-allmenn tilgang';
default: return 'Åpne data';
}
}

return (
<div className={styles.detailsPage}>
<Breadcrumbs
Expand All @@ -58,14 +95,14 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
/>
<div className={styles.mainContent}>
<div className={styles.header}>
<Link href='#'>Skatteetaten</Link>
<Link href='#'>Digdir</Link>
<div className={styles.titleContainer}>
<Heading
level={1}
size='lg'
className={styles.title}
>
Inntektsmottakere API
data.altinn.no
</Heading>
<div className={styles.titleToolbar}>
<StarButton
Expand All @@ -79,7 +116,7 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
blink();
}}
>
Ta i bruk
Bruk API
</Button>
</div>
</div>
Expand Down Expand Up @@ -111,39 +148,43 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
</Tab>
</TabList>
<TabContent value='oversikt'>
<article className={styles.article}>
<p>
Tjenesten leverer en liste over inntektsmottakere der arbeidsgiver (opplysningspliktig),
via a-ordningen, har rapportert pensjonsavtale med pensjonsinnretningen som utfører
kallet.
</p>
</article>
<Heading
level={4}
size='xxsmall'
>
Beskrivelse
</Heading>
<div className={styles.box}>
Tjenesten leverer en liste over inntektsmottakere der arbeidsgiver (opplysningspliktig),
via a-ordningen, har rapportert pensjonsavtale med pensjonsinnretningen som utfører
kallet.
</div>
<section className={styles.section}>
<Heading
level={4}
size='xs'
size='xxsmall'
>
Endepunkter
Endepunkter&nbsp;<Badge>2</Badge>
</Heading>
<dl>
<dt>Endepunkt:</dt>
<dd>
<Link href='#'>
https://inntektsmottakere.api.skatteetaten-test.no/v1
<Link href='https://api.data.altinn.no/v1'>
https://api.data.altinn.no/v1
<ExternalLinkIcon />
</Link>
</dd>
<dt>Endepunkt:</dt>
<dt>Endepunktbeskrivelse:</dt>
<dd>
<Link href='#'>
https://inntektsmottakere.api.skatteetaten.no/v1
<Link href='https://api.data.altinn.no/v1/public/metadata/oas/json'>
https://api.data.altinn.no/v1/public/metadata/oas/json
<ExternalLinkIcon />
</Link>
</dd>
<dt>Endepunktbeskrivelse:</dt>
<dt>Dokumentasjon:</dt>
<dd>
<Link href='https://api.swaggerhub.com/apis/skatteetaten/inntektsmottakere-api/1.1.0'>
Gå til spesifikasjon
<Link href='https://docs.data.altinn.no/'>
https://docs.data.altinn.no/
<ExternalLinkIcon />
</Link>
</dd>
Expand All @@ -157,9 +198,49 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
</dd>
</dl>
</section>
<BrandDivider className={styles.divider} />
<section className={styles.section}>
<Heading
level={4}
size='xxsmall'
>
{/*Relaterte datasett&nbsp;<Badge>{relatedDatasets.length}</Badge>*/}
Tilgjengeliggjør datasett
</Heading>
<table className='table'>
<tbody>
{relatedDatasets.map(dataset => (
<tr key={dataset.name}>
<td>
<Link href='/view'>{dataset.name}</Link>
</td>
<td>
<span className={styles.relatedPublisher}>
{dataset.publisher}
</span>
</td>
<td align='right'>
<Tag
color={getColorFromAccessLevel(dataset.accessLevel)}
size='sm'
>
{getLabelFromAccessLevel(dataset.accessLevel)}
</Tag>
</td>
</tr>
))}
</tbody>
</table>
</section>
</TabContent>
<TabContent value='endepunkt'>
<section className={styles.section}>
<Heading
level={4}
size='xxsmall'
>
Endepunkter
</Heading>
<dl className={cn({ [styles.highlight]: highlight })}>
<dt>Endepunkt:</dt>
<dd>
Expand Down Expand Up @@ -212,7 +293,7 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
level={4}
size='xxsmall'
>
Bruk av datasettet
Generelt
</Heading>
<dl>
<dt>Utgiver:</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { type Dictionary, type LocaleCodes } from '@fdk-frontend/dictionaries';

import Breadcrumbs from '@fdk-frontend/ui/breadcrumbs';
import Badge from '@fdk-frontend/ui/badge';
import { BrandDivider } from '@fdk-frontend/ui/divider';
import StarButton from '@fdk-frontend/ui/star-button';
import {
Heading,
Expand Down Expand Up @@ -97,8 +98,8 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
blink();
}}
>
<DownloadIcon fontSize='1.2em' /> Last ned
{/*Be om tilgang*/}
{/*<DownloadIcon fontSize='1.2em' /> Last ned*/}
Bruk datasett
</Button>
</div>
</div>
Expand Down Expand Up @@ -148,7 +149,7 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp
<TabList>
<Tab value='oversikt'>Oversikt</Tab>
<Tab value='distribusjoner'>
Distribusjoner&nbsp;<Badge>1</Badge>
Distribusjoner og API&nbsp;<Badge>1</Badge>
</Tab>
<Tab value='detaljer'>Detaljer</Tab>
<Tab value='kommentarer'>
Expand Down Expand Up @@ -257,13 +258,13 @@ Formål: Data fra smilefjestilsyn gir en samlet oversikt over alle serveringsste
<section className={styles.section}>
<Distributions datasets={datasets} />
</section>
<hr className={styles.divider} />
<BrandDivider className={styles.divider} />
<section className={styles.section}>
<Heading
level={4}
size='xxsmall'
>
Andre så også på
Relaterte datasett
</Heading>
<table className='table'>
<tbody>
Expand Down
Loading

0 comments on commit b615879

Please sign in to comment.