Skip to content

Commit

Permalink
feat(sanity): add release error indicators to ReleasesOverview
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed Feb 5, 2025
1 parent 5119ee0 commit 1961e16
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/sanity/src/core/releases/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ const releasesLocaleStrings = {

/** Title text when error during release update */
'failed-edit-title': 'Failed to save changes',
/** Title text displayed for releases that failed to publish */
'failed-publish-title': 'Failed to publish',

/**The text that will be shown in the footer to indicate the time the release was archived */
'footer.status.archived': 'Archived',
/**The text that will be shown in the footer to indicate the time the release was created */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {LockIcon} from '@sanity/icons'
import {ErrorOutlineIcon, LockIcon} from '@sanity/icons'
import {Flex, Text} from '@sanity/ui'
import {type TFunction} from 'i18next'
import {Fragment} from 'react'

import {ToneIcon} from '../../../../ui-components/toneIcon/ToneIcon'
import {Tooltip} from '../../../../ui-components/tooltip/Tooltip'
import {RelativeTime} from '../../../components'
import {getPublishDateFromRelease, isReleaseScheduledOrScheduling} from '../../util/util'
import {Headers} from '../components/Table/TableHeader'
Expand Down Expand Up @@ -86,10 +89,27 @@ export const releasesOverviewColumnDefs: (
)
},
},
{
id: 'error',
sorting: false,
width: 40,
header: () => <Fragment />,
cell: ({datum: {error}, cellProps}) => (
<Flex {...cellProps} align="center" paddingX={2} paddingY={3} sizing="border">
{typeof error !== 'undefined' && (
<Tooltip content={<Text size={1}>{t('failed-publish-title')}</Text>} portal>
<Text size={1}>
<ToneIcon icon={ErrorOutlineIcon} tone="critical" />
</Text>
</Tooltip>
)}
</Flex>
),
},
{
id: 'documentCount',
sorting: false,
width: 100,
width: 120,
header: ({headerProps}) => (
<Flex {...headerProps} paddingY={3} sizing="border">
<Headers.BasicHeader text="" />
Expand Down

0 comments on commit 1961e16

Please sign in to comment.