+
${this.renderPanel(msg("Overview"), this.renderOverview(), [
tw`rounded-lg border p-4`,
])}
-
+
${this.renderPanel(
html`
${this.renderTitle(msg("Metadata"))}
@@ -420,7 +420,7 @@ export class ArchivedItemDetail extends BtrixElement {
class="text-base"
name="pencil"
@click=${this.openMetadataEditor}
- label=${msg("Edit Metadata")}
+ label=${msg("Edit Archived Item")}
>
`,
)}
@@ -429,6 +429,26 @@ export class ArchivedItemDetail extends BtrixElement {
[tw`rounded-lg border p-4`],
)}
+
+ ${this.renderPanel(
+ html`
+ ${this.renderTitle(msg("Collections"))}
+ ${when(
+ this.isCrawler,
+ () => html`
+
+ `,
+ )}
+ `,
+ this.renderCollections(),
+ [tw`rounded-lg border p-4`],
+ )}
+
`;
break;
@@ -653,7 +673,7 @@ export class ArchivedItemDetail extends BtrixElement {
}}
>
- ${msg("Edit Metadata")}
+ ${msg("Edit Archived Item")}
`,
@@ -959,26 +979,26 @@ export class ArchivedItemDetail extends BtrixElement {
() => html`
`,
)}
-
+
+ `;
+ }
+
+ private renderCollections() {
+ const noneText = html`${msg("None")}`;
+ return html`
+
+
${when(
this.item,
- () =>
+ (item) =>
when(
- this.item!.collections.length,
+ item.collections.length,
() => html`
-
- ${this.item!.collections.map(
- ({ id, name }) =>
- html`-
- ${name}
-
`,
- )}
-
+
`,
() => noneText,
),
diff --git a/frontend/src/pages/org/archived-items.ts b/frontend/src/pages/org/archived-items.ts
index 2393eb5713..5096a5d33f 100644
--- a/frontend/src/pages/org/archived-items.ts
+++ b/frontend/src/pages/org/archived-items.ts
@@ -593,7 +593,7 @@ export class CrawlsList extends BtrixElement {
}}
>
- ${msg("Edit Metadata")}
+ ${msg("Edit Archived Item")}
`,
diff --git a/frontend/src/pages/org/collection-detail.ts b/frontend/src/pages/org/collection-detail.ts
index dc37d61b19..f05a7af653 100644
--- a/frontend/src/pages/org/collection-detail.ts
+++ b/frontend/src/pages/org/collection-detail.ts
@@ -639,7 +639,9 @@ export class CollectionDetail extends BtrixElement {
private renderDetailItem(
label: string | TemplateResult,
- renderContent: (collection: PublicCollection) => TemplateResult | string,
+ renderContent: (
+ collection: Collection | PublicCollection,
+ ) => TemplateResult | string,
) {
return metadataItemWithCollection(this.collection)({
label,
diff --git a/frontend/src/pages/public/org.ts b/frontend/src/pages/public/org.ts
index 7d325f15d0..91a2f122e7 100644
--- a/frontend/src/pages/public/org.ts
+++ b/frontend/src/pages/public/org.ts
@@ -8,7 +8,11 @@ import queryString from "query-string";
import { BtrixElement } from "@/classes/BtrixElement";
import { page, pageHeading } from "@/layouts/page";
import type { APIPaginatedList, APISortQuery } from "@/types/api";
-import { CollectionAccess, type Collection } from "@/types/collection";
+import {
+ CollectionAccess,
+ type Collection,
+ type PublicCollection,
+} from "@/types/collection";
import type { OrgData, PublicOrgCollections } from "@/types/org";
import { SortDirection } from "@/types/utils";
import { richText } from "@/utils/rich-text";
@@ -321,7 +325,7 @@ export class PublicOrg extends BtrixElement {
}
private async getUserPublicCollections({ orgId }: { orgId: string }) {
- const params: APISortQuery & {
+ const params: APISortQuery & {
access: CollectionAccess;
} = {
sortBy: "dateLatest",
@@ -330,7 +334,7 @@ export class PublicOrg extends BtrixElement {
};
const query = queryString.stringify(params);
- const data = await this.api.fetch>(
+ const data = await this.api.fetch>(
`/orgs/${orgId}/collections?${query}`,
);
diff --git a/frontend/src/strings/crawl-workflows/section.ts b/frontend/src/strings/crawl-workflows/section.ts
index 04ebcb13c5..1b09c14064 100644
--- a/frontend/src/strings/crawl-workflows/section.ts
+++ b/frontend/src/strings/crawl-workflows/section.ts
@@ -8,6 +8,7 @@ const section: Record = {
behaviors: msg("Page Behavior"),
browserSettings: msg("Browser Settings"),
scheduling: msg("Scheduling"),
+ collections: msg("Collections"),
metadata: msg("Metadata"),
};
diff --git a/frontend/src/types/collection.ts b/frontend/src/types/collection.ts
index f4837eae5d..dd06b2c795 100644
--- a/frontend/src/types/collection.ts
+++ b/frontend/src/types/collection.ts
@@ -25,8 +25,8 @@ export const publicCollectionSchema = z.object({
orgName: z.string(),
orgPublicProfile: z.boolean(),
name: z.string(),
- created: z.string().datetime(),
- modified: z.string().datetime(),
+ created: z.string().datetime().nullable(), // NOTE dates may be null for older collections since we can't backfill
+ modified: z.string().datetime().nullable(),
caption: z.string().nullable(),
description: z.string().nullable(),
resources: z.array(z.string()),
@@ -47,13 +47,15 @@ export const publicCollectionSchema = z.object({
totalSize: z.number(),
allowPublicDownload: z.boolean(),
homeUrl: z.string().url().nullable(),
- homeUrlPageId: z.string().url().nullable(),
+ homeUrlPageId: z.string().nullable(),
homeUrlTs: z.string().datetime().nullable(),
access: z.nativeEnum(CollectionAccess),
});
export type PublicCollection = z.infer;
export const collectionSchema = publicCollectionSchema.extend({
+ orgName: z.string().optional(),
+ orgPublicProfile: z.boolean().optional(),
tags: z.array(z.string()),
access: z.nativeEnum(CollectionAccess),
});
diff --git a/frontend/src/types/storage.ts b/frontend/src/types/storage.ts
index ac53700148..dd8b6e0689 100644
--- a/frontend/src/types/storage.ts
+++ b/frontend/src/types/storage.ts
@@ -1,7 +1,7 @@
import { z } from "zod";
export const storageFileSchema = z.object({
- id: z.string(),
+ id: z.string().optional(),
name: z.string(),
path: z.string().url(),
hash: z.string(),
diff --git a/frontend/src/utils/workflow.ts b/frontend/src/utils/workflow.ts
index 5a317abab3..d6930f2fae 100644
--- a/frontend/src/utils/workflow.ts
+++ b/frontend/src/utils/workflow.ts
@@ -39,6 +39,7 @@ export const SECTIONS = [
"behaviors",
"browserSettings",
"scheduling",
+ "collections",
"metadata",
] as const;
export const sectionsEnum = z.enum(SECTIONS);
@@ -50,6 +51,7 @@ export enum GuideHash {
Behaviors = "page-behavior",
BrowserSettings = "browser-settings",
Scheduling = "scheduling",
+ Collections = "collections",
Metadata = "metadata",
}
@@ -64,6 +66,7 @@ export const workflowTabToGuideHash: Record = {
behaviors: GuideHash.Behaviors,
browserSettings: GuideHash.BrowserSettings,
scheduling: GuideHash.Scheduling,
+ collections: GuideHash.Collections,
metadata: GuideHash.Metadata,
};