Skip to content

Commit

Permalink
Merge branch 'main' into fer/1832
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Jan 22, 2024
2 parents 030d453 + ddd3e77 commit 276009f
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 166 deletions.
2 changes: 1 addition & 1 deletion sanityv3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@reach/auto-id": "^0.18.0",
"@sanity/asset-utils": "^1.3.0",
"@sanity/client": "^6.7.0",
"@sanity/cross-dataset-duplicator": "^1.2.3",
"@sanity/cross-dataset-duplicator": "^1.2.4",
"@sanity/document-internationalization": "^1.1.1",
"@sanity/icons": "^2.3.1",
"@sanity/scheduled-publishing": "^1.2.1",
Expand Down
33 changes: 11 additions & 22 deletions sanityv3/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/schemas/objects/promotion/promoteTopic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
description: 'A short and catchy introduction text for this topic content card (max. 215 chars)',
type: 'array',
of: [introBlockContentType],
validation: (Rule: Rule) => Rule.custom((value: any) => validateCharCounterEditor(value, 215)),
validation: (Rule: Rule) => Rule.custom((value: any) => validateCharCounterEditor(value, 215, true)),
},
],
preview: {
Expand Down
20 changes: 12 additions & 8 deletions sanityv3/schemas/validations/validateCharCounterEditor.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
export const validateCharCounterEditor = (value: PortableTextBlock[], charLimit: number) => {
if (!value || value.length === 0) {
return 'Required'
import type { PortableTextBlock } from 'sanity'

export const validateCharCounterEditor = (value: PortableTextBlock[], charLimit: number, allowZeroLength = false) => {
if (!value || (value.length === 0 && !allowZeroLength)) {
return allowZeroLength ? true : 'Required'
}

const count = value[0].children.reduce(
(total: any, current: { text: string | any[] }) => total + current.text.length,
0,
)
const count = value[0]?.children
? (value[0].children as { text: string }[]).reduce(
(total: number, current: { text: string }) => total + current.text.length,
0,
)
: null

if (count > charLimit) {
if (count !== null && count > charLimit) {
return `The introduction should be no longer than ${charLimit} characters. Currently ${count} characters long.`
}

Expand Down
2 changes: 1 addition & 1 deletion search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@azure/storage-blob": "^12.15.0",
"@sanity/client": "^5.4.2",
"algoliasearch": "^4.19.1",
"axios": "^1.6.0",
"axios": "^1.6.4",
"dotenv-azure": "^2.0.0",
"fp-ts": "^2.16.0"
}
Expand Down
20 changes: 15 additions & 5 deletions search/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 web/components/src/FormattedDateTime/FormattedDate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const FormattedDate = ({
return (
<StyledDate uppercase={uppercase} {...rest}>
{icon && <DateIcon />}
<StyledTime dateTime={datetime}>
<StyledTime suppressHydrationWarning dateTime={datetime}>
<ReactIntlDate value={new Date(datetime)} day={day} year={year} month={month} />
</StyledTime>
</StyledDate>
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@chakra-ui/skip-nav": "^2.0.12",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@equinor/eds-core-react": "0.32.4",
"@equinor/eds-core-react": "0.33.0",
"@equinor/eds-icons": "^0.19.1",
"@equinor/eds-tokens": "^0.9.0",
"@next/bundle-analyzer": "^12.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import IFrame from '../../iframe/IFrame'
import type { PortableTextBlock } from '@portabletext/types'
import type { IFrameData } from 'types/types'
import styled from 'styled-components'
import RichText from '../RichText'

type IframeRenderer = {
_key: string
Expand All @@ -28,6 +29,7 @@ export const BasicIframe = (iframe: BlockProps) => {

return (
<Container>
{value.title && <RichText value={value.title} />}
<IFrame
frameTitle={data.frameTitle}
url={data.url}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const StyledBackground = styled(BackgroundContainer)`
}
min-width: var(--card-maxWidth, 100%);
max-width: var(--card-maxWidth, 100%);
`
const StyledEventsCard = styled(EventsCard)`
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const StyledPeopleCard = styled(PeopleCard)`
const CardWrapper = styled.div`
display: flex;
min-width: 280px;
max-width: var(--card-maxWidth);
width: 100%;
`

Expand Down
Loading

0 comments on commit 276009f

Please sign in to comment.