Skip to content

Commit

Permalink
Merge branch 'main' into feature/web-organization-page-standalone-lev…
Browse files Browse the repository at this point in the history
…el1-sitemap
  • Loading branch information
RunarVestmann committed Nov 28, 2024
2 parents fbe341c + 9ea0c3d commit e2d531c
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 23 deletions.
37 changes: 21 additions & 16 deletions apps/web/layouts/organization/standalone/components/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useWindowSize } from 'react-use'

import {
Box,
GridColumn,
Expand All @@ -8,6 +10,7 @@ import {
LinkV2,
Text,
} from '@island.is/island-ui/core'
import { theme } from '@island.is/island-ui/theme'
import { LanguageToggler, SearchInput } from '@island.is/web/components'
import { useI18n } from '@island.is/web/i18n'

Expand All @@ -33,36 +36,38 @@ export const Navigation: React.FC<React.PropsWithChildren<NavigationProps>> = ({
organizationSlug,
}) => {
const { activeLocale } = useI18n()
const { width } = useWindowSize()

return (
<GridContainer>
<GridRow className={styles.gridRow} alignItems="center">
<GridColumn span="3/12">
<GridColumn span={['6/12', '6/12', '6/12', '3/12']}>
<LinkV2 href={homeHref}>
<Inline space={3} alignY="center" flexWrap="nowrap">
<Inline space={[2, 2, 3]} alignY="center" flexWrap="nowrap">
{!!logo && (
<img src={logo} alt={logoAltText} className={styles.logo} />
)}
<Text variant="h2" as="h1">
<Text
variant={width < theme.breakpoints.sm ? 'h3' : 'h2'}
as="h1"
>
{title}
</Text>
</Inline>
</LinkV2>
</GridColumn>
<GridColumn span="6/12">
<Hidden below="lg">
<Inline space={3} alignY="center" justifyContent="center">
{links.map((link) => (
<LinkV2 key={link.label} href={link.href}>
<Text variant="h4" color="blue600">
{link.label}
</Text>
</LinkV2>
))}
</Inline>
</Hidden>
<GridColumn span="6/12" hiddenBelow="lg">
<Inline space={3} alignY="center" justifyContent="center">
{links.map((link) => (
<LinkV2 key={link.label} href={link.href}>
<Text variant="h4" color="blue600">
{link.label}
</Text>
</LinkV2>
))}
</Inline>
</GridColumn>
<GridColumn span="3/12">
<GridColumn span={['6/12', '6/12', '6/12', '3/12']}>
<Hidden below="lg">
<Box display="flex" alignItems="center" justifyContent="flexEnd">
<SearchInput
Expand Down
5 changes: 3 additions & 2 deletions apps/web/layouts/organization/standalone/standalone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SkipToMainContent,
} from '@island.is/web/components'
import { PRELOADED_FONTS } from '@island.is/web/constants'
import { GlobalContextProvider } from '@island.is/web/context'
import { OrganizationPage } from '@island.is/web/graphql/schema'
import { useLinkResolver } from '@island.is/web/hooks'
import { useI18n } from '@island.is/web/i18n'
Expand Down Expand Up @@ -87,7 +88,7 @@ export const StandaloneLayout = ({
const featuredImage = seo?.image ?? organizationPage.featuredImage

return (
<>
<GlobalContextProvider>
<Head>
{PRELOADED_FONTS.map((href, index) => {
return (
Expand Down Expand Up @@ -270,6 +271,6 @@ export const StandaloneLayout = ({
url('/fonts/ibm-plex-sans-v7-latin-600.woff') format('woff');
}
`}</style>
</>
</GlobalContextProvider>
)
}
7 changes: 7 additions & 0 deletions apps/web/screens/Organization/Standalone/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
QueryGetOrganizationPageArgs,
} from '@island.is/web/graphql/schema'
import { useNamespace } from '@island.is/web/hooks'
import useContentfulId from '@island.is/web/hooks/useContentfulId'
import { StandaloneLayout } from '@island.is/web/layouts/organization/standalone'
import type { Screen, ScreenContext } from '@island.is/web/types'
import { CustomNextError } from '@island.is/web/units/errors'
Expand All @@ -27,6 +28,11 @@ export interface StandaloneHomeProps {
namespace: Record<string, string>
}

const LanguageToggleSetup = (props: { id: string }) => {
useContentfulId(props.id)
return null
}

const StandaloneHome: Screen<
StandaloneHomeProps,
StandaloneHomeScreenContext
Expand All @@ -43,6 +49,7 @@ const StandaloneHome: Screen<
isFrontpage={true}
bannerTitle={n('bannerTitle', '')}
>
<LanguageToggleSetup id={organizationPage.id} />
<Stack space={SLICE_SPACING}>
<Stack space={SLICE_SPACING}>
{organizationPage.slices.map((slice) => {
Expand Down
9 changes: 9 additions & 0 deletions apps/web/screens/Organization/Standalone/ParentSubpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
QueryGetOrganizationSubpageArgs,
} from '@island.is/web/graphql/schema'
import { useLinkResolver } from '@island.is/web/hooks'
import useContentfulId from '@island.is/web/hooks/useContentfulId'
import { useI18n } from '@island.is/web/i18n'
import { StandaloneLayout } from '@island.is/web/layouts/organization/standalone'
import type { Screen, ScreenContext } from '@island.is/web/types'
Expand Down Expand Up @@ -52,6 +53,11 @@ export interface StandaloneParentSubpageProps {
namespace: Record<string, string>
}

const LanguageToggleSetup = (props: { ids: string[] }) => {
useContentfulId(...props.ids)
return null
}

const StandaloneParentSubpage: Screen<
StandaloneParentSubpageProps,
StandaloneParentSubpageScreenContext
Expand All @@ -74,6 +80,9 @@ const StandaloneParentSubpage: Screen<
title: `${subpage.title} | ${organizationPage.title}`,
}}
>
<LanguageToggleSetup
ids={[organizationPage.id, parentSubpage.id, subpage.id]}
/>
<GridContainer>
<GridRow>
<GridColumn span={['9/9', '9/9', '7/9']} offset={['0', '0', '1/9']}>
Expand Down
1 change: 1 addition & 0 deletions apps/web/screens/queries/Organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export const GET_ORGANIZATION_PARENT_SUBPAGE_QUERY = gql`
$input: GetOrganizationParentSubpageInput!
) {
getOrganizationParentSubpage(input: $input) {
id
title
childLinks {
label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const studiesAccidentSubtypeMap = {
const getAccidentTypes = (answers: AccidentNotificationAnswers) => {
const accidentType = getValueViaPath<AccidentTypeEnum>(
answers,
'accidentType.answer',
'accidentType.radioButton',
)
const workAccidentType = getValueViaPath<WorkAccidentTypeEnum>(
answers,
Expand Down
11 changes: 7 additions & 4 deletions scripts/ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# This is a multi-stage Dockerfile which contains all CI-related operations as well as images to be deployed in production
ARG PLAYWRIGHT_VERSION
ARG DOCKER_IMAGE_REGISTRY=public.ecr.aws
ARG DOCKER_ECR_REGISTRY=public.ecr.aws/docker
ARG DOCKER_IMAGE_REGISTRY=${DOCKER_ECR_REGISTRY%/docker}
# Alias DOCKER_IMAGE_REGISTRY to DOCKER_REGISTRY for backwards compatibility
ARG DOCKER_REGISTRY=${DOCKER_IMAGE_REGISTRY}/docker
ARG NODE_IMAGE_TAG

FROM ${DOCKER_IMAGE_REGISTRY}/docker/library/node:${NODE_IMAGE_TAG} AS deps
FROM ${DOCKER_REGISTRY}/library/node:${NODE_IMAGE_TAG} AS deps

# hadolint ignore=DL3018
RUN apk add -U git
Expand Down Expand Up @@ -37,7 +40,7 @@ ENV NODE_OPTIONS="--max-old-space-size=8192"
RUN yarn run build ${APP} --prod

# This is base image for containers that are to be deployed
FROM ${DOCKER_IMAGE_REGISTRY}/docker/library/node:${NODE_IMAGE_TAG} AS output-base
FROM ${DOCKER_REGISTRY}/library/node:${NODE_IMAGE_TAG} AS output-base
ARG APP
ARG APP_HOME
ARG APP_DIST_HOME
Expand Down Expand Up @@ -85,7 +88,7 @@ LABEL branch=${GIT_BRANCH}
LABEL commit=${GIT_COMMIT_SHA}
ENTRYPOINT [ "node", "main.js" ]

FROM ${DOCKER_IMAGE_REGISTRY}/nginx/nginx:1.21-alpine AS output-static
FROM ${DOCKER_REGISTRY}/nginx/nginx:1.21-alpine AS output-static
ARG APP
ARG APP_DIST_HOME
ENV APP=${APP}
Expand Down

0 comments on commit e2d531c

Please sign in to comment.