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

Bump follow-redirects from 1.15.2 to 1.15.5 in /search #2063

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
3fae938
✨Add more aspectratios on fullwidthimage #1756
millianapia Jul 26, 2023
4ce2d8d
🐛 Fix rarios #1791
padms Aug 14, 2023
f8c4319
♻️ Simplify check #1756
padms Aug 17, 2023
d33af23
🔨 Migration scripts for adjusting aspectRatio #1756
padms Aug 30, 2023
ce3307c
🐛 Aspect ratio default #1756
padms Aug 30, 2023
114e20a
Merge branch 'main' into malj/1756
padms Sep 1, 2023
f8c7f32
♿️ use alt text for video #1834
padms Nov 16, 2023
75ab098
💄 Event card width #1929
padms Nov 28, 2023
915089b
💄 Fix news cards width #1928
padms Nov 28, 2023
1e907e9
💄 add sizes for teaser component #1997
millianapia Dec 5, 2023
c284c13
💄 Add sizes #1997
millianapia Dec 11, 2023
517ed0d
💄 Small pixel change #1997
millianapia Dec 18, 2023
8cc603b
🚧 WIP table rich text #1832
fernandolucchesi Jan 2, 2024
e820c61
⬆️ Upgrade dependencies #2033
padms Jan 4, 2024
913c5af
🐛 Add break-word overflow on portraitcard #2037
millianapia Jan 5, 2024
7ae6bae
Upgrade plugin
padms Jan 8, 2024
8cf18bb
⬆️ Upgrade axios #2033
padms Jan 9, 2024
f0c4d3a
🔍️ Add property key on multiplePromotions #2042
millianapia Jan 9, 2024
ac551ef
✨ Refactor validateCharCounter and add option to start at 0 #2046
millianapia Jan 9, 2024
3cf1e53
🔧 Add lint on sanityv3 studio #2024
millianapia Jan 10, 2024
165ddff
✨ Key numbers component #2048
padms Jan 11, 2024
ea0a685
Missing commit #2028
padms Jan 11, 2024
513a66c
🚧 Add migration script and rich text serializers #1832
fernandolucchesi Jan 11, 2024
b6fa9ef
🎨 Move table query to its file #1832
fernandolucchesi Jan 11, 2024
e70923d
Merge branch 'main' into fer/1832
fernandolucchesi Jan 12, 2024
930867a
✨ Add themes to tables #1832
fernandolucchesi Jan 15, 2024
2f61742
🗑️ Remove unused file #1832
fernandolucchesi Jan 15, 2024
9c64d37
♻️ Extract urls and make cookiebot url a wildcard #2058
millianapia Jan 15, 2024
b583b21
♻️ Remove unused filter and join #2058
millianapia Jan 16, 2024
6ac31ec
♻️ Remove any #2048
padms Jan 17, 2024
da24a09
Merge branch 'main' into padms/2048
padms Jan 17, 2024
c8d70be
Merge remote-tracking branch 'origin/malj/1756' into staging
padms Jan 17, 2024
489d016
Merge branch 'padms/1971' into staging
padms Jan 17, 2024
618f1b4
Merge branch 'padms/2048' into staging
padms Jan 17, 2024
cb0a32c
Merge branch 'padms/2033' into staging
padms Jan 17, 2024
5b4a762
Merge remote-tracking branch 'origin/malj/2037' into staging
padms Jan 17, 2024
0655aa6
Merge remote-tracking branch 'origin/malj/1997' into staging
padms Jan 17, 2024
be7b088
Merge remote-tracking branch 'origin/padms/1928' into staging
padms Jan 17, 2024
c73f8c4
Merge remote-tracking branch 'origin/padms/1929' into staging
padms Jan 17, 2024
770cde6
Merge remote-tracking branch 'origin/padms/1834' into staging
padms Jan 17, 2024
8031726
Merge remote-tracking branch 'origin/malj/2024' into staging
padms Jan 17, 2024
bd32024
Merge remote-tracking branch 'origin/malj/2042' into staging
padms Jan 17, 2024
448276d
♻️ Refactor securityheaders to include join #2058
millianapia Jan 17, 2024
bc73bbe
Merge branch 'malj/2058' into staging
millianapia Jan 17, 2024
9d33194
Add wildcard for other cookiebot #2058
millianapia Jan 17, 2024
6b4bff9
♻️ Add wildcard for cookiebot in img-src policy #2058
millianapia Jan 17, 2024
7ca436e
✨ Suppress hydration warning #2058
fernandolucchesi Jan 17, 2024
9cd79a1
Merge branch 'malj/2058' into staging
millianapia Jan 17, 2024
b41ab06
🏷️ Add type and remove unused import #1832
fernandolucchesi Jan 18, 2024
1aa5aed
Merge branch 'fer/1832' into staging
fernandolucchesi Jan 18, 2024
fcbc7c5
⬆️ Fix lockfile issue
fernandolucchesi Jan 18, 2024
9fd99b0
Merge 2010
padms Jan 18, 2024
e7ae6ef
✨ Add validation for table bg colors #1832
fernandolucchesi Jan 19, 2024
7abb196
Merge branch 'fer/1832' into staging
fernandolucchesi Jan 19, 2024
fa0935d
✏️ Change order of component list #1879
millianapia Jan 19, 2024
030d453
✨ Add missing type #1832
fernandolucchesi Jan 19, 2024
eb0dbc2
Merge branch 'fer/1832' into staging
fernandolucchesi Jan 19, 2024
da932bc
Merge branch 'malj/2046' into staging
millianapia Jan 19, 2024
3180a28
✨ Add keynumber type #1879
millianapia Jan 20, 2024
755d8f4
Merge branch 'malj/1879' into staging
millianapia Jan 20, 2024
276009f
Merge branch 'main' into fer/1832
fernandolucchesi Jan 22, 2024
d19a9ca
Merge branch 'fer/1832' into staging
fernandolucchesi Jan 22, 2024
8749a72
⬆️ Fix pnpm-lock file #2069
fernandolucchesi Jan 22, 2024
bacab97
Merge branch 'fer/2069'
fernandolucchesi Jan 22, 2024
ef9b5bc
Bump follow-redirects from 1.15.2 to 1.15.5 in /search
dependabot[bot] Jan 22, 2024
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
11 changes: 5 additions & 6 deletions .github/workflows/DEV-studio-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ jobs:
run: |
pnpm install
pnpm sanityv3 install
# @TODO: Enable ESlint for v3
# - name: Run ESLint 🔎
# id: lint
# run: |
# pnpm lint:studio
- name: Run ESLint 🔎
id: lint
run: |
pnpm lint:sanityv3
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
Expand Down Expand Up @@ -133,4 +132,4 @@ jobs:
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()
if: failure()
5 changes: 5 additions & 0 deletions e2e/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sanityv3/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions sanityv3/schemas/components/ThemeSelector/ThemeSelector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { Box, Card, Flex, Stack, Tooltip, Text } from '@sanity/ui'
import { useCallback } from 'react'
import { set } from 'sanity'
import type { ObjectInputProps } from 'sanity'
import styled from 'styled-components'
import { defaultColors, getColorForTheme } from './defaultColors'
import { EdsIcon } from '../../../icons'
import { text_field } from '@equinor/eds-icons'

const Circle = styled.div<{ active: boolean }>`
display: inline-block;
border: solid 2px ${({ active }) => (active ? 'var(--card-focus-ring-color)' : 'transparent')};
border-radius: 50%;
padding: 4px;
cursor: pointer;
`

const InnerCircle = styled.div<{ color: string; fillColor: string }>`
display: flex;
background-color: ${({ color }) => color};
border: 1px solid var(--card-hairline-soft-color);
padding: 15px;
border-radius: 50%;
color: ${({ fillColor }) => fillColor};
`

export type ThemeSelectorValue = {
title: string
value: number
}

type ColorCircleProps = {
color: ThemeSelectorValue
active: boolean
onClickHandler: (val: ThemeSelectorValue) => void
}

const ColorCircle = ({ color, active, onClickHandler }: ColorCircleProps) => {
const { background, highlight } = getColorForTheme(color.value)
return (
<Card paddingY={1}>
<Tooltip
content={
<Box padding={2}>
<Text muted size={1}>
{color.title}
</Text>
</Box>
}
fallbackPlacements={['right', 'left']}
placement="top"
portal
>
<Circle active={active} onClick={() => onClickHandler(color)}>
<InnerCircle color={background} fillColor={highlight}>
<EdsIcon {...text_field} />
</InnerCircle>
</Circle>
</Tooltip>
</Card>
)
}

type ThemeSelectorProps = ObjectInputProps

export const ThemeSelector = ({ value, onChange, schemaType }: ThemeSelectorProps) => {
const { options } = schemaType
const colors = (options?.colors as ThemeSelectorValue[]) || defaultColors

const handleSelect = useCallback(
(selected: ThemeSelectorValue) => {
if (selected === value) return

onChange(set(selected.title, ['title']))
onChange(set(selected.value, ['value']))
},
[onChange, value],
)

return (
<Stack space={3}>
{colors && (
<Card>
<Flex direction={'row'} wrap={'wrap'}>
{colors.map((colorItem: ThemeSelectorValue) => {
const { background } = getColorForTheme(colorItem.value)
return (
<ColorCircle
key={background}
color={colorItem}
active={colorItem.value === value?.value}
onClickHandler={handleSelect}
/>
)
})}
</Flex>
</Card>
)}
</Stack>
)
}

export default ThemeSelector
36 changes: 36 additions & 0 deletions sanityv3/schemas/components/ThemeSelector/defaultColors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export const defaultColors = [
{ title: 'White', value: 0 },
{ title: 'Moss Green Light', value: 1 },
{ title: 'Spruce Wood', value: 2 },
{ title: 'Mist Blue', value: 3 },
{ title: 'Mid Yellow', value: 4 },
{ title: 'Mid Orange', value: 5 },
{ title: 'Mid Blue 1', value: 6 },
{ title: 'Mid Blue 2', value: 7 },
{ title: 'Mid Green', value: 8 },
]

export const getColorForTheme = (pattern: number) => {
switch (pattern) {
case 1:
return { background: 'hsl(184, 30%, 96%)', highlight: 'hsl(348, 100%, 54%)' }
case 2:
return { background: 'hsl(25, 100%, 94%)', highlight: 'hsl(348, 100%, 54%)' }
case 3:
return { background: 'hsl(199, 58%, 90%)', highlight: 'hsl(348, 100%, 54%)' }
case 4:
return { background: '#FFF5B8', highlight: 'hsl(348, 100%, 54%)' }
case 5:
return { background: '#F8D1AF', highlight: 'hsl(348, 100%, 54%)' }
case 6:
return { background: '#49709C', highlight: '#F8D1AF' }
case 7:
return { background: '#49709C', highlight: '#FFF5B8' }
case 8:
return { background: '#C3E4CE', highlight: 'hsl(348, 100%, 54%)' }

case 0:
default:
return { background: 'hsl(0, 0%, 100%)', highlight: 'hsl(348, 100%, 54%)' }
}
}
2 changes: 2 additions & 0 deletions sanityv3/schemas/components/ThemeSelector/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './ThemeSelector'
export * from './defaultColors'
2 changes: 1 addition & 1 deletion sanityv3/schemas/components/renderers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ReactNode} from 'react'
import { ReactNode } from 'react'

type Props = {
children: ReactNode
Expand Down
1 change: 1 addition & 0 deletions sanityv3/schemas/documents/magazine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default {
of: [
{ type: 'textBlock' },
{ type: 'teaser' },
{ type: 'textTeaser' },
{ type: 'fullWidthImage' },
{ type: 'fullWidthVideo' },
{ type: 'figure' },
Expand Down
22 changes: 12 additions & 10 deletions sanityv3/schemas/documents/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,28 @@ export default {
of: [
{ type: 'textBlock' },
{ type: 'teaser' },
{ type: 'fullWidthImage' },
{ type: 'fullWidthVideo' },
{ type: 'figure' },
{ type: 'textWithIconArray' },
{ type: 'textTeaser' },
{ type: 'fullWidthImage' },
{ type: 'pullQuote', initialValue: { background: defaultColors[0] } },
{ type: 'accordion' },
{ type: 'promoTileArray' },
{ type: 'promotion' },
{ type: 'table' },
{ type: 'stockValuesApi' },
{ type: 'iframe' },
{ type: 'cookieDeclaration' },
Flags.HAS_FORMS && { type: 'form' },
Flags.HAS_NEWS && { type: 'newsList' },
Flags.HAS_TWITTER_FEED && { type: 'twitterEmbed' },
{ type: 'fullWidthVideo' },
{ type: 'textWithIconArray' },
{ type: 'keyNumbers' },
{ type: 'promotion' },
{ type: 'anchorLink' },
{ type: 'imageCarousel' },
{ type: 'iframeCarousel' },
{ type: 'videoPlayer' },
{ type: 'videoPlayerCarousel' },
{ type: 'table' },
Flags.HAS_FORMS && { type: 'form' },
Flags.HAS_NEWS && { type: 'newsList' },
{ type: 'stockValuesApi' },
Flags.HAS_TWITTER_FEED && { type: 'twitterEmbed' },
{ type: 'cookieDeclaration' },
].filter((e) => e),
},
].filter((e) => e),
Expand Down
1 change: 1 addition & 0 deletions sanityv3/schemas/editors/titleEditorContentType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const configureTitleBlockContent = (
if (highlight) {
config.marks?.decorators?.push(textColorConfig)
}

return config
}

Expand Down
8 changes: 8 additions & 0 deletions sanityv3/schemas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import stockValuesApi from './objects/stockValuesApi'
import table from './objects/table'
import tableRichText from './objects/table/tableRichText'
import teaser from './objects/teaser'
import textTeaser from './objects/textTeaser'
import textBlock from './objects/textBlock'
import textWithIcon from './objects/textWithIcon'
import textWithIconArray from './objects/textWithIconArray'
Expand All @@ -85,6 +86,9 @@ import videoPlayer from './objects/videoPlayer'
import videoPlayerCarousel from './objects/videoPlayerCarousel'
import videoControls from './objects/videoControls'
import hlsVideo from './objects/hlsVideo'
import keyNumbers from './objects/keyNumbers'
import keyNumberItem from './objects/keyNumberItem'
import themeList from './objects/themeList'

const routeSchemas = languages.map(({ name, title }) => {
return route(name, title)
Expand Down Expand Up @@ -122,6 +126,7 @@ const RemainingSchemas = [
downloadableFile,
downloadableImage,
teaser,
textTeaser,
textBlock,
accordion,
accordionItem,
Expand Down Expand Up @@ -164,6 +169,9 @@ const RemainingSchemas = [
videoPlayerCarousel,
videoControls,
hlsVideo,
keyNumbers,
keyNumberItem,
themeList,
]

// Then we give our schema to the builder and provide the result to Sanity
Expand Down
14 changes: 14 additions & 0 deletions sanityv3/schemas/objects/fullWidthImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ export default {
type: 'imageWithAltAndCaption',
validation: (Rule: Rule) => Rule.required(),
},
{
name: 'aspectRatio',
type: 'number',
title: 'Aspect ratio',
options: {
list: [
{ title: '10:3', value: 0.3 },
{ title: '2:1', value: 0.5 },
],
layout: 'dropdown',
},
initialValue: 0.3,
validation: (Rule: Rule) => Rule.required(),
},
],
preview: {
select: {
Expand Down
44 changes: 44 additions & 0 deletions sanityv3/schemas/objects/keyNumberItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Rule } from 'sanity'
import { NumberIcon } from '@sanity/icons'

export default {
name: 'keyNumberItem',
type: 'object',
title: 'Key Number',
fields: [
{
name: 'keyNumber',
title: 'Key Number',
type: 'number',
validation: (Rule: Rule) => Rule.required(),
},
{
name: 'unit',
title: 'Unit',
description: 'A short abbreviated text describing the unit of the key number',
type: 'string',
},
{
name: 'description',
title: 'Description',
type: 'string',
description: 'Short description to show below the key number',
},
],

preview: {
select: {
keyNumber: 'keyNumber',
unit: 'unit',
description: 'description',
},
prepare(selection: Record<string, string | number>) {
const { keyNumber, unit, description } = selection
return {
title: `${keyNumber} ${unit ?? ''}`,
subtitle: description,
media: NumberIcon,
}
},
},
}
Loading