Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix [properties-fe] - save / filter of entity type tasks (#600)

Daniel Kweon592e4c333810
diff --git a/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx b/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx
index aa189ed0b1..1c91eabe57 100644
--- a/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx
+++ b/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx
@@ -13,11 +13,11 @@ const TOOLSETS = [
},
] as const;
-const TOOLSET_TO_DISPLAY = Object.fromEntries(
+const _TOOLSET_TO_DISPLAY = Object.fromEntries(
TOOLSETS.map((t) => [t.value, t.label])
) as Record<ToolSetName, string>;
-const TOOLSET_FROM_DISPLAY = Object.fromEntries(
+const _TOOLSET_FROM_DISPLAY = Object.fromEntries(
TOOLSETS.map((t) => [t.label, { value: t.value, tooltip: t.tooltip }])
) as Record<string, { value: ToolSetName; tooltip: string }>;
@@ -43,7 +43,7 @@ export function ToolsetSelector(props: {
toolset: Signal<ToolSet>;
sources: Signal<Source>;
}) {
- const [toolset, setToolset] = props.toolset;
+ const [toolset, _setToolset] = props.toolset;
const [source, setSource] = props.sources;
return (
diff --git a/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx b/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx
index 91ede3bdab..414abceed9 100644
--- a/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx
@@ -137,6 +137,9 @@ function getEntityType(entity: CombinedEntity): string {
case 'channel':
return 'CHANNEL';
case 'item':
+ if (entity.data.type === 'document' && entity.data.subType === 'task') {
+ return 'TASK';
+ }
return entity.data.type.toUpperCase();
case 'company':
return 'COMPANY';
@@ -289,7 +292,11 @@ export function PropertyEntitySelector(props: EntityInputProps) {
const itemTypes: EntityType[] = ['DOCUMENT', 'PROJECT', 'CHAT'];
if (itemTypes.includes(specificEntityType)) {
return history()
- .filter((item) => item.type.toUpperCase() === specificEntityType)
+ .filter(
+ (item) =>
+ item.type.toUpperCase() === specificEntityType &&
+ !(item.type === 'document' && item.subType === 'task')
+ )
.map(entityMapper('item'));
}