Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: details page redesign #279

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c84e33c
fix(details): added details poc pages
Lillebo Oct 17, 2024
34a72f3
feat(details): design fidling
Lillebo Oct 18, 2024
fff2dce
chore(details): types, prettier
Lillebo Oct 18, 2024
a828b6f
fix(details): details page client component(s), highlght area of inte…
Lillebo Oct 21, 2024
8c55c8f
fix(details): details page worst case
Lillebo Oct 29, 2024
bcc5f8f
fix(details): fixed metadata tab, StarButton
Lillebo Oct 29, 2024
b833c50
chore(details): lint
Lillebo Oct 29, 2024
bb42bad
fix(details): StarButton animation
Lillebo Oct 29, 2024
9814af0
fix(details): worst/best case
Lillebo Oct 31, 2024
78198f7
chore(details): cleanup, prettier, lint
Lillebo Nov 6, 2024
814e4b5
fix(details): remove distribution highlight blinking
Lillebo Nov 11, 2024
888c674
fix(details): added show/hide empty rows button to details tab
Lillebo Nov 11, 2024
780c140
fix(details): design community tab
Lillebo Nov 18, 2024
05945f7
fix(details): distribution contents
Lillebo Nov 19, 2024
b615879
fix(details): api/distributions cleanup
Lillebo Nov 20, 2024
a57f9f9
chore(details): lint
Lillebo Nov 22, 2024
4050937
chore(details): nextjs-15 update
Lillebo Nov 22, 2024
0846d66
fix(details): fixed api link
Lillebo Nov 22, 2024
aad5d35
fix(details): added CommunityTab to worst case
Lillebo Nov 22, 2024
7514abc
fix(details): added CommunityTab to api page
Lillebo Nov 25, 2024
7986a1c
fix(details): responsive details header
Lillebo Nov 25, 2024
47122ab
feat(details): added ScrollShadow component
Lillebo Nov 27, 2024
23acf60
fix(details): mobile responsive
Lillebo Nov 27, 2024
c493ecd
fix(details): mobile responsive: api
Lillebo Nov 27, 2024
5fb0058
fix(details): scroll-shadows use client
Lillebo Nov 28, 2024
b087f3c
fix(details): breadcrumbs update, details header tweak
Lillebo Nov 28, 2024
3fcd20a
fix(details): responsive fix, tableScroller, community-tab
Lillebo Dec 6, 2024
0f28ad0
chore(details): types
Lillebo Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ description: Om vurdering av metadatakvalitet på data.norge.no og hvofor vi gj

Data.norge.no har fire ulike nivåer for metadatakvalitet:

| Nivå | Begrunnelse |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Utmerket** | Dette er bra saker! 75 % eller flere av kvalitetskriteriene er innfridd. Beskrivelsen er informativ og gir stor nytteverdi for brukeren, noe som bør være målet for alle beskrivelser. |
| **God** | 50-75 % av kvalitetskriteriene er innfridd. |
| **Tilstrekkelig** (bør forbedres) | Bare 25-50 % av kvalitetskriteriene er innfridd, og beskrivelsen bør absolutt forbedres. |
| **Dårlig** | 25 % eller færre av kvalitetskriteriene er innfridd. Beskrivelsen er mangelfull og dekker sjelden. |
| Nivå | Begrunnelse |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <Tag color="success">Utmerket</Tag> | Dette er bra saker! 75 % eller flere av kvalitetskriteriene er innfridd. Beskrivelsen er informativ og gir stor nytteverdi for brukeren, noe som bør være målet for alle beskrivelser. |
| <Tag color="success">God</Tag> | 50-75 % av kvalitetskriteriene er innfridd. |
| <Tag color="warning">Tilstrekkelig</Tag> | Bare 25-50 % av kvalitetskriteriene er innfridd, og beskrivelsen bør absolutt forbedres. |
| <Tag color="danger">Dårlig</Tag> | 25 % eller færre av kvalitetskriteriene er innfridd. Beskrivelsen er mangelfull og dekker sjelden. |

## Hvorfor måler vi metadatakvalitet

Expand Down
24 changes: 24 additions & 0 deletions apps/data-norge/src/app/[lang]/view/api/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { i18n, getDictionary } from '@fdk-frontend/dictionaries';

import DetailsPage from '../../../components/details/details-page/api';
import { DetailsPageWrapperProps } from '../page';

const APIPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

return (
<DetailsPage
locale={locale}
commonDictionary={commonDictionary}
/>
);
};

export const metadata = {
title: 'API: Inntektsmottakere API - data.norge.no',
description: 'POC for detaljvisning',
};

export default APIPageWrapper;
24 changes: 24 additions & 0 deletions apps/data-norge/src/app/[lang]/view/begrep/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { i18n, getDictionary } from '@fdk-frontend/dictionaries';

import DetailsPage from '../../../components/details/details-page/begrep';
import { DetailsPageWrapperProps } from '../page';

const BegrepsPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

return (
<DetailsPage
locale={locale}
commonDictionary={commonDictionary}
/>
);
};

export const metadata = {
title: 'Begrep: egenandel på dagpenger - data.norge.no',
description: 'POC for detaljvisning',
};

export default BegrepsPageWrapper;
24 changes: 24 additions & 0 deletions apps/data-norge/src/app/[lang]/view/datasett-worstcase/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { i18n, getDictionary } from '@fdk-frontend/dictionaries';

import DetailsPage from '../../../components/details/details-page/datasett-worstcase';
import { DetailsPageWrapperProps } from '../page';

const DatasettRichPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

return (
<DetailsPage
locale={locale}
commonDictionary={commonDictionary}
/>
);
};

export const metadata = {
title: 'Datasett: Energimålinger kommunale bygg - data.norge.no',
description: 'POC for detaljvisning',
};

export default DatasettRichPageWrapper;
6 changes: 6 additions & 0 deletions apps/data-norge/src/app/[lang]/view/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import DocsLayout from '@fdk-frontend/ui/layouts/docs-layout';

export const revalidate = 0;
export const dynamic = 'force-dynamic';

export default DocsLayout;
30 changes: 30 additions & 0 deletions apps/data-norge/src/app/[lang]/view/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { i18n, getDictionary, type LocaleCodes } from '@fdk-frontend/dictionaries';

import DetailsPage from '../../components/details/details-page';

export type DetailsPageWrapperProps = {
params: Promise<{
lang: LocaleCodes;
slug: string[];
}>;
};

const DetailsPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

return (
<DetailsPage
locale={locale}
commonDictionary={commonDictionary}
/>
);
};

export const metadata = {
title: 'Datasett: Energimålinger kommunale bygg - data.norge.no',
description: 'POC for detaljvisning',
};

export default DetailsPageWrapper;
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.notice {
margin-top:2rem;

.toolbar {
@media (max-width: 500px) {
flex-direction:column;
align-items:flex-start;
}
}
}

.forumStats {
display:inline-flex;
flex-direction:column;
text-align:center;
padding:0.25rem;
}

.section {
:global(.table) {

.threadLink {
margin-bottom:0.5rem;
line-height:1.5rem;
}

:global(.fds-tag) {
white-space: nowrap;
font-size:0.9rem;

:global(.fds-link) {
text-decoration:none;
// color: var(--color-text);

&:hover {
text-decoration:underline;
text-decoration-thickness: max(0.12em);
}
}
}

tr:hover {
:global(.fds-tag) {
// background:white;
}
}
}
}

.tableScroller {
margin:1rem -2rem;

> div {
padding:0 2rem;
}

@media (max-width: 400px) {
margin:1rem -1.5rem;

> div {
padding:0 1.5rem;
}
}
}
126 changes: 126 additions & 0 deletions apps/data-norge/src/app/components/details/community-tab/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { PropsWithChildren } from 'react';
import NextLink from 'next/link';

import { Heading, Button, Link, Paragraph, Alert, Tag } from '@digdir/designsystemet-react';
import { ExternalLinkIcon, Chat2Icon } 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 { Subtext } from '@fdk-frontend/ui/typography';
import ScrollShadows from '@fdk-frontend/ui/scroll-shadows';
import IconBadge from '@fdk-frontend/ui/icon-badge';

import styles from './community-tab.module.scss';

const CommunityTab = ({ children }: PropsWithChildren) => {
return (
<section className={styles.section}>
<Heading
level={4}
size='xxsmall'
>
{/*<Button
variant='tertiary'
size='sm'
style={{float:'right',position:'relative',top:'-0.75rem'}}
>
Gå til Datalandsbyen
<ExternalLinkIcon />
</Button>*/}
<HStack>
Diskusjoner på Datalandsbyen <Badge>2</Badge>
</HStack>
</Heading>
<ScrollShadows className={styles.tableScroller}>
<table className='table' style={{minWidth:600}}>
<tbody>
<tr>
<td width='1'>
<IconBadge fontSize='1.5rem'>
<Chat2Icon />
</IconBadge>
</td>
<td>
<Link href='#' className={styles.threadLink}>Vannverk - transportsystem <ExternalLinkIcon /></Link>
<HStack style={{gap:'0.5rem'}}>
<Tag size='sm' color='neutral'><Link href='#'>Kommentartråder</Link></Tag>
<Subtext>Postet av fdk-community-admin</Subtext>
</HStack>
</td>
<td align='right'>
<HStack style={{justifyContent:'flex-end'}}>
<div className={styles.forumStats}>
<span>7</span>
<Subtext>Stemmer</Subtext>
</div>
<div className={styles.forumStats}>
<span>12</span>
<Subtext>Innlegg</Subtext>
</div>
<div className={styles.forumStats}>
<span>16k</span>
<Subtext>Visninger</Subtext>
</div>
</HStack>
</td>
</tr>
<tr>
<td width='1'>
<IconBadge fontSize='1.5rem'>
<Chat2Icon />
</IconBadge>
</td>
<td>
<Link href='#' className={styles.threadLink}> Strømstøtten minutt for minutt - beregnet med åpne data <ExternalLinkIcon /></Link>
<HStack style={{gap:'0.5rem'}}>
<Tag size='sm' color='neutral'><Link href='#'>Gode eksempler på bruk</Link></Tag>
<Subtext>Postet av fdk-community-admin</Subtext>
</HStack>
</td>
<td align='right'>
<HStack style={{justifyContent:'flex-end'}}>
<div className={styles.forumStats}>
<span>7</span>
<Subtext>Stemmer</Subtext>
</div>
<div className={styles.forumStats}>
<span>12</span>
<Subtext>Innlegg</Subtext>
</div>
<div className={styles.forumStats}>
<span>16k</span>
<Subtext>Visninger</Subtext>
</div>
</HStack>
</td>
</tr>
</tbody>
</table>
</ScrollShadows>
<Alert className={styles.notice}>
<VStack>
<Heading
level={4}
size='xxsmall'
>
Hva er Datalandsbyen?
</Heading>
<Paragraph size='sm'>
Datalandsbyen er vårt nettforum hvor du kan etterspørre data, dele erfaringer og spørre om råd som gjelder datadeling og informasjonsforvaltning.
</Paragraph>
<HStack className={styles.toolbar}>
<Button variant='secondary' size='sm' asChild>
<NextLink href="https://datalandsbyen.norge.no/">Gå til Datalandsbyen <ExternalLinkIcon /></NextLink>
</Button>
<Button variant='secondary' size='sm' asChild>
<NextLink href="/docs/community">Mer informasjon</NextLink>
</Button>
</HStack>
</VStack>
</Alert>
</section>
);
}

export default CommunityTab;
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { PropsWithChildren } from 'react';

import { Link, type LinkProps } from '@digdir/designsystemet-react';

import Markdown from '@fdk-frontend/ui/markdown';

const allowedElements = [
'p',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'blockquote',
'pre',
'code',
'ul',
'ol',
'li',
'hr',
'table',
'thead',
'tbody',
'tr',
'th',
'td',
'a',
'strong',
'em',
'img',
'br',
'del',
'span',
];

type Props = PropsWithChildren & {
className?: string;
};

const DatasetDescription = ({ className, children }: Props) => {
return (
<article className={className}>
<Markdown
allowedElements={allowedElements}
components={{
a: (props: LinkProps) => <Link {...props} />,
}}
>
{children}
</Markdown>
</article>
);
};

export default DatasetDescription;
Loading
Loading