@vertesia/ui 0.65.0 → 0.67.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/features/agent/PayloadBuilder.js +27 -0
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +3 -3
- 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/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 +17 -16
- 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/layout/FullHeightLayout.js +2 -4
- package/lib/esm/layout/FullHeightLayout.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/features/agent/PayloadBuilder.d.ts +8 -1
- 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-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.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 +4 -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/features/agent/PayloadBuilder.tsx +34 -1
- package/src/features/agent/chat/ModernAgentConversation.tsx +639 -639
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +12 -13
- 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/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 +38 -98
- 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/layout/FullHeightLayout.tsx +2 -2
- 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,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { Button, useToast } from '@vertesia/ui/core';
|
|
4
|
-
import { FullHeightLayout } from '@vertesia/ui/layout';
|
|
5
|
-
import { useUserSession } from '@vertesia/ui/session';
|
|
6
|
-
import { GenericPageNavHeader } from "../../layout";
|
|
7
|
-
import { ContentObjectTypesSearch } from './ContentObjectTypesSearch';
|
|
8
|
-
import { ObjectTypeSearchProvider } from './search/ObjectTypeSearchProvider';
|
|
9
|
-
import { CreateOrUpdateTypeModal } from './CreateOrUpdateTypeModal';
|
|
10
|
-
export var ChunkableOptions;
|
|
11
|
-
(function (ChunkableOptions) {
|
|
12
|
-
ChunkableOptions["true"] = "Yes";
|
|
13
|
-
ChunkableOptions["false"] = "No";
|
|
14
|
-
})(ChunkableOptions || (ChunkableOptions = {}));
|
|
15
|
-
;
|
|
16
|
-
export function ContentObjectTypesView({}) {
|
|
17
|
-
const toast = useToast();
|
|
18
|
-
const [showCreateModal, setShowCreateModal] = useState(false);
|
|
19
|
-
const session = useUserSession();
|
|
20
|
-
const { store } = session;
|
|
21
|
-
const actions = _jsx(Button, { variant: "primary", onClick: () => setShowCreateModal(true), children: "Create Type" }, "create");
|
|
22
|
-
const [isDirty, setIsDirty] = useState(false);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (isDirty) {
|
|
25
|
-
setIsDirty(false);
|
|
26
|
-
}
|
|
27
|
-
}, [isDirty]);
|
|
28
|
-
const onCloseCreateModal = async (payload) => {
|
|
29
|
-
if (!payload) {
|
|
30
|
-
setShowCreateModal(false);
|
|
31
|
-
return Promise.resolve();
|
|
32
|
-
}
|
|
33
|
-
return store.types.create(payload).then(async () => {
|
|
34
|
-
toast({
|
|
35
|
-
status: 'success',
|
|
36
|
-
title: 'Type created',
|
|
37
|
-
duration: 2000
|
|
38
|
-
});
|
|
39
|
-
session.reloadTypes();
|
|
40
|
-
setIsDirty(true);
|
|
41
|
-
}).catch(err => {
|
|
42
|
-
toast({
|
|
43
|
-
status: 'error',
|
|
44
|
-
title: 'Error creating type',
|
|
45
|
-
description: err.message,
|
|
46
|
-
duration: 5000
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
const breadcrumbs = [
|
|
51
|
-
_jsx("span", { children: "Content Type" }, '0')
|
|
52
|
-
];
|
|
53
|
-
return (_jsxs(FullHeightLayout, { children: [_jsx(GenericPageNavHeader, { actions: actions, breadcrumbs: breadcrumbs, title: "Content Types" }), _jsx(CreateOrUpdateTypeModal, { okLabel: "Create", title: "Create Type", isOpen: showCreateModal, onClose: onCloseCreateModal }), _jsx(ObjectTypeSearchProvider, { children: _jsx(FullHeightLayout.Body, { children: _jsx(ContentObjectTypesSearch, { isDirty: isDirty }) }) })] }));
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=ContentObjectTypesView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentObjectTypesView.js","sourceRoot":"","sources":["../../../../../src/features/store/types/ContentObjectTypesView.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Collection, FacetSpec } from "@vertesia/common";
|
|
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
|
-
|
|
13
|
-
const facets: FacetSpec[] = [
|
|
14
|
-
{
|
|
15
|
-
name: 'status',
|
|
16
|
-
field: 'status'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'type',
|
|
20
|
-
field: 'type'
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
interface CollectionViewProps {
|
|
26
|
-
collectionId: string;
|
|
27
|
-
}
|
|
28
|
-
export function CollectionView({ collectionId }: CollectionViewProps) {
|
|
29
|
-
const { client } = useUserSession();
|
|
30
|
-
|
|
31
|
-
const { data: collection, error, refetch, isLoading } = useFetch(() => client.store.collections.retrieve(collectionId), [collectionId]);
|
|
32
|
-
|
|
33
|
-
if (error) {
|
|
34
|
-
return <ErrorBox title='Collection fetch failed'>{error.message}</ErrorBox>
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const actions = [
|
|
38
|
-
<SelectionActions key='selection' />,
|
|
39
|
-
<UploadObjectsButton key="upload" collectionId={collectionId ?? ''} />
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
const title = (
|
|
43
|
-
<div className='flex gap-x-1 items-center'>
|
|
44
|
-
<div>{collection?.name || ''}</div>
|
|
45
|
-
</div>
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
const breadcrumbs = [
|
|
49
|
-
<NavLink href='/collections' key='collections'>Collections</NavLink>,
|
|
50
|
-
<span key='collection-detail'>Collection Detail</span>
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
const tabs = [
|
|
54
|
-
{
|
|
55
|
-
name: 'browse',
|
|
56
|
-
label: 'Browse',
|
|
57
|
-
content: <BrowseCollectionView collection={collection as Collection} />
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'metadata',
|
|
61
|
-
label: 'Metadata',
|
|
62
|
-
content: <EditCollectionView collection={collection as Collection} refetch={refetch} />
|
|
63
|
-
}
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<FullHeightLayout>
|
|
68
|
-
<DocumentSearchProvider facets={facets} collectionId={collectionId}>
|
|
69
|
-
<DocumentSelectionProvider collectionId={collectionId}>
|
|
70
|
-
<GenericPageNavHeader title={title}
|
|
71
|
-
description={collection?.description || ''}
|
|
72
|
-
actions={actions}
|
|
73
|
-
breadcrumbs={breadcrumbs}
|
|
74
|
-
/>
|
|
75
|
-
<VTabs defaultValue="browse" tabs={tabs}>
|
|
76
|
-
<VTabsBar className="px-4" />
|
|
77
|
-
{
|
|
78
|
-
isLoading ?
|
|
79
|
-
<div className="w-full flex justify-center">
|
|
80
|
-
<Spinner />
|
|
81
|
-
</div> :
|
|
82
|
-
<div className="h-[calc(100vh-165px)] overflow-auto px-4 py-2">
|
|
83
|
-
<PanelErrorBoundary>
|
|
84
|
-
<VTabsPanel />
|
|
85
|
-
</PanelErrorBoundary>
|
|
86
|
-
</div>
|
|
87
|
-
}
|
|
88
|
-
</VTabs>
|
|
89
|
-
|
|
90
|
-
</DocumentSelectionProvider>
|
|
91
|
-
</DocumentSearchProvider>
|
|
92
|
-
</FullHeightLayout>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import LocalizedFormat from 'dayjs/plugin/localizedFormat';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { ColumnLayout, ContentObjectType } from '@vertesia/common';
|
|
6
|
-
import { Button, Center, ErrorBox, Popover, PopoverContent, PopoverTrigger, Spinner, Switch, Tab, Tabs, TabsBar, TabsPanel, useFetch, useToast } from '@vertesia/ui/core';
|
|
7
|
-
import { FullHeightLayout } from '@vertesia/ui/layout';
|
|
8
|
-
import { useLocation, useNavigate } from "@vertesia/ui/router";
|
|
9
|
-
import { useUserSession } from '@vertesia/ui/session';
|
|
10
|
-
import { PropertiesView } from '@vertesia/ui/widgets';
|
|
11
|
-
import { EllipsisVertical, SquarePen, Trash2 } from 'lucide-react';
|
|
12
|
-
import { GenericPageNavHeader } from "../../layout";
|
|
13
|
-
import { UserInfo } from '../../user/UserInfo';
|
|
14
|
-
|
|
15
|
-
import { CreateOrUpdateTypeModal, CreateOrUpdateTypePayload } from './CreateOrUpdateTypeModal';
|
|
16
|
-
import { ObjectSchemaEditor } from './ObjectSchemaEditor';
|
|
17
|
-
import { TableLayoutEditor } from './TableLayoutEditor';
|
|
18
|
-
|
|
19
|
-
dayjs.extend(LocalizedFormat)
|
|
20
|
-
|
|
21
|
-
interface ContentObjectTypeViewProps {
|
|
22
|
-
typeId: string;
|
|
23
|
-
}
|
|
24
|
-
export function ContentObjectTypeView({ typeId }: ContentObjectTypeViewProps) {
|
|
25
|
-
const { store, user } = useUserSession();
|
|
26
|
-
const { hash } = useLocation();
|
|
27
|
-
const currentTab = hash ? hash.substring(1) : undefined;
|
|
28
|
-
|
|
29
|
-
let { data: objectType, isLoading, error, refetch } = useFetch(() => {
|
|
30
|
-
if (user) {
|
|
31
|
-
return store.types.retrieve(typeId);
|
|
32
|
-
} else {
|
|
33
|
-
return Promise.resolve(undefined);
|
|
34
|
-
}
|
|
35
|
-
}, [user]);
|
|
36
|
-
|
|
37
|
-
if (error) {
|
|
38
|
-
return <ErrorBox title="Error">{error.message}</ErrorBox>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (isLoading) {
|
|
42
|
-
return <Center className="py-10"><Spinner size='lg' /></Center>
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!objectType) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const actions = [
|
|
50
|
-
<DeleteTypeButton key="delete" objectType={objectType} />
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
const onSchemaUpdate = (value: any) => {
|
|
54
|
-
objectType.object_schema = value.schema;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const onLayoutUpdate = (value: ColumnLayout[] | undefined) => {
|
|
58
|
-
objectType.table_layout = value;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const tabs: Tab[] = [
|
|
62
|
-
{ name: 'metadata', label: "Metadata", href: "#metadata", content: <MetadataView objectType={objectType} /> },
|
|
63
|
-
{ name: 'schema', label: "Object Schema", href: "#schema", content: <ObjectSchemaEditor objectType={objectType} onSchemaUpdate={onSchemaUpdate} /> },
|
|
64
|
-
{ name: 'layout', label: "Table Layout", href: "#layout", content: <TableLayoutEditor objectType={objectType} onLayoutUpdate={onLayoutUpdate} /> },
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
const breadcrumbs = [breadcrumb()];
|
|
68
|
-
const title = pageTitle(objectType, refetch);
|
|
69
|
-
const description = objectType.description;
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<FullHeightLayout>
|
|
73
|
-
<GenericPageNavHeader title={title} description={description} actions={[actions]} breadcrumbs={breadcrumbs} />
|
|
74
|
-
<Tabs tabs={tabs} current={currentTab}>
|
|
75
|
-
<TabsBar />
|
|
76
|
-
<FullHeightLayout.Body>
|
|
77
|
-
<div className="h-[calc(100vh-187px)] overflow-auto">
|
|
78
|
-
<TabsPanel />
|
|
79
|
-
</div>
|
|
80
|
-
</FullHeightLayout.Body>
|
|
81
|
-
</Tabs>
|
|
82
|
-
</FullHeightLayout>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function breadcrumb() {
|
|
87
|
-
return <span>Content Type</span>
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function pageTitle(objectType: ContentObjectType, refetch: () => Promise<unknown>) {
|
|
91
|
-
return <PageTitle objectType={objectType} refetch={refetch} />
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function PageTitle({ objectType, refetch }: { objectType: ContentObjectType, refetch: () => Promise<unknown> }) {
|
|
95
|
-
const toast = useToast();
|
|
96
|
-
const session = useUserSession();
|
|
97
|
-
const { store } = session;
|
|
98
|
-
const [showEditModal, setShowEditModal] = useState(false);
|
|
99
|
-
const onCloseEditModal = (payload?: CreateOrUpdateTypePayload) => {
|
|
100
|
-
if (!payload) {
|
|
101
|
-
setShowEditModal(false);
|
|
102
|
-
return Promise.resolve();
|
|
103
|
-
}
|
|
104
|
-
return store.types.update(objectType.id, payload).then(() => {
|
|
105
|
-
toast({
|
|
106
|
-
status: 'success',
|
|
107
|
-
title: 'Type updated',
|
|
108
|
-
duration: 2000
|
|
109
|
-
});
|
|
110
|
-
return refetch().finally(() => session.reloadTypes());
|
|
111
|
-
}).catch(err => {
|
|
112
|
-
toast({
|
|
113
|
-
status: 'error',
|
|
114
|
-
title: 'Error updating type',
|
|
115
|
-
description: err.message,
|
|
116
|
-
duration: 5000
|
|
117
|
-
})
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return <>
|
|
121
|
-
<div className='flex items-center gap-x-2'>{objectType.name} <Button variant="ghost" size="sm" title="Edit" onClick={() => setShowEditModal(true)}><SquarePen className="size-4" /></Button></div>
|
|
122
|
-
<CreateOrUpdateTypeModal okLabel="Save Changes" title="Edit Type" isOpen={showEditModal} onClose={onCloseEditModal} initialPayload={objectType} />
|
|
123
|
-
</>
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
interface MetadataViewProps {
|
|
127
|
-
objectType: ContentObjectType;
|
|
128
|
-
}
|
|
129
|
-
function MetadataView({ objectType }: MetadataViewProps) {
|
|
130
|
-
return (
|
|
131
|
-
<PropertiesView className='w-full' properties={[
|
|
132
|
-
{ name: "Id", value: objectType.id },
|
|
133
|
-
{ name: "Name", value: objectType.name },
|
|
134
|
-
{ name: "Is Chunkable", value: <ChunkableSwitch objectType={objectType} /> },
|
|
135
|
-
{ name: "Strict Mode", value: <StrictModeSwitch objectType={objectType} /> },
|
|
136
|
-
{ name: 'Created By', value: <UserInfo userRef={objectType.created_by} /> },
|
|
137
|
-
{ name: 'Created At', value: dayjs(objectType.created_at).format('LLL') },
|
|
138
|
-
{ name: 'Updated By', value: <UserInfo userRef={objectType.updated_by} /> },
|
|
139
|
-
{ name: 'Updated At', value: dayjs(objectType.updated_at).format('LLL') },
|
|
140
|
-
]}
|
|
141
|
-
/>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
interface TypeSwitchProps {
|
|
147
|
-
objectType: ContentObjectType;
|
|
148
|
-
field: 'is_chunkable' | 'strict_mode';
|
|
149
|
-
initialValue?: boolean;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function TypeSwitch({ objectType, field, initialValue }: TypeSwitchProps) {
|
|
153
|
-
const [value, setValue] = useState(initialValue ?? false);
|
|
154
|
-
const toast = useToast();
|
|
155
|
-
const { store } = useUserSession();
|
|
156
|
-
|
|
157
|
-
const onChange = (value: boolean) => {
|
|
158
|
-
store.types.update(objectType.id, {
|
|
159
|
-
[field]: value
|
|
160
|
-
}).then(() => {
|
|
161
|
-
setValue(value);
|
|
162
|
-
toast({
|
|
163
|
-
status: 'success',
|
|
164
|
-
title: 'Successfully Updated.',
|
|
165
|
-
duration: 2000
|
|
166
|
-
})
|
|
167
|
-
}).catch((err) => {
|
|
168
|
-
toast({
|
|
169
|
-
status: 'error',
|
|
170
|
-
title: 'Failed to update.',
|
|
171
|
-
description: err.message,
|
|
172
|
-
duration: 5000
|
|
173
|
-
})
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
<Switch value={value} onChange={onChange} />
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
interface ChunkableSwitchProps {
|
|
183
|
-
objectType: ContentObjectType;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function ChunkableSwitch({ objectType }: ChunkableSwitchProps) {
|
|
187
|
-
return (
|
|
188
|
-
<TypeSwitch objectType={objectType} field="is_chunkable" initialValue={objectType.is_chunkable ?? false} />
|
|
189
|
-
)
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
interface StrictModeSwitchProps {
|
|
193
|
-
objectType: ContentObjectType;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function StrictModeSwitch({ objectType }: StrictModeSwitchProps) {
|
|
197
|
-
return (
|
|
198
|
-
<TypeSwitch objectType={objectType} field="strict_mode" initialValue={objectType.strict_mode ?? false} />
|
|
199
|
-
)
|
|
200
|
-
}
|
|
201
|
-
interface DeleteTypeButtonProps {
|
|
202
|
-
objectType: ContentObjectType;
|
|
203
|
-
}
|
|
204
|
-
function DeleteTypeButton({ objectType }: DeleteTypeButtonProps) {
|
|
205
|
-
const toast = useToast();
|
|
206
|
-
const navigate = useNavigate();
|
|
207
|
-
const { store } = useUserSession();
|
|
208
|
-
const onDelete = () => {
|
|
209
|
-
confirm('Are you sure you want to delete this rule?') &&
|
|
210
|
-
store.types.delete(objectType.id).then(() => {
|
|
211
|
-
toast({
|
|
212
|
-
status: 'success',
|
|
213
|
-
title: `Object type ${objectType.name} deleted`,
|
|
214
|
-
duration: 2000
|
|
215
|
-
});
|
|
216
|
-
navigate('/types');
|
|
217
|
-
}).catch(err => {
|
|
218
|
-
toast(
|
|
219
|
-
{
|
|
220
|
-
status: 'error',
|
|
221
|
-
title: 'Failed to delete rule',
|
|
222
|
-
description: err.message,
|
|
223
|
-
duration: 5000
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
})
|
|
227
|
-
}
|
|
228
|
-
return (
|
|
229
|
-
<Popover hover>
|
|
230
|
-
<PopoverTrigger>
|
|
231
|
-
<div className='cursor-pointer hover:bg-muted p-2 rounded-md'>
|
|
232
|
-
<Button variant="ghost" size='sm' title='More actions'><EllipsisVertical /></Button>
|
|
233
|
-
</div>
|
|
234
|
-
</PopoverTrigger >
|
|
235
|
-
<PopoverContent className='p-0 w-35' align='end'>
|
|
236
|
-
<div className="py-2 px-1.5 flex justify-center w-full">
|
|
237
|
-
<Button variant="ghost" onClick={onDelete} className='w-full'>
|
|
238
|
-
<Trash2 className='size-4' /> Delete
|
|
239
|
-
</Button>
|
|
240
|
-
</div>
|
|
241
|
-
</PopoverContent>
|
|
242
|
-
</Popover >
|
|
243
|
-
)
|
|
244
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button, useToast } from '@vertesia/ui/core';
|
|
4
|
-
import { FullHeightLayout } from '@vertesia/ui/layout';
|
|
5
|
-
import { useUserSession } from '@vertesia/ui/session';
|
|
6
|
-
import { GenericPageNavHeader } from "../../layout";
|
|
7
|
-
import { ContentObjectTypesSearch } from './ContentObjectTypesSearch';
|
|
8
|
-
import { ObjectTypeSearchProvider } from './search/ObjectTypeSearchProvider';
|
|
9
|
-
|
|
10
|
-
import { CreateOrUpdateTypeModal, CreateOrUpdateTypePayload } from './CreateOrUpdateTypeModal';
|
|
11
|
-
|
|
12
|
-
export enum ChunkableOptions {
|
|
13
|
-
true = "Yes",
|
|
14
|
-
false = "No"
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
interface ContentObjectTypesViewProps { }
|
|
18
|
-
export function ContentObjectTypesView({ }: ContentObjectTypesViewProps) {
|
|
19
|
-
const toast = useToast();
|
|
20
|
-
const [showCreateModal, setShowCreateModal] = useState(false);
|
|
21
|
-
const session = useUserSession();
|
|
22
|
-
const { store } = session;
|
|
23
|
-
|
|
24
|
-
const actions = <Button key="create" variant="primary" onClick={() => setShowCreateModal(true)}>Create Type</Button>;
|
|
25
|
-
|
|
26
|
-
const [isDirty, setIsDirty] = useState(false);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (isDirty) {
|
|
29
|
-
setIsDirty(false);
|
|
30
|
-
}
|
|
31
|
-
}, [isDirty]);
|
|
32
|
-
|
|
33
|
-
const onCloseCreateModal = async (payload?: CreateOrUpdateTypePayload) => {
|
|
34
|
-
if (!payload) {
|
|
35
|
-
setShowCreateModal(false);
|
|
36
|
-
return Promise.resolve();
|
|
37
|
-
}
|
|
38
|
-
return store.types.create(payload).then(async () => {
|
|
39
|
-
toast({
|
|
40
|
-
status: 'success',
|
|
41
|
-
title: 'Type created',
|
|
42
|
-
duration: 2000
|
|
43
|
-
});
|
|
44
|
-
session.reloadTypes();
|
|
45
|
-
setIsDirty(true);
|
|
46
|
-
}).catch(err => {
|
|
47
|
-
toast({
|
|
48
|
-
status: 'error',
|
|
49
|
-
title: 'Error creating type',
|
|
50
|
-
description: err.message,
|
|
51
|
-
duration: 5000
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const breadcrumbs = [
|
|
57
|
-
<span key='0'>Content Type</span>
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<FullHeightLayout>
|
|
62
|
-
<GenericPageNavHeader actions={actions} breadcrumbs={breadcrumbs} title="Content Types" />
|
|
63
|
-
<CreateOrUpdateTypeModal okLabel="Create" title="Create Type" isOpen={showCreateModal} onClose={onCloseCreateModal} />
|
|
64
|
-
<ObjectTypeSearchProvider>
|
|
65
|
-
<FullHeightLayout.Body>
|
|
66
|
-
<ContentObjectTypesSearch isDirty={isDirty}></ContentObjectTypesSearch>
|
|
67
|
-
</FullHeightLayout.Body>
|
|
68
|
-
</ObjectTypeSearchProvider>
|
|
69
|
-
</FullHeightLayout>
|
|
70
|
-
);
|
|
71
|
-
}
|