@vertesia/ui 0.66.0 → 0.68.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/Badge.js +1 -1
- package/lib/esm/core/components/Badge.js.map +1 -1
- package/lib/esm/core/components/FormItem.js +2 -2
- package/lib/esm/core/components/FormItem.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/shadcn/checkbox.js +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
- package/lib/esm/core/components/shadcn/command.js +1 -1
- package/lib/esm/core/components/shadcn/command.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +6 -6
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js +129 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js +46 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js +23 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js +28 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js +5 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +101 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/{stringListFilter.js → filter/StringListFilter.js} +3 -3
- package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/{textFilter.js → filter/TextFilter.js} +4 -4
- package/lib/esm/core/components/shadcn/filters/filter/TextFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js +161 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js +88 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js +128 -87
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +7 -6
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/index.js +1 -1
- package/lib/esm/core/components/shadcn/filters/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
- package/lib/esm/core/components/toast/NotificationPanel.js +24 -18
- package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +47 -27
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +10 -4
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +7 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +13 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +2 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +10 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/esm/features/facets/DocumentsFacetsNav.js +133 -0
- package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/RunsFacetsNav.js +125 -0
- package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +4 -113
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/VStringFacet.js +6 -4
- package/lib/esm/features/facets/VStringFacet.js.map +1 -1
- package/lib/esm/features/facets/VTypeFacet.js +4 -5
- package/lib/esm/features/facets/VTypeFacet.js.map +1 -1
- package/lib/esm/features/facets/VUserFacet.js +1 -1
- package/lib/esm/features/facets/VUserFacet.js.map +1 -1
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js +98 -0
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/index.js +3 -2
- package/lib/esm/features/facets/index.js.map +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +10 -9
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +10 -9
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +0 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +37 -2
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +5 -6
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocument.js +2 -2
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +16 -4
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +72 -37
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +15 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +8 -8
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/layout/FullHeightLayout.js +2 -4
- package/lib/esm/layout/FullHeightLayout.js.map +1 -1
- package/lib/esm/router/HistoryNavigator.js +2 -2
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/shell/SplashScreen.js +19 -0
- package/lib/esm/shell/SplashScreen.js.map +1 -0
- package/lib/esm/shell/VertesiaShell.js +10 -0
- package/lib/esm/shell/VertesiaShell.js.map +1 -0
- package/lib/esm/shell/index.js +7 -0
- package/lib/esm/shell/index.js.map +1 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js +81 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -0
- package/lib/esm/shell/login/GitHubSignInButton.js +24 -0
- package/lib/esm/shell/login/GitHubSignInButton.js.map +1 -0
- package/lib/esm/shell/login/GoogleSignInButton.js +25 -0
- package/lib/esm/shell/login/GoogleSignInButton.js.map +1 -0
- package/lib/esm/shell/login/InviteAcceptModal.js +45 -0
- package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js +19 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js.map +1 -0
- package/lib/esm/shell/login/PreviewIcon.js +23 -0
- package/lib/esm/shell/login/PreviewIcon.js.map +1 -0
- package/lib/esm/shell/login/SignInModal.js +9 -0
- package/lib/esm/shell/login/SignInModal.js.map +1 -0
- package/lib/esm/shell/login/SigninScreen.js +64 -0
- package/lib/esm/shell/login/SigninScreen.js.map +1 -0
- package/lib/esm/shell/login/SignupForm.js +91 -0
- package/lib/esm/shell/login/SignupForm.js.map +1 -0
- package/lib/esm/shell/login/TerminalLogin.js +179 -0
- package/lib/esm/shell/login/TerminalLogin.js.map +1 -0
- package/lib/esm/shell/login/UserInfo.js +40 -0
- package/lib/esm/shell/login/UserInfo.js.map +1 -0
- package/lib/esm/shell/login/UserSessionMenu.js +31 -0
- package/lib/esm/shell/login/UserSessionMenu.js.map +1 -0
- package/lib/esm/shell/utils.js +6 -0
- package/lib/esm/shell/utils.js.map +1 -0
- package/lib/esm/widgets/SvgIcon.js +36 -0
- package/lib/esm/widgets/SvgIcon.js.map +1 -0
- package/lib/esm/widgets/index.js +7 -6
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/upload/UploadSummary.js +1 -1
- package/lib/esm/widgets/upload/UploadSummary.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/FormItem.d.ts +2 -1
- package/lib/types/core/components/shadcn/dialog.d.ts +2 -1
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts +8 -0
- package/lib/types/core/components/shadcn/filters/comboBox/StringListCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/TextCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/comboBox.d.ts +4 -0
- package/lib/types/core/components/shadcn/filters/{selectFilter.d.ts → filter/SelectFilter.d.ts} +2 -2
- package/lib/types/core/components/shadcn/filters/{stringListFilter.d.ts → filter/StringListFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/{textFilter.d.ts → filter/TextFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/{dateFilter.d.ts → filter/dateFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/filter-styles.d.ts +1 -0
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts +14 -4
- package/lib/types/core/components/shadcn/filters/index.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/types.d.ts +2 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +17 -8
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +2 -1
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts +16 -0
- package/lib/types/features/facets/RunsFacetsNav.d.ts +18 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +1 -1
- package/lib/types/features/facets/VStringFacet.d.ts +6 -2
- package/lib/types/features/facets/VTypeFacet.d.ts +3 -1
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts +13 -0
- package/lib/types/features/facets/index.d.ts +3 -2
- package/lib/types/shell/SplashScreen.d.ts +4 -0
- package/lib/types/shell/VertesiaShell.d.ts +7 -0
- package/lib/types/shell/index.d.ts +6 -0
- package/lib/types/shell/login/EnterpriseSigninButton.d.ts +5 -0
- package/lib/types/shell/login/GitHubSignInButton.d.ts +5 -0
- package/lib/types/shell/login/GoogleSignInButton.d.ts +5 -0
- package/lib/types/shell/login/InviteAcceptModal.d.ts +1 -0
- package/lib/types/shell/login/MicrosoftSigninButton.d.ts +5 -0
- package/lib/types/shell/login/PreviewIcon.d.ts +5 -0
- package/lib/types/shell/login/SignInModal.d.ts +6 -0
- package/lib/types/shell/login/SigninScreen.d.ts +8 -0
- package/lib/types/shell/login/SignupForm.d.ts +7 -0
- package/lib/types/shell/login/TerminalLogin.d.ts +1 -0
- package/lib/types/shell/login/UserInfo.d.ts +5 -0
- package/lib/types/shell/login/UserSessionMenu.d.ts +8 -0
- package/lib/types/shell/utils.d.ts +1 -0
- package/lib/types/widgets/SvgIcon.d.ts +6 -0
- package/lib/types/widgets/index.d.ts +7 -6
- 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-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-shell.js +2 -0
- package/lib/vertesia-ui-shell.js.map +1 -0
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +14 -6
- package/src/core/components/Badge.tsx +12 -8
- package/src/core/components/FormItem.tsx +4 -3
- package/src/core/components/InputList.tsx +21 -17
- package/src/core/components/shadcn/checkbox.tsx +2 -2
- package/src/core/components/shadcn/command.tsx +1 -1
- package/src/core/components/shadcn/dialog.tsx +18 -9
- package/src/core/components/shadcn/filters/DynamicLabel.tsx +1 -2
- package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +211 -0
- package/src/core/components/shadcn/filters/{comboBox.tsx → comboBox/SelectCombobox.tsx} +8 -192
- package/src/core/components/shadcn/filters/comboBox/StringListCombobox.tsx +76 -0
- package/src/core/components/shadcn/filters/comboBox/TextCombobox.tsx +81 -0
- package/src/core/components/shadcn/filters/comboBox/comboBox.tsx +4 -0
- package/src/core/components/shadcn/filters/filter/SelectFilter.tsx +161 -0
- package/src/core/components/shadcn/filters/{stringListFilter.tsx → filter/StringListFilter.tsx} +7 -7
- package/src/core/components/shadcn/filters/{textFilter.tsx → filter/TextFilter.tsx} +17 -11
- package/src/core/components/shadcn/filters/filter/dateFilter.tsx +256 -0
- package/src/core/components/shadcn/filters/filter-styles.ts +87 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +208 -152
- package/src/core/components/shadcn/filters/filters.tsx +7 -5
- package/src/core/components/shadcn/filters/index.ts +1 -1
- package/src/core/components/shadcn/filters/types.ts +2 -0
- package/src/core/components/toast/NotificationPanel.tsx +38 -22
- package/src/features/agent/PayloadBuilder.tsx +56 -31
- package/src/features/agent/chat/ModernAgentConversation.tsx +645 -639
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +7 -6
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +13 -2
- package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +2 -1
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +12 -4
- package/src/features/facets/DocumentsFacetsNav.tsx +171 -0
- package/src/features/facets/RunsFacetsNav.tsx +166 -0
- package/src/features/facets/VFacetsNav.tsx +10 -126
- package/src/features/facets/VStringFacet.tsx +10 -4
- package/src/features/facets/VTypeFacet.tsx +6 -5
- package/src/features/facets/VUserFacet.tsx +5 -3
- package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +132 -0
- package/src/features/facets/index.ts +5 -2
- package/src/features/store/collections/CollectionsTable.tsx +3 -2
- package/src/features/store/collections/CreateCollection.tsx +17 -15
- package/src/features/store/collections/EditCollectionView.tsx +19 -16
- package/src/features/store/collections/SelectCollection.tsx +1 -1
- package/src/features/store/objects/DocumentPreviewPanel.tsx +0 -1
- package/src/features/store/objects/DocumentSearchResults.tsx +80 -11
- package/src/features/store/objects/components/ContentOverview.tsx +7 -7
- package/src/features/store/objects/components/SelectDocument.tsx +2 -2
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +40 -19
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +160 -214
- package/src/features/store/types/ObjectSchemaEditor.tsx +15 -0
- package/src/features/user/UserInfo.tsx +17 -14
- package/src/layout/FullHeightLayout.tsx +2 -2
- package/src/router/HistoryNavigator.ts +2 -2
- package/src/shell/SplashScreen.tsx +41 -0
- package/src/shell/VertesiaShell.tsx +27 -0
- package/src/shell/index.tsx +6 -0
- package/src/shell/login/EnterpriseSigninButton.tsx +106 -0
- package/src/shell/login/GitHubSignInButton.tsx +40 -0
- package/src/shell/login/GoogleSignInButton.tsx +36 -0
- package/src/shell/login/InviteAcceptModal.tsx +78 -0
- package/src/shell/login/MicrosoftSigninButton.tsx +30 -0
- package/src/shell/login/PreviewIcon.tsx +29 -0
- package/src/shell/login/SignInModal.tsx +28 -0
- package/src/shell/login/SigninScreen.tsx +162 -0
- package/src/shell/login/SignupForm.tsx +178 -0
- package/src/shell/login/TerminalLogin.tsx +299 -0
- package/src/shell/login/UserInfo.tsx +76 -0
- package/src/shell/login/UserSessionMenu.tsx +81 -0
- package/src/shell/utils.tsx +7 -0
- package/src/widgets/SvgIcon.tsx +44 -0
- package/src/widgets/index.ts +7 -6
- package/src/widgets/upload/UploadSummary.tsx +3 -4
- package/lib/esm/core/components/shadcn/filters/comboBox.js +0 -101
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +0 -36
- package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +0 -67
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +0 -1
- package/lib/esm/features/facets/InteractionFacet.js +0 -39
- package/lib/esm/features/facets/InteractionFacet.js.map +0 -1
- package/lib/esm/features/facets/TypeOptions.js +0 -19
- package/lib/esm/features/facets/TypeOptions.js.map +0 -1
- package/lib/esm/features/facets/UserFacet.js +0 -33
- package/lib/esm/features/facets/UserFacet.js.map +0 -1
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +0 -22
- package/lib/types/features/facets/InteractionFacet.d.ts +0 -9
- package/lib/types/features/facets/TypeOptions.d.ts +0 -3
- package/lib/types/features/facets/UserFacet.d.ts +0 -11
- package/src/core/components/shadcn/filters/dateFilter.tsx +0 -82
- package/src/core/components/shadcn/filters/selectFilter.tsx +0 -110
- package/src/features/facets/InteractionFacet.tsx +0 -53
- package/src/features/facets/TypeOptions.tsx +0 -22
- package/src/features/facets/UserFacet.tsx +0 -61
|
@@ -3,7 +3,7 @@ import React, { useEffect, useMemo, useState } from "react";
|
|
|
3
3
|
import InlineSlidingPlanPanel from "./InlineSlidingPlanPanel";
|
|
4
4
|
import MessageItem from "./MessageItem";
|
|
5
5
|
import WorkstreamTabs, { extractWorkstreams, filterMessagesByWorkstream } from "./WorkstreamTabs";
|
|
6
|
-
import { getWorkstreamId } from "./utils";
|
|
6
|
+
import { DONE_STATES, getWorkstreamId } from "./utils";
|
|
7
7
|
|
|
8
8
|
interface AllMessagesMixedProps {
|
|
9
9
|
messages: AgentMessage[];
|
|
@@ -115,7 +115,8 @@ export default function AllMessagesMixed({
|
|
|
115
115
|
statusMap.set(workstreamId, [
|
|
116
116
|
AgentMessageType.COMPLETE,
|
|
117
117
|
AgentMessageType.IDLE,
|
|
118
|
-
AgentMessageType.REQUEST_INPUT
|
|
118
|
+
AgentMessageType.REQUEST_INPUT,
|
|
119
|
+
AgentMessageType.TERMINATED
|
|
119
120
|
].includes(lastMessage.type));
|
|
120
121
|
}
|
|
121
122
|
}
|
|
@@ -171,7 +172,7 @@ export default function AllMessagesMixed({
|
|
|
171
172
|
// Find if this is the latest non-completion message
|
|
172
173
|
const isLatestNonCompletionMessage = !isCompleted &&
|
|
173
174
|
index === displayMessages.length - 1 &&
|
|
174
|
-
!
|
|
175
|
+
!DONE_STATES.includes(message.type);
|
|
175
176
|
|
|
176
177
|
return (
|
|
177
178
|
<MessageItem
|
|
@@ -186,12 +187,12 @@ export default function AllMessagesMixed({
|
|
|
186
187
|
<>
|
|
187
188
|
{/* Get all messages to display in sliding view */}
|
|
188
189
|
{(() => {
|
|
189
|
-
// First get all permanent messages (ANSWER, QUESTION, COMPLETE, REQUEST_INPUT)
|
|
190
|
+
// First get all permanent messages (ANSWER, QUESTION, COMPLETE, REQUEST_INPUT, TERMINATED)
|
|
190
191
|
const permanentMessages = displayMessages.filter(msg =>
|
|
191
192
|
msg.type === AgentMessageType.ANSWER ||
|
|
192
193
|
msg.type === AgentMessageType.QUESTION ||
|
|
193
194
|
msg.type === AgentMessageType.COMPLETE ||
|
|
194
|
-
msg.type === AgentMessageType.
|
|
195
|
+
msg.type === AgentMessageType.TERMINATED
|
|
195
196
|
);
|
|
196
197
|
|
|
197
198
|
// Then get the latest thinking message if not completed
|
|
@@ -224,7 +225,7 @@ export default function AllMessagesMixed({
|
|
|
224
225
|
return allMessages.map((message, index) => {
|
|
225
226
|
const isLatestMessage = !isCompleted &&
|
|
226
227
|
index === allMessages.length - 1 &&
|
|
227
|
-
!
|
|
228
|
+
!DONE_STATES.includes(message.type);
|
|
228
229
|
|
|
229
230
|
return (
|
|
230
231
|
<MessageItem
|
|
@@ -44,10 +44,17 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
44
44
|
case AgentMessageType.COMPLETE:
|
|
45
45
|
return {
|
|
46
46
|
...baseStyle,
|
|
47
|
-
containerClass: "bg-white border-l-4 border-l-
|
|
47
|
+
containerClass: "bg-white border-l-4 border-l-success shadow-sm",
|
|
48
48
|
iconComponent: <CheckCircle className="size-4 text-success" />,
|
|
49
49
|
sender: "Completed",
|
|
50
50
|
};
|
|
51
|
+
case AgentMessageType.TERMINATED:
|
|
52
|
+
return {
|
|
53
|
+
...baseStyle,
|
|
54
|
+
containerClass: "bg-white border-l-4 border-l-attention shadow-sm",
|
|
55
|
+
iconComponent: <CheckCircle className="size-4 text-attention" />,
|
|
56
|
+
sender: "Terminated",
|
|
57
|
+
};
|
|
51
58
|
case AgentMessageType.QUESTION:
|
|
52
59
|
return {
|
|
53
60
|
...baseStyle,
|
|
@@ -254,7 +261,7 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
254
261
|
components={{
|
|
255
262
|
a: ({ node, ...props }: { node?: any; href?: string; children?: React.ReactNode }) => {
|
|
256
263
|
const href = props.href || "";
|
|
257
|
-
if (href.
|
|
264
|
+
if (href.includes("/store/objects")) {
|
|
258
265
|
return (
|
|
259
266
|
<NavLink
|
|
260
267
|
href={href}
|
|
@@ -377,6 +384,8 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
377
384
|
return "border-l-success bg-success";
|
|
378
385
|
case AgentMessageType.PLAN:
|
|
379
386
|
return "border-l-attention bg-attention";
|
|
387
|
+
case AgentMessageType.TERMINATED:
|
|
388
|
+
return "border-l-muted bg-muted";
|
|
380
389
|
default:
|
|
381
390
|
return "border-l-indigo-500 dark:border-l-indigo-400 bg-indigo-50/50 dark:bg-indigo-900/10";
|
|
382
391
|
}
|
|
@@ -437,6 +446,8 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
|
|
|
437
446
|
);
|
|
438
447
|
case AgentMessageType.COMPLETE:
|
|
439
448
|
return <CheckCircle className={`size-4 ${iconColor}`} />;
|
|
449
|
+
case AgentMessageType.TERMINATED:
|
|
450
|
+
return <CheckCircle className={`size-4 ${iconColor}`} />;
|
|
440
451
|
case AgentMessageType.IDLE:
|
|
441
452
|
return <Clock className={`size-4 ${iconColor}`} />;
|
|
442
453
|
case AgentMessageType.REQUEST_INPUT:
|
|
@@ -27,7 +27,8 @@ function isPermanentMessage(message: AgentMessage): boolean {
|
|
|
27
27
|
message.type === AgentMessageType.QUESTION ||
|
|
28
28
|
message.type === AgentMessageType.COMPLETE ||
|
|
29
29
|
message.type === AgentMessageType.IDLE ||
|
|
30
|
-
message.type === AgentMessageType.REQUEST_INPUT
|
|
30
|
+
message.type === AgentMessageType.REQUEST_INPUT ||
|
|
31
|
+
message.type === AgentMessageType.TERMINATED
|
|
31
32
|
);
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -17,6 +17,14 @@ export function insertMessageInTimeline(arr: AgentMessage[], m: AgentMessage) {
|
|
|
17
17
|
* This function checks the main workstream status to determine if the conversation is complete
|
|
18
18
|
* For multi-workstream scenarios, we keep streaming until the main workstream is complete
|
|
19
19
|
*/
|
|
20
|
+
|
|
21
|
+
export const DONE_STATES = [
|
|
22
|
+
AgentMessageType.COMPLETE,
|
|
23
|
+
AgentMessageType.IDLE,
|
|
24
|
+
AgentMessageType.REQUEST_INPUT,
|
|
25
|
+
AgentMessageType.TERMINATED,
|
|
26
|
+
];
|
|
27
|
+
|
|
20
28
|
export function isInProgress(messages: AgentMessage[]) {
|
|
21
29
|
if (!messages.length) return true;
|
|
22
30
|
|
|
@@ -46,7 +54,7 @@ export function isInProgress(messages: AgentMessage[]) {
|
|
|
46
54
|
console.log(`[isInProgress] Last message type in only workstream: ${lastMessage.type}`);
|
|
47
55
|
|
|
48
56
|
// Check if this single workstream is completed
|
|
49
|
-
if (!
|
|
57
|
+
if (!DONE_STATES.includes(
|
|
50
58
|
lastMessage.type
|
|
51
59
|
)) {
|
|
52
60
|
console.log("[isInProgress] Only workstream is still in progress");
|
|
@@ -71,7 +79,7 @@ export function isInProgress(messages: AgentMessage[]) {
|
|
|
71
79
|
const lastMainMessage = mainWorkstreamMsgs[mainWorkstreamMsgs.length - 1];
|
|
72
80
|
console.log(`[isInProgress] Last message type in main workstream: ${lastMainMessage.type}`);
|
|
73
81
|
|
|
74
|
-
if (!
|
|
82
|
+
if (!DONE_STATES.includes(
|
|
75
83
|
lastMainMessage.type
|
|
76
84
|
)) {
|
|
77
85
|
console.log("[isInProgress] Main workstream is still in progress");
|
|
@@ -89,7 +97,7 @@ export function isInProgress(messages: AgentMessage[]) {
|
|
|
89
97
|
for (const [workstreamId, msgs] of workstreamMessages.entries()) {
|
|
90
98
|
if (msgs.length > 0) {
|
|
91
99
|
const lastMessage = msgs[msgs.length - 1];
|
|
92
|
-
if (!
|
|
100
|
+
if (!DONE_STATES.includes(
|
|
93
101
|
lastMessage.type
|
|
94
102
|
)) {
|
|
95
103
|
console.log(`[isInProgress] Workstream ${workstreamId} is still active`);
|
|
@@ -168,7 +176,7 @@ export function getWorkstreamStatusMap(messages: AgentMessage[]): Map<string, "p
|
|
|
168
176
|
);
|
|
169
177
|
|
|
170
178
|
if (hasCompleteMessage ||
|
|
171
|
-
|
|
179
|
+
DONE_STATES.includes(lastMessage.type)) {
|
|
172
180
|
console.log(`[getWorkstreamStatusMap] Marking workstream ${workstreamId} as completed`);
|
|
173
181
|
statusMap.set(workstreamId, "completed");
|
|
174
182
|
} else {
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Filter as BaseFilter, FilterProvider, FilterBtn, FilterBar, FilterClear, FilterGroup } from '@vertesia/ui/core';
|
|
2
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { VStringFacet } from './VStringFacet';
|
|
5
|
+
import { VTypeFacet } from './VTypeFacet';
|
|
6
|
+
import { SearchInterface } from './VFacetsNav';
|
|
7
|
+
|
|
8
|
+
interface DocumentsFacetsNavProps {
|
|
9
|
+
facets: {
|
|
10
|
+
type?: any[];
|
|
11
|
+
status?: any[];
|
|
12
|
+
role?: any[];
|
|
13
|
+
location?: any[];
|
|
14
|
+
tags?: string[];
|
|
15
|
+
};
|
|
16
|
+
search: SearchInterface;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Hook to create filter groups for documents
|
|
20
|
+
export function useDocumentFilterGroups(facets: DocumentsFacetsNavProps['facets']): FilterGroup[] {
|
|
21
|
+
const { typeRegistry } = useUserSession();
|
|
22
|
+
const customFilterGroups: FilterGroup[] = [];
|
|
23
|
+
|
|
24
|
+
customFilterGroups.push({
|
|
25
|
+
placeholder: 'Name or ID',
|
|
26
|
+
name: 'name',
|
|
27
|
+
type: 'text',
|
|
28
|
+
options: [],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (facets.type) {
|
|
32
|
+
const typeFilterGroup = VTypeFacet({
|
|
33
|
+
buckets: facets.type || [],
|
|
34
|
+
typeRegistry: typeRegistry,
|
|
35
|
+
type: 'select',
|
|
36
|
+
multiple: true
|
|
37
|
+
});
|
|
38
|
+
customFilterGroups.push(typeFilterGroup);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (facets.status) {
|
|
42
|
+
const statusFilterGroup = VStringFacet({
|
|
43
|
+
search: null as any, // This will be provided by the search context
|
|
44
|
+
buckets: facets.status || [],
|
|
45
|
+
name: 'Status',
|
|
46
|
+
type: 'select',
|
|
47
|
+
multiple: true
|
|
48
|
+
});
|
|
49
|
+
customFilterGroups.push(statusFilterGroup);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (facets.tags) {
|
|
53
|
+
customFilterGroups.push({
|
|
54
|
+
name: 'Tags',
|
|
55
|
+
type: 'stringList',
|
|
56
|
+
options: facets.tags.map((tag: string) => ({
|
|
57
|
+
label: tag,
|
|
58
|
+
value: tag
|
|
59
|
+
}))
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
customFilterGroups.push({
|
|
64
|
+
name: 'created_at',
|
|
65
|
+
placeholder: 'Created Date',
|
|
66
|
+
type: 'date',
|
|
67
|
+
multiple: true,
|
|
68
|
+
options: []
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
customFilterGroups.push({
|
|
72
|
+
name: 'updated_at',
|
|
73
|
+
placeholder: 'Updated Date',
|
|
74
|
+
type: 'date',
|
|
75
|
+
multiple: true,
|
|
76
|
+
options: []
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return customFilterGroups;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Hook to create filter change handler for documents
|
|
83
|
+
export function useDocumentFilterHandler(search: SearchInterface) {
|
|
84
|
+
return (newFilters: BaseFilter[]) => {
|
|
85
|
+
if (newFilters.length === 0) {
|
|
86
|
+
search.clearFilters();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
search.clearFilters(false);
|
|
91
|
+
|
|
92
|
+
newFilters.forEach(filter => {
|
|
93
|
+
if (filter.value && filter.value.length > 0) {
|
|
94
|
+
const filterName = filter.name;
|
|
95
|
+
|
|
96
|
+
let filterValue;
|
|
97
|
+
if (filter.type === 'date' && filter.multiple) {
|
|
98
|
+
// Handle date range filters
|
|
99
|
+
if (Array.isArray(filter.value) && filter.value.length > 0) {
|
|
100
|
+
if (filter.value.length === 1) {
|
|
101
|
+
// Single date - use as both start and end
|
|
102
|
+
const dateValue = typeof filter.value[0] === 'object' ? (filter.value[0] as any).value : filter.value[0];
|
|
103
|
+
filterValue = {
|
|
104
|
+
gte: dateValue,
|
|
105
|
+
lte: dateValue
|
|
106
|
+
};
|
|
107
|
+
} else if (filter.value.length === 2) {
|
|
108
|
+
// Date range - start and end dates
|
|
109
|
+
const startDate = typeof filter.value[0] === 'object' ? (filter.value[0] as any).value : filter.value[0];
|
|
110
|
+
const endDate = typeof filter.value[1] === 'object' ? (filter.value[1] as any).value : filter.value[1];
|
|
111
|
+
filterValue = {
|
|
112
|
+
gte: startDate,
|
|
113
|
+
lte: endDate
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
} else if (filter.multiple) {
|
|
118
|
+
filterValue = Array.isArray(filter.value)
|
|
119
|
+
? filter.value.map((v: any) => typeof v === 'object' && v.value ? v.value : v)
|
|
120
|
+
: [typeof filter.value === 'object' && (filter.value as any).value ? (filter.value as any).value : filter.value];
|
|
121
|
+
} else {
|
|
122
|
+
// Single value - don't wrap in array
|
|
123
|
+
filterValue = Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object'
|
|
124
|
+
? (filter.value[0] as any).value
|
|
125
|
+
: Array.isArray(filter.value) && filter.value[0]
|
|
126
|
+
? filter.value[0]
|
|
127
|
+
: filter.value;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (filterName === 'name') {
|
|
131
|
+
search.query.search_term = filterValue;
|
|
132
|
+
search.query.name = filterValue;
|
|
133
|
+
} else {
|
|
134
|
+
search.query[filterName] = filterValue;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
search.search();
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Legacy component for backward compatibility
|
|
144
|
+
export function DocumentsFacetsNav({
|
|
145
|
+
facets,
|
|
146
|
+
search,
|
|
147
|
+
}: DocumentsFacetsNavProps) {
|
|
148
|
+
const [filters, setFilters] = useState<BaseFilter[]>([]);
|
|
149
|
+
const filterGroups = useDocumentFilterGroups(facets);
|
|
150
|
+
const handleFilterLogic = useDocumentFilterHandler(search);
|
|
151
|
+
|
|
152
|
+
const handleFilterChange: React.Dispatch<React.SetStateAction<BaseFilter[]>> = (value) => {
|
|
153
|
+
const newFilters = typeof value === 'function' ? value(filters) : value;
|
|
154
|
+
setFilters(newFilters);
|
|
155
|
+
handleFilterLogic(newFilters);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<FilterProvider
|
|
160
|
+
filterGroups={filterGroups}
|
|
161
|
+
filters={filters}
|
|
162
|
+
setFilters={handleFilterChange}
|
|
163
|
+
>
|
|
164
|
+
<div className="flex gap-2 items-center">
|
|
165
|
+
<FilterBtn />
|
|
166
|
+
<FilterBar />
|
|
167
|
+
<FilterClear />
|
|
168
|
+
</div>
|
|
169
|
+
</FilterProvider>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Filter as BaseFilter, FilterProvider, FilterBtn, FilterBar, FilterClear, FilterGroup } from '@vertesia/ui/core';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { VEnvironmentFacet } from './VEnvironmentFacet';
|
|
4
|
+
import { VInteractionFacet } from './VInteractionFacet';
|
|
5
|
+
import { VStringFacet } from './VStringFacet';
|
|
6
|
+
import { VUserFacet } from './VUserFacet';
|
|
7
|
+
import { SearchInterface } from './VFacetsNav';
|
|
8
|
+
|
|
9
|
+
interface RunsFacetsNavProps {
|
|
10
|
+
facets: {
|
|
11
|
+
type?: any[];
|
|
12
|
+
interactions?: any[];
|
|
13
|
+
environments?: any[];
|
|
14
|
+
models?: any[];
|
|
15
|
+
statuses?: any[];
|
|
16
|
+
finish_reason?: any[];
|
|
17
|
+
created_by?: any[];
|
|
18
|
+
};
|
|
19
|
+
search: SearchInterface;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Hook to create filter groups for runs
|
|
23
|
+
export function useRunsFilterGroups(facets: RunsFacetsNavProps['facets']): FilterGroup[] {
|
|
24
|
+
const customFilterGroups: FilterGroup[] = [];
|
|
25
|
+
|
|
26
|
+
if (facets.interactions) {
|
|
27
|
+
const interactionFilterGroup = VInteractionFacet({
|
|
28
|
+
buckets: facets.interactions || [],
|
|
29
|
+
name: 'interaction',
|
|
30
|
+
placeholder: 'Interactions',
|
|
31
|
+
});
|
|
32
|
+
customFilterGroups.push(interactionFilterGroup);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (facets.environments) {
|
|
36
|
+
const environmentFilterGroup = VEnvironmentFacet({
|
|
37
|
+
buckets: facets.environments || [],
|
|
38
|
+
name: 'Environments'
|
|
39
|
+
});
|
|
40
|
+
customFilterGroups.push(environmentFilterGroup);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (facets.models) {
|
|
44
|
+
const modelFilterGroup = VStringFacet({
|
|
45
|
+
search: null as any, // This will be provided by the search context
|
|
46
|
+
buckets: facets.models || [],
|
|
47
|
+
name: 'Model'
|
|
48
|
+
});
|
|
49
|
+
customFilterGroups.push(modelFilterGroup);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (facets.statuses) {
|
|
53
|
+
const statusFilterGroup = VStringFacet({
|
|
54
|
+
search: null as any, // This will be provided by the search context
|
|
55
|
+
buckets: facets.statuses || [],
|
|
56
|
+
name: 'Status'
|
|
57
|
+
});
|
|
58
|
+
customFilterGroups.push(statusFilterGroup);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (facets.finish_reason) {
|
|
62
|
+
const processedFinishReason = facets.finish_reason.map((bucket: any) => ({
|
|
63
|
+
...bucket,
|
|
64
|
+
_id: bucket._id === null ? 'none' : bucket._id
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
const finishReasonFilterGroup = VStringFacet({
|
|
68
|
+
search: null as any, // This will be provided by the search context
|
|
69
|
+
buckets: processedFinishReason,
|
|
70
|
+
name: 'finish_reason',
|
|
71
|
+
placeholder: 'Finish Reason'
|
|
72
|
+
});
|
|
73
|
+
customFilterGroups.push(finishReasonFilterGroup);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (facets.created_by) {
|
|
77
|
+
const createdByFilterGroup = VUserFacet({
|
|
78
|
+
buckets: facets.created_by || [],
|
|
79
|
+
name: 'created_by',
|
|
80
|
+
placeholder: 'Created By'
|
|
81
|
+
});
|
|
82
|
+
customFilterGroups.push(createdByFilterGroup);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const dateAfterFilterGroup = {
|
|
86
|
+
name: 'start',
|
|
87
|
+
placeholder: 'Date After',
|
|
88
|
+
type: 'date' as const,
|
|
89
|
+
multiple: false
|
|
90
|
+
};
|
|
91
|
+
customFilterGroups.push(dateAfterFilterGroup);
|
|
92
|
+
|
|
93
|
+
const dateBeforeFilterGroup = {
|
|
94
|
+
name: 'end',
|
|
95
|
+
placeholder: 'Date Before',
|
|
96
|
+
type: 'date' as const,
|
|
97
|
+
multiple: false
|
|
98
|
+
};
|
|
99
|
+
customFilterGroups.push(dateBeforeFilterGroup);
|
|
100
|
+
|
|
101
|
+
return customFilterGroups;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Hook to create filter change handler for runs
|
|
105
|
+
export function useRunsFilterHandler(search: SearchInterface) {
|
|
106
|
+
return (newFilters: BaseFilter[]) => {
|
|
107
|
+
if (newFilters.length === 0) {
|
|
108
|
+
search.clearFilters();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
search.clearFilters(false);
|
|
113
|
+
|
|
114
|
+
newFilters.forEach(filter => {
|
|
115
|
+
if (filter.value && filter.value.length > 0) {
|
|
116
|
+
const filterName = filter.name;
|
|
117
|
+
let filterValue;
|
|
118
|
+
if (filter.type === 'stringList') {
|
|
119
|
+
filterValue = filter.value.map(v => typeof v === 'string' ? v : v.value);
|
|
120
|
+
} else if (filter.multiple) {
|
|
121
|
+
filterValue = Array.isArray(filter.value)
|
|
122
|
+
? filter.value.map((v: any) => typeof v === 'object' && v.value ? v.value : v)
|
|
123
|
+
: [typeof filter.value === 'object' && (filter.value as any).value ? (filter.value as any).value : filter.value];
|
|
124
|
+
} else {
|
|
125
|
+
// Single value - don't wrap in array
|
|
126
|
+
filterValue = Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object'
|
|
127
|
+
? (filter.value[0] as any).value
|
|
128
|
+
: Array.isArray(filter.value) && filter.value[0]
|
|
129
|
+
? filter.value[0]
|
|
130
|
+
: filter.value;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
search.query[filterName] = filterValue;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
search.search();
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Legacy component for backward compatibility
|
|
142
|
+
export function RunsFacetsNav({ facets, search }: RunsFacetsNavProps) {
|
|
143
|
+
const [filters, setFilters] = useState<BaseFilter[]>([]);
|
|
144
|
+
const filterGroups = useRunsFilterGroups(facets);
|
|
145
|
+
const handleFilterLogic = useRunsFilterHandler(search);
|
|
146
|
+
|
|
147
|
+
const handleFilterChange: React.Dispatch<React.SetStateAction<BaseFilter[]>> = (value) => {
|
|
148
|
+
const newFilters = typeof value === 'function' ? value(filters) : value;
|
|
149
|
+
setFilters(newFilters);
|
|
150
|
+
handleFilterLogic(newFilters);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<FilterProvider
|
|
155
|
+
filterGroups={filterGroups}
|
|
156
|
+
filters={filters}
|
|
157
|
+
setFilters={handleFilterChange}
|
|
158
|
+
>
|
|
159
|
+
<div className="flex gap-2 items-center">
|
|
160
|
+
<FilterBtn />
|
|
161
|
+
<FilterBar />
|
|
162
|
+
<FilterClear />
|
|
163
|
+
</div>
|
|
164
|
+
</FilterProvider>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { Filter as BaseFilter, FilterBar, FilterGroup } from '@vertesia/ui/core';
|
|
2
|
-
import { useUserSession } from '@vertesia/ui/session';
|
|
1
|
+
import { Filter as BaseFilter, FilterProvider, FilterBtn, FilterBar, FilterClear, FilterGroup } from '@vertesia/ui/core';
|
|
3
2
|
import { useState } from 'react';
|
|
4
|
-
import { VEnvironmentFacet } from './VEnvironmentFacet';
|
|
5
|
-
import { VInteractionFacet } from './VInteractionFacet';
|
|
6
|
-
import { VStringFacet } from './VStringFacet';
|
|
7
|
-
import { VTypeFacet } from './VTypeFacet';
|
|
8
|
-
import { VUserFacet } from './VUserFacet';
|
|
9
3
|
|
|
10
4
|
export interface SearchInterface {
|
|
11
5
|
getFilterValue(name: string): any;
|
|
@@ -21,10 +15,9 @@ interface FacetsNavProps {
|
|
|
21
15
|
search: SearchInterface;
|
|
22
16
|
textSearch?: string;
|
|
23
17
|
}
|
|
24
|
-
export function VFacetsNav({
|
|
18
|
+
export function VFacetsNav({ search, textSearch = '' }: FacetsNavProps) {
|
|
25
19
|
const [filters, setFilters] = useState<BaseFilter[]>([]);
|
|
26
20
|
const customFilterGroups: FilterGroup[] = [];
|
|
27
|
-
const { typeRegistry } = useUserSession();
|
|
28
21
|
|
|
29
22
|
if (textSearch) {
|
|
30
23
|
customFilterGroups.push({
|
|
@@ -35,121 +28,6 @@ export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps)
|
|
|
35
28
|
});
|
|
36
29
|
}
|
|
37
30
|
|
|
38
|
-
if (facets.type) {
|
|
39
|
-
const typeFilterGroup = VTypeFacet({
|
|
40
|
-
buckets: facets.type || [],
|
|
41
|
-
typeRegistry: typeRegistry,
|
|
42
|
-
});
|
|
43
|
-
customFilterGroups.push(typeFilterGroup);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (facets.status) {
|
|
47
|
-
const statusFilterGroup = VStringFacet({
|
|
48
|
-
search,
|
|
49
|
-
buckets: facets.status || [],
|
|
50
|
-
name: 'Status'
|
|
51
|
-
});
|
|
52
|
-
customFilterGroups.push(statusFilterGroup);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (facets.role) {
|
|
56
|
-
const roleFilterGroup = VStringFacet({
|
|
57
|
-
search,
|
|
58
|
-
buckets: facets.role || [],
|
|
59
|
-
name: 'Role'
|
|
60
|
-
});
|
|
61
|
-
customFilterGroups.push(roleFilterGroup);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (facets.location) {
|
|
65
|
-
const locationFilterGroup = VStringFacet({
|
|
66
|
-
search,
|
|
67
|
-
buckets: facets.location || [],
|
|
68
|
-
name: 'Location'
|
|
69
|
-
});
|
|
70
|
-
customFilterGroups.push(locationFilterGroup);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (facets.initiated_by) {
|
|
74
|
-
const initiatedByFilterGroup = VUserFacet({
|
|
75
|
-
buckets: facets.initiated_by || [],
|
|
76
|
-
name: 'User'
|
|
77
|
-
});
|
|
78
|
-
customFilterGroups.push(initiatedByFilterGroup);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Run table */
|
|
82
|
-
if (facets.interactions) {
|
|
83
|
-
const interactionFilterGroup = VInteractionFacet({
|
|
84
|
-
buckets: facets.interactions || [],
|
|
85
|
-
name: 'interaction',
|
|
86
|
-
placeholder: 'Interactions',
|
|
87
|
-
});
|
|
88
|
-
customFilterGroups.push(interactionFilterGroup);
|
|
89
|
-
}
|
|
90
|
-
|
|
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'
|
|
104
|
-
});
|
|
105
|
-
customFilterGroups.push(modelFilterGroup);
|
|
106
|
-
}
|
|
107
|
-
|
|
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 */
|
|
152
|
-
|
|
153
31
|
const handleFilterChange: React.Dispatch<React.SetStateAction<BaseFilter[]>> = (value) => {
|
|
154
32
|
|
|
155
33
|
const newFilters = typeof value === 'function' ? value(filters) : value;
|
|
@@ -188,10 +66,16 @@ export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps)
|
|
|
188
66
|
};
|
|
189
67
|
|
|
190
68
|
return (
|
|
191
|
-
<
|
|
69
|
+
<FilterProvider
|
|
192
70
|
filterGroups={customFilterGroups}
|
|
193
71
|
filters={filters}
|
|
194
72
|
setFilters={handleFilterChange}
|
|
195
|
-
|
|
73
|
+
>
|
|
74
|
+
<div className="flex gap-2 items-center">
|
|
75
|
+
<FilterBtn />
|
|
76
|
+
<FilterBar />
|
|
77
|
+
<FilterClear />
|
|
78
|
+
</div>
|
|
79
|
+
</FilterProvider>
|
|
196
80
|
)
|
|
197
81
|
}
|