-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.ts
More file actions
113 lines (102 loc) · 3.14 KB
/
Copy pathindex.ts
File metadata and controls
113 lines (102 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import type { Action } from '@objectstack/spec/ui';
const task = 'showcase_task';
/**
* Action matrix — covers every `ActionType` (script / url / flow / modal /
* api / form) surfaced across a spread of `ActionLocation`s (toolbar, row,
* record header/more, related list, global nav).
*/
/** script — inline handler, shown on each row and the record header. */
export const MarkDoneAction: Action = {
name: 'showcase_mark_done',
label: 'Mark Done',
icon: 'check',
objectName: task,
type: 'script',
// `record_section` so the Task Detail page's `record:quick_actions` bar
// (which names this action) resolves it — the engine location-filters even
// explicitly-named actions, mirroring the platform's own sys-user pages.
locations: ['list_item', 'record_header', 'record_section'],
refreshAfter: true,
};
/** url — navigate out, from the row overflow menu. */
export const OpenDocsAction: Action = {
name: 'showcase_open_docs',
label: 'Open Docs',
icon: 'book-open',
objectName: task,
type: 'url',
target: 'https://docs.objectstack.ai',
locations: ['record_more'],
refreshAfter: false,
};
/**
* flow — launch the Reassign screen-flow wizard. Row-level (`list_item`) so the
* row's `recordId` flows into the flow, which collects `new_assignee` via a
* `screen` node and writes it back with `update_record`. The objectui
* FlowRunner renders the screen and resumes the run.
*/
export const BulkReassignAction: Action = {
name: 'showcase_bulk_reassign',
label: 'Reassign…',
icon: 'users',
objectName: task,
type: 'flow',
target: 'showcase_reassign_wizard',
locations: ['list_item', 'list_toolbar'],
refreshAfter: true,
};
/** modal — open a dialog/page. */
export const QuickViewAction: Action = {
name: 'showcase_quick_view',
label: 'Quick View',
icon: 'eye',
objectName: task,
type: 'modal',
target: 'showcase_component_gallery',
locations: ['list_item'],
refreshAfter: false,
};
/** api — call a custom endpoint. */
export const RecalcEstimateAction: Action = {
name: 'showcase_recalc_estimate',
label: 'Recalculate Estimate',
icon: 'calculator',
objectName: task,
type: 'api',
target: '/api/v1/showcase/recalc',
locations: ['record_more', 'record_section'],
refreshAfter: true,
};
/** form — open a parameter form dialog. */
export const LogTimeAction: Action = {
name: 'showcase_log_time',
label: 'Log Time',
icon: 'clock',
objectName: task,
type: 'form',
target: 'showcase_task.default',
// `record_section` so it surfaces in the Task Detail quick-actions bar too.
locations: ['record_header', 'record_related', 'record_section'],
refreshAfter: true,
};
/** global nav command-palette action. */
export const NewTaskAction: Action = {
name: 'showcase_new_task',
label: 'New Task',
icon: 'plus',
objectName: task,
type: 'modal',
target: 'showcase_component_gallery',
locations: ['global_nav'],
refreshAfter: true,
};
export const allActions = [
MarkDoneAction,
OpenDocsAction,
BulkReassignAction,
QuickViewAction,
RecalcEstimateAction,
LogTimeAction,
NewTaskAction,
];