@cratis/scene.blueprint.hr 0.0.0-stage → 4.50.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/blueprint.ts +16 -0
- package/blueprintCatalog.json +164 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/hrApplication.js +49 -0
- package/dist/cjs/hrApplication.js.map +1 -0
- package/dist/cjs/hrParts.js +131 -0
- package/dist/cjs/hrParts.js.map +1 -0
- package/dist/cjs/hrQueries.js +67 -0
- package/dist/cjs/hrQueries.js.map +1 -0
- package/dist/cjs/hrScreenSet.js +61 -0
- package/dist/cjs/hrScreenSet.js.map +1 -0
- package/dist/cjs/index.js +69 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/manifest.js +65 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +135 -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 +22 -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 +51 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +30 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +210 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/orgChartTemplate.js +63 -0
- package/dist/cjs/templates/orgChartTemplate.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +181 -0
- package/dist/cjs/templates/recordTemplates.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/hrApplication.d.ts +10 -0
- package/dist/esm/hrApplication.d.ts.map +1 -0
- package/dist/esm/hrApplication.js +44 -0
- package/dist/esm/hrApplication.js.map +1 -0
- package/dist/esm/hrParts.d.ts +15 -0
- package/dist/esm/hrParts.d.ts.map +1 -0
- package/dist/esm/hrParts.js +114 -0
- package/dist/esm/hrParts.js.map +1 -0
- package/dist/esm/hrQueries.d.ts +38 -0
- package/dist/esm/hrQueries.d.ts.map +1 -0
- package/dist/esm/hrQueries.js +59 -0
- package/dist/esm/hrQueries.js.map +1 -0
- package/dist/esm/hrScreenSet.d.ts +7 -0
- package/dist/esm/hrScreenSet.d.ts.map +1 -0
- package/dist/esm/hrScreenSet.js +59 -0
- package/dist/esm/hrScreenSet.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 +63 -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 +131 -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 +20 -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 +3 -0
- package/dist/esm/templates/formTemplates.d.ts.map +1 -0
- package/dist/esm/templates/formTemplates.js +49 -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 +19 -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 +205 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/orgChartTemplate.d.ts +3 -0
- package/dist/esm/templates/orgChartTemplate.d.ts.map +1 -0
- package/dist/esm/templates/orgChartTemplate.js +61 -0
- package/dist/esm/templates/orgChartTemplate.js.map +1 -0
- package/dist/esm/templates/recordTemplates.d.ts +4 -0
- package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
- package/dist/esm/templates/recordTemplates.js +178 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/hrApplication.ts +28 -0
- package/hrParts.ts +52 -0
- package/hrQueries.ts +59 -0
- package/hrScreenSet.ts +24 -0
- package/index.ts +14 -0
- package/manifest.ts +41 -0
- package/navigation.ts +59 -0
- package/package.json +79 -5
- package/packageName.ts +5 -0
- package/sampleData/hr-nordic.json +1659 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/formTemplates.ts +34 -0
- package/templates/index.ts +21 -0
- package/templates/listTemplates.ts +109 -0
- package/templates/orgChartTemplate.ts +27 -0
- package/templates/recordTemplates.ts +75 -0
- package/thumbnails/HrEmployeeDirectory.svg +29 -0
- package/thumbnails/HrEmployeePage.svg +18 -0
- package/thumbnails/HrOnboardingChecklist.svg +18 -0
- package/thumbnails/HrOnboardingList.svg +13 -0
- package/thumbnails/HrOrgChart.svg +20 -0
- package/thumbnails/HrQuickCreateEmployee.svg +12 -0
- package/thumbnails/HrRequestTimeOff.svg +12 -0
- package/thumbnails/HrTimeOffBalanceList.svg +13 -0
- package/thumbnails/HrTimeOffList.svg +13 -0
- package/thumbnails/hr.svg +14 -0
- package/README.md +0 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var packageName = require('./packageName.js');
|
|
5
|
+
var hrScreenSet = require('./hrScreenSet.js');
|
|
6
|
+
var index = require('./templates/index.js');
|
|
7
|
+
var formTemplates = require('./templates/formTemplates.js');
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
10
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
|
+
const description = 'People, the org chart, time off and onboarding for an HR team: a directory of cards, employee pages, an org tree, time-off requests and balances, and onboarding checklists.';
|
|
12
|
+
/**
|
|
13
|
+
* This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,
|
|
14
|
+
* components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data
|
|
15
|
+
* and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what "update available" compares.
|
|
16
|
+
*/ const hrBlueprintManifest = {
|
|
17
|
+
name: packageName.hrBlueprintName,
|
|
18
|
+
version: '1.0.0',
|
|
19
|
+
kind: scene_model.PackageKind.Blueprint,
|
|
20
|
+
dependencies: [
|
|
21
|
+
{
|
|
22
|
+
name: 'Cratis.Blueprint.Default',
|
|
23
|
+
versionRange: '^1.0.0'
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
components: [],
|
|
27
|
+
layouts: [],
|
|
28
|
+
screenTemplates: index.hrScreenTemplates.map((template)=>template.name),
|
|
29
|
+
dialogTemplates: formTemplates.hrQuickCreateDialogs.map((template)=>template.name),
|
|
30
|
+
themes: [],
|
|
31
|
+
displayName: 'HR People and Time Off',
|
|
32
|
+
description,
|
|
33
|
+
module: '@cratis/scene.blueprint.hr',
|
|
34
|
+
license: 'MIT',
|
|
35
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
|
|
36
|
+
sampleData: [
|
|
37
|
+
{
|
|
38
|
+
id: 'hr-nordic',
|
|
39
|
+
title: 'HR · Nordic',
|
|
40
|
+
locale: 'nb-NO',
|
|
41
|
+
path: 'sampleData/hr-nordic.json'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
blueprint: {
|
|
45
|
+
domain: 'hr',
|
|
46
|
+
description,
|
|
47
|
+
thumbnail: 'thumbnails/hr.svg',
|
|
48
|
+
screenSet: hrScreenSet.hrScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order })=>({
|
|
49
|
+
name,
|
|
50
|
+
title,
|
|
51
|
+
description: screenDescription,
|
|
52
|
+
template,
|
|
53
|
+
...parent === undefined ? {} : {
|
|
54
|
+
parent
|
|
55
|
+
},
|
|
56
|
+
...order === undefined ? {} : {
|
|
57
|
+
order
|
|
58
|
+
}
|
|
59
|
+
})),
|
|
60
|
+
defaultSampleData: 'hr-nordic'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.hrBlueprintManifest = hrBlueprintManifest;
|
|
65
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sources":["../../manifest.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { hrBlueprintName } from './packageName';\nimport { hrScreenDefinitions } from './hrScreenSet';\nimport { hrDialogTemplates, hrScreenTemplates } from './templates';\n\nconst description = 'People, the org chart, time off and onboarding for an HR team: a directory of cards, employee pages, an org tree, time-off requests and balances, and onboarding checklists.';\n\n/**\n * This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,\n * components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data\n * and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what \"update available\" compares.\n */\nexport const hrBlueprintManifest: ScenePackage = {\n name: hrBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n components: [],\n layouts: [],\n screenTemplates: hrScreenTemplates.map(template => template.name),\n dialogTemplates: hrDialogTemplates.map(template => template.name),\n themes: [],\n displayName: 'HR People and Time Off',\n description,\n module: '@cratis/scene.blueprint.hr',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n sampleData: [{ id: 'hr-nordic', title: 'HR · Nordic', locale: 'nb-NO', path: 'sampleData/hr-nordic.json' }],\n blueprint: {\n domain: 'hr',\n description,\n thumbnail: 'thumbnails/hr.svg',\n screenSet: hrScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({\n name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),\n })),\n defaultSampleData: 'hr-nordic',\n },\n};\n"],"names":["description","hrBlueprintManifest","name","hrBlueprintName","version","kind","PackageKind","Blueprint","dependencies","versionRange","components","layouts","screenTemplates","hrScreenTemplates","map","template","dialogTemplates","hrDialogTemplates","themes","displayName","module","license","licenseUrl","sampleData","id","title","locale","path","blueprint","domain","thumbnail","screenSet","hrScreenDefinitions","screenDescription","parent","order","undefined","defaultSampleData"],"mappings":";;;;;;;;AAAA;AACA;AAOA,MAAMA,WAAAA,GAAc,8KAAA;AAEpB;;;;UAKaC,mBAAAA,GAAoC;IAC7CC,IAAAA,EAAMC,2BAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM,0BAAA;YAA4BO,YAAAA,EAAc;AAAS;AAAE,KAAA;AAC5EC,IAAAA,UAAAA,EAAY,EAAE;AACdC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiBC,wBAAkBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASb,IAAI,CAAA;AAChEc,IAAAA,eAAAA,EAAiBC,mCAAkBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASb,IAAI,CAAA;AAChEgB,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,wBAAA;AACbnB,IAAAA,WAAAA;IACAoB,MAAAA,EAAQ,4BAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY,mDAAA;IACZC,UAAAA,EAAY;AAAC,QAAA;YAAEC,EAAAA,EAAI,WAAA;YAAaC,KAAAA,EAAO,aAAA;YAAeC,MAAAA,EAAQ,OAAA;YAASC,IAAAA,EAAM;AAA4B;AAAE,KAAA;IAC3GC,SAAAA,EAAW;QACPC,MAAAA,EAAQ,IAAA;AACR7B,QAAAA,WAAAA;QACA8B,SAAAA,EAAW,mBAAA;AACXC,QAAAA,SAAAA,EAAWC,gCAAoBlB,GAAG,CAAC,CAAC,EAAEZ,IAAI,EAAEuB,KAAK,EAAEzB,aAAaiC,iBAAiB,EAAElB,QAAQ,EAAEmB,MAAM,EAAEC,KAAK,EAAE,IAAM;AAC9GjC,gBAAAA,IAAAA;AAAMuB,gBAAAA,KAAAA;gBAAOzB,WAAAA,EAAaiC,iBAAAA;AAAmBlB,gBAAAA,QAAAA;gBAAU,GAAImB,MAAAA,KAAWE,SAAAA,GAAY,EAAC,GAAI;AAAEF,oBAAAA;iBAAQ;gBAAG,GAAIC,KAAAA,KAAUC,SAAAA,GAAY,EAAC,GAAI;AAAED,oBAAAA;;aACzI,CAAA,CAAA;QACAE,iBAAAA,EAAmB;AACvB;AACJ;;"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var hrScreenSet = require('./hrScreenSet.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 module the blueprint's screens live in, and so the first segment of every screen's qualified name. */ const hrModule = 'hr';
|
|
9
|
+
/**
|
|
10
|
+
* The application structure the screen set implies: one module, `hr`, a feature for each screen and the sub-features beneath it (`hr.directory.record` is the
|
|
11
|
+
* `record` feature of `directory`). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
|
|
12
|
+
*/ const hrStructure = (()=>{
|
|
13
|
+
const root = {
|
|
14
|
+
id: hrModule,
|
|
15
|
+
name: 'HR',
|
|
16
|
+
features: []};
|
|
17
|
+
for (const screen of hrScreenSet.hrScreenDefinitions){
|
|
18
|
+
let parent = root;
|
|
19
|
+
for (const id of screen.name.split('.').slice(1)){
|
|
20
|
+
let node = parent.features.find((candidate)=>candidate.id === id);
|
|
21
|
+
if (!node) {
|
|
22
|
+
node = {
|
|
23
|
+
id,
|
|
24
|
+
name: screen.title,
|
|
25
|
+
features: [],
|
|
26
|
+
slices: []
|
|
27
|
+
};
|
|
28
|
+
parent.features.push(node);
|
|
29
|
+
}
|
|
30
|
+
parent = node;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
modules: [
|
|
35
|
+
{
|
|
36
|
+
id: root.id,
|
|
37
|
+
name: root.name,
|
|
38
|
+
features: root.features
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
/**
|
|
44
|
+
* The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
|
|
45
|
+
* the four places an HR team goes: Directory, Org chart, Time off (with its requests and its balances beneath it) and Onboarding.
|
|
46
|
+
*/ const hrNavigation = {
|
|
47
|
+
application: {
|
|
48
|
+
logo: {
|
|
49
|
+
image: '',
|
|
50
|
+
title: 'HR'
|
|
51
|
+
},
|
|
52
|
+
regions: [
|
|
53
|
+
{
|
|
54
|
+
region: scene_model.NavigationRegionKind.Topbar,
|
|
55
|
+
items: [
|
|
56
|
+
{
|
|
57
|
+
id: 'hr',
|
|
58
|
+
title: 'HR',
|
|
59
|
+
target: {
|
|
60
|
+
module: hrModule
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
modules: [
|
|
68
|
+
{
|
|
69
|
+
module: hrModule,
|
|
70
|
+
regions: [
|
|
71
|
+
{
|
|
72
|
+
region: scene_model.NavigationRegionKind.Sidebar,
|
|
73
|
+
mode: scene_model.NavigationRegionMode.Override,
|
|
74
|
+
items: [
|
|
75
|
+
{
|
|
76
|
+
id: 'directory',
|
|
77
|
+
title: 'Directory',
|
|
78
|
+
target: {
|
|
79
|
+
module: hrModule,
|
|
80
|
+
feature: 'directory'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'org',
|
|
85
|
+
title: 'Org chart',
|
|
86
|
+
target: {
|
|
87
|
+
module: hrModule,
|
|
88
|
+
feature: 'org'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'timeoff',
|
|
93
|
+
title: 'Time off',
|
|
94
|
+
target: {
|
|
95
|
+
module: hrModule,
|
|
96
|
+
feature: 'timeoff'
|
|
97
|
+
},
|
|
98
|
+
children: [
|
|
99
|
+
{
|
|
100
|
+
id: 'requests',
|
|
101
|
+
title: 'Requests',
|
|
102
|
+
target: {
|
|
103
|
+
module: hrModule,
|
|
104
|
+
feature: 'timeoff'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'balances',
|
|
109
|
+
title: 'Balances',
|
|
110
|
+
target: {
|
|
111
|
+
module: hrModule,
|
|
112
|
+
feature: 'timeoff.balances'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'onboarding',
|
|
119
|
+
title: 'Onboarding',
|
|
120
|
+
target: {
|
|
121
|
+
module: hrModule,
|
|
122
|
+
feature: 'onboarding'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
exports.hrModule = hrModule;
|
|
133
|
+
exports.hrNavigation = hrNavigation;
|
|
134
|
+
exports.hrStructure = hrStructure;
|
|
135
|
+
//# 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 { hrScreenDefinitions } from './hrScreenSet';\n\n/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */\nexport const hrModule = 'hr';\n\n/**\n * The application structure the screen set implies: one module, `hr`, a feature for each screen and the sub-features beneath it (`hr.directory.record` is the\n * `record` feature of `directory`). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.\n */\nexport const hrStructure: ApplicationStructure = (() => {\n interface Node { id: string; name: string; features: Node[]; slices: never[] }\n const root: Node = { id: hrModule, name: 'HR', features: [], slices: [] };\n for (const screen of hrScreenDefinitions) {\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\n * the four places an HR team goes: Directory, Org chart, Time off (with its requests and its balances beneath it) and Onboarding.\n */\nexport const hrNavigation: NavigationModel = {\n application: {\n logo: { image: '', title: 'HR' },\n regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'hr', title: 'HR', target: { module: hrModule } }] }],\n },\n modules: [{\n module: hrModule,\n regions: [{\n region: NavigationRegionKind.Sidebar,\n mode: NavigationRegionMode.Override,\n items: [\n { id: 'directory', title: 'Directory', target: { module: hrModule, feature: 'directory' } },\n { id: 'org', title: 'Org chart', target: { module: hrModule, feature: 'org' } },\n {\n id: 'timeoff', title: 'Time off', target: { module: hrModule, feature: 'timeoff' }, children: [\n { id: 'requests', title: 'Requests', target: { module: hrModule, feature: 'timeoff' } },\n { id: 'balances', title: 'Balances', target: { module: hrModule, feature: 'timeoff.balances' } },\n ],\n },\n { id: 'onboarding', title: 'Onboarding', target: { module: hrModule, feature: 'onboarding' } },\n ],\n }],\n }],\n};\n"],"names":["hrModule","hrStructure","root","id","name","features","screen","hrScreenDefinitions","parent","split","slice","node","find","candidate","title","slices","push","modules","hrNavigation","application","logo","image","regions","region","NavigationRegionKind","Topbar","items","target","module","Sidebar","mode","NavigationRegionMode","Override","feature","children"],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */ const hrBlueprintName = 'Cratis.Blueprint.Hr';
|
|
6
|
+
|
|
7
|
+
exports.hrBlueprintName = hrBlueprintName;
|
|
8
|
+
//# 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 hrBlueprintName = 'Cratis.Blueprint.Hr';\n"],"names":["hrBlueprintName"],"mappings":";;AAAA;AACA;AAEA,iHACO,MAAMA,eAAAA,GAAkB;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
4
|
+
var hrScreenSet = require('../hrScreenSet.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
|
+
/**
|
|
9
|
+
* 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
|
|
10
|
+
* the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`hrNavigation`).
|
|
11
|
+
*/ const hrScreens = hrScreenSet.hrScreenDefinitions.map((definition)=>({
|
|
12
|
+
name: definition.name,
|
|
13
|
+
layout: scene_blueprint_default.LayoutName.AppShell,
|
|
14
|
+
screenTemplate: definition.template,
|
|
15
|
+
slotContent: {},
|
|
16
|
+
forms: [],
|
|
17
|
+
contributions: [],
|
|
18
|
+
path: definition.name.split('.')
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
exports.hrScreens = hrScreens;
|
|
22
|
+
//# 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 { hrScreenDefinitions } from '../hrScreenSet';\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\n * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`hrNavigation`).\n */\nexport const hrScreens: Screen[] = hrScreenDefinitions.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":["hrScreens","hrScreenDefinitions","map","definition","name","layout","LayoutName","AppShell","screenTemplate","template","slotContent","forms","contributions","path","split"],"mappings":";;;;;AAAA;AACA;AAMA;;;UAIaA,SAAAA,GAAsBC,+BAAAA,CAAoBC,GAAG,CAACC,CAAAA,cAAe;AACtEC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,mCAAWC,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,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const hrTemplateProvenance = {
|
|
6
|
+
compatibility: {
|
|
7
|
+
scene: '^4.13.0',
|
|
8
|
+
packages: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Cratis.Blueprint.Default',
|
|
11
|
+
versionRange: '^1.0.0'
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
attribution: {
|
|
16
|
+
author: 'Cratis',
|
|
17
|
+
url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.hr'
|
|
18
|
+
},
|
|
19
|
+
license: 'MIT',
|
|
20
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.hrTemplateProvenance = hrTemplateProvenance;
|
|
24
|
+
//# 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 hrTemplateProvenance: 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.hr' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["hrTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":";;AAAA;AACA;AAIA,wGACO,MAAMA,oBAAAA,GAA2G;IACpHC,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;AAA2E,KAAA;IACjHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var hrQueries = require('../hrQueries.js');
|
|
6
|
+
var hrParts = require('../hrParts.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/**
|
|
11
|
+
* One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
|
|
12
|
+
* that thing needs to get started.
|
|
13
|
+
*/ function quickCreateOf(name, title, subtitle, sections, noun, create) {
|
|
14
|
+
return {
|
|
15
|
+
name,
|
|
16
|
+
slots: scene_blueprint_default.quickCreateDialogTemplate.slots,
|
|
17
|
+
content: {
|
|
18
|
+
header: [
|
|
19
|
+
scene_blueprint_default.component(`${name}-frame`, 'dialogFrame', {
|
|
20
|
+
title,
|
|
21
|
+
subtitle
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
body: [
|
|
25
|
+
hrParts.withBehaviors(scene_blueprint_default.component(`${name}-form`, 'formScreenBody', {
|
|
26
|
+
mode: 'create',
|
|
27
|
+
saveAndNew: false,
|
|
28
|
+
strings: {
|
|
29
|
+
formSave: create
|
|
30
|
+
},
|
|
31
|
+
sections: hrQueries.fromQuery(sections),
|
|
32
|
+
errors: hrQueries.fromQuery(hrQueries.HrQuery.FormErrors, '0'),
|
|
33
|
+
...hrQueries.localeOfData
|
|
34
|
+
}), hrParts.closesDialog())
|
|
35
|
+
],
|
|
36
|
+
actions: []
|
|
37
|
+
},
|
|
38
|
+
displayName: `HR quick create ${noun}`,
|
|
39
|
+
description: noun === 'time-off request' ? 'A short form that asks for time off without leaving the page.' : `A short form that creates one ${noun} without leaving the page.`,
|
|
40
|
+
metadata: hrParts.hrMetadata(name, 'Dialog', [
|
|
41
|
+
scene_model.TemplateScope.Slice
|
|
42
|
+
])
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Request time off (type, dates, a note), and the quick creation of an employee. */ const hrQuickCreateDialogs = [
|
|
46
|
+
quickCreateOf('HrRequestTimeOff', 'Request time off', 'Say when and what kind', 'TimeOffQuickSections', 'time-off request', 'Send request'),
|
|
47
|
+
quickCreateOf('HrQuickCreateEmployee', 'New employee', 'Only what is needed to get started', 'EmployeeQuickSections', 'employee', 'Create')
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
exports.hrQuickCreateDialogs = hrQuickCreateDialogs;
|
|
51
|
+
//# 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, TemplateScope } from '@cratis/scene.model';\nimport { quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';\nimport { HrQuery, fromQuery, localeOfData } from '../hrQueries';\nimport { closesDialog, component, hrMetadata, withBehaviors } from '../hrParts';\n\n/**\n * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields\n * that thing needs to get started.\n */\nfunction quickCreateOf(name: string, title: string, subtitle: string, sections: string, noun: string, create: string): DialogTemplate {\n return {\n name,\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component(`${name}-frame`, 'dialogFrame', { title, subtitle })],\n body: [withBehaviors(component(`${name}-form`, 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: create }, sections: fromQuery(sections), errors: fromQuery(HrQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: `HR quick create ${noun}`,\n description: noun === 'time-off request' ? 'A short form that asks for time off without leaving the page.' : `A short form that creates one ${noun} without leaving the page.`,\n metadata: hrMetadata(name, 'Dialog', [TemplateScope.Slice]),\n };\n}\n\n/** Request time off (type, dates, a note), and the quick creation of an employee. */\nexport const hrQuickCreateDialogs: DialogTemplate[] = [\n quickCreateOf('HrRequestTimeOff', 'Request time off', 'Say when and what kind', 'TimeOffQuickSections', 'time-off request', 'Send request'),\n quickCreateOf('HrQuickCreateEmployee', 'New employee', 'Only what is needed to get started', 'EmployeeQuickSections', 'employee', 'Create'),\n];\n"],"names":["quickCreateOf","name","title","subtitle","sections","noun","create","slots","quickCreateDialogTemplate","content","header","component","body","withBehaviors","mode","saveAndNew","strings","formSave","fromQuery","errors","HrQuery","FormErrors","localeOfData","closesDialog","actions","displayName","description","metadata","hrMetadata","TemplateScope","Slice","hrQuickCreateDialogs"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;AAGC,IACD,SAASA,aAAAA,CAAcC,IAAY,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,QAAgB,EAAEC,IAAY,EAAEC,MAAc,EAAA;IAChH,OAAO;AACHL,QAAAA,IAAAA;AACAM,QAAAA,KAAAA,EAAOC,kDAA0BD,KAAK;QACtCE,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,iCAAAA,CAAU,CAAA,EAAGV,IAAAA,CAAK,MAAM,CAAC,EAAE,aAAA,EAAe;AAAEC,oBAAAA,KAAAA;AAAOC,oBAAAA;AAAS,iBAAA;AAAG,aAAA;YACxES,IAAAA,EAAM;AAACC,gBAAAA,qBAAAA,CAAcF,kCAAU,CAAA,EAAGV,IAAAA,CAAK,KAAK,CAAC,EAAE,gBAAA,EAAkB;oBAC7Da,IAAAA,EAAM,QAAA;oBAAUC,UAAAA,EAAY,KAAA;oBAAOC,OAAAA,EAAS;wBAAEC,QAAAA,EAAUX;AAAO,qBAAA;AAAGF,oBAAAA,QAAAA,EAAUc,mBAAAA,CAAUd,QAAAA,CAAAA;oBAAWe,MAAAA,EAAQD,mBAAAA,CAAUE,iBAAAA,CAAQC,UAAU,EAAE,GAAA,CAAA;AAAM,oBAAA,GAAGC;iBACpJ,CAAA,EAAIC,oBAAAA,EAAAA;AAAgB,aAAA;AACpBC,YAAAA,OAAAA,EAAS;AACb,SAAA;QACAC,WAAAA,EAAa,CAAC,gBAAgB,EAAEpB,IAAAA,CAAAA,CAAM;QACtCqB,WAAAA,EAAarB,IAAAA,KAAS,qBAAqB,+DAAA,GAAkE,CAAC,8BAA8B,EAAEA,IAAAA,CAAK,0BAA0B,CAAC;QAC9KsB,QAAAA,EAAUC,kBAAAA,CAAW3B,MAAM,QAAA,EAAU;AAAC4B,YAAAA,yBAAAA,CAAcC;AAAM,SAAA;AAC9D,KAAA;AACJ;AAEA,sFACO,MAAMC,oBAAAA,GAAyC;AAClD/B,IAAAA,aAAAA,CAAc,kBAAA,EAAoB,kBAAA,EAAoB,wBAAA,EAA0B,sBAAA,EAAwB,kBAAA,EAAoB,cAAA,CAAA;AAC5HA,IAAAA,aAAAA,CAAc,uBAAA,EAAyB,cAAA,EAAgB,oCAAA,EAAsC,uBAAA,EAAyB,UAAA,EAAY,QAAA;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var listTemplates = require('./listTemplates.js');
|
|
4
|
+
var orgChartTemplate = require('./orgChartTemplate.js');
|
|
5
|
+
var recordTemplates = require('./recordTemplates.js');
|
|
6
|
+
var formTemplates = require('./formTemplates.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/** Every screen template this blueprint provides, in the order the manifest lists them. */ const hrScreenTemplates = [
|
|
11
|
+
listTemplates.hrEmployeeDirectoryTemplate,
|
|
12
|
+
recordTemplates.hrEmployeePageTemplate,
|
|
13
|
+
orgChartTemplate.hrOrgChartTemplate,
|
|
14
|
+
listTemplates.hrTimeOffListTemplate,
|
|
15
|
+
listTemplates.hrTimeOffBalanceListTemplate,
|
|
16
|
+
listTemplates.hrOnboardingListTemplate,
|
|
17
|
+
recordTemplates.hrOnboardingChecklistTemplate
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
exports.hrEmployeeDirectoryTemplate = listTemplates.hrEmployeeDirectoryTemplate;
|
|
21
|
+
exports.hrOnboardingListTemplate = listTemplates.hrOnboardingListTemplate;
|
|
22
|
+
exports.hrTimeOffBalanceListTemplate = listTemplates.hrTimeOffBalanceListTemplate;
|
|
23
|
+
exports.hrTimeOffListTemplate = listTemplates.hrTimeOffListTemplate;
|
|
24
|
+
exports.hrOrgChartTemplate = orgChartTemplate.hrOrgChartTemplate;
|
|
25
|
+
exports.hrEmployeePageTemplate = recordTemplates.hrEmployeePageTemplate;
|
|
26
|
+
exports.hrOnboardingChecklistTemplate = recordTemplates.hrOnboardingChecklistTemplate;
|
|
27
|
+
exports.hrDialogTemplates = formTemplates.hrQuickCreateDialogs;
|
|
28
|
+
exports.hrQuickCreateDialogs = formTemplates.hrQuickCreateDialogs;
|
|
29
|
+
exports.hrScreenTemplates = hrScreenTemplates;
|
|
30
|
+
//# 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 { hrEmployeeDirectoryTemplate, hrOnboardingListTemplate, hrTimeOffBalanceListTemplate, hrTimeOffListTemplate } from './listTemplates';\nimport { hrOrgChartTemplate } from './orgChartTemplate';\nimport { hrEmployeePageTemplate, hrOnboardingChecklistTemplate } from './recordTemplates';\n\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './orgChartTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const hrScreenTemplates = [\n hrEmployeeDirectoryTemplate, hrEmployeePageTemplate,\n hrOrgChartTemplate,\n hrTimeOffListTemplate, hrTimeOffBalanceListTemplate,\n hrOnboardingListTemplate, hrOnboardingChecklistTemplate,\n];\n\nexport { hrQuickCreateDialogs as hrDialogTemplates } from './formTemplates';\n"],"names":["hrScreenTemplates","hrEmployeeDirectoryTemplate","hrEmployeePageTemplate","hrOrgChartTemplate","hrTimeOffListTemplate","hrTimeOffBalanceListTemplate","hrOnboardingListTemplate","hrOnboardingChecklistTemplate"],"mappings":";;;;;;;AAAA;AACA;AAWA,4FACO,MAAMA,iBAAAA,GAAoB;AAC7BC,IAAAA,yCAAAA;AAA6BC,IAAAA,sCAAAA;AAC7BC,IAAAA,mCAAAA;AACAC,IAAAA,mCAAAA;AAAuBC,IAAAA,0CAAAA;AACvBC,IAAAA,sCAAAA;AAA0BC,IAAAA;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var hrQueries = require('../hrQueries.js');
|
|
6
|
+
var hrParts = require('../hrParts.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
const listScopes = [
|
|
11
|
+
scene_model.TemplateScope.Module,
|
|
12
|
+
scene_model.TemplateScope.Feature
|
|
13
|
+
];
|
|
14
|
+
/** 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)=>hrParts.withBehaviors(hrParts.actionButton(id, 'Export', 'secondary'), [
|
|
15
|
+
{
|
|
16
|
+
bindings: [
|
|
17
|
+
{
|
|
18
|
+
trigger: {
|
|
19
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
20
|
+
},
|
|
21
|
+
actions: [
|
|
22
|
+
{
|
|
23
|
+
kind: scene_model.InteractionActionKind.Notify,
|
|
24
|
+
level: scene_model.NotificationLevel.Info,
|
|
25
|
+
message: {
|
|
26
|
+
text: 'The export has started.'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* One HR list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and
|
|
36
|
+
* every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
|
|
37
|
+
*/ function listTemplateOf(options) {
|
|
38
|
+
const queries = hrQueries.hrQueriesOf(options.entity);
|
|
39
|
+
const id = options.name;
|
|
40
|
+
const listId = `${id}-records`;
|
|
41
|
+
const primary = hrParts.withBehaviors(hrParts.actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? hrParts.opensDialog(options.primary.dialog) : hrParts.goesTo(options.primary.screen));
|
|
42
|
+
const list = scene_blueprint_default.component(listId, 'dataList', {
|
|
43
|
+
label: options.title,
|
|
44
|
+
rows: hrQueries.fromQuery(queries.rows),
|
|
45
|
+
columns: hrQueries.fromQuery(queries.columns),
|
|
46
|
+
titleField: options.titleField,
|
|
47
|
+
pageSize: options.cards ? 12 : 10,
|
|
48
|
+
urlKey: options.urlKey,
|
|
49
|
+
...hrQueries.localeOfData,
|
|
50
|
+
rowActions: options.rowActions,
|
|
51
|
+
...options.readOnly ? {} : {
|
|
52
|
+
selectionMode: options.recordScreen ? 'single' : 'multiple'
|
|
53
|
+
},
|
|
54
|
+
...options.cards ? {
|
|
55
|
+
variant: 'cards',
|
|
56
|
+
imageField: options.cards.imageField
|
|
57
|
+
} : {},
|
|
58
|
+
...options.toneField ? {
|
|
59
|
+
toneField: options.toneField
|
|
60
|
+
} : {}
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
name: options.name,
|
|
64
|
+
fitsSlot: 'content',
|
|
65
|
+
slots: scene_blueprint_default.listScreenTemplate.slots,
|
|
66
|
+
arrangement: scene_blueprint_default.listScreenTemplate.arrangement,
|
|
67
|
+
content: {
|
|
68
|
+
header: [
|
|
69
|
+
scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
|
|
70
|
+
title: options.title,
|
|
71
|
+
subtitle: options.subtitle
|
|
72
|
+
}, {
|
|
73
|
+
actions: [
|
|
74
|
+
exportAction(`${id}-export`),
|
|
75
|
+
primary
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
],
|
|
79
|
+
toolbar: [
|
|
80
|
+
scene_blueprint_default.component(`${id}-search`, 'globalSearch', {
|
|
81
|
+
placeholder: options.searchLabel,
|
|
82
|
+
label: options.searchLabel,
|
|
83
|
+
urlKey: `${options.urlKey}q`
|
|
84
|
+
}),
|
|
85
|
+
scene_blueprint_default.component(`${id}-views`, 'savedViewsMenu', {
|
|
86
|
+
views: hrQueries.fromQuery(queries.views),
|
|
87
|
+
savePermission: 'enabled',
|
|
88
|
+
managePermission: 'enabled'
|
|
89
|
+
}),
|
|
90
|
+
scene_blueprint_default.component(`${id}-columns`, 'columnChooser', {
|
|
91
|
+
columns: hrQueries.fromQuery(queries.columnChoices)
|
|
92
|
+
})
|
|
93
|
+
],
|
|
94
|
+
filters: [
|
|
95
|
+
scene_blueprint_default.component(`${id}-filter`, 'filterBuilder', {
|
|
96
|
+
fields: hrQueries.fromQuery(queries.filterFields),
|
|
97
|
+
...hrQueries.localeOfData
|
|
98
|
+
})
|
|
99
|
+
],
|
|
100
|
+
list: [
|
|
101
|
+
options.recordScreen ? hrParts.withBehaviors(list, hrParts.opensRecordOnSelect(listId, options.recordScreen)) : list
|
|
102
|
+
],
|
|
103
|
+
bulkBar: options.recordScreen || options.readOnly ? [] : [
|
|
104
|
+
scene_blueprint_default.component(`${id}-bulk`, 'bulkBar', {
|
|
105
|
+
selection: hrQueries.fromQuery(queries.selection),
|
|
106
|
+
actions: options.bulkActions
|
|
107
|
+
})
|
|
108
|
+
],
|
|
109
|
+
footer: []
|
|
110
|
+
},
|
|
111
|
+
displayName: options.displayName,
|
|
112
|
+
description: options.description,
|
|
113
|
+
metadata: hrParts.hrMetadata(options.name, 'List', listScopes)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** The directory: everyone in the company as cards - photo, name, title, department and how to reach them. Choosing a card opens the employee. */ const hrEmployeeDirectoryTemplate = listTemplateOf({
|
|
117
|
+
name: 'HrEmployeeDirectory',
|
|
118
|
+
entity: hrQueries.HrEntityKind.Employee,
|
|
119
|
+
displayName: 'HR employee directory',
|
|
120
|
+
description: 'Employees as cards with photo, name, title, department and contact, filtered by department, location and status.',
|
|
121
|
+
title: 'Directory',
|
|
122
|
+
subtitle: 'Everyone in the company',
|
|
123
|
+
searchLabel: 'Search people',
|
|
124
|
+
urlKey: 'people',
|
|
125
|
+
primary: {
|
|
126
|
+
label: 'New employee',
|
|
127
|
+
dialog: 'HrQuickCreateEmployee'
|
|
128
|
+
},
|
|
129
|
+
rowActions: [
|
|
130
|
+
'View profile',
|
|
131
|
+
'Send email'
|
|
132
|
+
],
|
|
133
|
+
bulkActions: [],
|
|
134
|
+
titleField: 'name',
|
|
135
|
+
recordScreen: 'hr.directory.record',
|
|
136
|
+
cards: {
|
|
137
|
+
imageField: 'photo'
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
/** The time-off requests: who asked for what and when, with the actions a manager takes on one or many at once. */ const hrTimeOffListTemplate = listTemplateOf({
|
|
141
|
+
name: 'HrTimeOffList',
|
|
142
|
+
entity: hrQueries.HrEntityKind.TimeOff,
|
|
143
|
+
displayName: 'HR time off',
|
|
144
|
+
description: 'Time-off requests with the employee, type, dates, days and status, filtered by type, status and period.',
|
|
145
|
+
title: 'Time off',
|
|
146
|
+
subtitle: 'Requests to approve and who is away',
|
|
147
|
+
searchLabel: 'Search requests',
|
|
148
|
+
urlKey: 'timeoff',
|
|
149
|
+
primary: {
|
|
150
|
+
label: 'Request time off',
|
|
151
|
+
dialog: 'HrRequestTimeOff'
|
|
152
|
+
},
|
|
153
|
+
rowActions: [
|
|
154
|
+
'Approve',
|
|
155
|
+
'Decline',
|
|
156
|
+
'Cancel'
|
|
157
|
+
],
|
|
158
|
+
bulkActions: [
|
|
159
|
+
'Approve',
|
|
160
|
+
'Decline'
|
|
161
|
+
],
|
|
162
|
+
titleField: 'employee'
|
|
163
|
+
});
|
|
164
|
+
/** The balances: what each employee is entitled to, has taken and has left, with how much of the year is used. Read only. */ const hrTimeOffBalanceListTemplate = listTemplateOf({
|
|
165
|
+
name: 'HrTimeOffBalanceList',
|
|
166
|
+
entity: hrQueries.HrEntityKind.Balance,
|
|
167
|
+
displayName: 'HR time-off balances',
|
|
168
|
+
description: 'Each employee\'s entitlement, days taken and days left, with how much of it is used.',
|
|
169
|
+
title: 'Balances',
|
|
170
|
+
subtitle: 'Time off taken and left this year',
|
|
171
|
+
searchLabel: 'Search balances',
|
|
172
|
+
urlKey: 'balances',
|
|
173
|
+
primary: {
|
|
174
|
+
label: 'Request time off',
|
|
175
|
+
dialog: 'HrRequestTimeOff'
|
|
176
|
+
},
|
|
177
|
+
rowActions: [
|
|
178
|
+
'View employee'
|
|
179
|
+
],
|
|
180
|
+
bulkActions: [],
|
|
181
|
+
titleField: 'employee',
|
|
182
|
+
readOnly: true
|
|
183
|
+
});
|
|
184
|
+
/** The onboarding: new hires, when they start, who looks after them and how far along their checklist is. Choosing a row opens the checklist. */ const hrOnboardingListTemplate = listTemplateOf({
|
|
185
|
+
name: 'HrOnboardingList',
|
|
186
|
+
entity: hrQueries.HrEntityKind.Onboarding,
|
|
187
|
+
displayName: 'HR onboarding',
|
|
188
|
+
description: 'New hires with their start date, owner and a progress bar of their checklist.',
|
|
189
|
+
title: 'Onboarding',
|
|
190
|
+
subtitle: 'New hires and how far along they are',
|
|
191
|
+
searchLabel: 'Search new hires',
|
|
192
|
+
urlKey: 'onboarding',
|
|
193
|
+
primary: {
|
|
194
|
+
label: 'New employee',
|
|
195
|
+
dialog: 'HrQuickCreateEmployee'
|
|
196
|
+
},
|
|
197
|
+
rowActions: [
|
|
198
|
+
'Open checklist',
|
|
199
|
+
'Remind owner'
|
|
200
|
+
],
|
|
201
|
+
bulkActions: [],
|
|
202
|
+
titleField: 'name',
|
|
203
|
+
recordScreen: 'hr.onboarding.record'
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
exports.hrEmployeeDirectoryTemplate = hrEmployeeDirectoryTemplate;
|
|
207
|
+
exports.hrOnboardingListTemplate = hrOnboardingListTemplate;
|
|
208
|
+
exports.hrTimeOffBalanceListTemplate = hrTimeOffBalanceListTemplate;
|
|
209
|
+
exports.hrTimeOffListTemplate = hrTimeOffListTemplate;
|
|
210
|
+
//# sourceMappingURL=listTemplates.js.map
|