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): prevent metadata properties from disappearing in task view (#2515)

gbirman7a5210ca85a4
diff --git a/js/app/packages/queries/properties/entity.ts b/js/app/packages/queries/properties/entity.ts
index 80451af179..3a648428fa 100644
--- a/js/app/packages/queries/properties/entity.ts
+++ b/js/app/packages/queries/properties/entity.ts
@@ -46,6 +46,7 @@ export function useEntityPropertiesQuery(
queryKey: propertiesKeys.entity({
entityType: type,
entityId: id,
+ includeMetadata,
}).queryKey,
queryFn: async () => {
const data = await throwOnErr(
@@ -162,7 +163,7 @@ export function useSaveEntityPropertyMutation(
return optimisticUpdateSoupEntity({
tag: current.tag,
data: {
- id: current.data.id,
+ ...current.data,
properties: current.data.properties.map((prop) =>
prop.definition.id === vars.property.propertyDefinitionId
? { ...prop, value: soupValue }
@@ -406,7 +407,7 @@ export function useSetPropertyStatusCompleteMutation(
soupTxn = optimisticUpdateSoupEntity({
tag: current.tag,
data: {
- id: current.data.id,
+ ...current.data,
properties: updateStatusPropertyToCompleted(
current.data.properties
),
diff --git a/js/app/packages/queries/properties/keys.ts b/js/app/packages/queries/properties/keys.ts
index 8088294208..8f14930d76 100644
--- a/js/app/packages/queries/properties/keys.ts
+++ b/js/app/packages/queries/properties/keys.ts
@@ -4,8 +4,15 @@ import type { PropertyScope } from '../../service-clients/service-properties/gen
export const propertiesKeys = createQueryKeys('properties', {
all: null,
- entity: (params: { entityType: EntityType; entityId: string }) => ({
- queryKey: ['entity', params.entityType, params.entityId],
+ entity: (params: {
+ entityType: EntityType;
+ entityId: string;
+ includeMetadata?: boolean;
+ }) => ({
+ queryKey:
+ params.includeMetadata !== undefined
+ ? ['entity', params.entityType, params.entityId, params.includeMetadata]
+ : ['entity', params.entityType, params.entityId],
}),
options: (params: { propertyDefinitionId: string }) => ({
queryKey: ['options', params.propertyDefinitionId],