Skip to content

Commit

Permalink
Merge branch 'fer/1944' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Oct 20, 2023
2 parents fcc931c + f1088cf commit a55c3b0
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion sanityv3/resolveProductionUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const remoteUrl = () => {
const env = window.location.hostname.includes('equinor-web-sites-preprod') ? 'preprod' : 'prod'
switch (dataset) {
case 'global':
return `https://web-equinor-web-sites-${env}.c2.radix.equinor.com/`
return `https://web-equinor-web-sites-${env}.c2.radix.equinor.com`
case 'global-development':
return 'https://web-global-development-equinor-web-sites-dev.c2.radix.equinor.com'
case 'global-test':
Expand Down
14 changes: 9 additions & 5 deletions sanityv3/schemas/components/VideoSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ const VideoSelector = forwardRef(function VideoSelector(
headers: {
Authorization: `Basic ${SCREEN9_AUTH}`,
},
}).then((res) =>
res.status !== 200
? setError(`Could not retrieve url from Screen9. Please report the error to the dev team.`)
: res.json(),
)
})
.then((res) =>
res.status !== 200
? setError('Could not retrieve url from Screen9. Please report the error to the dev team.')
: res.json(),
)
.catch((error) => {
setError(`Could not retrieve url from Screen9. Please report the error to the dev team. Error: ${error}`)
})

if (!data.error) {
const video = {
Expand Down
4 changes: 2 additions & 2 deletions search/IndexSanityContent/magazine/sanity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export const query = /* groq */ `*[_type == "magazine" && _lang == $lang && !(_i
"textBlocks": content[_type == "textBlock"]{
"_key": _key,
"title": select(
"isBigText" == true => {
isBigText == true =>
pt::text(bigTitle),
pt::text(title)
}),
),
"ingress": pt::text(ingress),
"text": pt::text(text) // TODO: Do this manually to cover all cases
},
Expand Down
4 changes: 2 additions & 2 deletions search/IndexSanityContent/topic/sanity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export const query = /* groq */ `*[_type match "route_" + $lang + "*" && content
"textBlocks": content->content[_type == "textBlock"]{
"_key": _key,
"title": select(
"isBigText" == true => {
isBigText == true =>
pt::text(bigTitle),
pt::text(title)
}),
),
"ingress": pt::text(ingress),
"text": pt::text(text) // TODO: Do this manually to cover all cases
},
Expand Down
4 changes: 3 additions & 1 deletion web/pages/magasin/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ MagazineIndexNorwegian.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'no' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'no' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not Norwegian.
// This is a hack and and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'no') {
return {
notFound: true,
Expand Down
4 changes: 3 additions & 1 deletion web/pages/magazine/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ MagazineIndex.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'en' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'en' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not English.
// This is a hack and and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'en') {
return {
notFound: true,
Expand Down
6 changes: 4 additions & 2 deletions web/pages/news/index.global.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetServerSideProps } from 'next'
import { GetServerSideProps, GetStaticPaths } from 'next'
import { InstantSearchSSRProvider } from 'react-instantsearch-hooks-web'
import { getServerState } from 'react-instantsearch-hooks-server'
import type { AppProps } from 'next/app'
Expand Down Expand Up @@ -67,12 +67,14 @@ NewsRoom.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'en' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'en' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not English.
// This is a hack and and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'en') {
return {
notFound: true,
Expand Down
5 changes: 4 additions & 1 deletion web/pages/nyheter/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ NorwegianNewsRoom.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'no' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'no' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not Norwegian.
// This is a hack, and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'no') {
return {
notFound: true,
Expand Down

0 comments on commit a55c3b0

Please sign in to comment.