@vertesia/ui 0.64.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/core/components/EmptyCollection.js +2 -2
- package/lib/esm/core/components/EmptyCollection.js.map +1 -1
- package/lib/esm/core/components/InputList.js +2 -2
- package/lib/esm/core/components/InputList.js.map +1 -1
- package/lib/esm/core/components/SidePanel.js +1 -1
- package/lib/esm/core/components/SidePanel.js.map +1 -1
- package/lib/esm/core/components/Switch.js +2 -2
- package/lib/esm/core/components/Switch.js.map +1 -1
- package/lib/esm/core/components/shadcn/calendar.js +0 -1
- package/lib/esm/core/components/shadcn/calendar.js.map +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js +0 -1
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
- package/lib/esm/core/components/shadcn/command.js +0 -1
- package/lib/esm/core/components/shadcn/command.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +0 -1
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/comboBox.js +18 -0
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +38 -17
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +11 -5
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +1 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js +24 -0
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/label.js +0 -1
- package/lib/esm/core/components/shadcn/label.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/env/index.js +4 -1
- package/lib/esm/env/index.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +56 -16
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +2 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +2 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/facets/VEnvironmentFacet.js +24 -0
- package/lib/esm/features/facets/VEnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +69 -26
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/VInteractionFacet.js +45 -0
- package/lib/esm/features/facets/VInteractionFacet.js.map +1 -0
- package/lib/esm/features/facets/VStringFacet.js +6 -5
- package/lib/esm/features/facets/VStringFacet.js.map +1 -1
- package/lib/esm/features/facets/VUserFacet.js +6 -6
- package/lib/esm/features/facets/VUserFacet.js.map +1 -1
- package/lib/esm/features/layout/GenericPageNavHeader.js +1 -1
- package/lib/esm/features/magic-pdf/PdfPageProvider.js +3 -3
- package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -1
- package/lib/esm/features/magic-pdf/TextPageView.js +1 -2
- package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js +9 -5
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
- package/lib/esm/features/store/collections/{CollectionsView.js → CreateCollection.js} +6 -14
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -0
- package/lib/esm/features/store/collections/EditCollectionView.js +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +24 -0
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -0
- package/lib/esm/features/store/collections/index.js +2 -2
- package/lib/esm/features/store/collections/index.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +6 -3
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +14 -14
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentIcon.js +7 -10
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentInput.js +1 -2
- package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -1
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +4 -2
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +1 -2
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocument.js +9 -3
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js +2 -2
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -1
- package/lib/esm/features/store/objects/layout/documentLayout.js +2 -2
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +4 -2
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +7 -10
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +2 -2
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -1
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js +2 -3
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -1
- package/lib/esm/features/store/types/ContentObjectTypesTable.js +1 -1
- package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +2 -2
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +2 -3
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/store/types/TableLayoutEditor.js +1 -1
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
- package/lib/esm/features/store/types/index.js +0 -2
- package/lib/esm/features/store/types/index.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +1 -2
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/features/utils/rendition.js +22 -2
- package/lib/esm/features/utils/rendition.js.map +1 -1
- package/lib/esm/session/UserSession.js +2 -2
- package/lib/esm/session/UserSession.js.map +1 -1
- package/lib/esm/session/auth/composable.js +1 -1
- package/lib/esm/session/auth/composable.js.map +1 -1
- package/lib/esm/session/constants.js +3 -0
- package/lib/esm/session/constants.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +2 -2
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/esm/widgets/properties/PropertiesView.js +4 -2
- package/lib/esm/widgets/properties/PropertiesView.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +1 -1
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/InputList.d.ts +2 -1
- package/lib/types/core/components/Switch.d.ts +2 -1
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/stringListFilter.d.ts +10 -0
- package/lib/types/core/components/shadcn/filters/types.d.ts +3 -3
- package/lib/types/env/index.d.ts +1 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +12 -2
- package/lib/types/features/facets/VEnvironmentFacet.d.ts +11 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +9 -1
- package/lib/types/features/facets/VInteractionFacet.d.ts +14 -0
- package/lib/types/features/facets/VStringFacet.d.ts +3 -2
- package/lib/types/features/facets/VUserFacet.d.ts +3 -2
- package/lib/types/features/store/collections/{CollectionsView.d.ts → CreateCollection.d.ts} +5 -3
- package/lib/types/features/store/collections/SelectCollection.d.ts +14 -0
- package/lib/types/features/store/collections/index.d.ts +2 -2
- package/lib/types/features/store/objects/components/ContentOverview.d.ts +2 -1
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +2 -1
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +2 -1
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +1 -1
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +3 -2
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -1
- package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -1
- package/lib/types/features/store/types/index.d.ts +0 -2
- package/lib/types/features/utils/rendition.d.ts +1 -1
- package/lib/types/session/UserSession.d.ts +2 -2
- package/lib/types/session/constants.d.ts +2 -0
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js +1 -1
- package/lib/vertesia-ui-env.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +6 -4
- package/src/core/components/EmptyCollection.tsx +26 -24
- package/src/core/components/InputList.tsx +3 -1
- package/src/core/components/SidePanel.tsx +2 -2
- package/src/core/components/Switch.tsx +4 -3
- package/src/core/components/shadcn/calendar.tsx +0 -2
- package/src/core/components/shadcn/checkbox.tsx +0 -2
- package/src/core/components/shadcn/command.tsx +0 -2
- package/src/core/components/shadcn/dialog.tsx +0 -2
- package/src/core/components/shadcn/filters/comboBox.tsx +73 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +41 -17
- package/src/core/components/shadcn/filters/filters.tsx +30 -14
- package/src/core/components/shadcn/filters/selectFilter.tsx +3 -3
- package/src/core/components/shadcn/filters/stringListFilter.tsx +58 -0
- package/src/core/components/shadcn/filters/textFilter.tsx +2 -1
- package/src/core/components/shadcn/filters/types.ts +3 -3
- package/src/core/components/shadcn/label.tsx +0 -2
- package/src/core/components/shadcn/selectBox.tsx +1 -1
- package/src/env/index.ts +5 -1
- package/src/features/agent/PayloadBuilder.tsx +66 -16
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +0 -11
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +11 -12
- package/src/features/facets/VEnvironmentFacet.tsx +42 -0
- package/src/features/facets/VFacetsNav.tsx +87 -29
- package/src/features/facets/VInteractionFacet.tsx +73 -0
- package/src/features/facets/VStringFacet.tsx +7 -6
- package/src/features/facets/VUserFacet.tsx +7 -6
- package/src/features/layout/GenericPageNavHeader.tsx +1 -1
- package/src/features/magic-pdf/PdfPageProvider.tsx +3 -3
- package/src/features/magic-pdf/TextPageView.tsx +1 -2
- package/src/features/store/collections/CollectionsTable.tsx +49 -40
- package/src/features/store/collections/{CollectionsView.tsx → CreateCollection.tsx} +15 -42
- package/src/features/store/collections/EditCollectionView.tsx +1 -1
- package/src/features/store/collections/SelectCollection.tsx +46 -0
- package/src/features/store/collections/index.ts +2 -2
- package/src/features/store/objects/DocumentSearchResults.tsx +6 -3
- package/src/features/store/objects/components/ContentOverview.tsx +33 -95
- package/src/features/store/objects/components/DocumentIcon.tsx +27 -14
- package/src/features/store/objects/components/DocumentInput.tsx +1 -2
- package/src/features/store/objects/components/PropertiesEditorModal.tsx +7 -3
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +2 -2
- package/src/features/store/objects/components/SelectDocument.tsx +18 -3
- package/src/features/store/objects/components/SelectDocumentModal.tsx +6 -6
- package/src/features/store/objects/layout/documentLayout.tsx +2 -2
- package/src/features/store/objects/search/DocumentSearchContext.ts +6 -3
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +1 -1
- package/src/features/store/objects/selection/SelectionActions.tsx +0 -1
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +10 -21
- package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +1 -1
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +2 -2
- package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +1 -1
- package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +1 -1
- package/src/features/store/types/ContentObjectTypesSearch.tsx +3 -4
- package/src/features/store/types/ContentObjectTypesTable.tsx +3 -1
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +2 -9
- package/src/features/store/types/ObjectSchemaEditor.tsx +4 -5
- package/src/features/store/types/TableLayoutEditor.tsx +4 -4
- package/src/features/store/types/index.ts +0 -2
- package/src/features/user/UserInfo.tsx +1 -2
- package/src/features/utils/rendition.ts +23 -1
- package/src/session/UserSession.ts +2 -2
- package/src/session/auth/composable.ts +1 -1
- package/src/session/constants.ts +2 -0
- package/src/widgets/codemirror/CodeMirrorEditor.tsx +2 -2
- package/src/widgets/properties/PropertiesView.tsx +10 -2
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +1 -1
- package/lib/esm/features/store/collections/CollectionView.js +0 -53
- package/lib/esm/features/store/collections/CollectionView.js.map +0 -1
- package/lib/esm/features/store/collections/CollectionsView.js.map +0 -1
- package/lib/esm/features/store/types/ContentObjectTypeView.js +0 -158
- package/lib/esm/features/store/types/ContentObjectTypeView.js.map +0 -1
- package/lib/esm/features/store/types/ContentObjectTypesView.js +0 -55
- package/lib/esm/features/store/types/ContentObjectTypesView.js.map +0 -1
- package/lib/types/features/store/collections/CollectionView.d.ts +0 -5
- package/lib/types/features/store/types/ContentObjectTypeView.d.ts +0 -5
- package/lib/types/features/store/types/ContentObjectTypesView.d.ts +0 -8
- package/src/features/store/collections/CollectionView.tsx +0 -94
- package/src/features/store/types/ContentObjectTypeView.tsx +0 -244
- package/src/features/store/types/ContentObjectTypesView.tsx +0 -71
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ColumnLayout, ContentObjectItem } from "@vertesia/common";
|
|
2
|
-
import { ErrorBox, Spinner, useIntersectionObserver } from "@vertesia/ui/core";
|
|
2
|
+
import { Button, ErrorBox, Spinner, useIntersectionObserver } from "@vertesia/ui/core";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { VFacetsNav } from "../../../facets";
|
|
5
5
|
import { DocumentTable } from "../DocumentTable";
|
|
6
6
|
import { useDocumentSearch, useWatchDocumentSearchFacets, useWatchDocumentSearchResult } from "../search/DocumentSearchContext";
|
|
7
7
|
import { DocumentSearchProvider } from "../search/DocumentSearchProvider";
|
|
8
8
|
import { ContentDispositionButton } from "./ContentDispositionButton";
|
|
9
|
+
import { RefreshCw } from "lucide-react";
|
|
9
10
|
|
|
10
11
|
const layout: ColumnLayout[] = [
|
|
11
12
|
{ "name": "Name", "field": "properties.title", "type": "string", "fallback": "name" },
|
|
@@ -33,15 +34,19 @@ export function SelectDocument({ onChange }: SelectDocumentProps) {
|
|
|
33
34
|
interface SelectDocumentImplProps {
|
|
34
35
|
onRowClick: (selected: ContentObjectItem) => void;
|
|
35
36
|
}
|
|
37
|
+
const LAST_DISPLAYED_VIEW = 'vertesia.content_store.lastDisplayedView'
|
|
38
|
+
|
|
36
39
|
function SelectDocumentImpl({ onRowClick }: SelectDocumentImplProps) {
|
|
37
40
|
const [isReady, setIsReady] = useState(false);
|
|
38
|
-
const [isGridView, setIsGridView] = useState(localStorage.getItem(
|
|
41
|
+
const [isGridView, setIsGridView] = useState(localStorage.getItem(LAST_DISPLAYED_VIEW) === 'grid');
|
|
39
42
|
const { search, isLoading, error, objects } = useWatchDocumentSearchResult();
|
|
40
43
|
|
|
41
44
|
const loadMoreRef = useRef<HTMLDivElement>(null);
|
|
45
|
+
|
|
42
46
|
useIntersectionObserver(loadMoreRef, () => {
|
|
43
47
|
isReady && search.loadMore(true)
|
|
44
48
|
}, { deps: [isReady] });
|
|
49
|
+
|
|
45
50
|
useEffect(() => {
|
|
46
51
|
search.search().then(() => setIsReady(true));
|
|
47
52
|
}, []);
|
|
@@ -49,6 +54,11 @@ function SelectDocumentImpl({ onRowClick }: SelectDocumentImplProps) {
|
|
|
49
54
|
const facets = useWatchDocumentSearchFacets();
|
|
50
55
|
const facetSearch = useDocumentSearch();
|
|
51
56
|
|
|
57
|
+
const handleRefetch = () => {
|
|
58
|
+
setIsReady(false);
|
|
59
|
+
search.search().then(() => setIsReady(true));
|
|
60
|
+
}
|
|
61
|
+
|
|
52
62
|
if (error) {
|
|
53
63
|
return <ErrorBox title="Search failed">{error.message}</ErrorBox>
|
|
54
64
|
}
|
|
@@ -57,7 +67,12 @@ function SelectDocumentImpl({ onRowClick }: SelectDocumentImplProps) {
|
|
|
57
67
|
<div>
|
|
58
68
|
<div className="flex justify-between items-center mb-4">
|
|
59
69
|
<VFacetsNav facets={facets} search={facetSearch} textSearch="Filter content" />
|
|
60
|
-
<
|
|
70
|
+
<div className="flex items-center gap-2">
|
|
71
|
+
<Button variant="outline" onClick={handleRefetch} alt="Refresh">
|
|
72
|
+
<RefreshCw size={16} />
|
|
73
|
+
</Button>
|
|
74
|
+
<ContentDispositionButton onUpdate={setIsGridView} />
|
|
75
|
+
</div>
|
|
61
76
|
</div>
|
|
62
77
|
<DocumentTable objects={objects || []} isLoading={false} layout={layout} onRowClick={onRowClick} isGridView={isGridView} />
|
|
63
78
|
<div ref={loadMoreRef} className='mt-10' />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContentObjectItem } from "@vertesia/common";
|
|
2
|
-
import {
|
|
2
|
+
import { VModal, VModalBody, VModalTitle } from "@vertesia/ui/core";
|
|
3
3
|
import { SelectDocument } from "./SelectDocument";
|
|
4
4
|
|
|
5
5
|
interface SelectDocumentModalProps {
|
|
@@ -10,11 +10,11 @@ interface SelectDocumentModalProps {
|
|
|
10
10
|
}
|
|
11
11
|
export function SelectDocumentModal({ isOpen, onClose }: SelectDocumentModalProps) {
|
|
12
12
|
return (
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
13
|
+
<VModal onClose={() => onClose()} isOpen={!!isOpen} className='min-w-[60vw]'>
|
|
14
|
+
<VModalTitle>Select Content</VModalTitle>
|
|
15
|
+
<VModalBody className='pt-0 overflow-y-auto max-h-[80vh] min-h-[80vh]'>
|
|
16
16
|
{isOpen && <SelectDocument onChange={onClose} />}
|
|
17
|
-
</
|
|
18
|
-
</
|
|
17
|
+
</VModalBody>
|
|
18
|
+
</VModal>
|
|
19
19
|
)
|
|
20
20
|
}
|
|
@@ -52,7 +52,7 @@ export function DocumentTableView({ objects, selection, isLoading, onRowClick, c
|
|
|
52
52
|
)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export function DocumentGridView({ objects, selection, isLoading, onSelectionChange }: ViewProps) {
|
|
55
|
+
export function DocumentGridView({ objects, selection, isLoading, onSelectionChange, onRowClick }: ViewProps) {
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<>
|
|
@@ -61,7 +61,7 @@ export function DocumentGridView({ objects, selection, isLoading, onSelectionCha
|
|
|
61
61
|
</div>
|
|
62
62
|
<div className="w-full gap-2 grid lg:grid-cols-6">
|
|
63
63
|
{objects.map((document) => (
|
|
64
|
-
<DocumentIcon key={document.id} document={document} selection={selection} onSelectionChange={onSelectionChange} />
|
|
64
|
+
<DocumentIcon key={document.id} document={document} selection={selection} onSelectionChange={onSelectionChange} onRowClick={onRowClick} />
|
|
65
65
|
))}
|
|
66
66
|
</div>
|
|
67
67
|
</>
|
|
@@ -3,6 +3,7 @@ import { createContext, useContext } from 'react';
|
|
|
3
3
|
import { SharedState, useWatchSharedState } from '@vertesia/ui/core';
|
|
4
4
|
import { ComputeFacetsResponse, ZenoClient } from '@vertesia/client';
|
|
5
5
|
import { ComplexSearchQuery, ContentObjectItem, FacetBucket, FacetSpec, ObjectSearchQuery } from '@vertesia/common';
|
|
6
|
+
import { SearchInterface } from '@vertesia/ui/features'
|
|
6
7
|
|
|
7
8
|
interface DocumentSearchResult {
|
|
8
9
|
objects: ContentObjectItem[],
|
|
@@ -11,7 +12,7 @@ interface DocumentSearchResult {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
export class DocumentSearch {
|
|
15
|
+
export class DocumentSearch implements SearchInterface {
|
|
15
16
|
|
|
16
17
|
collectionId?: string;
|
|
17
18
|
facets = new SharedState<ComputeFacetsResponse>({});
|
|
@@ -49,13 +50,15 @@ export class DocumentSearch {
|
|
|
49
50
|
this.search();
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
clearFilters() {
|
|
53
|
+
clearFilters(autoSearch: boolean = true) {
|
|
53
54
|
const parent = this.query.parent;
|
|
54
55
|
this.query = {
|
|
55
56
|
parent
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
if (autoSearch) {
|
|
60
|
+
this.search();
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
getFacetBuckets(name: string): FacetBucket[] {
|
|
@@ -28,7 +28,6 @@ export function SelectionActions() {
|
|
|
28
28
|
<div className="flex items-center gap-x-1 shrink-0">
|
|
29
29
|
<div className='text-sm nowrap'>{size} document{plural} selected</div>
|
|
30
30
|
<Button title="Clear selection" variant={"ghost"}
|
|
31
|
-
className=" rounded-md p-2"
|
|
32
31
|
onClick={onClearSelection}>
|
|
33
32
|
<X className="size-4" />
|
|
34
33
|
</Button>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Button,
|
|
1
|
+
import { Button, Portal, useToast, VModal, VModalBody, VModalFooter, VModalTitle } from "@vertesia/ui/core";
|
|
2
2
|
import { useUserSession } from "@vertesia/ui/session";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { CreateCollectionForm } from "../../../collections";
|
|
4
|
+
import { CreateCollectionForm, SelectCollection } from "../../../collections";
|
|
5
5
|
import { useObjectsActionCallback } from "../ObjectsActionContext";
|
|
6
6
|
import { ActionComponentTypeProps, ObjectsActionSpec } from "../ObjectsActionSpec";
|
|
7
7
|
|
|
@@ -43,7 +43,7 @@ function SelectCollectionModal({ isOpen, onClose, objectIds }: SelectCollectionM
|
|
|
43
43
|
return (
|
|
44
44
|
<VModal isOpen={isOpen} onClose={onClose}>
|
|
45
45
|
<VModalTitle>Add to a Collection</VModalTitle>
|
|
46
|
-
<AddToCollectionForm onClose={onClose} objectIds={objectIds}
|
|
46
|
+
<AddToCollectionForm onClose={onClose} objectIds={objectIds}/>
|
|
47
47
|
</VModal>
|
|
48
48
|
)
|
|
49
49
|
}
|
|
@@ -55,8 +55,7 @@ interface AddToCollectionFormProps {
|
|
|
55
55
|
function AddToCollectionForm({ onClose, objectIds }: AddToCollectionFormProps) {
|
|
56
56
|
const toast = useToast();
|
|
57
57
|
const { client } = useUserSession();
|
|
58
|
-
const [
|
|
59
|
-
const { data: collections, error } = useFetch(() => client.store.collections.list({ dynamic: false }), []);
|
|
58
|
+
const [selectedCollectionId, setSelectedCollectionId] = useState<string>();
|
|
60
59
|
const onAddToCollection = ({ collectionId }: { collectionId: string }) => {
|
|
61
60
|
if (!collectionId || !objectIds?.length) {
|
|
62
61
|
return;
|
|
@@ -78,28 +77,18 @@ function AddToCollectionForm({ onClose, objectIds }: AddToCollectionFormProps) {
|
|
|
78
77
|
});
|
|
79
78
|
});
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
|
|
81
|
+
const onCollectionChange = (collectionId: string | undefined) => {
|
|
82
|
+
setSelectedCollectionId(collectionId);
|
|
83
|
+
};
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<>
|
|
87
87
|
<VModalBody>
|
|
88
|
-
<
|
|
89
|
-
filterBy={"name"}
|
|
90
|
-
value={selectedCol}
|
|
91
|
-
onChange={(collection) => {
|
|
92
|
-
setSelectedCol(collection);
|
|
93
|
-
}}
|
|
94
|
-
placeholder="Select a collection"
|
|
95
|
-
options={collections || []}
|
|
96
|
-
optionLabel={(col: any) => col.name}
|
|
97
|
-
by="id"
|
|
98
|
-
className="mb-4"
|
|
99
|
-
/>
|
|
88
|
+
<SelectCollection onChange={onCollectionChange} value={selectedCollectionId} className="mb-4"/>
|
|
100
89
|
</VModalBody>
|
|
101
90
|
<VModalFooter>
|
|
102
|
-
<Button isDisabled={!
|
|
91
|
+
<Button isDisabled={!selectedCollectionId} onClick={() => selectedCollectionId && onAddToCollection({ collectionId: selectedCollectionId })}>
|
|
103
92
|
Add to Collection
|
|
104
93
|
</Button>
|
|
105
94
|
</VModalFooter>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToast } from "@vertesia/ui/core";
|
|
2
2
|
import { useUserSession } from "@vertesia/ui/session";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { SelectContentTypeModal } from "
|
|
4
|
+
import { SelectContentTypeModal } from "../../../types";
|
|
5
5
|
import { useObjectsActionCallback } from "../ObjectsActionContext";
|
|
6
6
|
import { ActionComponentTypeProps, ObjectsActionSpec } from "../ObjectsActionSpec";
|
|
7
7
|
|
|
@@ -4,12 +4,12 @@ import { useToast } from '@vertesia/ui/core';
|
|
|
4
4
|
import { useNavigate } from "@vertesia/ui/router";
|
|
5
5
|
import { useUserSession } from '@vertesia/ui/session';
|
|
6
6
|
|
|
7
|
-
import { useDocumentSearch } from '
|
|
7
|
+
import { useDocumentSearch } from '../../search/DocumentSearchContext';
|
|
8
8
|
import { useObjectsActionContext } from '../ObjectsActionContext';
|
|
9
9
|
import { ActionComponentTypeProps, ObjectsActionSpec } from '../ObjectsActionSpec';
|
|
10
10
|
import ConfirmAction from './ConfirmAction';
|
|
11
11
|
|
|
12
|
-
function DeleteObjectsActionComponent({ action, objectIds, children }: ActionComponentTypeProps) {
|
|
12
|
+
export function DeleteObjectsActionComponent({ action, objectIds, children }: ActionComponentTypeProps) {
|
|
13
13
|
const ctx = useObjectsActionContext();
|
|
14
14
|
|
|
15
15
|
const toast = useToast();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToast } from "@vertesia/ui/core";
|
|
2
2
|
import { useUserSession } from "@vertesia/ui/session";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { ExportPropertiesModal, ExportTypes } from "
|
|
4
|
+
import { ExportPropertiesModal, ExportTypes } from "../../ExportPropertiesModal";
|
|
5
5
|
import { useObjectsActionCallback } from "../ObjectsActionContext";
|
|
6
6
|
import { ActionComponentTypeProps, ObjectsActionSpec } from "../ObjectsActionSpec";
|
|
7
7
|
|
|
@@ -8,7 +8,7 @@ import { useObjectsActionContext } from '../ObjectsActionContext';
|
|
|
8
8
|
import { ActionComponentTypeProps, ObjectsActionSpec } from '../ObjectsActionSpec';
|
|
9
9
|
import ConfirmAction from './ConfirmAction';
|
|
10
10
|
|
|
11
|
-
function RemoveFromCollectionActionComponent({ action, objectIds, collectionId }: ActionComponentTypeProps) {
|
|
11
|
+
export function RemoveFromCollectionActionComponent({ action, objectIds, collectionId }: ActionComponentTypeProps) {
|
|
12
12
|
const ctx = useObjectsActionContext();
|
|
13
13
|
|
|
14
14
|
const toast = useToast();
|
|
@@ -3,8 +3,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { ContentObjectTypesTable } from './ContentObjectTypesTable';
|
|
4
4
|
import { useWatchSearchResult } from './search/ObjectTypeSearchContext';
|
|
5
5
|
import { useUserSession } from '@vertesia/ui/session';
|
|
6
|
-
import { EmptyCollection, ErrorBox, Input, SelectBox, useToast } from '@vertesia/ui/core';
|
|
7
|
-
import { useDebounce, useIntersectionObserver } from '@vertesia/ui/core';
|
|
6
|
+
import { EmptyCollection, ErrorBox, Input, SelectBox, useToast, useDebounce, useIntersectionObserver } from '@vertesia/ui/core';
|
|
8
7
|
|
|
9
8
|
import { CreateOrUpdateTypeModal, CreateOrUpdateTypePayload } from './CreateOrUpdateTypeModal';
|
|
10
9
|
|
|
@@ -90,12 +89,12 @@ export function ContentObjectTypesSearch({ isDirty = false }: ContentObjectTypes
|
|
|
90
89
|
};
|
|
91
90
|
|
|
92
91
|
return (
|
|
93
|
-
<div>
|
|
92
|
+
<div className='flex flex-col gap-4 h-full'>
|
|
94
93
|
<div className="flex gap-4">
|
|
95
94
|
<Input placeholder="Filter by Name" value={searchTerm} onChange={setSearchTerm} />
|
|
96
95
|
<SelectBox className="w-60" isClearable options={Object.values(ChunkableOptions)} value={chunkable} onChange={onChunkableChange} placeholder={"Is Chunkable"} />
|
|
97
96
|
</div>
|
|
98
|
-
<div className="
|
|
97
|
+
<div className="flex-1">
|
|
99
98
|
{
|
|
100
99
|
(!isLoading && objects?.length === 0) ?
|
|
101
100
|
<EmptyCollection title="No Type" buttonLabel='Create Type' onClick={onOpenCreateModal}>
|
|
@@ -19,7 +19,8 @@ export function ContentObjectTypesTable({ objects, isLoading }: ContentObjectTyp
|
|
|
19
19
|
<thead>
|
|
20
20
|
<tr>
|
|
21
21
|
<th>Name</th>
|
|
22
|
-
<th>
|
|
22
|
+
<th>Strict Mode</th>
|
|
23
|
+
<th>Semantic Chunking</th>
|
|
23
24
|
<th>Updated At</th>
|
|
24
25
|
</tr>
|
|
25
26
|
</thead>
|
|
@@ -27,6 +28,7 @@ export function ContentObjectTypesTable({ objects, isLoading }: ContentObjectTyp
|
|
|
27
28
|
{objects?.map((obj: any) => (
|
|
28
29
|
<tr key={obj.id} onClick={() => navigate(`/types/${obj.id}`)} className='cursor-pointer hover:bg-muted'>
|
|
29
30
|
<td>{obj.name}</td>
|
|
31
|
+
<td>{obj.strict_mode ? 'Yes' : 'No'}</td>
|
|
30
32
|
<td>{obj.is_chunkable ? 'Yes' : 'No'}</td>
|
|
31
33
|
<td>{dayjs(obj.updated_at).fromNow()}</td>
|
|
32
34
|
</tr>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { Button, Input, Modal, ModalBody, ModalFooter, ModalTitle,
|
|
3
|
+
import { Button, Input, Modal, ModalBody, ModalFooter, ModalTitle, useToast, Textarea } from '@vertesia/ui/core';
|
|
4
4
|
|
|
5
5
|
export interface CreateOrUpdateTypePayload {
|
|
6
6
|
name: string;
|
|
@@ -48,14 +48,7 @@ export function CreateOrUpdateTypeModal({ title, isOpen, onClose, okLabel, initi
|
|
|
48
48
|
</div>
|
|
49
49
|
<div>
|
|
50
50
|
<label className="block text-sm font-medium text-muted">Description</label>
|
|
51
|
-
<
|
|
52
|
-
</div>
|
|
53
|
-
<div className="flex items-center justify-between">
|
|
54
|
-
<label className="block text-sm font-medium text-muted-foreground">Strict Mode</label>
|
|
55
|
-
<Switch value={strictMode} onChange={setStrictMode} />
|
|
56
|
-
</div>
|
|
57
|
-
<div className="text-xs text-muted-foreground">
|
|
58
|
-
When enabled, objects will be validated against the schema at generation and save time.
|
|
51
|
+
<Textarea value={description} onChange={setDescription} />
|
|
59
52
|
</div>
|
|
60
53
|
</div>
|
|
61
54
|
</ModalBody>
|
|
@@ -3,9 +3,8 @@ import { useMemo, useRef, useState } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { useUserSession } from '@vertesia/ui/session';
|
|
5
5
|
import { json } from '@codemirror/lang-json';
|
|
6
|
-
import { CodeMirrorEditor, EditorApi } from '@vertesia/ui/widgets';
|
|
6
|
+
import { CodeMirrorEditor, EditorApi, SchemaEditor, useSchema } from '@vertesia/ui/widgets';
|
|
7
7
|
import { Button, useToast } from '@vertesia/ui/core';
|
|
8
|
-
import { SchemaEditor, useSchema } from '@vertesia/ui/widgets';
|
|
9
8
|
import { ContentObjectType } from '@vertesia/common';
|
|
10
9
|
|
|
11
10
|
const CODE_MIRROR_EXTENSIONS = [basicSetup, json()];
|
|
@@ -85,9 +84,9 @@ export function ObjectSchemaEditor({ objectType, onSchemaUpdate }: ObjectSchemaE
|
|
|
85
84
|
};
|
|
86
85
|
|
|
87
86
|
return (
|
|
88
|
-
<div className="mx-2 my-2 rounded-
|
|
89
|
-
<div className="flex items-center rounded-t-md border-b gap-x-2 py-2
|
|
90
|
-
<div className="text-
|
|
87
|
+
<div className="mx-2 my-2 rounded-2xl border border-solid shadow-md border-spacing-2">
|
|
88
|
+
<div className="flex items-center rounded-t-md border-b gap-x-2 py-2 pl-4 pr-2">
|
|
89
|
+
<div className="text-base font-semibold">Schema Editor</div>
|
|
91
90
|
<div>
|
|
92
91
|
<Button variant="outline" size="sm" onClick={handleOnSave}>
|
|
93
92
|
{
|
|
@@ -81,11 +81,11 @@ export function TableLayoutEditor({ objectType, onLayoutUpdate }: TableLayoutEdi
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
|
-
<div className="mx-2 my-2 rounded-
|
|
85
|
-
<div className="flex items-center rounded-t-md gap-x-2
|
|
86
|
-
<div className="text-
|
|
84
|
+
<div className="mx-2 my-2 rounded-2xl border border-solid shadow-xs">
|
|
85
|
+
<div className="flex items-center rounded-t-md border-b gap-x-2 py-2 pl-4 pr-2">
|
|
86
|
+
<div className="text-base font-semibold ">Table Layout Editor</div>
|
|
87
87
|
<div className="ml-auto flex gap-x-2">
|
|
88
|
-
<Button isLoading={isUpdating} variant="
|
|
88
|
+
<Button isLoading={isUpdating} variant="outline" size="sm" onClick={onSave}>Save Changes</Button>
|
|
89
89
|
</div>
|
|
90
90
|
</div>
|
|
91
91
|
<div className="px-4 py-2">
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from "./ContentObjectTypesSearch";
|
|
2
2
|
export * from "./ContentObjectTypesTable";
|
|
3
|
-
export * from "./ContentObjectTypesView";
|
|
4
|
-
export * from "./ContentObjectTypeView";
|
|
5
3
|
export * from "./CreateOrUpdateTypeModal";
|
|
6
4
|
export * from "./ObjectSchemaEditor";
|
|
7
5
|
export * from "./search";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useUserSession } from "@vertesia/ui/session";
|
|
2
2
|
import { ApiKey, ApiKeyTypes, PrincipalType, User } from "@vertesia/common";
|
|
3
|
-
import { Avatar, Table, Popover, PopoverContent, PopoverTrigger } from "@vertesia/ui/core";
|
|
4
|
-
import { useFetch } from "@vertesia/ui/core";
|
|
3
|
+
import { Avatar, Table, Popover, PopoverContent, PopoverTrigger, useFetch } from "@vertesia/ui/core";
|
|
5
4
|
import { ReactNode } from "react";
|
|
6
5
|
|
|
7
6
|
//TODO use a real cache
|
|
@@ -18,6 +18,7 @@ export async function retrieveRendition(
|
|
|
18
18
|
doc: ContentObjectItem,
|
|
19
19
|
setRenditionUrl: (url: string) => void,
|
|
20
20
|
setRenditionAlt: (alt: string) => void,
|
|
21
|
+
setRenditionStatus: (status: string) => void,
|
|
21
22
|
) {
|
|
22
23
|
if (
|
|
23
24
|
!doc?.content?.type ||
|
|
@@ -27,9 +28,11 @@ export async function retrieveRendition(
|
|
|
27
28
|
isPdf(doc.content.type)
|
|
28
29
|
)
|
|
29
30
|
) {
|
|
31
|
+
setRenditionStatus("No preview available");
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
setRenditionStatus("Preparing preview...");
|
|
33
36
|
const currentTime = new Date().getTime() / 1000;
|
|
34
37
|
|
|
35
38
|
const savedId = localStorage.getItem(
|
|
@@ -46,16 +49,27 @@ export async function retrieveRendition(
|
|
|
46
49
|
) {
|
|
47
50
|
setRenditionUrl(savedId);
|
|
48
51
|
setRenditionAlt(`${doc.name} Rendition`);
|
|
52
|
+
setRenditionStatus("ready");
|
|
49
53
|
return savedId;
|
|
50
54
|
}
|
|
51
55
|
|
|
56
|
+
setRenditionStatus("Preparing preview...");
|
|
52
57
|
client.objects.getRendition(doc.id, RENDITION_OPTIONS).then((response) => {
|
|
53
58
|
if (response.status === "generating") {
|
|
54
|
-
|
|
59
|
+
setRenditionStatus("Preparing preview...");
|
|
60
|
+
setRenditionUrl("");
|
|
61
|
+
setRenditionAlt("");
|
|
62
|
+
setTimeout(() => retrieveRendition(client, doc, setRenditionUrl, setRenditionAlt, setRenditionStatus), 60000);
|
|
55
63
|
} else if (response.status === "failed") {
|
|
64
|
+
setRenditionStatus("No preview available");
|
|
65
|
+
setRenditionUrl("");
|
|
66
|
+
setRenditionAlt("");
|
|
56
67
|
return;
|
|
57
68
|
} else {
|
|
58
69
|
if (!response?.renditions?.length) {
|
|
70
|
+
setRenditionStatus("No preview available");
|
|
71
|
+
setRenditionUrl("");
|
|
72
|
+
setRenditionAlt("");
|
|
59
73
|
return;
|
|
60
74
|
}
|
|
61
75
|
const rendition = response.renditions[0];
|
|
@@ -70,6 +84,14 @@ export async function retrieveRendition(
|
|
|
70
84
|
);
|
|
71
85
|
setRenditionUrl(rendition);
|
|
72
86
|
setRenditionAlt(`${doc.name} Rendition`);
|
|
87
|
+
setRenditionStatus("ready");
|
|
88
|
+
console.log(`Rendition for document ${doc.id} retrieved successfully: ${rendition}`);
|
|
73
89
|
}
|
|
90
|
+
}).catch((error) => {
|
|
91
|
+
|
|
92
|
+
setRenditionStatus("No preview available");
|
|
93
|
+
console.warn("Failed to retrieve rendition:", error);
|
|
94
|
+
setRenditionUrl("");
|
|
95
|
+
setRenditionAlt("");
|
|
74
96
|
});
|
|
75
97
|
}
|
|
@@ -9,8 +9,8 @@ import { getComposableToken } from './auth/composable';
|
|
|
9
9
|
import { getFirebaseAuth } from './auth/firebase';
|
|
10
10
|
import { TypeRegistry } from './TypeRegistry';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
export
|
|
12
|
+
import { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY } from './constants';
|
|
13
|
+
export { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY };
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class UserSession {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { AuthTokenPayload } from "@vertesia/common";
|
|
5
5
|
import { jwtDecode } from "jwt-decode";
|
|
6
6
|
import { Env } from '@vertesia/ui/env';
|
|
7
|
-
import { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY } from '../
|
|
7
|
+
import { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY } from '../constants';
|
|
8
8
|
import { getFirebaseAuth, getFirebaseAuthToken } from './firebase';
|
|
9
9
|
|
|
10
10
|
let AUTH_TOKEN_RAW: string | undefined;
|
|
@@ -30,8 +30,8 @@ const customTheme = EditorView.theme({
|
|
|
30
30
|
".cm-gutters": { backgroundColor: "transparent", color: "#ddd" },
|
|
31
31
|
".cm-focused": { outline: "none" },
|
|
32
32
|
".cm-cursor": {
|
|
33
|
-
borderLeft: "2px solid #
|
|
34
|
-
borderLeftColor: "#
|
|
33
|
+
borderLeft: "2px solid #808080",
|
|
34
|
+
borderLeftColor: "#808080",
|
|
35
35
|
animation: "blink 1.2s step-start infinite"
|
|
36
36
|
},
|
|
37
37
|
"@keyframes blink": { "50%": { opacity: 0 } }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Table } from "@vertesia/ui/core";
|
|
1
|
+
import { Table, VTooltip } from "@vertesia/ui/core";
|
|
2
|
+
import { Info } from "lucide-react";
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
interface PropertiesViewProps {
|
|
@@ -12,8 +13,15 @@ export function PropertiesView({ className, properties }: PropertiesViewProps) {
|
|
|
12
13
|
{
|
|
13
14
|
properties.map((property) => (
|
|
14
15
|
<tr key={property.name}>
|
|
15
|
-
<td className='w-1/3 font-semibold' >
|
|
16
|
+
<td className='w-1/3 font-semibold gap-2' >
|
|
16
17
|
<span>{property.name}</span>
|
|
18
|
+
{property.description &&
|
|
19
|
+
<VTooltip
|
|
20
|
+
description={property.description}
|
|
21
|
+
placement="top">
|
|
22
|
+
<Info className="size-3 ml-2 text-muted-foreground" />
|
|
23
|
+
</VTooltip>
|
|
24
|
+
}
|
|
17
25
|
</td>
|
|
18
26
|
<td className='w-2/3'>{property.value ?? 'undefined'}</td>
|
|
19
27
|
</tr>
|
|
@@ -154,7 +154,7 @@ function AddPropertyButton({ parent }: AddPropertyButtonProps) {
|
|
|
154
154
|
parent.reloadTree();
|
|
155
155
|
}
|
|
156
156
|
return (
|
|
157
|
-
<Button variant="
|
|
157
|
+
<Button variant="ghost" onClick={add}>
|
|
158
158
|
<Plus className='size-4' />Add property
|
|
159
159
|
</Button>
|
|
160
160
|
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ErrorBox, Spinner, useFetch, VTabs, VTabsBar, VTabsPanel } from "@vertesia/ui/core";
|
|
3
|
-
import { FullHeightLayout } from "@vertesia/ui/layout";
|
|
4
|
-
import { NavLink } from "@vertesia/ui/router";
|
|
5
|
-
import { useUserSession } from "@vertesia/ui/session";
|
|
6
|
-
import { PanelErrorBoundary } from "../../errors";
|
|
7
|
-
import { GenericPageNavHeader } from "../../layout";
|
|
8
|
-
import { DocumentSearchProvider, DocumentSelectionProvider } from "../../store";
|
|
9
|
-
import { SelectionActions, UploadObjectsButton } from "../objects/selection/SelectionActions";
|
|
10
|
-
import { BrowseCollectionView } from "./BrowseCollectionView";
|
|
11
|
-
import { EditCollectionView } from "./EditCollectionView";
|
|
12
|
-
const facets = [
|
|
13
|
-
{
|
|
14
|
-
name: 'status',
|
|
15
|
-
field: 'status'
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: 'type',
|
|
19
|
-
field: 'type'
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
export function CollectionView({ collectionId }) {
|
|
23
|
-
const { client } = useUserSession();
|
|
24
|
-
const { data: collection, error, refetch, isLoading } = useFetch(() => client.store.collections.retrieve(collectionId), [collectionId]);
|
|
25
|
-
if (error) {
|
|
26
|
-
return _jsx(ErrorBox, { title: 'Collection fetch failed', children: error.message });
|
|
27
|
-
}
|
|
28
|
-
const actions = [
|
|
29
|
-
_jsx(SelectionActions, {}, 'selection'),
|
|
30
|
-
_jsx(UploadObjectsButton, { collectionId: collectionId ?? '' }, "upload")
|
|
31
|
-
];
|
|
32
|
-
const title = (_jsx("div", { className: 'flex gap-x-1 items-center', children: _jsx("div", { children: collection?.name || '' }) }));
|
|
33
|
-
const breadcrumbs = [
|
|
34
|
-
_jsx(NavLink, { href: '/collections', children: "Collections" }, 'collections'),
|
|
35
|
-
_jsx("span", { children: "Collection Detail" }, 'collection-detail')
|
|
36
|
-
];
|
|
37
|
-
const tabs = [
|
|
38
|
-
{
|
|
39
|
-
name: 'browse',
|
|
40
|
-
label: 'Browse',
|
|
41
|
-
content: _jsx(BrowseCollectionView, { collection: collection })
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'metadata',
|
|
45
|
-
label: 'Metadata',
|
|
46
|
-
content: _jsx(EditCollectionView, { collection: collection, refetch: refetch })
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
return (_jsx(FullHeightLayout, { children: _jsx(DocumentSearchProvider, { facets: facets, collectionId: collectionId, children: _jsxs(DocumentSelectionProvider, { collectionId: collectionId, children: [_jsx(GenericPageNavHeader, { title: title, description: collection?.description || '', actions: actions, breadcrumbs: breadcrumbs }), _jsxs(VTabs, { defaultValue: "browse", tabs: tabs, children: [_jsx(VTabsBar, { className: "px-4" }), isLoading ?
|
|
50
|
-
_jsx("div", { className: "w-full flex justify-center", children: _jsx(Spinner, {}) }) :
|
|
51
|
-
_jsx("div", { className: "h-[calc(100vh-165px)] overflow-auto px-4 py-2", children: _jsx(PanelErrorBoundary, { children: _jsx(VTabsPanel, {}) }) })] })] }) }) }));
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=CollectionView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionView.js","sourceRoot":"","sources":["../../../../../src/features/store/collections/CollectionView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,GAAgB;IACxB;QACI,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;KAClB;IACD;QACI,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;KAChB;CACJ,CAAC;AAMF,MAAM,UAAU,cAAc,CAAC,EAAE,YAAY,EAAuB;IAChE,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC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,KAAK,EAC9B,WAAW,EAAE,UAAU,EAAE,WAAW,IAAI,EAAE,EAC1C,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GAC1B,EACF,MAAC,KAAK,IAAC,YAAY,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,aACnC,KAAC,QAAQ,IAAC,SAAS,EAAC,MAAM,GAAG,EAEzB,SAAS,CAAC,CAAC;gCACP,cAAK,SAAS,EAAC,4BAA4B,YACvC,KAAC,OAAO,KAAG,GACT,CAAC,CAAC;gCACR,cAAK,SAAS,EAAC,+CAA+C,YAC1D,KAAC,kBAAkB,cACf,KAAC,UAAU,KAAG,GACG,GACnB,IAEV,IAEgB,GACP,GACV,CACtB,CAAA;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionsView.js","sourceRoot":"","sources":["../../../../../src/features/store/collections/CollectionsView.tsx"],"names":[],"mappings":";AACA,OAAO,EACH,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EACjC,UAAU,EACV,YAAY,EACZ,WAAW,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,UAAU,eAAe,CAAC,EAAyB;IACrD,MAAM,OAAO,GAAG,CAAC,KAAC,sBAAsB,MAAK,QAAQ,CAAG,CAAC,CAAC;IAC1D,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