Files
multica/packages/core/properties/queries.ts
Lambda 645ea20b00 feat(web): custom properties settings tab + issue sidebar editors (MUL-4463)
- Settings → Properties: definition management mirroring the Labels tab
  (list with type badges/option chips/usage counts, create/edit dialog
  with option editor, archive/restore, 20-cap indicator). Admin-gated;
  members see a read-only catalog.
- Issue detail sidebar: custom properties join the built-in optional
  props' progressive disclosure — set values render as rows with
  type-appropriate editors (select/multi-select pickers, calendar,
  yes/no, inline input for text/number/url), unset ones live in the
  same '+ Add property' menu behind a separator. Archived definitions
  render read-only until cleared.
- Core: property types, zod schemas (lenient type strings for forward
  compat), api client methods, React Query hooks with optimistic
  single-key value writes, ws-updaters + realtime wiring for
  property:created/updated and issue_properties:changed.
- Locales: en/zh-Hans/ja/ko strings; Issue fixtures gain properties: {}.

Co-authored-by: multica-agent <github@multica.ai>
2026-07-14 17:29:00 +08:00

17 lines
553 B
TypeScript

import { queryOptions } from "@tanstack/react-query";
import { api } from "../api";
export const propertyKeys = {
all: (wsId: string) => ["properties", wsId] as const,
list: (wsId: string, includeArchived = false) =>
[...propertyKeys.all(wsId), "list", includeArchived] as const,
};
export function propertyListOptions(wsId: string, includeArchived = false) {
return queryOptions({
queryKey: propertyKeys.list(wsId, includeArchived),
queryFn: () => api.listProperties(includeArchived),
select: (data) => data.properties,
});
}