From 780dd093218f22adf18c47b7ff9c6614fd7284bc Mon Sep 17 00:00:00 2001 From: Emma Segal-Grossman Date: Mon, 4 Mar 2024 18:52:09 -0500 Subject: [PATCH] Create `ArchivedItemPage` and `ArchivedItemPageComment` types (#1567) Based on #1534 Figured this should be in place so we can work on other front-end things with these, rather than dealing with refactoring later ### Changes - Adds `ArchivedItemPage` and `ArchivedItemPageComment` types from #1534 (thank you @SuaYoo!) - Adds typedefs for match and resource count properties - sets properties optional in the db schema to optional in the type as well ### Manual testing 1. ### Screenshots | Page | Image/video | | ---- | ----------- | | | | --- frontend/src/types/crawler.ts | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/frontend/src/types/crawler.ts b/frontend/src/types/crawler.ts index 507a4c27..194d29d7 100644 --- a/frontend/src/types/crawler.ts +++ b/frontend/src/types/crawler.ts @@ -181,3 +181,40 @@ export type CrawlerChannel = { }; export type ArchivedItem = Crawl | Upload; + +export type ArchivedItemPageComment = { + id: string; + created: string; + modified: string; + userName: string; + text: string; +}; + +export type ArchivedItemPage = { + id?: string; + oid: string; + crawl_id: string; + url: string; + title?: string; + timestamp?: string; // Date + load_state?: number; + status?: number; + /** screenshot match percent, keyed by QA run ID */ + screenshotMatch?: Record; + /** text match percent, keyed by QA run ID */ + textMatch?: Record; + /** resource counts, keyed by QA run ID */ + resourceCounts?: Record< + string, + { + crawlGood?: number; + crawlBad?: number; + replayGood?: number; + replayBad?: number; + } + >; + userid?: string; + modified?: string; + approved?: boolean; + notes?: ArchivedItemPageComment[]; +};