forest-cli 5.24.3 → 5.25.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/dist/services/dumpers/agent-nodejs.d.ts.map +1 -1
- package/dist/services/dumpers/agent-nodejs.js +11 -4
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/back.hbs +1 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/back.js +154 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/component.js +154 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/data-map.css +416 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/data-map.hbs +99 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/data-map.js +243 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/demo-guide.css +278 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/demo-guide.hbs +38 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/demo-guide.js +353 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-activity.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-agent.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-ai.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-charts.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-collections.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-custom-components.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-inboxes.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-roles.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-segments.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-smart-actions.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-workflows.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-workspaces.js +124 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature.css +1109 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature.hbs +286 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/go-to.hbs +4 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/go-to.js +217 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/kyc-flow.css +580 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/kyc-flow.hbs +80 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/kyc-flow.js +49 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/run-action.hbs +3 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/run-action.js +96 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/select-first.css +131 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/select-first.hbs +4 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/select-first.js +205 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/senior-guide.hbs +39 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/senior-guide.js +189 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/style.css +372 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/template.hbs +83 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/forest-layout.json +52897 -8498
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/203696b1-e9ca-45f3-9bd3-5bc6fb4fd8c3.bpmn +161 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/2bc0c0ff-486c-44b1-ae31-3de204f7b14f.bpmn +107 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/4b37a274-117f-4c2d-96ad-21d1be4d0bc7.bpmn +159 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/56ff9484-8308-4971-9e02-3de5eea2e240.bpmn +67 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/619e3e88-4a9c-4f02-84fb-732c16f9b5bf.bpmn +43 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/76516b9e-aac0-4f7b-9794-8f86c529531b.bpmn +75 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/86b4fc1e-b10a-4906-9fd1-e601eaad83c0.bpmn +81 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/92b119e5-c908-48d1-9a0d-23173c57bd5b.bpmn +47 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/92c02240-9c8a-49e7-9993-077af3e1ddcc.bpmn +77 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/aac25aee-f626-40a8-9459-d2a933fb8446.bpmn +105 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/b269dbff-5fde-401f-a05b-76a7dac79387.bpmn +75 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/d8b208a9-fc71-4005-acb9-ba5fedd2499f.bpmn +73 -0
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/e3abab67-7bc6-4a44-9848-c7f83a55a56d.bpmn +71 -0
- package/dist/services/dumpers/templates/agent-nodejs/javascript/index.hbs +45 -4
- package/dist/services/dumpers/templates/agent-nodejs/typescript/index.hbs +45 -4
- package/dist/utils/messages.js +2 -2
- package/oclif.manifest.json +376 -376
- package/package.json +6 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/30d581e3-294e-4790-b723-0f16509ecae0.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/52e0acb4-6064-472a-9823-cdfd7fa7a3ab.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/71f692b4-fe4f-476d-8251-fdc5af1ec51e.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/9d564d80-19d1-4ce4-bb4b-aaf41e7ef5b6.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/c8ab4b5d-20df-4d28-9160-0d4376282c90.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/d0289f67-2c9e-4c69-b1ee-ecbbace841b3.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/d07aa5ee-9a49-4916-a1b5-1f953bfe9a8e.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/e25c6237-b882-498b-9655-b16b30131b10.bpmn +0 -2
- package/dist/services/dumpers/templates/agent-nodejs/common/workflows/f01b9e61-4156-47b8-b6a1-5c90adbcd2ba.bpmn +0 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* eslint-disable import/no-unresolved -- runs inside the Forest app, which provides these */
|
|
2
|
+
/* eslint-env browser */
|
|
3
|
+
/**
|
|
4
|
+
* A feature explainer's workspace Custom component (generated by charts/features.js
|
|
5
|
+
* once per feature, with that feature's content written in). Its only way out is the Hub, plus
|
|
6
|
+
* the buttons that open the place in the demo where the feature shows.
|
|
7
|
+
*/
|
|
8
|
+
import { action } from '@ember/object';
|
|
9
|
+
import { inject as service } from '@ember/service';
|
|
10
|
+
import Component from '@glimmer/component';
|
|
11
|
+
import { tracked } from '@glimmer/tracking';
|
|
12
|
+
|
|
13
|
+
// Written at build time (scripts/build-public.js): the feature, its facts, the Hub's workspace id.
|
|
14
|
+
const FEATURE = {"hubId":"30b652d1-5f0e-4556-8a96-4863f009eb85","workspaceId":"df6f1e14-8e6e-441f-8a36-ac38932019d6","position":9,"total":12,"key":"roles","icon":"🔐","name":"Roles, teams & permissions","promise":"Analysts see what they need and do what they may; the MLRO signs, the rest cannot.","hubWhere":"This demo runs as the Operations team. Project settings, Roles.","what":["Teams decide what people see: each team has its own layout, desks and inboxes. Compliance does not have to see the payments queues.","Roles decide what people may do, table by table (see, create, edit, delete, export) and action by action (run it, need approval, approve).","A user belongs to one or more teams, with one role. Admins manage all of it in Project settings."],"facts":[],"liveText":"This demo runs as the Operations team, and you are its admin: every desk and every action is open to you. Open Project settings (top-right menu), then Roles and Teams, to see where it is set.","setup":["Project settings (top-right menu), Teams: create “Compliance”, “Payments”, add people.","Project settings, Roles: create “Analyst”, “MLRO”; per table, tick list, details, create, update, delete, export.","Per Smart Action: trigger, require approval, approve, self-approve.","Switch team (top bar) to lay out each team’s desks: layouts are per team and environment."],"docs":"https://docs.forest.app/get-started/control/roles-permissions.md","art":"roles","buttons":[]}
|
|
15
|
+
|
|
16
|
+
const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
17
|
+
|
|
18
|
+
/** "records.customers" in the chart's answer, or undefined. */
|
|
19
|
+
const pick = (facts, dotted) =>
|
|
20
|
+
dotted.split('.').reduce((value, key) => (value == null ? undefined : value[key]), facts);
|
|
21
|
+
const format = value => (typeof value === 'number' ? value.toLocaleString('en-GB') : value);
|
|
22
|
+
|
|
23
|
+
export default class extends Component {
|
|
24
|
+
@service lianaServerFetch;
|
|
25
|
+
|
|
26
|
+
@service router;
|
|
27
|
+
|
|
28
|
+
@tracked liveFacts = null;
|
|
29
|
+
|
|
30
|
+
@tracked liveStatus = 'loading';
|
|
31
|
+
|
|
32
|
+
feature = FEATURE;
|
|
33
|
+
|
|
34
|
+
// One flag per illustration: the template shows the one whose flag is set.
|
|
35
|
+
art = { [FEATURE.art]: true };
|
|
36
|
+
|
|
37
|
+
steps = FEATURE.setup.map((text, i) => ({ number: i + 1, text }));
|
|
38
|
+
|
|
39
|
+
hasFacts = FEATURE.facts.length > 0;
|
|
40
|
+
|
|
41
|
+
constructor(...args) {
|
|
42
|
+
super(...args);
|
|
43
|
+
if (FEATURE.facts.some(f => f.live)) this.loadFacts();
|
|
44
|
+
else this.liveStatus = 'none';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadFacts() {
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.lianaServerFetch.fetch('/forest/_charts/feature_facts', {});
|
|
50
|
+
if (!response.ok) throw new Error(`feature_facts: ${response.status}`);
|
|
51
|
+
this.liveFacts = await response.json();
|
|
52
|
+
this.liveStatus = 'ok';
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.liveStatus = 'failed';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Static facts as they are; live ones once the chart answers ("…" until then, "–" if not). */
|
|
59
|
+
get facts() {
|
|
60
|
+
return FEATURE.facts.map(f => {
|
|
61
|
+
if (!f.live) return { label: f.label, value: format(f.value), live: false };
|
|
62
|
+
const value = this.liveFacts ? pick(this.liveFacts, f.live) : undefined;
|
|
63
|
+
let shown = '…';
|
|
64
|
+
if (value !== undefined) shown = format(value);
|
|
65
|
+
else if (this.liveStatus === 'failed' || this.liveFacts) shown = '–';
|
|
66
|
+
|
|
67
|
+
return { label: f.label, value: shown, live: true };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get liveNote() {
|
|
72
|
+
if (this.liveStatus === 'ok') return 'Live from this demo’s data.';
|
|
73
|
+
if (this.liveStatus === 'failed') return 'Live figures unavailable: is the agent running?';
|
|
74
|
+
if (this.liveStatus === 'loading') return 'Counting…';
|
|
75
|
+
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The current url with the workspace id swapped: no need to know Forest's url scheme. */
|
|
80
|
+
static workspacePath(workspaceId) {
|
|
81
|
+
const path = window.location.pathname;
|
|
82
|
+
const ids = path.match(UUID) || [];
|
|
83
|
+
const current =
|
|
84
|
+
FEATURE.workspaceId && path.includes(FEATURE.workspaceId)
|
|
85
|
+
? FEATURE.workspaceId
|
|
86
|
+
: ids[ids.length - 1];
|
|
87
|
+
if (!current) return null;
|
|
88
|
+
const at = path.lastIndexOf(current);
|
|
89
|
+
|
|
90
|
+
return `${path.slice(0, at)}${workspaceId}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A table's list, assuming /<project>/<environment>/<team>/data/<table>/index. */
|
|
94
|
+
static tablePath(collection) {
|
|
95
|
+
const [project, environment, team] = window.location.pathname.split('/').filter(Boolean);
|
|
96
|
+
|
|
97
|
+
return `/${project}/${environment}/${team}/data/${collection}/index`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Inside the app when the router knows the url, else a full page load. */
|
|
101
|
+
go(path) {
|
|
102
|
+
if (!path) return;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const transition = this.router.transitionTo(path);
|
|
106
|
+
transition?.catch?.(error => {
|
|
107
|
+
if (error?.name !== 'TransitionAborted') window.location.assign(path);
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
window.location.assign(path);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@action
|
|
115
|
+
openHub() {
|
|
116
|
+
this.go(this.constructor.workspacePath(FEATURE.hubId));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@action
|
|
120
|
+
open(button) {
|
|
121
|
+
if (button.workspaceId) this.go(this.constructor.workspacePath(button.workspaceId));
|
|
122
|
+
else if (button.collection) this.go(this.constructor.tablePath(button.collection));
|
|
123
|
+
}
|
|
124
|
+
}
|
package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-segments.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* eslint-disable import/no-unresolved -- runs inside the Forest app, which provides these */
|
|
2
|
+
/* eslint-env browser */
|
|
3
|
+
/**
|
|
4
|
+
* A feature explainer's workspace Custom component (generated by charts/features.js
|
|
5
|
+
* once per feature, with that feature's content written in). Its only way out is the Hub, plus
|
|
6
|
+
* the buttons that open the place in the demo where the feature shows.
|
|
7
|
+
*/
|
|
8
|
+
import { action } from '@ember/object';
|
|
9
|
+
import { inject as service } from '@ember/service';
|
|
10
|
+
import Component from '@glimmer/component';
|
|
11
|
+
import { tracked } from '@glimmer/tracking';
|
|
12
|
+
|
|
13
|
+
// Written at build time (scripts/build-public.js): the feature, its facts, the Hub's workspace id.
|
|
14
|
+
const FEATURE = {"hubId":"30b652d1-5f0e-4556-8a96-4863f009eb85","workspaceId":"3822638d-f3ec-41f3-8bd4-136d7e01dc26","position":2,"total":12,"key":"segments","icon":"🔖","name":"Segments","promise":"Saved lists your whole team shares: “transfers to validate” is one click away.","hubWhere":"Alerts table: AML alerts to review, Fraud and takeover alerts.","what":["A segment is a saved filter on a collection, with a name. Everyone on the team sees the same rows, kept up to date as the data changes.","Build one with the filter builder, with a SQL query, or in the agent’s code when the rule is too rich for a filter.","Segments are the bricks of the rest: the queues that hand out cases are built on them, and the desks’ counters count them."],"facts":[{"value":21,"label":"segments in this demo"},{"live":"queues.alerts_aml","label":"waiting in “AML alerts”"},{"live":"queues.transfers_validate","label":"waiting in “Transfers to validate”"},{"live":"queues.disputes_new","label":"waiting in “New disputes”"}],"setup":["Turn on the Layout Editor, click the cog next to the table, open the Segments tab.","Click “+ New segment”, name it, add the filters (say Validation status is Pending), pick a sort.","Save, then switch it on: new segments start disabled.","Or filter the list first and save it as a segment from there."],"docs":"https://docs.forest.app/product/process/segments/creating-segments.md","art":"segments","buttons":[{"label":"Open Alerts","workspaceId":null,"collection":"alerts"},{"label":"Open Outgoing transfers","workspaceId":null,"collection":"outgoing_transfers"}]}
|
|
15
|
+
|
|
16
|
+
const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
17
|
+
|
|
18
|
+
/** "records.customers" in the chart's answer, or undefined. */
|
|
19
|
+
const pick = (facts, dotted) =>
|
|
20
|
+
dotted.split('.').reduce((value, key) => (value == null ? undefined : value[key]), facts);
|
|
21
|
+
const format = value => (typeof value === 'number' ? value.toLocaleString('en-GB') : value);
|
|
22
|
+
|
|
23
|
+
export default class extends Component {
|
|
24
|
+
@service lianaServerFetch;
|
|
25
|
+
|
|
26
|
+
@service router;
|
|
27
|
+
|
|
28
|
+
@tracked liveFacts = null;
|
|
29
|
+
|
|
30
|
+
@tracked liveStatus = 'loading';
|
|
31
|
+
|
|
32
|
+
feature = FEATURE;
|
|
33
|
+
|
|
34
|
+
// One flag per illustration: the template shows the one whose flag is set.
|
|
35
|
+
art = { [FEATURE.art]: true };
|
|
36
|
+
|
|
37
|
+
steps = FEATURE.setup.map((text, i) => ({ number: i + 1, text }));
|
|
38
|
+
|
|
39
|
+
hasFacts = FEATURE.facts.length > 0;
|
|
40
|
+
|
|
41
|
+
constructor(...args) {
|
|
42
|
+
super(...args);
|
|
43
|
+
if (FEATURE.facts.some(f => f.live)) this.loadFacts();
|
|
44
|
+
else this.liveStatus = 'none';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadFacts() {
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.lianaServerFetch.fetch('/forest/_charts/feature_facts', {});
|
|
50
|
+
if (!response.ok) throw new Error(`feature_facts: ${response.status}`);
|
|
51
|
+
this.liveFacts = await response.json();
|
|
52
|
+
this.liveStatus = 'ok';
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.liveStatus = 'failed';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Static facts as they are; live ones once the chart answers ("…" until then, "–" if not). */
|
|
59
|
+
get facts() {
|
|
60
|
+
return FEATURE.facts.map(f => {
|
|
61
|
+
if (!f.live) return { label: f.label, value: format(f.value), live: false };
|
|
62
|
+
const value = this.liveFacts ? pick(this.liveFacts, f.live) : undefined;
|
|
63
|
+
let shown = '…';
|
|
64
|
+
if (value !== undefined) shown = format(value);
|
|
65
|
+
else if (this.liveStatus === 'failed' || this.liveFacts) shown = '–';
|
|
66
|
+
|
|
67
|
+
return { label: f.label, value: shown, live: true };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get liveNote() {
|
|
72
|
+
if (this.liveStatus === 'ok') return 'Live from this demo’s data.';
|
|
73
|
+
if (this.liveStatus === 'failed') return 'Live figures unavailable: is the agent running?';
|
|
74
|
+
if (this.liveStatus === 'loading') return 'Counting…';
|
|
75
|
+
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The current url with the workspace id swapped: no need to know Forest's url scheme. */
|
|
80
|
+
static workspacePath(workspaceId) {
|
|
81
|
+
const path = window.location.pathname;
|
|
82
|
+
const ids = path.match(UUID) || [];
|
|
83
|
+
const current =
|
|
84
|
+
FEATURE.workspaceId && path.includes(FEATURE.workspaceId)
|
|
85
|
+
? FEATURE.workspaceId
|
|
86
|
+
: ids[ids.length - 1];
|
|
87
|
+
if (!current) return null;
|
|
88
|
+
const at = path.lastIndexOf(current);
|
|
89
|
+
|
|
90
|
+
return `${path.slice(0, at)}${workspaceId}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A table's list, assuming /<project>/<environment>/<team>/data/<table>/index. */
|
|
94
|
+
static tablePath(collection) {
|
|
95
|
+
const [project, environment, team] = window.location.pathname.split('/').filter(Boolean);
|
|
96
|
+
|
|
97
|
+
return `/${project}/${environment}/${team}/data/${collection}/index`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Inside the app when the router knows the url, else a full page load. */
|
|
101
|
+
go(path) {
|
|
102
|
+
if (!path) return;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const transition = this.router.transitionTo(path);
|
|
106
|
+
transition?.catch?.(error => {
|
|
107
|
+
if (error?.name !== 'TransitionAborted') window.location.assign(path);
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
window.location.assign(path);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@action
|
|
115
|
+
openHub() {
|
|
116
|
+
this.go(this.constructor.workspacePath(FEATURE.hubId));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@action
|
|
120
|
+
open(button) {
|
|
121
|
+
if (button.workspaceId) this.go(this.constructor.workspacePath(button.workspaceId));
|
|
122
|
+
else if (button.collection) this.go(this.constructor.tablePath(button.collection));
|
|
123
|
+
}
|
|
124
|
+
}
|
package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-smart-actions.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* eslint-disable import/no-unresolved -- runs inside the Forest app, which provides these */
|
|
2
|
+
/* eslint-env browser */
|
|
3
|
+
/**
|
|
4
|
+
* A feature explainer's workspace Custom component (generated by charts/features.js
|
|
5
|
+
* once per feature, with that feature's content written in). Its only way out is the Hub, plus
|
|
6
|
+
* the buttons that open the place in the demo where the feature shows.
|
|
7
|
+
*/
|
|
8
|
+
import { action } from '@ember/object';
|
|
9
|
+
import { inject as service } from '@ember/service';
|
|
10
|
+
import Component from '@glimmer/component';
|
|
11
|
+
import { tracked } from '@glimmer/tracking';
|
|
12
|
+
|
|
13
|
+
// Written at build time (scripts/build-public.js): the feature, its facts, the Hub's workspace id.
|
|
14
|
+
const FEATURE = {"hubId":"30b652d1-5f0e-4556-8a96-4863f009eb85","workspaceId":"8da7be9d-4b5c-4916-8e38-36c0f1a6004d","position":5,"total":12,"key":"smart-actions","icon":"⚡","name":"Smart Actions","promise":"Your business operations as buttons: a form, your code runs, a card shows what it did.","hubWhere":"MLRO desk: File SAR. Disputes desk: Route dispute, File with network.","what":["A Smart Action is a button on a record that runs your own code in the agent: approve a transfer, file a SAR, block a card, call a provider.","It can ask for input first, with a form that adapts as you fill it, and finish with a result card that shows what changed.","Sensitive ones can need a second person: with approvals on, the action waits until someone allowed to approve it says yes."],"facts":[{"value":73,"label":"Smart Actions in this demo"},{"value":26,"label":"of them as buttons on the desks"}],"setup":["A developer declares it in the agent: collection.addAction(\"Route dispute\", { scope, form, execute }).","The form fields go in “form”; the result card is the HTML the action returns.","In the Layout Editor, table settings, Actions tab: choose where the button shows and its color.","Approvals: Project settings, Roles, then per action “Require approval” and who may approve. Requests land in Collaboration, Approval Workflow."],"docs":"https://docs.forest.app/product/execute/actions.md","art":"actions","buttons":[{"label":"Open the Disputes desk","workspaceId":"9d9fa26f-31c8-4c99-874e-2154843f6ba5","collection":null},{"label":"Open the MLRO desk","workspaceId":"a20b591a-fc4d-4d01-8c85-559d571b1c29","collection":null}]}
|
|
15
|
+
|
|
16
|
+
const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
17
|
+
|
|
18
|
+
/** "records.customers" in the chart's answer, or undefined. */
|
|
19
|
+
const pick = (facts, dotted) =>
|
|
20
|
+
dotted.split('.').reduce((value, key) => (value == null ? undefined : value[key]), facts);
|
|
21
|
+
const format = value => (typeof value === 'number' ? value.toLocaleString('en-GB') : value);
|
|
22
|
+
|
|
23
|
+
export default class extends Component {
|
|
24
|
+
@service lianaServerFetch;
|
|
25
|
+
|
|
26
|
+
@service router;
|
|
27
|
+
|
|
28
|
+
@tracked liveFacts = null;
|
|
29
|
+
|
|
30
|
+
@tracked liveStatus = 'loading';
|
|
31
|
+
|
|
32
|
+
feature = FEATURE;
|
|
33
|
+
|
|
34
|
+
// One flag per illustration: the template shows the one whose flag is set.
|
|
35
|
+
art = { [FEATURE.art]: true };
|
|
36
|
+
|
|
37
|
+
steps = FEATURE.setup.map((text, i) => ({ number: i + 1, text }));
|
|
38
|
+
|
|
39
|
+
hasFacts = FEATURE.facts.length > 0;
|
|
40
|
+
|
|
41
|
+
constructor(...args) {
|
|
42
|
+
super(...args);
|
|
43
|
+
if (FEATURE.facts.some(f => f.live)) this.loadFacts();
|
|
44
|
+
else this.liveStatus = 'none';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadFacts() {
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.lianaServerFetch.fetch('/forest/_charts/feature_facts', {});
|
|
50
|
+
if (!response.ok) throw new Error(`feature_facts: ${response.status}`);
|
|
51
|
+
this.liveFacts = await response.json();
|
|
52
|
+
this.liveStatus = 'ok';
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.liveStatus = 'failed';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Static facts as they are; live ones once the chart answers ("…" until then, "–" if not). */
|
|
59
|
+
get facts() {
|
|
60
|
+
return FEATURE.facts.map(f => {
|
|
61
|
+
if (!f.live) return { label: f.label, value: format(f.value), live: false };
|
|
62
|
+
const value = this.liveFacts ? pick(this.liveFacts, f.live) : undefined;
|
|
63
|
+
let shown = '…';
|
|
64
|
+
if (value !== undefined) shown = format(value);
|
|
65
|
+
else if (this.liveStatus === 'failed' || this.liveFacts) shown = '–';
|
|
66
|
+
|
|
67
|
+
return { label: f.label, value: shown, live: true };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get liveNote() {
|
|
72
|
+
if (this.liveStatus === 'ok') return 'Live from this demo’s data.';
|
|
73
|
+
if (this.liveStatus === 'failed') return 'Live figures unavailable: is the agent running?';
|
|
74
|
+
if (this.liveStatus === 'loading') return 'Counting…';
|
|
75
|
+
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The current url with the workspace id swapped: no need to know Forest's url scheme. */
|
|
80
|
+
static workspacePath(workspaceId) {
|
|
81
|
+
const path = window.location.pathname;
|
|
82
|
+
const ids = path.match(UUID) || [];
|
|
83
|
+
const current =
|
|
84
|
+
FEATURE.workspaceId && path.includes(FEATURE.workspaceId)
|
|
85
|
+
? FEATURE.workspaceId
|
|
86
|
+
: ids[ids.length - 1];
|
|
87
|
+
if (!current) return null;
|
|
88
|
+
const at = path.lastIndexOf(current);
|
|
89
|
+
|
|
90
|
+
return `${path.slice(0, at)}${workspaceId}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A table's list, assuming /<project>/<environment>/<team>/data/<table>/index. */
|
|
94
|
+
static tablePath(collection) {
|
|
95
|
+
const [project, environment, team] = window.location.pathname.split('/').filter(Boolean);
|
|
96
|
+
|
|
97
|
+
return `/${project}/${environment}/${team}/data/${collection}/index`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Inside the app when the router knows the url, else a full page load. */
|
|
101
|
+
go(path) {
|
|
102
|
+
if (!path) return;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const transition = this.router.transitionTo(path);
|
|
106
|
+
transition?.catch?.(error => {
|
|
107
|
+
if (error?.name !== 'TransitionAborted') window.location.assign(path);
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
window.location.assign(path);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@action
|
|
115
|
+
openHub() {
|
|
116
|
+
this.go(this.constructor.workspacePath(FEATURE.hubId));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@action
|
|
120
|
+
open(button) {
|
|
121
|
+
if (button.workspaceId) this.go(this.constructor.workspacePath(button.workspaceId));
|
|
122
|
+
else if (button.collection) this.go(this.constructor.tablePath(button.collection));
|
|
123
|
+
}
|
|
124
|
+
}
|
package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-workflows.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* eslint-disable import/no-unresolved -- runs inside the Forest app, which provides these */
|
|
2
|
+
/* eslint-env browser */
|
|
3
|
+
/**
|
|
4
|
+
* A feature explainer's workspace Custom component (generated by charts/features.js
|
|
5
|
+
* once per feature, with that feature's content written in). Its only way out is the Hub, plus
|
|
6
|
+
* the buttons that open the place in the demo where the feature shows.
|
|
7
|
+
*/
|
|
8
|
+
import { action } from '@ember/object';
|
|
9
|
+
import { inject as service } from '@ember/service';
|
|
10
|
+
import Component from '@glimmer/component';
|
|
11
|
+
import { tracked } from '@glimmer/tracking';
|
|
12
|
+
|
|
13
|
+
// Written at build time (scripts/build-public.js): the feature, its facts, the Hub's workspace id.
|
|
14
|
+
const FEATURE = {"hubId":"30b652d1-5f0e-4556-8a96-4863f009eb85","workspaceId":"e2607278-3d14-48e7-880c-36610417b4a2","position":4,"total":12,"key":"workflows","icon":"🧭","name":"Workflows","promise":"Your procedure, step by step on screen: the analyst follows it, and the hard cases go up.","hubWhere":"Alerts desk: Fraud and takeover alert. Payments desk: High-value transfer validation.","what":["A workflow is your procedure drawn as steps: read these fields, run this check, decide, act. The analyst sees one step at a time next to the record.","Some steps run on their own (start the review, call SEON). Others wait for the analyst to read and click Done. A decision can be left to AI, which explains its choice.","When a case needs a second pair of eyes, an escalation step parks the run in an inbox, and a senior analyst carries on where it stopped."],"facts":[{"value":13,"label":"workflows in this demo"},{"value":22,"label":"decisions left to AI"},{"value":4,"label":"escalation steps to an inbox"},{"live":"queues.alerts_fraud","label":"waiting in “Fraud and takeover alerts”"}],"setup":["Open the table’s settings (cog, in the Layout Editor), Workflows tab, click “+ New”.","Drag steps from the toolbar onto the canvas: Guidance, Get data, Trigger action, Decision, Escalation, End.","On a Decision, set the decision maker to AI to let it pick the branch from what earlier steps read.","On an Escalation, pick the inbox that receives the run. Save, then add a Workflow button to a desk."],"docs":"https://docs.forest.app/product/process/workflows/overview.md","art":"workflows","buttons":[{"label":"Open the Alerts desk","workspaceId":"0de6234b-0b10-47fd-862b-a7f88f4c3845","collection":null},{"label":"Open the Payments desk","workspaceId":"35e0620c-79c2-45c3-8c6d-cac353ba9342","collection":null}]}
|
|
15
|
+
|
|
16
|
+
const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
17
|
+
|
|
18
|
+
/** "records.customers" in the chart's answer, or undefined. */
|
|
19
|
+
const pick = (facts, dotted) =>
|
|
20
|
+
dotted.split('.').reduce((value, key) => (value == null ? undefined : value[key]), facts);
|
|
21
|
+
const format = value => (typeof value === 'number' ? value.toLocaleString('en-GB') : value);
|
|
22
|
+
|
|
23
|
+
export default class extends Component {
|
|
24
|
+
@service lianaServerFetch;
|
|
25
|
+
|
|
26
|
+
@service router;
|
|
27
|
+
|
|
28
|
+
@tracked liveFacts = null;
|
|
29
|
+
|
|
30
|
+
@tracked liveStatus = 'loading';
|
|
31
|
+
|
|
32
|
+
feature = FEATURE;
|
|
33
|
+
|
|
34
|
+
// One flag per illustration: the template shows the one whose flag is set.
|
|
35
|
+
art = { [FEATURE.art]: true };
|
|
36
|
+
|
|
37
|
+
steps = FEATURE.setup.map((text, i) => ({ number: i + 1, text }));
|
|
38
|
+
|
|
39
|
+
hasFacts = FEATURE.facts.length > 0;
|
|
40
|
+
|
|
41
|
+
constructor(...args) {
|
|
42
|
+
super(...args);
|
|
43
|
+
if (FEATURE.facts.some(f => f.live)) this.loadFacts();
|
|
44
|
+
else this.liveStatus = 'none';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadFacts() {
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.lianaServerFetch.fetch('/forest/_charts/feature_facts', {});
|
|
50
|
+
if (!response.ok) throw new Error(`feature_facts: ${response.status}`);
|
|
51
|
+
this.liveFacts = await response.json();
|
|
52
|
+
this.liveStatus = 'ok';
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.liveStatus = 'failed';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Static facts as they are; live ones once the chart answers ("…" until then, "–" if not). */
|
|
59
|
+
get facts() {
|
|
60
|
+
return FEATURE.facts.map(f => {
|
|
61
|
+
if (!f.live) return { label: f.label, value: format(f.value), live: false };
|
|
62
|
+
const value = this.liveFacts ? pick(this.liveFacts, f.live) : undefined;
|
|
63
|
+
let shown = '…';
|
|
64
|
+
if (value !== undefined) shown = format(value);
|
|
65
|
+
else if (this.liveStatus === 'failed' || this.liveFacts) shown = '–';
|
|
66
|
+
|
|
67
|
+
return { label: f.label, value: shown, live: true };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get liveNote() {
|
|
72
|
+
if (this.liveStatus === 'ok') return 'Live from this demo’s data.';
|
|
73
|
+
if (this.liveStatus === 'failed') return 'Live figures unavailable: is the agent running?';
|
|
74
|
+
if (this.liveStatus === 'loading') return 'Counting…';
|
|
75
|
+
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The current url with the workspace id swapped: no need to know Forest's url scheme. */
|
|
80
|
+
static workspacePath(workspaceId) {
|
|
81
|
+
const path = window.location.pathname;
|
|
82
|
+
const ids = path.match(UUID) || [];
|
|
83
|
+
const current =
|
|
84
|
+
FEATURE.workspaceId && path.includes(FEATURE.workspaceId)
|
|
85
|
+
? FEATURE.workspaceId
|
|
86
|
+
: ids[ids.length - 1];
|
|
87
|
+
if (!current) return null;
|
|
88
|
+
const at = path.lastIndexOf(current);
|
|
89
|
+
|
|
90
|
+
return `${path.slice(0, at)}${workspaceId}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A table's list, assuming /<project>/<environment>/<team>/data/<table>/index. */
|
|
94
|
+
static tablePath(collection) {
|
|
95
|
+
const [project, environment, team] = window.location.pathname.split('/').filter(Boolean);
|
|
96
|
+
|
|
97
|
+
return `/${project}/${environment}/${team}/data/${collection}/index`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Inside the app when the router knows the url, else a full page load. */
|
|
101
|
+
go(path) {
|
|
102
|
+
if (!path) return;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const transition = this.router.transitionTo(path);
|
|
106
|
+
transition?.catch?.(error => {
|
|
107
|
+
if (error?.name !== 'TransitionAborted') window.location.assign(path);
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
window.location.assign(path);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@action
|
|
115
|
+
openHub() {
|
|
116
|
+
this.go(this.constructor.workspacePath(FEATURE.hubId));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@action
|
|
120
|
+
open(button) {
|
|
121
|
+
if (button.workspaceId) this.go(this.constructor.workspacePath(button.workspaceId));
|
|
122
|
+
else if (button.collection) this.go(this.constructor.tablePath(button.collection));
|
|
123
|
+
}
|
|
124
|
+
}
|
package/dist/services/dumpers/templates/agent-nodejs/common/components/hub/feature-workspaces.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* eslint-disable import/no-unresolved -- runs inside the Forest app, which provides these */
|
|
2
|
+
/* eslint-env browser */
|
|
3
|
+
/**
|
|
4
|
+
* A feature explainer's workspace Custom component (generated by charts/features.js
|
|
5
|
+
* once per feature, with that feature's content written in). Its only way out is the Hub, plus
|
|
6
|
+
* the buttons that open the place in the demo where the feature shows.
|
|
7
|
+
*/
|
|
8
|
+
import { action } from '@ember/object';
|
|
9
|
+
import { inject as service } from '@ember/service';
|
|
10
|
+
import Component from '@glimmer/component';
|
|
11
|
+
import { tracked } from '@glimmer/tracking';
|
|
12
|
+
|
|
13
|
+
// Written at build time (scripts/build-public.js): the feature, its facts, the Hub's workspace id.
|
|
14
|
+
const FEATURE = {"hubId":"30b652d1-5f0e-4556-8a96-4863f009eb85","workspaceId":"b4b80f61-2e70-4e10-8cb6-33e3926a5839","position":7,"total":12,"key":"workspaces","icon":"🧩","name":"Workspaces & the layout editor","promise":"A page per team: its queue, the case, and the buttons to act, without a line of code.","hubWhere":"Every desk. The Hub and this page are workspaces too.","what":["A workspace is a page you assemble: an inbox on the left, the picked case’s fields in tabs, the workflow and action buttons on the right, counters on top.","Components talk to each other: pick a task in the inbox and every field, button and tab follows it.","The Layout Editor rearranges everything else too: tables, columns, record pages, forms. Changes are a draft for your team until you publish them."],"facts":[{"value":6,"label":"team desks, plus the manager’s Ops overview"},{"value":3,"label":"record pages"},{"value":21,"label":"inboxes, filed in the team folders"}],"setup":["Click “+ Add New” in the left panel, choose Workspace, name it (“KYC review”).","Drag components from the side: Inbox or Collection, then Fields, Actions, Workflow, Chart, Text, Tabs.","Set the collection’s row click to “Select a record”, so the fields follow the picked row.","Exit the builder and try it as an operator."],"docs":"https://docs.forest.app/product/build/workspaces.md","art":"workspaces","buttons":[{"label":"Open the Onboarding desk","workspaceId":"654efc2e-e63e-4bf5-89aa-a220fec2855b","collection":null},{"label":"Open the Ops overview","workspaceId":"6edb4352-9147-4d77-8cfc-4b31ec903f72","collection":null}]}
|
|
15
|
+
|
|
16
|
+
const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
17
|
+
|
|
18
|
+
/** "records.customers" in the chart's answer, or undefined. */
|
|
19
|
+
const pick = (facts, dotted) =>
|
|
20
|
+
dotted.split('.').reduce((value, key) => (value == null ? undefined : value[key]), facts);
|
|
21
|
+
const format = value => (typeof value === 'number' ? value.toLocaleString('en-GB') : value);
|
|
22
|
+
|
|
23
|
+
export default class extends Component {
|
|
24
|
+
@service lianaServerFetch;
|
|
25
|
+
|
|
26
|
+
@service router;
|
|
27
|
+
|
|
28
|
+
@tracked liveFacts = null;
|
|
29
|
+
|
|
30
|
+
@tracked liveStatus = 'loading';
|
|
31
|
+
|
|
32
|
+
feature = FEATURE;
|
|
33
|
+
|
|
34
|
+
// One flag per illustration: the template shows the one whose flag is set.
|
|
35
|
+
art = { [FEATURE.art]: true };
|
|
36
|
+
|
|
37
|
+
steps = FEATURE.setup.map((text, i) => ({ number: i + 1, text }));
|
|
38
|
+
|
|
39
|
+
hasFacts = FEATURE.facts.length > 0;
|
|
40
|
+
|
|
41
|
+
constructor(...args) {
|
|
42
|
+
super(...args);
|
|
43
|
+
if (FEATURE.facts.some(f => f.live)) this.loadFacts();
|
|
44
|
+
else this.liveStatus = 'none';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadFacts() {
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.lianaServerFetch.fetch('/forest/_charts/feature_facts', {});
|
|
50
|
+
if (!response.ok) throw new Error(`feature_facts: ${response.status}`);
|
|
51
|
+
this.liveFacts = await response.json();
|
|
52
|
+
this.liveStatus = 'ok';
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.liveStatus = 'failed';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Static facts as they are; live ones once the chart answers ("…" until then, "–" if not). */
|
|
59
|
+
get facts() {
|
|
60
|
+
return FEATURE.facts.map(f => {
|
|
61
|
+
if (!f.live) return { label: f.label, value: format(f.value), live: false };
|
|
62
|
+
const value = this.liveFacts ? pick(this.liveFacts, f.live) : undefined;
|
|
63
|
+
let shown = '…';
|
|
64
|
+
if (value !== undefined) shown = format(value);
|
|
65
|
+
else if (this.liveStatus === 'failed' || this.liveFacts) shown = '–';
|
|
66
|
+
|
|
67
|
+
return { label: f.label, value: shown, live: true };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get liveNote() {
|
|
72
|
+
if (this.liveStatus === 'ok') return 'Live from this demo’s data.';
|
|
73
|
+
if (this.liveStatus === 'failed') return 'Live figures unavailable: is the agent running?';
|
|
74
|
+
if (this.liveStatus === 'loading') return 'Counting…';
|
|
75
|
+
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The current url with the workspace id swapped: no need to know Forest's url scheme. */
|
|
80
|
+
static workspacePath(workspaceId) {
|
|
81
|
+
const path = window.location.pathname;
|
|
82
|
+
const ids = path.match(UUID) || [];
|
|
83
|
+
const current =
|
|
84
|
+
FEATURE.workspaceId && path.includes(FEATURE.workspaceId)
|
|
85
|
+
? FEATURE.workspaceId
|
|
86
|
+
: ids[ids.length - 1];
|
|
87
|
+
if (!current) return null;
|
|
88
|
+
const at = path.lastIndexOf(current);
|
|
89
|
+
|
|
90
|
+
return `${path.slice(0, at)}${workspaceId}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A table's list, assuming /<project>/<environment>/<team>/data/<table>/index. */
|
|
94
|
+
static tablePath(collection) {
|
|
95
|
+
const [project, environment, team] = window.location.pathname.split('/').filter(Boolean);
|
|
96
|
+
|
|
97
|
+
return `/${project}/${environment}/${team}/data/${collection}/index`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Inside the app when the router knows the url, else a full page load. */
|
|
101
|
+
go(path) {
|
|
102
|
+
if (!path) return;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const transition = this.router.transitionTo(path);
|
|
106
|
+
transition?.catch?.(error => {
|
|
107
|
+
if (error?.name !== 'TransitionAborted') window.location.assign(path);
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
window.location.assign(path);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@action
|
|
115
|
+
openHub() {
|
|
116
|
+
this.go(this.constructor.workspacePath(FEATURE.hubId));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@action
|
|
120
|
+
open(button) {
|
|
121
|
+
if (button.workspaceId) this.go(this.constructor.workspacePath(button.workspaceId));
|
|
122
|
+
else if (button.collection) this.go(this.constructor.tablePath(button.collection));
|
|
123
|
+
}
|
|
124
|
+
}
|