Skip to content

Commit d31976e

Browse files
PerOlavMtalepre
andauthored
Amplitude utvide sidevisning (#2133)
* Legger til pageType (innholdstype) til decoratorParams * nav-dekoratoren-moduler v3.1.3 --------- Co-authored-by: Tale Prestmo <[email protected]>
1 parent 683c45d commit d31976e

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

package-lock.json

+17-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@navikt/ds-css": "7.3.1",
4343
"@navikt/ds-react": "7.3.1",
4444
"@navikt/ds-tokens": "7.3.1",
45-
"@navikt/nav-dekoratoren-moduler": "3.1.1",
45+
"@navikt/nav-dekoratoren-moduler": "3.1.3",
4646
"@navikt/nav-office-reception-info": "1.1.2",
4747
"@reduxjs/toolkit": "2.3.0",
4848
"csp-header": "5.2.1",

src/utils/decorator-utils.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DecoratorParams } from '@navikt/nav-dekoratoren-moduler';
22
import { Language } from 'translations';
3-
import { ContentProps, ContentType } from 'types/content-props/_content-common';
3+
import { ContentProps, ContentType, innholdsTypeMap } from 'types/content-props/_content-common';
44
import { LanguageProps } from 'types/language';
55
import { Audience, getAudience } from 'types/component-props/_mixins';
66
import { stripXpPathPrefix } from './urls';
@@ -76,20 +76,19 @@ export const getDecoratorParams = (content: ContentProps): DecoratorParams => {
7676
}
7777

7878
const { _path, breadcrumbs, language, data, editorView } = content;
79-
8079
const audience = data?.audience ? getAudience(data.audience) : undefined;
81-
8280
const rolePathSegment = _path.split('/')[2];
8381
const context = audience ? audienceToRoleContext[audience] : pathToRoleContext[rolePathSegment];
8482
const decoratorLanguage = getDecoratorLangFromXpLang(language);
8583
const feedbackEnabled = data?.feedbackToggle;
8684
const chatbotDisabled =
8785
data?.chatbotToggle === false || editorView === 'edit' || editorView === 'inline';
88-
86+
const pageType = innholdsTypeMap[content.type];
8987
return {
9088
...defaultParams,
9189
...(context && { context }),
9290
...(decoratorLanguage && { language: decoratorLanguage }),
91+
pageType,
9392
breadcrumbs:
9493
breadcrumbs?.map((crumb) => ({
9594
...crumb,

0 commit comments

Comments
 (0)