@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.
Files changed (130) hide show
  1. package/README.md +66 -2
  2. package/approvalsApplication.ts +28 -0
  3. package/approvalsParts.ts +50 -0
  4. package/approvalsQueries.ts +58 -0
  5. package/approvalsScreenSet.ts +24 -0
  6. package/blueprint.ts +16 -0
  7. package/blueprintCatalog.json +171 -0
  8. package/dist/cjs/approvalsApplication.js +49 -0
  9. package/dist/cjs/approvalsApplication.js.map +1 -0
  10. package/dist/cjs/approvalsParts.js +131 -0
  11. package/dist/cjs/approvalsParts.js.map +1 -0
  12. package/dist/cjs/approvalsQueries.js +68 -0
  13. package/dist/cjs/approvalsQueries.js.map +1 -0
  14. package/dist/cjs/approvalsScreenSet.js +61 -0
  15. package/dist/cjs/approvalsScreenSet.js.map +1 -0
  16. package/dist/cjs/blueprint.js +19 -0
  17. package/dist/cjs/blueprint.js.map +1 -0
  18. package/dist/cjs/index.js +67 -0
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/cjs/manifest.js +71 -0
  21. package/dist/cjs/manifest.js.map +1 -0
  22. package/dist/cjs/navigation.js +117 -0
  23. package/dist/cjs/navigation.js.map +1 -0
  24. package/dist/cjs/package.json +3 -0
  25. package/dist/cjs/packageName.js +8 -0
  26. package/dist/cjs/packageName.js.map +1 -0
  27. package/dist/cjs/screens/index.js +23 -0
  28. package/dist/cjs/screens/index.js.map +1 -0
  29. package/dist/cjs/templateProvenance.js +24 -0
  30. package/dist/cjs/templateProvenance.js.map +1 -0
  31. package/dist/cjs/templates/formTemplates.js +111 -0
  32. package/dist/cjs/templates/formTemplates.js.map +1 -0
  33. package/dist/cjs/templates/index.js +31 -0
  34. package/dist/cjs/templates/index.js.map +1 -0
  35. package/dist/cjs/templates/listTemplates.js +221 -0
  36. package/dist/cjs/templates/listTemplates.js.map +1 -0
  37. package/dist/cjs/templates/recordTemplates.js +97 -0
  38. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  39. package/dist/cjs/templates/wizardTemplate.js +77 -0
  40. package/dist/cjs/templates/wizardTemplate.js.map +1 -0
  41. package/dist/esm/approvalsApplication.d.ts +10 -0
  42. package/dist/esm/approvalsApplication.d.ts.map +1 -0
  43. package/dist/esm/approvalsApplication.js +44 -0
  44. package/dist/esm/approvalsApplication.js.map +1 -0
  45. package/dist/esm/approvalsParts.d.ts +13 -0
  46. package/dist/esm/approvalsParts.d.ts.map +1 -0
  47. package/dist/esm/approvalsParts.js +114 -0
  48. package/dist/esm/approvalsParts.js.map +1 -0
  49. package/dist/esm/approvalsQueries.d.ts +51 -0
  50. package/dist/esm/approvalsQueries.d.ts.map +1 -0
  51. package/dist/esm/approvalsQueries.js +63 -0
  52. package/dist/esm/approvalsQueries.js.map +1 -0
  53. package/dist/esm/approvalsScreenSet.d.ts +7 -0
  54. package/dist/esm/approvalsScreenSet.d.ts.map +1 -0
  55. package/dist/esm/approvalsScreenSet.js +59 -0
  56. package/dist/esm/approvalsScreenSet.js.map +1 -0
  57. package/dist/esm/blueprint.d.ts +3 -0
  58. package/dist/esm/blueprint.d.ts.map +1 -0
  59. package/dist/esm/blueprint.js +17 -0
  60. package/dist/esm/blueprint.js.map +1 -0
  61. package/dist/esm/index.d.ts +12 -0
  62. package/dist/esm/index.d.ts.map +1 -0
  63. package/dist/esm/index.js +17 -0
  64. package/dist/esm/index.js.map +1 -0
  65. package/dist/esm/manifest.d.ts +3 -0
  66. package/dist/esm/manifest.d.ts.map +1 -0
  67. package/dist/esm/manifest.js +69 -0
  68. package/dist/esm/manifest.js.map +1 -0
  69. package/dist/esm/navigation.d.ts +5 -0
  70. package/dist/esm/navigation.d.ts.map +1 -0
  71. package/dist/esm/navigation.js +113 -0
  72. package/dist/esm/navigation.js.map +1 -0
  73. package/dist/esm/package.json +3 -0
  74. package/dist/esm/packageName.d.ts +2 -0
  75. package/dist/esm/packageName.d.ts.map +1 -0
  76. package/dist/esm/packageName.js +6 -0
  77. package/dist/esm/packageName.js.map +1 -0
  78. package/dist/esm/screens/index.d.ts +3 -0
  79. package/dist/esm/screens/index.d.ts.map +1 -0
  80. package/dist/esm/screens/index.js +21 -0
  81. package/dist/esm/screens/index.js.map +1 -0
  82. package/dist/esm/templateProvenance.d.ts +3 -0
  83. package/dist/esm/templateProvenance.d.ts.map +1 -0
  84. package/dist/esm/templateProvenance.js +22 -0
  85. package/dist/esm/templateProvenance.js.map +1 -0
  86. package/dist/esm/templates/formTemplates.d.ts +6 -0
  87. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  88. package/dist/esm/templates/formTemplates.js +106 -0
  89. package/dist/esm/templates/formTemplates.js.map +1 -0
  90. package/dist/esm/templates/index.d.ts +7 -0
  91. package/dist/esm/templates/index.d.ts.map +1 -0
  92. package/dist/esm/templates/index.js +20 -0
  93. package/dist/esm/templates/index.js.map +1 -0
  94. package/dist/esm/templates/listTemplates.d.ts +6 -0
  95. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  96. package/dist/esm/templates/listTemplates.js +216 -0
  97. package/dist/esm/templates/listTemplates.js.map +1 -0
  98. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  99. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  100. package/dist/esm/templates/recordTemplates.js +95 -0
  101. package/dist/esm/templates/recordTemplates.js.map +1 -0
  102. package/dist/esm/templates/wizardTemplate.d.ts +3 -0
  103. package/dist/esm/templates/wizardTemplate.d.ts.map +1 -0
  104. package/dist/esm/templates/wizardTemplate.js +75 -0
  105. package/dist/esm/templates/wizardTemplate.js.map +1 -0
  106. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  107. package/index.ts +14 -0
  108. package/manifest.ts +44 -0
  109. package/navigation.ts +54 -0
  110. package/package.json +78 -4
  111. package/packageName.ts +5 -0
  112. package/sampleData/approvals-general.json +1269 -0
  113. package/sampleData/approvals-nordic.json +1269 -0
  114. package/screens/index.ts +21 -0
  115. package/templateProvenance.ts +15 -0
  116. package/templates/formTemplates.ts +61 -0
  117. package/templates/index.ts +19 -0
  118. package/templates/listTemplates.ts +116 -0
  119. package/templates/recordTemplates.ts +45 -0
  120. package/templates/wizardTemplate.ts +33 -0
  121. package/thumbnails/AllRequests.svg +13 -0
  122. package/thumbnails/ApprovalInbox.svg +23 -0
  123. package/thumbnails/DecisionDialog.svg +11 -0
  124. package/thumbnails/MyRequests.svg +13 -0
  125. package/thumbnails/NewRequestWizard.svg +14 -0
  126. package/thumbnails/RequestPage.svg +11 -0
  127. package/thumbnails/RequestTypeEditForm.svg +14 -0
  128. package/thumbnails/RequestTypeQuickCreate.svg +11 -0
  129. package/thumbnails/RequestTypes.svg +13 -0
  130. package/thumbnails/approvals.svg +9 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.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 { InteractionActionKind, InteractionTriggerKind, NotificationLevel, NotifyAction, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { listScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { ApprovalsQuery, fromQuery, localeOfData } from '../approvalsQueries';\nimport { actionButton, approvalsMetadata, component, goesTo, opensDialog, opensRecordOnSelect, withBehaviors } from '../approvalsParts';\n\nconst listScopes = [TemplateScope.Module, TemplateScope.Feature];\n\n/** 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. */\nconst exportAction = (id: string) => withBehaviors(actionButton(id, 'Export', 'secondary'), [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Click },\n actions: [{ kind: InteractionActionKind.Notify, level: NotificationLevel.Info, message: { text: 'The export has started.' } } as unknown as NotifyAction],\n }],\n}]);\n\ninterface ListOptions {\n name: string;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n searchLabel: string;\n urlKey: string;\n rows: string;\n columns: string;\n filterFields: string;\n views: string;\n columnChoices?: string;\n selection?: string;\n rowActions: string[];\n bulkActions?: string[];\n recordScreen?: string;\n\n /** The primary button of the header: its label and what it does. */\n primary?: { label: string; behaviors: ReturnType<typeof goesTo> };\n\n /** Draw the rows as cards with their actions as buttons, as an approver decides. */\n decide?: boolean;\n}\n\n/**\n * One approvals list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled. The slots, arrangement and every behavior -\n * sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.\n */\nfunction listTemplateOf(options: ListOptions): ScreenTemplate {\n const id = options.name;\n const listId = `${id}-records`;\n const list = component(listId, 'dataList', {\n label: options.title, rows: fromQuery(options.rows), columns: fromQuery(options.columns), titleField: 'title', pageSize: options.decide ? 6 : 10, rowActions: options.rowActions, urlKey: options.urlKey,\n ...(options.decide ? { variant: 'cards', rowActionStyle: 'buttons', toneField: 'tone' } : {}),\n selectionMode: options.recordScreen || options.decide ? 'single' : 'multiple', ...localeOfData,\n });\n const toolbar = [\n component(`${id}-search`, 'globalSearch', { placeholder: options.searchLabel, label: options.searchLabel, urlKey: `${options.urlKey}q` }),\n component(`${id}-views`, 'savedViewsMenu', { views: fromQuery(options.views), savePermission: 'enabled', managePermission: 'enabled' }),\n ...(options.columnChoices ? [component(`${id}-columns`, 'columnChooser', { columns: fromQuery(options.columnChoices) })] : []),\n ];\n\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: listScreenTemplate.slots,\n arrangement: listScreenTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, {\n actions: [exportAction(`${id}-export`), ...(options.primary ? [withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.behaviors)] : [])],\n })],\n toolbar,\n filters: [component(`${id}-filter`, 'filterBuilder', { fields: fromQuery(options.filterFields), ...localeOfData })],\n list: [options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : options.decide ? withBehaviors(list, opensDialog('DecisionDialog')) : list],\n bulkBar: options.bulkActions && options.selection && !options.recordScreen && !options.decide ? [component(`${id}-bulk`, 'bulkBar', { selection: fromQuery(options.selection), actions: options.bulkActions })] : [],\n footer: [],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: approvalsMetadata(options.name, 'List', listScopes),\n };\n}\n\n/**\n * 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\n * 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,\n * so a decision always carries a comment. A card's tone says how overdue it is, and the words say the same.\n */\nexport const approvalInboxTemplate = listTemplateOf({\n name: 'ApprovalInbox', displayName: 'Approval inbox', description: 'The requests waiting for my decision as cards, with Approve, Reject and Request changes inline.',\n title: 'Inbox', subtitle: 'Waiting for your decision', searchLabel: 'Search the inbox', urlKey: 'inbox', rows: ApprovalsQuery.Inbox, columns: ApprovalsQuery.InboxColumns,\n filterFields: ApprovalsQuery.InboxFilterFields, views: ApprovalsQuery.InboxViews, rowActions: ['Approve', 'Reject', 'Request changes'], decide: true,\n});\n\n/** 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. */\nexport const myRequestsTemplate = listTemplateOf({\n name: 'MyRequests', displayName: 'My requests', description: 'The requests I made, with draft, submitted, approved and rejected as chips.',\n title: 'My requests', subtitle: 'What I asked for and where it stands', searchLabel: 'Search my requests', urlKey: 'requests',\n rows: ApprovalsQuery.MyRequests, columns: ApprovalsQuery.MyRequestColumns, filterFields: ApprovalsQuery.MyRequestFilterFields, views: ApprovalsQuery.MyRequestViews, columnChoices: ApprovalsQuery.MyRequestColumnChoices,\n selection: ApprovalsQuery.MyRequestSelection, rowActions: ['Withdraw', 'Delete draft'], bulkActions: ['Withdraw'], recordScreen: 'approvals.requests.page', primary: { label: 'New request', behaviors: goesTo('approvals.requests.new') },\n});\n\n/** Every request of the organisation, with who asked, who decides and where each stands. */\nexport const allRequestsTemplate = listTemplateOf({\n name: 'AllRequests', displayName: 'All requests', description: 'Every request of the organisation with its type, requester, current approver and status.',\n title: 'All requests', subtitle: 'Every request in the organisation', searchLabel: 'Search all requests', urlKey: 'all',\n rows: ApprovalsQuery.AllRequests, columns: ApprovalsQuery.AllRequestColumns, filterFields: ApprovalsQuery.AllRequestFilterFields, views: ApprovalsQuery.AllRequestViews, columnChoices: ApprovalsQuery.AllRequestColumnChoices,\n selection: ApprovalsQuery.AllRequestSelection, rowActions: ['Reassign', 'Cancel'], bulkActions: ['Reassign', 'Cancel'], recordScreen: 'approvals.requests.page',\n});\n\n/** 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. */\nexport const requestTypesTemplate = listTemplateOf({\n name: 'RequestTypes', displayName: 'Request types', description: 'The request types an organisation offers, with the steps that approve each and whether it is active.',\n title: 'Templates', subtitle: 'The request types people can choose from', searchLabel: 'Search request types', urlKey: 'types',\n rows: ApprovalsQuery.RequestTypes, columns: ApprovalsQuery.RequestTypeColumns, filterFields: ApprovalsQuery.RequestTypeFilterFields, views: ApprovalsQuery.RequestTypeViews, columnChoices: ApprovalsQuery.RequestTypeColumnChoices,\n selection: ApprovalsQuery.RequestTypeSelection, rowActions: ['Duplicate', 'Deactivate'], bulkActions: ['Deactivate'], recordScreen: 'approvals.templates.edit', primary: { label: 'New request type', behaviors: opensDialog('RequestTypeQuickCreate') },\n});\n"],"names":["listScopes","TemplateScope","Module","Feature","exportAction","id","withBehaviors","actionButton","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","Notify","level","NotificationLevel","Info","message","text","listTemplateOf","options","name","listId","list","component","label","title","rows","fromQuery","columns","titleField","pageSize","decide","rowActions","urlKey","variant","rowActionStyle","toneField","selectionMode","recordScreen","localeOfData","toolbar","placeholder","searchLabel","views","savePermission","managePermission","columnChoices","fitsSlot","slots","listScreenTemplate","arrangement","content","header","subtitle","primary","behaviors","filters","fields","filterFields","opensRecordOnSelect","opensDialog","bulkBar","bulkActions","selection","footer","displayName","description","metadata","approvalsMetadata","approvalInboxTemplate","ApprovalsQuery","Inbox","InboxColumns","InboxFilterFields","InboxViews","myRequestsTemplate","MyRequests","MyRequestColumns","MyRequestFilterFields","MyRequestViews","MyRequestColumnChoices","MyRequestSelection","goesTo","allRequestsTemplate","AllRequests","AllRequestColumns","AllRequestFilterFields","AllRequestViews","AllRequestColumnChoices","AllRequestSelection","requestTypesTemplate","RequestTypes","RequestTypeColumns","RequestTypeFilterFields","RequestTypeViews","RequestTypeColumnChoices","RequestTypeSelection"],"mappings":";;;;;AAAA;AACA;AAOA,MAAMA,UAAAA,GAAa;AAACC,IAAAA,aAAAA,CAAcC,MAAM;AAAED,IAAAA,aAAAA,CAAcE;AAAQ,CAAA;AAEhE,gJACA,MAAMC,YAAAA,GAAe,CAACC,KAAeC,aAAAA,CAAcC,YAAAA,CAAaF,EAAAA,EAAI,QAAA,EAAU,WAAA,CAAA,EAAc;AAAC,QAAA;YACzFG,QAAAA,EAAU;AAAC,gBAAA;oBACPC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,uBAAuBC;AAAM,qBAAA;oBAC9CC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,sBAAsBC,MAAM;AAAEC,4BAAAA,KAAAA,EAAOC,kBAAkBC,IAAI;4BAAEC,OAAAA,EAAS;gCAAEC,IAAAA,EAAM;AAA0B;AAAE;AAA6B;AAC7J;AAAE;AACN;AAAE,KAAA,CAAA;AA2BF;;;IAIA,SAASC,eAAeC,OAAoB,EAAA;IACxC,MAAMjB,EAAAA,GAAKiB,QAAQC,IAAI;AACvB,IAAA,MAAMC,MAAAA,GAAS,CAAA,EAAGnB,EAAAA,CAAG,QAAQ,CAAC;IAC9B,MAAMoB,IAAAA,GAAOC,SAAAA,CAAUF,MAAAA,EAAQ,UAAA,EAAY;AACvCG,QAAAA,KAAAA,EAAOL,QAAQM,KAAK;QAAEC,IAAAA,EAAMC,SAAAA,C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eiB,eAAe;AAAEzC,IAAAA,aAAAA,EAAewB,eAAekB,uBAAuB;AAC9NzB,IAAAA,SAAAA,EAAWO,eAAemB,mBAAmB;IAAEzD,UAAAA,EAAY;AAAC,QAAA,UAAA;AAAY,QAAA;AAAS,KAAA;IAAE8B,WAAAA,EAAa;AAAC,QAAA,UAAA;AAAY,QAAA;AAAS,KAAA;IAAExB,YAAAA,EAAc;AAC1I,CAAA;AAEA,oKACO,MAAMoD,oBAAAA,GAAuBxE,cAAAA,CAAe;IAC/CE,IAAAA,EAAM,cAAA;IAAgB6C,WAAAA,EAAa,eAAA;IAAiBC,WAAAA,EAAa,sGAAA;IACjEzC,KAAAA,EAAO,WAAA;IAAa4B,QAAAA,EAAU,0CAAA;IAA4CX,WAAAA,EAAa,sBAAA;IAAwBT,MAAAA,EAAQ,OAAA;AACvHP,IAAAA,IAAAA,EAAM4C,eAAeqB,YAAY;AAAE/D,IAAAA,OAAAA,EAAS0C,eAAesB,kBAAkB;AAAElC,IAAAA,YAAAA,EAAcY,eAAeuB,uBAAuB;AAAElD,IAAAA,KAAAA,EAAO2B,eAAewB,gBAAgB;AAAEhD,IAAAA,aAAAA,EAAewB,eAAeyB,wBAAwB;AACnOhC,IAAAA,SAAAA,EAAWO,eAAe0B,oBAAoB;IAAEhE,UAAAA,EAAY;AAAC,QAAA,WAAA;AAAa,QAAA;AAAa,KAAA;IAAE8B,WAAAA,EAAa;AAAC,QAAA;AAAa,KAAA;IAAExB,YAAAA,EAAc,0BAAA;IAA4BgB,OAAAA,EAAS;QAAE9B,KAAAA,EAAO,kBAAA;AAAoB+B,QAAAA,SAAAA,EAAWK,WAAAA,CAAY,wBAAA;AAA0B;AAC3P,CAAA;;"}
@@ -0,0 +1,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const requestPageTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=recordTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordTemplates.d.ts","sourceRoot":"","sources":["../../../templates/recordTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAWpE,eAAO,MAAM,mBAAmB,EAAE,cA8BjC,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { component, recordPageTemplate } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, ApprovalsQuery, currencyOfData } from '../approvalsQueries.js';
4
+ import { approvalsMetadata, withBehaviors, opensDialog, 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
+ /**
9
+ * The request page: the foundation `RecordPage` with the request's title, its key facts under it - status, who asked, the amount - and the **approval chain**
10
+ * as the page's first block: the steps in order, who decides each and where it stands. A rejection stops the chain and the steps after it read "Not reached"; the
11
+ * outcome is said in words above the steps. The request's fields, its **attachments** and its **comments** (the page's activity) follow, and the decision
12
+ * buttons open the decision dialog.
13
+ */ const requestPageTemplate = {
14
+ name: 'RequestPage',
15
+ fitsSlot: 'content',
16
+ slots: recordPageTemplate.slots,
17
+ arrangement: recordPageTemplate.arrangement,
18
+ content: {
19
+ header: [
20
+ component('request-header', 'pageHeader', {
21
+ title: fromQuery(ApprovalsQuery.Request, '0.title'),
22
+ subtitle: fromQuery(ApprovalsQuery.Request, '0.reference')
23
+ }, {
24
+ actions: [
25
+ withBehaviors(actionButton('request-approve', 'Approve', 'primary'), opensDialog('DecisionDialog')),
26
+ withBehaviors(actionButton('request-reject', 'Reject', 'secondary'), opensDialog('DecisionDialog')),
27
+ withBehaviors(actionButton('request-changes', 'Request changes', 'secondary'), opensDialog('DecisionDialog'))
28
+ ]
29
+ })
30
+ ],
31
+ summary: [
32
+ component('request-status', 'statusChip', {
33
+ status: fromQuery(ApprovalsQuery.RequestSummary, '0.status'),
34
+ tone: fromQuery(ApprovalsQuery.RequestSummary, '0.tone')
35
+ }),
36
+ component('request-amount', 'statCard', {
37
+ label: fromQuery(ApprovalsQuery.RequestSummary, '0.amountLabel'),
38
+ value: fromQuery(ApprovalsQuery.RequestSummary, '0.amount'),
39
+ format: 'currency',
40
+ fractionDigits: 0,
41
+ ...currencyOfData
42
+ }),
43
+ component('request-people', 'avatarStack', {
44
+ people: fromQuery(ApprovalsQuery.RequestSummary, '0.people')
45
+ })
46
+ ],
47
+ tabs: [
48
+ component('request-tabs', 'tabSet', {
49
+ tabs: fromQuery(ApprovalsQuery.RequestTabs),
50
+ urlKey: 'tab',
51
+ label: 'Request sections'
52
+ })
53
+ ],
54
+ main: [
55
+ component('request-chain', 'approvalChainStepper', {
56
+ steps: fromQuery(ApprovalsQuery.Chain),
57
+ label: 'Approval chain',
58
+ ...localeOfData
59
+ }),
60
+ component('request-form', 'formScreenBody', {
61
+ mode: 'readOnly',
62
+ sections: fromQuery(ApprovalsQuery.RequestSections),
63
+ values: fromQuery(ApprovalsQuery.Request, '0'),
64
+ ...localeOfData
65
+ })
66
+ ],
67
+ related: [
68
+ component('request-attachments', 'dataList', {
69
+ label: 'Attachments',
70
+ rows: fromQuery(ApprovalsQuery.Attachments),
71
+ columns: fromQuery(ApprovalsQuery.AttachmentColumns),
72
+ titleField: 'name',
73
+ pageSize: 5,
74
+ ...localeOfData
75
+ })
76
+ ],
77
+ activity: [
78
+ component('request-comments', 'activityFeed', {
79
+ label: 'Comments',
80
+ entries: fromQuery(ApprovalsQuery.Comments),
81
+ ...localeOfData
82
+ })
83
+ ],
84
+ aside: []
85
+ },
86
+ displayName: 'Request page',
87
+ description: 'One request: summary, approval chain, fields, attachments and comments, and the decision buttons.',
88
+ metadata: approvalsMetadata('RequestPage', 'Detail', [
89
+ TemplateScope.Feature,
90
+ TemplateScope.Subfeature
91
+ ])
92
+ };
93
+
94
+ export { requestPageTemplate };
95
+ //# sourceMappingURL=recordTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordTemplates.js","sources":["../../../templates/recordTemplates.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 { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { recordPageTemplate } from '@cratis/scene.blueprint.default';\nimport { ApprovalsQuery, currencyOfData, fromQuery, localeOfData } from '../approvalsQueries';\nimport { actionButton, approvalsMetadata, component, opensDialog, withBehaviors } from '../approvalsParts';\n\n/**\n * The request page: the foundation `RecordPage` with the request's title, its key facts under it - status, who asked, the amount - and the **approval chain**\n * as the page's first block: the steps in order, who decides each and where it stands. A rejection stops the chain and the steps after it read \"Not reached\"; the\n * outcome is said in words above the steps. The request's fields, its **attachments** and its **comments** (the page's activity) follow, and the decision\n * buttons open the decision dialog.\n */\nexport const requestPageTemplate: ScreenTemplate = {\n name: 'RequestPage',\n fitsSlot: 'content',\n slots: recordPageTemplate.slots,\n arrangement: recordPageTemplate.arrangement,\n content: {\n header: [component('request-header', 'pageHeader', { title: fromQuery(ApprovalsQuery.Request, '0.title'), subtitle: fromQuery(ApprovalsQuery.Request, '0.reference') }, {\n actions: [\n withBehaviors(actionButton('request-approve', 'Approve', 'primary'), opensDialog('DecisionDialog')),\n withBehaviors(actionButton('request-reject', 'Reject', 'secondary'), opensDialog('DecisionDialog')),\n withBehaviors(actionButton('request-changes', 'Request changes', 'secondary'), opensDialog('DecisionDialog')),\n ],\n })],\n summary: [\n component('request-status', 'statusChip', { status: fromQuery(ApprovalsQuery.RequestSummary, '0.status'), tone: fromQuery(ApprovalsQuery.RequestSummary, '0.tone') }),\n component('request-amount', 'statCard', { label: fromQuery(ApprovalsQuery.RequestSummary, '0.amountLabel'), value: fromQuery(ApprovalsQuery.RequestSummary, '0.amount'), format: 'currency', fractionDigits: 0, ...currencyOfData }),\n component('request-people', 'avatarStack', { people: fromQuery(ApprovalsQuery.RequestSummary, '0.people') }),\n ],\n tabs: [component('request-tabs', 'tabSet', { tabs: fromQuery(ApprovalsQuery.RequestTabs), urlKey: 'tab', label: 'Request sections' })],\n main: [\n component('request-chain', 'approvalChainStepper', { steps: fromQuery(ApprovalsQuery.Chain), label: 'Approval chain', ...localeOfData }),\n component('request-form', 'formScreenBody', { mode: 'readOnly', sections: fromQuery(ApprovalsQuery.RequestSections), values: fromQuery(ApprovalsQuery.Request, '0'), ...localeOfData }),\n ],\n related: [component('request-attachments', 'dataList', { label: 'Attachments', rows: fromQuery(ApprovalsQuery.Attachments), columns: fromQuery(ApprovalsQuery.AttachmentColumns), titleField: 'name', pageSize: 5, ...localeOfData })],\n activity: [component('request-comments', 'activityFeed', { label: 'Comments', entries: fromQuery(ApprovalsQuery.Comments), ...localeOfData })],\n aside: [],\n },\n displayName: 'Request page',\n description: 'One request: summary, approval chain, fields, attachments and comments, and the decision buttons.',\n metadata: approvalsMetadata('RequestPage', 'Detail', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n"],"names":["requestPageTemplate","name","fitsSlot","slots","recordPageTemplate","arrangement","content","header","component","title","fromQuery","ApprovalsQuery","Request","subtitle","actions","withBehaviors","actionButton","opensDialog","summary","status","RequestSummary","tone","label","value","format","fractionDigits","currencyOfData","people","tabs","RequestTabs","urlKey","main","steps","Chain","localeOfData","mode","sections","RequestSections","values","related","rows","Attachments","columns","AttachmentColumns","titleField","pageSize","activity","entries","Comments","aside","displayName","description","metadata","approvalsMetadata","TemplateScope","Feature","Subfeature"],"mappings":";;;;;AAAA;AACA;AAOA;;;;;UAMaA,mBAAAA,GAAsC;IAC/CC,IAAAA,EAAM,aAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,mBAAmBD,KAAK;AAC/BE,IAAAA,WAAAA,EAAaD,mBAAmBC,WAAW;IAC3CC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,SAAAA,CAAU,kBAAkB,YAAA,EAAc;gBAAEC,KAAAA,EAAOC,SAAAA,CAAUC,cAAAA,CAAeC,OAAO,EAAE,SAAA,CAAA;gBA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AAA,CAAkB,eAAe,QAAA,EAAU;AAACC,QAAAA,aAAAA,CAAcC,OAAO;AAAED,QAAAA,aAAAA,CAAcE;AAAW,KAAA;AAC1G;;"}
@@ -0,0 +1,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const newRequestWizardTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=wizardTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizardTemplate.d.ts","sourceRoot":"","sources":["../../../templates/wizardTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAUpE,eAAO,MAAM,wBAAwB,EAAE,cAmBtC,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { component, wizardScreenTemplate } from '@cratis/scene.blueprint.default';
3
+ import { fromQuery, ApprovalsQuery, localeOfData } from '../approvalsQueries.js';
4
+ import { approvalsMetadata } 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
+ /**
9
+ * The new-request wizard (the foundation `WizardScreen`): **request type**, **details**, **attachments**, then **review and submit**. The type chooses what the
10
+ * details ask for; an invalid step blocks Next and says why; the step the person has reached and the steps they have done survive a refresh, and a refresh can
11
+ * never land past a step that was not done. Save draft keeps the request as a draft in My requests. The step's content is the slot named by its id.
12
+ */ const newRequestWizardTemplate = {
13
+ name: 'NewRequestWizard',
14
+ fitsSlot: 'content',
15
+ slots: wizardScreenTemplate.slots,
16
+ arrangement: wizardScreenTemplate.arrangement,
17
+ content: {
18
+ header: [
19
+ component('request-wizard-header', 'pageHeader', {
20
+ title: 'New request',
21
+ subtitle: 'Four short steps'
22
+ })
23
+ ],
24
+ progress: [
25
+ component('request-wizard-progress', 'wizardProgress', {
26
+ steps: fromQuery(ApprovalsQuery.WizardSteps),
27
+ urlKey: 'step'
28
+ }, {
29
+ type: [
30
+ component('request-wizard-type', 'formScreenBody', {
31
+ mode: 'create',
32
+ sections: fromQuery(ApprovalsQuery.TypeSections),
33
+ errors: fromQuery(ApprovalsQuery.FormErrors, '0'),
34
+ ...localeOfData
35
+ })
36
+ ],
37
+ details: [
38
+ component('request-wizard-details', 'formScreenBody', {
39
+ mode: 'create',
40
+ sections: fromQuery(ApprovalsQuery.DetailSections),
41
+ errors: fromQuery(ApprovalsQuery.FormErrors, '0'),
42
+ ...localeOfData
43
+ })
44
+ ],
45
+ attachments: [
46
+ component('request-wizard-attachments', 'fileUploader', {
47
+ accept: '.pdf, .png, .jpg, .docx, .xlsx',
48
+ maxSizeMb: 10,
49
+ multiple: true,
50
+ actionPermission: 'enabled'
51
+ })
52
+ ],
53
+ review: [
54
+ component('request-wizard-review', 'formScreenBody', {
55
+ mode: 'readOnly',
56
+ sections: fromQuery(ApprovalsQuery.ReviewSections),
57
+ values: fromQuery(ApprovalsQuery.ReviewValues, '0'),
58
+ ...localeOfData
59
+ })
60
+ ]
61
+ })
62
+ ],
63
+ step: [],
64
+ actions: []
65
+ },
66
+ displayName: 'New request',
67
+ description: 'Request type, details, attachments, then review and submit; the step survives a refresh and a draft can be saved.',
68
+ metadata: approvalsMetadata('NewRequestWizard', 'Wizard', [
69
+ TemplateScope.Feature,
70
+ TemplateScope.Subfeature
71
+ ])
72
+ };
73
+
74
+ export { newRequestWizardTemplate };
75
+ //# sourceMappingURL=wizardTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizardTemplate.js","sources":["../../../templates/wizardTemplate.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 { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { wizardScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { ApprovalsQuery, fromQuery, localeOfData } from '../approvalsQueries';\nimport { approvalsMetadata, component } from '../approvalsParts';\n\n/**\n * The new-request wizard (the foundation `WizardScreen`): **request type**, **details**, **attachments**, then **review and submit**. The type chooses what the\n * details ask for; an invalid step blocks Next and says why; the step the person has reached and the steps they have done survive a refresh, and a refresh can\n * never land past a step that was not done. Save draft keeps the request as a draft in My requests. The step's content is the slot named by its id.\n */\nexport const newRequestWizardTemplate: ScreenTemplate = {\n name: 'NewRequestWizard',\n fitsSlot: 'content',\n slots: wizardScreenTemplate.slots,\n arrangement: wizardScreenTemplate.arrangement,\n content: {\n header: [component('request-wizard-header', 'pageHeader', { title: 'New request', subtitle: 'Four short steps' })],\n progress: [component('request-wizard-progress', 'wizardProgress', { steps: fromQuery(ApprovalsQuery.WizardSteps), urlKey: 'step' }, {\n type: [component('request-wizard-type', 'formScreenBody', { mode: 'create', sections: fromQuery(ApprovalsQuery.TypeSections), errors: fromQuery(ApprovalsQuery.FormErrors, '0'), ...localeOfData })],\n details: [component('request-wizard-details', 'formScreenBody', { mode: 'create', sections: fromQuery(ApprovalsQuery.DetailSections), errors: fromQuery(ApprovalsQuery.FormErrors, '0'), ...localeOfData })],\n attachments: [component('request-wizard-attachments', 'fileUploader', { accept: '.pdf, .png, .jpg, .docx, .xlsx', maxSizeMb: 10, multiple: true, actionPermission: 'enabled' })],\n review: [component('request-wizard-review', 'formScreenBody', { mode: 'readOnly', sections: fromQuery(ApprovalsQuery.ReviewSections), values: fromQuery(ApprovalsQuery.ReviewValues, '0'), ...localeOfData })],\n })],\n step: [],\n actions: [],\n },\n displayName: 'New request',\n description: 'Request type, details, attachments, then review and submit; the step survives a refresh and a draft can be saved.',\n metadata: approvalsMetadata('NewRequestWizard', 'Wizard', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n"],"names":["newRequestWizardTemplate","name","fitsSlot","slots","wizardScreenTemplate","arrangement","content","header","component","title","subtitle","progress","steps","fromQuery","ApprovalsQuery","WizardSteps","urlKey","type","mode","sections","TypeSections","errors","FormErrors","localeOfData","details","DetailSections","attachments","accept","maxSizeMb","multiple","actionPermission","review","ReviewSections","values","ReviewValues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