@cratis/scene.blueprint.approvals 0.0.0-stage → 4.53.1
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 +66 -2
- package/approvalsApplication.ts +28 -0
- package/approvalsParts.ts +50 -0
- package/approvalsQueries.ts +58 -0
- package/approvalsScreenSet.ts +24 -0
- package/blueprint.ts +16 -0
- package/blueprintCatalog.json +171 -0
- package/dist/cjs/approvalsApplication.js +49 -0
- package/dist/cjs/approvalsApplication.js.map +1 -0
- package/dist/cjs/approvalsParts.js +131 -0
- package/dist/cjs/approvalsParts.js.map +1 -0
- package/dist/cjs/approvalsQueries.js +68 -0
- package/dist/cjs/approvalsQueries.js.map +1 -0
- package/dist/cjs/approvalsScreenSet.js +61 -0
- package/dist/cjs/approvalsScreenSet.js.map +1 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/index.js +67 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/manifest.js +71 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +117 -0
- package/dist/cjs/navigation.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +8 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/screens/index.js +23 -0
- package/dist/cjs/screens/index.js.map +1 -0
- package/dist/cjs/templateProvenance.js +24 -0
- package/dist/cjs/templateProvenance.js.map +1 -0
- package/dist/cjs/templates/formTemplates.js +111 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +31 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +221 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +97 -0
- package/dist/cjs/templates/recordTemplates.js.map +1 -0
- package/dist/cjs/templates/wizardTemplate.js +77 -0
- package/dist/cjs/templates/wizardTemplate.js.map +1 -0
- package/dist/esm/approvalsApplication.d.ts +10 -0
- package/dist/esm/approvalsApplication.d.ts.map +1 -0
- package/dist/esm/approvalsApplication.js +44 -0
- package/dist/esm/approvalsApplication.js.map +1 -0
- package/dist/esm/approvalsParts.d.ts +13 -0
- package/dist/esm/approvalsParts.d.ts.map +1 -0
- package/dist/esm/approvalsParts.js +114 -0
- package/dist/esm/approvalsParts.js.map +1 -0
- package/dist/esm/approvalsQueries.d.ts +51 -0
- package/dist/esm/approvalsQueries.d.ts.map +1 -0
- package/dist/esm/approvalsQueries.js +63 -0
- package/dist/esm/approvalsQueries.js.map +1 -0
- package/dist/esm/approvalsScreenSet.d.ts +7 -0
- package/dist/esm/approvalsScreenSet.d.ts.map +1 -0
- package/dist/esm/approvalsScreenSet.js +59 -0
- package/dist/esm/approvalsScreenSet.js.map +1 -0
- package/dist/esm/blueprint.d.ts +3 -0
- package/dist/esm/blueprint.d.ts.map +1 -0
- package/dist/esm/blueprint.js +17 -0
- package/dist/esm/blueprint.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/manifest.d.ts +3 -0
- package/dist/esm/manifest.d.ts.map +1 -0
- package/dist/esm/manifest.js +69 -0
- package/dist/esm/manifest.js.map +1 -0
- package/dist/esm/navigation.d.ts +5 -0
- package/dist/esm/navigation.d.ts.map +1 -0
- package/dist/esm/navigation.js +113 -0
- package/dist/esm/navigation.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +6 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/screens/index.d.ts +3 -0
- package/dist/esm/screens/index.d.ts.map +1 -0
- package/dist/esm/screens/index.js +21 -0
- package/dist/esm/screens/index.js.map +1 -0
- package/dist/esm/templateProvenance.d.ts +3 -0
- package/dist/esm/templateProvenance.d.ts.map +1 -0
- package/dist/esm/templateProvenance.js +22 -0
- package/dist/esm/templateProvenance.js.map +1 -0
- package/dist/esm/templates/formTemplates.d.ts +6 -0
- package/dist/esm/templates/formTemplates.d.ts.map +1 -0
- package/dist/esm/templates/formTemplates.js +106 -0
- package/dist/esm/templates/formTemplates.js.map +1 -0
- package/dist/esm/templates/index.d.ts +7 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +20 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +6 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +216 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/recordTemplates.d.ts +3 -0
- package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
- package/dist/esm/templates/recordTemplates.js +95 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/templates/wizardTemplate.d.ts +3 -0
- package/dist/esm/templates/wizardTemplate.d.ts.map +1 -0
- package/dist/esm/templates/wizardTemplate.js +75 -0
- package/dist/esm/templates/wizardTemplate.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/index.ts +14 -0
- package/manifest.ts +44 -0
- package/navigation.ts +54 -0
- package/package.json +78 -4
- package/packageName.ts +5 -0
- package/sampleData/approvals-general.json +1269 -0
- package/sampleData/approvals-nordic.json +1269 -0
- package/screens/index.ts +21 -0
- package/templateProvenance.ts +15 -0
- package/templates/formTemplates.ts +61 -0
- package/templates/index.ts +19 -0
- package/templates/listTemplates.ts +116 -0
- package/templates/recordTemplates.ts +45 -0
- package/templates/wizardTemplate.ts +33 -0
- package/thumbnails/AllRequests.svg +13 -0
- package/thumbnails/ApprovalInbox.svg +23 -0
- package/thumbnails/DecisionDialog.svg +11 -0
- package/thumbnails/MyRequests.svg +13 -0
- package/thumbnails/NewRequestWizard.svg +14 -0
- package/thumbnails/RequestPage.svg +11 -0
- package/thumbnails/RequestTypeEditForm.svg +14 -0
- package/thumbnails/RequestTypeQuickCreate.svg +11 -0
- package/thumbnails/RequestTypes.svg +13 -0
- package/thumbnails/approvals.svg +9 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { NavigationRegionMode, NavigationRegionKind } from '@cratis/scene.model';
|
|
2
|
+
import { approvalsScreenDefinitions } from './approvalsScreenSet.js';
|
|
3
|
+
|
|
4
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
5
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
6
|
+
/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */ const approvalsModule = 'approvals';
|
|
7
|
+
/**
|
|
8
|
+
* The application structure the screen set implies: one module, `approvals`, a feature for each screen and the sub-features beneath it (`approvals.requests.new`
|
|
9
|
+
* is the `new` feature of `requests`). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
|
|
10
|
+
*/ const approvalsStructure = (()=>{
|
|
11
|
+
const root = {
|
|
12
|
+
id: approvalsModule,
|
|
13
|
+
name: 'Approvals',
|
|
14
|
+
features: []};
|
|
15
|
+
for (const screen of approvalsScreenDefinitions){
|
|
16
|
+
let parent = root;
|
|
17
|
+
for (const id of screen.name.split('.').slice(1)){
|
|
18
|
+
let node = parent.features.find((candidate)=>candidate.id === id);
|
|
19
|
+
if (!node) {
|
|
20
|
+
node = {
|
|
21
|
+
id,
|
|
22
|
+
name: screen.title,
|
|
23
|
+
features: [],
|
|
24
|
+
slices: []
|
|
25
|
+
};
|
|
26
|
+
parent.features.push(node);
|
|
27
|
+
}
|
|
28
|
+
parent = node;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
modules: [
|
|
33
|
+
{
|
|
34
|
+
id: root.id,
|
|
35
|
+
name: root.name,
|
|
36
|
+
features: root.features
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
/**
|
|
42
|
+
* The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists the four
|
|
43
|
+
* places of an approvals application: Inbox, My requests, All requests and Templates (for administrators).
|
|
44
|
+
*/ const approvalsNavigation = {
|
|
45
|
+
application: {
|
|
46
|
+
logo: {
|
|
47
|
+
image: '',
|
|
48
|
+
title: 'Approvals'
|
|
49
|
+
},
|
|
50
|
+
regions: [
|
|
51
|
+
{
|
|
52
|
+
region: NavigationRegionKind.Topbar,
|
|
53
|
+
items: [
|
|
54
|
+
{
|
|
55
|
+
id: 'approvals',
|
|
56
|
+
title: 'Approvals',
|
|
57
|
+
target: {
|
|
58
|
+
module: approvalsModule
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
modules: [
|
|
66
|
+
{
|
|
67
|
+
module: approvalsModule,
|
|
68
|
+
regions: [
|
|
69
|
+
{
|
|
70
|
+
region: NavigationRegionKind.Sidebar,
|
|
71
|
+
mode: NavigationRegionMode.Override,
|
|
72
|
+
items: [
|
|
73
|
+
{
|
|
74
|
+
id: 'inbox',
|
|
75
|
+
title: 'Inbox',
|
|
76
|
+
target: {
|
|
77
|
+
module: approvalsModule,
|
|
78
|
+
feature: 'inbox'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'requests',
|
|
83
|
+
title: 'My requests',
|
|
84
|
+
target: {
|
|
85
|
+
module: approvalsModule,
|
|
86
|
+
feature: 'requests'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'all',
|
|
91
|
+
title: 'All requests',
|
|
92
|
+
target: {
|
|
93
|
+
module: approvalsModule,
|
|
94
|
+
feature: 'all'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'templates',
|
|
99
|
+
title: 'Templates',
|
|
100
|
+
target: {
|
|
101
|
+
module: approvalsModule,
|
|
102
|
+
feature: 'templates'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export { approvalsModule, approvalsNavigation, approvalsStructure };
|
|
113
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sources":["../../navigation.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationStructure, NavigationModel, NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';\nimport { approvalsScreenDefinitions } from './approvalsScreenSet';\n\n/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */\nexport const approvalsModule = 'approvals';\n\n/**\n * The application structure the screen set implies: one module, `approvals`, a feature for each screen and the sub-features beneath it (`approvals.requests.new`\n * is the `new` feature of `requests`). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.\n */\nexport const approvalsStructure: ApplicationStructure = (() => {\n interface Node { id: string; name: string; features: Node[]; slices: never[] }\n const root: Node = { id: approvalsModule, name: 'Approvals', features: [], slices: [] };\n for (const screen of approvalsScreenDefinitions) {\n let parent = root;\n for (const id of screen.name.split('.').slice(1)) {\n let node = parent.features.find(candidate => candidate.id === id);\n if (!node) {\n node = { id, name: screen.title, features: [], slices: [] };\n parent.features.push(node);\n }\n parent = node;\n }\n }\n\n return { modules: [{ id: root.id, name: root.name, features: root.features }] } as unknown as ApplicationStructure;\n})();\n\n/**\n * The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists the four\n * places of an approvals application: Inbox, My requests, All requests and Templates (for administrators).\n */\nexport const approvalsNavigation: NavigationModel = {\n application: {\n logo: { image: '', title: 'Approvals' },\n regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'approvals', title: 'Approvals', target: { module: approvalsModule } }] }],\n },\n modules: [{\n module: approvalsModule,\n regions: [{\n region: NavigationRegionKind.Sidebar,\n mode: NavigationRegionMode.Override,\n items: [\n { id: 'inbox', title: 'Inbox', target: { module: approvalsModule, feature: 'inbox' } },\n { id: 'requests', title: 'My requests', target: { module: approvalsModule, feature: 'requests' } },\n { id: 'all', title: 'All requests', target: { module: approvalsModule, feature: 'all' } },\n { id: 'templates', title: 'Templates', target: { module: approvalsModule, feature: 'templates' } },\n ],\n }],\n }],\n};\n"],"names":["approvalsModule","approvalsStructure","root","id","name","features","screen","approvalsScreenDefinitions","parent","split","slice","node","find","candidate","title","slices","push","modules","approvalsNavigation","application","logo","image","regions","region","NavigationRegionKind","Topbar","items","target","module","Sidebar","mode","NavigationRegionMode","Override","feature"],"mappings":";;;AAAA;AACA;AAKA,8GACO,MAAMA,eAAAA,GAAkB;AAE/B;;;AAGC,IACM,MAAMC,kBAAAA,GAA4C,CAAA,IAAA;AAErD,IAAA,MAAMC,IAAAA,GAAa;QAAEC,EAAAA,EAAIH,eAAAA;QAAiBI,IAAAA,EAAM,WAAA;AAAaC,QAAAA,QAAAA,EAAU,EAAe,CAAA;IACtF,KAAK,MAAMC,UAAUC,0BAAAA,CAA4B;AAC7C,QAAA,IAAIC,MAAAA,GAASN,IAAAA;QACb,KAAK,MAAMC,EAAAA,IAAMG,MAAAA,CAAOF,IAAI,CAACK,KAAK,CAAC,GAAA,CAAA,CAAKC,KAAK,CAAC,CAAA,CAAA,CAAI;YAC9C,IAAIC,IAAAA,GAAOH,MAAAA,CAAOH,QAAQ,CAACO,IAAI,CAACC,CAAAA,SAAAA,GAAaA,SAAAA,CAAUV,EAAE,KAAKA,EAAAA,CAAAA;AAC9D,YAAA,IAAI,CAACQ,IAAAA,EAAM;gBACPA,IAAAA,GAAO;AAAER,oBAAAA,EAAAA;AAAIC,oBAAAA,IAAAA,EAAME,OAAOQ,KAAK;AAAET,oBAAAA,QAAAA,EAAU,EAAE;AAAEU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C,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAW;AAAE,yBAAA;AACjG,wBAAA;4BAAE9B,EAAAA,EAAI,KAAA;4BAAOW,KAAAA,EAAO,cAAA;4BAAgBa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAM;AAAE,yBAAA;AACxF,wBAAA;4BAAE9B,EAAAA,EAAI,WAAA;4BAAaW,KAAAA,EAAO,WAAA;4BAAaa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAY;AAAE;AACpG;AACL;AAAE;AACN;AAAE;AACN;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageName.d.ts","sourceRoot":"","sources":["../../packageName.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */ const approvalsBlueprintName = 'Cratis.Blueprint.Approvals';
|
|
4
|
+
|
|
5
|
+
export { approvalsBlueprintName };
|
|
6
|
+
//# sourceMappingURL=packageName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */\nexport const approvalsBlueprintName = 'Cratis.Blueprint.Approvals';\n"],"names":["approvalsBlueprintName"],"mappings":"AAAA;AACA;AAEA,iHACO,MAAMA,sBAAAA,GAAyB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../screens/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAS7C,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAQlC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LayoutName } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { approvalsScreenDefinitions } from '../approvalsScreenSet.js';
|
|
3
|
+
|
|
4
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
5
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
6
|
+
/**
|
|
7
|
+
* The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in the
|
|
8
|
+
* foundation's application shell. A new application that adopts the blueprint gets these, wired into
|
|
9
|
+
* its navigation (`approvalsNavigation`).
|
|
10
|
+
*/ const approvalsScreens = approvalsScreenDefinitions.map((definition)=>({
|
|
11
|
+
name: definition.name,
|
|
12
|
+
layout: LayoutName.AppShell,
|
|
13
|
+
screenTemplate: definition.template,
|
|
14
|
+
slotContent: {},
|
|
15
|
+
forms: [],
|
|
16
|
+
contributions: [],
|
|
17
|
+
path: definition.name.split('.')
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export { approvalsScreens };
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../screens/index.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen } from '@cratis/scene.model';\nimport { LayoutName } from '@cratis/scene.blueprint.default';\nimport { approvalsScreenDefinitions } from '../approvalsScreenSet';\n\n/**\n * The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in the\n * foundation's application shell. A new application that adopts the blueprint gets these, wired into\n * its navigation (`approvalsNavigation`).\n */\nexport const approvalsScreens: Screen[] = approvalsScreenDefinitions.map(definition => ({\n name: definition.name,\n layout: LayoutName.AppShell,\n screenTemplate: definition.template,\n slotContent: {},\n forms: [],\n contributions: [],\n path: definition.name.split('.'),\n}));\n"],"names":["approvalsScreens","approvalsScreenDefinitions","map","definition","name","layout","LayoutName","AppShell","screenTemplate","template","slotContent","forms","contributions","path","split"],"mappings":";;;AAAA;AACA;AAMA;;;;UAKaA,gBAAAA,GAA6BC,0BAAAA,CAA2BC,GAAG,CAACC,CAAAA,cAAe;AACpFC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,WAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBL,WAAWM,QAAQ;AACnCC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA,KAAAA,EAAO,EAAE;AACTC,QAAAA,aAAAA,EAAe,EAAE;AACjBC,QAAAA,IAAAA,EAAMV,UAAAA,CAAWC,IAAI,CAACU,KAAK,CAAC,GAAA;AAChC,KAAA,CAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.d.ts","sourceRoot":"","sources":["../../templateProvenance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,eAAO,MAAM,2BAA2B,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAQ1H,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const approvalsTemplateProvenance = {
|
|
4
|
+
compatibility: {
|
|
5
|
+
scene: '^4.13.0',
|
|
6
|
+
packages: [
|
|
7
|
+
{
|
|
8
|
+
name: 'Cratis.Blueprint.Default',
|
|
9
|
+
versionRange: '^1.0.0'
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
attribution: {
|
|
14
|
+
author: 'Cratis',
|
|
15
|
+
url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.approvals'
|
|
16
|
+
},
|
|
17
|
+
license: 'MIT',
|
|
18
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { approvalsTemplateProvenance };
|
|
22
|
+
//# sourceMappingURL=templateProvenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.js","sources":["../../templateProvenance.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { TemplateMetadata } from '@cratis/scene.model';\n\n/** The compatibility, attribution and license metadata every template this blueprint ships carries. */\nexport const approvalsTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'> = {\n compatibility: {\n scene: '^4.13.0',\n packages: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n },\n attribution: { author: 'Cratis', url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.approvals' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["approvalsTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":"AAAA;AACA;AAIA,wGACO,MAAMA,2BAAAA,GAAkH;IAC3HC,aAAAA,EAAe;QACXC,KAAAA,EAAO,SAAA;QACPC,QAAAA,EAAU;AAAC,YAAA;gBAAEC,IAAAA,EAAM,0BAAA;gBAA4BC,YAAAA,EAAc;AAAS;AAAE;AAC5E,KAAA;IACAC,WAAAA,EAAa;QAAEC,MAAAA,EAAQ,QAAA;QAAUC,GAAAA,EAAK;AAAkF,KAAA;IACxHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DialogTemplate, ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const requestTypeEditFormTemplate: ScreenTemplate;
|
|
3
|
+
export declare const decisionDialogTemplate: DialogTemplate;
|
|
4
|
+
export declare const requestTypeQuickCreateDialogTemplate: DialogTemplate;
|
|
5
|
+
export declare const approvalsDialogTemplates: DialogTemplate[];
|
|
6
|
+
//# sourceMappingURL=formTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplates.d.ts","sourceRoot":"","sources":["../../../templates/formTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAMpF,eAAO,MAAM,2BAA2B,EAAE,cAazC,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,cAapC,CAAC;AAGF,eAAO,MAAM,oCAAoC,EAAE,cAalD,CAAC;AAGF,eAAO,MAAM,wBAAwB,EAAE,cAAc,EAAmE,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { TemplateScope } from '@cratis/scene.model';
|
|
2
|
+
import { component, formScreenTemplate, quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { localeOfData, fromQuery, ApprovalsQuery } from '../approvalsQueries.js';
|
|
4
|
+
import { approvalsMetadata, withBehaviors, closesDialog } from '../approvalsParts.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/** The request type editor: what a type asks for, how many steps approve it and who decides each. For administrators. */ const requestTypeEditFormTemplate = {
|
|
9
|
+
name: 'RequestTypeEditForm',
|
|
10
|
+
fitsSlot: 'content',
|
|
11
|
+
slots: formScreenTemplate.slots,
|
|
12
|
+
arrangement: formScreenTemplate.arrangement,
|
|
13
|
+
content: {
|
|
14
|
+
header: [
|
|
15
|
+
component('request-type-header', 'pageHeader', {
|
|
16
|
+
title: 'Edit request type',
|
|
17
|
+
subtitle: 'What it asks for and who approves it'
|
|
18
|
+
})
|
|
19
|
+
],
|
|
20
|
+
body: [
|
|
21
|
+
component('request-type-body', 'formScreenBody', {
|
|
22
|
+
mode: 'edit',
|
|
23
|
+
sections: fromQuery(ApprovalsQuery.TypeEditorSections),
|
|
24
|
+
errors: fromQuery(ApprovalsQuery.FormErrors, '0'),
|
|
25
|
+
...localeOfData
|
|
26
|
+
})
|
|
27
|
+
],
|
|
28
|
+
actions: []
|
|
29
|
+
},
|
|
30
|
+
displayName: 'Edit request type',
|
|
31
|
+
description: 'A form that edits a request type: its name, what it asks for and its approval steps.',
|
|
32
|
+
metadata: approvalsMetadata('RequestTypeEditForm', 'Form', [
|
|
33
|
+
TemplateScope.Feature,
|
|
34
|
+
TemplateScope.Subfeature
|
|
35
|
+
])
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The decision dialog (the foundation confirm dialog with a comment field): says which decision is being made - approve, reject or request changes -
|
|
39
|
+
* and asks for a comment that the requester will see. The commit verb is the decision's.
|
|
40
|
+
*/ const decisionDialogTemplate = {
|
|
41
|
+
name: 'DecisionDialog',
|
|
42
|
+
slots: quickCreateDialogTemplate.slots,
|
|
43
|
+
content: {
|
|
44
|
+
header: [
|
|
45
|
+
component('decision-frame', 'dialogFrame', {
|
|
46
|
+
title: 'Your decision',
|
|
47
|
+
subtitle: 'Say why - the requester will see it'
|
|
48
|
+
})
|
|
49
|
+
],
|
|
50
|
+
body: [
|
|
51
|
+
withBehaviors(component('decision-form', 'formScreenBody', {
|
|
52
|
+
mode: 'create',
|
|
53
|
+
saveAndNew: false,
|
|
54
|
+
strings: {
|
|
55
|
+
formSave: 'Decide'
|
|
56
|
+
},
|
|
57
|
+
sections: fromQuery(ApprovalsQuery.DecisionSections),
|
|
58
|
+
errors: fromQuery(ApprovalsQuery.FormErrors, '0'),
|
|
59
|
+
...localeOfData
|
|
60
|
+
}), closesDialog())
|
|
61
|
+
],
|
|
62
|
+
actions: []
|
|
63
|
+
},
|
|
64
|
+
displayName: 'Decision',
|
|
65
|
+
description: 'A confirmation with a decision (approve, reject or request changes) and a comment for the requester.',
|
|
66
|
+
metadata: approvalsMetadata('DecisionDialog', 'Dialog', [
|
|
67
|
+
TemplateScope.Slice
|
|
68
|
+
])
|
|
69
|
+
};
|
|
70
|
+
/** A short form that adds a request type to the list without leaving it. */ const requestTypeQuickCreateDialogTemplate = {
|
|
71
|
+
name: 'RequestTypeQuickCreate',
|
|
72
|
+
slots: quickCreateDialogTemplate.slots,
|
|
73
|
+
content: {
|
|
74
|
+
header: [
|
|
75
|
+
component('request-type-frame', 'dialogFrame', {
|
|
76
|
+
title: 'New request type',
|
|
77
|
+
subtitle: 'Only what is needed to get started'
|
|
78
|
+
})
|
|
79
|
+
],
|
|
80
|
+
body: [
|
|
81
|
+
withBehaviors(component('request-type-quick', 'formScreenBody', {
|
|
82
|
+
mode: 'create',
|
|
83
|
+
saveAndNew: false,
|
|
84
|
+
strings: {
|
|
85
|
+
formSave: 'Create'
|
|
86
|
+
},
|
|
87
|
+
sections: fromQuery(ApprovalsQuery.TypeEditorSections),
|
|
88
|
+
errors: fromQuery(ApprovalsQuery.FormErrors, '0'),
|
|
89
|
+
...localeOfData
|
|
90
|
+
}), closesDialog())
|
|
91
|
+
],
|
|
92
|
+
actions: []
|
|
93
|
+
},
|
|
94
|
+
displayName: 'New request type',
|
|
95
|
+
description: 'A short form that adds a request type without leaving the page.',
|
|
96
|
+
metadata: approvalsMetadata('RequestTypeQuickCreate', 'Dialog', [
|
|
97
|
+
TemplateScope.Slice
|
|
98
|
+
])
|
|
99
|
+
};
|
|
100
|
+
/** The dialogs of the approvals application. */ const approvalsDialogTemplates = [
|
|
101
|
+
decisionDialogTemplate,
|
|
102
|
+
requestTypeQuickCreateDialogTemplate
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
export { approvalsDialogTemplates, decisionDialogTemplate, requestTypeEditFormTemplate, requestTypeQuickCreateDialogTemplate };
|
|
106
|
+
//# sourceMappingURL=formTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplates.js","sources":["../../../templates/formTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { formScreenTemplate, quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';\nimport { ApprovalsQuery, fromQuery, localeOfData } from '../approvalsQueries';\nimport { approvalsMetadata, closesDialog, component, withBehaviors } from '../approvalsParts';\n\n/** The request type editor: what a type asks for, how many steps approve it and who decides each. For administrators. */\nexport const requestTypeEditFormTemplate: ScreenTemplate = {\n name: 'RequestTypeEditForm',\n fitsSlot: 'content',\n slots: formScreenTemplate.slots,\n arrangement: formScreenTemplate.arrangement,\n content: {\n header: [component('request-type-header', 'pageHeader', { title: 'Edit request type', subtitle: 'What it asks for and who approves it' })],\n body: [component('request-type-body', 'formScreenBody', { mode: 'edit', sections: fromQuery(ApprovalsQuery.TypeEditorSections), errors: fromQuery(ApprovalsQuery.FormErrors, '0'), ...localeOfData })],\n actions: [],\n },\n displayName: 'Edit request type',\n description: 'A form that edits a request type: its name, what it asks for and its approval steps.',\n metadata: approvalsMetadata('RequestTypeEditForm', 'Form', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n\n/**\n * The decision dialog (the foundation confirm dialog with a comment field): says which decision is being made - approve, reject or request changes -\n * and asks for a comment that the requester will see. The commit verb is the decision's.\n */\nexport const decisionDialogTemplate: DialogTemplate = {\n name: 'DecisionDialog',\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component('decision-frame', 'dialogFrame', { title: 'Your decision', subtitle: 'Say why - the requester will see it' })],\n body: [withBehaviors(component('decision-form', 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: 'Decide' }, sections: fromQuery(ApprovalsQuery.DecisionSections), errors: fromQuery(ApprovalsQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: 'Decision',\n description: 'A confirmation with a decision (approve, reject or request changes) and a comment for the requester.',\n metadata: approvalsMetadata('DecisionDialog', 'Dialog', [TemplateScope.Slice]),\n};\n\n/** A short form that adds a request type to the list without leaving it. */\nexport const requestTypeQuickCreateDialogTemplate: DialogTemplate = {\n name: 'RequestTypeQuickCreate',\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component('request-type-frame', 'dialogFrame', { title: 'New request type', subtitle: 'Only what is needed to get started' })],\n body: [withBehaviors(component('request-type-quick', 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: 'Create' }, sections: fromQuery(ApprovalsQuery.TypeEditorSections), errors: fromQuery(ApprovalsQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: 'New request type',\n description: 'A short form that adds a request type without leaving the page.',\n metadata: approvalsMetadata('RequestTypeQuickCreate', 'Dialog', [TemplateScope.Slice]),\n};\n\n/** The dialogs of the approvals application. */\nexport const approvalsDialogTemplates: DialogTemplate[] = [decisionDialogTemplate, requestTypeQuickCreateDialogTemplate];\n"],"names":["requestTypeEditFormTemplate","name","fitsSlot","slots","formScreenTemplate","arrangement","content","header","component","title","subtitle","body","mode","sections","fromQuery","ApprovalsQuery","TypeEditorSections","errors","FormErrors","localeOfData","actions","displayName","description","metadata","approvalsMetadata","TemplateScope","Feature","Subfeature","decisionDialogTemplate","quickCreateDialogTemplate","withBehaviors","saveAndNew","strings","formSave","DecisionSections","closesDialog","Slice","requestTypeQuickCreateDialogTemplate","approvalsDialogTemplates"],"mappings":";;;;;AAAA;AACA;AAOA,0HACO,MAAMA,2BAAAA,GAA8C;IACvDC,IAAAA,EAAM,qBAAA;IACNC,QAAAA,EAAU,SAAA;AAC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AAM,KAAA;AACzF;AAEA,iDACO,MAAME,wBAAAA,GAA6C;AAACV,IAAAA,sBAAAA;AAAwBS,IAAAA;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './listTemplates';
|
|
2
|
+
export * from './wizardTemplate';
|
|
3
|
+
export * from './recordTemplates';
|
|
4
|
+
export * from './formTemplates';
|
|
5
|
+
export declare const approvalsScreenTemplates: import("@cratis/scene.model/screens").ScreenTemplate[];
|
|
6
|
+
export { approvalsDialogTemplates } from './formTemplates';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../templates/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAGhC,eAAO,MAAM,wBAAwB,wDAEpC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { requestTypeEditFormTemplate } from './formTemplates.js';
|
|
2
|
+
export { approvalsDialogTemplates, decisionDialogTemplate, requestTypeQuickCreateDialogTemplate } from './formTemplates.js';
|
|
3
|
+
import { approvalInboxTemplate, myRequestsTemplate, allRequestsTemplate, requestTypesTemplate } from './listTemplates.js';
|
|
4
|
+
import { requestPageTemplate } from './recordTemplates.js';
|
|
5
|
+
import { newRequestWizardTemplate } from './wizardTemplate.js';
|
|
6
|
+
|
|
7
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
8
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
|
+
/** Every screen template this blueprint provides, in the order the manifest lists them. */ const approvalsScreenTemplates = [
|
|
10
|
+
approvalInboxTemplate,
|
|
11
|
+
myRequestsTemplate,
|
|
12
|
+
newRequestWizardTemplate,
|
|
13
|
+
requestPageTemplate,
|
|
14
|
+
allRequestsTemplate,
|
|
15
|
+
requestTypesTemplate,
|
|
16
|
+
requestTypeEditFormTemplate
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export { allRequestsTemplate, approvalInboxTemplate, approvalsScreenTemplates, myRequestsTemplate, newRequestWizardTemplate, requestPageTemplate, requestTypeEditFormTemplate, requestTypesTemplate };
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../templates/index.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { requestTypeEditFormTemplate } from './formTemplates';\nimport { allRequestsTemplate, approvalInboxTemplate, myRequestsTemplate, requestTypesTemplate } from './listTemplates';\nimport { requestPageTemplate } from './recordTemplates';\nimport { newRequestWizardTemplate } from './wizardTemplate';\n\nexport * from './listTemplates';\nexport * from './wizardTemplate';\nexport * from './recordTemplates';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const approvalsScreenTemplates = [\n approvalInboxTemplate, myRequestsTemplate, newRequestWizardTemplate, requestPageTemplate, allRequestsTemplate, requestTypesTemplate, requestTypeEditFormTemplate,\n];\n\nexport { approvalsDialogTemplates } from './formTemplates';\n"],"names":["approvalsScreenTemplates","approvalInboxTemplate","myRequestsTemplate","newRequestWizardTemplate","requestPageTemplate","allRequestsTemplate","requestTypesTemplate","requestTypeEditFormTemplate"],"mappings":";;;;;;AAAA;AACA;AAYA,4FACO,MAAMA,wBAAAA,GAA2B;AACpCC,IAAAA,qBAAAA;AAAuBC,IAAAA,kBAAAA;AAAoBC,IAAAA,wBAAAA;AAA0BC,IAAAA,mBAAAA;AAAqBC,IAAAA,mBAAAA;AAAqBC,IAAAA,oBAAAA;AAAsBC,IAAAA;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const approvalInboxTemplate: ScreenTemplate;
|
|
3
|
+
export declare const myRequestsTemplate: ScreenTemplate;
|
|
4
|
+
export declare const allRequestsTemplate: ScreenTemplate;
|
|
5
|
+
export declare const requestTypesTemplate: ScreenTemplate;
|
|
6
|
+
//# sourceMappingURL=listTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkF,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAoFpJ,eAAO,MAAM,qBAAqB,gBAIhC,CAAC;AAGH,eAAO,MAAM,kBAAkB,gBAK7B,CAAC;AAGH,eAAO,MAAM,mBAAmB,gBAK9B,CAAC;AAGH,eAAO,MAAM,oBAAoB,gBAK/B,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { TemplateScope, NotificationLevel, InteractionActionKind, InteractionTriggerKind } from '@cratis/scene.model';
|
|
2
|
+
import { component, listScreenTemplate } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { localeOfData, fromQuery, ApprovalsQuery } from '../approvalsQueries.js';
|
|
4
|
+
import { goesTo, opensDialog, approvalsMetadata, withBehaviors, opensRecordOnSelect, actionButton } from '../approvalsParts.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
const listScopes = [
|
|
9
|
+
TemplateScope.Module,
|
|
10
|
+
TemplateScope.Feature
|
|
11
|
+
];
|
|
12
|
+
/** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */ const exportAction = (id)=>withBehaviors(actionButton(id, 'Export', 'secondary'), [
|
|
13
|
+
{
|
|
14
|
+
bindings: [
|
|
15
|
+
{
|
|
16
|
+
trigger: {
|
|
17
|
+
kind: InteractionTriggerKind.Click
|
|
18
|
+
},
|
|
19
|
+
actions: [
|
|
20
|
+
{
|
|
21
|
+
kind: InteractionActionKind.Notify,
|
|
22
|
+
level: NotificationLevel.Info,
|
|
23
|
+
message: {
|
|
24
|
+
text: 'The export has started.'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]);
|
|
32
|
+
/**
|
|
33
|
+
* One approvals list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled. The slots, arrangement and every behavior -
|
|
34
|
+
* sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
|
|
35
|
+
*/ function listTemplateOf(options) {
|
|
36
|
+
const id = options.name;
|
|
37
|
+
const listId = `${id}-records`;
|
|
38
|
+
const list = component(listId, 'dataList', {
|
|
39
|
+
label: options.title,
|
|
40
|
+
rows: fromQuery(options.rows),
|
|
41
|
+
columns: fromQuery(options.columns),
|
|
42
|
+
titleField: 'title',
|
|
43
|
+
pageSize: options.decide ? 6 : 10,
|
|
44
|
+
rowActions: options.rowActions,
|
|
45
|
+
urlKey: options.urlKey,
|
|
46
|
+
...options.decide ? {
|
|
47
|
+
variant: 'cards',
|
|
48
|
+
rowActionStyle: 'buttons',
|
|
49
|
+
toneField: 'tone'
|
|
50
|
+
} : {},
|
|
51
|
+
selectionMode: options.recordScreen || options.decide ? 'single' : 'multiple',
|
|
52
|
+
...localeOfData
|
|
53
|
+
});
|
|
54
|
+
const toolbar = [
|
|
55
|
+
component(`${id}-search`, 'globalSearch', {
|
|
56
|
+
placeholder: options.searchLabel,
|
|
57
|
+
label: options.searchLabel,
|
|
58
|
+
urlKey: `${options.urlKey}q`
|
|
59
|
+
}),
|
|
60
|
+
component(`${id}-views`, 'savedViewsMenu', {
|
|
61
|
+
views: fromQuery(options.views),
|
|
62
|
+
savePermission: 'enabled',
|
|
63
|
+
managePermission: 'enabled'
|
|
64
|
+
}),
|
|
65
|
+
...options.columnChoices ? [
|
|
66
|
+
component(`${id}-columns`, 'columnChooser', {
|
|
67
|
+
columns: fromQuery(options.columnChoices)
|
|
68
|
+
})
|
|
69
|
+
] : []
|
|
70
|
+
];
|
|
71
|
+
return {
|
|
72
|
+
name: options.name,
|
|
73
|
+
fitsSlot: 'content',
|
|
74
|
+
slots: listScreenTemplate.slots,
|
|
75
|
+
arrangement: listScreenTemplate.arrangement,
|
|
76
|
+
content: {
|
|
77
|
+
header: [
|
|
78
|
+
component(`${id}-header`, 'pageHeader', {
|
|
79
|
+
title: options.title,
|
|
80
|
+
subtitle: options.subtitle
|
|
81
|
+
}, {
|
|
82
|
+
actions: [
|
|
83
|
+
exportAction(`${id}-export`),
|
|
84
|
+
...options.primary ? [
|
|
85
|
+
withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.behaviors)
|
|
86
|
+
] : []
|
|
87
|
+
]
|
|
88
|
+
})
|
|
89
|
+
],
|
|
90
|
+
toolbar,
|
|
91
|
+
filters: [
|
|
92
|
+
component(`${id}-filter`, 'filterBuilder', {
|
|
93
|
+
fields: fromQuery(options.filterFields),
|
|
94
|
+
...localeOfData
|
|
95
|
+
})
|
|
96
|
+
],
|
|
97
|
+
list: [
|
|
98
|
+
options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : options.decide ? withBehaviors(list, opensDialog('DecisionDialog')) : list
|
|
99
|
+
],
|
|
100
|
+
bulkBar: options.bulkActions && options.selection && !options.recordScreen && !options.decide ? [
|
|
101
|
+
component(`${id}-bulk`, 'bulkBar', {
|
|
102
|
+
selection: fromQuery(options.selection),
|
|
103
|
+
actions: options.bulkActions
|
|
104
|
+
})
|
|
105
|
+
] : [],
|
|
106
|
+
footer: []
|
|
107
|
+
},
|
|
108
|
+
displayName: options.displayName,
|
|
109
|
+
description: options.description,
|
|
110
|
+
metadata: approvalsMetadata(options.name, 'List', listScopes)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The approval inbox: the requests waiting for the signed-in person as cards (the foundation list's Cards variant), each with its type, who asked, the amount or
|
|
115
|
+
* dates, how long it has waited and **Approve, Reject and Request changes as buttons on the card**. Pressing one opens the decision dialog for that decision,
|
|
116
|
+
* so a decision always carries a comment. A card's tone says how overdue it is, and the words say the same.
|
|
117
|
+
*/ const approvalInboxTemplate = listTemplateOf({
|
|
118
|
+
name: 'ApprovalInbox',
|
|
119
|
+
displayName: 'Approval inbox',
|
|
120
|
+
description: 'The requests waiting for my decision as cards, with Approve, Reject and Request changes inline.',
|
|
121
|
+
title: 'Inbox',
|
|
122
|
+
subtitle: 'Waiting for your decision',
|
|
123
|
+
searchLabel: 'Search the inbox',
|
|
124
|
+
urlKey: 'inbox',
|
|
125
|
+
rows: ApprovalsQuery.Inbox,
|
|
126
|
+
columns: ApprovalsQuery.InboxColumns,
|
|
127
|
+
filterFields: ApprovalsQuery.InboxFilterFields,
|
|
128
|
+
views: ApprovalsQuery.InboxViews,
|
|
129
|
+
rowActions: [
|
|
130
|
+
'Approve',
|
|
131
|
+
'Reject',
|
|
132
|
+
'Request changes'
|
|
133
|
+
],
|
|
134
|
+
decide: true
|
|
135
|
+
});
|
|
136
|
+
/** The requests I made: draft, submitted, approved and rejected as chips, and a New request button that starts the wizard. Choosing a request opens it. */ const myRequestsTemplate = listTemplateOf({
|
|
137
|
+
name: 'MyRequests',
|
|
138
|
+
displayName: 'My requests',
|
|
139
|
+
description: 'The requests I made, with draft, submitted, approved and rejected as chips.',
|
|
140
|
+
title: 'My requests',
|
|
141
|
+
subtitle: 'What I asked for and where it stands',
|
|
142
|
+
searchLabel: 'Search my requests',
|
|
143
|
+
urlKey: 'requests',
|
|
144
|
+
rows: ApprovalsQuery.MyRequests,
|
|
145
|
+
columns: ApprovalsQuery.MyRequestColumns,
|
|
146
|
+
filterFields: ApprovalsQuery.MyRequestFilterFields,
|
|
147
|
+
views: ApprovalsQuery.MyRequestViews,
|
|
148
|
+
columnChoices: ApprovalsQuery.MyRequestColumnChoices,
|
|
149
|
+
selection: ApprovalsQuery.MyRequestSelection,
|
|
150
|
+
rowActions: [
|
|
151
|
+
'Withdraw',
|
|
152
|
+
'Delete draft'
|
|
153
|
+
],
|
|
154
|
+
bulkActions: [
|
|
155
|
+
'Withdraw'
|
|
156
|
+
],
|
|
157
|
+
recordScreen: 'approvals.requests.page',
|
|
158
|
+
primary: {
|
|
159
|
+
label: 'New request',
|
|
160
|
+
behaviors: goesTo('approvals.requests.new')
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
/** Every request of the organisation, with who asked, who decides and where each stands. */ const allRequestsTemplate = listTemplateOf({
|
|
164
|
+
name: 'AllRequests',
|
|
165
|
+
displayName: 'All requests',
|
|
166
|
+
description: 'Every request of the organisation with its type, requester, current approver and status.',
|
|
167
|
+
title: 'All requests',
|
|
168
|
+
subtitle: 'Every request in the organisation',
|
|
169
|
+
searchLabel: 'Search all requests',
|
|
170
|
+
urlKey: 'all',
|
|
171
|
+
rows: ApprovalsQuery.AllRequests,
|
|
172
|
+
columns: ApprovalsQuery.AllRequestColumns,
|
|
173
|
+
filterFields: ApprovalsQuery.AllRequestFilterFields,
|
|
174
|
+
views: ApprovalsQuery.AllRequestViews,
|
|
175
|
+
columnChoices: ApprovalsQuery.AllRequestColumnChoices,
|
|
176
|
+
selection: ApprovalsQuery.AllRequestSelection,
|
|
177
|
+
rowActions: [
|
|
178
|
+
'Reassign',
|
|
179
|
+
'Cancel'
|
|
180
|
+
],
|
|
181
|
+
bulkActions: [
|
|
182
|
+
'Reassign',
|
|
183
|
+
'Cancel'
|
|
184
|
+
],
|
|
185
|
+
recordScreen: 'approvals.requests.page'
|
|
186
|
+
});
|
|
187
|
+
/** The request types an organisation offers: what each asks for, how many steps approve it and whether it is active. For administrators. Choosing one edits it. */ const requestTypesTemplate = listTemplateOf({
|
|
188
|
+
name: 'RequestTypes',
|
|
189
|
+
displayName: 'Request types',
|
|
190
|
+
description: 'The request types an organisation offers, with the steps that approve each and whether it is active.',
|
|
191
|
+
title: 'Templates',
|
|
192
|
+
subtitle: 'The request types people can choose from',
|
|
193
|
+
searchLabel: 'Search request types',
|
|
194
|
+
urlKey: 'types',
|
|
195
|
+
rows: ApprovalsQuery.RequestTypes,
|
|
196
|
+
columns: ApprovalsQuery.RequestTypeColumns,
|
|
197
|
+
filterFields: ApprovalsQuery.RequestTypeFilterFields,
|
|
198
|
+
views: ApprovalsQuery.RequestTypeViews,
|
|
199
|
+
columnChoices: ApprovalsQuery.RequestTypeColumnChoices,
|
|
200
|
+
selection: ApprovalsQuery.RequestTypeSelection,
|
|
201
|
+
rowActions: [
|
|
202
|
+
'Duplicate',
|
|
203
|
+
'Deactivate'
|
|
204
|
+
],
|
|
205
|
+
bulkActions: [
|
|
206
|
+
'Deactivate'
|
|
207
|
+
],
|
|
208
|
+
recordScreen: 'approvals.templates.edit',
|
|
209
|
+
primary: {
|
|
210
|
+
label: 'New request type',
|
|
211
|
+
behaviors: opensDialog('RequestTypeQuickCreate')
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
export { allRequestsTemplate, approvalInboxTemplate, myRequestsTemplate, requestTypesTemplate };
|
|
216
|
+
//# sourceMappingURL=listTemplates.js.map
|