diff --git a/client/src/app/(asset)/metadata/[id]/content/json-editor.tsx b/client/src/app/(asset)/metadata/[id]/content/json-editor.tsx index 1e0f2fd..6cff6fd 100644 --- a/client/src/app/(asset)/metadata/[id]/content/json-editor.tsx +++ b/client/src/app/(asset)/metadata/[id]/content/json-editor.tsx @@ -63,7 +63,7 @@ export default function JSONEditor({ (doc) => doc.toJSON() as RulesCollection, )[0]; - const project = activeProject?._data; + const project = activeProject?.toJSON() as ProjectCollection; if (!metadatas || !project || !rules) return null; diff --git a/client/src/app/(asset)/metadata/[id]/header/actions.tsx b/client/src/app/(asset)/metadata/[id]/header/actions.tsx index d67f660..9088b23 100644 --- a/client/src/app/(asset)/metadata/[id]/header/actions.tsx +++ b/client/src/app/(asset)/metadata/[id]/header/actions.tsx @@ -23,7 +23,7 @@ export default function HeaderActions({ const projectCollection = useRxCollection("project"); const metadataCollection = useRxCollection("metadata"); - const project = activeProject?._data; + const project = activeProject?.toJSON() as ProjectCollection; if (!metadata || !project) return
No metadata found
; diff --git a/client/src/app/(validator)/data-validation/assets/actions.tsx b/client/src/app/(validator)/data-validation/assets/actions.tsx index fe76d63..528859f 100644 --- a/client/src/app/(validator)/data-validation/assets/actions.tsx +++ b/client/src/app/(validator)/data-validation/assets/actions.tsx @@ -86,6 +86,7 @@ export default function Actions({ return (
@@ -132,6 +138,7 @@ export default function Actions({ + ); +} + +const formatMetadata = ( + JSON: RxDumpCollection | undefined, +): MetatdataJSON[] => { + const documents = JSON?.docs; + if (!documents) return []; + + const metadatas = documents.map( + ({ assetName, metadata }) => + ({ + assetName, + metadata, + }) as unknown as MetatdataJSON, + ); + + return metadatas; +}; diff --git a/client/src/app/(validator)/summary/page.tsx b/client/src/app/(validator)/summary/page.tsx index 2f6808c..b579268 100644 --- a/client/src/app/(validator)/summary/page.tsx +++ b/client/src/app/(validator)/summary/page.tsx @@ -1,5 +1,7 @@ import { Typography } from "~/components/typography"; -import Summary from "./summary"; + +import ExportButton from "./export-button"; +import Content from "./content"; export default function SummaryPage() { return ( @@ -12,10 +14,10 @@ export default function SummaryPage() {
- {/* Add buttons here */} +
- + ); } diff --git a/client/src/app/(validator)/summary/summary/index.tsx b/client/src/app/(validator)/summary/summary/index.tsx deleted file mode 100644 index 744c4c0..0000000 --- a/client/src/app/(validator)/summary/summary/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -import React from "react"; -import ValidatorStats from "./validator-stats"; - -export default function Summary() { - return ( -
- -
- ); -} diff --git a/client/src/app/(validator)/summary/summary/validator-stats.tsx b/client/src/app/(validator)/summary/summary/validator-stats.tsx deleted file mode 100644 index 21eca76..0000000 --- a/client/src/app/(validator)/summary/summary/validator-stats.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import React from "react"; -import { useRxData } from "rxdb-hooks"; -import Stat from "~/components/stat"; -import { Typography } from "~/components/typography"; -import { getKeyCount } from "~/lib/get/get-key-count"; -import type { ValidationsCollection } from "~/lib/types"; - -export default function ValidatorStats() { - const { result, isFetching } = useRxData( - "validations", - (collection) => collection.find(), - ); - - if (isFetching) return
Loading...
; - - const validations = result.map( - (doc) => doc.toJSON() as ValidationsCollection, - ); - - const keys = getKeyCount(validations); - - return ( -
- Validator detected -
- {Object.keys(keys.errors).map((key) => ( -
- - {key} - -
- ))} - {Object.keys(keys.warnings).map((key) => ( -
- - {key} - -
- - {keys.warnings[key]?.message} - -
- ))} -
-
- ); -} diff --git a/client/src/components/add-asset-button.tsx b/client/src/components/add-asset-button.tsx index b9cb7cc..38567cd 100644 --- a/client/src/components/add-asset-button.tsx +++ b/client/src/components/add-asset-button.tsx @@ -64,8 +64,9 @@ export default function AddAssetButton() { return (