diff --git a/src/components/ContentMapper.tsx b/src/components/ContentMapper.tsx
index d00436142..3b9b05875 100644
--- a/src/components/ContentMapper.tsx
+++ b/src/components/ContentMapper.tsx
@@ -16,7 +16,6 @@ import { SituationPage } from './pages/situation-page/SituationPage';
import { GuidePage } from './pages/guide-page/GuidePage';
import { OverviewPage } from './pages/overview-page/OverviewPage';
import { OfficeEditorialPage } from './pages/office-editorial-page/OfficeEditorialPage';
-import { OfficeBranchPage } from './pages/office-branch-page/OfficeBranchPage';
import { ThemedArticlePage } from './pages/themed-article-page/ThemedArticlePage';
import { ProductPage } from './pages/product-page/ProductPage';
import { ProductDetailsPage } from './pages/product-details-page/ProductDetailsPage';
@@ -53,7 +52,6 @@ const contentToReactComponent: {
[ContentType.Overview]: OverviewPage,
[ContentType.GenericPage]: GenericPage,
[ContentType.OfficeEditorialPage]: OfficeEditorialPage,
- [ContentType.OfficeBranchPage]: OfficeBranchPage,
[ContentType.OfficePage]: OfficePage,
[ContentType.CurrentTopicPage]: CurrentTopicPage,
[ContentType.PressLandingPage]: PressLandingPage,
diff --git a/src/components/pages/office-branch-page/OfficeBranchPage.module.scss b/src/components/pages/office-branch-page/OfficeBranchPage.module.scss
deleted file mode 100644
index a39cd6b14..000000000
--- a/src/components/pages/office-branch-page/OfficeBranchPage.module.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-@use 'common' as common;
-
-$margin: 2rem;
-
-.officeBranchPage {
- display: flex;
- flex-direction: column;
-}
-.pageContent {
- display: flex;
- flex-direction: column;
-
- :global {
- .layout__section-with-header {
- max-width: common.$sectionMaxWidth;
- margin-bottom: $margin;
- }
- }
-}
-
-.content {
- margin-top: 2rem;
- display: flex;
- justify-content: flex-start;
- align-self: center;
- width: 100%;
- max-width: common.$contentMaxWidth;
-
- & > * {
- width: 100%;
- }
-}
diff --git a/src/components/pages/office-branch-page/OfficeBranchPage.tsx b/src/components/pages/office-branch-page/OfficeBranchPage.tsx
deleted file mode 100644
index 986ab883d..000000000
--- a/src/components/pages/office-branch-page/OfficeBranchPage.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from 'react';
-import { ComponentMapper } from 'components/ComponentMapper';
-import { OfficeBranchPageProps } from 'types/content-props/dynamic-page-props';
-import { classNames } from 'utils/classnames';
-import { logger } from 'srcCommon/logger';
-import { OfficePageHeader } from './office-page-header/OfficePageHeader';
-import { OfficeDetails } from './office-details/OfficeDetails';
-
-import styles from './OfficeBranchPage.module.scss';
-
-export const OfficeBranchPage = (props: OfficeBranchPageProps) => {
- const editorialPage = props.editorial;
-
- if (!editorialPage) {
- logger.error(`No editorial page found for ${props.displayName}`);
- }
-
- return (
-
+
{officeNorgData && (
)}
{officeNorgData &&
}
-
+
);
diff --git a/src/components/pages/office-branch-page/office-details/OfficeDetails.module.scss b/src/components/pages/office-page/office-details/OfficeDetails.module.scss
similarity index 100%
rename from src/components/pages/office-branch-page/office-details/OfficeDetails.module.scss
rename to src/components/pages/office-page/office-details/OfficeDetails.module.scss
diff --git a/src/components/pages/office-branch-page/office-details/OfficeDetails.tsx b/src/components/pages/office-page/office-details/OfficeDetails.tsx
similarity index 100%
rename from src/components/pages/office-branch-page/office-details/OfficeDetails.tsx
rename to src/components/pages/office-page/office-details/OfficeDetails.tsx
diff --git a/src/components/pages/office-branch-page/office-details/officeInformation/OfficeInformation.module.scss b/src/components/pages/office-page/office-details/officeInformation/OfficeInformation.module.scss
similarity index 100%
rename from src/components/pages/office-branch-page/office-details/officeInformation/OfficeInformation.module.scss
rename to src/components/pages/office-page/office-details/officeInformation/OfficeInformation.module.scss
diff --git a/src/components/pages/office-branch-page/office-details/officeInformation/OfficeInformation.tsx b/src/components/pages/office-page/office-details/officeInformation/OfficeInformation.tsx
similarity index 98%
rename from src/components/pages/office-branch-page/office-details/officeInformation/OfficeInformation.tsx
rename to src/components/pages/office-page/office-details/officeInformation/OfficeInformation.tsx
index b72ff2127..2ca70dd03 100644
--- a/src/components/pages/office-branch-page/office-details/officeInformation/OfficeInformation.tsx
+++ b/src/components/pages/office-page/office-details/officeInformation/OfficeInformation.tsx
@@ -2,7 +2,7 @@ import { ExpansionCard, BodyShort, Heading } from '@navikt/ds-react';
import { usePageContentProps } from 'store/pageContext';
import { translator } from 'translations';
import { OfficeDetailsData } from 'types/content-props/office-details-props';
-import { officeDetailsFormatAddress } from 'components/pages/office-branch-page/office-details/utils';
+import { officeDetailsFormatAddress } from 'components/pages/office-page/office-details/utils';
import styles from './OfficeInformation.module.scss';
diff --git a/src/components/pages/office-branch-page/office-details/phonePoster/AudienceChannels.module.scss b/src/components/pages/office-page/office-details/phonePoster/AudienceChannels.module.scss
similarity index 100%
rename from src/components/pages/office-branch-page/office-details/phonePoster/AudienceChannels.module.scss
rename to src/components/pages/office-page/office-details/phonePoster/AudienceChannels.module.scss
diff --git a/src/components/pages/office-branch-page/office-details/phonePoster/AudienceChannels.tsx b/src/components/pages/office-page/office-details/phonePoster/AudienceChannels.tsx
similarity index 97%
rename from src/components/pages/office-branch-page/office-details/phonePoster/AudienceChannels.tsx
rename to src/components/pages/office-page/office-details/phonePoster/AudienceChannels.tsx
index 2b56d7765..899e60ff6 100644
--- a/src/components/pages/office-branch-page/office-details/phonePoster/AudienceChannels.tsx
+++ b/src/components/pages/office-page/office-details/phonePoster/AudienceChannels.tsx
@@ -1,7 +1,7 @@
import { BodyShort } from '@navikt/ds-react';
import { LenkeBase } from 'components/_common/lenke/LenkeBase';
import { AudienceContact } from 'types/content-props/office-details-props';
-import { officeDetailsFormatPhoneNumber } from 'components/pages/office-branch-page/office-details/utils';
+import { officeDetailsFormatPhoneNumber } from 'components/pages/office-page/office-details/utils';
import styles from './AudienceChannels.module.scss';
diff --git a/src/components/pages/office-branch-page/office-details/phonePoster/PhonePoster.module.scss b/src/components/pages/office-page/office-details/phonePoster/PhonePoster.module.scss
similarity index 100%
rename from src/components/pages/office-branch-page/office-details/phonePoster/PhonePoster.module.scss
rename to src/components/pages/office-page/office-details/phonePoster/PhonePoster.module.scss
diff --git a/src/components/pages/office-branch-page/office-details/phonePoster/PhonePoster.tsx b/src/components/pages/office-page/office-details/phonePoster/PhonePoster.tsx
similarity index 94%
rename from src/components/pages/office-branch-page/office-details/phonePoster/PhonePoster.tsx
rename to src/components/pages/office-page/office-details/phonePoster/PhonePoster.tsx
index 3a46f6260..fd4d1c7a3 100644
--- a/src/components/pages/office-branch-page/office-details/phonePoster/PhonePoster.tsx
+++ b/src/components/pages/office-page/office-details/phonePoster/PhonePoster.tsx
@@ -1,9 +1,9 @@
import React from 'react';
import { BodyLong, BodyShort, Heading } from '@navikt/ds-react';
import { PhoneFillIcon } from '@navikt/aksel-icons';
-import { OfficeDetailsProps } from 'components/pages/office-branch-page/office-details/OfficeDetails';
+import { OfficeDetailsProps } from 'components/pages/office-page/office-details/OfficeDetails';
import { translator } from 'translations';
-import { officeDetailsFormatPhoneNumber } from 'components/pages/office-branch-page/office-details/utils';
+import { officeDetailsFormatPhoneNumber } from 'components/pages/office-page/office-details/utils';
import { usePageContentProps } from 'store/pageContext';
import { forceArray } from 'utils/arrays';
import { LenkeBase } from 'components/_common/lenke/LenkeBase';
diff --git a/src/components/pages/office-branch-page/office-details/utils.ts b/src/components/pages/office-page/office-details/utils.ts
similarity index 100%
rename from src/components/pages/office-branch-page/office-details/utils.ts
rename to src/components/pages/office-page/office-details/utils.ts
diff --git a/src/components/pages/office-branch-page/office-page-header/OfficePageHeader.module.scss b/src/components/pages/office-page/office-page-header/OfficePageHeader.module.scss
similarity index 100%
rename from src/components/pages/office-branch-page/office-page-header/OfficePageHeader.module.scss
rename to src/components/pages/office-page/office-page-header/OfficePageHeader.module.scss
diff --git a/src/components/pages/office-branch-page/office-page-header/OfficePageHeader.tsx b/src/components/pages/office-page/office-page-header/OfficePageHeader.tsx
similarity index 100%
rename from src/components/pages/office-branch-page/office-page-header/OfficePageHeader.tsx
rename to src/components/pages/office-page/office-page-header/OfficePageHeader.tsx
diff --git a/src/components/parts/_legacy/office-information/OfficeInformationLegacyPart.tsx b/src/components/parts/_legacy/office-information/OfficeInformationLegacyPart.tsx
index 63e788b1b..2f9bbe837 100644
--- a/src/components/parts/_legacy/office-information/OfficeInformationLegacyPart.tsx
+++ b/src/components/parts/_legacy/office-information/OfficeInformationLegacyPart.tsx
@@ -3,7 +3,7 @@ import { Heading, BodyLong, BodyShort } from '@navikt/ds-react';
import {
officeDetailsFormatAddress,
officeDetailsFormatPhoneNumber,
-} from 'components/pages/office-branch-page/office-details/utils';
+} from 'components/pages/office-page/office-details/utils';
import { OfficeInfoEmail } from 'components/parts/_legacy/office-information/OfficeInfoEmail';
import ArtikkelDato from 'components/parts/_legacy/main-article/komponenter/ArtikkelDato';
import { LenkeInline } from 'components/_common/lenke/LenkeInline';
diff --git a/src/components/parts/_legacy/office-information/reception/Reception.tsx b/src/components/parts/_legacy/office-information/reception/Reception.tsx
index 3cbe92374..1395b1d06 100644
--- a/src/components/parts/_legacy/office-information/reception/Reception.tsx
+++ b/src/components/parts/_legacy/office-information/reception/Reception.tsx
@@ -7,7 +7,7 @@ import {
LegacyOfficeOpeningHoursProps,
} from 'types/content-props/office-information-props';
import { forceArray } from 'utils/arrays';
-import { officeDetailsFormatAddress } from 'components/pages/office-branch-page/office-details/utils';
+import { officeDetailsFormatAddress } from 'components/pages/office-page/office-details/utils';
import { OpeningHours } from './OpeningHours';
import style from './Reception.module.scss';
diff --git a/src/components/parts/office-editorial-detail/OfficeEditorialDetailPart.tsx b/src/components/parts/office-editorial-detail/OfficeEditorialDetailPart.tsx
index a29b64929..d5a5911a9 100644
--- a/src/components/parts/office-editorial-detail/OfficeEditorialDetailPart.tsx
+++ b/src/components/parts/office-editorial-detail/OfficeEditorialDetailPart.tsx
@@ -64,7 +64,13 @@ export const OfficeEditorialDetailPart = ({
);
}
- if (pageProps.type !== ContentType.OfficeBranchPage) {
+ if (pageProps.type !== ContentType.OfficePage) {
+ return null;
+ }
+
+ const officeData = pageProps.data.officeNorgData.data;
+
+ if (!officeData) {
return null;
}
@@ -73,5 +79,5 @@ export const OfficeEditorialDetailPart = ({
return null;
}
- return
;
+ return
;
};
diff --git a/src/types/content-props/_content-common.ts b/src/types/content-props/_content-common.ts
index 098d75b68..1a7a6cc4c 100644
--- a/src/types/content-props/_content-common.ts
+++ b/src/types/content-props/_content-common.ts
@@ -24,7 +24,6 @@ import {
DynamicPageProps,
GenericPageProps,
GuidePageProps,
- OfficeBranchPageProps,
OfficeEditorialPageProps,
CurrentTopicPageProps,
ProductDetailsProps,
@@ -72,7 +71,6 @@ export enum ContentType {
ProductPage = 'no.nav.navno:content-page-with-sidemenus',
ProductDetails = 'no.nav.navno:product-details',
OfficeEditorialPage = 'no.nav.navno:office-editorial-page',
- OfficeBranchPage = 'no.nav.navno:office-branch',
GuidePage = 'no.nav.navno:guide-page',
ThemedArticlePage = 'no.nav.navno:themed-article-page',
CurrentTopicPage = 'no.nav.navno:current-topic-page',
@@ -174,7 +172,6 @@ type SpecificContentProps =
| ProductPageProps
| SituationPageProps
| OfficeEditorialPageProps
- | OfficeBranchPageProps
| OfficePageProps
| PictogramsProps
| GlobalValuesProps
diff --git a/src/types/content-props/dynamic-page-props.ts b/src/types/content-props/dynamic-page-props.ts
index 7ea406e24..910d72142 100644
--- a/src/types/content-props/dynamic-page-props.ts
+++ b/src/types/content-props/dynamic-page-props.ts
@@ -62,12 +62,6 @@ export type OfficeEditorialPageProps = ContentCommonProps & {
page: LayoutComponentProps;
};
-export type OfficeBranchPageProps = ContentCommonProps & {
- type: ContentType.OfficeBranchPage;
- data: OfficeDetailsData;
- editorial: OfficeEditorialPageProps;
-};
-
export type OfficePageProps = ContentCommonProps & {
type: ContentType.OfficePage;
data: {
@@ -75,6 +69,7 @@ export type OfficePageProps = ContentCommonProps & {
officeNorgData: OptionSetSingle<{ data: OfficeDetailsData }>;
};
page: LayoutComponentProps;
+ editorial?: OfficeEditorialPageProps;
};
export type CurrentTopicPageProps = ContentCommonProps & {
diff --git a/src/utils/appearance.ts b/src/utils/appearance.ts
index e04c6897b..fdbdce8bd 100644
--- a/src/utils/appearance.ts
+++ b/src/utils/appearance.ts
@@ -22,7 +22,6 @@ const contentTypesWithWhiteHeader: ReadonlySet
= new Set([
ContentType.FrontPageNested,
ContentType.GenericPage,
ContentType.GuidePage,
- ContentType.OfficeBranchPage,
ContentType.OfficePage,
ContentType.OfficeEditorialPage,
ContentType.Overview,