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.

add [properties-fe] - handle entity type tasks + task search (#529)

Daniel Kweon9aee1d70cb7d
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 3e4661fcdd..8f2e93e8d8 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
@@ -155,7 +155,9 @@ function getEntityIcon(entity: CombinedEntity) {
case 'item': {
const blockName =
entity.data.type === 'document'
- ? fileTypeToBlockName(entity.data.fileType, true)
+ ? entity.data.subType === 'task'
+ ? 'task'
+ : fileTypeToBlockName(entity.data.fileType, true)
: entity.data.type === 'chat'
? 'chat'
: entity.data.type === 'project'
@@ -210,6 +212,12 @@ export function PropertyEntitySelector(props: EntityInputProps) {
return [];
}
+ if (specificEntityType === 'TASK') {
+ return history()
+ .filter((item) => item.type === 'document' && item.subType === 'task')
+ .map(entityMapper('item'));
+ }
+
const itemTypes: EntityType[] = ['DOCUMENT', 'PROJECT', 'CHAT'];
if (itemTypes.includes(specificEntityType)) {
return history()
diff --git a/js/app/packages/core/component/Properties/utils/PropertyDataTypeIcon.tsx b/js/app/packages/core/component/Properties/utils/PropertyDataTypeIcon.tsx
index 5c10c1becc..5fdb2e75b4 100644
--- a/js/app/packages/core/component/Properties/utils/PropertyDataTypeIcon.tsx
+++ b/js/app/packages/core/component/Properties/utils/PropertyDataTypeIcon.tsx
@@ -9,6 +9,7 @@ import FolderIcon from '@icon/regular/folder.svg';
import HashIcon from '@icon/regular/hash.svg';
import LinkIcon from '@icon/regular/link.svg';
import ListBulletIcon from '@icon/regular/list-bullets.svg';
+import TaskIcon from '@icon/regular/list-checks.svg';
import PencilIcon from '@icon/regular/pencil.svg';
import SimpleTagIcon from '@icon/regular/tag-simple.svg';
import UserCircleIcon from '@icon/regular/user-circle.svg';
@@ -44,6 +45,8 @@ export const PropertyDataTypeIcon: Component<PropertyDataTypeIconProps> = (
return <CompanyIcon class={iconClasses} />;
case 'THREAD':
return <ThreadIcon class={iconClasses} />;
+ case 'TASK':
+ return <TaskIcon class={iconClasses} />;
default:
return <SimpleTagIcon class={iconClasses} />;
}
diff --git a/js/app/packages/core/component/Properties/utils/display.ts b/js/app/packages/core/component/Properties/utils/display.ts
index 2c47b64514..db7d9f5b6d 100644
--- a/js/app/packages/core/component/Properties/utils/display.ts
+++ b/js/app/packages/core/component/Properties/utils/display.ts
@@ -17,6 +17,7 @@ export const getPropertyDataTypeDropdownOptions = () => [
{ value: 'entity:CHANNEL' as const, label: 'Channel' },
{ value: 'entity:PROJECT' as const, label: 'Project' },
{ value: 'entity:CHAT' as const, label: 'Chat' },
+ { value: 'entity:TASK' as const, label: 'Task' },
// { value: 'entity:COMPANY' as const, label: 'Company' },
// { value: 'entity:THREAD' as const, label: 'Thread' },
{ value: 'entity' as const, label: 'Any Entity' },