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

feat(releases): last edited and document count in bundle #7124

Merged
merged 123 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
6c2e51e
feat(sanity): add support for sticky query params
bjoerge May 6, 2024
d5ee769
feat(sanity): add 'perspective' dropdown
bjoerge May 6, 2024
5399354
feat(sanity): include `_version` field in search results
juice49 Jun 21, 2024
e851dc2
feat(types): add `_version` field to `SanityDocument` and `SanityDocu…
juice49 Jun 21, 2024
22305e5
fix(sanity): global perspective state restoration
juice49 Jun 24, 2024
8a50a7c
feat(sanity): hardcode `summerDrop` and `autumnDrop` bundles
juice49 Jun 24, 2024
85ddb5a
wip: allow pairs to include multiple drafts
juice49 May 22, 2024
e18b8b8
feat(sanity): support versioned document ids in `getPublishedId` func…
juice49 Jun 24, 2024
18b0a6f
feat(sanity): add `_version` field to preview observation
juice49 Jun 26, 2024
3fd1823
feat(sanity): reflect checked out bundle in document lists and list p…
juice49 Jun 26, 2024
b262130
debug(sanity): add version debug output to list previews
juice49 Jun 26, 2024
ef1d4b4
feat(sanity): add action to create new version based on an doc id
RitaDias Jun 25, 2024
683de3a
feat(sanity): update document title + version popover - add new and f…
RitaDias Jun 26, 2024
52f5a01
chore(sanity): move versions menu to versions folder
RitaDias Jun 26, 2024
e84c17a
chore(sanity): update check for checking version
RitaDias Jun 26, 2024
ba56b95
fix(sanity): ability to add new versions to doc
RitaDias Jun 26, 2024
5988427
feat(sanity): add dumb bundle and version data, add icons and hues
RitaDias Jun 26, 2024
f4fcaa8
feat(sanity): update styles and don't rely on random
RitaDias Jun 26, 2024
1bcf5dd
update isVersion
RitaDias Jun 26, 2024
6440551
docs(sanity): update comments
RitaDias Jun 26, 2024
61bdca4
feat(sanity): add "latest version" menu button
RitaDias Jun 26, 2024
392aedf
refactor(sanity): update comments
RitaDias Jun 26, 2024
49cbc49
chore(sanity): remove import from format date. will use something else
RitaDias Jun 26, 2024
5545b69
fix(sanity): allow uppercase characters in version identifiers
juice49 Jun 26, 2024
3ee428b
feat(sanity): add tag to list document versions request
juice49 Jun 27, 2024
1a31436
feat(corel): integrate bundles store (#7040)
pedrobonamin Jul 1, 2024
496fc50
feat(corel): doc and structure updates (#7039)
RitaDias Jul 1, 2024
fa75354
feat(releases): initialising releases plugin (#7048)
jordanl17 Jul 2, 2024
b64d7a8
refactor(releases): removing shortRelativeDate (#7051)
jordanl17 Jul 2, 2024
2d88505
chore(corel): add bundles provider (#7054)
pedrobonamin Jul 3, 2024
1ec16f0
feat(COREL): update types to bundle + add create bundle functionality…
RitaDias Jul 5, 2024
1552501
refactor(COREL): refactor version context & renaming (#7071)
RitaDias Jul 5, 2024
175df90
fix(corel): update uses of collate, add typeguard for bundles and add…
pedrobonamin Jul 8, 2024
d0c6d3e
feat(releases): archive and unarchive releases (#7072)
jordanl17 Jul 8, 2024
2f0951b
refactor(sanity): move bundle metadata store to resource cache
juice49 Jul 7, 2024
32325cb
feat(releases): bundle store starts to support bundle metadata
jordanl17 Jul 9, 2024
22d2413
feat(releases): loading state only on initial fetch of metadata
jordanl17 Jul 9, 2024
4a11541
feat(releases): added created at col
jordanl17 Jul 9, 2024
2c644ec
feat(releases): patching mutated bundle slugs
jordanl17 Jul 9, 2024
908f800
feat(releases): aggregate all metadata listening calls
jordanl17 Jul 10, 2024
9efdb0e
fix(releases): fixing empty observed result state
jordanl17 Jul 10, 2024
1a8419d
refactor(releases): move to slugs; split agg from createBundleStore
jordanl17 Jul 10, 2024
0d6fd6e
fix(deps): Update dev-non-major (#7100)
renovate[bot] Jul 9, 2024
31cdc88
fix(deps): update dependency get-it to ^8.6.3 (#7108)
renovate[bot] Jul 9, 2024
bec881b
fix(deps): update dependency @sanity/client to ^6.20.2 (#7111)
renovate[bot] Jul 9, 2024
b9aee8c
refactor(sanity): remove "features" (#7097)
RitaDias Jul 9, 2024
4b5e9c0
fix(deps): update dependency @sanity/client to ^6.20.2 (#7110)
renovate[bot] Jul 9, 2024
e19e126
fix(deps): update dependency @sanity/bifur-client to ^0.4.1 (#7102)
renovate[bot] Jul 9, 2024
18fc28a
fix(deps): update dependency @sanity/ui to ^2.6.3 (#7104)
renovate[bot] Jul 9, 2024
b171072
fix(deps): update dependency react-rx to ^3.1.1 (#7113)
renovate[bot] Jul 9, 2024
7296662
chore(deps): update dependency @sanity/tsdoc to v1.0.83 (#7080)
renovate[bot] Jul 9, 2024
38db2c1
chore(deps): update dependency esbuild to ^0.23.0 (#7106)
renovate[bot] Jul 9, 2024
ea3983c
test(cli): use separate tarball location for cursor export test (#7118)
rexxars Jul 9, 2024
87912bf
fix(core): minor typo fix in i18n comment (#7115)
rexxars Jul 9, 2024
2283478
feat(router): update router to support query params in intent links (…
pedrobonamin Jul 10, 2024
d770998
feat(sanity): add 'perspective' dropdown
bjoerge May 6, 2024
935d441
fix(sanity): global perspective state restoration
juice49 Jun 24, 2024
68e216e
feat(sanity): hardcode `summerDrop` and `autumnDrop` bundles
juice49 Jun 24, 2024
e7d8a8d
feat(sanity): reflect checked out bundle in document lists and list p…
juice49 Jun 26, 2024
ccec543
debug(sanity): add version debug output to list previews
juice49 Jun 26, 2024
bbedbb2
feat(sanity): add action to create new version based on an doc id
RitaDias Jun 25, 2024
a882893
feat(sanity): update document title + version popover - add new and f…
RitaDias Jun 26, 2024
41981a2
chore(sanity): move versions menu to versions folder
RitaDias Jun 26, 2024
bb4a2d8
chore(sanity): update check for checking version
RitaDias Jun 26, 2024
920fc7d
fix(sanity): ability to add new versions to doc
RitaDias Jun 26, 2024
9c640f7
feat(sanity): add dumb bundle and version data, add icons and hues
RitaDias Jun 26, 2024
d08c7fa
feat(sanity): update styles and don't rely on random
RitaDias Jun 26, 2024
69bb772
update isVersion
RitaDias Jun 26, 2024
029a6a9
docs(sanity): update comments
RitaDias Jun 26, 2024
8d1f950
feat(sanity): add "latest version" menu button
RitaDias Jun 26, 2024
9f2c697
refactor(sanity): update comments
RitaDias Jun 26, 2024
556d68f
chore(sanity): remove import from format date. will use something else
RitaDias Jun 26, 2024
86c6ded
fix(sanity): allow uppercase characters in version identifiers
juice49 Jun 26, 2024
9bab88c
feat(sanity): add tag to list document versions request
juice49 Jun 27, 2024
91abe9a
feat(corel): integrate bundles store (#7040)
pedrobonamin Jul 1, 2024
59bcc09
feat(corel): doc and structure updates (#7039)
RitaDias Jul 1, 2024
79562df
feat(releases): initialising releases plugin (#7048)
jordanl17 Jul 2, 2024
542d99d
refactor(releases): removing shortRelativeDate (#7051)
jordanl17 Jul 2, 2024
69f0128
chore(corel): add bundles provider (#7054)
pedrobonamin Jul 3, 2024
5b5e171
feat(COREL): update types to bundle + add create bundle functionality…
RitaDias Jul 5, 2024
bae19ec
refactor(COREL): refactor version context & renaming (#7071)
RitaDias Jul 5, 2024
7c14a08
fix(corel): update uses of collate, add typeguard for bundles and add…
pedrobonamin Jul 8, 2024
6a28673
feat(releases): archive and unarchive releases (#7072)
jordanl17 Jul 8, 2024
2d15bb4
refactor(sanity): move bundle metadata store to resource cache
juice49 Jul 7, 2024
3edd253
Merge branch 'corel' into corel-44-context
jordanl17 Jul 10, 2024
308ec1a
refactor(releases): only adding metadata context when not already exi…
jordanl17 Jul 10, 2024
5d2e0c7
refactor(releases): only adding metadata context when not already exi…
jordanl17 Jul 10, 2024
649f57f
refactor(releases): creating tableBundles in BundlesOverview
jordanl17 Jul 10, 2024
e969959
refactor(releases): renaming projection of query for metadata
jordanl17 Jul 10, 2024
5291d85
chore(releases): code comments
jordanl17 Jul 10, 2024
71fc1a6
fix(releases): fixing issue with removing bundles from aggregator lis…
jordanl17 Jul 10, 2024
1f9b3ee
refactor(releases): nesting bundle doc metadata in TableBunde
jordanl17 Jul 10, 2024
cf4b861
Merge branch 'corel' into corel-44-context
jordanl17 Jul 11, 2024
0b9bfb9
fix(corel): update releases router to use bundle name
pedrobonamin Jul 4, 2024
65f3d68
feat(corel): add bundle details screen
pedrobonamin Jul 4, 2024
a14e2cd
chore: update @sanity/icons package
pedrobonamin Jul 8, 2024
8313eaa
feat(corel): releases DocumentRow updates
pedrobonamin Jul 8, 2024
e0022f7
fix(corel): update BundleIconEditorPicker types
pedrobonamin Jul 8, 2024
f0431ac
fix(corel): update bundles table test
pedrobonamin Jul 8, 2024
815da97
fix(corel): add filter in documents table
pedrobonamin Jul 8, 2024
5641d1b
chore(corel): update file location and naming
pedrobonamin Jul 9, 2024
dadc535
feat(corel): add document actions to document row
pedrobonamin Jul 9, 2024
86f2496
fix(core): remove references to bundles in useListener hook
pedrobonamin Jul 9, 2024
d305629
fix(corel): add search params to IntentLink
pedrobonamin Jul 9, 2024
23c89fe
chore(corel): remove router type change and restore previous pnpm-loc…
pedrobonamin Jul 9, 2024
79cee6e
fix(releases): fixing tests for BundlesTable
jordanl17 Jul 11, 2024
8578248
fix(releases):adding tests for doc count and updated time to bundles …
jordanl17 Jul 11, 2024
29c2244
fix(corel): update bundlesTable tests
pedrobonamin Jul 11, 2024
b0e81d0
fix(releases): fixing BundlesOverview tests
jordanl17 Jul 11, 2024
a9c4dbe
feat(releases): delete bundle confirm lists document count in bundle
jordanl17 Jul 11, 2024
bb52c3c
refactor(releases): update BundlesMetadataContext to export interface
jordanl17 Jul 11, 2024
b1cbfd7
fix(releases): fix BundlesTable tests
jordanl17 Jul 11, 2024
e7006a4
Merge branch 'corel-24' into corel-44-context
jordanl17 Jul 11, 2024
0ff7b13
Merge branch 'corel' into corel-44-context
jordanl17 Jul 11, 2024
c88c144
refactor(releases): rename components and files to releases rather th…
jordanl17 Jul 11, 2024
64b6363
feat(releases): assigning authorId on release creation
jordanl17 Jul 11, 2024
17046ec
fix(releases): update BundleMenuButton test with hue and icon properties
jordanl17 Jul 11, 2024
95fc990
feat(releases): release detail delete uses documents count in bundle
jordanl17 Jul 12, 2024
91082cc
fix(releases): using short and temporal version of relative time
jordanl17 Jul 12, 2024
2a2ccb9
Merge branch 'corel' into corel-44-context
jordanl17 Jul 12, 2024
4582484
Merge branch 'corel' into corel-44-context
jordanl17 Jul 15, 2024
7ea22f9
refactor(releases): startWith to handle initial loading state on fetch
jordanl17 Jul 15, 2024
95e555e
Merge branch 'corel' into corel-44-context
jordanl17 Jul 15, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {createContext} from 'react'

import type {MetadataWrapper} from '../../../core/store/bundles/createBundlesMetadataAggregator'

/**
* @internal
*/
export interface BundlesMetadataContextValue {
state: MetadataWrapper
addBundleSlugsToListener: (slugs: string[]) => void
removeBundleSlugsFromListener: (slugs: string[]) => void
}

/**
* @internal
* @hidden
*/
export const BundlesMetadataContext = createContext<BundlesMetadataContextValue | null>(null)
1 change: 1 addition & 0 deletions packages/sanity/src/_singletons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from './core/form/studio/TreeEditingEnabledContext'
export * from './core/form/studio/ValidationContext'
export * from './core/i18n/LocaleContext'
export * from './core/presence/FormFieldPresenceContext'
export * from './core/releases/BundlesMetadataContext'
export * from './core/schedulePublishing/DocumentActionPropsContext'
export * from './core/schedulePublishing/tool/ScheduledPublishingEnabledContext'
export * from './core/schedulePublishing/tool/SchedulePublishingUpsellContext'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {useBundleOperations} from '../../../store/bundles/useBundleOperations'

type Props = {
bundle?: BundleDocument
documentCount: number
}

export const BundleMenuButton = ({bundle}: Props) => {
export const BundleMenuButton = ({bundle, documentCount}: Props) => {
const {deleteBundle, updateBundle} = useBundleOperations()
const router = useRouter()
const isBundleArchived = !!bundle?.archivedAt
Expand Down Expand Up @@ -56,8 +57,7 @@ export const BundleMenuButton = ({bundle}: Props) => {
setIsPerformingOperation(false)
}

// TODO: Replace this with the count once it's available. Wait for @jordanl17 change on that.
const count = 2
const bundleHasDocuments = !!documentCount

return (
<>
Expand Down Expand Up @@ -92,8 +92,10 @@ export const BundleMenuButton = ({bundle}: Props) => {
{showDiscardDialog && (
<Dialog
id="discard-version-dialog"
header={`Are you sure you want to delete the ${bundle?.title} release?`}
header={`Are you sure you want to delete the '${bundle?.title}' release?`}
onClose={() => setShowDiscardDialog(false)}
// remove body padding if no documents in release
padding={bundleHasDocuments}
footer={{
confirmButton: {
tone: 'default',
Expand All @@ -103,9 +105,11 @@ export const BundleMenuButton = ({bundle}: Props) => {
},
}}
>
<Text muted size={1}>
This will also delete {count} document version{count > 1 ? 's' : ''}.
</Text>
{bundleHasDocuments && (
<Text data-testid="confirm-delete-body" muted size={1}>
This will also delete {documentCount} document version{documentCount > 1 ? 's' : ''}.
</Text>
)}
</Dialog>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {describe, expect, jest, test} from '@jest/globals'
import {beforeEach, describe, expect, jest, test} from '@jest/globals'
import {fireEvent, render, screen} from '@testing-library/react'
import {act} from 'react'
import {useRouter} from 'sanity/router'
Expand All @@ -21,14 +21,18 @@ jest.mock('sanity/router', () => ({
useRouter: jest.fn().mockReturnValue({state: {}, navigate: jest.fn()}),
}))

const renderTest = async (bundle: BundleDocument) => {
const renderTest = async (bundle: BundleDocument, documentCount: number = 2) => {
const wrapper = await createTestProvider({
resources: [releasesUsEnglishLocaleBundle],
})
return render(<BundleMenuButton bundle={bundle} />, {wrapper})
return render(<BundleMenuButton bundle={bundle} documentCount={documentCount} />, {wrapper})
}

describe('BundleMenuButton', () => {
beforeEach(() => {
jest.clearAllMocks()
})

test('will archive an unarchived bundle', async () => {
const activeBundle: BundleDocument = {
_id: 'activeBundle',
Expand All @@ -40,6 +44,8 @@ describe('BundleMenuButton', () => {
_createdAt: new Date().toISOString(),
_updatedAt: new Date().toISOString(),
_rev: '',
hue: 'gray',
icon: 'cube',
}

await renderTest(activeBundle)
Expand Down Expand Up @@ -67,6 +73,8 @@ describe('BundleMenuButton', () => {
_createdAt: new Date().toISOString(),
_updatedAt: new Date().toISOString(),
_rev: '',
hue: 'gray',
icon: 'cube',
}
await renderTest(archivedBundle)

Expand All @@ -82,7 +90,7 @@ describe('BundleMenuButton', () => {
})
})

test('will delete a bundle', async () => {
test('will delete a bundle with documents', async () => {
const activeBundle: BundleDocument = {
_id: 'activeBundle',
_type: 'bundle',
Expand All @@ -93,6 +101,8 @@ describe('BundleMenuButton', () => {
_createdAt: new Date().toISOString(),
_updatedAt: new Date().toISOString(),
_rev: '',
hue: 'gray',
icon: 'cube',
}
await renderTest(activeBundle)

Expand All @@ -102,6 +112,8 @@ describe('BundleMenuButton', () => {
fireEvent.click(screen.getByText('Delete'))
})
expect(useBundleOperations().deleteBundle).not.toHaveBeenCalled()
// TODO: remove not exact once i18n used for strings
screen.getByText('This will also delete 2 document versions', {exact: false})

await act(() => {
fireEvent.click(screen.getByText('Confirm'))
Expand All @@ -110,4 +122,37 @@ describe('BundleMenuButton', () => {
expect(useBundleOperations().deleteBundle).toHaveBeenCalledWith(activeBundle)
expect(useRouter().navigate).not.toHaveBeenCalled()
})

test('will delete a bundle with no documents', async () => {
const activeEmptyBundle: BundleDocument = {
_id: 'activeEmptyBundle',
_type: 'bundle',
archivedAt: new Date().toISOString(),
title: 'activeEmptyBundle',
name: 'activeEmptyBundle',
authorId: 'author',
_createdAt: new Date().toISOString(),
_updatedAt: new Date().toISOString(),
_rev: '',
hue: 'gray',
icon: 'cube',
}
await renderTest(activeEmptyBundle, 0)

fireEvent.click(screen.getByLabelText('Release menu'))

await act(() => {
fireEvent.click(screen.getByText('Delete'))
})
expect(useBundleOperations().deleteBundle).not.toHaveBeenCalled()
// confirm dialog body is hidden when no documents in bundle
expect(screen.queryByTestId('confirm-delete-body')).toBeNull()

await act(() => {
fireEvent.click(screen.getByText('Confirm'))
})

expect(useBundleOperations().deleteBundle).toHaveBeenCalledWith(activeEmptyBundle)
expect(useRouter().navigate).not.toHaveBeenCalled()
})
})
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {SearchIcon} from '@sanity/icons'
import {Button, Card, Flex, Stack, TextInput} from '@sanity/ui'
import {Box, Button, Card, Flex, Stack, Text, TextInput} from '@sanity/ui'

/**
* @internal
*/
export interface BundleHeaderProps {
export interface ReleaseHeaderProps {
searchDisabled?: boolean
searchTerm?: string
setSearchTerm: (value?: string) => void
}

export function BundleHeader({searchDisabled, searchTerm, setSearchTerm}: BundleHeaderProps) {
export function ReleaseHeader({searchDisabled, searchTerm, setSearchTerm}: ReleaseHeaderProps) {
return (
<Card as="thead" radius={3}>
<Flex as="tr">
Expand All @@ -29,6 +29,22 @@ export function BundleHeader({searchDisabled, searchTerm, setSearchTerm}: Bundle
clearButton={!!searchTerm}
/>
</Stack>
{/* Number of documents */}
<Flex as="th" paddingY={3} sizing="border" style={{width: 90}}>
<Box padding={2}>
<Text muted size={1} weight="medium">
Documents
</Text>
</Box>
</Flex>
{/* Created */}
<Flex as="th" paddingY={3} sizing="border" style={{width: 120}}>
<Button mode="bleed" padding={2} radius={3} space={1} text="Created" />
</Flex>
{/* Edited */}
<Flex as="th" paddingY={3} sizing="border" style={{width: 100}}>
<Button mode="bleed" padding={2} radius={3} space={1} text="Edited" />
</Flex>
{/* Published */}
<Flex
as="th"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import {Box, Card, Flex, Stack, Text} from '@sanity/ui'
import {useRouter} from 'sanity/router'

import {BundleBadge} from '../../../bundles/components/BundleBadge'
import {RelativeTime} from '../../../components'
import {type BundleDocument} from '../../../store/bundles/types'
import {RelativeTime, UserAvatar} from '../../../components'
import {BundleMenuButton} from '../BundleMenuButton/BundleMenuButton'
import {type TableBundle} from './ReleasesTable'

type Props = {
bundle: BundleDocument
type ReleaseRowProps = {
bundle: TableBundle
}

export function BundleRow({bundle}: Props) {
export function ReleaseRow({bundle}: ReleaseRowProps) {
const {documentsMetadata} = bundle
const router = useRouter()

return (
Expand Down Expand Up @@ -38,6 +39,43 @@ export function BundleRow({bundle}: Props) {
</Flex>
</Card>
</Box>
{/* # of documents */}
<Flex as="td" align="center" paddingX={2} paddingY={3} sizing="border" style={{width: 90}}>
<Text muted size={1}>
{documentsMetadata.documentCount}
</Text>
</Flex>
{/* Created */}
<Flex
as="td"
align="center"
gap={2}
paddingX={2}
paddingY={3}
sizing="border"
style={{width: 120}}
>
{bundle.authorId && <UserAvatar size={0} user={bundle.authorId} />}
<Text muted size={1}>
<RelativeTime time={bundle._createdAt} useTemporalPhrase minimal />
</Text>
</Flex>
{/* Edited */}
<Flex
as="td"
align="center"
gap={2}
paddingX={2}
paddingY={3}
sizing="border"
style={{width: 100}}
>
{documentsMetadata.updatedAt && (
<Text muted size={1}>
<RelativeTime time={documentsMetadata.updatedAt} useTemporalPhrase minimal />
</Text>
)}
</Flex>
{/* Published */}
<Flex as="td" align="center" paddingX={2} paddingY={3} sizing="border" style={{width: 100}}>
{!!bundle.publishedAt && (
Expand All @@ -48,7 +86,7 @@ export function BundleRow({bundle}: Props) {
</Flex>
{/* Actions */}
<Flex as="td" align="center" flex="none" padding={3}>
<BundleMenuButton bundle={bundle} />
<BundleMenuButton bundle={bundle} documentCount={bundle.documentsMetadata.documentCount} />
</Flex>
</Card>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import {useMemo} from 'react'
import {styled} from 'styled-components'

import {type BundleDocument} from '../../../store/bundles/types'
import {BundleHeader, type BundleHeaderProps} from './BundleHeader'
import {BundleRow} from './BundleRow'
import {type BundlesMetadata} from '../../tool/useBundlesMetadata'
import {ReleaseHeader, type ReleaseHeaderProps} from './ReleaseHeader'
import {ReleaseRow} from './ReleaseRow'

const RowStack = styled(Stack)({
'& > *:not(:first-child)': {
Expand All @@ -19,11 +20,15 @@ const RowStack = styled(Stack)({
},
})

interface BundlesTableProps extends Omit<BundleHeaderProps, 'searchDisabled'> {
bundles: BundleDocument[]
export interface TableBundle extends BundleDocument {
documentsMetadata: BundlesMetadata
}

export function BundlesTable({bundles, searchTerm, setSearchTerm}: BundlesTableProps) {
interface ReleasesTableProps extends Omit<ReleaseHeaderProps, 'searchDisabled'> {
bundles: TableBundle[]
}

export function ReleasesTable({bundles, searchTerm, setSearchTerm}: ReleasesTableProps) {
const tableContent = useMemo(() => {
if (bundles.length === 0) {
return (
Expand All @@ -44,12 +49,12 @@ export function BundlesTable({bundles, searchTerm, setSearchTerm}: BundlesTableP
)
}

return bundles.map((bundle) => <BundleRow key={bundle.name} bundle={bundle} />)
return bundles.map((bundle) => <ReleaseRow key={bundle.name} bundle={bundle} />)
}, [bundles])

return (
<Stack as="table" space={1}>
<BundleHeader
<ReleaseHeader
searchDisabled={!searchTerm && !bundles.length}
searchTerm={searchTerm}
setSearchTerm={setSearchTerm}
Expand Down
Loading
Loading