Skip to content

Commit

Permalink
Merge branch 'main' into jonas/sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbrunvoll committed Apr 2, 2024
2 parents b94d7ac + 2a1ac26 commit fce76cb
Show file tree
Hide file tree
Showing 41 changed files with 1,115 additions and 68 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,27 @@ jobs:
ATB_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ github.event_name == 'release' && 'atb-mobility-platform.firebaseapp.com' || 'atb-mobility-platform-staging.firebaseapp.com' }}
ATB_NEXT_PUBLIC_FIREBASE_APP_ID=${{ github.event_name == 'release' && '1:827196677776:web:c4b1d8924bb5778bf50215' || '1:939812594010:web:0308b2a9cdc80b0d069363' }}
ATB_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ github.event_name == 'release' && '' || '' }}
ATB_NEXT_PUBLIC_DISABLE_LINE_FILTER=false
NFK_NEXT_PUBLIC_MAPBOX_DEFAULT_LAT=67.280357
NFK_NEXT_PUBLIC_MAPBOX_DEFAULT_LNG=14.404916
NFK_NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ github.event_name == 'release' && 'nfk-prod' || 'nfk-staging'}}
NFK_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=${{ github.event_name == 'release' && 'AIzaSyDGwZLvjhRJmxiU9BOkbYn9P78QTJsAaBQ' || 'AIzaSyDU18r0GPKIGcVxA3Zj_zgkrtqaUfcOHGM' }}
NFK_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ github.event_name == 'release' && 'nfk-prod.firebaseapp.com' || 'nfk-staging.firebaseapp.com' }}
NFK_NEXT_PUBLIC_FIREBASE_APP_ID=${{ github.event_name == 'release' && '1:638315587956:web:51e95a11a03f27dc9ca421' || '1:793301954236:web:908723b8ded2824cadeab9' }}
NFK_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ github.event_name == 'release' && '' || '' }}
NFK_NEXT_PUBLIC_DISABLE_LINE_FILTER=true
FRAM_NEXT_PUBLIC_MAPBOX_DEFAULT_LAT=62.4705
FRAM_NEXT_PUBLIC_MAPBOX_DEFAULT_LNG=6.1533
FRAM_NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ github.event_name == 'release' && 'fram-prod-a7850' || 'fram-staging'}}
FRAM_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=${{ github.event_name == 'release' && 'AIzaSyBw6YwFJV__iw6Qp7bLdcwcUKtr2f02H2M' || 'AIzaSyBTsBaCnXcCFPQUaXTPLSMGfydaTpaLDrs' }}
FRAM_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ github.event_name == 'release' && 'fram-prod-a7850.firebaseapp.com' || 'fram-staging.firebaseapp.com' }}
FRAM_NEXT_PUBLIC_FIREBASE_APP_ID=${{ github.event_name == 'release' && '1:717595301444:web:1e16129330d562f1b3ce11' || '1:312905478211:web:41c6f9db83ae5ef0efa4f6' }}
FRAM_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ github.event_name == 'release' && 'G-KS45JBFWF4' || '' }}
FRAM_NEXT_PUBLIC_DISABLE_LINE_FILTER=false
TROMS_NEXT_PUBLIC_MAPBOX_DEFAULT_LAT=69.665229
TROMS_NEXT_PUBLIC_MAPBOX_DEFAULT_LNG=18.9070347
TROMS_NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ github.event_name == 'release' && '' || 'troms-staging'}}
TROMS_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=${{ github.event_name == 'release' && '' || 'AIzaSyCtJMximw0SL9N8YNH21TWDO0s_mv_9crE' }}
TROMS_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ github.event_name == 'release' && '' || 'troms-staging.firebaseapp.com' }}
TROMS_NEXT_PUBLIC_FIREBASE_APP_ID=${{ github.event_name == 'release' && '' || '1:973624729382:web:a84d8a489613a14be12be7' }}
TROMS_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=''
TROMS_NEXT_PUBLIC_DISABLE_LINE_FILTER=false
secrets:
github_pat: ${{ secrets.GH_PAT }}
build_secrets: |
Expand Down
8 changes: 0 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ARG ATB_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY
ARG ATB_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ARG ATB_NEXT_PUBLIC_FIREBASE_APP_ID
ARG ATB_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ARG ATB_NEXT_PUBLIC_DISABLE_LINE_FILTER

ARG NFK_NEXT_PUBLIC_MAPBOX_DEFAULT_LAT
ARG NFK_NEXT_PUBLIC_MAPBOX_DEFAULT_LNG
Expand All @@ -31,7 +30,6 @@ ARG NFK_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY
ARG NFK_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ARG NFK_NEXT_PUBLIC_FIREBASE_APP_ID
ARG NFK_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ARG NFK_NEXT_PUBLIC_DISABLE_LINE_FILTER

ARG FRAM_NEXT_PUBLIC_MAPBOX_DEFAULT_LAT
ARG FRAM_NEXT_PUBLIC_MAPBOX_DEFAULT_LNG
Expand All @@ -40,7 +38,6 @@ ARG FRAM_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY
ARG FRAM_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ARG FRAM_NEXT_PUBLIC_FIREBASE_APP_ID
ARG FRAM_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ARG FRAM_NEXT_PUBLIC_DISABLE_LINE_FILTER

ARG TROMS_NEXT_PUBLIC_MAPBOX_DEFAULT_LAT
ARG TROMS_NEXT_PUBLIC_MAPBOX_DEFAULT_LNG
Expand All @@ -49,7 +46,6 @@ ARG TROMS_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY
ARG TROMS_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ARG TROMS_NEXT_PUBLIC_FIREBASE_APP_ID
ARG TROMS_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ARG TROMS_NEXT_PUBLIC_DISABLE_LINE_FILTER

# Generate GraphQL files
RUN yarn generate
Expand All @@ -63,7 +59,6 @@ ENV NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=$ATB_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY
ENV NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=$ATB_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ENV NEXT_PUBLIC_FIREBASE_APP_ID=$ATB_NEXT_PUBLIC_FIREBASE_APP_ID
ENV NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=$ATB_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ENV NEXT_PUBLIC_DISABLE_LINE_FILTER=$ATB_NEXT_PUBLIC_DISABLE_LINE_FILTER

RUN --mount=type=secret,id=ATB_NEXT_PUBLIC_MAPBOX_API_TOKEN \
--mount=type=secret,id=ATB_NEXT_PUBLIC_MAPBOX_STOP_PLACES_STYLE_URL \
Expand All @@ -80,7 +75,6 @@ ENV NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=$NFK_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY
ENV NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=$NFK_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ENV NEXT_PUBLIC_FIREBASE_APP_ID=$NFK_NEXT_PUBLIC_FIREBASE_APP_ID
ENV NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=$NFK_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ENV NEXT_PUBLIC_DISABLE_LINE_FILTER=$NFK_NEXT_PUBLIC_DISABLE_LINE_FILTER

RUN --mount=type=secret,id=NFK_NEXT_PUBLIC_MAPBOX_API_TOKEN \
--mount=type=secret,id=NFK_NEXT_PUBLIC_MAPBOX_STOP_PLACES_STYLE_URL \
Expand All @@ -97,7 +91,6 @@ ENV NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=$FRAM_NEXT_PUBLIC_FIREBASE_PUBLIC_API_KE
ENV NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=$FRAM_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ENV NEXT_PUBLIC_FIREBASE_APP_ID=$FRAM_NEXT_PUBLIC_FIREBASE_APP_ID
ENV NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=$FRAM_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ENV NEXT_PUBLIC_DISABLE_LINE_FILTER=$FRAM_NEXT_PUBLIC_DISABLE_LINE_FILTER

RUN --mount=type=secret,id=FRAM_NEXT_PUBLIC_MAPBOX_API_TOKEN \
--mount=type=secret,id=FRAM_NEXT_PUBLIC_MAPBOX_STOP_PLACES_STYLE_URL \
Expand All @@ -114,7 +107,6 @@ ENV NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY=$TROMS_NEXT_PUBLIC_FIREBASE_PUBLIC_API_K
ENV NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=$TROMS_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ENV NEXT_PUBLIC_FIREBASE_APP_ID=$TROMS_NEXT_PUBLIC_FIREBASE_APP_ID
ENV NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=$TROMS_NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
ENV NEXT_PUBLIC_DISABLE_LINE_FILTER=$TROMS_NEXT_PUBLIC_DISABLE_LINE_FILTER

RUN --mount=type=secret,id=TROMS_NEXT_PUBLIC_MAPBOX_API_TOKEN \
--mount=type=secret,id=TROMS_NEXT_PUBLIC_MAPBOX_STOP_PLACES_STYLE_URL \
Expand Down
2 changes: 1 addition & 1 deletion orgs/atb.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "./schema-validation.json",
"orgId": "atb",
"orgLineIdPrefix": "ATB:Line:2_",
"authorityId": "ATB:Authority:2",

"supportEmail": "kundeservice@atb.no",

Expand Down
4 changes: 2 additions & 2 deletions orgs/fram.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "./schema-validation.json",

"orgId": "fram",
"orgLineIdPrefix": "MOR:Line:",
"authorityId": "MOR:Authority:MOR",

"supportEmail": "fram@mrfylke.no",

Expand All @@ -19,7 +19,7 @@
},

"accessibilityStatementUrl": {
"default": "https://uustatus.no/nb/erklaringer/publisert/1b5c3a7f-cb6b-45c7-afd6-752931242235"
"default": "https://uustatus.no/nb/erklaringer/publisert/7d09e41a-8b28-4bc9-b5d2-a6bc8432f2cf"
},

"supportUrl": {
Expand Down
2 changes: 1 addition & 1 deletion orgs/nfk.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "./schema-validation.json",
"orgId": "nfk",
"orgLineIdPrefix": "NOR:Line:12_",
"authorityId": "NOR:Authority:12",

"supportEmail": "sentrumsterminalen@boreal.no",

Expand Down
2 changes: 1 addition & 1 deletion orgs/schema-validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"enum": ["atb", "fram", "nfk", "troms"],
"type": "string"
},
"orgLineIdPrefix": {
"authorityId": {
"type": "string"
},
"$schema": {
Expand Down
2 changes: 1 addition & 1 deletion orgs/troms.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "./schema-validation.json",
"orgId": "troms",
"orgLineIdPrefix": "TRO:Line:1_",
"authorityId": "TRO:Authority:1",

"supportEmail": "",

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"graphql": "^16.8.1",
"haversine-distance": "^1.2.1",
"humanize-duration": "^3.31.0",
"iso8601-duration": "^2.1.2",
"lodash": "^4.17.21",
"lz-string": "^1.5.0",
"mapbox-gl": "^3.2.0",
Expand Down
8 changes: 4 additions & 4 deletions src/components/labled-input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export default function LabeledInput({
...props
}: LabeledInputProps) {
const isError = typeof validationError !== 'undefined';
const prefix = useId();
const postfix = useId();

const errorLabel = prefix + 'Error';
const errorLabel = 'error-' + postfix;

const validationStatusProps: JSX.IntrinsicElements['input'] = status
const validationStatusProps: JSX.IntrinsicElements['input'] = isError
? { 'aria-invalid': 'true', 'aria-describedby': errorLabel }
: {};
: { 'aria-invalid': 'false' };
return (
<div
className={andIf({
Expand Down
1 change: 1 addition & 0 deletions src/components/map/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const mapLegSchema = z.object({
transportSubmode: transportSubmodeSchema.optional(),
faded: z.boolean(),
points: z.array(z.array(z.number(), z.number())),
isFlexibleLine: z.boolean(),
});

export type MapLegType = z.infer<typeof mapLegSchema>;
1 change: 1 addition & 0 deletions src/components/map/use-map-legs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const useMapLegs = (
],
},
transport,
mapLeg.isFlexibleLine,
);
const lineColor = mapLeg.faded
? hexToRgba(transportColor.background, 0.5)
Expand Down
2 changes: 2 additions & 0 deletions src/components/map/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const mapToMapLegs = (
transportSubmode: TransportSubmodeType | undefined,
fromStopPlace?: { latitude?: number; longitude?: number },
toStopPlace?: { latitude?: number; longitude?: number },
isFlexibleLine?: boolean,
) => {
if (!pointsOnLink || !pointsOnLink.points) return [];
const points = polyline.decode(pointsOnLink.points);
Expand All @@ -72,6 +73,7 @@ export const mapToMapLegs = (
transportSubmode,
faded,
points: item,
isFlexibleLine: isFlexibleLine ?? false,
};
};

Expand Down
21 changes: 20 additions & 1 deletion src/components/message-box/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const MessageBox = ({
color: staticColors['status'][type].text,
};
const overrideMode = useStatusThemeColor(type);
const aria = modeToAria(type);

return (
<div
Expand All @@ -62,7 +63,12 @@ export const MessageBox = ({
{title}
</Typo.h2>
)}
<Typo.p className={style.body} textType="body__primary" id={textId}>
<Typo.p
className={style.body}
textType="body__primary"
id={textId}
{...aria}
>
{message}
</Typo.p>
{onClick && (
Expand Down Expand Up @@ -108,3 +114,16 @@ function useStatusThemeColor(mode: MessageMode): MonoIconProps['overrideMode'] {

return overrideColor;
}

function modeToAria(mode: MessageMode): JSX.IntrinsicElements['div'] {
switch (mode) {
case 'error':
return { role: 'alert' };
case 'valid':
return { 'aria-live': 'polite' };
case 'warning':
return { 'aria-live': 'polite' };
case 'info':
return { role: 'status' };
}
}
Loading

0 comments on commit fce76cb

Please sign in to comment.