Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(web): Use Custom Page content type for /starfatorg #14650

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
Webreader,
} from '@island.is/web/components'
import {
CustomPageUniqueIdentifier,
GetIcelandicGovernmentInstitutionVacanciesQuery,
GetIcelandicGovernmentInstitutionVacanciesQueryVariables,
GetNamespaceQuery,
Expand All @@ -40,6 +41,7 @@ import { withMainLayout } from '@island.is/web/layouts/main'
import { Screen } from '@island.is/web/types'
import { CustomNextError } from '@island.is/web/units/errors'

import { withCustomPageWrapper } from '../CustomPage/CustomPageWrapper'
import { extractFilterTags } from '../Organization/PublishedMaterial/utils'
import { GET_NAMESPACE_QUERY } from '../queries'
import { GET_ICELANDIC_GOVERNMENT_INSTITUTION_VACANCIES } from '../queries/IcelandicGovernmentInstitutionVacancies'
Expand Down Expand Up @@ -695,10 +697,6 @@ IcelandicGovernmentInstitutionVacanciesList.getProps = async ({
namespaceResponse?.data?.getNamespace?.fields || '{}',
) as Record<string, string>

if (namespace['display404']) {
throw new CustomNextError(404, 'Vacancies on Ísland.is are turned off')
}

const vacanciesResponse = await apolloClient.query<
GetIcelandicGovernmentInstitutionVacanciesQuery,
GetIcelandicGovernmentInstitutionVacanciesQueryVariables
Expand All @@ -715,10 +713,15 @@ IcelandicGovernmentInstitutionVacanciesList.getProps = async ({
return {
vacancies,
namespace,
customAlertBanner: namespace['customAlertBanner'],
}
}

export default withMainLayout(IcelandicGovernmentInstitutionVacanciesList, {
footerVersion: 'organization',
})
export default withMainLayout(
withCustomPageWrapper(
CustomPageUniqueIdentifier.Vacancies,
IcelandicGovernmentInstitutionVacanciesList,
),
{
footerVersion: 'organization',
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Webreader,
} from '@island.is/web/components'
import {
CustomPageUniqueIdentifier,
GetIcelandicGovernmentInstitutionVacancyDetailsQuery,
GetIcelandicGovernmentInstitutionVacancyDetailsQueryVariables,
GetNamespaceQuery,
Expand All @@ -28,6 +29,7 @@ import { Screen } from '@island.is/web/types'
import { CustomNextError } from '@island.is/web/units/errors'
import { webRichText } from '@island.is/web/utils/richText'

import { withCustomPageWrapper } from '../CustomPage/CustomPageWrapper'
import SidebarLayout from '../Layouts/SidebarLayout'
import { GET_NAMESPACE_QUERY } from '../queries'
import { GET_ICELANDIC_GOVERNMENT_INSTITUTION_VACANCY_DETAILS } from '../queries/IcelandicGovernmentInstitutionVacancies'
Expand Down Expand Up @@ -398,15 +400,15 @@ IcelandicGovernmentInstitutionVacancyDetails.getProps = async ({
namespaceResponse?.data?.getNamespace?.fields || '{}',
) as Record<string, string>

if (namespace['display404']) {
throw new CustomNextError(404, 'Vacancies on Ísland.is are turned off')
}

return {
vacancy,
namespace,
customAlertBanner: namespace['customAlertBanner'],
}
}

export default withMainLayout(IcelandicGovernmentInstitutionVacancyDetails)
export default withMainLayout(
withCustomPageWrapper(
CustomPageUniqueIdentifier.Vacancies,
IcelandicGovernmentInstitutionVacancyDetails,
),
)
1 change: 1 addition & 0 deletions libs/cms/src/lib/dto/getCustomPage.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CacheField } from '@island.is/nest/graphql'
export enum CustomPageUniqueIdentifier {
PensionCalculator = 'PensionCalculator',
OfficialJournalOfIceland = 'OfficialJournalOfIceland',
Vacancies = 'Vacancies',
}

registerEnumType(CustomPageUniqueIdentifier, {
Expand Down
5 changes: 4 additions & 1 deletion libs/cms/src/lib/generated/contentfulTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,10 @@ export interface ICustomPageFields {
title?: string | undefined

/** Unique Identifier */
uniqueIdentifier: 'PensionCalculator' | 'OfficialJournalOfIceland'
uniqueIdentifier:
| 'PensionCalculator'
| 'OfficialJournalOfIceland'
| 'Vacancies'

/** Alert Banner */
alertBanner?: IAlertBanner | undefined
Expand Down
Loading