Skip to content

Commit 2d6e74a

Browse files
authoredMar 14, 2025··
refactor(core): update "no releases" content (#8938)
1 parent acb753f commit 2d6e74a

File tree

3 files changed

+294
-80
lines changed

3 files changed

+294
-80
lines changed
 

‎packages/sanity/src/core/releases/i18n/resources.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ const releasesLocaleStrings = {
180180
/** Text for when a release is not found */
181181
'not-found': 'Release not found: {{releaseId}}',
182182

183+
/** Text for the button name for the release tool */
184+
'overview.action.documentation': 'Documentation',
183185
/** Text for when a release is not found */
184186
'overview.calendar.tooltip': 'View calendar',
185187
/** Description for the release tool */
186188
'overview.description':
187-
'Releases are collections of document versions which can be managed and published together.',
189+
'Releases are collections of document changes which can be managed, scheduled, and rolled back together.',
188190
/** Text for the placeholder in the search release input */
189191
'overview.search-releases-placeholder': 'Search releases',
190192
/** Title for the release tool */

‎packages/sanity/src/core/releases/tool/overview/ReleasesOverview.tsx

+104-79
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
import {AddIcon, ChevronDownIcon, EarthGlobeIcon} from '@sanity/icons'
2-
import {
3-
Box,
4-
type ButtonMode,
5-
Card,
6-
Container,
7-
Flex,
8-
Inline,
9-
Stack,
10-
Text,
11-
useMediaIndex,
12-
} from '@sanity/ui'
2+
import {Box, type ButtonMode, Card, Flex, Inline, Stack, Text, useMediaIndex} from '@sanity/ui'
133
import {format, isSameDay} from 'date-fns'
144
import {AnimatePresence, motion} from 'framer-motion'
155
import {type MouseEventHandler, useCallback, useEffect, useMemo, useRef, useState} from 'react'
@@ -36,6 +26,7 @@ import {getReleaseDefaults} from '../../util/util'
3626
import {ReleaseMenuButton} from '../components/ReleaseMenuButton/ReleaseMenuButton'
3727
import {Table, type TableRowProps} from '../components/Table/Table'
3828
import {type TableSort} from '../components/Table/TableProvider'
29+
import {ReleaseIllustration} from '../resources/ReleaseIllustration'
3930
import {CalendarPopover} from './CalendarPopover'
4031
import {
4132
DATE_SEARCH_PARAM_KEY,
@@ -108,6 +99,7 @@ export function ReleasesOverview() {
10899

109100
const hasReleases = releases.length > 0 || archivedReleases.length > 0
110101
const loadingOrHasReleases = loading || hasReleases
102+
const hasNoReleases = !loading && !hasReleases
111103

112104
const tableReleases = useMemo<TableRelease[]>(() => {
113105
if (!hasReleases || !releasesMetadata) return []
@@ -259,7 +251,6 @@ export function ReleasesOverview() {
259251
}
260252
onClick={handleOnClickCreateRelease}
261253
text={tCore('release.action.create-new')}
262-
size="large"
263254
tooltipProps={{
264255
disabled: hasCreatePermission === true,
265256
content: tCore('release.action.permission.error'),
@@ -352,78 +343,112 @@ export function ReleasesOverview() {
352343
[releaseGroupMode, t],
353344
)
354345

346+
const NoRelease = () => {
347+
return (
348+
<Flex
349+
direction="column"
350+
flex={1}
351+
justify={hasNoReleases ? 'center' : 'flex-start'}
352+
align={hasNoReleases ? 'center' : 'flex-start'}
353+
style={{position: 'relative'}}
354+
>
355+
<Flex gap={3} direction="column" style={{maxWidth: '300px'}}>
356+
<ReleaseIllustration />
357+
<Text as="h1" size={1} weight="semibold" data-testid="no-releases-info-text">
358+
{t('overview.title')}
359+
</Text>
360+
<Text size={1} muted>
361+
{t('overview.description')}
362+
</Text>
363+
<Inline space={2}>
364+
{createReleaseButton}
365+
<Button
366+
as="a"
367+
href="https://www.sanity.io/docs/content-releases"
368+
target="_blank"
369+
mode="ghost"
370+
onClick={handleOnClickCreateRelease}
371+
text={t('overview.action.documentation')}
372+
/>
373+
</Inline>
374+
</Flex>
375+
</Flex>
376+
)
377+
}
378+
355379
return (
356380
<Flex direction="row" flex={1} style={{height: '100%'}}>
357381
<Flex flex={1}>
358382
{showCalendar && renderCalendarFilter}
359-
<Flex direction="column" flex={1} style={{position: 'relative'}}>
360-
<Card flex="none" padding={3}>
361-
<Flex align="center" flex={1} gap={3}>
362-
<Inline>
363-
{!showCalendar && <CalendarPopover content={renderCalendarFilter} />}
364-
<Stack padding={2} space={4}>
365-
<Text as="h1" size={1} weight="semibold">
366-
{t('overview.title')}
367-
</Text>
368-
</Stack>
369-
</Inline>
370-
371-
<Flex flex={1} gap={1}>
372-
{loadingOrHasReleases &&
373-
(releaseFilterDate ? (
374-
<DateFilterButton filterDate={releaseFilterDate} onClear={clearFilterDate} />
375-
) : (
376-
currentArchivedPicker
377-
))}
378-
</Flex>
379-
<Flex flex="none" gap={2}>
380-
<Button
381-
icon={EarthGlobeIcon}
382-
iconRight={ChevronDownIcon}
383-
mode="bleed"
384-
size="large"
385-
text={`${timeZone.abbreviation} (${timeZone.namePretty})`}
386-
onClick={dialogTimeZoneShow}
387-
/>
388-
{DialogTimeZone && <DialogTimeZone {...dialogProps} />}
389-
{loadingOrHasReleases && createReleaseButton}
390-
</Flex>
383+
384+
{hasNoReleases ? (
385+
<NoRelease />
386+
) : (
387+
<>
388+
<Flex direction="column" flex={1} style={{position: 'relative'}}>
389+
<Card flex="none" padding={3}>
390+
<Flex align="center" flex={1} gap={3}>
391+
<Inline>
392+
{!showCalendar && <CalendarPopover content={renderCalendarFilter} />}
393+
<Stack padding={2} space={4}>
394+
<Text as="h1" size={1} weight="semibold">
395+
{t('overview.title')}
396+
</Text>
397+
</Stack>
398+
</Inline>
399+
400+
<Flex flex={1} gap={1}>
401+
{loadingOrHasReleases &&
402+
(releaseFilterDate ? (
403+
<DateFilterButton
404+
filterDate={releaseFilterDate}
405+
onClear={clearFilterDate}
406+
/>
407+
) : (
408+
currentArchivedPicker
409+
))}
410+
</Flex>
411+
<Flex flex="none" gap={2}>
412+
<Button
413+
icon={EarthGlobeIcon}
414+
iconRight={ChevronDownIcon}
415+
mode="bleed"
416+
size="large"
417+
text={`${timeZone.abbreviation} (${timeZone.namePretty})`}
418+
onClick={dialogTimeZoneShow}
419+
/>
420+
{DialogTimeZone && <DialogTimeZone {...dialogProps} />}
421+
{loadingOrHasReleases && createReleaseButton}
422+
</Flex>
423+
</Flex>
424+
</Card>
425+
<Box ref={scrollContainerRef} marginTop={3} overflow={'auto'}>
426+
{(loading || hasReleases) && (
427+
<Table<TableRelease>
428+
// for resetting filter and sort on table when filer changed
429+
key={releaseFilterDate ? 'by_date' : releaseGroupMode}
430+
defaultSort={
431+
releaseGroupMode === 'archived'
432+
? DEFAULT_ARCHIVED_RELEASES_OVERVIEW_SORT
433+
: DEFAULT_RELEASES_OVERVIEW_SORT
434+
}
435+
loading={loadingTableData}
436+
data={filteredReleases}
437+
columnDefs={tableColumns}
438+
emptyState={t('no-releases')}
439+
// eslint-disable-next-line @sanity/i18n/no-attribute-string-literals
440+
rowId="_id"
441+
rowActions={renderRowActions}
442+
rowProps={getRowProps}
443+
scrollContainerRef={scrollContainerRef}
444+
hideTableInlinePadding
445+
/>
446+
)}
447+
</Box>
391448
</Flex>
392-
</Card>
393-
<Box ref={scrollContainerRef} marginTop={3} overflow={'auto'}>
394-
{!loading && !hasReleases ? (
395-
<Container style={{margin: 0}} width={0}>
396-
<Stack space={5} padding={4}>
397-
<Text data-testid="no-releases-info-text" muted size={2}>
398-
{t('overview.description')}
399-
</Text>
400-
<Box>{createReleaseButton}</Box>
401-
</Stack>
402-
</Container>
403-
) : (
404-
<Table<TableRelease>
405-
// for resetting filter and sort on table when filer changed
406-
key={releaseFilterDate ? 'by_date' : releaseGroupMode}
407-
defaultSort={
408-
releaseGroupMode === 'archived'
409-
? DEFAULT_ARCHIVED_RELEASES_OVERVIEW_SORT
410-
: DEFAULT_RELEASES_OVERVIEW_SORT
411-
}
412-
loading={loadingTableData}
413-
data={filteredReleases}
414-
columnDefs={tableColumns}
415-
emptyState={t('no-releases')}
416-
// eslint-disable-next-line @sanity/i18n/no-attribute-string-literals
417-
rowId="_id"
418-
rowActions={renderRowActions}
419-
rowProps={getRowProps}
420-
scrollContainerRef={scrollContainerRef}
421-
hideTableInlinePadding
422-
/>
423-
)}
424-
</Box>
425-
{renderCreateReleaseDialog()}
426-
</Flex>
449+
{renderCreateReleaseDialog()}
450+
</>
451+
)}
427452
</Flex>
428453
</Flex>
429454
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
export const ReleaseIllustration = () => {
2+
return (
3+
<svg
4+
width="248"
5+
height="201"
6+
viewBox="0 0 248 201"
7+
fill="none"
8+
xmlns="http://www.w3.org/2000/svg"
9+
>
10+
<path
11+
opacity="0.2"
12+
d="M175.4 29.8262V98.1738C175.4 103.823 181.346 107.498 186.399 104.971L222.399 86.9714C224.974 85.684 226.6 83.0524 226.6 80.1738V11.8262C226.6 6.17654 220.654 2.50197 215.601 5.02859L179.601 23.0286C177.026 24.316 175.4 26.9476 175.4 29.8262Z"
13+
fill="white"
14+
stroke="#515870"
15+
strokeWidth="1.2"
16+
/>
17+
<path
18+
opacity="0.2"
19+
d="M183.4 33.8262V102.174C183.4 107.823 189.346 111.498 194.399 108.971L230.399 90.9714C232.974 89.684 234.6 87.0524 234.6 84.1738V15.8262C234.6 10.1765 228.654 6.50197 223.601 9.02859L187.601 27.0286C185.026 28.316 183.4 30.9476 183.4 33.8262Z"
20+
fill="white"
21+
stroke="#515870"
22+
strokeWidth="1.2"
23+
/>
24+
<path
25+
opacity="0.2"
26+
d="M195.4 39.8262V108.174C195.4 113.823 201.346 117.498 206.399 114.971L242.399 96.9714C244.974 95.684 246.6 93.0524 246.6 90.1738V21.8262C246.6 16.1765 240.654 12.502 235.601 15.0286L199.601 33.0286C197.026 34.316 195.4 36.9476 195.4 39.8262Z"
27+
fill="white"
28+
stroke="#515870"
29+
strokeWidth="1.2"
30+
/>
31+
<path
32+
opacity="0.6"
33+
d="M109.4 50.8262V119.174C109.4 124.823 115.346 128.498 120.399 125.971L156.399 107.971C158.974 106.684 160.6 104.052 160.6 101.174V32.8262C160.6 27.1765 154.654 23.502 149.601 26.0286L113.601 44.0286C111.026 45.316 109.4 47.9476 109.4 50.8262Z"
34+
fill="white"
35+
stroke="#515870"
36+
strokeWidth="1.2"
37+
/>
38+
<path
39+
opacity="0.9"
40+
d="M118 123.174V54.8262C118 52.1748 119.498 49.751 121.87 48.5653L157.87 30.5652C162.524 28.2381 168 31.6226 168 36.8262V105.174C168 107.825 166.502 110.249 164.131 111.435L128.13 129.435C123.476 131.762 118 128.377 118 123.174Z"
41+
fill="#F6F6F8"
42+
stroke="#4E556D"
43+
strokeWidth="1.2"
44+
/>
45+
<path
46+
opacity="0.2"
47+
d="M121.4 56.8262V125.174C121.4 130.823 127.346 134.498 132.399 131.971L168.399 113.971C170.974 112.684 172.6 110.052 172.6 107.174V38.8262C172.6 33.1765 166.654 29.502 161.601 32.0286L125.601 50.0286C123.026 51.316 121.4 53.9476 121.4 56.8262Z"
48+
fill="white"
49+
stroke="#515870"
50+
strokeWidth="1.2"
51+
/>
52+
<path
53+
opacity="0.2"
54+
d="M125.4 58.8262V127.174C125.4 132.823 131.346 136.498 136.399 133.971L172.399 115.971C174.974 114.684 176.6 112.052 176.6 109.174V40.8262C176.6 35.1765 170.654 31.502 165.601 34.0286L129.601 52.0286C127.026 53.316 125.4 55.9476 125.4 58.8262Z"
55+
fill="white"
56+
stroke="#515870"
57+
strokeWidth="1.2"
58+
/>
59+
<path
60+
opacity="0.2"
61+
d="M137.4 64.8262V133.174C137.4 138.823 143.346 142.498 148.399 139.971L184.399 121.971C186.974 120.684 188.6 118.052 188.6 115.174V46.8262C188.6 41.1765 182.654 37.502 177.601 40.0286L141.601 58.0286C139.026 59.316 137.4 61.9476 137.4 64.8262Z"
62+
fill="white"
63+
stroke="#515870"
64+
strokeWidth="1.2"
65+
/>
66+
<path
67+
opacity="0.2"
68+
d="M145.4 68.8262V137.174C145.4 142.823 151.346 146.498 156.399 143.971L192.399 125.971C194.974 124.684 196.6 122.052 196.6 119.174V50.8262C196.6 45.1765 190.654 41.502 185.601 44.0286L149.601 62.0286C147.026 63.316 145.4 65.9476 145.4 68.8262Z"
69+
fill="white"
70+
stroke="#515870"
71+
strokeWidth="1.2"
72+
/>
73+
<path
74+
opacity="0.6"
75+
d="M1.4 104.826V173.174C1.4 178.823 7.34557 182.498 12.3988 179.971L48.3988 161.971C50.9736 160.684 52.6 158.052 52.6 155.174V86.8262C52.6 81.1765 46.6544 77.502 41.6012 80.0286L5.60117 98.0286C3.02641 99.316 1.4 101.948 1.4 104.826Z"
76+
fill="white"
77+
stroke="#515870"
78+
strokeWidth="1.2"
79+
/>
80+
<path
81+
opacity="0.6"
82+
d="M56.6 146.174V77.8262C56.6 75.4021 57.9696 73.186 60.1378 72.1019L96.1378 54.1019C100.393 51.9742 105.4 55.0686 105.4 59.8262V128.174C105.4 130.598 104.03 132.814 101.862 133.898L65.8622 151.898C61.6068 154.026 56.6 150.931 56.6 146.174Z"
83+
fill="white"
84+
stroke="#515870"
85+
strokeWidth="1.2"
86+
/>
87+
<path
88+
opacity="0.8"
89+
d="M60.6 148.174V79.8262C60.6 77.4021 61.9696 75.186 64.1378 74.1019L100.138 56.1019C104.393 53.9742 109.4 57.0686 109.4 61.8262V130.174C109.4 132.598 108.03 134.814 105.862 135.898L69.8622 153.898C65.6068 156.026 60.6 152.931 60.6 148.174Z"
90+
fill="white"
91+
stroke="#515870"
92+
strokeWidth="1.2"
93+
/>
94+
<path
95+
opacity="0.9"
96+
d="M64 150.174V81.8262C64 79.1748 65.498 76.751 67.8695 75.5653L103.87 57.5652C108.524 55.2381 114 58.6226 114 63.8262V132.174C114 134.825 112.502 137.249 110.131 138.435L74.1305 156.435C69.4762 158.762 64 155.377 64 150.174Z"
97+
fill="#F6F6F8"
98+
stroke="#4E556D"
99+
strokeWidth="1.2"
100+
/>
101+
<path
102+
opacity="0.2"
103+
d="M72.6 154.174V85.8262C72.6 83.4021 73.9696 81.186 76.1378 80.1019L112.138 62.1019C116.393 59.9742 121.4 63.0686 121.4 67.8262V136.174C121.4 138.598 120.03 140.814 117.862 141.898L81.8622 159.898C77.6068 162.026 72.6 158.931 72.6 154.174Z"
104+
fill="white"
105+
stroke="#515870"
106+
strokeWidth="1.2"
107+
/>
108+
<path
109+
opacity="0.2"
110+
d="M76.6 156.174V87.8262C76.6 85.4021 77.9696 83.186 80.1378 82.1019L116.138 64.1019C120.393 61.9742 125.4 65.0686 125.4 69.8262V138.174C125.4 140.598 124.03 142.814 121.862 143.898L85.8622 161.898C81.6068 164.026 76.6 160.931 76.6 156.174Z"
111+
fill="white"
112+
stroke="#515870"
113+
strokeWidth="1.2"
114+
/>
115+
<path
116+
opacity="0.2"
117+
d="M84.6 160.174V91.8262C84.6 89.4021 85.9696 87.186 88.1378 86.1019L124.138 68.1019C128.393 65.9742 133.4 69.0686 133.4 73.8262V142.174C133.4 144.598 132.03 146.814 129.862 147.898L93.8622 165.898C89.6068 168.026 84.6 164.931 84.6 160.174Z"
118+
fill="white"
119+
stroke="#515870"
120+
strokeWidth="1.2"
121+
/>
122+
<path
123+
opacity="0.2"
124+
d="M88.6 162.174V93.8262C88.6 91.4021 89.9696 89.186 92.1378 88.1019L128.138 70.1019C132.393 67.9742 137.4 71.0686 137.4 75.8262V144.174C137.4 146.598 136.03 148.814 133.862 149.898L97.8622 167.898C93.6068 170.026 88.6 166.931 88.6 162.174Z"
125+
fill="white"
126+
stroke="#515870"
127+
strokeWidth="1.2"
128+
/>
129+
<path
130+
opacity="0.2"
131+
d="M92.6 164.174V95.8262C92.6 93.4021 93.9696 91.186 96.1378 90.1019L132.138 72.1019C136.393 69.9742 141.4 73.0686 141.4 77.8262V146.174C141.4 148.598 140.03 150.814 137.862 151.898L101.862 169.898C97.6068 172.026 92.6 168.931 92.6 164.174Z"
132+
fill="white"
133+
stroke="#515870"
134+
strokeWidth="1.2"
135+
/>
136+
<path
137+
opacity="0.2"
138+
d="M96.6 166.174V97.8262C96.6 95.4021 97.9696 93.186 100.138 92.1019L136.138 74.1019C140.393 71.9742 145.4 75.0686 145.4 79.8262V148.174C145.4 150.598 144.03 152.814 141.862 153.898L105.862 171.898C101.607 174.026 96.6 170.931 96.6 166.174Z"
139+
fill="white"
140+
stroke="#515870"
141+
strokeWidth="1.2"
142+
/>
143+
<path
144+
opacity="0.2"
145+
d="M104.6 170.174V101.826C104.6 99.4021 105.97 97.186 108.138 96.1019L144.138 78.1019C148.393 75.9742 153.4 79.0686 153.4 83.8262V152.174C153.4 154.598 152.03 156.814 149.862 157.898L113.862 175.898C109.607 178.026 104.6 174.931 104.6 170.174Z"
146+
fill="white"
147+
stroke="#515870"
148+
strokeWidth="1.2"
149+
/>
150+
<path
151+
opacity="0.8"
152+
d="M5.4 106.826V175.174C5.4 180.823 11.3456 184.498 16.3988 181.971L52.3988 163.971C54.9736 162.684 56.6 160.052 56.6 157.174V88.8262C56.6 83.1765 50.6544 79.502 45.6012 82.0286L9.60117 100.029C7.02641 101.316 5.4 103.948 5.4 106.826Z"
153+
fill="white"
154+
stroke="#515870"
155+
strokeWidth="1.2"
156+
/>
157+
<path
158+
opacity="0.9"
159+
d="M10 177.174V108.826C10 106.175 11.498 103.751 13.8695 102.565L49.8695 84.5652C54.5238 82.2381 60 85.6226 60 90.8262V159.174C60 161.825 58.502 164.249 56.1305 165.435L20.1305 183.435C15.4762 185.762 10 182.377 10 177.174Z"
160+
fill="#F6F6F8"
161+
stroke="#4E556D"
162+
strokeWidth="1.2"
163+
/>
164+
<path
165+
opacity="0.2"
166+
d="M13.4 110.826V179.174C13.4 184.823 19.3456 188.498 24.3988 185.971L60.3988 167.971C62.9736 166.684 64.6 164.052 64.6 161.174V92.8262C64.6 87.1765 58.6544 83.502 53.6012 86.0286L17.6012 104.029C15.0264 105.316 13.4 107.948 13.4 110.826Z"
167+
fill="white"
168+
stroke="#515870"
169+
strokeWidth="1.2"
170+
/>
171+
<path
172+
opacity="0.2"
173+
d="M29.4 118.826V187.174C29.4 192.823 35.3456 196.498 40.3988 193.971L76.3988 175.971C78.9736 174.684 80.6 172.052 80.6 169.174V100.826C80.6 95.1765 74.6544 91.502 69.6012 94.0286L33.6012 112.029C31.0264 113.316 29.4 115.948 29.4 118.826Z"
174+
fill="white"
175+
stroke="#515870"
176+
strokeWidth="1.2"
177+
/>
178+
<path
179+
opacity="0.2"
180+
d="M33.4 120.826V189.174C33.4 194.823 39.3456 198.498 44.3988 195.971L80.3988 177.971C82.9736 176.684 84.6 174.052 84.6 171.174V102.826C84.6 97.1765 78.6544 93.502 73.6012 96.0286L37.6012 114.029C35.0264 115.316 33.4 117.948 33.4 120.826Z"
181+
fill="white"
182+
stroke="#515870"
183+
strokeWidth="1.2"
184+
/>
185+
</svg>
186+
)
187+
}

0 commit comments

Comments
 (0)
Please sign in to comment.