@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,8 +1,9 @@
|
|
|
1
1
|
import { AsyncExecutionResult, VertesiaClient } from "@vertesia/client";
|
|
2
|
-
import { ExecutionEnvironmentRef, Interaction,
|
|
2
|
+
import { ExecutionEnvironmentRef, Interaction, mergePromptsSchema, PopulatedInteraction, supportsToolUse } from "@vertesia/common";
|
|
3
3
|
import { JSONObject } from "@vertesia/json";
|
|
4
4
|
import { useUserSession } from "@vertesia/ui/session";
|
|
5
5
|
import Ajv, { ValidateFunction } from "ajv";
|
|
6
|
+
import type { JSONSchema4 } from "json-schema";
|
|
6
7
|
import React, { createContext, useContext, useEffect, useState } from "react";
|
|
7
8
|
|
|
8
9
|
export interface ConversationWorkflowPayload {
|
|
@@ -15,13 +16,15 @@ export interface ConversationWorkflowPayload {
|
|
|
15
16
|
|
|
16
17
|
export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
17
18
|
_interactive: boolean = true;
|
|
19
|
+
_debug_mode: boolean = false;
|
|
20
|
+
_collection: string | undefined;
|
|
18
21
|
_start: boolean = false;
|
|
19
22
|
|
|
20
23
|
payload: ConversationWorkflowPayload;
|
|
21
|
-
|
|
24
|
+
private _interactionParamsSchema?: JSONSchema4 | null;
|
|
22
25
|
private _inputValidator?: {
|
|
23
26
|
validate: ValidateFunction;
|
|
24
|
-
schema:
|
|
27
|
+
schema: JSONSchema4;
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
constructor(public vertesia: VertesiaClient, public updateState: (data: PayloadBuilder) => void) {
|
|
@@ -32,22 +35,26 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
onStateChanged() {
|
|
35
|
-
this.
|
|
38
|
+
const newInstance = this.clone();
|
|
39
|
+
this.updateState(newInstance);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
clone() {
|
|
39
43
|
const builder = new PayloadBuilder(this.vertesia, this.updateState);
|
|
40
|
-
builder.
|
|
44
|
+
builder._interactionParamsSchema = this._interactionParamsSchema;
|
|
41
45
|
builder.payload = this.payload;
|
|
42
46
|
builder._interactive = this._interactive;
|
|
47
|
+
builder._debug_mode = this._debug_mode;
|
|
43
48
|
builder._inputValidator = this._inputValidator;
|
|
44
49
|
builder._start = this._start;
|
|
50
|
+
builder._collection = this._collection;
|
|
45
51
|
return builder;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
get interactive() {
|
|
49
55
|
return this._interactive;
|
|
50
56
|
}
|
|
57
|
+
|
|
51
58
|
set interactive(interactive: boolean) {
|
|
52
59
|
if (interactive !== this._interactive) {
|
|
53
60
|
this._interactive = interactive;
|
|
@@ -55,21 +62,42 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
55
62
|
}
|
|
56
63
|
}
|
|
57
64
|
|
|
65
|
+
get debug_mode() {
|
|
66
|
+
return this._debug_mode;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set debug_mode(debug_mode: boolean) {
|
|
70
|
+
if (debug_mode !== this._debug_mode) {
|
|
71
|
+
this._debug_mode = debug_mode;
|
|
72
|
+
this.onStateChanged();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get collection() {
|
|
77
|
+
return this._collection;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
set collection(collection: string | undefined) {
|
|
81
|
+
if (collection !== this._collection) {
|
|
82
|
+
this._collection = collection;
|
|
83
|
+
this.onStateChanged();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get search_scope() {
|
|
88
|
+
return this._collection ? "collection" : undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
58
91
|
get interaction() {
|
|
59
92
|
return this.payload.interaction;
|
|
60
93
|
}
|
|
61
94
|
set interaction(interaction: Interaction | undefined) {
|
|
62
95
|
if (interaction?.id !== this.payload.interaction?.id) {
|
|
63
96
|
this.payload.interaction = interaction;
|
|
64
|
-
this.
|
|
97
|
+
this._interactionParamsSchema = mergePromptsSchema(this.interaction as PopulatedInteraction) as JSONSchema4;
|
|
65
98
|
// Reset the validator when schema changes
|
|
66
99
|
this._inputValidator = undefined;
|
|
67
100
|
if (interaction) {
|
|
68
|
-
if (interaction.model) {
|
|
69
|
-
this.payload.model = interaction.model;
|
|
70
|
-
} else {
|
|
71
|
-
this.payload.model = undefined;
|
|
72
|
-
}
|
|
73
101
|
if (interaction.environment) {
|
|
74
102
|
if (typeof interaction.environment === 'string') {
|
|
75
103
|
this.vertesia.environments.retrieve(interaction.environment).then((environment) => this.environment = environment);
|
|
@@ -77,6 +105,12 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
77
105
|
this.payload.environment = interaction.environment;
|
|
78
106
|
}
|
|
79
107
|
}
|
|
108
|
+
if (interaction.model) {
|
|
109
|
+
this.payload.model = interaction.model;
|
|
110
|
+
} else {
|
|
111
|
+
this.payload.model = this.environment?.default_model && supportsToolUse(this.environment.default_model, this.environment.provider)
|
|
112
|
+
? this.environment.default_model : undefined;
|
|
113
|
+
}
|
|
80
114
|
}
|
|
81
115
|
this.onStateChanged();
|
|
82
116
|
}
|
|
@@ -88,6 +122,9 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
88
122
|
set environment(environment: ExecutionEnvironmentRef | undefined) {
|
|
89
123
|
if (environment?.id !== this.payload.environment?.id) {
|
|
90
124
|
this.payload.environment = environment;
|
|
125
|
+
this.payload.model = environment?.default_model && supportsToolUse(environment.default_model, environment.provider)
|
|
126
|
+
? environment.default_model : undefined;
|
|
127
|
+
|
|
91
128
|
this.onStateChanged();
|
|
92
129
|
}
|
|
93
130
|
}
|
|
@@ -134,9 +171,22 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
134
171
|
return this._start;
|
|
135
172
|
}
|
|
136
173
|
|
|
174
|
+
get interactionParamsSchema(): JSONSchema4 | null | undefined {
|
|
175
|
+
return this._interactionParamsSchema;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
set interactionParamsSchema(schema: JSONSchema4 | null | undefined) {
|
|
179
|
+
if (this._interactionParamsSchema !== schema) {
|
|
180
|
+
this._interactionParamsSchema = schema;
|
|
181
|
+
this.onStateChanged();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
137
185
|
reset() {
|
|
138
186
|
this._start = false;
|
|
139
187
|
this._interactive = true;
|
|
188
|
+
this._debug_mode = false;
|
|
189
|
+
this._collection = undefined;
|
|
140
190
|
this.payload = {
|
|
141
191
|
model: '',
|
|
142
192
|
tools: [],
|
|
@@ -144,7 +194,7 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
144
194
|
environment: undefined,
|
|
145
195
|
prompt_data: undefined
|
|
146
196
|
};
|
|
147
|
-
this.
|
|
197
|
+
this._interactionParamsSchema = null;
|
|
148
198
|
this._inputValidator = undefined;
|
|
149
199
|
|
|
150
200
|
this.onStateChanged();
|
|
@@ -156,16 +206,16 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
|
|
|
156
206
|
}
|
|
157
207
|
|
|
158
208
|
validateInput(): { isValid: boolean; errorMessage?: string } {
|
|
159
|
-
if (!this.
|
|
209
|
+
if (!this._interactionParamsSchema) {
|
|
160
210
|
return { isValid: true };
|
|
161
211
|
}
|
|
162
212
|
|
|
163
213
|
// If schema has changed or validator not initialized, recompile
|
|
164
|
-
if (!this._inputValidator || this._inputValidator.schema !== this.
|
|
214
|
+
if (!this._inputValidator || this._inputValidator.schema !== this._interactionParamsSchema) {
|
|
165
215
|
const ajv = new Ajv({ strict: false });
|
|
166
216
|
this._inputValidator = {
|
|
167
|
-
validate: ajv.compile(this.
|
|
168
|
-
schema: this.
|
|
217
|
+
validate: ajv.compile(this._interactionParamsSchema),
|
|
218
|
+
schema: this._interactionParamsSchema
|
|
169
219
|
};
|
|
170
220
|
}
|
|
171
221
|
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
DownloadCloudIcon,
|
|
9
9
|
ExternalLink,
|
|
10
10
|
MoreVertical,
|
|
11
|
-
Plus,
|
|
12
11
|
XIcon,
|
|
13
12
|
} from "lucide-react";
|
|
14
13
|
import { PayloadBuilderProvider, usePayloadBuilder } from "../../PayloadBuilder";
|
|
@@ -148,11 +147,6 @@ function MoreDropdown({
|
|
|
148
147
|
}
|
|
149
148
|
};
|
|
150
149
|
|
|
151
|
-
const startNewAgent = () => {
|
|
152
|
-
builder.reset();
|
|
153
|
-
resetWorkflow?.();
|
|
154
|
-
}
|
|
155
|
-
|
|
156
150
|
const openUrl = (url: string) => {
|
|
157
151
|
window.open(url, "_blank");
|
|
158
152
|
return url;
|
|
@@ -215,11 +209,6 @@ function MoreDropdown({
|
|
|
215
209
|
}}>
|
|
216
210
|
<XIcon className="size-3.5 mr-2 text-destructive" /> Cancel Workflow
|
|
217
211
|
</CommandItem>
|
|
218
|
-
{!isModal && (
|
|
219
|
-
<CommandItem className="text-xs" onSelect={startNewAgent}>
|
|
220
|
-
<Plus className="size-3.5 mr-2 text-muted" /> Start a new Agent
|
|
221
|
-
</CommandItem>
|
|
222
|
-
)}
|
|
223
212
|
</CommandGroup>
|
|
224
213
|
</CommandList>
|
|
225
214
|
</Command>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentMessage, AgentMessageType } from "@vertesia/common";
|
|
2
|
-
import { Button, useToast } from "@vertesia/ui/core";
|
|
2
|
+
import { Badge, Button, useToast } from "@vertesia/ui/core";
|
|
3
3
|
import { NavLink } from "@vertesia/ui/router";
|
|
4
4
|
import { useUserSession } from "@vertesia/ui/session";
|
|
5
5
|
import dayjs from "dayjs";
|
|
@@ -483,28 +483,27 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
483
483
|
<div className={showPulsatingCircle ? "animate-fadeIn" : ""}>
|
|
484
484
|
{getMessageIcon()}
|
|
485
485
|
</div>
|
|
486
|
-
<span className="text-xs font-medium text-
|
|
486
|
+
<span className="text-xs font-medium text-muted ">{messageStyles.sender}</span>
|
|
487
487
|
|
|
488
488
|
{/* Show workstream badge next to sender for better organization */}
|
|
489
489
|
{workstreamId !== "main" && workstreamId !== "all" && (
|
|
490
|
-
<
|
|
490
|
+
<Badge variant="default" className="text-xs text-muted">
|
|
491
491
|
{workstreamId}
|
|
492
|
-
</
|
|
492
|
+
</Badge>
|
|
493
493
|
)}
|
|
494
494
|
</div>
|
|
495
495
|
|
|
496
496
|
<div className="flex items-center gap-2">
|
|
497
|
-
<span className="text-xs text-
|
|
497
|
+
<span className="text-xs text-muted">
|
|
498
498
|
{dayjs(message.timestamp).format("HH:mm:ss")}
|
|
499
499
|
</span>
|
|
500
500
|
<Button
|
|
501
|
-
variant="ghost"
|
|
502
|
-
size="xs"
|
|
501
|
+
variant="ghost" size="xs"
|
|
503
502
|
onClick={copyToClipboard}
|
|
504
|
-
className="text-
|
|
503
|
+
className="text-muted"
|
|
505
504
|
title="Copy message"
|
|
506
505
|
>
|
|
507
|
-
<CopyIcon className="
|
|
506
|
+
<CopyIcon className="size-3" />
|
|
508
507
|
</Button>
|
|
509
508
|
</div>
|
|
510
509
|
</div>
|
|
@@ -529,7 +528,7 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
529
528
|
<div className="mt-2">
|
|
530
529
|
<button
|
|
531
530
|
onClick={() => setShowDetails(!showDetails)}
|
|
532
|
-
className="text-xs text-muted
|
|
531
|
+
className="text-xs text-muted flex items-center"
|
|
533
532
|
>
|
|
534
533
|
{showDetails ? "Hide" : "Show"} details
|
|
535
534
|
<svg
|
|
@@ -544,11 +543,11 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
544
543
|
</button>
|
|
545
544
|
|
|
546
545
|
{showDetails && (
|
|
547
|
-
<div className="mt-2 p-2 bg-
|
|
546
|
+
<div className="mt-2 p-2 bg-muted border border-mixer-muted/40 rounded text-sm">
|
|
548
547
|
{typeof message.details === "string" ? (
|
|
549
548
|
renderContent(message.details)
|
|
550
549
|
) : (
|
|
551
|
-
<pre className="text-xs font-mono whitespace-pre-wrap overflow-x-auto bg-
|
|
550
|
+
<pre className="text-xs font-mono whitespace-pre-wrap overflow-x-auto bg-muted p-2 rounded text-muted ">
|
|
552
551
|
{JSON.stringify(message.details, null, 2)}
|
|
553
552
|
</pre>
|
|
554
553
|
)}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FacetBucket } from '@vertesia/common';
|
|
2
|
+
import { FilterGroup } from '@vertesia/ui/core';
|
|
3
|
+
|
|
4
|
+
interface EnrichedFacetBucket extends FacetBucket {
|
|
5
|
+
name?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface EnvironmentFacetProps {
|
|
9
|
+
buckets: EnrichedFacetBucket[];
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function VEnvironmentFacet({ buckets, name }: EnvironmentFacetProps): FilterGroup {
|
|
14
|
+
const options = buckets.map((bucket) => ({
|
|
15
|
+
label: `(${bucket.count})`,
|
|
16
|
+
value: bucket._id
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const filterGroup: FilterGroup = {
|
|
20
|
+
name: name.charAt(0).toUpperCase() + name.slice(1),
|
|
21
|
+
options: options,
|
|
22
|
+
type: "select",
|
|
23
|
+
labelRenderer: (environmentId: string) => {
|
|
24
|
+
const bucket = buckets.find(b => b._id === environmentId);
|
|
25
|
+
const displayName = bucket?.name || environmentId;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className="w-full flex items-center">
|
|
29
|
+
<span className="text-sm truncate">{displayName}</span>
|
|
30
|
+
<span className="ml-2 text-xs">({bucket?.count || 0})</span>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
filterBy: (optionValue: string, searchText: string) => {
|
|
35
|
+
const bucket = buckets.find(b => b._id === optionValue);
|
|
36
|
+
const searchName = bucket?.name || optionValue;
|
|
37
|
+
return searchName.toLowerCase().includes(searchText.toLowerCase());
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return filterGroup;
|
|
42
|
+
}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { Filter as BaseFilter, FilterBar, FilterGroup } from '@vertesia/ui/core';
|
|
2
2
|
import { useUserSession } from '@vertesia/ui/session';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import { VEnvironmentFacet } from './VEnvironmentFacet';
|
|
5
|
+
import { VInteractionFacet } from './VInteractionFacet';
|
|
4
6
|
import { VStringFacet } from './VStringFacet';
|
|
5
7
|
import { VTypeFacet } from './VTypeFacet';
|
|
6
8
|
import { VUserFacet } from './VUserFacet';
|
|
7
9
|
|
|
10
|
+
export interface SearchInterface {
|
|
11
|
+
getFilterValue(name: string): any;
|
|
12
|
+
setFilterValue(name: string, value: any): void;
|
|
13
|
+
clearFilters(autoSearch?: boolean): void;
|
|
14
|
+
search(): Promise<boolean | undefined>;
|
|
15
|
+
readonly isRunning: boolean;
|
|
16
|
+
query: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
interface FacetsNavProps {
|
|
9
20
|
facets: any;
|
|
10
|
-
search:
|
|
21
|
+
search: SearchInterface;
|
|
11
22
|
textSearch?: string;
|
|
12
23
|
}
|
|
13
24
|
export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps) {
|
|
@@ -67,34 +78,77 @@ export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps)
|
|
|
67
78
|
customFilterGroups.push(initiatedByFilterGroup);
|
|
68
79
|
}
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
/** Run table */
|
|
82
|
+
if (facets.interactions) {
|
|
83
|
+
const interactionFilterGroup = VInteractionFacet({
|
|
84
|
+
buckets: facets.interactions || [],
|
|
85
|
+
name: 'interaction',
|
|
86
|
+
placeholder: 'Interactions',
|
|
76
87
|
});
|
|
88
|
+
customFilterGroups.push(interactionFilterGroup);
|
|
77
89
|
}
|
|
78
90
|
|
|
79
|
-
if (facets.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
if (facets.environments) {
|
|
92
|
+
const environmentFilterGroup = VEnvironmentFacet({
|
|
93
|
+
buckets: facets.environments || [],
|
|
94
|
+
name: 'Environments'
|
|
95
|
+
});
|
|
96
|
+
customFilterGroups.push(environmentFilterGroup);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (facets.models) {
|
|
100
|
+
const modelFilterGroup = VStringFacet({
|
|
101
|
+
search,
|
|
102
|
+
buckets: facets.models || [],
|
|
103
|
+
name: 'Model'
|
|
85
104
|
});
|
|
105
|
+
customFilterGroups.push(modelFilterGroup);
|
|
86
106
|
}
|
|
87
107
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
if (facets.statuses) {
|
|
109
|
+
const statusFilterGroup = VStringFacet({
|
|
110
|
+
search,
|
|
111
|
+
buckets: facets.statuses || [],
|
|
112
|
+
name: 'Status'
|
|
113
|
+
});
|
|
114
|
+
customFilterGroups.push(statusFilterGroup);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (facets.finish_reason) {
|
|
118
|
+
const processedFinishReason = facets.finish_reason.map((bucket: any) => ({
|
|
119
|
+
...bucket,
|
|
120
|
+
_id: bucket._id === null ? 'none' : bucket._id
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
const finishReasonFilterGroup = VStringFacet({
|
|
124
|
+
search,
|
|
125
|
+
buckets: processedFinishReason,
|
|
126
|
+
name: 'finish_reason',
|
|
127
|
+
placeholder: 'Finish Reason'
|
|
128
|
+
});
|
|
129
|
+
customFilterGroups.push(finishReasonFilterGroup);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (facets.created_by) {
|
|
133
|
+
const createdByFilterGroup = VUserFacet({
|
|
134
|
+
buckets: facets.created_by || [],
|
|
135
|
+
name: 'created_by',
|
|
136
|
+
placeholder: 'Created By'
|
|
137
|
+
});
|
|
138
|
+
customFilterGroups.push(createdByFilterGroup);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (facets.tags) {
|
|
142
|
+
customFilterGroups.push({
|
|
143
|
+
name: 'Tags',
|
|
144
|
+
type: 'stringList',
|
|
145
|
+
options: facets.tags.map((tag: string) => ({
|
|
146
|
+
label: tag,
|
|
147
|
+
value: tag
|
|
148
|
+
}))
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** Run table */
|
|
98
152
|
|
|
99
153
|
const handleFilterChange: React.Dispatch<React.SetStateAction<BaseFilter[]>> = (value) => {
|
|
100
154
|
|
|
@@ -106,21 +160,25 @@ export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps)
|
|
|
106
160
|
}
|
|
107
161
|
setFilters(newFilters);
|
|
108
162
|
|
|
163
|
+
// Reset the actual query before reapplying filters. Otherwise the removed filters remain.
|
|
164
|
+
search.clearFilters(false);
|
|
165
|
+
|
|
109
166
|
newFilters.forEach(filter => {
|
|
110
167
|
if (filter.value && filter.value.length > 0) {
|
|
111
168
|
const filterName = filter.name.toLowerCase();
|
|
112
|
-
const filterValue = filter.
|
|
169
|
+
const filterValue = filter.type === 'stringList'
|
|
170
|
+
? filter.value.map(v => typeof v === 'string' ? v : v.value)
|
|
171
|
+
: Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object'
|
|
172
|
+
? filter.value[0].value
|
|
173
|
+
: filter.value;
|
|
113
174
|
|
|
114
|
-
// Map filter names to the expected field names
|
|
115
175
|
switch (filterName) {
|
|
116
176
|
case 'name':
|
|
117
177
|
search.query.search_term = filterValue;
|
|
118
|
-
|
|
119
|
-
case 'user':
|
|
120
|
-
search.query.initiated_by = filterValue === 'Unknown User' ? 'unknown' : filterValue;
|
|
178
|
+
search.query.name = filterValue;
|
|
121
179
|
break;
|
|
122
180
|
default:
|
|
123
|
-
|
|
181
|
+
search.query[filterName] = filterValue;
|
|
124
182
|
break;
|
|
125
183
|
}
|
|
126
184
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { FacetBucket, InteractionStatus } from '@vertesia/common';
|
|
2
|
+
import { Badge, FilterGroup } from '@vertesia/ui/core';
|
|
3
|
+
|
|
4
|
+
interface EnrichedFacetBucket extends FacetBucket {
|
|
5
|
+
name?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface InteractionFacetProps {
|
|
11
|
+
buckets: EnrichedFacetBucket[];
|
|
12
|
+
name: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function VInteractionFacet({ buckets, name, placeholder }: InteractionFacetProps): FilterGroup {
|
|
17
|
+
const options = buckets.map((bucket) => ({
|
|
18
|
+
label: `(${bucket.count})`,
|
|
19
|
+
value: bucket._id
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
const filterGroup: FilterGroup = {
|
|
23
|
+
name: name,
|
|
24
|
+
placeholder: placeholder || `${name.charAt(0).toUpperCase() + name.slice(1)}`,
|
|
25
|
+
options: options,
|
|
26
|
+
type: "select",
|
|
27
|
+
labelRenderer: (interactionId: string) => {
|
|
28
|
+
const bucket = buckets.find(b => b._id === interactionId);
|
|
29
|
+
const displayName = bucket?.name || interactionId;
|
|
30
|
+
|
|
31
|
+
// Determine badge variant based on status
|
|
32
|
+
let badgeVariant: "success" | "attention" | "destructive" = "success";
|
|
33
|
+
if (bucket?.status) {
|
|
34
|
+
switch (bucket.status) {
|
|
35
|
+
case InteractionStatus.published:
|
|
36
|
+
badgeVariant = "success";
|
|
37
|
+
break;
|
|
38
|
+
case InteractionStatus.archived:
|
|
39
|
+
badgeVariant = "destructive";
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
badgeVariant = "attention";
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const badgeText = bucket?.version && bucket?.status ?
|
|
48
|
+
`v${bucket.version} ${bucket.status}` :
|
|
49
|
+
bucket?.status || (bucket?.version ? `v${bucket.version}` : '');
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div className="w-full flex items-center justify-between">
|
|
53
|
+
<div className="flex flex-row flex-wrap items-center gap-2 min-w-0 flex-1">
|
|
54
|
+
<span className="text-sm truncate">{displayName}</span>
|
|
55
|
+
{badgeText && (
|
|
56
|
+
<Badge variant={badgeVariant} className="text-xs w-fit">
|
|
57
|
+
{badgeText}
|
|
58
|
+
</Badge>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
<span className="ml-2 text-xs shrink-0">({bucket?.count || 0})</span>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
filterBy: (optionValue: string, searchText: string) => {
|
|
66
|
+
const bucket = buckets.find(b => b._id === optionValue);
|
|
67
|
+
const searchName = bucket?.name || optionValue;
|
|
68
|
+
return searchName.toLowerCase().includes(searchText.toLowerCase());
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return filterGroup;
|
|
73
|
+
}
|
|
@@ -5,30 +5,31 @@ import { FilterGroup } from '@vertesia/ui/core';
|
|
|
5
5
|
interface StringFacetProps {
|
|
6
6
|
buckets: FacetBucket[];
|
|
7
7
|
name: string;
|
|
8
|
+
placeholder?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export function createStringFilterGroup({ buckets, name }: StringFacetProps): FilterGroup {
|
|
11
|
+
export function createStringFilterGroup({ buckets, name, placeholder }: StringFacetProps): FilterGroup {
|
|
11
12
|
const options = buckets.map((bucket) => ({
|
|
12
13
|
label: facetOptionLabel(bucket),
|
|
13
14
|
value: bucket._id
|
|
14
15
|
}));
|
|
15
16
|
|
|
16
17
|
const filterGroup: FilterGroup = {
|
|
17
|
-
name: name
|
|
18
|
+
name: name,
|
|
18
19
|
options: options,
|
|
19
|
-
type: "select"
|
|
20
|
-
|
|
20
|
+
type: "select",
|
|
21
|
+
placeholder: `${placeholder ?? `${name.charAt(0).toUpperCase() + name.slice(1)}`}`,
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
return filterGroup;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export function VStringFacet({ buckets, name, }: {
|
|
27
|
+
export function VStringFacet({ buckets, name, placeholder}: {
|
|
27
28
|
search: any;
|
|
28
29
|
buckets: FacetBucket[];
|
|
29
30
|
name: string;
|
|
30
31
|
placeholder?: string;
|
|
31
32
|
className?: string;
|
|
32
33
|
}) {
|
|
33
|
-
return createStringFilterGroup({ buckets, name });
|
|
34
|
+
return createStringFilterGroup({ buckets, name, placeholder });
|
|
34
35
|
}
|
|
@@ -5,19 +5,20 @@ import { UserInfo } from '../user/UserInfo';
|
|
|
5
5
|
interface UserFacetProps {
|
|
6
6
|
buckets: FacetBucket[];
|
|
7
7
|
name: string;
|
|
8
|
+
placeholder?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export function createUserFilterGroup({ buckets, name }: UserFacetProps): FilterGroup {
|
|
11
|
+
export function createUserFilterGroup({ buckets, name, placeholder }: UserFacetProps): FilterGroup {
|
|
11
12
|
const options = buckets.map((bucket) => {
|
|
12
13
|
return {
|
|
13
14
|
value: bucket._id,
|
|
14
|
-
// Store the count for use in labelRenderer
|
|
15
15
|
label: `(${bucket.count})`
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const filterGroup: FilterGroup = {
|
|
20
|
-
name: name
|
|
20
|
+
name: name,
|
|
21
|
+
placeholder: placeholder || `${name.charAt(0).toUpperCase() + name.slice(1)}`,
|
|
21
22
|
options: options,
|
|
22
23
|
labelRenderer: (userRef: string) => {
|
|
23
24
|
const isUnknownUser = userRef === 'Unknown User' || !userRef;
|
|
@@ -36,12 +37,12 @@ export function createUserFilterGroup({ buckets, name }: UserFacetProps): Filter
|
|
|
36
37
|
<span className="text-muted-foreground ml-2">({bucket?.count || 0})</span>
|
|
37
38
|
</div>
|
|
38
39
|
);
|
|
39
|
-
}
|
|
40
|
+
},
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
return filterGroup;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export function VUserFacet({ buckets, name }: UserFacetProps) {
|
|
46
|
-
return createUserFilterGroup({ buckets, name });
|
|
46
|
+
export function VUserFacet({ buckets, name, placeholder }: UserFacetProps) {
|
|
47
|
+
return createUserFilterGroup({ buckets, name, placeholder });
|
|
47
48
|
}
|
|
@@ -40,7 +40,7 @@ export function GenericPageNavHeader({ className, children, title, description,
|
|
|
40
40
|
}
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
|
-
<div className="flex gap-x-
|
|
43
|
+
<div className="flex gap-x-2 shrink-0">{actions}</div>
|
|
44
44
|
</div>
|
|
45
45
|
{children && <div className="w-full flex items-center">{children}</div>}
|
|
46
46
|
</div>
|
|
@@ -83,14 +83,14 @@ function getBasePath(objectId: string) {
|
|
|
83
83
|
return `${ADVANCED_PROCESSING_PREFIX}/${objectId}`;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function getPageImagePath(objectId: string, pageNumber: number, ext = ".
|
|
86
|
+
function getPageImagePath(objectId: string, pageNumber: number, ext = ".jpg") {
|
|
87
87
|
return `${getBasePath(objectId)}/pages/page-${pageNumber}${ext}`;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
function getPageAnnotatedImagePath(
|
|
91
91
|
objectId: string,
|
|
92
92
|
pageNumber: number,
|
|
93
|
-
ext = ".
|
|
93
|
+
ext = ".jpg",
|
|
94
94
|
) {
|
|
95
95
|
return `${getBasePath(objectId)}/pages/page-${pageNumber}-annotated${ext}`;
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ function getPageAnnotatedImagePath(
|
|
|
98
98
|
function getPageInstrumentedImagePath(
|
|
99
99
|
objectId: string,
|
|
100
100
|
pageNumber: number,
|
|
101
|
-
ext = ".
|
|
101
|
+
ext = ".jpg",
|
|
102
102
|
) {
|
|
103
103
|
return `${getBasePath(objectId)}/pages/page-${pageNumber}.instrumented${ext}`;
|
|
104
104
|
}
|