mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 01:02:02 +00:00
Compare commits
130
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75609e1b09 | ||
|
|
ea9bb63d0a | ||
|
|
a148b08eb5 | ||
|
|
1ca7e746e1 | ||
|
|
535ed17d36 | ||
|
|
8df1bc26a0 | ||
|
|
1b15ab146a | ||
|
|
0868b7d716 | ||
|
|
618d8d3de1 | ||
|
|
e9831b4e2a | ||
|
|
b0aa3ce0e7 | ||
|
|
4fa62f5d64 | ||
|
|
350e929bd2 | ||
|
|
64d178ea36 | ||
|
|
cb3decf3bd | ||
|
|
d66d009fe8 | ||
|
|
5974a77140 | ||
|
|
68b4444bb1 | ||
|
|
fc7d16b64b | ||
|
|
08a893c29a | ||
|
|
8d181e7a92 | ||
|
|
ab1c0849f4 | ||
|
|
96098e532f | ||
|
|
0b14ef50e9 | ||
|
|
262f8bf5d2 | ||
|
|
f18a2dde8f | ||
|
|
2e48c97b50 | ||
|
|
8bf2b8f322 | ||
|
|
ceb7b231b5 | ||
|
|
f7f304b33d | ||
|
|
151484afd3 | ||
|
|
7ae6969b35 | ||
|
|
65cfd8b459 | ||
|
|
3c9405b718 | ||
|
|
48b347e814 | ||
|
|
59de2d7992 | ||
|
|
0166c17985 | ||
|
|
57b1de13a9 | ||
|
|
52104b0f23 | ||
|
|
564a6b4b90 | ||
|
|
d43a4bfbdb | ||
|
|
1e647bffc6 | ||
|
|
986c43ead3 | ||
|
|
ea4fffdeba | ||
|
|
c14e9c346b | ||
|
|
d3dd96d2d4 | ||
|
|
b5fd3dd734 | ||
|
|
6979811e67 | ||
|
|
82ab82889d | ||
|
|
0b978693d6 | ||
|
|
feabc168d7 | ||
|
|
759c12eeef | ||
|
|
e3bc4f99a0 | ||
|
|
8c31007854 | ||
|
|
cf80626256 | ||
|
|
cbcfecbe72 | ||
|
|
a1ae58d041 | ||
|
|
a6cf7c1f25 | ||
|
|
a31a969863 | ||
|
|
19504b0d32 | ||
|
|
920a037b47 | ||
|
|
568f55e4be | ||
|
|
53cbedf041 | ||
|
|
cb356c23dc | ||
|
|
8f76acc776 | ||
|
|
d0269a84c0 | ||
|
|
e36206197d | ||
|
|
5e6bb7e016 | ||
|
|
15ed6b0f2f | ||
|
|
16142657ec | ||
|
|
a5b50f4cef | ||
|
|
796b7ac49f | ||
|
|
9bafc3e218 | ||
|
|
72c04454e5 | ||
|
|
dc4ad88427 | ||
|
|
00ecf7c67c | ||
|
|
83f8127570 | ||
|
|
b6017ea5cf | ||
|
|
b96036d14a | ||
|
|
d0fafb41b3 | ||
|
|
ddf8f65499 | ||
|
|
31aa6243ef | ||
|
|
afca0f481a | ||
|
|
2ffc2c22dc | ||
|
|
d8100c1589 | ||
|
|
a4cce95171 | ||
|
|
01ab8e5741 | ||
|
|
dd1a961dd2 | ||
|
|
11520ce468 | ||
|
|
20c8f9204b | ||
|
|
0074bfd5fb | ||
|
|
a0504f4e57 | ||
|
|
7bcac33423 | ||
|
|
a6feaea201 | ||
|
|
9c6cf8c811 | ||
|
|
592e0ccae9 | ||
|
|
f2f44ad2d7 | ||
|
|
322077fff8 | ||
|
|
5eaf729cc4 | ||
|
|
f285477a6c | ||
|
|
16f693cee9 | ||
|
|
2a7198e02b | ||
|
|
98b4f4e76a | ||
|
|
cf397f2522 | ||
|
|
7f1305c639 | ||
|
|
5964775a8e | ||
|
|
f1ea4ee1e0 | ||
|
|
cc24357a9e | ||
|
|
53406e54a9 | ||
|
|
39faa2b945 | ||
|
|
02e5978664 | ||
|
|
fa20f601df | ||
|
|
132ee94235 | ||
|
|
fa5aa175ab | ||
|
|
cf8833c885 | ||
|
|
a37f42b28a | ||
|
|
b8e797bc92 | ||
|
|
c248cb2a57 | ||
|
|
2a748c7903 | ||
|
|
2f2cbc16ca | ||
|
|
c0b8928ece | ||
|
|
50fe0e785b | ||
|
|
b2d31aed46 | ||
|
|
9fdf2cd4df | ||
|
|
02aa151153 | ||
|
|
a472fc4793 | ||
|
|
fdab54742f | ||
|
|
53230c1d67 | ||
|
|
d6dfdff964 | ||
|
|
2feb10005c |
No files matched your search
@@ -24,10 +24,10 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
run: cd aksel.nav.no/sanity && yarn
|
||||
|
||||
- name: Export dataset
|
||||
run: SANITY_TOKEN=${{secrets.SANITY_DATASET_EDITOR_TOKEN}} yarn workspace aksel.nav.no sanity:backup
|
||||
run: cd aksel.nav.no/sanity && SANITY_TOKEN=${{secrets.SANITY_DATASET_EDITOR_TOKEN}} yarn backup
|
||||
- name: Upload GCP bucket
|
||||
uses: "google-github-actions/auth@v0"
|
||||
with:
|
||||
@@ -36,4 +36,4 @@ jobs:
|
||||
with:
|
||||
path: ./aksel.nav.no/sanity
|
||||
destination: "aksel-website-prod/backups"
|
||||
glob: "**/backup-*.tar.gz"
|
||||
glob: "backup-*.tar.gz"
|
||||
@@ -20,9 +20,8 @@ jobs:
|
||||
- uses: "actions/checkout@v3"
|
||||
|
||||
- id: upload
|
||||
uses: nais/frontend-plattform-cdn-upload-action@main
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-environment: cdn.nav.no
|
||||
cdn-team-name: aksel
|
||||
source: ./fonts
|
||||
destination: "" # uploads folder to team root
|
||||
|
||||
@@ -148,3 +148,4 @@ tmp.json
|
||||
/playwright/.cache/
|
||||
playwright-report/
|
||||
/test-results/
|
||||
backup-*.tar.gz
|
||||
@@ -1,5 +1,9 @@
|
||||
# @navikt/ds-codemod
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-codemod",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "Aksel codemods for NAVs designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
"build-pict": "svgr --silent --index-template index-template.js --out-dir src/pictograms pictograms"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-react": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.6",
|
||||
"@navikt/ds-react": "^2.0.6",
|
||||
"clsx": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -51,7 +51,6 @@
|
||||
"@rollup/plugin-commonjs": "23.0.2",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@svgr/cli": "6.2.1",
|
||||
"@types/node": "^17.0.35",
|
||||
"concurrently": "7.2.1",
|
||||
"copyfiles": "2.4.1",
|
||||
"postcss-combine-duplicated-selectors": "10.0.3",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @navikt/ds-css
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Reverserte border-width endrind i button
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
.navds-button--secondary {
|
||||
color: var(--ac-button-secondary-text, var(--a-text-action));
|
||||
background-color: var(--ac-button-secondary-bg, var(--a-surface-default));
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
}
|
||||
|
||||
.navds-button--secondary:hover {
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
|
||||
.navds-button--secondary:focus {
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-secondary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-secondary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--secondary:active {
|
||||
@@ -145,7 +145,7 @@
|
||||
.navds-button--secondary:hover:where(:disabled, .navds-button--disabled) {
|
||||
color: var(--ac-button-secondary-text, var(--a-text-action));
|
||||
background-color: var(--ac-button-secondary-bg, var(--a-surface-default));
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
}
|
||||
|
||||
/****************************
|
||||
@@ -162,7 +162,7 @@
|
||||
}
|
||||
|
||||
.navds-button--tertiary:focus {
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-tertiary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-tertiary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:active {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "CSS for NAV Designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -20,7 +20,7 @@
|
||||
"watch": "postcss --watch --use postcss-import -o dist/index.css index.css"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^2.0.4",
|
||||
"@navikt/ds-tokens": "^2.0.6",
|
||||
"normalize.css": "^8.0.1",
|
||||
"postcss": "^8.4.0",
|
||||
"postcss-cli": "^9.0.0",
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @navikt/ds-react
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- DateInput hadde duplikat className satt
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "Aksel react-components for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@floating-ui/react-dom-interactions": "0.9.2",
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.6",
|
||||
"@radix-ui/react-tabs": "1.0.0",
|
||||
"@radix-ui/react-toggle-group": "1.0.0",
|
||||
"clsx": "^1.2.1",
|
||||
@@ -52,7 +52,6 @@
|
||||
"@testing-library/user-event": "^14.2.0",
|
||||
"@types/faker": "5.5.8",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"@types/react-modal": "^3.13.1",
|
||||
"concurrently": "7.2.1",
|
||||
"copyfiles": "^2.4.1",
|
||||
|
||||
@@ -108,7 +108,6 @@ const DateInput: DateInputType = forwardRef<HTMLInputElement, DateInputProps>(
|
||||
autoComplete="off"
|
||||
aria-controls={ariaId}
|
||||
className={cl(
|
||||
className,
|
||||
"navds-date__field-input",
|
||||
"navds-text-field__input",
|
||||
"navds-body-short",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# @navikt/ds-tailwind
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tailwind",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "Tailwind config based on @navikt/ds-tokens",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -22,9 +22,8 @@
|
||||
"directory": "@navikt/core/tailwind"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^2.0.4",
|
||||
"@navikt/ds-tokens": "^2.0.6",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# @navikt/ds-tokens
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tokens",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "Design-tokens for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -31,7 +31,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# @navikt/ds-icons
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-icons",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "Aksel icons for NAV",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"repository": {
|
||||
@@ -49,7 +49,6 @@
|
||||
"@svgr/cli": "6.2.1",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/lodash.startcase": "^4.4.6",
|
||||
"@types/node": "^17.0.35",
|
||||
"@types/rimraf": "3.0.2",
|
||||
"axios": "^0.21.3",
|
||||
"concurrently": "7.2.1",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# @navikt/ds-css-internal
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css-internal",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "CSS for NAV internal Designsystem-components",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @navikt/ds-react-internal
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.6
|
||||
- @navikt/ds-icons@2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.5
|
||||
- @navikt/ds-icons@2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react-internal",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"description": "Aksel react components for internal UIs in NAV",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -35,13 +35,12 @@
|
||||
"watch": "tsc --watch -p tsconfig.esm.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-react": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.6",
|
||||
"@navikt/ds-react": "^2.0.6",
|
||||
"clsx": "^1.1.1",
|
||||
"copy-to-clipboard": "^3.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^17.0.35",
|
||||
"concurrently": "7.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "10.9.0",
|
||||
|
||||
@@ -7,12 +7,17 @@
|
||||
"tags": ["designsystem", "docs"]
|
||||
},
|
||||
{
|
||||
"url": "https://aksel.nav.no/artikkel/",
|
||||
"url": "https://aksel.nav.no/god-praksis/",
|
||||
"tags": ["aksel"],
|
||||
"selectors_key": "aksel"
|
||||
},
|
||||
{
|
||||
"url": "https://aksel.nav.no/blogg/",
|
||||
"url": "https://aksel.nav.no/produktbloggen/",
|
||||
"tags": ["aksel"],
|
||||
"selectors_key": "aksel"
|
||||
},
|
||||
{
|
||||
"url": "https://aksel.nav.no/prinsipper/",
|
||||
"tags": ["aksel"],
|
||||
"selectors_key": "aksel"
|
||||
}
|
||||
@@ -41,7 +46,8 @@
|
||||
"selectors_exclude": [".algolia-ignore-index"],
|
||||
"stop_urls": [
|
||||
"https://aksel.nav.no/preview",
|
||||
"https://old-design-nav.vercel.app"
|
||||
"https://old-design-nav.vercel.app",
|
||||
"https://aksel.nav.no/eksempler"
|
||||
],
|
||||
"sitemap_urls": ["https://aksel.nav.no/api/sitemap"],
|
||||
"js_render": true
|
||||
|
||||
@@ -8,25 +8,21 @@
|
||||
"dev": "yarn workspace website dev",
|
||||
"build:next": "yarn workspace website build",
|
||||
"serve:next": "yarn workspace website start",
|
||||
"sanity": "yarn workspace sanity start",
|
||||
"sanity:deploy": "yarn workspace sanity deploy",
|
||||
"sanity:backup": "yarn workspace sanity backup",
|
||||
"sanity:update": "yarn workspace website update:sanity",
|
||||
"test": "yarn workspace website test"
|
||||
},
|
||||
"workspaces": [
|
||||
"sanity",
|
||||
"website"
|
||||
],
|
||||
"dependencies": {
|
||||
"@navikt/ds-codemod": "^2.0.4",
|
||||
"@navikt/ds-css": "^2.0.4",
|
||||
"@navikt/ds-css-internal": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-react": "^2.0.4",
|
||||
"@navikt/ds-react-internal": "^2.0.4",
|
||||
"@navikt/ds-tailwind": "^2.0.4",
|
||||
"@navikt/ds-tokens": "^2.0.4"
|
||||
"@navikt/ds-codemod": "^2.0.6",
|
||||
"@navikt/ds-css": "^2.0.6",
|
||||
"@navikt/ds-css-internal": "^2.0.6",
|
||||
"@navikt/ds-icons": "^2.0.6",
|
||||
"@navikt/ds-react": "^2.0.6",
|
||||
"@navikt/ds-react-internal": "^2.0.6",
|
||||
"@navikt/ds-tailwind": "^2.0.6",
|
||||
"@navikt/ds-tokens": "^2.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier-plugin-tailwindcss": "^0.1.13"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.yarn/cache
|
||||
Binary file not shown.
@@ -68,7 +68,9 @@ export const akselInnhold = async () => {
|
||||
})
|
||||
)
|
||||
),
|
||||
S.listItem().title("Blogg").child(S.documentTypeList("aksel_blogg")),
|
||||
S.listItem()
|
||||
.title("Produktbloggen")
|
||||
.child(S.documentTypeList("aksel_blogg")),
|
||||
S.listItem()
|
||||
.title("Prinsipper")
|
||||
.child(
|
||||
|
||||
@@ -93,18 +93,10 @@ export const dsPanel = async (roles) => {
|
||||
.title("Eksempler")
|
||||
.icon(() => <span>{`EX`}</span>)
|
||||
.child(S.documentTypeList("kode_eksempler_fil")),
|
||||
S.listItem()
|
||||
.title("Fargekategorier")
|
||||
.icon(() => <Folder />)
|
||||
.child(S.documentTypeList("ds_color_categories")),
|
||||
S.listItem()
|
||||
.title("Props")
|
||||
.icon(() => <Folder />)
|
||||
.child(S.documentTypeList("ds_props")),
|
||||
S.listItem()
|
||||
.title("Tokens")
|
||||
.icon(() => <Folder />)
|
||||
.child(S.documentTypeList("ds_tokens")),
|
||||
S.listItem()
|
||||
.title("Token-kategorier")
|
||||
.icon(() => <Folder />)
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
"@sanity/form-builder": "b38478227ba5e22c91981da4b53436df22e48ff25238a55a973ed620be5068aa",
|
||||
"@sanity/data-aspects": "d199e2c199b3e26cd28b68dc84d7fc01c9186bf5089580f2e2446994d36b3cb6",
|
||||
"@sanity/vision": "da5b6ed712703ecd04bf4df560570c668aa95252c6bc1c41d6df1bda9b8b8f60",
|
||||
"power-table": "922902575995e62af8f628e6abe652ecc5f3b1e1d2dec5859392e79e47707088"
|
||||
"power-table": "922902575995e62af8f628e6abe652ecc5f3b1e1d2dec5859392e79e47707088",
|
||||
"table": "e56785cc6cecbacf8ebe6bb99ffae32b973e233503c0714497ac7df3042863f1"
|
||||
}
|
||||
@@ -38,14 +38,6 @@ export const publishedAtField = {
|
||||
!currentUser.roles.find((x) => x.name === "administrator"),
|
||||
};
|
||||
|
||||
export const migratedField = {
|
||||
title: "Migrert riktekst",
|
||||
name: "isMigrated",
|
||||
type: "boolean",
|
||||
hidden: true,
|
||||
initialValue: true,
|
||||
};
|
||||
|
||||
export const titleField = {
|
||||
title: "Sidetittel",
|
||||
name: "heading",
|
||||
@@ -111,19 +103,3 @@ export const innholdFieldNewNested = (name?: string, type?: string) => {
|
||||
delete fields.group;
|
||||
return fields;
|
||||
};
|
||||
|
||||
export const hidePageFeedback = {
|
||||
title: "Tilbakemeldinger",
|
||||
name: "metadata_feedback",
|
||||
type: "object",
|
||||
group: "settings",
|
||||
fields: [
|
||||
{
|
||||
title: "Skjul artikkel feedback modul",
|
||||
description: "Gjemmer <<Var denne artikkelen til hjelp?>> modulen.",
|
||||
name: "hide_feedback",
|
||||
type: "boolean",
|
||||
initialValue: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -10,7 +10,10 @@
|
||||
"build": "sanity build",
|
||||
"deploy": "yarn typegen && sanity deploy",
|
||||
"backup": "node scripts/backup.js",
|
||||
"typegen": "sanity exec typegen.ts"
|
||||
"typegen": "sanity exec typegen.ts",
|
||||
"sanity:dev": "sanity start",
|
||||
"sanity:deploy": "yarn typegen && sanity deploy",
|
||||
"sanity:backup": "node scripts/backup.js"
|
||||
},
|
||||
"main": "package.json",
|
||||
"keywords": [
|
||||
@@ -29,6 +32,7 @@
|
||||
"@sanity/export": "^2.30.3",
|
||||
"@sanity/production-preview": "^2.29.3",
|
||||
"@sanity/react-hooks": "^2.35.0",
|
||||
"@sanity/ui": "^0.37.22",
|
||||
"@sanity/vision": "^2.35.0",
|
||||
"moment": "2.29.4",
|
||||
"sanity-codegen": "0.9.8",
|
||||
|
||||
+2
-4
@@ -4,7 +4,6 @@ import {
|
||||
groups,
|
||||
ingressField,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
relevanteArtiklerField,
|
||||
sanitySlug,
|
||||
@@ -12,7 +11,7 @@ import {
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "artikkel/";
|
||||
const prefix = "god-praksis/artikler/";
|
||||
|
||||
export default {
|
||||
title: "Aksel Artikkel",
|
||||
@@ -24,7 +23,7 @@ export default {
|
||||
publishedAtField,
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 2),
|
||||
sanitySlug(prefix, 3),
|
||||
{
|
||||
title: "Tema",
|
||||
description: "Legg til de viktigeste temaene",
|
||||
@@ -39,6 +38,5 @@ export default {
|
||||
relevanteArtiklerField,
|
||||
|
||||
SEOFields,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
export { default as Artikkel } from "./articles/artikkel";
|
||||
export { default as Blogg } from "./articles/blogg";
|
||||
export { default as Tema } from "./tema";
|
||||
export { default as Prinsipp } from "./articles/prinsipp";
|
||||
export { default as Standalone } from "./articles/standalone";
|
||||
+1
-3
@@ -4,14 +4,13 @@ import {
|
||||
groups,
|
||||
ingressField,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
SEOFields,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "blogg/";
|
||||
const prefix = "produktbloggen/";
|
||||
|
||||
export default {
|
||||
title: "Blogg",
|
||||
@@ -28,6 +27,5 @@ export default {
|
||||
innholdFieldNew,
|
||||
|
||||
SEOFields,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { KomponentArtikkel } from "./index";
|
||||
import KomponentArtikkel from "./komponent";
|
||||
|
||||
export default {
|
||||
...KomponentArtikkel,
|
||||
@@ -1,83 +0,0 @@
|
||||
import {
|
||||
defaultDocPreview,
|
||||
editorField,
|
||||
groups,
|
||||
hidePageFeedback,
|
||||
innholdFieldNew,
|
||||
innholdFieldNewNested,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "designsystem/side/";
|
||||
|
||||
export default {
|
||||
title: "Artikkel",
|
||||
name: "ds_artikkel",
|
||||
type: "document",
|
||||
groups,
|
||||
...defaultDocPreview,
|
||||
fields: [
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 3),
|
||||
{
|
||||
title: "Layout",
|
||||
description:
|
||||
"'Full' bruker hele bredden, men fjerner table of content (bruk bare for eks ikonside eller komponentvisning)",
|
||||
name: "layout",
|
||||
type: "string",
|
||||
group: "settings",
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Full", value: "full" },
|
||||
{ title: "Default", value: "default" },
|
||||
],
|
||||
layout: "radio",
|
||||
},
|
||||
initialValue: "default",
|
||||
},
|
||||
{
|
||||
type: "boolean",
|
||||
name: "artikkel_type",
|
||||
title: "Bruk Tabs",
|
||||
group: "innhold",
|
||||
initialValue: false,
|
||||
},
|
||||
{
|
||||
...innholdFieldNew,
|
||||
type: "riktekst_ds_artikkel",
|
||||
hidden: ({ document }) => !!document?.artikkel_type,
|
||||
},
|
||||
{
|
||||
name: "content_tabs",
|
||||
title: "Innhold i Tabs",
|
||||
type: "array",
|
||||
group: "innhold",
|
||||
hidden: ({ document }) => !document?.artikkel_type,
|
||||
of: [
|
||||
{
|
||||
name: "tab",
|
||||
title: "Tab",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Tittel",
|
||||
description: "Innhold vil da legges under url/tab-tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Tabben må ha en enkel tittel"),
|
||||
},
|
||||
innholdFieldNewNested(),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
hidePageFeedback,
|
||||
],
|
||||
};
|
||||
@@ -1,93 +0,0 @@
|
||||
export default {
|
||||
title: "Fargekategori",
|
||||
name: "ds_color_categories",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
title: "Beskrivelse",
|
||||
name: "description",
|
||||
type: "riktekst_enkel",
|
||||
},
|
||||
{
|
||||
type: "array",
|
||||
name: "colors",
|
||||
title: "Farger",
|
||||
of: [{ type: "ds_color" }],
|
||||
options: {
|
||||
sortable: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const Color = {
|
||||
name: "ds_color",
|
||||
title: "Farge",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Navn",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
name: "full_title",
|
||||
title: "CSS variabelnavn",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Fargetype/nivå",
|
||||
name: "color_type",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
initialValue: "global",
|
||||
readOnly: true,
|
||||
options: {
|
||||
layout: "radio",
|
||||
list: [
|
||||
{ value: "global", title: "Global" },
|
||||
{ value: "semantic", title: "Semantic" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "color_name",
|
||||
title: "Brukt fargenavn",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
hidden: ({ parent }) => parent?.color_type === "global",
|
||||
},
|
||||
{
|
||||
name: "color_roles",
|
||||
title: "Fargeroller",
|
||||
type: "array",
|
||||
hidden: ({ parent }) => parent?.color_type === "global",
|
||||
of: [{ type: "string", name: "role" }],
|
||||
},
|
||||
{
|
||||
name: "color_value",
|
||||
title: "Brukt farge",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
name: "color_index",
|
||||
title: "Fargeindeks",
|
||||
type: "number",
|
||||
description:
|
||||
"Brukes for å endre rekkefølgen på listen. Farger med indeks 0 vil være først, større tall sorteres under der igjen",
|
||||
},
|
||||
],
|
||||
__experimental_omnisearch_visibility: false,
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
export default {
|
||||
title: "Tokens",
|
||||
name: "ds_tokens",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Navn",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Verdi",
|
||||
name: "token",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Faktisk verdi",
|
||||
name: "raw",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Parent",
|
||||
name: "parent",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Beskrivelse",
|
||||
name: "beskrivelse",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
title: "Autogenerert",
|
||||
name: "autogenerated",
|
||||
type: "boolean",
|
||||
readOnly: true,
|
||||
},
|
||||
],
|
||||
__experimental_omnisearch_visibility: false,
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
export { default as KomponentArtikkel } from "./articles/komponent";
|
||||
export { default as Artikkel } from "./articles/artikkel";
|
||||
export { default as ComponentTemplate } from "./component-template";
|
||||
|
||||
export { default as Props } from "./automated/props";
|
||||
export { default as TokensOld } from "./automated/tokens.old";
|
||||
export { default as TokenKategori } from "./automated/tokens";
|
||||
export { default as KodeEksempler } from "./automated/kode-eksempler";
|
||||
export {
|
||||
Color,
|
||||
default as ColorCategories,
|
||||
} from "./automated/color-categories";
|
||||
export { default as Frontpage } from "./frontpage";
|
||||
export { default as Navigation, ds_header_heading } from "./navigation";
|
||||
@@ -1,129 +0,0 @@
|
||||
export default {
|
||||
name: "ds_navigation",
|
||||
title: "Navigation",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Designsystem navigajsons-struktur",
|
||||
name: "title",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
hidden: true,
|
||||
initialValue: "Designsystem navigajsons-struktur",
|
||||
},
|
||||
{
|
||||
name: "headings",
|
||||
title: "Header linker",
|
||||
type: "array",
|
||||
of: [
|
||||
{
|
||||
type: "ds_navigation_heading",
|
||||
name: "heading",
|
||||
title: "Header link",
|
||||
},
|
||||
],
|
||||
validation: (Rule) =>
|
||||
Rule.required()
|
||||
.min(1)
|
||||
.error("Headingmenyen må ha minst en koblet lenke i sidemenyen"),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const ds_header_heading = {
|
||||
name: "ds_navigation_heading",
|
||||
title: "Header link",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Heading tittel",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Side selve headingen linker til",
|
||||
description:
|
||||
"Husk å legge denne til i menyen også, hvis ikke blir den bare tilgjengelig via headern",
|
||||
name: "link_ref",
|
||||
type: "reference",
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må linke til en startside"),
|
||||
},
|
||||
{
|
||||
title: "Meny for denne headingen",
|
||||
name: "menu",
|
||||
type: "array",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny må ha misnt en lenke"),
|
||||
of: [
|
||||
{
|
||||
title: "Menypunkt",
|
||||
name: "item",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Menypunkt tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Link til side",
|
||||
name: "link",
|
||||
type: "reference",
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
options: {
|
||||
modal: {
|
||||
type: "dialog",
|
||||
width: "medium", // 'small' | 'medium' | 'large' | 'full'
|
||||
},
|
||||
},
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må lenke til en side"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "subheading",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Subheading må være fylt ut"),
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare(selection) {
|
||||
const { title } = selection;
|
||||
return {
|
||||
title: title,
|
||||
subtitle: "Subheading",
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare({ title }) {
|
||||
return {
|
||||
title: `${title}`,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
import {
|
||||
defaultDocPreview,
|
||||
editorField,
|
||||
groups,
|
||||
innholdFieldNew,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "designsystem/side/";
|
||||
|
||||
export default {
|
||||
title: "Artikkel",
|
||||
name: "ds_artikkel",
|
||||
type: "document",
|
||||
groups,
|
||||
...defaultDocPreview,
|
||||
fields: [
|
||||
publishedAtField,
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 3),
|
||||
{
|
||||
title: "url (v2)",
|
||||
name: "slug_v2",
|
||||
type: "slug",
|
||||
hidden: ({ currentUser }) =>
|
||||
!currentUser.roles.find((x) => x.name === "developer"),
|
||||
},
|
||||
{
|
||||
title: "Kategori",
|
||||
name: "kategori",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Styling", value: "styling" },
|
||||
{ title: "Tokens", value: "tokens" },
|
||||
{ title: "Stæsj", value: "staesj" },
|
||||
{ title: "Guider", value: "guider" },
|
||||
].map((x) => ({
|
||||
title: x.title,
|
||||
value: x.value,
|
||||
})),
|
||||
layout: "radio",
|
||||
},
|
||||
hidden: ({ currentUser }) =>
|
||||
!currentUser.roles.find((x) => x.name === "developer"),
|
||||
},
|
||||
{
|
||||
...innholdFieldNew,
|
||||
type: "riktekst_ds_artikkel",
|
||||
},
|
||||
],
|
||||
};
|
||||
File renamed without changes.
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import { People } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
import profilePage from "../../components/profile/profile-page";
|
||||
|
||||
File renamed without changes.
+26
-2
@@ -3,7 +3,6 @@ import {
|
||||
editorField,
|
||||
groups,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
@@ -22,6 +21,31 @@ export default {
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 3),
|
||||
{
|
||||
title: "url (v2)",
|
||||
name: "slug_v2",
|
||||
type: "slug",
|
||||
hidden: ({ currentUser }) =>
|
||||
!currentUser.roles.find((x) => x.name === "developer"),
|
||||
},
|
||||
{
|
||||
title: "Kategori",
|
||||
name: "kategori",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Core", value: "core" },
|
||||
{ title: "Internal", value: "internal" },
|
||||
].map((x) => ({
|
||||
title: x.title,
|
||||
value: x.value,
|
||||
})),
|
||||
layout: "radio",
|
||||
},
|
||||
hidden: ({ currentUser }) =>
|
||||
!currentUser.roles.find((x) => x.name === "developer"),
|
||||
},
|
||||
{
|
||||
title: "Metadata",
|
||||
name: "status",
|
||||
@@ -63,7 +87,7 @@ export default {
|
||||
{
|
||||
...innholdFieldNew,
|
||||
type: "riktekst_komponent",
|
||||
name: "bruk_tab",
|
||||
name: "content",
|
||||
title: "Innhold",
|
||||
},
|
||||
{
|
||||
@@ -1,144 +1,121 @@
|
||||
import { Expand, Link } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
const config = require("../../config");
|
||||
|
||||
const maxDepth = 2;
|
||||
|
||||
const checkDepth = (list, depth) => {
|
||||
if (!list || list.length === 0) {
|
||||
throw new Error("Dropdown lister må ha mist et element");
|
||||
}
|
||||
|
||||
if (depth > maxDepth) {
|
||||
throw new Error(`Sidemeny kan ha maks dybde på ${maxDepth} elementer`);
|
||||
}
|
||||
|
||||
for (const el of list) {
|
||||
el._type === "dropdown" && checkDepth(el.dropdown, depth + 1);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
function validateNestedDepth(sidemenu) {
|
||||
if (!sidemenu) {
|
||||
return "Sidemeny må ha minst et element";
|
||||
}
|
||||
try {
|
||||
checkDepth(sidemenu, 0);
|
||||
} catch (e) {
|
||||
return e.message;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "navigation",
|
||||
name: "ds_navigation",
|
||||
title: "Navigation",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Designsystem navigajsons-struktur",
|
||||
name: "title",
|
||||
title: "Tittel",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
hidden: true,
|
||||
initialValue: "Designsystem navigajsons-struktur",
|
||||
},
|
||||
{
|
||||
name: "sidemenu",
|
||||
title: "Sidemeny",
|
||||
name: "headings",
|
||||
title: "Header linker",
|
||||
type: "array",
|
||||
of: [
|
||||
{
|
||||
type: "ds_navigation_heading",
|
||||
name: "heading",
|
||||
title: "Header link",
|
||||
},
|
||||
],
|
||||
validation: (Rule) =>
|
||||
Rule.required()
|
||||
.min(1)
|
||||
.error("Headingmenyen må ha minst en koblet lenke i sidemenyen"),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const ds_header_heading = {
|
||||
name: "ds_navigation_heading",
|
||||
title: "Header link",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Heading tittel",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Side selve headingen linker til",
|
||||
description:
|
||||
"Linker eller dropdowns med linker. Maks dybde på 2 dropdowns er støttet. Sider må være publisert før de kan linkes her.",
|
||||
type: "array",
|
||||
of: [
|
||||
{ type: "navigation_dropdown", name: "dropdown", title: "Dropdown" },
|
||||
{ type: "navigation_link", name: "link", title: "Link" },
|
||||
],
|
||||
validation: (Rule) => Rule.required().min(1),
|
||||
},
|
||||
],
|
||||
validation: (Rule) =>
|
||||
Rule.required().custom(({ sidemenu, ...rest }) => {
|
||||
return validateNestedDepth(sidemenu);
|
||||
}),
|
||||
};
|
||||
|
||||
export const dropdown = {
|
||||
name: "navigation_dropdown",
|
||||
title: "Dropdown",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Tittel",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
title: "Meny",
|
||||
name: "dropdown",
|
||||
type: "array",
|
||||
of: [
|
||||
{ type: "navigation_link", name: "link", title: "Link" },
|
||||
{ type: "navigation_dropdown", name: "dropdown", title: "Dropdown" },
|
||||
],
|
||||
validation: (Rule) => Rule.required().min(1),
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare({ title }) {
|
||||
return {
|
||||
title: `${title}`,
|
||||
media: <Expand />,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const link = {
|
||||
name: "navigation_link",
|
||||
title: "Link",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Tittel",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
title: "Link",
|
||||
"Husk å legge denne til i menyen også, hvis ikke blir den bare tilgjengelig via headern",
|
||||
name: "link_ref",
|
||||
type: "reference",
|
||||
weak: true,
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
validation: (Rule) => Rule.required(),
|
||||
/* Matches results based on document prefix */
|
||||
options: {
|
||||
filter: ({ document }) => {
|
||||
const match = config.teams.find((team) =>
|
||||
document._id.endsWith(team.name)
|
||||
);
|
||||
if (!match) {
|
||||
return {
|
||||
filter: ``,
|
||||
};
|
||||
}
|
||||
return {
|
||||
filter: `_type match ["${match.prefix}_*", "*_page"]`,
|
||||
};
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må linke til en startside"),
|
||||
},
|
||||
{
|
||||
title: "Meny for denne headingen",
|
||||
name: "menu",
|
||||
type: "array",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny må ha misnt en lenke"),
|
||||
of: [
|
||||
{
|
||||
title: "Menypunkt",
|
||||
name: "item",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Menypunkt tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Link til side",
|
||||
name: "link",
|
||||
type: "reference",
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
options: {
|
||||
modal: {
|
||||
type: "dialog",
|
||||
width: "medium", // 'small' | 'medium' | 'large' | 'full'
|
||||
},
|
||||
},
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må lenke til en side"),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "subheading",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Subheading må være fylt ut"),
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare(selection) {
|
||||
const { title } = selection;
|
||||
return {
|
||||
title: title,
|
||||
subtitle: "Subheading",
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
options: {
|
||||
modal: {
|
||||
type: "dialog",
|
||||
width: "medium", // 'small' | 'medium' | 'large' | 'full'
|
||||
},
|
||||
},
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
@@ -146,7 +123,6 @@ export const link = {
|
||||
prepare({ title }) {
|
||||
return {
|
||||
title: `${title}`,
|
||||
media: <Link />,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
-2
@@ -5,7 +5,6 @@ import {
|
||||
ingressField,
|
||||
innholdFieldPrinsipp,
|
||||
isSlugUnique,
|
||||
migratedField,
|
||||
prinsipper,
|
||||
publishedAtField,
|
||||
SEOFields,
|
||||
@@ -138,6 +137,5 @@ export default {
|
||||
ingressField,
|
||||
innholdFieldPrinsipp,
|
||||
SEOFields,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
File renamed without changes.
-2
@@ -2,7 +2,6 @@ import {
|
||||
defaultDocPreview,
|
||||
groups,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
@@ -21,6 +20,5 @@ export default {
|
||||
titleField,
|
||||
sanitySlug(prefix, 2),
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
+34
-11
@@ -11,7 +11,10 @@ export default {
|
||||
name: "title",
|
||||
type: "string",
|
||||
group: "innhold",
|
||||
validation: (Rule) => Rule.required().error("Temaet må ha et navn"),
|
||||
validation: (Rule) =>
|
||||
Rule.required()
|
||||
.warning("Denne endringe påvirker URL")
|
||||
.error("Temaet må ha et navn"),
|
||||
},
|
||||
{
|
||||
title: "Kort Intro/Oppsummering",
|
||||
@@ -30,6 +33,36 @@ export default {
|
||||
type: "riktekst_enkel",
|
||||
group: "innhold",
|
||||
},
|
||||
{
|
||||
title: "Hidden",
|
||||
name: "bruk_seksjoner",
|
||||
type: "boolean",
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
title: "Shortname",
|
||||
description: "En mer sanitert visning av tema-navnet i url ene",
|
||||
name: "slug",
|
||||
type: "slug",
|
||||
group: "innhold",
|
||||
validation: (Rule) => Rule.required().error("Tema må ha en URL"),
|
||||
options: {
|
||||
source: "title",
|
||||
slugify: (s: string) =>
|
||||
s
|
||||
? s
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.replace(/\s+/g, "-")
|
||||
.replace(/-+/gm, "-")
|
||||
.replace(/æ/g, "a")
|
||||
.replace(/å/g, "a")
|
||||
.replace(/ø/g, "o")
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
.replace(/[&\\#!,+()$~%.'"¨:*?<>{}]/g, "")
|
||||
: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Ansvarlig for tema",
|
||||
description: "Legg til redaktør som har forvaltningsansvaret for temaet",
|
||||
@@ -39,15 +72,6 @@ export default {
|
||||
validation: (Rule) => Rule.required(),
|
||||
group: "innhold",
|
||||
},
|
||||
{
|
||||
title: "Bruk seksjonsinndeling",
|
||||
description:
|
||||
"Vil ikke vise artikler som ikke er lagt til i seksjoner hvis valgt!",
|
||||
name: "bruk_seksjoner",
|
||||
type: "boolean",
|
||||
group: "innhold",
|
||||
initialValue: false,
|
||||
},
|
||||
{
|
||||
title: "Seksjonering",
|
||||
description:
|
||||
@@ -55,7 +79,6 @@ export default {
|
||||
name: "seksjoner",
|
||||
type: "array",
|
||||
group: "innhold",
|
||||
hidden: ({ parent }) => !parent?.bruk_seksjoner,
|
||||
of: [
|
||||
{
|
||||
type: "object",
|
||||
File renamed without changes.
@@ -1,28 +1,28 @@
|
||||
import Accordion from "./accordion";
|
||||
import Alert from "./alert";
|
||||
import Innholdskort from "./innholdskort";
|
||||
import Bilde from "./bilde";
|
||||
import HeroBilde from "./hero-bilde";
|
||||
import DoDont, { doDontBlock } from "./do-dont";
|
||||
import HeroBilde from "./hero-bilde";
|
||||
import introKomponent from "./intro-komponent";
|
||||
import Kode from "./kode";
|
||||
import KodeEksempler from "./kode-eksempler";
|
||||
import Props from "./props";
|
||||
import RelatertInnhold from "./relatert-innhold";
|
||||
import Innholdskort from "./innholdskort";
|
||||
import KodeEksempler from "./kode-eksempler";
|
||||
import TokenRef from "./token-tabell";
|
||||
import { tmpTabell, tmpTabellRow } from "./tabellv2";
|
||||
import {
|
||||
RiktekstAksel,
|
||||
RiktekstDsArtikkel,
|
||||
RiktekstEnkel,
|
||||
RiktekstKomponent,
|
||||
RiktekstTabell,
|
||||
RiktekstPrinsipp,
|
||||
RiktekstTabell,
|
||||
} from "./riktekst";
|
||||
import SpesialSeksjon from "./spesial-seksjon";
|
||||
import Tastatur from "./tastatur";
|
||||
import Tips from "./tips";
|
||||
import TokenRef from "./token-tabell";
|
||||
import Video from "./video";
|
||||
import { tmpTabell, tmpTabellRow } from "./tabellv2";
|
||||
|
||||
const v2Blocks = [
|
||||
tmpTabell,
|
||||
@@ -36,6 +36,7 @@ const v2Blocks = [
|
||||
RiktekstPrinsipp,
|
||||
|
||||
/* Moduler */
|
||||
/* Tabellv2, */
|
||||
DoDont,
|
||||
doDontBlock,
|
||||
Bilde,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Usikker på om skal være med videre
|
||||
|
||||
import { FileContent } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
initialValue: false,
|
||||
},
|
||||
{
|
||||
title: "Installasjon-snippet",
|
||||
title: "Eksempel-navn",
|
||||
name: "dir",
|
||||
type: "reference",
|
||||
to: [{ type: "kode_eksempler_fil" }],
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import React from "react";
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import { List } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import { allDocumentTypes } from "../../config";
|
||||
import { Link } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Star } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
export default {
|
||||
title: "Sidemodul",
|
||||
title: "Unik Sidemodul",
|
||||
type: "object",
|
||||
name: "spesial_seksjon",
|
||||
icon: Star,
|
||||
@@ -14,26 +14,13 @@ export default {
|
||||
type: "string",
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Farge kategori", value: "farge_kategori" },
|
||||
{ title: "Token kategori", value: "token_kategori" },
|
||||
{ title: "Ikonsøk", value: "ikonsok" },
|
||||
{ title: "Endringslogg", value: "endringslogg" },
|
||||
{ title: "Komponentoversikt", value: "komponentoversikt" },
|
||||
/* ...Object.keys(docs).map((x) => ({
|
||||
title: `Tokenvisning: ${x}`,
|
||||
value: `tokens_${x}`,
|
||||
})), */
|
||||
],
|
||||
layout: "radio",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Farge kategori",
|
||||
type: "reference",
|
||||
name: "farge_ref",
|
||||
hidden: ({ parent }) => parent.modul !== "farge_kategori",
|
||||
to: [{ type: "ds_color_categories" }],
|
||||
},
|
||||
{
|
||||
title: "Token kategori",
|
||||
type: "reference",
|
||||
@@ -49,7 +36,7 @@ export default {
|
||||
prepare(s) {
|
||||
return {
|
||||
title: s.modul,
|
||||
subtitle: "Sidemodul",
|
||||
subtitle: "Unik Sidemodul",
|
||||
media: () => <Star />,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -4,12 +4,22 @@ import schemaTypes from "all:part:@sanity/base/schema-type";
|
||||
/* Schemas */
|
||||
/* Documents */
|
||||
import editors from "./documents/editors";
|
||||
import navigation, { dropdown, link } from "./documents/navigation";
|
||||
import frontpage from "./documents/frontpage";
|
||||
import redirect from "./documents/redirects";
|
||||
import KodeEksempler from "./documents/kode-eksempler";
|
||||
import Tokens from "./documents/tokens";
|
||||
import Props from "./documents/props";
|
||||
import DsFrontpage from "./documents/ds-frontpage";
|
||||
import DsCompTemplate from "./documents/component-template";
|
||||
import KompArtikkel from "./documents/komponent";
|
||||
import AkselTema from "./documents/tema";
|
||||
import AkselArtikkel from "./documents/aksel-artikkel";
|
||||
import DsArtikkel from "./documents/ds-artikkel";
|
||||
import Blogg from "./documents/blogg";
|
||||
import Prinsipp from "./documents/prinsipp";
|
||||
import Standalone from "./documents/standalone";
|
||||
import Navigation, { ds_header_heading } from "./documents/navigation";
|
||||
|
||||
import * as Designsystem from "./documents/designsystem";
|
||||
import * as Aksel from "./documents/aksel";
|
||||
import v2Blocks from "./modules";
|
||||
|
||||
export default createSchema({
|
||||
@@ -18,28 +28,22 @@ export default createSchema({
|
||||
...v2Blocks,
|
||||
frontpage,
|
||||
editors,
|
||||
navigation,
|
||||
link,
|
||||
dropdown,
|
||||
redirect,
|
||||
Navigation,
|
||||
ds_header_heading,
|
||||
KompArtikkel,
|
||||
|
||||
Designsystem.Color,
|
||||
Designsystem.ds_header_heading,
|
||||
Designsystem.ColorCategories,
|
||||
Designsystem.TokensOld,
|
||||
Designsystem.TokenKategori,
|
||||
Designsystem.KodeEksempler,
|
||||
Designsystem.Props,
|
||||
Designsystem.ComponentTemplate,
|
||||
Designsystem.Frontpage,
|
||||
Designsystem.Navigation,
|
||||
Designsystem.KomponentArtikkel,
|
||||
Designsystem.Artikkel,
|
||||
KodeEksempler,
|
||||
Tokens,
|
||||
Props,
|
||||
DsFrontpage,
|
||||
DsCompTemplate,
|
||||
DsArtikkel,
|
||||
|
||||
Aksel.Artikkel,
|
||||
Aksel.Blogg,
|
||||
Aksel.Tema,
|
||||
Aksel.Prinsipp,
|
||||
Aksel.Standalone,
|
||||
AkselArtikkel,
|
||||
Blogg,
|
||||
AkselTema,
|
||||
Prinsipp,
|
||||
Standalone,
|
||||
]),
|
||||
});
|
||||
@@ -7,6 +7,8 @@ if (!sanityToken) {
|
||||
throw new Error("Could not find token from SANITY_TOKEN");
|
||||
}
|
||||
|
||||
console.log(sanityToken);
|
||||
|
||||
const client = sanityClient({
|
||||
projectId: SanityConfig.api.projectId,
|
||||
dataset: SanityConfig.api.dataset,
|
||||
@@ -45,4 +47,4 @@ const main = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
main();
|
||||
/* main(); */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,22 @@
|
||||
import { definePreview } from "next-sanity/preview";
|
||||
import { ComponentType } from "react";
|
||||
import { config } from "../lib/sanity/config";
|
||||
|
||||
const usePreview = definePreview(config);
|
||||
|
||||
const WithPreview = ({
|
||||
comp: Comp,
|
||||
query,
|
||||
params,
|
||||
props,
|
||||
}: {
|
||||
comp: ComponentType;
|
||||
query: string;
|
||||
props: any;
|
||||
params?: any;
|
||||
}) => {
|
||||
const data = usePreview(null, query, params);
|
||||
return <Comp {...props} {...data} />;
|
||||
};
|
||||
|
||||
export default WithPreview;
|
||||
@@ -4,7 +4,6 @@ import { SanityT } from "@/lib";
|
||||
import AkselArtikkelTemplate from "./page-templates/AkselArtikkel";
|
||||
import AkselBloggTemplate from "./page-templates/AkselBlogg";
|
||||
import ArtikkelTemplate from "./page-templates/Artikkel";
|
||||
import ArtikkelTabbedTemplate from "./page-templates/ArtikkelTabbed";
|
||||
import KomponentArtikkelTemplate from "./page-templates/KomponentArtikkel";
|
||||
import AkselPrinsippTemplate from "./page-templates/AkselPrinsipp";
|
||||
import AkselStandaloneTemplate from "./page-templates/AkselStandalone";
|
||||
@@ -61,12 +60,7 @@ type templateT =
|
||||
|
||||
const templates: templateT = {
|
||||
komponent_artikkel: (props) => <KomponentArtikkelTemplate {...props} />,
|
||||
ds_artikkel: (props) =>
|
||||
props.data.artikkel_type ? (
|
||||
<ArtikkelTabbedTemplate {...props} />
|
||||
) : (
|
||||
<ArtikkelTemplate {...props} />
|
||||
),
|
||||
ds_artikkel: (props) => <ArtikkelTemplate {...props} />,
|
||||
aksel_artikkel: (props) => <AkselArtikkelTemplate {...props} />,
|
||||
aksel_blogg: (props) => <AkselBloggTemplate {...props} />,
|
||||
aksel_prinsipp: (props) => <AkselPrinsippTemplate {...props} />,
|
||||
|
||||
@@ -26,14 +26,14 @@ const Footer = ({ variant = "ds" }: { variant: "ds" | "aksel" }) => {
|
||||
</Heading>
|
||||
<BodyShort as="ul" className="mt-5 grid gap-2">
|
||||
<li>
|
||||
<NextLink href="/artikkel/om-aksel" passHref>
|
||||
<NextLink href="/god-praksis/artikler/om-aksel" passHref>
|
||||
<Link className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200">
|
||||
Om Aksel
|
||||
</Link>
|
||||
</NextLink>
|
||||
</li>
|
||||
<li>
|
||||
<NextLink href="/artikkel/skriv-for-aksel" passHref>
|
||||
<NextLink href="/god-praksis/artikler/skriv-for-aksel" passHref>
|
||||
<Link className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200">
|
||||
Skriv for Aksel
|
||||
</Link>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { getTemaSlug, SanityT, urlFor } from "@/lib";
|
||||
import { SanityT, urlFor } from "@/lib";
|
||||
import { SanityBlockContent } from "@/sanity-block";
|
||||
import { Next } from "@navikt/ds-icons";
|
||||
import { BodyShort, Heading, Ingress, Label } from "@navikt/ds-react";
|
||||
import { FooterSlope } from "components/website-modules/Slope";
|
||||
import Head from "next/head";
|
||||
import NextLink from "next/link";
|
||||
|
||||
import {
|
||||
abbrName,
|
||||
ArtikkelCard,
|
||||
@@ -42,7 +43,7 @@ const AkselArtikkelTemplate = ({
|
||||
</Heading>
|
||||
<div className="card-grid-3-1 mt-6 px-4">
|
||||
{data.relevante_artikler.map((x: any) => (
|
||||
<ArtikkelCard {...x} source={x.title} key={x._id} />
|
||||
<ArtikkelCard {...x} key={x._id} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -110,11 +111,11 @@ const AkselArtikkelTemplate = ({
|
||||
</div>
|
||||
{hasTema && (
|
||||
<div className="mt-8 flex flex-wrap gap-2">
|
||||
{data.tema.map(({ title }: any) => (
|
||||
{data.tema.map(({ title, slug }: any) => (
|
||||
<span key={title}>
|
||||
<NextLink
|
||||
key={title}
|
||||
href={`/tema/${getTemaSlug(title)}`}
|
||||
href={`/god-praksis/${slug.current}`}
|
||||
passHref
|
||||
>
|
||||
<BodyShort
|
||||
|
||||
@@ -2,6 +2,7 @@ import { SanityT, urlFor } from "@/lib";
|
||||
import { SanityBlockContent } from "@/sanity-block";
|
||||
import { BodyShort, Heading, Ingress, Label } from "@navikt/ds-react";
|
||||
import Head from "next/head";
|
||||
|
||||
import { abbrName, dateStr, Feedback, TableOfContents } from "../..";
|
||||
import Footer from "../footer/Footer";
|
||||
import AkselHeader from "../header/AkselHeader";
|
||||
|
||||
@@ -3,7 +3,6 @@ import { SanityT } from "@/lib";
|
||||
import { SanityBlockContent } from "@/sanity-block";
|
||||
import { Heading } from "@navikt/ds-react";
|
||||
import Head from "next/head";
|
||||
import React from "react";
|
||||
import Footer from "../footer/Footer";
|
||||
import AkselHeader from "../header/AkselHeader";
|
||||
|
||||
@@ -33,7 +32,7 @@ const AkselStandaloneTemplate = ({
|
||||
<main
|
||||
tabIndex={-1}
|
||||
id="hovedinnhold"
|
||||
className="aksel-artikkel bg-gray-50 pt-[8vw] pb-16 focus:outline-none xs:pb-32"
|
||||
className="aksel-artikkel xs:pb-32 bg-gray-50 pt-[8vw] pb-16 focus:outline-none"
|
||||
>
|
||||
<div className="px-4">
|
||||
<div className="dynamic-wrapper-prose">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { SanityT } from "@/lib";
|
||||
import { SanityBlockContent } from "@/sanity-block";
|
||||
import { BodyShort, Heading } from "@navikt/ds-react";
|
||||
import cl from "classnames";
|
||||
import Head from "next/head";
|
||||
|
||||
import { dateStr, Feedback, TableOfContents } from "../..";
|
||||
|
||||
const ArtikkelTemplate = ({
|
||||
@@ -16,11 +16,6 @@ const ArtikkelTemplate = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
const layout = cl({
|
||||
"content-box--full": data.layout === "full",
|
||||
"content-box": data.layout !== "full",
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -31,6 +26,7 @@ const ArtikkelTemplate = ({
|
||||
</>
|
||||
)}
|
||||
</Head>
|
||||
|
||||
<div className="content-box">
|
||||
<div className="pt-8 pb-6">
|
||||
<Heading
|
||||
@@ -53,7 +49,7 @@ const ArtikkelTemplate = ({
|
||||
</div>
|
||||
<div className="relative flex max-w-full md:max-w-7xl">
|
||||
<TableOfContents changedState={data.content} hideToc={false} />
|
||||
<div className={layout}>
|
||||
<div className="content-box">
|
||||
<SanityBlockContent className="mt-12" blocks={data.content} />
|
||||
<Feedback docId={data?._id} docType={data?._type} />
|
||||
</div>
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
import { SanityT } from "@/lib";
|
||||
import { SanityBlockContent } from "@/sanity-block";
|
||||
import { BodyShort, Heading, Tabs } from "@navikt/ds-react";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { capitalize, dateStr, Feedback, logNav, TableOfContents } from "../..";
|
||||
|
||||
const ArtikkelTabbedTemplate = ({
|
||||
data,
|
||||
title,
|
||||
}: {
|
||||
data: SanityT.Schema.ds_artikkel;
|
||||
title: string;
|
||||
}): JSX.Element => {
|
||||
const { query, push } = useRouter();
|
||||
|
||||
if (!data.content_tabs || !data.heading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const basePath = `/designsystem/side/${query.slug[1]}`;
|
||||
|
||||
const tabs: string[] = data.content_tabs.map(
|
||||
(tab) => tab.title?.toLowerCase().replace(/\s+/g, "-") || "undefined"
|
||||
);
|
||||
const activeTab = query.slug[2] ? tabs.indexOf(query.slug[2]) : 0;
|
||||
const tabTitle = data?.content_tabs?.[activeTab]?.title;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
{data.heading && (
|
||||
<>
|
||||
<title>{`${data.heading} ${tabTitle ?? ""} - ${title}`}</title>
|
||||
<meta property="og:title" content={`${data.heading} - ${title}`} />
|
||||
</>
|
||||
)}
|
||||
</Head>
|
||||
<div className="content-box">
|
||||
<div className="pt-8 pb-6">
|
||||
<Heading
|
||||
size="xlarge"
|
||||
level="1"
|
||||
spacing
|
||||
className="algolia-index-lvl1"
|
||||
>
|
||||
{data.heading}
|
||||
</Heading>
|
||||
|
||||
<BodyShort
|
||||
size="small"
|
||||
as="span"
|
||||
className="text-text-subtle flex items-center"
|
||||
>
|
||||
{`Oppdatert ${dateStr(data._updatedAt)}`}
|
||||
</BodyShort>
|
||||
</div>
|
||||
</div>
|
||||
{tabs.length > 1 && (
|
||||
<Tabs
|
||||
className="top-0 z-[1001]"
|
||||
value={data.content_tabs[activeTab]?.title
|
||||
.toLowerCase()
|
||||
.replace(/\s+/g, "-")}
|
||||
onChange={(x) => {
|
||||
push(`${basePath}/${x}`, undefined, { shallow: true });
|
||||
logNav("tabs", window.location.pathname, `${basePath}/${x}`);
|
||||
}}
|
||||
>
|
||||
<Tabs.List className="mx-0 px-2 md:mx-12 md:px-0">
|
||||
{data.content_tabs.map((x) => (
|
||||
<Tabs.Tab
|
||||
as="button"
|
||||
key={x.title}
|
||||
value={x.title?.toLowerCase().replace(/\s+/g, "-")}
|
||||
label={capitalize(x.title)}
|
||||
/>
|
||||
))}
|
||||
</Tabs.List>
|
||||
{data.content_tabs.map((x) => (
|
||||
<Tabs.Panel
|
||||
className="tabpanel relative max-w-full md:max-w-7xl"
|
||||
key={x.title}
|
||||
value={x.title?.toLowerCase().replace(/\s+/g, "-")}
|
||||
>
|
||||
<TableOfContents changedState={x.content} hideToc={false} />
|
||||
<div className="content-box">
|
||||
<SanityBlockContent className="mt-12" blocks={x.content} />
|
||||
<Feedback docId={data?._id} docType={data?._type} />
|
||||
</div>
|
||||
</Tabs.Panel>
|
||||
))}
|
||||
</Tabs>
|
||||
)}
|
||||
<style jsx global>{`
|
||||
.tabpanel[data-state="active"] {
|
||||
display: flex;
|
||||
}
|
||||
`}</style>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ArtikkelTabbedTemplate;
|
||||
@@ -55,7 +55,6 @@ const KomponentArtikkelTemplate = ({
|
||||
content={`${data.heading} - Designsystemet`}
|
||||
/>
|
||||
</Head>
|
||||
|
||||
<div className="content-box">
|
||||
<div className="pt-8">
|
||||
<div className="flex flex-wrap gap-2"></div>
|
||||
@@ -123,7 +122,7 @@ const KomponentArtikkelTemplate = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative flex max-w-full md:max-w-7xl">
|
||||
<TableOfContents changedState={data["bruk_tab"]} hideToc={false} />
|
||||
<TableOfContents changedState={data["content"]} hideToc={false} />
|
||||
<div className="content-box">
|
||||
<div className="mt-12">
|
||||
{data?.status && data.status?.tag === "beta" && (
|
||||
@@ -133,8 +132,9 @@ const KomponentArtikkelTemplate = ({
|
||||
</Heading>
|
||||
<BodyLong className="override-text-no-max mb-2">
|
||||
Komponenten er under utvikling. Dette kan medføre
|
||||
breaking-changes i patch/minor versjon av kodepakker. Vær
|
||||
forsiktig ved bruk og unngå production om mulig.
|
||||
breaking-changes i patch/minor versjon av kodepakker. Teamet
|
||||
ditt må selv ta stilling til om dere ønsker å bruke denne i
|
||||
produksjon.
|
||||
</BodyLong>
|
||||
<BodyLong className="override-text-no-max">
|
||||
Har du innspill eller funnet en bug? Send oss en melding her
|
||||
@@ -144,7 +144,7 @@ const KomponentArtikkelTemplate = ({
|
||||
</div>
|
||||
)}
|
||||
<IntroSeksjon node={data.intro} />
|
||||
<SanityBlockContent blocks={data["bruk_tab"]} />
|
||||
<SanityBlockContent blocks={data["content"]} />
|
||||
</div>
|
||||
<Feedback docId={data?._id} docType={data?._type} />
|
||||
</div>
|
||||
|
||||
@@ -12,12 +12,7 @@ const IconSearch = dynamic(() => import("./icon-search"), {
|
||||
type SpesialT = {
|
||||
_key: string;
|
||||
_type: "spesial_seksjon";
|
||||
modul?:
|
||||
| "farge_kategori"
|
||||
| "ikonsok"
|
||||
| "endringslogg"
|
||||
| "komponentoversikt"
|
||||
| "token_kategori";
|
||||
modul?: "ikonsok" | "komponentoversikt" | "token_kategori";
|
||||
logs?: any[];
|
||||
komponenter?: any;
|
||||
farge?: any;
|
||||
@@ -31,8 +26,6 @@ const SideModul = ({ node }: { node: SpesialT }): JSX.Element => {
|
||||
|
||||
const GetModule = () => {
|
||||
switch (node.modul) {
|
||||
case "farge_kategori":
|
||||
return null;
|
||||
case "komponentoversikt":
|
||||
return <ComponentOverview node={node.komponenter} />;
|
||||
case "ikonsok":
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getTemaSlug, SanityT } from "@/lib";
|
||||
import { SanityT } from "@/lib";
|
||||
import { BodyShort, Detail, Heading } from "@navikt/ds-react";
|
||||
import NextLink from "next/link";
|
||||
import { abbrName, dateStr, logNav } from "../..";
|
||||
@@ -23,7 +23,7 @@ export const ArtikkelCard = ({
|
||||
href={{
|
||||
pathname: `/${slug}`,
|
||||
query: {
|
||||
...(source ? { tema: getTemaSlug(source) } : {}),
|
||||
...(source ? { tema: source } : {}),
|
||||
},
|
||||
}}
|
||||
passHref
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { getTemaSlug } from "@/lib";
|
||||
import { BodyShort, Heading } from "@navikt/ds-react";
|
||||
import NextLink from "next/link";
|
||||
import { logNav } from "../..";
|
||||
@@ -9,11 +8,12 @@ export const TemaCard = ({
|
||||
title,
|
||||
refCount,
|
||||
compact = false,
|
||||
}: AkselTemaT & { compact?: boolean }) => {
|
||||
slug,
|
||||
}: AkselTemaT & { compact?: boolean; urlPrefix?: string }) => {
|
||||
return (
|
||||
<NextLink href={`/tema/${getTemaSlug(title)}`} passHref>
|
||||
<NextLink href={`/god-praksis/${slug.current}`} passHref>
|
||||
<a
|
||||
className="group relative rounded-r-md rounded-l bg-white shadow transition-colors ease-in-out focus:outline-none focus-visible:shadow-focus sm:shadow-md"
|
||||
className="focus-visible:shadow-focus group relative rounded-r-md rounded-l bg-white shadow transition-colors ease-in-out focus:outline-none sm:shadow-md"
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"temakort",
|
||||
|
||||
@@ -3,6 +3,7 @@ import { SanityT, urlFor } from "@/lib";
|
||||
import { Heading, Tag } from "@navikt/ds-react";
|
||||
import Nextlink from "next/link";
|
||||
import cl from "classnames";
|
||||
import Image from "next/image";
|
||||
|
||||
const getStatus = (status?: SanityT.Schema.komponent_artikkel["status"]) => {
|
||||
switch (status?.tag) {
|
||||
@@ -75,11 +76,14 @@ const ComponentOverview = ({
|
||||
)}
|
||||
>
|
||||
{x.status?.bilde ? (
|
||||
<img
|
||||
alt={x?.heading + " thumbnail"}
|
||||
decoding="async"
|
||||
<Image
|
||||
src={urlFor(x.status?.bilde).auto("format").url()}
|
||||
className="object-contain transition-transform"
|
||||
decoding="async"
|
||||
width="320px"
|
||||
height="256px"
|
||||
layout="fixed"
|
||||
objectFit="contain"
|
||||
alt={x?.heading + " thumbnail"}
|
||||
/>
|
||||
) : (
|
||||
<svg
|
||||
|
||||
@@ -7,13 +7,30 @@ import React, { useCallback, useEffect, useState } from "react";
|
||||
import Filter, { FilterT } from "./Filter";
|
||||
import { categorizeIcons, CategoryT, IconMetaT } from "./iconCategories";
|
||||
|
||||
const SkeletonElement = () => (
|
||||
<div className="vk-icon_button bg-surface-subtle h-32 w-48 shrink rounded" />
|
||||
);
|
||||
|
||||
const ModalPlaceholder = () => (
|
||||
<div className="min-h-96 w-[600px] max-w-[90%]" />
|
||||
);
|
||||
|
||||
const IconView = dynamic(() => import("./IconView"), {
|
||||
loading: () => <div className="min-h-screen w-full" />,
|
||||
loading: () => (
|
||||
<div className="min-h-screen w-full pt-8">
|
||||
<div className="bg-surface-subtle mb-3 h-5 w-48 rounded-full" />
|
||||
<div className="grid content-start justify-start gap-x-4 gap-y-6 pb-8 [grid-template-columns:repeat(auto-fit,12rem)]">
|
||||
{[...Array(24)].map((_, y) => (
|
||||
<SkeletonElement key={y} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
const ModalContent = dynamic(() => import("./ModalContent"), {
|
||||
loading: () => <div className="min-h-[90vw] w-[600px] max-w-[90%]" />,
|
||||
loading: () => <ModalPlaceholder />,
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
@@ -150,7 +167,11 @@ const IconSearch = () => {
|
||||
</BodyLong>
|
||||
<Modal open={open} onClose={() => handleClose()}>
|
||||
<Modal.Content>
|
||||
{selectedIcon && <ModalContent icon={selectedIcon} />}
|
||||
{selectedIcon ? (
|
||||
<ModalContent icon={selectedIcon} />
|
||||
) : (
|
||||
<ModalPlaceholder />
|
||||
)}
|
||||
</Modal.Content>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
@@ -55,6 +55,7 @@ export const CopyToken = ({ val }: { val: string }) => {
|
||||
"bg-surface-action-selected text-md text-text-on-action flex h-7 w-full px-2 font-sans text-sm",
|
||||
{ "animate-popup translate-y-[-100%]": copyTimer }
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
<span
|
||||
className={cl("flex w-full items-center justify-center gap-1", {
|
||||
|
||||
@@ -17,8 +17,8 @@ export const BreadCrumbs = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<NextLink href={href ?? `/tema/${router.query.tema}`} passHref>
|
||||
<a className="group mb-1 flex w-fit items-center justify-start text-deepblue-500 hover:text-deepblue-800 focus:underline focus:outline-none">
|
||||
<NextLink href={href ?? `/god-praksis/${router.query.tema}`} passHref>
|
||||
<a className="text-deepblue-500 hover:text-deepblue-800 group mb-1 flex w-fit items-center justify-start focus:underline focus:outline-none">
|
||||
<svg
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -33,7 +33,7 @@ export const BreadCrumbs = ({
|
||||
<path
|
||||
d="M16 9.72266L8 9.72266"
|
||||
strokeWidth="1.5"
|
||||
className="hidden stroke-deepblue-500 group-hover:block group-hover:stroke-deepblue-800"
|
||||
className="stroke-deepblue-500 group-hover:stroke-deepblue-800 hidden group-hover:block"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
/**
|
||||
* https://github.com/navikt/detsombetyrnoe/blob/main/src/components/PreviewBanner.tsx#L17
|
||||
*/
|
||||
import { useCurrentUser } from "@/lib";
|
||||
import { Edit } from "@navikt/ds-icons";
|
||||
import { Tooltip } from "@navikt/ds-react";
|
||||
import * as React from "react";
|
||||
import { useContext } from "react";
|
||||
import { IdContext } from "./utils";
|
||||
import cl from "classnames";
|
||||
import { useContext } from "react";
|
||||
import { IdContext, useCheckAuth } from "./utils";
|
||||
|
||||
function EditButton({ variant }: { variant: "ds" | "aksel" }): JSX.Element {
|
||||
const { data } = useCurrentUser();
|
||||
const idCtx = useContext(IdContext);
|
||||
|
||||
return data && idCtx?.id ? (
|
||||
const validUser = useCheckAuth();
|
||||
|
||||
return validUser && idCtx?.id ? (
|
||||
<>
|
||||
<div className="overflow-hidden">
|
||||
<Tooltip
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
/**
|
||||
* https://github.com/navikt/detsombetyrnoe/blob/main/src/components/PreviewBanner.tsx#L17
|
||||
*/
|
||||
import { useCurrentUser } from "@/lib";
|
||||
import { useCheckAuth } from "./utils";
|
||||
import { BodyShort, Button, Detail } from "@navikt/ds-react";
|
||||
import { useRouter } from "next/router";
|
||||
import * as React from "react";
|
||||
|
||||
function PreviewBanner(): JSX.Element {
|
||||
const { asPath } = useRouter();
|
||||
const { data } = useCurrentUser();
|
||||
const validUser = useCheckAuth();
|
||||
|
||||
if (data === null) {
|
||||
if (!validUser) {
|
||||
return (
|
||||
<>
|
||||
<div className="fixed inset-0 z-[9999] bg-gray-900/70 backdrop-blur-sm" />
|
||||
@@ -43,7 +42,6 @@ function PreviewBanner(): JSX.Element {
|
||||
);
|
||||
}
|
||||
|
||||
if (!data) return null;
|
||||
return (
|
||||
<a
|
||||
href={`/api/exit-preview?slug=${asPath}`}
|
||||
|
||||
@@ -122,8 +122,9 @@ function Search({
|
||||
noResultsScreen: {
|
||||
noResultsText: "Ingen resultater for",
|
||||
suggestedQueryText: "Prøv disse søkene",
|
||||
openIssueText: "Bør søket gi et resultat?",
|
||||
openIssueLinkText: "Send oss en melding, så fikser vi",
|
||||
reportMissingResultsText: "Bør søket gi et resultat?",
|
||||
reportMissingResultsLinkText:
|
||||
"Send oss en melding, så fikser vi",
|
||||
},
|
||||
}}
|
||||
appId="J64I2SIG7K"
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import amplitude from "amplitude-js";
|
||||
import { isTest } from ".";
|
||||
import { isDevelopment } from "@/lib";
|
||||
|
||||
export enum AmplitudeEvents {
|
||||
"sidevisning" = "sidevisning",
|
||||
@@ -43,10 +41,13 @@ export const logNav = (kilde: string, fra: string, til: string) => {
|
||||
|
||||
const isPreview = () => !!document.getElementById("exit-preview-id");
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV === "development";
|
||||
const isTest = process.env.NEXT_PUBLIC_TEST === "true";
|
||||
|
||||
export function logAmplitudeEvent(eventName: string, data?: any): Promise<any> {
|
||||
return new Promise(function (resolve: any) {
|
||||
const eventData = data ? { ...data } : {};
|
||||
if (amplitude && !(isDevelopment() || isTest() || isPreview())) {
|
||||
if (amplitude && !(isDevelopment || isTest || isPreview())) {
|
||||
amplitude.getInstance().logEvent(eventName, eventData, resolve);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import { createContext } from "react";
|
||||
|
||||
export const IdContext = createContext<{ id?: string }>(null);
|
||||
@@ -3,6 +3,5 @@ import { PagePropsContextT } from "@/lib";
|
||||
|
||||
export const PagePropsContext = createContext<PagePropsContextT>(null);
|
||||
|
||||
export const IdContext = createContext<{ id?: string }>(null);
|
||||
|
||||
export * from "./authprovider";
|
||||
export * from "./id-context";
|
||||
@@ -1,4 +1,6 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { _checkAuth } from "@sanity/preview-kit";
|
||||
import { config } from "../../../lib/sanity/config";
|
||||
|
||||
export const useDebounce = (value: any) => {
|
||||
const [debouncedValue, setDebouncedValue] = useState(value);
|
||||
@@ -11,3 +13,13 @@ export const useDebounce = (value: any) => {
|
||||
|
||||
return debouncedValue;
|
||||
};
|
||||
|
||||
export const useCheckAuth = () => {
|
||||
const [user, setUser] = useState<boolean>(true);
|
||||
|
||||
useEffect(() => {
|
||||
_checkAuth(config.projectId, null).then(setUser);
|
||||
}, []);
|
||||
|
||||
return user;
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useEffect } from "react";
|
||||
|
||||
const environment = process.env.NODE_ENV;
|
||||
const test = process.env.NEXT_PUBLIC_TEST;
|
||||
|
||||
export const isProduction = (): boolean => {
|
||||
if (typeof window !== "undefined") {
|
||||
@@ -15,10 +14,6 @@ export const isProduction = (): boolean => {
|
||||
}
|
||||
};
|
||||
|
||||
export function isTest(): boolean {
|
||||
return test === "true";
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/38588346/anchor-a-tags-not-working-in-chrome-when-using/38588927#38588927
|
||||
// https://github.com/vercel/next.js/discussions/13134
|
||||
export function useScrollToHashOnPageLoad(): void {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
[
|
||||
"/",
|
||||
"/designsystem",
|
||||
"/tema",
|
||||
"/blogg",
|
||||
"/god-praksis",
|
||||
"/produktbloggen",
|
||||
"/designsystem/komponenter/tag",
|
||||
"/designsystem/side/migrering",
|
||||
"/designsystem/side/ikoner",
|
||||
"/tema/innholdsarbeid",
|
||||
"/tema/brukerinnsikt",
|
||||
"/tema/universell-utforming",
|
||||
"/artikkel/innholdsstrategi-for-nav-no?tema=innholdsarbeid",
|
||||
"/blogg/ny-forside-pa-navno"
|
||||
"/god-praksis/innholdsarbeid",
|
||||
"/god-praksis/brukerinnsikt",
|
||||
"/god-praksis/universell-utforming",
|
||||
"/god-praksis/artikler/innholdsstrategi-for-nav-no?tema=innholdsarbeid"
|
||||
]
|
||||
@@ -58,12 +58,19 @@ const transform = (src: any, type?: string) => {
|
||||
return newData;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
const docs = await noCdnClient(token).fetch(
|
||||
`*[_type in ["komponent_artikkel","ds_artikkel","aksel_artikkel","aksel_prinsipp","aksel_blogg","aksel_standalone"]]`
|
||||
);
|
||||
*/
|
||||
|
||||
const main = async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const transactionClient = noCdnClient(token).transaction();
|
||||
|
||||
const docs = await noCdnClient(token).fetch(
|
||||
`*[_type in ["komponent_artikkel","ds_artikkel","aksel_artikkel","aksel_prinsipp","aksel_blogg","aksel_standalone"]]`
|
||||
`*[_type in ["komponent_artikkel"]]`
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@@ -72,8 +79,6 @@ const main = async () => {
|
||||
docs.forEach((data) => {
|
||||
switch (data._type) {
|
||||
case "aksel_artikkel":
|
||||
/* data.innhold &&
|
||||
newData.push({ _id: data._id, content: transform(data.innhold) }); */
|
||||
break;
|
||||
case "aksel_prinsipp":
|
||||
break;
|
||||
@@ -84,6 +89,11 @@ const main = async () => {
|
||||
case "ds_artikkel":
|
||||
break;
|
||||
case "komponent_artikkel":
|
||||
/* data.bruk_tab &&
|
||||
newData.push({
|
||||
_id: data._id,
|
||||
content: data.bruk_tab.map((x) => ({ ...x, _key: randKey() })),
|
||||
}); */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -93,9 +103,10 @@ const main = async () => {
|
||||
/* for (const data of newData) {
|
||||
const id = data._id;
|
||||
delete data._id;
|
||||
transactionClient.patch(id, (p) => p.set({ ...data }));
|
||||
} */
|
||||
/* await transactionClient
|
||||
transactionClient.patch(id, (p) => p.set({ ...data }).unset(["bruk_tab"]));
|
||||
}
|
||||
|
||||
await transactionClient
|
||||
.commit({ autoGenerateArrayKeys: true, dryRun: true })
|
||||
.then(() => console.log(`Updated!`))
|
||||
.catch((e) => console.error(e.message)); */
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Migration template
|
||||
*/
|
||||
|
||||
import dotenv from "dotenv";
|
||||
import { noCdnClient } from "../sanity/sanity.server";
|
||||
import { customAlphabet } from "nanoid/non-secure";
|
||||
|
||||
dotenv.config();
|
||||
const token = process.env.SANITY_WRITE_KEY;
|
||||
|
||||
/* Key-function used by sanity */
|
||||
const randKey = () => {
|
||||
const nanoid = customAlphabet("1234567890abcdef", 12);
|
||||
return nanoid();
|
||||
};
|
||||
|
||||
const main = async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const transactionClient = noCdnClient(token).transaction();
|
||||
|
||||
const docs = await noCdnClient(token).fetch(`*[_type in ["ds_artikkel"]]`);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const newData = [];
|
||||
|
||||
docs.forEach((data) => {
|
||||
data?.slug?.current
|
||||
? newData.push({
|
||||
_id: data._id,
|
||||
kategori: "styling",
|
||||
slug_v2: {
|
||||
_type: "slug",
|
||||
current: data.slug.current.replace(
|
||||
"designsystem/side/",
|
||||
"grunnleggende/styling/"
|
||||
),
|
||||
},
|
||||
})
|
||||
: console.log(data.heading);
|
||||
});
|
||||
|
||||
for (const data of newData) {
|
||||
const id = data._id;
|
||||
delete data._id;
|
||||
transactionClient.patch(id, (p) =>
|
||||
p
|
||||
.set({ ...data })
|
||||
.unset(["metadata_feedback", "isMigrated", "artikkel_type"])
|
||||
);
|
||||
}
|
||||
/* transactionClient.create({
|
||||
_type: "redirect",
|
||||
source: `/tema`,
|
||||
destination: `/god-praksis`,
|
||||
permanent: true,
|
||||
});*/
|
||||
|
||||
await transactionClient
|
||||
.commit({ autoGenerateArrayKeys: true, dryRun: true })
|
||||
.then((a) => console.log(`Updated! \n${JSON.stringify(a, null, 2)}`))
|
||||
.catch((e) => console.error(e.message));
|
||||
};
|
||||
|
||||
main();
|
||||
@@ -121,13 +121,6 @@ const spesialSeksjon = `_type == "spesial_seksjon" =>{
|
||||
slug,
|
||||
}
|
||||
},
|
||||
modul == "farge_kategori" =>{
|
||||
"farge": farge_ref->{..., description[]{
|
||||
...,
|
||||
${markDef}
|
||||
}
|
||||
}
|
||||
},
|
||||
modul == "token_kategori" =>{
|
||||
"token": token_ref->{...}
|
||||
}
|
||||
@@ -161,16 +154,18 @@ ${defaultBlock},
|
||||
|
||||
export const allDocuments = `*[]{...,'slug': slug.current }`;
|
||||
|
||||
export const akselTema = `*[_type == "aksel_tema"]{
|
||||
export const akselTema = `{"temaer": *[_type == "aksel_tema"]{
|
||||
...,
|
||||
"refCount": count(*[_type == "aksel_artikkel" && !(_id in path("drafts.**")) && references(^._id)])
|
||||
}`;
|
||||
}}`;
|
||||
|
||||
export const akselBloggPosts = `*[_type == "aksel_blogg"] | order(_createdAt desc){
|
||||
...,
|
||||
"slug": slug.current,
|
||||
contributors[]->{
|
||||
title
|
||||
export const akselBloggPosts = `{
|
||||
"bloggposts": *[_type == "aksel_blogg"] | order(_createdAt desc){
|
||||
...,
|
||||
"slug": slug.current,
|
||||
contributors[]->{
|
||||
title
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
@@ -187,50 +182,63 @@ export const akselForsideQuery = `*[_type == "vk_frontpage"][0]{
|
||||
hovedside->{slug, heading},
|
||||
undersider[]->{slug, heading}
|
||||
},
|
||||
"bloggs": ${akselBloggPosts},
|
||||
"temaer": ${akselTema}
|
||||
"bloggs": *[_type == "aksel_blogg"] | order(_createdAt desc){
|
||||
...,
|
||||
"slug": slug.current,
|
||||
contributors[]->{
|
||||
title
|
||||
}
|
||||
},
|
||||
"temaer": *[_type == "aksel_tema"]{
|
||||
...,
|
||||
"refCount": count(*[_type == "aksel_artikkel" && !(_id in path("drafts.**")) && references(^._id)])
|
||||
}
|
||||
}`;
|
||||
|
||||
export const akselDocumentsByType = `*[_type in $types]{ _type, _id, 'slug': slug.current }`;
|
||||
|
||||
export const akselPrinsippBySlug = `*[slug.current == $slug] | order(_updatedAt desc)[0]
|
||||
{
|
||||
...,
|
||||
"slug": slug.current,
|
||||
"content": select(
|
||||
$valid == "true" => content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
$valid != "true" => []
|
||||
),
|
||||
contributors[]->{
|
||||
title
|
||||
export const akselPrinsippBySlug = `{
|
||||
"prinsipp": *[slug.current == $slug] | order(_updatedAt desc)[0]
|
||||
{
|
||||
...,
|
||||
"slug": slug.current,
|
||||
"content": select(
|
||||
$valid == "true" => content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
$valid != "true" => []
|
||||
),
|
||||
contributors[]->{
|
||||
title
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
export const akselDocumentBySlug = `*[slug.current == $slug] | order(_updatedAt desc)[0]
|
||||
{
|
||||
...,
|
||||
"slug": slug.current,
|
||||
content[]{
|
||||
export const akselDocumentBySlug = `{
|
||||
"page": *[slug.current == $slug] | order(_updatedAt desc)[0]
|
||||
{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
tema[]->{title},
|
||||
contributors[]->{
|
||||
title
|
||||
},
|
||||
relevante_artikler[]->{
|
||||
_id,
|
||||
heading,
|
||||
_createdAt,
|
||||
_updatedAt,
|
||||
publishedAt,
|
||||
"slug": slug.current,
|
||||
"tema": tema[]->tag,
|
||||
ingress,
|
||||
"contributor": contributors[0]->title,
|
||||
content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
tema[]->{title, slug},
|
||||
contributors[]->{
|
||||
title
|
||||
},
|
||||
relevante_artikler[]->{
|
||||
_id,
|
||||
heading,
|
||||
_createdAt,
|
||||
_updatedAt,
|
||||
publishedAt,
|
||||
"slug": slug.current,
|
||||
"tema": tema[]->tag,
|
||||
ingress,
|
||||
"contributor": contributors[0]->title,
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
@@ -289,21 +297,10 @@ export const dsSlugQuery = `{
|
||||
${deRefs}
|
||||
}
|
||||
},
|
||||
bruk_tab[]{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
content_tabs[]{
|
||||
...,
|
||||
content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
}
|
||||
},
|
||||
},
|
||||
${dsNavQuery}
|
||||
}`;
|
||||
@@ -321,13 +318,12 @@ export const dsNavigationQuery = `
|
||||
}
|
||||
`;
|
||||
|
||||
export const akselTemaNames = `*[_type == "aksel_tema" && count(*[references(^._id)]) > 0].title`;
|
||||
export const akselTemaNames = `*[_type == "aksel_tema" && count(*[references(^._id)]) > 0].slug`;
|
||||
|
||||
export const akselTemaDocs = `*[_type == "aksel_tema"]{
|
||||
...,
|
||||
"ansvarlig": ansvarlig->{title, roller},
|
||||
bruk_seksjoner == true => {
|
||||
"artikler": [],
|
||||
export const akselTemaDocs = `{
|
||||
"tema": *[_type == "aksel_tema" && slug.current == $slug] | order(_updatedAt desc)[0]{
|
||||
...,
|
||||
"ansvarlig": ansvarlig->{title, roller},
|
||||
seksjoner[]{
|
||||
...,
|
||||
beskrivelse[]{
|
||||
@@ -346,35 +342,23 @@ export const akselTemaDocs = `*[_type == "aksel_tema"]{
|
||||
"contributor": contributors[0]->title,
|
||||
}
|
||||
}
|
||||
},
|
||||
bruk_seksjoner != true => {
|
||||
"artikler": *[_type=='aksel_artikkel' && references(^._id) && !(_id in path("drafts.**"))] | order(_createdAt desc){
|
||||
_id,
|
||||
heading,
|
||||
_createdAt,
|
||||
_updatedAt,
|
||||
publishedAt,
|
||||
"slug": slug.current,
|
||||
"tema": tema[]->tag,
|
||||
ingress,
|
||||
"contributor": contributors[0]->title,
|
||||
},
|
||||
"seksjoner": []
|
||||
},
|
||||
}
|
||||
}`;
|
||||
|
||||
export const akselBloggBySlug = `*[slug.current == $slug] | order(_updatedAt desc)[0]
|
||||
{
|
||||
...,
|
||||
"slug": slug.current,
|
||||
"content": select(
|
||||
$valid == "true" => content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
export const akselBloggBySlug = `{
|
||||
"blogg": *[slug.current == $slug && _type == "aksel_blogg"] | order(_updatedAt desc)[0]
|
||||
{
|
||||
...,
|
||||
"slug": slug.current,
|
||||
"content": select(
|
||||
$valid == "true" => content[]{
|
||||
...,
|
||||
${deRefs}
|
||||
},
|
||||
$valid != "true" => []
|
||||
),
|
||||
contributors[]->{
|
||||
title
|
||||
},
|
||||
$valid != "true" => []
|
||||
),
|
||||
contributors[]->{
|
||||
title
|
||||
},
|
||||
}
|
||||
}`;
|
||||
@@ -1,26 +1,14 @@
|
||||
import imageUrlBuilder from "@sanity/image-url";
|
||||
import {
|
||||
createCurrentUserHook,
|
||||
createPreviewSubscriptionHook,
|
||||
} from "next-sanity";
|
||||
import { SanityT } from "..";
|
||||
import { config } from "./config";
|
||||
import { akselDocumentsByType, akselTemaNames, dsDocuments } from "./queries";
|
||||
import { getClient, noCdnClient, sanityClient } from "./sanity.server";
|
||||
|
||||
const imageBuilder = imageUrlBuilder(sanityClient);
|
||||
|
||||
export const usePreviewSubscription = createPreviewSubscriptionHook(config);
|
||||
|
||||
export const useCurrentUser = createCurrentUserHook(config);
|
||||
|
||||
export function urlFor(source: any) {
|
||||
return imageBuilder.image(source);
|
||||
}
|
||||
|
||||
export const getTemaSlug = (s: string) =>
|
||||
s ? s.toLowerCase().trim().replace(/\s+/g, "-") : null;
|
||||
|
||||
export const getAllPages = async (token?: string) => {
|
||||
const pages = await getDsPaths(token).then((paths) =>
|
||||
paths.map((slugs) => slugs.join("/"))
|
||||
@@ -36,7 +24,7 @@ export const getAllPages = async (token?: string) => {
|
||||
"blogg",
|
||||
...pages,
|
||||
...artikler,
|
||||
...temaer.map((x) => `tema/${x}`),
|
||||
...temaer.map((x) => `god-praksis/${x}`),
|
||||
];
|
||||
};
|
||||
|
||||
@@ -54,8 +42,13 @@ export const getAkselDocuments = async (
|
||||
const documents: any[] | null = await client.fetch(akselDocumentsByType, {
|
||||
types:
|
||||
source === "all"
|
||||
? `["aksel_artikkel", "aksel_blogg", "aksel_prinsipp", "aksel_standalone"]`
|
||||
: `["${source}"]`,
|
||||
? [
|
||||
"aksel_artikkel",
|
||||
"aksel_blogg",
|
||||
"aksel_prinsipp",
|
||||
"aksel_standalone",
|
||||
]
|
||||
: [source],
|
||||
});
|
||||
const paths = [];
|
||||
|
||||
@@ -80,33 +73,7 @@ export const getDsPaths = async (token?: string): Promise<string[][]> => {
|
||||
return null;
|
||||
}
|
||||
const slug = page.slug.split("/");
|
||||
|
||||
const defaultPush = () => paths.push(slug);
|
||||
|
||||
switch (page._type) {
|
||||
case "ds_artikkel": {
|
||||
if (!page?.artikkel_type) {
|
||||
defaultPush();
|
||||
break;
|
||||
}
|
||||
if (!page.content_tabs) break;
|
||||
const tabbedArticleTabs = page.content_tabs
|
||||
.map((tab) => {
|
||||
return tab.content && tab.title
|
||||
? tab.title?.toLowerCase().replace(/\s+/g, "-")
|
||||
: null;
|
||||
})
|
||||
.filter((x) => !!x);
|
||||
tabbedArticleTabs.forEach((tab) => {
|
||||
paths.push([...slug, tab]);
|
||||
});
|
||||
defaultPush();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
defaultPush();
|
||||
break;
|
||||
}
|
||||
paths.push(slug);
|
||||
});
|
||||
return paths;
|
||||
};
|
||||
@@ -122,14 +89,7 @@ export const validateDsPath = (
|
||||
|
||||
if (slug.length === 2) return true;
|
||||
switch (doc._type) {
|
||||
case "ds_artikkel":
|
||||
return (
|
||||
isLvl2 &&
|
||||
doc.content_tabs &&
|
||||
doc.content_tabs.find(
|
||||
(x) => x.title?.toLowerCase().replace(/\s+/g, "-") === slug[2]
|
||||
)
|
||||
);
|
||||
/* Støtte gamle url-er */
|
||||
case "komponent_artikkel":
|
||||
return slug?.[2] === "kode";
|
||||
default:
|
||||
@@ -139,6 +99,6 @@ export const validateDsPath = (
|
||||
|
||||
export const getAkselTema = async (token?: string): Promise<string[]> => {
|
||||
const client = token ? noCdnClient(token) : getClient();
|
||||
const tags: string[] = await client.fetch(akselTemaNames);
|
||||
return tags.map(getTemaSlug);
|
||||
const tags: { current: string }[] = await client.fetch(akselTemaNames);
|
||||
return tags.map((x) => x?.current);
|
||||
};
|
||||
@@ -10,13 +10,7 @@ const docTypes = [
|
||||
|
||||
const akselSpesifics = `
|
||||
_type == "aksel_prinsipp" => {"prinsipp": prinsipp.prinsippvalg},
|
||||
_type == "aksel_artikkel" => {"tema": tema[]->title}`;
|
||||
|
||||
const dsSpesifics = `
|
||||
artikkel_type == true => {
|
||||
"tabs": content_tabs[].title
|
||||
}
|
||||
`;
|
||||
_type == "aksel_artikkel" => {"tema": tema[]->slug.current}`;
|
||||
|
||||
const query = `
|
||||
*[_type in $types]{
|
||||
@@ -25,7 +19,6 @@ const query = `
|
||||
"url": slug.current,
|
||||
heading,
|
||||
${akselSpesifics},
|
||||
${dsSpesifics}
|
||||
}`;
|
||||
|
||||
export const generateObjects = async () => {
|
||||
@@ -51,33 +44,10 @@ export const generateObjects = async () => {
|
||||
objects.push(doc);
|
||||
break;
|
||||
case "ds_artikkel":
|
||||
if (doc.tabs) {
|
||||
doc.tabs.forEach((x, i) =>
|
||||
objects.push({
|
||||
...doc,
|
||||
tab: x,
|
||||
url:
|
||||
i > 0
|
||||
? `${doc.url}/${x.toLowerCase().replace(/\s+/g, "-")}`
|
||||
: doc.url,
|
||||
})
|
||||
);
|
||||
break;
|
||||
}
|
||||
objects.push(doc);
|
||||
break;
|
||||
case "komponent_artikkel":
|
||||
objects.push({
|
||||
...doc,
|
||||
tab: "bruk",
|
||||
rank: 1,
|
||||
});
|
||||
objects.push({
|
||||
...doc,
|
||||
tab: "bruk",
|
||||
url: `${doc.url}/kode`,
|
||||
rank: 2,
|
||||
});
|
||||
objects.push(doc);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -4,7 +4,6 @@ export const mockArtikkel = {
|
||||
_rev: "p611vx-xfw-51n-25p-djs2hyal8",
|
||||
_type: "ds_artikkel",
|
||||
_updatedAt: "2022-05-13T14:00:57Z",
|
||||
artikkel_type: false,
|
||||
contributors: [
|
||||
{ title: "Ola Normann" },
|
||||
{ title: "Petter Pettersen" },
|
||||
|
||||
+130
-312
@@ -97,26 +97,6 @@ eks: Utvikler, Webanalytiker, uu-spesialist
|
||||
profile_page?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigation
|
||||
*/
|
||||
interface navigation extends Sanity.Document {
|
||||
_type: "navigation";
|
||||
|
||||
/**
|
||||
* Tittel - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Sidemeny - `Array`
|
||||
Linker eller dropdowns med linker. Maks dybde på 2 dropdowns er støttet. Sider må være publisert før de kan linkes her.
|
||||
*/
|
||||
sidemenu?: Array<
|
||||
Sanity.Keyed<navigation_dropdown> | Sanity.Keyed<navigation_link>
|
||||
>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect
|
||||
*/
|
||||
@@ -140,79 +120,105 @@ Linker eller dropdowns med linker. Maks dybde på 2 dropdowns er støttet. Sider
|
||||
}
|
||||
|
||||
/**
|
||||
* Fargekategori
|
||||
* Navigation
|
||||
*/
|
||||
interface ds_color_categories extends Sanity.Document {
|
||||
_type: "ds_color_categories";
|
||||
interface ds_navigation extends Sanity.Document {
|
||||
_type: "ds_navigation";
|
||||
|
||||
/**
|
||||
* Tittel - `String`
|
||||
* Designsystem navigajsons-struktur - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Beskrivelse - `RegistryReference`
|
||||
* Header linker - `Array`
|
||||
*/
|
||||
description?: riktekst_enkel;
|
||||
|
||||
/**
|
||||
* Farger - `Array`
|
||||
*/
|
||||
colors?: Array<Sanity.Keyed<ds_color>>;
|
||||
headings?: Array<Sanity.Keyed<ds_navigation_heading>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tokens
|
||||
* Komponentartikkel
|
||||
*/
|
||||
interface ds_tokens extends Sanity.Document {
|
||||
_type: "ds_tokens";
|
||||
interface komponent_artikkel extends Sanity.Document {
|
||||
_type: "komponent_artikkel";
|
||||
|
||||
/**
|
||||
* Navn - `String`
|
||||
* Publiseringsdato - `Datetime`
|
||||
Synlig bare for admins. Setter publiseringsdato for dokument
|
||||
*/
|
||||
title?: string;
|
||||
publishedAt?: string;
|
||||
|
||||
/**
|
||||
* Verdi - `String`
|
||||
* Redaktører - `Array`
|
||||
Legg til alle som har bidratt med denne siden!
|
||||
*/
|
||||
token?: string;
|
||||
contributors?: Array<Sanity.KeyedReference<editor>>;
|
||||
|
||||
/**
|
||||
* Faktisk verdi - `String`
|
||||
* Sidetittel - `String`
|
||||
Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av siden i URL.
|
||||
*/
|
||||
raw?: string;
|
||||
heading?: string;
|
||||
|
||||
/**
|
||||
* Parent - `String`
|
||||
* url - `Slug`
|
||||
*/
|
||||
parent?: string;
|
||||
slug?: {
|
||||
_type: "slug";
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Beskrivelse - `String`
|
||||
* url (v2) - `Slug`
|
||||
*/
|
||||
beskrivelse?: string;
|
||||
|
||||
/**
|
||||
* Autogenerert - `Boolean`
|
||||
*/
|
||||
autogenerated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tokens
|
||||
*/
|
||||
interface token_kategori extends Sanity.Document {
|
||||
_type: "token_kategori";
|
||||
|
||||
/**
|
||||
* Navn - `String`
|
||||
*/
|
||||
title?: string;
|
||||
slug_v2?: {
|
||||
_type: "slug_v2";
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Kategori - `String`
|
||||
*/
|
||||
kategori?: string;
|
||||
kategori?: "core" | "internal";
|
||||
|
||||
/**
|
||||
* Metadata - `Object`
|
||||
*/
|
||||
status?: {
|
||||
/**
|
||||
* Status - `String`
|
||||
*/
|
||||
tag?: "beta" | "new" | "ready" | "deprecated";
|
||||
|
||||
/**
|
||||
* Thumbnail/og-bilde - `Image`
|
||||
*/
|
||||
bilde?: {
|
||||
asset: Sanity.Asset;
|
||||
crop?: Sanity.ImageCrop;
|
||||
hotspot?: Sanity.ImageHotspot;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Intro - `RegistryReference`
|
||||
*/
|
||||
intro?: intro_komponent;
|
||||
|
||||
/**
|
||||
* Innhold - `RegistryReference`
|
||||
*/
|
||||
content?: riktekst_komponent;
|
||||
|
||||
/**
|
||||
* Kodepakker - `Array`
|
||||
*/
|
||||
kodepakker?: Array<Sanity.Keyed<string>>;
|
||||
|
||||
/**
|
||||
* Figma lenke (optional) - `Url`
|
||||
*/
|
||||
figma_link?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,6 +262,23 @@ Linker eller dropdowns med linker. Maks dybde på 2 dropdowns er støttet. Sider
|
||||
>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tokens
|
||||
*/
|
||||
interface token_kategori extends Sanity.Document {
|
||||
_type: "token_kategori";
|
||||
|
||||
/**
|
||||
* Navn - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Kategori - `String`
|
||||
*/
|
||||
kategori?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Autogenerert Propdata
|
||||
*/
|
||||
@@ -317,78 +340,6 @@ Linker eller dropdowns med linker. Maks dybde på 2 dropdowns er støttet. Sider
|
||||
>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Komponentartikkel-template
|
||||
*/
|
||||
interface ds_component_template extends Sanity.Document {
|
||||
_type: "ds_component_template";
|
||||
|
||||
/**
|
||||
* Publiseringsdato - `Datetime`
|
||||
Synlig bare for admins. Setter publiseringsdato for dokument
|
||||
*/
|
||||
publishedAt?: string;
|
||||
|
||||
/**
|
||||
* Redaktører - `Array`
|
||||
Legg til alle som har bidratt med denne siden!
|
||||
*/
|
||||
contributors?: Array<Sanity.KeyedReference<editor>>;
|
||||
|
||||
/**
|
||||
* Sidetittel - `String`
|
||||
Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av siden i URL.
|
||||
*/
|
||||
heading?: string;
|
||||
|
||||
/**
|
||||
* url - `Slug`
|
||||
*/
|
||||
slug?: {
|
||||
_type: "slug";
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Metadata - `Object`
|
||||
*/
|
||||
status?: {
|
||||
/**
|
||||
* Status - `String`
|
||||
*/
|
||||
tag?: "beta" | "new" | "ready" | "deprecated";
|
||||
|
||||
/**
|
||||
* Thumbnail/og-bilde - `Image`
|
||||
*/
|
||||
bilde?: {
|
||||
asset: Sanity.Asset;
|
||||
crop?: Sanity.ImageCrop;
|
||||
hotspot?: Sanity.ImageHotspot;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Intro - `RegistryReference`
|
||||
*/
|
||||
intro?: intro_komponent;
|
||||
|
||||
/**
|
||||
* Innhold - `RegistryReference`
|
||||
*/
|
||||
bruk_tab?: riktekst_komponent;
|
||||
|
||||
/**
|
||||
* Kodepakker - `Array`
|
||||
*/
|
||||
kodepakker?: Array<Sanity.Keyed<string>>;
|
||||
|
||||
/**
|
||||
* Figma lenke (optional) - `Url`
|
||||
*/
|
||||
figma_link?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forside
|
||||
*/
|
||||
@@ -441,27 +392,10 @@ Beskriv bildet for skjermlesere
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigation
|
||||
* Komponentartikkel-template
|
||||
*/
|
||||
interface ds_navigation extends Sanity.Document {
|
||||
_type: "ds_navigation";
|
||||
|
||||
/**
|
||||
* Designsystem navigajsons-struktur - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Header linker - `Array`
|
||||
*/
|
||||
headings?: Array<Sanity.Keyed<ds_navigation_heading>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Komponentartikkel
|
||||
*/
|
||||
interface komponent_artikkel extends Sanity.Document {
|
||||
_type: "komponent_artikkel";
|
||||
interface ds_component_template extends Sanity.Document {
|
||||
_type: "ds_component_template";
|
||||
|
||||
/**
|
||||
* Publiseringsdato - `Datetime`
|
||||
@@ -489,6 +423,19 @@ Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av sid
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* url (v2) - `Slug`
|
||||
*/
|
||||
slug_v2?: {
|
||||
_type: "slug_v2";
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Kategori - `String`
|
||||
*/
|
||||
kategori?: "core" | "internal";
|
||||
|
||||
/**
|
||||
* Metadata - `Object`
|
||||
*/
|
||||
@@ -516,7 +463,7 @@ Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av sid
|
||||
/**
|
||||
* Innhold - `RegistryReference`
|
||||
*/
|
||||
bruk_tab?: riktekst_komponent;
|
||||
content?: riktekst_komponent;
|
||||
|
||||
/**
|
||||
* Kodepakker - `Array`
|
||||
@@ -535,11 +482,6 @@ Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av sid
|
||||
interface ds_artikkel extends Sanity.Document {
|
||||
_type: "ds_artikkel";
|
||||
|
||||
/**
|
||||
* Migrert riktekst - `Boolean`
|
||||
*/
|
||||
isMigrated?: boolean;
|
||||
|
||||
/**
|
||||
* Publiseringsdato - `Datetime`
|
||||
Synlig bare for admins. Setter publiseringsdato for dokument
|
||||
@@ -567,51 +509,22 @@ Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av sid
|
||||
};
|
||||
|
||||
/**
|
||||
* Layout - `String`
|
||||
'Full' bruker hele bredden, men fjerner table of content (bruk bare for eks ikonside eller komponentvisning)
|
||||
* url (v2) - `Slug`
|
||||
*/
|
||||
layout?: "full" | "default";
|
||||
slug_v2?: {
|
||||
_type: "slug_v2";
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Bruk Tabs - `Boolean`
|
||||
* Kategori - `String`
|
||||
*/
|
||||
artikkel_type?: boolean;
|
||||
kategori?: "styling" | "tokens" | "staesj" | "guider";
|
||||
|
||||
/**
|
||||
* Innhold - `RegistryReference`
|
||||
*/
|
||||
content?: riktekst_ds_artikkel;
|
||||
|
||||
/**
|
||||
* Innhold i Tabs - `Array`
|
||||
*/
|
||||
content_tabs?: Array<
|
||||
Sanity.Keyed<{
|
||||
_type: "tab";
|
||||
|
||||
/**
|
||||
* Tittel - `String`
|
||||
Innhold vil da legges under url/tab-tittel
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Innhold - `RegistryReference`
|
||||
*/
|
||||
content?: riktekst_ds_artikkel;
|
||||
}>
|
||||
>;
|
||||
|
||||
/**
|
||||
* Tilbakemeldinger - `Object`
|
||||
*/
|
||||
metadata_feedback?: {
|
||||
/**
|
||||
* Skjul artikkel feedback modul - `Boolean`
|
||||
Gjemmer <<Var denne artikkelen til hjelp?>> modulen.
|
||||
*/
|
||||
hide_feedback?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -697,11 +610,6 @@ Anbefalt størrelse er 1200:630px
|
||||
hotspot?: Sanity.ImageHotspot;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Migrert riktekst - `Boolean`
|
||||
*/
|
||||
isMigrated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -767,11 +675,6 @@ Anbefalt størrelse er 1200:630px
|
||||
hotspot?: Sanity.ImageHotspot;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Migrert riktekst - `Boolean`
|
||||
*/
|
||||
isMigrated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -796,18 +699,26 @@ Brukes i kort og innganger
|
||||
*/
|
||||
beskrivelse?: riktekst_enkel;
|
||||
|
||||
/**
|
||||
* Hidden - `Boolean`
|
||||
*/
|
||||
bruk_seksjoner?: boolean;
|
||||
|
||||
/**
|
||||
* Shortname - `Slug`
|
||||
En mer sanitert visning av tema-navnet i url ene
|
||||
*/
|
||||
slug?: {
|
||||
_type: "slug";
|
||||
current: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Ansvarlig for tema - `Reference`
|
||||
Legg til redaktør som har forvaltningsansvaret for temaet
|
||||
*/
|
||||
ansvarlig?: Sanity.Reference<editor>;
|
||||
|
||||
/**
|
||||
* Bruk seksjonsinndeling - `Boolean`
|
||||
Vil ikke vise artikler som ikke er lagt til i seksjoner hvis valgt!
|
||||
*/
|
||||
bruk_seksjoner?: boolean;
|
||||
|
||||
/**
|
||||
* Seksjonering - `Array`
|
||||
Del inn artiklene i flere seksjoner (vises ikke i preview før publisering desverre)
|
||||
@@ -918,11 +829,6 @@ Anbefalt størrelse er 1200:630px
|
||||
hotspot?: Sanity.ImageHotspot;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Migrert riktekst - `Boolean`
|
||||
*/
|
||||
isMigrated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -955,11 +861,6 @@ Bruk en kort og konsis tittel om mulig. Blir satt som `<H1 />` på toppen av sid
|
||||
* Innhold - `RegistryReference`
|
||||
*/
|
||||
content?: riktekst_aksel;
|
||||
|
||||
/**
|
||||
* Migrert riktekst - `Boolean`
|
||||
*/
|
||||
isMigrated?: boolean;
|
||||
}
|
||||
|
||||
type tabell_v2 = {
|
||||
@@ -1335,17 +1236,7 @@ Legg til en eller flere elementer
|
||||
/**
|
||||
* Modul - `String`
|
||||
*/
|
||||
modul?:
|
||||
| "farge_kategori"
|
||||
| "token_kategori"
|
||||
| "ikonsok"
|
||||
| "endringslogg"
|
||||
| "komponentoversikt";
|
||||
|
||||
/**
|
||||
* Farge kategori - `Reference`
|
||||
*/
|
||||
farge_ref?: Sanity.Reference<ds_color_categories>;
|
||||
modul?: "token_kategori" | "ikonsok" | "komponentoversikt";
|
||||
|
||||
/**
|
||||
* Token kategori - `Reference`
|
||||
@@ -1453,7 +1344,7 @@ Vis bare et spesfikt eksempel
|
||||
standalone?: boolean;
|
||||
|
||||
/**
|
||||
* Installasjon-snippet - `Reference`
|
||||
* Eksempel-navn - `Reference`
|
||||
*/
|
||||
dir?: Sanity.Reference<kode_eksempler_fil>;
|
||||
|
||||
@@ -1465,76 +1356,6 @@ Vis bare et spesfikt eksempel
|
||||
|
||||
type token_ref = Sanity.Reference<token_kategori>;
|
||||
|
||||
type navigation_link = {
|
||||
_type: "navigation_link";
|
||||
|
||||
/**
|
||||
* Tittel - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Link - `Reference`
|
||||
*/
|
||||
link_ref?: Sanity.Reference<komponent_artikkel | ds_artikkel>;
|
||||
};
|
||||
|
||||
type navigation_dropdown = {
|
||||
_type: "navigation_dropdown";
|
||||
|
||||
/**
|
||||
* Tittel - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Meny - `Array`
|
||||
*/
|
||||
dropdown?: Array<
|
||||
Sanity.Keyed<navigation_link> | Sanity.Keyed<navigation_dropdown>
|
||||
>;
|
||||
};
|
||||
|
||||
type ds_color = {
|
||||
_type: "ds_color";
|
||||
|
||||
/**
|
||||
* Navn - `String`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* CSS variabelnavn - `String`
|
||||
*/
|
||||
full_title?: string;
|
||||
|
||||
/**
|
||||
* Fargetype/nivå - `String`
|
||||
*/
|
||||
color_type?: "global" | "semantic";
|
||||
|
||||
/**
|
||||
* Brukt fargenavn - `String`
|
||||
*/
|
||||
color_name?: string;
|
||||
|
||||
/**
|
||||
* Fargeroller - `Array`
|
||||
*/
|
||||
color_roles?: Array<Sanity.Keyed<string>>;
|
||||
|
||||
/**
|
||||
* Brukt farge - `String`
|
||||
*/
|
||||
color_value?: string;
|
||||
|
||||
/**
|
||||
* Fargeindeks - `Number`
|
||||
Brukes for å endre rekkefølgen på listen. Farger med indeks 0 vil være først, større tall sorteres under der igjen
|
||||
*/
|
||||
color_index?: number;
|
||||
};
|
||||
|
||||
type ds_navigation_heading = {
|
||||
_type: "ds_navigation_heading";
|
||||
|
||||
@@ -1580,17 +1401,14 @@ Husk å legge denne til i menyen også, hvis ikke blir den bare tilgjengelig via
|
||||
type Document =
|
||||
| vk_frontpage
|
||||
| editor
|
||||
| navigation
|
||||
| redirect
|
||||
| ds_color_categories
|
||||
| ds_tokens
|
||||
| token_kategori
|
||||
| kode_eksempler_fil
|
||||
| ds_props
|
||||
| ds_component_template
|
||||
| ds_frontpage
|
||||
| ds_navigation
|
||||
| komponent_artikkel
|
||||
| kode_eksempler_fil
|
||||
| token_kategori
|
||||
| ds_props
|
||||
| ds_frontpage
|
||||
| ds_component_template
|
||||
| ds_artikkel
|
||||
| aksel_artikkel
|
||||
| aksel_blogg
|
||||
|
||||
@@ -10,11 +10,11 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
||||
const ContentSecurityPolicy = `
|
||||
default-src 'self' 'unsafe-inline';
|
||||
font-src 'self' https://cdn.nav.no data:;
|
||||
img-src 'self' cdn.sanity.io data:;
|
||||
script-src 'self' 'unsafe-eval';
|
||||
img-src 'self' cdn.sanity.io https://avatars.githubusercontent.com data:;
|
||||
script-src 'self' https://in2.taskanalytics.com/tm.js 'nonce-4e1aa203a32e' 'unsafe-eval';
|
||||
style-src 'self' 'unsafe-inline';
|
||||
report-uri https://sentry.gc.nav.no/api/113/envelope/?sentry_key=d35bd60e413c489ca0f2fd389b4e6e5e&sentry_version=7;
|
||||
connect-src 'self' cdn.sanity.io *.api.sanity.io https://amplitude.nav.no https://sentry.gc.nav.no https://*.algolia.net https://*.algolianet.com;
|
||||
connect-src 'self' wss://hnbe3yhs.api.sanity.io cdn.sanity.io *.api.sanity.io https://amplitude.nav.no https://sentry.gc.nav.no https://*.algolia.net https://*.algolianet.com https://in2.taskanalytics.com/03346;
|
||||
frame-ancestors localhost:3333 'self' localhost:3000 https://verktoykasse.sanity.studio/;
|
||||
media-src 'self' cdn.sanity.io;
|
||||
frame-src 'self' https://web.microsoftstream.com localhost:3000;
|
||||
|
||||
@@ -26,10 +26,17 @@
|
||||
"@radix-ui/react-tabs": "1.0.0",
|
||||
"@sanity/block-content-to-react": "^3.0.0",
|
||||
"@sanity/client": "^3.3.0",
|
||||
"@sanity/code-input": "studio-v3",
|
||||
"@sanity/icons": "2.1.0",
|
||||
"@sanity/image-url": "1.0.1",
|
||||
"@sanity/preview-kit": "^1.2.8",
|
||||
"@sanity/table": "1.0.0",
|
||||
"@sanity/ui": "^1.0.0",
|
||||
"@sanity/vision": "3.0.0-rc.3",
|
||||
"@svgr/webpack": "^5.5.0",
|
||||
"algoliasearch": "4.12.2",
|
||||
"amplitude-js": "^8.8.0",
|
||||
"boring-avatars": "1.7.0",
|
||||
"classnames": "^2.3.1",
|
||||
"codesandbox": "^2.2.3",
|
||||
"color": "4.2.3",
|
||||
@@ -41,7 +48,7 @@
|
||||
"jwt-decode": "3.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
"next": "^12.2.0",
|
||||
"next-sanity": "^1.0.0",
|
||||
"next-sanity": "^3.1.2",
|
||||
"prettier": "2.7.1",
|
||||
"prism-react-renderer": "^1.3.0",
|
||||
"prismjs": "^1.27.0",
|
||||
@@ -49,7 +56,14 @@
|
||||
"react-dom": "^18.0.0",
|
||||
"react-instantsearch-hooks-web": "^6.26.0",
|
||||
"react-modal": "3.15.1",
|
||||
"react-snowfall": "1.2.1",
|
||||
"sanity": "3.0.0-rc.3",
|
||||
"sanity-plugin-asset-source-unsplash": "^1.0.0",
|
||||
"sanity-plugin-graph-view": "^2.0.1",
|
||||
"sanity-plugin-iframe-pane": "^2.1.1",
|
||||
"sanity-plugin-media": "^2.0.2",
|
||||
"sitemap": "^7.0.0",
|
||||
"suspend-react": "0.0.8",
|
||||
"tailwindcss": "^3.2.0",
|
||||
"validator": "^13.7.0"
|
||||
},
|
||||
@@ -62,7 +76,6 @@
|
||||
"@testing-library/jest-dom": "^5.16.0",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { Provider } from "@navikt/ds-react";
|
||||
import PreviewBanner from "components/website-modules/PreviewBanner";
|
||||
import {
|
||||
AuthProvider,
|
||||
IdContext,
|
||||
initAmplitude,
|
||||
logPageView,
|
||||
PreviewBanner,
|
||||
useScrollToHashOnPageLoad,
|
||||
} from "@/components";
|
||||
import { Provider } from "@navikt/ds-react";
|
||||
} from "components/website-modules/utils/amplitude";
|
||||
import { useScrollToHashOnPageLoad } from "components/website-modules/utils/util";
|
||||
import Head from "next/head";
|
||||
import React, { useEffect } from "react";
|
||||
import { Router } from "next/router";
|
||||
import Script from "next/script";
|
||||
import { useEffect } from "react";
|
||||
import { AuthProvider } from "../components/website-modules/utils/contexts/authprovider";
|
||||
import { IdContext } from "../components/website-modules/utils/contexts/id-context";
|
||||
import "../styles/index.css";
|
||||
|
||||
function App({
|
||||
@@ -18,7 +20,7 @@ function App({
|
||||
}: {
|
||||
Component: any;
|
||||
pageProps: any;
|
||||
router: any;
|
||||
router: Router;
|
||||
}): JSX.Element {
|
||||
useScrollToHashOnPageLoad();
|
||||
|
||||
@@ -36,10 +38,6 @@ function App({
|
||||
};
|
||||
}, [router.events]);
|
||||
|
||||
/* useEffect(() => {
|
||||
hotjar.initialize(148751, 6);
|
||||
}, []); */
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -58,6 +56,16 @@ function App({
|
||||
/>
|
||||
<meta property="og:site_name" content="Aksel" key="ogsitename" />
|
||||
</Head>
|
||||
{!router.asPath.startsWith("/eksempler") &&
|
||||
!router.asPath.startsWith("/admin") && (
|
||||
<>
|
||||
<Script src="https://in2.taskanalytics.com/tm.js"></Script>
|
||||
<Script id="task-analytics" nonce="4e1aa203a32e">
|
||||
{`window.TA = window.TA||function(){(TA.q=TA.q||[]).push(arguments);};
|
||||
window.TA('start', '03346')`}
|
||||
</Script>
|
||||
</>
|
||||
)}
|
||||
{pageProps?.preview && <PreviewBanner />}
|
||||
|
||||
<Provider>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { NextStudio } from "next-sanity/studio";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { workspaceConfig } from "../../sanity/sanity.config";
|
||||
|
||||
const StudioPage = () => {
|
||||
useEffect(() => {
|
||||
if (window.location.host === "aksel.nav.no") {
|
||||
window.location.replace(`http://aksel.nav.no`);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const [scheme, setScheme] = useState("light");
|
||||
|
||||
return (
|
||||
<div data-theme={scheme} className="h-full min-h-screen">
|
||||
<NextStudio
|
||||
config={workspaceConfig}
|
||||
scheme={scheme}
|
||||
onSchemeChange={(s) => setScheme(s)}
|
||||
unstable__noFavicons
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default StudioPage;
|
||||
@@ -16,6 +16,10 @@ export default async function preview(req, res) {
|
||||
return redirectToPreview(res, "/");
|
||||
}
|
||||
|
||||
if (!process.env.SANITY_PREVIEW_TOKEN) {
|
||||
return res.status(401).json({ message: "Invalid preview-token" });
|
||||
}
|
||||
|
||||
// Check if the article with the given `slug` exists
|
||||
const article = await previewClient.fetch(
|
||||
"*[slug.current == $slug][0].slug.current",
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
import { LayoutPicker } from "@/components";
|
||||
import { SanityT, akselBloggBySlug, usePreviewSubscription } from "@/lib";
|
||||
import { getClient } from "@/sanity-client";
|
||||
import { GetServerSideProps } from "next/types";
|
||||
import React from "react";
|
||||
import NotFotfund from "../404";
|
||||
|
||||
const Page = (props: {
|
||||
slug?: string;
|
||||
page: SanityT.Schema.aksel_blogg;
|
||||
preview: boolean;
|
||||
}): JSX.Element => {
|
||||
const { data } = usePreviewSubscription(akselBloggBySlug, {
|
||||
params: { slug: `blogg/${props.slug}`, valid: "true" },
|
||||
initialData: props.page,
|
||||
enabled: props?.preview,
|
||||
});
|
||||
|
||||
if (!data) {
|
||||
return <NotFotfund />;
|
||||
}
|
||||
|
||||
return <LayoutPicker title="Aksel" data={data} />;
|
||||
};
|
||||
|
||||
interface StaticProps {
|
||||
props: {
|
||||
page: SanityT.Schema.aksel_blogg;
|
||||
slug: string;
|
||||
preview: boolean;
|
||||
validUser?: boolean;
|
||||
};
|
||||
notFound: boolean;
|
||||
}
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async (
|
||||
context
|
||||
): Promise<StaticProps | { notFound: true }> => {
|
||||
/* const isValidUser = await isValidated(context); */
|
||||
|
||||
const page = await getClient().fetch(akselBloggBySlug, {
|
||||
slug: `blogg/${context.params.slug}`,
|
||||
valid: "true" /* `${isValidUser}` */,
|
||||
});
|
||||
|
||||
return {
|
||||
props: {
|
||||
page,
|
||||
slug: context.params.slug as string,
|
||||
preview: context.preview ?? false,
|
||||
/* validUser: isValidUser, */
|
||||
},
|
||||
notFound: !page && !context.preview,
|
||||
};
|
||||
};
|
||||
|
||||
export default Page;
|
||||
@@ -1,29 +1,21 @@
|
||||
import { getActiveHeading, LayoutPicker, PagePropsContext } from "@/components";
|
||||
import { DsHeader, DsSidebar, Footer } from "@/layout";
|
||||
import {
|
||||
SanityT,
|
||||
dsSlugQuery,
|
||||
getDsPaths,
|
||||
usePreviewSubscription,
|
||||
validateDsPath,
|
||||
} from "@/lib";
|
||||
import { SanityT, dsSlugQuery, getDsPaths, validateDsPath } from "@/lib";
|
||||
import { getClient } from "@/sanity-client";
|
||||
import { PreviewSuspense } from "next-sanity/preview";
|
||||
import { lazy } from "react";
|
||||
import NotFotfund from "../404";
|
||||
|
||||
const Page = (props: {
|
||||
const Page = ({
|
||||
page,
|
||||
navigation,
|
||||
...rest
|
||||
}: {
|
||||
slug?: string[];
|
||||
page: any;
|
||||
navigation: SanityT.Schema.ds_navigation;
|
||||
preview: boolean;
|
||||
}): JSX.Element => {
|
||||
const {
|
||||
data: { page, navigation },
|
||||
} = usePreviewSubscription(dsSlugQuery, {
|
||||
params: { slug: `designsystem/${props.slug.slice(0, 2).join("/")}` },
|
||||
initialData: props,
|
||||
enabled: props?.preview,
|
||||
});
|
||||
|
||||
if (!page) {
|
||||
return <NotFotfund />;
|
||||
}
|
||||
@@ -32,7 +24,7 @@ const Page = (props: {
|
||||
<PagePropsContext.Provider
|
||||
value={{
|
||||
pageProps: {
|
||||
...props,
|
||||
...rest,
|
||||
page: page,
|
||||
navigation,
|
||||
activeHeading: getActiveHeading(navigation, page?.slug) ?? null,
|
||||
@@ -59,7 +51,26 @@ const Page = (props: {
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
||||
const WithPreview = lazy(() => import("../../components/WithPreview"));
|
||||
|
||||
const Wrapper = (props: any): JSX.Element => {
|
||||
if (props?.preview) {
|
||||
return (
|
||||
<PreviewSuspense fallback={<Page {...props} />}>
|
||||
<WithPreview
|
||||
comp={Page}
|
||||
query={dsSlugQuery}
|
||||
params={{ slug: `designsystem/${props.slug.slice(0, 2).join("/")}` }}
|
||||
props={props}
|
||||
/>
|
||||
</PreviewSuspense>
|
||||
);
|
||||
}
|
||||
|
||||
return <Page {...props} />;
|
||||
};
|
||||
|
||||
export default Wrapper;
|
||||
|
||||
export const getStaticPaths = async (): Promise<{
|
||||
fallback: string;
|
||||
|
||||
Loaded 100 of 193 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user