@cratis/scene.blueprint.orders 0.0.0-stage → 4.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -2
- package/blueprint.ts +16 -0
- package/blueprintCatalog.json +107 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/index.js +68 -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 +109 -0
- package/dist/cjs/navigation.js.map +1 -0
- package/dist/cjs/ordersApplication.js +49 -0
- package/dist/cjs/ordersApplication.js.map +1 -0
- package/dist/cjs/ordersParts.js +151 -0
- package/dist/cjs/ordersParts.js.map +1 -0
- package/dist/cjs/ordersQueries.js +66 -0
- package/dist/cjs/ordersQueries.js.map +1 -0
- package/dist/cjs/ordersScreenSet.js +40 -0
- package/dist/cjs/ordersScreenSet.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/boardTemplate.js +60 -0
- package/dist/cjs/templates/boardTemplate.js.map +1 -0
- package/dist/cjs/templates/deliveryTemplate.js +88 -0
- package/dist/cjs/templates/deliveryTemplate.js.map +1 -0
- package/dist/cjs/templates/formTemplates.js +50 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +23 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +145 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +101 -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/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +18 -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 +105 -0
- package/dist/esm/navigation.js.map +1 -0
- package/dist/esm/ordersApplication.d.ts +10 -0
- package/dist/esm/ordersApplication.d.ts.map +1 -0
- package/dist/esm/ordersApplication.js +44 -0
- package/dist/esm/ordersApplication.js.map +1 -0
- package/dist/esm/ordersParts.d.ts +16 -0
- package/dist/esm/ordersParts.d.ts.map +1 -0
- package/dist/esm/ordersParts.js +133 -0
- package/dist/esm/ordersParts.js.map +1 -0
- package/dist/esm/ordersQueries.d.ts +40 -0
- package/dist/esm/ordersQueries.d.ts.map +1 -0
- package/dist/esm/ordersQueries.js +58 -0
- package/dist/esm/ordersQueries.js.map +1 -0
- package/dist/esm/ordersScreenSet.d.ts +7 -0
- package/dist/esm/ordersScreenSet.d.ts.map +1 -0
- package/dist/esm/ordersScreenSet.js +38 -0
- package/dist/esm/ordersScreenSet.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/boardTemplate.d.ts +3 -0
- package/dist/esm/templates/boardTemplate.d.ts.map +1 -0
- package/dist/esm/templates/boardTemplate.js +58 -0
- package/dist/esm/templates/boardTemplate.js.map +1 -0
- package/dist/esm/templates/deliveryTemplate.d.ts +3 -0
- package/dist/esm/templates/deliveryTemplate.d.ts.map +1 -0
- package/dist/esm/templates/deliveryTemplate.js +86 -0
- package/dist/esm/templates/deliveryTemplate.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 +48 -0
- package/dist/esm/templates/formTemplates.js.map +1 -0
- package/dist/esm/templates/index.d.ts +8 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +15 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +3 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +143 -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 +99 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/index.ts +14 -0
- package/manifest.ts +41 -0
- package/navigation.ts +53 -0
- package/ordersApplication.ts +28 -0
- package/ordersParts.ts +58 -0
- package/ordersQueries.ts +58 -0
- package/ordersScreenSet.ts +21 -0
- package/package.json +78 -4
- package/packageName.ts +5 -0
- package/sampleData/orders-en.json +952 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/boardTemplate.ts +34 -0
- package/templates/deliveryTemplate.ts +31 -0
- package/templates/formTemplates.ts +33 -0
- package/templates/index.ts +15 -0
- package/templates/listTemplates.ts +93 -0
- package/templates/recordTemplates.ts +43 -0
- package/thumbnails/OrderPage.svg +18 -0
- package/thumbnails/OrdersDeliveryCalendar.svg +16 -0
- package/thumbnails/OrdersFulfilmentBoard.svg +23 -0
- package/thumbnails/OrdersList.svg +29 -0
- package/thumbnails/OrdersQuickCreateOrder.svg +12 -0
- package/thumbnails/orders.svg +14 -0
package/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
|
|
4
|
+
export * from './packageName';
|
|
5
|
+
export * from './templateProvenance';
|
|
6
|
+
export * from './ordersQueries';
|
|
7
|
+
export * from './ordersParts';
|
|
8
|
+
export * from './ordersScreenSet';
|
|
9
|
+
export * from './templates';
|
|
10
|
+
export * from './screens';
|
|
11
|
+
export * from './navigation';
|
|
12
|
+
export * from './manifest';
|
|
13
|
+
export * from './blueprint';
|
|
14
|
+
export * from './ordersApplication';
|
package/manifest.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
4
|
+
import { PackageKind, ScenePackage } from '@cratis/scene.model';
|
|
5
|
+
import { ordersBlueprintName } from './packageName';
|
|
6
|
+
import { ordersScreenDefinitions } from './ordersScreenSet';
|
|
7
|
+
import { ordersDialogTemplates, ordersScreenTemplates } from './templates';
|
|
8
|
+
|
|
9
|
+
const description = 'Sales orders from placing to delivery: every order with its status, an order page with its lines and shipments, a fulfilment board and a delivery calendar.';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,
|
|
13
|
+
* 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
|
|
14
|
+
* and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what "update available" compares.
|
|
15
|
+
*/
|
|
16
|
+
export const ordersBlueprintManifest: ScenePackage = {
|
|
17
|
+
name: ordersBlueprintName,
|
|
18
|
+
version: '1.0.0',
|
|
19
|
+
kind: PackageKind.Blueprint,
|
|
20
|
+
dependencies: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],
|
|
21
|
+
components: [],
|
|
22
|
+
layouts: [],
|
|
23
|
+
screenTemplates: ordersScreenTemplates.map(template => template.name),
|
|
24
|
+
dialogTemplates: ordersDialogTemplates.map(template => template.name),
|
|
25
|
+
themes: [],
|
|
26
|
+
displayName: 'Orders',
|
|
27
|
+
description,
|
|
28
|
+
module: '@cratis/scene.blueprint.orders',
|
|
29
|
+
license: 'MIT',
|
|
30
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
|
|
31
|
+
sampleData: [{ id: 'orders-en', title: 'Orders · English', locale: 'en-GB', path: 'sampleData/orders-en.json' }],
|
|
32
|
+
blueprint: {
|
|
33
|
+
domain: 'orders',
|
|
34
|
+
description,
|
|
35
|
+
thumbnail: 'thumbnails/orders.svg',
|
|
36
|
+
screenSet: ordersScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({
|
|
37
|
+
name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),
|
|
38
|
+
})),
|
|
39
|
+
defaultSampleData: 'orders-en',
|
|
40
|
+
},
|
|
41
|
+
};
|
package/navigation.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
|
|
4
|
+
import { ApplicationStructure, NavigationModel, NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';
|
|
5
|
+
import { ordersScreenDefinitions } from './ordersScreenSet';
|
|
6
|
+
|
|
7
|
+
/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */
|
|
8
|
+
export const ordersModule = 'orders';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The application structure the screen set implies: one module, `orders`, a feature for each screen and the sub-features beneath it (`orders.record` is the
|
|
12
|
+
* `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
|
|
13
|
+
*/
|
|
14
|
+
export const ordersStructure: ApplicationStructure = (() => {
|
|
15
|
+
interface Node { id: string; name: string; features: Node[]; slices: never[] }
|
|
16
|
+
const root: Node = { id: ordersModule, name: 'Orders', features: [], slices: [] };
|
|
17
|
+
for (const screen of ordersScreenDefinitions) {
|
|
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 = { id, name: screen.title, features: [], slices: [] };
|
|
23
|
+
parent.features.push(node);
|
|
24
|
+
}
|
|
25
|
+
parent = node;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return { modules: [{ id: root.id, name: root.name, features: root.features }] } as unknown as ApplicationStructure;
|
|
30
|
+
})();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
|
|
34
|
+
* the places a team goes: Orders, Fulfilment and Deliveries.
|
|
35
|
+
*/
|
|
36
|
+
export const ordersNavigation: NavigationModel = {
|
|
37
|
+
application: {
|
|
38
|
+
logo: { image: '', title: 'Orders' },
|
|
39
|
+
regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'orders', title: 'Orders', target: { module: ordersModule } }] }],
|
|
40
|
+
},
|
|
41
|
+
modules: [{
|
|
42
|
+
module: ordersModule,
|
|
43
|
+
regions: [{
|
|
44
|
+
region: NavigationRegionKind.Sidebar,
|
|
45
|
+
mode: NavigationRegionMode.Override,
|
|
46
|
+
items: [
|
|
47
|
+
{ id: 'order-list', title: 'Orders', target: { module: ordersModule, feature: 'list' } },
|
|
48
|
+
{ id: 'fulfilment', title: 'Fulfilment', target: { module: ordersModule, feature: 'fulfilment' } },
|
|
49
|
+
{ id: 'deliveries', title: 'Deliveries', target: { module: ordersModule, feature: 'deliveries' } },
|
|
50
|
+
],
|
|
51
|
+
}],
|
|
52
|
+
}],
|
|
53
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
|
|
4
|
+
import { UiProfile } from '@cratis/scene.model';
|
|
5
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
6
|
+
import { ApplicationDocument, CompositionOptions, defaultLayouts, previewProfile } from '@cratis/scene.blueprint.default';
|
|
7
|
+
import { ordersNavigation, ordersStructure } from './navigation';
|
|
8
|
+
import { ordersScreens } from './screens';
|
|
9
|
+
import { ordersDialogTemplates, ordersScreenTemplates } from './templates';
|
|
10
|
+
|
|
11
|
+
/** The id of the sample-data pack a new application starts with. */
|
|
12
|
+
export const ordersDefaultSampleDataId = 'orders-en';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The example application of the blueprint: the foundation's layouts, the Orders templates, the quick-create dialog and its four screens, rendering against the
|
|
16
|
+
* foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
|
|
17
|
+
* (`Samples/Orders/orders.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
|
|
18
|
+
*/
|
|
19
|
+
export function ordersApplication(sampleData: string = ordersDefaultSampleDataId): ApplicationDocument {
|
|
20
|
+
const profile: UiProfile = { ...previewProfile(undefined), name: 'Orders', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };
|
|
21
|
+
return { layouts: defaultLayouts, screenTemplates: ordersScreenTemplates, dialogTemplates: ordersDialogTemplates, screens: ordersScreens, uiProfiles: [profile] };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */
|
|
25
|
+
export const ordersComposition: CompositionOptions = { logo: ordersNavigation.application.logo };
|
|
26
|
+
|
|
27
|
+
/** The structure and navigation the shell's regions show and the items' destinations resolve against. */
|
|
28
|
+
export const ordersNavigationModel = () => ({ structure: new ApplicationStructureIndex(ordersStructure), navigation: ordersNavigation });
|
package/ordersParts.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
|
|
4
|
+
import {
|
|
5
|
+
Behavior, BindingSourceKind, DialogTemplate, ExternalComponent, InteractionActionKind, InteractionTriggerKind, NavigateAction, OpenDialogAction, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope,
|
|
6
|
+
} from '@cratis/scene.model';
|
|
7
|
+
import { component, panel } from '@cratis/scene.blueprint.default';
|
|
8
|
+
import { ordersTemplateProvenance } from './templateProvenance';
|
|
9
|
+
|
|
10
|
+
export { component, panel };
|
|
11
|
+
|
|
12
|
+
/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */
|
|
13
|
+
export const ordersCategory = 'Business / Orders';
|
|
14
|
+
|
|
15
|
+
/** The package-relative thumbnail of a template. */
|
|
16
|
+
export const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;
|
|
17
|
+
|
|
18
|
+
/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */
|
|
19
|
+
export const ordersMetadata = (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace' | 'Calendar', scopes: TemplateScope[]): TemplateMetadata =>
|
|
20
|
+
({ ...ordersTemplateProvenance, type, category: ordersCategory, thumbnail: thumbnailOf(name), scopes });
|
|
21
|
+
|
|
22
|
+
/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */
|
|
23
|
+
export const actionButton = (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra: Record<string, unknown> = {}, behaviors?: Behavior[]): ExternalComponent =>
|
|
24
|
+
({ ...component(id, 'actionButton', { label, emphasis, permission: 'enabled', ...extra }), ...(behaviors ? { behaviors } : {}) });
|
|
25
|
+
|
|
26
|
+
/** What pressing an element does: open the named dialog template over the page. */
|
|
27
|
+
export const opensDialog = (dialogTemplate: string): Behavior[] =>
|
|
28
|
+
[{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];
|
|
29
|
+
|
|
30
|
+
/** What pressing an element does: go to the named screen. */
|
|
31
|
+
export const goesTo = (screen: string): Behavior[] =>
|
|
32
|
+
[{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.Navigate, screen } as NavigateAction] }] }];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is
|
|
36
|
+
* opening it - the way a table of records works everywhere.
|
|
37
|
+
*/
|
|
38
|
+
export const opensRecordOnSelect = (listId: string, screen: string): Behavior[] => [{
|
|
39
|
+
bindings: [{
|
|
40
|
+
trigger: { kind: InteractionTriggerKind.Select },
|
|
41
|
+
actions: [{ kind: InteractionActionKind.Navigate, screen, arguments: [{ name: 'id', value: { kind: BindingSourceKind.ComponentProperty, componentId: listId, path: 'value' } }] } as NavigateAction],
|
|
42
|
+
}],
|
|
43
|
+
}];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* What choosing a row of a list does: open the named dialog over the page - a side sheet with the row's detail, so the list stays where it was.
|
|
47
|
+
*/
|
|
48
|
+
export const opensDialogOnSelect = (dialogTemplate: string): Behavior[] =>
|
|
49
|
+
[{ bindings: [{ trigger: { kind: InteractionTriggerKind.Select }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];
|
|
50
|
+
|
|
51
|
+
/** What a Cancel or Close control does: close the dialog it was opened from. */
|
|
52
|
+
export const closesDialog = (): Behavior[] => [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.CloseDialog }] }] }];
|
|
53
|
+
|
|
54
|
+
/** An element with the given behaviors attached. */
|
|
55
|
+
export const withBehaviors = <T extends SceneElement>(element: T, behaviors: Behavior[]): T => ({ ...element, behaviors });
|
|
56
|
+
|
|
57
|
+
export type OrdersScreenTemplate = ScreenTemplate;
|
|
58
|
+
export type OrdersDialogTemplate = DialogTemplate;
|
package/ordersQueries.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
|
|
4
|
+
import { BindingExpression, BindingSourceKind } from '@cratis/scene.model';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A property taken from a query result - never a value. An orders template declares *where* its data comes from and the sample-data pack, or the real
|
|
8
|
+
* query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
|
|
9
|
+
*/
|
|
10
|
+
export const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });
|
|
11
|
+
|
|
12
|
+
/** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */
|
|
13
|
+
export const OrdersQuery = {
|
|
14
|
+
/** One row: the `locale` and `currency` the figures and dates are formatted in. */
|
|
15
|
+
Settings: 'OrdersSettings',
|
|
16
|
+
RecordTabs: 'OrderRecordTabs',
|
|
17
|
+
Lines: 'OrderLines',
|
|
18
|
+
LineColumns: 'OrderLineColumns',
|
|
19
|
+
Shipments: 'OrderShipments',
|
|
20
|
+
ShipmentColumns: 'OrderShipmentColumns',
|
|
21
|
+
FulfilmentColumns: 'FulfilmentColumns',
|
|
22
|
+
FulfilmentCards: 'FulfilmentCards',
|
|
23
|
+
DeliveryEvents: 'DeliveryEvents',
|
|
24
|
+
DeliveryColumns: 'DeliveryColumns',
|
|
25
|
+
FormErrors: 'OrdersFormErrors',
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
/** The entities a template is made for. */
|
|
29
|
+
export enum OrdersEntityKind {
|
|
30
|
+
Order = 'Order',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The read model (and so the shape) the records of each entity are queried from. */
|
|
34
|
+
export const ordersEntityPlural: Record<OrdersEntityKind, string> = {
|
|
35
|
+
[OrdersEntityKind.Order]: 'Orders',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the
|
|
40
|
+
* list, its saved views and column choices, the selection, the sections of the quick form, and what the record page shows.
|
|
41
|
+
*/
|
|
42
|
+
export const ordersQueriesOf = (entity: OrdersEntityKind) => ({
|
|
43
|
+
rows: ordersEntityPlural[entity],
|
|
44
|
+
columns: `${entity}Columns`,
|
|
45
|
+
filterFields: `${entity}FilterFields`,
|
|
46
|
+
views: `${entity}Views`,
|
|
47
|
+
columnChoices: `${entity}ColumnChoices`,
|
|
48
|
+
selection: `${entity}Selection`,
|
|
49
|
+
quickSections: `${entity}QuickSections`,
|
|
50
|
+
record: `${entity}Record`,
|
|
51
|
+
sections: `${entity}Sections`,
|
|
52
|
+
summary: `${entity}Summary`,
|
|
53
|
+
activity: `${entity}Activity`,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/** The locale and currency of the data, bound onto every component that formats a figure or a date. */
|
|
57
|
+
export const localeOfData = { locale: fromQuery(OrdersQuery.Settings, '0.locale') };
|
|
58
|
+
export const currencyOfData = { ...localeOfData, currency: fromQuery(OrdersQuery.Settings, '0.currency') };
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
|
|
4
|
+
import { BlueprintScreen } from '@cratis/scene.model';
|
|
5
|
+
|
|
6
|
+
/** One ready-to-use screen: the qualified name that is also its place in the application (`projects.list.record` would be the `record` feature of `list`). */
|
|
7
|
+
export interface OrdersScreenDefinition extends BlueprintScreen {
|
|
8
|
+
template: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure
|
|
14
|
+
* and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.
|
|
15
|
+
*/
|
|
16
|
+
export const ordersScreenDefinitions: OrdersScreenDefinition[] = [
|
|
17
|
+
{ name: 'orders.list', title: 'Orders', template: 'OrdersList', order: 0, description: 'Every order with its customer, dates, total and status.' },
|
|
18
|
+
{ name: 'orders.record', title: 'Order', template: 'OrderPage', parent: 'orders.list', description: 'One order: key facts, its lines, its shipments and its activity.' },
|
|
19
|
+
{ name: 'orders.fulfilment', title: 'Fulfilment', template: 'OrdersFulfilmentBoard', order: 1, description: 'Orders in a column for each fulfilment step.' },
|
|
20
|
+
{ name: 'orders.deliveries', title: 'Deliveries', template: 'OrdersDeliveryCalendar', order: 2, description: 'The day each open order is due to arrive, on a calendar.' },
|
|
21
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,80 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "@cratis/scene.blueprint.orders",
|
|
3
|
+
"version": "4.59.0",
|
|
4
|
+
"description": "Projects, tasks and a board for a team.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cratis",
|
|
7
|
+
"scene",
|
|
8
|
+
"react",
|
|
9
|
+
"ui",
|
|
10
|
+
"blueprint",
|
|
11
|
+
"orders"
|
|
12
|
+
],
|
|
13
|
+
"author": "Cratis",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Cratis/Scene.git"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"sampleData",
|
|
25
|
+
"thumbnails",
|
|
26
|
+
"blueprintCatalog.json",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
"!**/for_*/**"
|
|
30
|
+
],
|
|
31
|
+
"main": "dist/cjs/index.js",
|
|
32
|
+
"module": "dist/esm/index.js",
|
|
33
|
+
"types": "dist/esm/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": "./package.json",
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/esm/index.d.ts",
|
|
38
|
+
"require": "./dist/cjs/index.js",
|
|
39
|
+
"import": "./dist/esm/index.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"prepare": "yarn g:build",
|
|
44
|
+
"clean": "yarn g:clean",
|
|
45
|
+
"build": "yarn g:build",
|
|
46
|
+
"lint": "yarn g:lint",
|
|
47
|
+
"lint:ci": "yarn g:lint:ci",
|
|
48
|
+
"test": "yarn g:test",
|
|
49
|
+
"test:browser": "yarn g:test --config ./vitest.browser.config.mts",
|
|
50
|
+
"ci": "yarn g:ci",
|
|
51
|
+
"up": "yarn g:up"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@cratis/scene.blueprint.default": "4.59.0",
|
|
55
|
+
"@cratis/scene.engine": "4.59.0",
|
|
56
|
+
"@cratis/scene.model": "4.59.0",
|
|
57
|
+
"@cratis/scene.react": "4.59.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@cratis/scene.blueprint.default": "4.59.0",
|
|
61
|
+
"@cratis/scene.engine": "4.59.0",
|
|
62
|
+
"@cratis/scene.model": "4.59.0",
|
|
63
|
+
"@cratis/scene.react": "4.59.0",
|
|
64
|
+
"@primereact/core": "11.2.0",
|
|
65
|
+
"@primereact/headless": "11.2.0",
|
|
66
|
+
"primeicons": "8.0.2",
|
|
67
|
+
"primereact": "11.2.0",
|
|
68
|
+
"react": "^19.3.0",
|
|
69
|
+
"react-dom": "^19.3.0"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@cratis/components": "^4.1.1",
|
|
73
|
+
"@primereact/core": "^11.0.0",
|
|
74
|
+
"@primereact/headless": "^11.0.0",
|
|
75
|
+
"primeicons": "^8.0.0",
|
|
76
|
+
"primereact": "^11.0.0",
|
|
77
|
+
"react": "^19.0.0",
|
|
78
|
+
"react-dom": "^19.0.0"
|
|
79
|
+
}
|
|
6
80
|
}
|
package/packageName.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
|
|
4
|
+
/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */
|
|
5
|
+
export const ordersBlueprintName = 'Cratis.Blueprint.Orders';
|