@elementumai/edk 0.10.4 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/dist-sdk/src/catalog/token.js +2 -1
- package/dist-sdk/src/core/wire/ref-serializer.js +26 -1
- package/dist-sdk/src/engine/build/context.d.ts +4 -0
- package/dist-sdk/src/engine/coverage-gaps.d.ts +2 -0
- package/dist-sdk/src/engine/coverage-gaps.js +3 -0
- package/dist-sdk/src/engine/ei/json-stream-reader.d.ts +43 -0
- package/dist-sdk/src/engine/ei/json-stream-reader.js +234 -0
- package/dist-sdk/src/engine/ei/run.d.ts +22 -0
- package/dist-sdk/src/engine/ei/run.js +99 -18
- package/dist-sdk/src/engine/ei/saved-plan.d.ts +16 -0
- package/dist-sdk/src/engine/ei/saved-plan.js +19 -0
- package/dist-sdk/src/engine/ei/state.d.ts +1 -1
- package/dist-sdk/src/engine/ei/state.js +17 -4
- package/dist-sdk/src/engine/progress.d.ts +3 -1
- package/dist-sdk/src/engine/progress.js +7 -3
- package/dist-sdk/src/engine/pull/authored-address.d.ts +15 -1
- package/dist-sdk/src/engine/pull/authored-address.js +180 -29
- package/dist-sdk/src/engine/pull/context.d.ts +37 -2
- package/dist-sdk/src/engine/pull/context.js +7 -4
- package/dist-sdk/src/engine/tf/index.d.ts +2 -2
- package/dist-sdk/src/engine/tf/index.js +2 -2
- package/dist-sdk/src/engine/tf/labels.d.ts +22 -0
- package/dist-sdk/src/engine/tf/labels.js +50 -0
- package/dist-sdk/src/engine/tf/model.d.ts +2 -0
- package/dist-sdk/src/engine/tf/model.js +26 -0
- package/dist-sdk/src/engine/validation.d.ts +2 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +52 -24
- package/dist-sdk/src/entities/access-policy/member-list.d.ts +32 -0
- package/dist-sdk/src/entities/access-policy/member-list.js +57 -0
- package/dist-sdk/src/entities/access-policy/module.js +5 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +4 -3
- package/dist-sdk/src/entities/access-policy/to-tf.js +21 -12
- package/dist-sdk/src/entities/agent/build.js +7 -5
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +2 -0
- package/dist-sdk/src/entities/agent/from-tf.js +13 -3
- package/dist-sdk/src/entities/agent/to-tf.js +11 -5
- package/dist-sdk/src/entities/agent/tools.d.ts +8 -0
- package/dist-sdk/src/entities/agent/tools.js +6 -2
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +29 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +56 -3
- package/dist-sdk/src/entities/agent-tool/types.d.ts +12 -8
- package/dist-sdk/src/entities/agent-tool/types.js +13 -9
- package/dist-sdk/src/entities/app/build.d.ts +11 -0
- package/dist-sdk/src/entities/app/build.js +1 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +5 -7
- package/dist-sdk/src/entities/app/from-tf.js +16 -10
- package/dist-sdk/src/entities/app/to-tf.js +6 -4
- package/dist-sdk/src/entities/automation/build.d.ts +2 -7
- package/dist-sdk/src/entities/automation/build.js +43 -14
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +7 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +7 -11
- package/dist-sdk/src/entities/automation/from-tf.d.ts +23 -1
- package/dist-sdk/src/entities/automation/from-tf.js +456 -34
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +22 -2
- package/dist-sdk/src/entities/automation/module.js +244 -57
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +22 -2
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +54 -3
- package/dist-sdk/src/entities/automation/run-target.d.ts +59 -0
- package/dist-sdk/src/entities/automation/run-target.js +99 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +9 -0
- package/dist-sdk/src/entities/automation/script-code.js +24 -3
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +16 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +49 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +20 -8
- package/dist-sdk/src/entities/automation/to-tf.d.ts +1 -3
- package/dist-sdk/src/entities/automation/to-tf.js +102 -40
- package/dist-sdk/src/entities/automation/triggers.d.ts +22 -3
- package/dist-sdk/src/entities/automation/triggers.js +40 -0
- package/dist-sdk/src/entities/automation/types.d.ts +21 -0
- package/dist-sdk/src/entities/automation/types.js +26 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/dashboard/from-tf.js +57 -7
- package/dist-sdk/src/entities/dashboard/to-tf.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +7 -2
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +65 -19
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +4 -2
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +341 -32
- package/dist-sdk/src/entities/element/build.d.ts +10 -0
- package/dist-sdk/src/entities/element/build.js +1 -0
- package/dist-sdk/src/entities/element/from-tf.js +14 -9
- package/dist-sdk/src/entities/element/to-tf.js +6 -4
- package/dist-sdk/src/entities/field/from-tf.d.ts +24 -0
- package/dist-sdk/src/entities/field/from-tf.js +79 -1
- package/dist-sdk/src/entities/field/module.js +7 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +30 -1
- package/dist-sdk/src/entities/field/to-tf.js +51 -0
- package/dist-sdk/src/entities/file-reader/module.js +3 -3
- package/dist-sdk/src/entities/file-reader/to-tf.js +3 -3
- package/dist-sdk/src/entities/file-reader/types.d.ts +4 -16
- package/dist-sdk/src/entities/file-reader/types.js +7 -0
- package/dist-sdk/src/entities/org/group.d.ts +1 -0
- package/dist-sdk/src/entities/org/group.js +2 -1
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +8 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +10 -2
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/record-create-form/to-tf.js +14 -2
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +8 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +88 -10
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +3 -2
- package/dist-sdk/src/entities/relationship/to-tf.js +79 -8
- package/dist-sdk/src/entities/role/from-tf.js +24 -7
- package/dist-sdk/src/entities/role/to-tf.js +25 -7
- package/dist-sdk/src/entities/service-account/from-tf.js +2 -1
- package/dist-sdk/src/entities/service-account/module.js +15 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +12 -4
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +1 -1
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +12 -7
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +5 -2
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +8 -1
- package/dist-sdk/src/entities/skill/from-tf.js +10 -3
- package/dist-sdk/src/entities/skill/module.js +16 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +8 -1
- package/dist-sdk/src/entities/skill/to-tf.js +23 -14
- package/dist-sdk/src/entities/skill/tools.d.ts +8 -0
- package/dist-sdk/src/entities/skill/tools.js +6 -2
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +8 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -2
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +8 -2
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +20 -10
- package/dist-sdk/src/entities/view/from-tf.d.ts +60 -0
- package/dist-sdk/src/entities/view/from-tf.js +391 -17
- package/dist-sdk/src/entities/view/module.js +15 -0
- package/dist-sdk/src/entities/view/portable.d.ts +11 -0
- package/dist-sdk/src/entities/view/portable.js +47 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +4 -1
- package/dist-sdk/src/entities/view/to-tf.js +25 -7
- package/dist-sdk/src/entities/view/types.js +1 -1
- package/dist-sdk/src/entities/widget/build.d.ts +4 -3
- package/dist-sdk/src/entities/widget/from-tf.d.ts +3 -0
- package/dist-sdk/src/entities/widget/from-tf.js +100 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +16 -1
- package/dist-sdk/src/entities/widget/to-tf.js +77 -14
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +27 -8
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/field-resource-types.d.ts +2 -0
- package/dist-sdk/src/graph/field-resource-types.js +11 -0
- package/dist-sdk/src/graph/index.d.ts +28 -3
- package/dist-sdk/src/graph/index.js +12 -2
- package/dist-sdk/src/graph/types.d.ts +157 -5
- package/package.json +1 -1
|
@@ -14,13 +14,15 @@ import { expr, isCanonicalTsLabel, scopedResourceLabel, tsLabelToTfLabel, } from
|
|
|
14
14
|
import { fieldRefToTfValue as customFieldRefToTfValue } from "../field/to-tf.js";
|
|
15
15
|
import { ELEMENT_SYSTEM_FIELD_KEYS } from "../element/system-fields.js";
|
|
16
16
|
import { filterToTf, principalListToTf } from "../access-policy/to-tf.js";
|
|
17
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
17
18
|
import { SUB_TYPE_BY_AUTHORING_TYPE } from "../field/types.js";
|
|
18
19
|
import { DASHBOARD_RESOURCE_TYPE } from "../dashboard/module.js";
|
|
19
20
|
import { WIDGET_RESOURCE_TYPE } from "../widget/module.js";
|
|
21
|
+
import { unbuiltWidgetReferenceNote } from "../widget/to-tf.js";
|
|
20
22
|
import { AGENT_VIEW_RESOURCE_TYPE, CUSTOM_VIEW_RESOURCE_TYPE, CALENDAR_VIEW_RESOURCE_TYPE, DASHBOARD_VIEW_RESOURCE_TYPE, GROUP_SECTION_WIRE_TYPE, LAYOUT_RESOURCE_TYPE, LIST_VIEW_RESOURCE_TYPE, KANBAN_VIEW_RESOURCE_TYPE, MANAGED_VIEW_ORDER_RESOURCE_TYPE, PLATFORM_DEFAULT_LIST_VIEW_NAME, SECTION_TYPE_TO_WIRE, SYSTEM_FIELD_ID_ATTR_BY_KEY, UPDATE_SECTION_WIRE_TYPE, } from "./types.js";
|
|
21
23
|
function appendViewSharingAttrs(attrs, view, where, ctx) {
|
|
22
|
-
const userIds = principalListToTf(view.userIds, "elementum_user", `${where}.userIds`, ctx);
|
|
23
|
-
const groupIds = principalListToTf(view.groupIds, "elementum_group", `${where}.groupIds`, ctx);
|
|
24
|
+
const userIds = principalListToTf(view.userIds, "elementum_user", `${where}.userIds`, ctx, "viewShare");
|
|
25
|
+
const groupIds = principalListToTf(view.groupIds, "elementum_group", `${where}.groupIds`, ctx, "viewShare");
|
|
24
26
|
if (view.userIds !== undefined) {
|
|
25
27
|
if (view.userIds.length === 0)
|
|
26
28
|
attrs["user_ids"] = [];
|
|
@@ -49,7 +51,16 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
49
51
|
diagnostics.push(`layouts.${stageKey} has no matching authored stage option; dropped`);
|
|
50
52
|
continue;
|
|
51
53
|
}
|
|
52
|
-
blocks.push(layoutToTf(stageKey, layout, ownerRefName, ownerTfLabel, scope, objectId, diagnostics, fieldAddresses, opts.
|
|
54
|
+
blocks.push(layoutToTf(stageKey, layout, ownerRefName, ownerTfLabel, scope, objectId, diagnostics, fieldAddresses, opts.widgets, opts.stageKeyByTfLabel?.get(stageTfLabel)));
|
|
55
|
+
}
|
|
56
|
+
if (opts.deleteDefaultListView === true) {
|
|
57
|
+
const named = [listViews, calendarViews, kanbanViews, dashboardViews, agentViews, customViews]
|
|
58
|
+
.flatMap((bag) => Object.entries(bag ?? {}))
|
|
59
|
+
.filter(([, view]) => view.name === PLATFORM_DEFAULT_LIST_VIEW_NAME)
|
|
60
|
+
.map(([key]) => key);
|
|
61
|
+
if (named.length > 0) {
|
|
62
|
+
throw new EntityTfError(`${ownerRefName}: deleteDefaultListView deletes the platform's "${PLATFORM_DEFAULT_LIST_VIEW_NAME}" view, but view ${named.map((k) => `"${k}"`).join(", ")} is named "${PLATFORM_DEFAULT_LIST_VIEW_NAME}". Rename or remove that view, or drop deleteDefaultListView.`);
|
|
63
|
+
}
|
|
53
64
|
}
|
|
54
65
|
const viewAddressByKey = new Map();
|
|
55
66
|
for (const [viewKey, view] of Object.entries(listViews ?? {})) {
|
|
@@ -281,6 +292,9 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
281
292
|
blocks.push({ kind: "resource", type: CUSTOM_VIEW_RESOURCE_TYPE, label: tfLabel, attrs });
|
|
282
293
|
viewAddressByKey.set(viewKey, { type: CUSTOM_VIEW_RESOURCE_TYPE, label: tfLabel });
|
|
283
294
|
}
|
|
295
|
+
if (opts.deleteDefaultListView === true && viewAddressByKey.size === 0) {
|
|
296
|
+
throw new EntityTfError(`${ownerRefName}: deleteDefaultListView needs at least one declared view; without one there is no view order to apply and the "${PLATFORM_DEFAULT_LIST_VIEW_NAME}" view would stay.`);
|
|
297
|
+
}
|
|
284
298
|
if (viewAddressByKey.size > 0) {
|
|
285
299
|
const orderKeys = viewOrder ?? [
|
|
286
300
|
...Object.keys(listViews ?? {}),
|
|
@@ -325,7 +339,11 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
325
339
|
// No name of its own: labelled from the owner's namespace, like the record
|
|
326
340
|
// create form, so renaming the app or element keeps its address.
|
|
327
341
|
label: scopedResourceLabel(ownerTfLabel, "view_order", scope),
|
|
328
|
-
attrs: {
|
|
342
|
+
attrs: {
|
|
343
|
+
object_id: objectId,
|
|
344
|
+
view_ids: viewIds,
|
|
345
|
+
...(opts.deleteDefaultListView !== undefined ? { delete_platform_default_list_view: opts.deleteDefaultListView } : {}),
|
|
346
|
+
},
|
|
329
347
|
});
|
|
330
348
|
}
|
|
331
349
|
}
|
|
@@ -345,7 +363,7 @@ export function managedViewSortToTf(sort, ownerTfLabel, scope, where, diagnostic
|
|
|
345
363
|
}
|
|
346
364
|
return expr.jsonencode({ orders });
|
|
347
365
|
}
|
|
348
|
-
function layoutToTf(stageKey, layout, ownerRefName, ownerTfLabel, scope, objectId, diagnostics, fieldAddresses,
|
|
366
|
+
function layoutToTf(stageKey, layout, ownerRefName, ownerTfLabel, scope, objectId, diagnostics, fieldAddresses, widgets, stageIdKey) {
|
|
349
367
|
const sections = [];
|
|
350
368
|
for (const section of layout.sections) {
|
|
351
369
|
const authoringType = section.type ?? "group";
|
|
@@ -410,8 +428,8 @@ function layoutToTf(stageKey, layout, ownerRefName, ownerTfLabel, scope, objectI
|
|
|
410
428
|
diagnostics.push(`${widgetWhere}: widget belongs to ${JSON.stringify(widget.parent)}, not ${JSON.stringify(ownerRefName)}; dropped`);
|
|
411
429
|
continue;
|
|
412
430
|
}
|
|
413
|
-
if (!
|
|
414
|
-
diagnostics.push(
|
|
431
|
+
if (!widgets?.built.has(key)) {
|
|
432
|
+
diagnostics.push(unbuiltWidgetReferenceNote(widgetWhere, key, scope, ownerRefName, widgets));
|
|
415
433
|
continue;
|
|
416
434
|
}
|
|
417
435
|
const widgetId = expr.resourceAttr(WIDGET_RESOURCE_TYPE, scopedResourceLabel(ownerTfLabel, tsLabelToTfLabel(key), scope), ["id"]);
|
|
@@ -140,4 +140,4 @@ export const KNOWN_DASHBOARD_VIEW_ATTRS = new Set([
|
|
|
140
140
|
"display_order",
|
|
141
141
|
]);
|
|
142
142
|
/** Attributes `managedViewOrderFromTf` understands. */
|
|
143
|
-
export const KNOWN_MANAGED_VIEW_ORDER_ATTRS = new Set(["object_id", "view_ids"]);
|
|
143
|
+
export const KNOWN_MANAGED_VIEW_ORDER_ATTRS = new Set(["object_id", "view_ids", "delete_platform_default_list_view"]);
|
|
@@ -99,9 +99,10 @@ export interface RunAutomationWidget extends WidgetButtonStyle {
|
|
|
99
99
|
readonly type: "runAutomation";
|
|
100
100
|
readonly name: string;
|
|
101
101
|
/**
|
|
102
|
-
* The automation this button runs.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
102
|
+
* The automation this button runs. When the automation is not an authored
|
|
103
|
+
* file in this workspace, build looks it up by `name`, its display name.
|
|
104
|
+
* `displayName` is accepted for sources pulled before edk#1894 and wins
|
|
105
|
+
* when set; pull no longer prints it.
|
|
105
106
|
*/
|
|
106
107
|
readonly automation: AutomationRef & {
|
|
107
108
|
readonly displayName?: string;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
2
|
import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
|
|
3
3
|
import type { NormalizedWidget } from "../app/deserializer/normalize.js";
|
|
4
|
+
import { type UnextractedFieldOwner } from "../view/from-tf.js";
|
|
4
5
|
export interface WidgetOwner {
|
|
5
6
|
readonly type: "elementum_app" | "elementum_element";
|
|
6
7
|
readonly label: string;
|
|
7
8
|
readonly ownerRefName: string;
|
|
8
9
|
readonly ownerTfLabel: string;
|
|
9
10
|
readonly scope: ChildResourceScope;
|
|
11
|
+
/** The owner's extracted fields, so a field pull did not extract keeps its platform id (#1966). */
|
|
12
|
+
readonly unextracted?: UnextractedFieldOwner;
|
|
10
13
|
}
|
|
11
14
|
export declare function widgetsFromTf(blocks: readonly TfBlock[], owner: WidgetOwner, ctx: FromTfContext, dynamicLayoutCompanionLabels?: ReadonlySet<string>): NormalizedWidget[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
1
2
|
import { dataRefLabel, optionalBoolean, optionalString, plainObject, resourceRefLabel } from "../../engine/pull/context.js";
|
|
2
3
|
import { bareChildResourceLabel, isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
3
4
|
import { AUTOMATION_RESOURCE_TYPE } from "../automation/types.js";
|
|
@@ -6,6 +7,7 @@ import { SUB_TYPE_BY_RESOURCE } from "../field/types.js";
|
|
|
6
7
|
import { WIDGET_RESOURCE_TYPE } from "./module.js";
|
|
7
8
|
import { filterFromTf } from "../access-policy/from-tf.js";
|
|
8
9
|
import { resolveDataAspectTarget } from "../shared/aspect-target-from-tf.js";
|
|
10
|
+
import { bareForeignFieldIdRef, isBarePlatformId, isUnextractedFieldKey, resolveOwnDataFieldRef, unextractedFieldRefId } from "../view/from-tf.js";
|
|
9
11
|
const KNOWN_ROOT_ATTRS = new Set(["object_id", "related_object", "related_link_action", "related_create_action", "run_automation_action"]);
|
|
10
12
|
export function widgetsFromTf(blocks, owner, ctx, dynamicLayoutCompanionLabels = new Set()) {
|
|
11
13
|
const out = [];
|
|
@@ -101,6 +103,9 @@ function widgetFromTf(block, owner, ctx, dynamicLayoutCompanionLabels) {
|
|
|
101
103
|
ctx.diagnostics.push(`${where}.run_automation_action: automation_id is not resolvable; skipped`);
|
|
102
104
|
return undefined;
|
|
103
105
|
}
|
|
106
|
+
const droppedGap = typeof automation === "string" ? droppedAutomationGap(key, automation, owner, ctx) : undefined;
|
|
107
|
+
if (droppedGap !== undefined)
|
|
108
|
+
ctx.diagnostics.push(droppedGap);
|
|
104
109
|
const parametersRaw = body["parameters"];
|
|
105
110
|
const parameters = Array.isArray(parametersRaw)
|
|
106
111
|
? parametersRaw.flatMap((raw, index) => {
|
|
@@ -109,7 +114,7 @@ function widgetFromTf(block, owner, ctx, dynamicLayoutCompanionLabels) {
|
|
|
109
114
|
return [];
|
|
110
115
|
}
|
|
111
116
|
const rec = raw;
|
|
112
|
-
const field = ownerFieldRef(rec["field_id"], owner, ctx);
|
|
117
|
+
const field = keepUnextractedOwnerField(rec["field_id"], ownerFieldRef(rec["field_id"], owner, ctx), owner, ctx, `${where}.run_automation_action.parameters[${index}].field_id`);
|
|
113
118
|
return [{
|
|
114
119
|
name: typeof rec["name"] === "string" ? rec["name"] : "",
|
|
115
120
|
fieldType: typeof rec["field_type"] === "string" ? rec["field_type"] : "TEXT",
|
|
@@ -150,7 +155,7 @@ function columnsAndRows(attrs, target, owner, ctx, where) {
|
|
|
150
155
|
let columns;
|
|
151
156
|
if (Array.isArray(columnsRaw)) {
|
|
152
157
|
columns = columnsRaw.flatMap((value, index) => {
|
|
153
|
-
const decoded = widgetFieldRef(value, target, owner, ctx);
|
|
158
|
+
const decoded = keepUnextractedOwnerField(value, widgetFieldRef(value, target, owner, ctx), owner, ctx, `${where}.columns[${index}]`, target);
|
|
154
159
|
if (decoded === undefined) {
|
|
155
160
|
ctx.diagnostics.push(`${where}.columns[${index}]: field reference is not resolvable; dropped`);
|
|
156
161
|
return [];
|
|
@@ -266,6 +271,36 @@ function recordIdentityTarget(resourceType, target) {
|
|
|
266
271
|
const targetType = target.kind === "app" ? "elementum_app" : "elementum_element";
|
|
267
272
|
return resourceType === WIDGET_RESOURCE_TYPE || resourceType === targetType ? target : undefined;
|
|
268
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* A run-automation widget keeps a raw automation id as is. Pull warns, naming
|
|
276
|
+
* the widget and the automation, and continues (#1877) only when the
|
|
277
|
+
* automation is known to be dropped: the export listed it in
|
|
278
|
+
* omitted-automations.json (deleted, DISABLED or unrepresentable), or wrote
|
|
279
|
+
* no id at all. Any other raw id is a valid reference to an automation this
|
|
280
|
+
* pull does not export, such as another app's, which build emits as is, so
|
|
281
|
+
* it stays silent. Unlike an unextracted field reference (#1978), a dropped
|
|
282
|
+
* automation does not fail the pull.
|
|
283
|
+
*/
|
|
284
|
+
function droppedAutomationGap(widgetKey, automationId, owner, ctx) {
|
|
285
|
+
const entity = `widget ${JSON.stringify(widgetKey)} (${owner.ownerRefName})`;
|
|
286
|
+
if (automationId === "") {
|
|
287
|
+
return typedCoverageGap({
|
|
288
|
+
kind: "degraded",
|
|
289
|
+
entity,
|
|
290
|
+
detail: "its run-automation button has no automation id in the export",
|
|
291
|
+
consequence: "the widget is pulled with an empty automation id, so the button has nothing to run. Choose its automation in the platform and pull again, or remove the widget",
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
const omitted = ctx.omittedAutomationsById?.get(automationId);
|
|
295
|
+
if (omitted === undefined)
|
|
296
|
+
return undefined;
|
|
297
|
+
return typedCoverageGap({
|
|
298
|
+
kind: "degraded",
|
|
299
|
+
entity,
|
|
300
|
+
detail: `its run-automation button runs automation ${JSON.stringify(omitted.name)} (${automationId}), which the export left out: ${omitted.reason}`,
|
|
301
|
+
consequence: "the widget is pulled with the automation's raw platform id, and the EDK does not manage that automation; if it was deleted, the button cannot run. Fix or restore the automation in the platform and pull again, or remove the widget",
|
|
302
|
+
});
|
|
303
|
+
}
|
|
269
304
|
function automationRef(value, owner, ctx) {
|
|
270
305
|
if (typeof value === "string")
|
|
271
306
|
return value;
|
|
@@ -279,11 +314,11 @@ function automationRef(value, owner, ctx) {
|
|
|
279
314
|
// platform-managed, so it is not in source.
|
|
280
315
|
const exportedName = ctx.resourceByAddress?.(`${AUTOMATION_RESOURCE_TYPE}.${label}`)?.attrs["name"];
|
|
281
316
|
const displayName = typeof exportedName === "string" && exportedName !== "" ? exportedName : undefined;
|
|
317
|
+
// Like every catalog ref: refName is the key, name the display name.
|
|
282
318
|
return {
|
|
283
319
|
kind: "automation",
|
|
284
320
|
key,
|
|
285
321
|
name: displayName ?? key,
|
|
286
|
-
...(displayName !== undefined ? { displayName } : {}),
|
|
287
322
|
parent: owner.ownerRefName,
|
|
288
323
|
};
|
|
289
324
|
}
|
|
@@ -295,6 +330,68 @@ function ownerFieldRef(value, owner, ctx) {
|
|
|
295
330
|
const key = fieldKeyFromTfRef(value, owner.ownerTfLabel, owner.scope);
|
|
296
331
|
return key === undefined ? undefined : { kind: "field", key, name: key, parent: owner.ownerRefName, fieldType: "TEXT" };
|
|
297
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* An owner field reference whose field pull did not extract becomes the
|
|
335
|
+
* field's platform id, which build emits as is (#1966). Its key would build
|
|
336
|
+
* a reference to a field resource that is not in source, which breaks plan.
|
|
337
|
+
* With no id the pull fails with an authoring blocker naming the site
|
|
338
|
+
* (#1978).
|
|
339
|
+
*/
|
|
340
|
+
function keepUnextractedOwnerField(value, decoded, owner, ctx, site, columnsTarget) {
|
|
341
|
+
if (value === undefined || owner.unextracted === undefined || decoded === undefined)
|
|
342
|
+
return decoded;
|
|
343
|
+
if (typeof decoded === "string") {
|
|
344
|
+
if (ctx.cloning === undefined || decoded !== value || !isBarePlatformId(value))
|
|
345
|
+
return decoded;
|
|
346
|
+
// Clone: a raw id nothing resolved on the widget's own app is the source
|
|
347
|
+
// app's, so it fails naming the site unless an import shows another
|
|
348
|
+
// owner's field. A column of another app's or element's records is that
|
|
349
|
+
// target's field and keeps its id (#1991, Dax 11:45).
|
|
350
|
+
const foreignTarget = columnsTarget === undefined ? undefined : foreignWidgetTarget(columnsTarget, owner);
|
|
351
|
+
return foreignTarget === undefined
|
|
352
|
+
? unextractedFieldRefId(value, undefined, owner.unextracted, ctx, site)
|
|
353
|
+
: bareForeignFieldIdRef(value, owner.unextracted, ctx, site, foreignTarget);
|
|
354
|
+
}
|
|
355
|
+
if (decoded.kind !== "field" || decoded.parent !== owner.ownerRefName)
|
|
356
|
+
return decoded;
|
|
357
|
+
// An own-app data source decodes here with only the widget's refName, so
|
|
358
|
+
// ei's `elementum_app_<display name>_` label prefix stays on the key. Match
|
|
359
|
+
// it against the extracted fields the way views do: an extracted field
|
|
360
|
+
// keeps its real key, and one pull did not extract fails closed naming it
|
|
361
|
+
// (#1991).
|
|
362
|
+
const ownData = resolveOwnDataFieldRef(value, owner.unextracted, ctx, site);
|
|
363
|
+
if (ownData === "failedClosed")
|
|
364
|
+
return undefined;
|
|
365
|
+
if (ownData !== undefined) {
|
|
366
|
+
if (ownData.key === decoded.key)
|
|
367
|
+
return decoded;
|
|
368
|
+
// The decoded name came from the same unstripped label; use the data
|
|
369
|
+
// source's own name, else the key, as a resource reference would.
|
|
370
|
+
const dataLabel = dataRefLabel(value, "elementum_field");
|
|
371
|
+
return { ...decoded, key: ownData.key, name: (dataLabel === undefined ? undefined : ctx.dataName("elementum_field", dataLabel)) ?? ownData.key };
|
|
372
|
+
}
|
|
373
|
+
if (!isUnextractedFieldKey(decoded.key, owner.unextracted))
|
|
374
|
+
return decoded;
|
|
375
|
+
// A raw id the field registry does not know resolves through its import
|
|
376
|
+
// block, as in a view, so both report under one field address.
|
|
377
|
+
const registryKey = typeof value === "string" && ctx.foreignFieldRefsById?.get(value) === undefined ? undefined : decoded.key;
|
|
378
|
+
const ref = unextractedFieldRefId(value, registryKey, owner.unextracted, ctx, site);
|
|
379
|
+
// The guard above already knows this key is not extracted, so a key that
|
|
380
|
+
// comes back never means "keep the decoded ref". The resolver keeps an id,
|
|
381
|
+
// or fails closed with a blocker naming the site and the key, for every
|
|
382
|
+
// shape, a data source included (#1991).
|
|
383
|
+
return ref === registryKey ? undefined : ref;
|
|
384
|
+
}
|
|
385
|
+
/** How a widget's target reads in a diagnostic when it is not the widget's own app or element; undefined when it is. */
|
|
386
|
+
function foreignWidgetTarget(target, owner) {
|
|
387
|
+
if (typeof target === "string")
|
|
388
|
+
return `the widget's target ${target}`;
|
|
389
|
+
if (target.kind === owner.scope && target.key === owner.ownerRefName)
|
|
390
|
+
return undefined;
|
|
391
|
+
if (target.kind !== "app" && target.kind !== "element")
|
|
392
|
+
return undefined;
|
|
393
|
+
return `the widget's target ${target.kind} ${JSON.stringify(target.name || target.key)}`;
|
|
394
|
+
}
|
|
298
395
|
function fieldRefFromRawId(id, target, owner, ctx) {
|
|
299
396
|
if (id === "")
|
|
300
397
|
return undefined;
|
|
@@ -62,5 +62,20 @@ export interface WidgetsToTfOptions {
|
|
|
62
62
|
*/
|
|
63
63
|
readonly relationshipTargets?: readonly RelationshipTargetWire[];
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
/** Which authored widgets build declared, and which it skipped with a warning. */
|
|
66
|
+
export interface BuiltWidgets {
|
|
67
|
+
readonly built: ReadonlySet<string>;
|
|
68
|
+
readonly skipped: ReadonlySet<string>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The note for a layout reference to a widget build did not declare. A layout
|
|
72
|
+
* may reference only a built widget: a skipped widget's reference would be an
|
|
73
|
+
* undeclared resource, which fails plan (#1877), so the reference is dropped.
|
|
74
|
+
*/
|
|
75
|
+
export declare function unbuiltWidgetReferenceNote(where: string, key: string, scope: ChildResourceScope, ownerRefName: string, widgets: BuiltWidgets | undefined): string;
|
|
76
|
+
/** The widget resources, and which widgets they declare (see {@link unbuiltWidgetReferenceNote}). */
|
|
77
|
+
export declare function widgetsToTf(widgets: Readonly<Record<string, AppWidgetWire>> | undefined, opts: WidgetsToTfOptions): {
|
|
78
|
+
readonly blocks: TfBlock[];
|
|
79
|
+
readonly widgets: BuiltWidgets;
|
|
80
|
+
};
|
|
66
81
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
1
2
|
import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
2
3
|
import { foreignFieldDataLabel, resolveForeignRef } from "../shared/foreign-ref.js";
|
|
3
4
|
import { expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tfLabelToTsLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
4
5
|
import { AUTOMATION_RESOURCE_TYPE, automationResourceLabel } from "../automation/types.js";
|
|
5
6
|
import { fieldMetadataFromEntries } from "../field/metadata.js";
|
|
6
|
-
import { authoredFieldKeysFromPayload, fieldRefToTfValue, } from "../field/to-tf.js";
|
|
7
|
+
import { authoredFieldKeysFromPayload, droppedEntryGap, fieldLookupName, fieldRefToTfValue, unauthoredSiblingFieldRef, UNRESOLVED_FIELD_REF, } from "../field/to-tf.js";
|
|
7
8
|
import { runAutomationParameterValue } from "./build.js";
|
|
8
9
|
import { WIDGET_RESOURCE_TYPE } from "./module.js";
|
|
9
10
|
import { filterToTf } from "../access-policy/to-tf.js";
|
|
@@ -13,8 +14,20 @@ export function relationshipTargetsFromBag(relationships) {
|
|
|
13
14
|
refName: relationship.target?.refName,
|
|
14
15
|
}));
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The note for a layout reference to a widget build did not declare. A layout
|
|
19
|
+
* may reference only a built widget: a skipped widget's reference would be an
|
|
20
|
+
* undeclared resource, which fails plan (#1877), so the reference is dropped.
|
|
21
|
+
*/
|
|
22
|
+
export function unbuiltWidgetReferenceNote(where, key, scope, ownerRefName, widgets) {
|
|
23
|
+
return widgets?.skipped.has(key) === true
|
|
24
|
+
? `${where}: build skipped widget ${JSON.stringify(key)} (${ownerRefName}) (see its warning), so the layout reference is dropped; if that widget is already managed, the next apply deletes it`
|
|
25
|
+
: `${where}: widget ${JSON.stringify(key)} is not declared in this ${scope}; dropped`;
|
|
26
|
+
}
|
|
27
|
+
/** The widget resources, and which widgets they declare (see {@link unbuiltWidgetReferenceNote}). */
|
|
16
28
|
export function widgetsToTf(widgets, opts) {
|
|
17
29
|
const blocks = [];
|
|
30
|
+
const builtKeys = new Set();
|
|
18
31
|
for (const [key, widget] of Object.entries(widgets ?? {})) {
|
|
19
32
|
const where = `widgets.${key}`;
|
|
20
33
|
if (!isCanonicalTsLabel(key)) {
|
|
@@ -73,7 +86,7 @@ export function widgetsToTf(widgets, opts) {
|
|
|
73
86
|
break;
|
|
74
87
|
}
|
|
75
88
|
case "runAutomation": {
|
|
76
|
-
const automationId = resolveAutomation(widget.automation, `${where}.automation`, opts);
|
|
89
|
+
const automationId = resolveAutomation(widget.automation, key, `${where}.automation`, opts);
|
|
77
90
|
if (automationId === undefined)
|
|
78
91
|
continue;
|
|
79
92
|
const body = buttonBody(widget);
|
|
@@ -94,8 +107,10 @@ export function widgetsToTf(widgets, opts) {
|
|
|
94
107
|
label: scopedResourceLabel(opts.ownerTfLabel, tsLabelToTfLabel(key), opts.scope),
|
|
95
108
|
attrs,
|
|
96
109
|
});
|
|
110
|
+
builtKeys.add(key);
|
|
97
111
|
}
|
|
98
|
-
|
|
112
|
+
const skipped = new Set(Object.keys(widgets ?? {}).filter((key) => !builtKeys.has(key)));
|
|
113
|
+
return { blocks, widgets: { built: builtKeys, skipped } };
|
|
99
114
|
}
|
|
100
115
|
function diagnoseRelatedRecordsJoin(where, target, opts) {
|
|
101
116
|
if (target.refName === undefined || target.kind === undefined)
|
|
@@ -186,6 +201,29 @@ function resolveManagedSystemColumn(key, target) {
|
|
|
186
201
|
return undefined;
|
|
187
202
|
return fieldRefToTfValue("HANDLE", key, target.tfLabel, target.kind, target.fieldOwnership);
|
|
188
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* The aspect a column's field is built against. A resolved widget target wins.
|
|
206
|
+
* A raw target id has no kind; the column's `parent`, when it is an app or
|
|
207
|
+
* element in this workspace, is that aspect (#2087). Element wins over an app
|
|
208
|
+
* of the same refName unless only the app owns the field key.
|
|
209
|
+
*/
|
|
210
|
+
function columnAspect(value, target, where, opts) {
|
|
211
|
+
if (target.kind !== undefined)
|
|
212
|
+
return target;
|
|
213
|
+
const parent = value.parent;
|
|
214
|
+
if (parent === undefined || parent === "")
|
|
215
|
+
return target;
|
|
216
|
+
const kinds = ["element", "app"].filter((kind) => opts.workspaceAspects?.get(workspaceAspectKey(kind, parent)) !== undefined);
|
|
217
|
+
if (kinds.length === 0)
|
|
218
|
+
return target;
|
|
219
|
+
const refName = value.refName ?? "";
|
|
220
|
+
const owning = kinds.find((kind) => {
|
|
221
|
+
const aspect = opts.workspaceAspects?.get(workspaceAspectKey(kind, parent));
|
|
222
|
+
return authoredFieldKeysFromPayload(aspect?.streamRootEntity?.payload)?.has(refName) === true;
|
|
223
|
+
});
|
|
224
|
+
const kind = owning ?? kinds[0];
|
|
225
|
+
return resolveAspect({ __kind: kind, refName: parent, name: parent }, where, opts) ?? target;
|
|
226
|
+
}
|
|
189
227
|
function resolveColumns(columns, target, where, opts) {
|
|
190
228
|
const out = [];
|
|
191
229
|
for (const [index, value] of (columns ?? []).entries()) {
|
|
@@ -221,7 +259,7 @@ function resolveColumns(columns, target, where, opts) {
|
|
|
221
259
|
continue;
|
|
222
260
|
}
|
|
223
261
|
if (value == null) {
|
|
224
|
-
opts.diagnostics.push(`${where}[${index}]
|
|
262
|
+
opts.diagnostics.push(droppedEntryGap(`${where}[${index}]`, `${UNRESOLVED_FIELD_REF}; dropped`, "widget"));
|
|
225
263
|
continue;
|
|
226
264
|
}
|
|
227
265
|
const refName = value.refName ?? "";
|
|
@@ -233,17 +271,34 @@ function resolveColumns(columns, target, where, opts) {
|
|
|
233
271
|
opts.diagnostics.push(`${where}[${index}]: field belongs to ${JSON.stringify(value.parent)}, not target ${JSON.stringify(target.refName)}; dropped`);
|
|
234
272
|
continue;
|
|
235
273
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
274
|
+
// A target pull left as a raw id has no kind, but the column still names
|
|
275
|
+
// its parent app or element. Resolve the field there instead of dropping
|
|
276
|
+
// the column and planning an empty list (#2087).
|
|
277
|
+
const columnTarget = columnAspect(value, target, `${where}[${index}]`, opts);
|
|
278
|
+
if (columnTarget.managed && columnTarget.kind !== undefined && columnTarget.tfLabel !== undefined) {
|
|
279
|
+
const column = resolveManagedColumn(value, refName, columnTarget, opts);
|
|
280
|
+
// Another app's or element's field that its source doesn't have has no
|
|
281
|
+
// resource to reference (#1966): look it up on the platform by name
|
|
282
|
+
// below, as the export did. A ref with no name can't be resolved.
|
|
283
|
+
const ownTarget = columnTarget.kind === opts.scope && columnTarget.refName === opts.ownerRefName;
|
|
284
|
+
const unauthored = ownTarget
|
|
285
|
+
? undefined
|
|
286
|
+
: unauthoredSiblingFieldRef(column.refName, { kind: columnTarget.kind, refName: columnTarget.refName ?? refName, fieldOwnership: columnTarget.fieldOwnership });
|
|
287
|
+
if (unauthored !== undefined && fieldLookupName(value) === undefined) {
|
|
288
|
+
opts.diagnostics.push(droppedEntryGap(`${where}[${index}]`, `${unauthored}; dropped`, "widget"));
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
const direct = unauthored !== undefined
|
|
292
|
+
? undefined
|
|
293
|
+
: fieldRefToTfValue(column.fieldType, column.refName, columnTarget.tfLabel, columnTarget.kind, columnTarget.fieldOwnership);
|
|
239
294
|
if (direct !== undefined) {
|
|
240
295
|
out.push(direct);
|
|
241
296
|
continue;
|
|
242
297
|
}
|
|
243
298
|
}
|
|
244
|
-
if (
|
|
245
|
-
const label = foreignFieldDataLabel(
|
|
246
|
-
opts.orgRefs.foreignField("elementum_field", label,
|
|
299
|
+
if (columnTarget.kind !== undefined) {
|
|
300
|
+
const label = foreignFieldDataLabel(columnTarget.kind, columnTarget.tfLabel ?? columnTarget.refName ?? "target", value.name ?? refName);
|
|
301
|
+
opts.orgRefs.foreignField("elementum_field", label, columnTarget.value, value.name ?? refName);
|
|
247
302
|
out.push(expr.dataAttr("elementum_field", label, ["id"]));
|
|
248
303
|
continue;
|
|
249
304
|
}
|
|
@@ -303,7 +358,7 @@ function onDemandRecordParamForWidget(automation, opts) {
|
|
|
303
358
|
?.onDemandRecordParamByAutomationRefName
|
|
304
359
|
?.get(automation.refName);
|
|
305
360
|
}
|
|
306
|
-
function resolveAutomation(value, where, opts) {
|
|
361
|
+
function resolveAutomation(value, widgetKey, where, opts) {
|
|
307
362
|
if (typeof value === "string")
|
|
308
363
|
return value;
|
|
309
364
|
const refName = value?.refName ?? "";
|
|
@@ -321,10 +376,18 @@ function resolveAutomation(value, where, opts) {
|
|
|
321
376
|
if (authored !== undefined && !authored.has(refName)) {
|
|
322
377
|
// Not in source: pull leaves some automations platform-managed. Look the
|
|
323
378
|
// live one up by display name in this owner rather than reference a
|
|
324
|
-
// resource the build never declares.
|
|
325
|
-
|
|
379
|
+
// resource the build never declares. `name` is the display name; sources
|
|
380
|
+
// pulled before edk#1894 carry it in `displayName` instead.
|
|
381
|
+
const displayName = value?.displayName ?? value?.name ?? "";
|
|
326
382
|
if (displayName === "") {
|
|
327
|
-
|
|
383
|
+
// Warn and keep building the rest (#1877). The caller skips the widget
|
|
384
|
+
// and every layout drops its reference, so plan still validates.
|
|
385
|
+
opts.diagnostics.push(typedCoverageGap({
|
|
386
|
+
kind: "skipped",
|
|
387
|
+
entity: `widget ${JSON.stringify(widgetKey)} (${opts.ownerRefName})`,
|
|
388
|
+
detail: `its automation ${JSON.stringify(refName)} is not in source, and the reference has no display name to look the live automation up by, so the widget is skipped`,
|
|
389
|
+
consequence: "it is not built, and build removes it from every layout that places it; if the widget is already managed, the next plan deletes it. If this source was pulled before #1901, pull it again; otherwise restore the automation in source or remove the widget",
|
|
390
|
+
}));
|
|
328
391
|
return undefined;
|
|
329
392
|
}
|
|
330
393
|
const label = `${opts.ownerTfLabel}_${tsLabelToTfLabel(refName)}`;
|
|
@@ -167,7 +167,7 @@ export type ListControlsOption = {
|
|
|
167
167
|
/**
|
|
168
168
|
* Customer-facing name: Record list
|
|
169
169
|
* Customer-facing description: A compact stacked list of records with titles and status pills. Use it for queues and pickers.
|
|
170
|
-
* Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. To share a ListControls filter, bind filterJson and use the same filterPreset on this list; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent list seed. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
|
|
170
|
+
* Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. Optional density: "compact" | "standard" | "comfortable" (List View names); omit to keep today’s spacing. Live lists show a matching record count in the collection footer. Optional fields is an ordered string[] of real aspect field ids shown as Ken-style labeled attributes under each title (user/group avatars, picklist color, locale dates, number/currency). Omit fields to keep today’s fixed system pills; when fields is set, do not also expect those pills. Never invent field UUIDs; resolve ids from Owning App fields when the admin asks in plain language (for example "show Team and Priority on each row"). To share a ListControls filter, bind filterJson and use the same filterPreset on this list; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent list seed. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
|
|
171
171
|
*/
|
|
172
172
|
export type ListCollectionBlockElement = {
|
|
173
173
|
readonly type: "ListCollectionBlock";
|
|
@@ -187,6 +187,7 @@ export type ListCollectionBlockPresentationalProps = {
|
|
|
187
187
|
readonly groupBy?: ((string) | (PropExpression)) | (null);
|
|
188
188
|
readonly sortBy?: ((string) | (PropExpression)) | (null);
|
|
189
189
|
readonly sortDirection?: ("ASC" | "DESC") | (PropExpression);
|
|
190
|
+
readonly density?: ("compact" | "standard" | "comfortable") | (PropExpression);
|
|
190
191
|
readonly status?: ("idle" | "loading" | "error") | (PropExpression);
|
|
191
192
|
readonly loadingMessage?: (string) | (PropExpression);
|
|
192
193
|
readonly errorMessage?: (string) | (PropExpression);
|
|
@@ -220,6 +221,7 @@ export type ListCollectionBlockSelfFetchingProps = {
|
|
|
220
221
|
readonly groupBy?: ((string) | (PropExpression)) | (null);
|
|
221
222
|
readonly sortBy?: ((string) | (PropExpression)) | (null);
|
|
222
223
|
readonly sortDirection?: ("ASC" | "DESC") | (PropExpression);
|
|
224
|
+
readonly density?: ("compact" | "standard" | "comfortable") | (PropExpression);
|
|
223
225
|
readonly status?: ("idle" | "loading" | "error") | (PropExpression);
|
|
224
226
|
readonly loadingMessage?: (string) | (PropExpression);
|
|
225
227
|
readonly errorMessage?: (string) | (PropExpression);
|
|
@@ -241,6 +243,7 @@ export type ListCollectionBlockSelfFetchingProps = {
|
|
|
241
243
|
}) | (PropExpression);
|
|
242
244
|
readonly pageSize?: (((25) | (PropExpression)) | ((50) | (PropExpression)) | ((100) | (PropExpression))) | (PropExpression);
|
|
243
245
|
readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
|
|
246
|
+
readonly fields?: (ReadonlyArray<string>) | (PropExpression);
|
|
244
247
|
};
|
|
245
248
|
/**
|
|
246
249
|
* Customer-facing name: Header
|
|
@@ -416,7 +419,7 @@ export type CardBlockProps = {
|
|
|
416
419
|
/**
|
|
417
420
|
* Customer-facing name: Data table
|
|
418
421
|
* Customer-facing description: A spreadsheet-style table with typed columns for structured rows.
|
|
419
|
-
* Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId
|
|
422
|
+
* Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId with record columns for live records; self-fetching falls back to the runtime default aspect. Optional density: "compact" | "standard" | "comfortable" (List View names); omit to keep today’s spacing. Self-fetching columns are registered system keys (handle, title, status, priority, assignee, assignmentGroup, createdBy, createdTime, updatedAt, stage) and/or real aspect field ids - never invent field UUIDs - as strings, or { key, width?, minWidth?, maxWidth? } for admin default widths (key is the same system key or field id). Prefer semantic system keys when they exist. Optional columnHeaders maps the same column string to a display label; omit to use i18n/system headers or the field name from aspect metadata. Object columns with header/type/align select the presentational branch. Live tables show a matching record count in the collection footer; CMV users may resize columns (browser-local, not written back to Spec). Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind filterJson and use the same filterPreset on this table; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent table seed. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
|
|
420
423
|
*/
|
|
421
424
|
export type DataTableBlockElement = {
|
|
422
425
|
readonly type: "DataTableBlock";
|
|
@@ -432,6 +435,7 @@ export type DataTableBlockProps = (DataTableBlockPresentationalProps) | (DataTab
|
|
|
432
435
|
export type DataTableBlockPresentationalProps = {
|
|
433
436
|
readonly selectedId?: ((string) | (PropExpression)) | (null);
|
|
434
437
|
readonly showHeader?: (boolean) | (PropExpression);
|
|
438
|
+
readonly density?: ("compact" | "standard" | "comfortable") | (PropExpression);
|
|
435
439
|
readonly loadingMessage?: (string) | (PropExpression);
|
|
436
440
|
readonly errorMessage?: (string) | (PropExpression);
|
|
437
441
|
readonly emptyMessage?: (string) | (PropExpression);
|
|
@@ -475,11 +479,15 @@ export type DataTableMessages = {
|
|
|
475
479
|
export type DataTableBlockSelfFetchingProps = {
|
|
476
480
|
readonly selectedId?: ((string) | (PropExpression)) | (null);
|
|
477
481
|
readonly showHeader?: (boolean) | (PropExpression);
|
|
482
|
+
readonly density?: ("compact" | "standard" | "comfortable") | (PropExpression);
|
|
478
483
|
readonly loadingMessage?: (string) | (PropExpression);
|
|
479
484
|
readonly errorMessage?: (string) | (PropExpression);
|
|
480
485
|
readonly emptyMessage?: (string) | (PropExpression);
|
|
481
486
|
readonly aspectId?: (string) | (PropExpression);
|
|
482
|
-
readonly columns?: (ReadonlyArray<
|
|
487
|
+
readonly columns?: (ReadonlyArray<DataTableSelfFetchingColumn>) | (PropExpression);
|
|
488
|
+
readonly columnHeaders?: ({
|
|
489
|
+
readonly [key: string]: string;
|
|
490
|
+
}) | (PropExpression);
|
|
483
491
|
readonly searchValue?: (string) | (PropExpression);
|
|
484
492
|
readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
|
|
485
493
|
readonly [key: string]: OpaqueJson;
|
|
@@ -499,6 +507,15 @@ export type DataTableBlockSelfFetchingProps = {
|
|
|
499
507
|
readonly selectedAspectId?: ((string) | (PropExpression)) | (null);
|
|
500
508
|
readonly selectedHandle?: ((string) | (PropExpression)) | (null);
|
|
501
509
|
};
|
|
510
|
+
export type DataTableSelfFetchingColumn = (string) | ({
|
|
511
|
+
/**
|
|
512
|
+
* Registered system key or real aspect field id (same as a string column).
|
|
513
|
+
*/
|
|
514
|
+
readonly key: string;
|
|
515
|
+
readonly width?: (string) | (number);
|
|
516
|
+
readonly minWidth?: (string) | (number);
|
|
517
|
+
readonly maxWidth?: (string) | (number);
|
|
518
|
+
});
|
|
502
519
|
/**
|
|
503
520
|
* Customer-facing name: Action cards
|
|
504
521
|
* Customer-facing description: Clickable tiles with an icon, title, and short description. Use them to choose a topic or action.
|
|
@@ -622,7 +639,7 @@ export type ChartBlockRelativeRange = {
|
|
|
622
639
|
/**
|
|
623
640
|
* Customer-facing name: Metrics
|
|
624
641
|
* Customer-facing description: A single KPI tile with a caption and prominent value.
|
|
625
|
-
* Internal authoring guidance: Single read-only KPI tile with a caption, prominent value, and optional static subtext below successful results. Use formattedValue for a complete display-ready metric, or calc for live Aspect.calculation data with optional explicit aspectId (otherwise the managed-view default), filterJson/filterPreset, quickFilterValue, number format, empty copy, and color
|
|
642
|
+
* Internal authoring guidance: Single read-only KPI tile with a caption, prominent value, and optional static subtext below successful results. Use formattedValue for a complete display-ready metric, or calc for live Aspect.calculation data with optional explicit aspectId (otherwise the managed-view default), filterJson/filterPreset, quickFilterValue, number format, empty copy, and color (none, info, success, warning, critical) with colorStyle (border or full; border when omitted) or ordered colorRules against the value to tint the tile; never use the legacy color values default, muted, primary, or error. Set showBackingList true on the self-fetch branch to show a fullscreen control that opens the records matching this metric. Bind filterJson and use the same filterPreset as ListControls when the KPI should share its view filter; give the metric its own filterPreset/filterJson without that binding when it should measure a different slice. Each MetricsRowBlock renders exactly one KPI; compose several independent tiles in RowBlock. Prefer ChartBlock when the result needs a bar, line, donut, category comparison, or trend.
|
|
626
643
|
*/
|
|
627
644
|
export type MetricsRowBlockElement = {
|
|
628
645
|
readonly type: "MetricsRowBlock";
|
|
@@ -638,13 +655,14 @@ export type MetricsRowBlockProps = (MetricsRowPresentationalProps) | (MetricsRow
|
|
|
638
655
|
export type MetricsRowPresentationalProps = {
|
|
639
656
|
readonly title?: (string) | (PropExpression);
|
|
640
657
|
readonly subtext?: (string) | (PropExpression);
|
|
641
|
-
readonly color?: ("
|
|
658
|
+
readonly color?: ("none" | "info" | "success" | "warning" | "critical" | "default" | "primary" | "muted" | "error") | (PropExpression);
|
|
659
|
+
readonly colorStyle?: ("none" | "border" | "full") | (PropExpression);
|
|
642
660
|
readonly colorRules?: (ReadonlyArray<{
|
|
643
661
|
readonly when: ("negative" | "positive" | "zero") | ({
|
|
644
662
|
readonly op: "lt" | "lte" | "gt" | "gte" | "eq";
|
|
645
663
|
readonly value: number;
|
|
646
664
|
});
|
|
647
|
-
readonly color: "
|
|
665
|
+
readonly color: "none" | "info" | "success" | "warning" | "critical" | "default" | "primary" | "muted" | "error";
|
|
648
666
|
}>) | (PropExpression);
|
|
649
667
|
readonly format?: ({
|
|
650
668
|
readonly style?: ("decimal" | "currency" | "percent") | (PropExpression);
|
|
@@ -657,13 +675,14 @@ export type MetricsRowPresentationalProps = {
|
|
|
657
675
|
export type MetricsRowSelfFetchProps = {
|
|
658
676
|
readonly title?: (string) | (PropExpression);
|
|
659
677
|
readonly subtext?: (string) | (PropExpression);
|
|
660
|
-
readonly color?: ("
|
|
678
|
+
readonly color?: ("none" | "info" | "success" | "warning" | "critical" | "default" | "primary" | "muted" | "error") | (PropExpression);
|
|
679
|
+
readonly colorStyle?: ("none" | "border" | "full") | (PropExpression);
|
|
661
680
|
readonly colorRules?: (ReadonlyArray<{
|
|
662
681
|
readonly when: ("negative" | "positive" | "zero") | ({
|
|
663
682
|
readonly op: "lt" | "lte" | "gt" | "gte" | "eq";
|
|
664
683
|
readonly value: number;
|
|
665
684
|
});
|
|
666
|
-
readonly color: "
|
|
685
|
+
readonly color: "none" | "info" | "success" | "warning" | "critical" | "default" | "primary" | "muted" | "error";
|
|
667
686
|
}>) | (PropExpression);
|
|
668
687
|
readonly format?: ({
|
|
669
688
|
readonly style?: ("decimal" | "currency" | "percent") | (PropExpression);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by `npm run generate:ragnarok` — do not edit. Refresh with `npm run refresh:ragnarok`.
|
|
2
|
-
// Source: urn:elementum:elementum-blocks:spec:v1 version 1.
|
|
3
|
-
// Schema sha256:
|
|
2
|
+
// Source: urn:elementum:elementum-blocks:spec:v1 version 1.41.0
|
|
3
|
+
// Schema sha256: 5af10bfafbb6818214da147ed26630a9f4eddaa6dbd6cbc289a2d9fbe30ee589
|
|
4
4
|
// Generator revision: 2
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field resource types, in a leaf module (#1859). The kind registry
|
|
3
|
+
* (`./index.js`, `./modules.ts`) and `./resource-types.ts` both import entity
|
|
4
|
+
* modules that reach `src/engine/pull/`, so pull code that reads these through
|
|
5
|
+
* either one closes an import cycle: whichever module loads first sees the
|
|
6
|
+
* other half-initialized (the CLI binary's workspace loader then lists
|
|
7
|
+
* `undefined` kinds). This module imports only the field sub-type table.
|
|
8
|
+
*/
|
|
9
|
+
import { FIELD_RESOURCE_TYPES } from "../entities/field/types.js";
|
|
10
|
+
/** Every field resource type. An owner's fields share one bag key space. */
|
|
11
|
+
export const FIELD_RESOURCE_TYPE_SET = new Set(FIELD_RESOURCE_TYPES);
|