Skip to content

Commit f16d8f3

Browse files
nl0claude
andauthored
Catalog: drop unused linkedData / overviewUrl code paths (#4856)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1cd3bb9 commit f16d8f3

16 files changed

Lines changed: 40 additions & 565 deletions

File tree

catalog/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ where verb is one of
1818

1919
## Changes
2020

21+
- [Removed] Drop unused `linkedData` / `overviewUrl` code paths from the catalog: admin form fields, JSON-LD mounts, and the precomputed-summary S3 fetch branches ([#4856](https://github.com/quiltdata/quilt/pull/4856))
2122
- [Fixed] Admin Users / Policies panels: drop phantom permission rows referencing a just-removed bucket (cache was not cascading the removal through `Policy.permissions` / `ManagedRole.permissions`) ([#4855](https://github.com/quiltdata/quilt/pull/4855))
2223
- [Changed] Migrate user-facing bucket queries to the new role-scoped `buckets` / `bucket` GraphQL type; admins in a scoped managed role now see only role-permitted buckets in navbar / listings / deep-links (admin panel unchanged) ([#4839](https://github.com/quiltdata/quilt/pull/4839))
2324
- [Fixed] Refresh navbar bucket selector after bucket removal and after policy / role / user-role edits that change the caller's managed-role bucket set ([#4839](https://github.com/quiltdata/quilt/pull/4839))

catalog/app/containers/Admin/Buckets/Buckets.tsx

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ const bucketToPrimaryValues = (bucket: BucketConfig) => ({
5050

5151
const bucketToMetadataValues = (bucket: BucketConfig) => ({
5252
relevanceScore: bucket.relevanceScore.toString(),
53-
overviewUrl: bucket.overviewUrl || '',
5453
tags: (bucket.tags || []).join(', '),
55-
linkedData: bucket.linkedData ? JSON.stringify(bucket.linkedData) : '',
5654
})
5755

5856
const bucketToIndexingAndNotificationsValues = (bucket: BucketConfig) => ({
@@ -369,12 +367,10 @@ const editFormSpec: FormSpec<Model.GQLTypes.BucketUpdateInput> = {
369367
(s) => s || null,
370368
Types.decode(Types.nullable(Types.IntFromString)),
371369
),
372-
overviewUrl: R.pipe(
373-
R.prop('overviewUrl'),
374-
Types.decode(Types.fromNullable(IO.string, '')),
375-
R.trim,
376-
(s) => (s ? (s as Types.NonEmptyString) : null),
377-
),
370+
// overviewUrl and linkedData are deprecated unused fields (see CHANGELOG).
371+
// Kept as null-producing entries to satisfy BucketUpdateInput / BucketAddInput
372+
// until the server-side schema drops them.
373+
overviewUrl: () => null,
378374
tags: R.pipe(
379375
R.prop('tags'),
380376
Types.decode(Types.fromNullable(IO.string, '')),
@@ -385,12 +381,7 @@ const editFormSpec: FormSpec<Model.GQLTypes.BucketUpdateInput> = {
385381
(tags) =>
386382
tags.length ? (tags as FP.nonEmptyArray.NonEmptyArray<Types.NonEmptyString>) : null,
387383
),
388-
linkedData: R.pipe(
389-
R.prop('linkedData'),
390-
Types.decode(Types.fromNullable(IO.string, '')),
391-
(s) => s.trim() || 'null',
392-
Types.decode(Types.withFallback(Types.JsonFromString, null)),
393-
),
384+
linkedData: () => null,
394385
fileExtensionsToIndex: (values) =>
395386
!values.enableDeepIndexing
396387
? []
@@ -830,28 +821,6 @@ function MetadataForm() {
830821
rows={1}
831822
rowsMax={3}
832823
/>
833-
<RF.Field
834-
component={Form.Field}
835-
name="overviewUrl"
836-
label="Overview URL"
837-
parse={R.trim}
838-
fullWidth
839-
margin="normal"
840-
/>
841-
<RF.Field
842-
component={Form.Field}
843-
name="linkedData"
844-
label="Structured data (JSON-LD)"
845-
validate={validators.jsonObject as FF.FieldValidator<any>}
846-
errors={{
847-
jsonObject: 'Must be a valid JSON object',
848-
}}
849-
fullWidth
850-
multiline
851-
rows={1}
852-
rowsMax={10}
853-
margin="normal"
854-
/>
855824
</>
856825
)
857826
}

catalog/app/containers/Admin/Buckets/gql/BucketConfigSelection.generated.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export type BucketConfigSelectionFragment = {
1111
| 'iconUrl'
1212
| 'description'
1313
| 'relevanceScore'
14-
| 'overviewUrl'
1514
| 'tags'
16-
| 'linkedData'
1715
| 'fileExtensionsToIndex'
1816
| 'indexContentBytes'
1917
| 'scannerParallelShardsDepth'
@@ -38,9 +36,7 @@ export const BucketConfigSelectionFragmentDoc = {
3836
{ kind: 'Field', name: { kind: 'Name', value: 'iconUrl' } },
3937
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
4038
{ kind: 'Field', name: { kind: 'Name', value: 'relevanceScore' } },
41-
{ kind: 'Field', name: { kind: 'Name', value: 'overviewUrl' } },
4239
{ kind: 'Field', name: { kind: 'Name', value: 'tags' } },
43-
{ kind: 'Field', name: { kind: 'Name', value: 'linkedData' } },
4440
{ kind: 'Field', name: { kind: 'Name', value: 'fileExtensionsToIndex' } },
4541
{ kind: 'Field', name: { kind: 'Name', value: 'indexContentBytes' } },
4642
{ kind: 'Field', name: { kind: 'Name', value: 'scannerParallelShardsDepth' } },

catalog/app/containers/Admin/Buckets/gql/BucketConfigSelection.graphql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ fragment BucketConfigSelection on BucketConfig {
44
iconUrl
55
description
66
relevanceScore
7-
overviewUrl
87
tags
9-
linkedData
108
fileExtensionsToIndex
119
indexContentBytes
1210
scannerParallelShardsDepth

catalog/app/containers/Bucket/Overview/Header.tsx

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ interface ExtData {
3939
objects: number
4040
}
4141

42-
const RODA_LINK = 'https://registry.opendata.aws'
43-
const RODA_BUCKET = 'quilt-open-data-bucket'
4442
const MAX_EXTS = 7
4543
// must have length >= MAX_EXTS
4644
const COLOR_MAP = [
@@ -276,10 +274,10 @@ function StatsItemSkeleton() {
276274
)
277275
}
278276

279-
function useStats(bucket: string, overviewUrl?: string | null) {
277+
function useStats(bucket: string) {
280278
const s3 = AWS.S3.use()
281279
const req = APIConnector.use()
282-
const statsData = useData(requests.bucketStats, { req, s3, bucket, overviewUrl })
280+
const statsData = useData(requests.bucketStats, { req, s3, bucket })
283281
const countQuery = GQL.useQuery(STAT_COUNTS_QUERY, { buckets: [bucket] })
284282
const totalBytes: string | null = React.useMemo(
285283
() =>
@@ -349,12 +347,11 @@ const useStatsStyles = M.makeStyles((t) => ({
349347
interface StatsProps {
350348
className: string
351349
bucket: string
352-
overviewUrl?: string | null
353350
}
354351

355-
function Stats({ className, bucket, overviewUrl }: StatsProps) {
352+
function Stats({ className, bucket }: StatsProps) {
356353
const classes = useStatsStyles()
357-
const { totalBytes, totalObjects, pkgCount } = useStats(bucket, overviewUrl)
354+
const { totalBytes, totalObjects, pkgCount } = useStats(bucket)
358355
return (
359356
<div className={cx(classes.root, className)}>
360357
{totalBytes ? <StatsItem value={totalBytes} /> : <StatsItemSkeleton />}
@@ -418,16 +415,14 @@ const useStyles = M.makeStyles((t) => ({
418415
interface HeaderProps {
419416
s3: AWSSDK.S3
420417
bucket: string
421-
overviewUrl: string | null | undefined
422418
description: string | null | undefined
423419
}
424420

425-
export default function Header({ s3, overviewUrl, bucket, description }: HeaderProps) {
421+
export default function Header({ s3, bucket, description }: HeaderProps) {
426422
const classes = useStyles()
427423
const req = APIConnector.use()
428-
const isRODA = !!overviewUrl && overviewUrl.includes(`/${RODA_BUCKET}/`)
429424
const colorPool = useConst(() => makeColorPool(COLOR_MAP))
430-
const statsData = useData(requests.bucketStats, { req, s3, bucket, overviewUrl })
425+
const statsData = useData(requests.bucketStats, { req, s3, bucket })
431426
const { urls } = NamedRoutes.use()
432427
const isAdmin = redux.useSelector(authSelectors.isAdmin)
433428
return (
@@ -439,24 +434,7 @@ export default function Header({ s3, overviewUrl, bucket, description }: HeaderP
439434
<M.Typography variant="body1">{description}</M.Typography>
440435
</M.Box>
441436
)}
442-
{isRODA && (
443-
<M.Box
444-
mt={1}
445-
position={{ md: 'absolute' }}
446-
right={{ md: 32 }}
447-
bottom={{ md: 31 }}
448-
color="grey.300"
449-
textAlign={{ md: 'right' }}
450-
>
451-
<M.Typography variant="body2">
452-
From the{' '}
453-
<M.Link href={RODA_LINK} color="inherit" underline="always">
454-
Registry of Open Data on AWS
455-
</M.Link>
456-
</M.Typography>
457-
</M.Box>
458-
)}
459-
<Stats className={classes.stats} bucket={bucket} overviewUrl={overviewUrl} />
437+
<Stats className={classes.stats} bucket={bucket} />
460438
{isAdmin && (
461439
<RRLink className={classes.settings} to={urls.adminBucketEdit(bucket)}>
462440
<M.IconButton color="inherit">

catalog/app/containers/Bucket/Overview/Overview.tsx

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import AsyncResult from 'utils/AsyncResult'
1111
import * as BucketPreferences from 'utils/BucketPreferences'
1212
import Data from 'utils/Data'
1313
import * as GQL from 'utils/GraphQL'
14-
import * as LinkedData from 'utils/LinkedData'
1514

1615
import * as Gallery from '../Gallery'
1716
import * as Summarize from '../Summarize'
@@ -20,37 +19,24 @@ import * as requests from '../requests'
2019
import Header from './Header'
2120
import BUCKET_QUERY from './gql/Bucket.generated'
2221

23-
interface BucketReadmes {
24-
forced?: Model.S3.S3ObjectLocation
25-
discovered: Model.S3.S3ObjectLocation[]
26-
}
27-
2822
interface ReadmesProps {
2923
s3: AWSSDK.S3
3024
bucket: string
31-
overviewUrl: string | undefined | null
3225
}
3326

34-
function Readmes({ s3, overviewUrl, bucket }: ReadmesProps) {
27+
function Readmes({ s3, bucket }: ReadmesProps) {
3528
return (
3629
// @ts-expect-error
37-
<Data fetch={requests.bucketReadmes} params={{ s3, overviewUrl, bucket }}>
30+
<Data fetch={requests.bucketReadmes} params={{ s3, bucket }}>
3831
{AsyncResult.case({
39-
Ok: (rs: BucketReadmes) =>
40-
(rs.discovered.length > 0 || !!rs.forced) && (
41-
<>
42-
{!!rs.forced && (
43-
<Summarize.FilePreview key="readme:forced" handle={rs.forced} expanded />
44-
)}
45-
{rs.discovered.map((h) => (
46-
<Summarize.FilePreview
47-
key={`readme:${h.bucket}/${h.key}`}
48-
handle={h}
49-
expanded
50-
/>
51-
))}
52-
</>
53-
),
32+
Ok: (readmes: Model.S3.S3ObjectLocation[]) =>
33+
readmes.map((h) => (
34+
<Summarize.FilePreview
35+
key={`readme:${h.bucket}/${h.key}`}
36+
handle={h}
37+
expanded
38+
/>
39+
)),
5440
_: () => <Summarize.FilePreviewSkel key="readme:skeleton" />,
5541
})}
5642
</Data>
@@ -60,15 +46,14 @@ function Readmes({ s3, overviewUrl, bucket }: ReadmesProps) {
6046
interface ImgsProps {
6147
s3: AWSSDK.S3
6248
bucket: string
63-
overviewUrl: string | undefined | null
6449
inStack: boolean
6550
}
6651

67-
function Imgs({ s3, overviewUrl, inStack, bucket }: ImgsProps) {
52+
function Imgs({ s3, inStack, bucket }: ImgsProps) {
6853
const req = APIConnector.use()
6954
return (
7055
// @ts-expect-error
71-
<Data fetch={requests.bucketImgs} params={{ req, s3, overviewUrl, inStack, bucket }}>
56+
<Data fetch={requests.bucketImgs} params={{ req, s3, inStack, bucket }}>
7257
{AsyncResult.case({
7358
Ok: (images: Model.S3.S3ObjectLocation[]) =>
7459
images.length ? <Gallery.Thumbnails images={images} /> : null,
@@ -89,7 +74,6 @@ interface ThumbnailsWrapperProps extends ImgsProps {
8974

9075
function ThumbnailsWrapper({
9176
s3,
92-
overviewUrl,
9377
inStack,
9478
bucket,
9579
preferences: galleryPrefs,
@@ -101,10 +85,8 @@ function ThumbnailsWrapper({
10185
<Data fetch={requests.ensureQuiltSummarizeIsPresent} params={{ s3, bucket }}>
10286
{AsyncResult.case({
10387
Ok: (h?: Model.S3.S3ObjectLocation) =>
104-
(!h || galleryPrefs.summarize) && (
105-
<Imgs {...{ s3, bucket, inStack, overviewUrl }} />
106-
),
107-
Err: () => <Imgs {...{ s3, bucket, inStack, overviewUrl }} />,
88+
(!h || galleryPrefs.summarize) && <Imgs {...{ s3, bucket, inStack }} />,
89+
Err: () => <Imgs {...{ s3, bucket, inStack }} />,
10890
Pending: () => <Gallery.Skeleton />,
10991
_: () => null,
11092
})}
@@ -118,20 +100,12 @@ export default function Overview() {
118100
const s3 = AWS.S3.use()
119101
const { bucket: bucketData } = GQL.useQueryS(BUCKET_QUERY, { bucket })
120102
const inStack = !!bucketData
121-
// overviewUrl is dead; stubbed until the field + its Readmes/Imgs/
122-
// Summarize code paths are removed.
123-
const overviewUrl = undefined
124103
const description = bucketData?.description
125104
const { prefs } = BucketPreferences.use()
126105
return (
127106
<M.Box pb={{ xs: 0, sm: 4 }} mx={{ xs: -2, sm: 0 }} position="relative" zIndex={1}>
128-
{inStack && (
129-
<React.Suspense fallback={null}>
130-
<LinkedData.BucketData bucket={bucket} />
131-
</React.Suspense>
132-
)}
133107
{bucketData ? (
134-
<Header {...{ s3, bucket, overviewUrl, description }} />
108+
<Header {...{ s3, bucket, description }} />
135109
) : (
136110
<M.Box
137111
pt={2}
@@ -142,20 +116,20 @@ export default function Overview() {
142116
<M.Typography variant="h5">{bucket}</M.Typography>
143117
</M.Box>
144118
)}
145-
<Readmes {...{ s3, bucket, overviewUrl }} />
119+
<Readmes {...{ s3, bucket }} />
146120
{BucketPreferences.Result.match(
147121
{
148122
Ok: ({ ui: { blocks } }) => (
149123
<ThumbnailsWrapper
150-
{...{ s3, bucket, inStack, overviewUrl, preferences: blocks.gallery }}
124+
{...{ s3, bucket, inStack, preferences: blocks.gallery }}
151125
/>
152126
),
153127
Pending: () => <Gallery.Skeleton />,
154128
Init: () => null,
155129
},
156130
prefs,
157131
)}
158-
<Summarize.SummaryRoot {...{ s3, bucket, inStack, overviewUrl }} />
132+
<Summarize.SummaryRoot {...{ s3, bucket, inStack }} />
159133
</M.Box>
160134
)
161135
}

catalog/app/containers/Bucket/PackageRevisions/PackageRevisions.tsx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -557,28 +557,3 @@ export default function PackageRevisionsWrapper() {
557557
</>
558558
)
559559
}
560-
561-
// TODO: restore linked data
562-
/*
563-
{!!bucketCfg &&
564-
AsyncResult.case(
565-
{
566-
_: () => null,
567-
Ok: ({ hash, modified, header }) => (
568-
<React.Suspense fallback={null}>
569-
<LinkedData.PackageData
570-
{...{
571-
bucket: bucketCfg,
572-
name,
573-
revision: r,
574-
hash,
575-
modified,
576-
header,
577-
}}
578-
/>
579-
</React.Suspense>
580-
),
581-
},
582-
res,
583-
)}
584-
*/

catalog/app/containers/Bucket/PackageTree/PackageTree.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,15 +1080,6 @@ function PackageTree({
10801080
return (
10811081
<FileView.Root>
10821082
<RRDom.Prompt when={!slt.isEmpty} message={guardNavigation} />
1083-
{/* TODO: bring back linked data after re-implementing it using graphql
1084-
{!!bucketCfg &&
1085-
revisionData.case({
1086-
Ok: ({ hash, modified }) => (
1087-
<ExposeLinkedData {...{ bucketCfg, bucket, name, hash, modified }} />
1088-
),
1089-
_: () => null,
1090-
})}
1091-
*/}
10921083
{!!resolvedFrom && (
10931084
<M.Box mb={2}>
10941085
<Lab.Alert

catalog/app/containers/Bucket/Summarize.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,11 @@ interface SummaryRootProps {
570570
s3: S3
571571
bucket: string
572572
inStack: boolean
573-
overviewUrl?: string | null
574573
}
575574

576-
export function SummaryRoot({ s3, bucket, inStack, overviewUrl }: SummaryRootProps) {
575+
export function SummaryRoot({ s3, bucket, inStack }: SummaryRootProps) {
577576
const req = APIConnector.use()
578-
const data = useData(requests.bucketSummary, { req, s3, bucket, inStack, overviewUrl })
577+
const data = useData(requests.bucketSummary, { req, s3, bucket, inStack })
579578
return (
580579
<FileThemeContext.Provider value={FileThemes.Overview}>
581580
{data.case({

0 commit comments

Comments
 (0)