@genesislcap/blank-app-seed 5.22.2-prerelease.2 → 5.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.genx/configure.js +11 -1
- package/.genx/package.json +1 -1
- package/.genx/scripts/generate-test-apps.sh +124 -0
- package/.genx/templates/angular/chart.hbs +19 -7
- package/.genx/templates/angular/component/component.column.defs.hbs +16 -4
- package/.genx/templates/angular/component/component.create.form.hbs +10 -2
- package/.genx/templates/angular/component/component.events.config.hbs +31 -6
- package/.genx/templates/angular/component/component.filter.form.hbs +1 -2
- package/.genx/templates/angular/component/component.gridOptions.hbs +15 -3
- package/.genx/templates/angular/component/component.hbs +77 -46
- package/.genx/templates/angular/component/component.index.hbs +1 -1
- package/.genx/templates/angular/component/component.update.form.hbs +1 -1
- package/.genx/templates/angular/entityManager.hbs +6 -6
- package/{client-tmp/angular/src/app/utils/fdc3.ts → .genx/templates/angular/fdc3.ts.hbs} +6 -8
- package/.genx/templates/angular/form.hbs +9 -12
- package/.genx/templates/angular/grid.hbs +43 -40
- package/.genx/templates/angular/route.hbs +8 -2
- package/.genx/templates/angular/route.template.hbs +7 -7
- package/.genx/templates/angular/slices/eventing.slice.hbs +21 -10
- package/.genx/templates/angular/store.hbs +1 -5
- package/.genx/templates/angular/tabsPanel.hbs +2 -2
- package/.genx/templates/react/chart.hbs +6 -15
- package/.genx/templates/react/component/component.column.defs.hbs +16 -10
- package/.genx/templates/react/component/component.create.form.hbs +2 -2
- package/.genx/templates/react/component/component.events.config.hbs +32 -5
- package/.genx/templates/react/component/component.filter.form.hbs +1 -2
- package/.genx/templates/react/component/component.gridOptions.hbs +17 -11
- package/.genx/templates/react/component/component.hbs +84 -42
- package/.genx/templates/react/component/component.update.form.hbs +1 -1
- package/.genx/templates/react/entityManager.hbs +8 -16
- package/{client-tmp/react/src/utils/fdc3.ts → .genx/templates/react/fdc3.ts.hbs} +7 -8
- package/.genx/templates/react/form.hbs +1 -15
- package/.genx/templates/react/grid.hbs +11 -11
- package/.genx/templates/react/gridLayout.hbs +44 -4
- package/.genx/templates/react/horizontalLayout.hbs +10 -1
- package/.genx/templates/react/route.hbs +23 -16
- package/.genx/templates/react/slices/eventing.slice.hbs +19 -8
- package/.genx/templates/react/store.hbs +1 -5
- package/.genx/templates/react/tabsLayout.hbs +5 -1
- package/.genx/templates/web-components/chart.hbs +25 -25
- package/.genx/templates/web-components/component/component.column.defs.hbs +11 -3
- package/.genx/templates/web-components/component/component.create.form.hbs +11 -4
- package/.genx/templates/web-components/component/component.events.config.hbs +33 -6
- package/.genx/templates/web-components/component/component.filter.form.hbs +1 -2
- package/.genx/templates/web-components/component/component.gridOptions.hbs +12 -3
- package/.genx/templates/web-components/component/component.hbs +19 -20
- package/.genx/templates/web-components/component/component.index.hbs +1 -1
- package/.genx/templates/web-components/component/component.template.hbs +9 -13
- package/.genx/templates/web-components/component/component.update.form.hbs +1 -1
- package/.genx/templates/web-components/entityManager.hbs +92 -73
- package/{client-tmp/web-components/src/utils/fdc3.ts → .genx/templates/web-components/fdc3.ts.hbs} +6 -7
- package/.genx/templates/web-components/form.hbs +16 -15
- package/.genx/templates/web-components/grid.hbs +49 -41
- package/.genx/templates/web-components/gridLayout.hbs +32 -28
- package/.genx/templates/web-components/horizontalLayout.hbs +5 -5
- package/.genx/templates/web-components/route.template.hbs +4 -6
- package/.genx/templates/web-components/slices/eventing.slice.hbs +23 -15
- package/.genx/templates/web-components/store.hbs +1 -9
- package/.genx/templates/web-components/tabsLayout.hbs +5 -5
- package/.genx/tests/fixtures/routes-full.json +299 -0
- package/.genx/tests/fixtures/testapp/client/src/pages/Home/Home.tsx +12 -0
- package/.genx/utils/formatJSONValue.js +38 -2
- package/.genx/utils/formatRouteData.js +67 -18
- package/.genx/utils/generateTile.js +10 -1
- package/.genx/utils/gridSerializers.js +63 -23
- package/.genx/utils/registerPartials.js +15 -12
- package/.genx/utils/toJsStringLiteral.js +37 -0
- package/.genx/versions.json +3 -3
- package/.github/workflows/build.yml +22 -1
- package/.husky/pre-commit +8 -0
- package/CHANGELOG.md +97 -23
- package/bdd-tests/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/bdd-tests/gradle.properties +0 -1
- package/client-tmp/angular/.oxfmtrc.json +32 -0
- package/client-tmp/angular/.oxlintrc.json +4 -0
- package/client-tmp/angular/README.md +4 -4
- package/client-tmp/angular/jest.config.js +1 -1
- package/client-tmp/angular/lint-css.js +24 -3
- package/client-tmp/angular/oxlint-staged.js +45 -0
- package/client-tmp/angular/package.json +19 -9
- package/client-tmp/angular/playwright.config.ts +12 -11
- package/client-tmp/angular/src/app/app.component.html +0 -1
- package/client-tmp/angular/src/app/app.component.ts +8 -9
- package/client-tmp/angular/src/app/app.config.ts +2 -2
- package/client-tmp/angular/src/app/app.module.ts +6 -5
- package/client-tmp/angular/src/app/components/error-message/error-message.component.html +29 -15
- package/client-tmp/angular/src/app/components/error-message/error-message.component.spec.ts +2 -2
- package/client-tmp/angular/src/app/components/error-message/error-message.component.ts +3 -5
- package/client-tmp/angular/src/app/directive/app-lazy-load.directive.ts +1 -0
- package/client-tmp/angular/src/app/guards/chained.guard.ts +19 -19
- package/client-tmp/angular/src/app/guards/connection.guard.ts +12 -12
- package/client-tmp/angular/src/app/layouts/blank/blank.layout.spec.ts +1 -1
- package/client-tmp/angular/src/app/layouts/blank/blank.layout.ts +1 -5
- package/client-tmp/angular/src/app/layouts/default/default.layout.html +3 -4
- package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +4 -4
- package/client-tmp/angular/src/app/layouts/default/default.layout.ts +1 -1
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +1 -2
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.html +3 -3
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.scss +1 -1
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.spec.ts +5 -5
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.ts +3 -4
- package/client-tmp/angular/src/app/services/route.service.ts +79 -74
- package/client-tmp/angular/src/app/share/foundation-auth.ts +7 -1
- package/client-tmp/angular/src/app/share/genesis-components.ts +66 -68
- package/client-tmp/angular/src/app/utils/index.ts +3 -1
- package/client-tmp/angular/src/app/utils/permissions.ts +7 -7
- package/client-tmp/angular/src/declaration.d.ts +1 -1
- package/client-tmp/angular/src/environments/environment.ts +1 -1
- package/client-tmp/angular/src/jest.setup.ts +8 -0
- package/client-tmp/angular/src/main.ts +2 -2
- package/client-tmp/angular/src/pbc/container.ts +28 -26
- package/client-tmp/angular/src/pbc/elementsRenderer.ts +49 -39
- package/client-tmp/angular/src/pbc/utils.ts +61 -60
- package/client-tmp/angular/src/styles/_mixins.scss +7 -8
- package/client-tmp/angular/src/styles/styles.css +6 -6
- package/client-tmp/angular/test/e2e/fixture.ts +2 -2
- package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +1 -1
- package/client-tmp/angular/tsconfig.app.json +2 -8
- package/client-tmp/angular/tsconfig.json +1 -4
- package/client-tmp/angular/tsconfig.spec.json +4 -11
- package/client-tmp/angular/webpack.dev.config.js +3 -4
- package/client-tmp/angular/webpack.prod.config.js +3 -4
- package/client-tmp/angular/webpack.shared.config.js +20 -24
- package/client-tmp/react/.oxfmtrc.json +30 -0
- package/client-tmp/react/.oxlintrc.json +4 -0
- package/client-tmp/react/README.md +4 -4
- package/client-tmp/react/jest.config.ts +8 -4
- package/client-tmp/react/jest.setup.ts +85 -1
- package/client-tmp/react/oxlint-staged.js +45 -0
- package/client-tmp/react/package.json +24 -9
- package/client-tmp/react/playwright.config.ts +11 -10
- package/client-tmp/react/src/App.tsx +27 -29
- package/client-tmp/react/src/__mocks__/fileMock.js +1 -0
- package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.test.tsx +16 -4
- package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.tsx +32 -29
- package/client-tmp/react/src/components/error-boundary/ErrorBoundary.tsx +15 -6
- package/client-tmp/react/src/components/routes/AppRoutes.tsx +1 -1
- package/client-tmp/react/src/components/single-component/registry.ts +4 -0
- package/client-tmp/react/src/custom-elements.d.ts +4 -2
- package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +1 -1
- package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +1 -1
- package/client-tmp/react/src/helpers/isConnectedHelper.tsx +3 -3
- package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +7 -11
- package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +8 -8
- package/client-tmp/react/src/main.tsx +11 -11
- package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +13 -2
- package/client-tmp/react/src/pages/AuthPage/AuthPage.tsx +14 -13
- package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +2 -7
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +8 -4
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
- package/client-tmp/react/src/pbc/container.tsx +9 -4
- package/client-tmp/react/src/pbc/elementsRenderer.tsx +18 -9
- package/client-tmp/react/src/pbc/utils.ts +60 -59
- package/client-tmp/react/src/services/auth.service.ts +1 -1
- package/client-tmp/react/src/services/store.service.ts +5 -3
- package/client-tmp/react/src/share/foundation-login.ts +2 -2
- package/client-tmp/react/src/share/genesis-components.ts +46 -47
- package/client-tmp/react/src/store/AuthContext.tsx +2 -10
- package/client-tmp/react/src/store/RoutesContext.test.tsx +99 -0
- package/client-tmp/react/src/store/RoutesContext.tsx +25 -5
- package/client-tmp/react/src/styles/styles.css +7 -7
- package/client-tmp/react/src/types/LayoutName.ts +1 -1
- package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +1 -1
- package/client-tmp/react/src/utils/index.ts +2 -0
- package/client-tmp/react/src/utils/layout.ts +8 -1
- package/client-tmp/react/src/utils/permissions.ts +7 -7
- package/client-tmp/react/src/utils/useDocumentTitle.ts +5 -6
- package/client-tmp/react/test/e2e/fixture.ts +5 -2
- package/client-tmp/react/test/e2e/flows/001-protected.e2e.ts +3 -1
- package/client-tmp/react/tsconfig.app.json +1 -1
- package/client-tmp/react/tsconfig.json +1 -5
- package/client-tmp/web-components/.oxfmtrc.json +30 -0
- package/client-tmp/web-components/.oxlintrc.json +4 -0
- package/client-tmp/web-components/oxlint-staged.js +45 -0
- package/client-tmp/web-components/package.json +14 -22
- package/client-tmp/web-components/src/components/components.ts +9 -7
- package/client-tmp/web-components/src/main/main.css +1 -2
- package/client-tmp/web-components/src/main/main.ts +1 -1
- package/client-tmp/web-components/src/routes/config.ts +4 -0
- package/client-tmp/web-components/src/utils/index.ts +2 -0
- package/client-tmp/web-components/tsconfig.json +1 -4
- package/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/package.json +1 -1
- package/server/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/server/gradle.properties +0 -2
- package/.genx/templates/angular/gridLayout.hbs +0 -30
- package/.genx/templates/angular/horizontalLayout.hbs +0 -7
- package/.genx/templates/angular/tabsLayout.hbs +0 -7
- package/.genx/tests/fixtures/testapp/client/src/routes/home/home.template.ts +0 -6
- package/client-tmp/react/.babelrc +0 -10
- package/client-tmp/react/.eslintrc.cjs +0 -21
- package/client-tmp/react/git +0 -0
- package/client-tmp/react/webpack.config.js +0 -121
- package/client-tmp/web-components/.prettierignore +0 -14
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
<rapid-grid-pro
|
|
2
|
+
header-case-type="capitalCase"{{#if config.useOnlyTemplateCols}}
|
|
3
|
+
only-template-col-defs{{/if}}
|
|
4
|
+
enable-row-flashing
|
|
5
|
+
enable-cell-flashing{{#if config.permissions.viewRight}}
|
|
6
|
+
[ngStyle]="{ display: hasUserPermission('{{config.permissions.viewRight}}') ? 'block' : 'none' }"{{/if}}
|
|
7
|
+
>
|
|
8
|
+
<grid-pro-genesis-datasource
|
|
9
|
+
resource-name="{{config.resourceName}}"
|
|
10
|
+
{{#if config.snapshot}}
|
|
11
|
+
isSnapshot="{{config.snapshot}}"
|
|
12
|
+
{{/if}}
|
|
13
|
+
{{#if config.reqrep}}
|
|
14
|
+
polling-interval="5000"
|
|
15
|
+
request-auto-setup="false"
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#if config.eventing.listener}}
|
|
18
|
+
[criteria]="criteria()"
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#ifAny config.gridOptions config.eventing.publishEventName}}
|
|
21
|
+
[deferredGridOptions]="gridOptionsModel"
|
|
22
|
+
{{/ifAny}}
|
|
23
|
+
></grid-pro-genesis-datasource>
|
|
24
|
+
{{#if config.gridOptions}}
|
|
25
|
+
<grid-pro-column
|
|
26
|
+
*ngFor="let columnDef of gridOptions?.columnDefs"
|
|
27
|
+
[definition]="columnDef"
|
|
28
|
+
></grid-pro-column>
|
|
29
|
+
{{/if}}
|
|
30
|
+
</rapid-grid-pro>{{#if config.permissions.viewRight}}
|
|
31
|
+
<section
|
|
32
|
+
[ngStyle]="{
|
|
33
|
+
height: '100%',
|
|
34
|
+
width: '100%',
|
|
35
|
+
display: !hasUserPermission('{{config.permissions.viewRight}}') ? 'block' : 'none',
|
|
36
|
+
}"
|
|
37
|
+
>
|
|
38
|
+
<app-error-message
|
|
39
|
+
style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center"
|
|
40
|
+
elementType="h3"
|
|
41
|
+
message="You do not have access to view this component."
|
|
42
|
+
></app-error-message>
|
|
43
|
+
</section>{{/if}}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
1
|
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
|
+
import { environment } from '../../../environments/environment';
|
|
4
|
+
{{#if route.tiles}}
|
|
5
|
+
// Tile imports are emitted in the order the tiles are declared in the route definition.
|
|
6
|
+
/* eslint-disable import-es/order */
|
|
3
7
|
{{#each route.tiles}}
|
|
4
8
|
import { {{pascalCase this.componentName}} } from './{{kebabCase this.title}}-{{this.componentType}}';
|
|
5
9
|
{{/each}}
|
|
6
|
-
|
|
10
|
+
/* eslint-enable import-es/order */
|
|
11
|
+
{{/if}}
|
|
7
12
|
|
|
8
13
|
@Component({
|
|
9
14
|
selector: 'app-{{kebabCase route.name}}',
|
|
@@ -12,6 +17,7 @@ import { environment } from '../../../environments/environment';
|
|
|
12
17
|
{{#each route.tiles}}
|
|
13
18
|
{{pascalCase this.componentName}},
|
|
14
19
|
{{/each}}
|
|
20
|
+
// CommonModule provides the built-in directives (ngIf/ngFor) used by the template.
|
|
15
21
|
CommonModule,
|
|
16
22
|
],
|
|
17
23
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{{#if route.tiles}}
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
<rapid-flex-layout>
|
|
3
|
+
<rapid-tabs>
|
|
4
4
|
{{#each route.tiles}}
|
|
5
|
-
|
|
5
|
+
<rapid-tab slot="tab">{{this.title}}</rapid-tab>
|
|
6
6
|
{{/each}}
|
|
7
7
|
|
|
8
8
|
{{> (lookup ./route 'layoutType') }}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
</rapid-tabs>
|
|
10
|
+
</rapid-flex-layout>
|
|
11
11
|
{{else}}
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<!-- insert template code here -->
|
|
13
|
+
Welcome to {{sentenceCase route.name}}
|
|
14
14
|
{{/if}}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
{{#if listeners.length}}
|
|
1
2
|
import { CriteriaBuilder, ExpressionBuilder, Serialisers } from '@genesislcap/foundation-criteria';
|
|
3
|
+
{{/if}}
|
|
2
4
|
import { createSlice } from '@genesislcap/foundation-redux';
|
|
3
5
|
|
|
4
6
|
export const eventingSlice = createSlice({
|
|
5
7
|
name: 'eventing',
|
|
8
|
+
{{#if events.length}}
|
|
6
9
|
initialState: {
|
|
7
10
|
{{#each events}}
|
|
8
|
-
{{this}}: null
|
|
11
|
+
{{this}}: null as Record<string, any> | null,
|
|
9
12
|
{{/each}}
|
|
10
13
|
},
|
|
11
14
|
reducers: {
|
|
12
15
|
{{#each events}}
|
|
13
16
|
publish{{pascalCase this}}: (state, action) => {
|
|
14
17
|
state.{{this}} = action.payload;
|
|
15
|
-
}
|
|
18
|
+
},
|
|
16
19
|
{{/each}}
|
|
17
20
|
},
|
|
21
|
+
{{else}}
|
|
22
|
+
initialState: {},
|
|
23
|
+
reducers: {},
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#if listeners.length}}
|
|
18
26
|
selectors: {
|
|
19
27
|
{{#each listeners}}
|
|
20
28
|
getCriteriaFor{{pascalCase tileName}}: (state) => {
|
|
@@ -24,18 +32,21 @@ export const eventingSlice = createSlice({
|
|
|
24
32
|
|
|
25
33
|
{{#each mappings}}
|
|
26
34
|
if (data.{{sourceField}}) {
|
|
27
|
-
criteriaBuilder.And(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
criteriaBuilder.And(
|
|
36
|
+
new ExpressionBuilder()
|
|
37
|
+
.withField('{{targetField}}')
|
|
38
|
+
.withValue(data.{{sourceField}})
|
|
39
|
+
.withSerialiser(Serialisers.EQ)
|
|
40
|
+
.build(),
|
|
41
|
+
);
|
|
32
42
|
}
|
|
33
43
|
{{/each}}
|
|
34
44
|
|
|
35
45
|
return criteriaBuilder.build();
|
|
36
|
-
}
|
|
46
|
+
},
|
|
37
47
|
{{/each}}
|
|
38
48
|
},
|
|
49
|
+
{{else}}
|
|
50
|
+
selectors: {},
|
|
51
|
+
{{/if}}
|
|
39
52
|
});
|
|
40
|
-
|
|
41
|
-
|
|
@@ -2,11 +2,7 @@ import { createStore } from '@genesislcap/foundation-redux';
|
|
|
2
2
|
import { eventingSlice } from './slices/eventing.slice';
|
|
3
3
|
|
|
4
4
|
export const { reduxStore, store, actions, selectors } = createStore([eventingSlice], {
|
|
5
|
-
eventing:
|
|
6
|
-
{{#each events}}
|
|
7
|
-
{{this}}: null{{#unless @last}},{{/unless}}
|
|
8
|
-
{{/each}}
|
|
9
|
-
},
|
|
5
|
+
eventing: eventingSlice.getInitialState(),
|
|
10
6
|
});
|
|
11
7
|
|
|
12
8
|
export type Store = typeof store;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
{{#if config.
|
|
2
|
-
|
|
1
|
+
{{#if config.type}}
|
|
2
|
+
<G2PlotChart type="{{ config.type }}" config={chartConfig}>
|
|
3
|
+
{{else}}
|
|
4
|
+
{{! `type` is optional: G2PlotChart falls back to its own default when it is absent, and type="" is not a ChartTypes. }}
|
|
5
|
+
<G2PlotChart config={chartConfig}>
|
|
3
6
|
{{/if}}
|
|
4
|
-
<
|
|
5
|
-
type="{{ config.type }}"
|
|
6
|
-
config={chartConfig}
|
|
7
|
-
>
|
|
8
|
-
<ChartDatasource
|
|
9
|
-
resourceName="{{ config.resourceName }}"
|
|
10
|
-
serverFields="{{ config.xField }} {{ config.yField }}"
|
|
11
|
-
/>
|
|
7
|
+
<ChartDatasource resourceName="{{ config.resourceName }}" serverFields="{{ config.xField }} {{ config.yField }}" />
|
|
12
8
|
</G2PlotChart>
|
|
13
|
-
{{#if config.permissions.viewRight~}}
|
|
14
|
-
) : (
|
|
15
|
-
<ErrorMessage elementType="h3" message="You do not have access to view this component." />
|
|
16
|
-
)
|
|
17
|
-
{{/if}}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
{{#if tile.config.columns
|
|
2
|
-
import { ColDef } from '@ag-grid-community/core';
|
|
1
|
+
{{#if tile.config.columns}}
|
|
2
|
+
import type { ColDef } from '@ag-grid-community/core';
|
|
3
3
|
{{/if}}
|
|
4
|
-
{{
|
|
4
|
+
{{! Formatter imports are gated on this file's own serialised content, so a formatter used only in tile.config.gridOptions does not leak an unused import in here. }}
|
|
5
|
+
{{#ifContains tile.config.columns 'getNumberFormatter'}}
|
|
6
|
+
{{#ifContains tile.config.columns 'getDateFormatter'}}
|
|
7
|
+
import { getDateFormatter, getNumberFormatter } from '@genesislcap/foundation-utils';
|
|
8
|
+
{{else}}
|
|
5
9
|
import { getNumberFormatter } from '@genesislcap/foundation-utils';
|
|
6
|
-
{{/
|
|
7
|
-
{{
|
|
10
|
+
{{/ifContains}}
|
|
11
|
+
{{else}}
|
|
12
|
+
{{#ifContains tile.config.columns 'getDateFormatter'}}
|
|
8
13
|
import { getDateFormatter } from '@genesislcap/foundation-utils';
|
|
9
|
-
{{/
|
|
10
|
-
{{
|
|
14
|
+
{{/ifContains}}
|
|
15
|
+
{{/ifContains}}
|
|
16
|
+
{{#ifContains tile.config.columns 'sendEventOnChannel'}}
|
|
11
17
|
import { sendEventOnChannel } from '../../../utils';
|
|
12
|
-
{{/
|
|
18
|
+
{{/ifContains}}
|
|
13
19
|
|
|
14
|
-
{{#if tile.config.columns
|
|
15
|
-
export const columnDefs: ColDef[] = {{{ tile.config.columns }}}
|
|
20
|
+
{{#if tile.config.columns}}
|
|
21
|
+
export const columnDefs: ColDef[] = {{{ tile.config.columns }}};
|
|
16
22
|
{{/if}}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UiSchema } from '@genesislcap/foundation-forms';
|
|
2
2
|
|
|
3
3
|
{{#if tile.config.createFormUiSchema~}}
|
|
4
|
-
export const createFormSchema: UiSchema = {{{ tile.config.createFormUiSchema }}}
|
|
4
|
+
export const createFormSchema: UiSchema = {{{ tile.config.createFormUiSchema }}};
|
|
5
5
|
{{/if}}
|
|
6
6
|
{{#if tile.config.uischema~}}
|
|
7
|
-
export const createFormSchema: UiSchema = {{{ tile.config.uischema }}}
|
|
7
|
+
export const createFormSchema: UiSchema = {{{ tile.config.uischema }}};
|
|
8
8
|
{{/if}}
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
{{#ifContains tile.config.customEvents '"position":'}}
|
|
2
|
+
{{#ifContains tile.config.customEvents '"uischema":'}}
|
|
3
|
+
import {
|
|
4
|
+
type CustomAction,
|
|
5
|
+
CrudMenuPosition,
|
|
6
|
+
UiSchema,
|
|
7
|
+
} from '@genesislcap/foundation-entity-management';
|
|
8
|
+
{{else}}
|
|
9
|
+
import { type CustomAction, CrudMenuPosition } from '@genesislcap/foundation-entity-management';
|
|
10
|
+
{{/ifContains}}
|
|
11
|
+
{{else}}
|
|
12
|
+
{{#ifContains tile.config.customEvents '"uischema":'}}
|
|
13
|
+
import { type CustomAction, UiSchema } from '@genesislcap/foundation-entity-management';
|
|
14
|
+
{{else}}
|
|
15
|
+
import { type CustomAction } from '@genesislcap/foundation-entity-management';
|
|
16
|
+
{{/ifContains}}
|
|
17
|
+
{{/ifContains}}
|
|
2
18
|
|
|
19
|
+
{{#ifContains tile.config.customEvents '"uischema":'}}
|
|
3
20
|
{{#each tile.config.customEvents}}
|
|
4
21
|
{{#if this.hasForm}}
|
|
5
22
|
export const {{camelCase this.name}}FormSchema: UiSchema = {{{this.uischema}}};
|
|
6
23
|
{{/if}}
|
|
7
24
|
{{/each}}
|
|
8
25
|
|
|
26
|
+
{{/ifContains}}
|
|
27
|
+
{{#each tile.config.customEvents}}
|
|
28
|
+
{{#if this.defaultValues}}
|
|
29
|
+
{{! Hoisted so the serialised literal keeps its own indentation; `as const` keeps the record-type discriminators literal so they still satisfy `DefaultValues`. }}
|
|
30
|
+
const {{camelCase this.name}}DefaultValues = {{{this.defaultValues}}} as const;
|
|
31
|
+
|
|
32
|
+
{{/if}}
|
|
33
|
+
{{/each}}
|
|
9
34
|
export const customActions: CustomAction[] = [
|
|
10
35
|
{{#each tile.config.customEvents}}
|
|
11
36
|
{
|
|
@@ -17,7 +42,9 @@ export const customActions: CustomAction[] = [
|
|
|
17
42
|
{{#if this.hasForm}}
|
|
18
43
|
uiSchema: {{camelCase this.name}}FormSchema,
|
|
19
44
|
{{/if}}
|
|
20
|
-
|
|
45
|
+
{{#if this.defaultValues}}
|
|
46
|
+
defaultValues: {{camelCase this.name}}DefaultValues,
|
|
47
|
+
{{/if}}
|
|
21
48
|
},
|
|
22
49
|
{{#if this.position}}
|
|
23
50
|
position: CrudMenuPosition.{{{pascalCase this.position}}},
|
|
@@ -26,12 +53,12 @@ export const customActions: CustomAction[] = [
|
|
|
26
53
|
icon: '{{this.icon}}',
|
|
27
54
|
{{/if}}
|
|
28
55
|
{{#if this.tooltip}}
|
|
29
|
-
tooltip:
|
|
56
|
+
tooltip: {{{this.tooltipJs}}},
|
|
30
57
|
{{/if}}
|
|
31
58
|
{{#if this.confirmSubmit}}
|
|
32
59
|
confirmSubmit: {
|
|
33
|
-
state: '{{this.confirmSubmit.state}}',
|
|
34
|
-
message:
|
|
60
|
+
state: '{{#if this.confirmSubmit.state}}{{this.confirmSubmit.state}}{{else}}enabled{{/if}}',
|
|
61
|
+
message: {{{this.confirmSubmitMessageJs}}},
|
|
35
62
|
},
|
|
36
63
|
{{/if}}
|
|
37
64
|
requiresSelection: true,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UiSchema } from '@genesislcap/foundation-forms';
|
|
2
2
|
|
|
3
3
|
{{#if tile.config.filterFormUiSchema~}}
|
|
4
|
-
export const filterFormSchema: UiSchema = {{{ tile.config.filterFormUiSchema }}}
|
|
4
|
+
export const filterFormSchema: UiSchema = {{{ tile.config.filterFormUiSchema }}};
|
|
5
5
|
{{/if}}
|
|
6
|
-
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
{{#if tile.config.gridOptions
|
|
2
|
-
import { GridOptions } from '@ag-grid-community/core';
|
|
1
|
+
{{#if tile.config.gridOptions}}
|
|
2
|
+
import type { GridOptions } from '@ag-grid-community/core';
|
|
3
3
|
{{/if}}
|
|
4
|
-
{{
|
|
4
|
+
{{! Formatter imports are gated on this file's own serialised content, so a formatter used only in tile.config.columns does not leak an unused import in here. }}
|
|
5
|
+
{{#ifContains tile.config.gridOptions 'getNumberFormatter'}}
|
|
6
|
+
{{#ifContains tile.config.gridOptions 'getDateFormatter'}}
|
|
7
|
+
import { getDateFormatter, getNumberFormatter } from '@genesislcap/foundation-utils';
|
|
8
|
+
{{else}}
|
|
5
9
|
import { getNumberFormatter } from '@genesislcap/foundation-utils';
|
|
6
|
-
{{/
|
|
7
|
-
{{
|
|
10
|
+
{{/ifContains}}
|
|
11
|
+
{{else}}
|
|
12
|
+
{{#ifContains tile.config.gridOptions 'getDateFormatter'}}
|
|
8
13
|
import { getDateFormatter } from '@genesislcap/foundation-utils';
|
|
9
|
-
{{/
|
|
10
|
-
{{
|
|
14
|
+
{{/ifContains}}
|
|
15
|
+
{{/ifContains}}
|
|
16
|
+
{{#ifContains tile.config.gridOptions 'sendEventOnChannel'}}
|
|
11
17
|
import { sendEventOnChannel } from '../../../utils';
|
|
12
|
-
{{/
|
|
18
|
+
{{/ifContains}}
|
|
13
19
|
|
|
14
|
-
{{#if tile.config.gridOptions
|
|
15
|
-
export const gridOptions: GridOptions = {{{ tile.config.gridOptions }}}
|
|
16
|
-
{{/if}}
|
|
20
|
+
{{#if tile.config.gridOptions}}
|
|
21
|
+
export const gridOptions: GridOptions = {{{ tile.config.gridOptions }}};
|
|
22
|
+
{{/if}}
|
|
@@ -1,64 +1,78 @@
|
|
|
1
|
+
{{#ifEquals tile.type 'grid-pro'}}
|
|
2
|
+
{{#ifAny tile.config.gridOptions tile.config.eventing.publishEventName}}
|
|
3
|
+
import type { GridOptions } from '@ag-grid-community/core';
|
|
4
|
+
{{/ifAny}}
|
|
5
|
+
{{/ifEquals}}
|
|
6
|
+
{{#ifAny tile.config.snapshot tile.config.reqrep tile.config.eventing.listener}}
|
|
7
|
+
{{#ifContains 'entity-manager|grid-pro' tile.type}}
|
|
8
|
+
import { DatasourceConfiguration } from '@genesislcap/foundation-entity-management';
|
|
9
|
+
{{/ifContains}}
|
|
10
|
+
{{/ifAny}}
|
|
1
11
|
{{#ifEquals tile.type 'entity-manager'}}
|
|
2
12
|
import { EntityManagement } from '@genesislcap/foundation-entity-management/react';
|
|
3
13
|
{{/ifEquals}}
|
|
4
|
-
{{#ifEquals tile.type 'grid-pro'}}
|
|
5
|
-
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
6
|
-
import { GridProGenesisDatasource{{#if tile.config.gridOptions}}, GridProColumn{{/if}} } from '@genesislcap/grid-pro/react';
|
|
7
|
-
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
8
|
-
{{/ifEquals}}
|
|
9
14
|
{{#ifEquals tile.type 'smart-form'}}
|
|
10
15
|
import { Form } from '@genesislcap/foundation-forms/react';
|
|
11
16
|
{{/ifEquals}}
|
|
17
|
+
{{#if tile.config.usesPermissionHelper}}
|
|
18
|
+
import { getUser } from '@genesislcap/foundation-user';
|
|
19
|
+
{{/if}}
|
|
12
20
|
{{#ifEquals tile.type 'chart'}}
|
|
13
|
-
import { G2PlotChart, ChartDatasource } from '@genesislcap/g2plot-chart/react';
|
|
14
21
|
import { ChartConfig } from '@genesislcap/g2plot-chart';
|
|
22
|
+
import { G2PlotChart, ChartDatasource } from '@genesislcap/g2plot-chart/react';
|
|
15
23
|
{{/ifEquals}}
|
|
16
|
-
{{#
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
{{
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
import { customEvent } from '@genesislcap/foundation-events';
|
|
24
|
+
{{#ifEquals tile.type 'grid-pro'}}
|
|
25
|
+
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
26
|
+
import { GridProGenesisDatasource{{#if tile.config.gridOptions}}, GridProColumn{{/if}} } from '@genesislcap/grid-pro/react';
|
|
27
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
28
|
+
{{/ifEquals}}
|
|
29
|
+
{{#if tile.config.eventing.listener}}
|
|
30
|
+
import { useSelector } from 'react-redux';
|
|
24
31
|
{{/if}}
|
|
25
|
-
|
|
32
|
+
{{#if tile.config.wholeTileRight}}
|
|
26
33
|
import ErrorMessage from '../../../components/ErrorMessage/ErrorMessage';
|
|
27
34
|
{{/if}}
|
|
28
|
-
{{#if tile.config.
|
|
29
|
-
|
|
35
|
+
{{#if tile.config.eventing.publishEventName}}
|
|
36
|
+
{{#if tile.config.eventing.listener}}
|
|
37
|
+
import { actions, selectors } from '../../../store/store';
|
|
38
|
+
{{else}}
|
|
39
|
+
import { actions } from '../../../store/store';
|
|
40
|
+
{{/if}}
|
|
41
|
+
{{else}}
|
|
42
|
+
{{#if tile.config.eventing.listener}}
|
|
43
|
+
import { selectors } from '../../../store/store';
|
|
44
|
+
{{/if}}
|
|
30
45
|
{{/if}}
|
|
46
|
+
{{#if tile.config.usesPermissionHelper}}
|
|
47
|
+
import { getViewUpdateRightComponent } from '../../../utils';
|
|
48
|
+
{{/if}}
|
|
49
|
+
{{#if tile.config.columns~}}
|
|
50
|
+
import { columnDefs as columnDefsTile } from './{{pascalCase tile.title}}ColumnDefs';
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{#if tile.config.createEvent}}
|
|
31
53
|
{{#if tile.config.createFormUiSchema~}}
|
|
32
54
|
import { createFormSchema as createFormSchemaTile } from './{{pascalCase tile.title}}CreateFormSchema';
|
|
33
55
|
{{/if}}
|
|
56
|
+
{{/if}}
|
|
34
57
|
{{#if tile.config.uischema~}}
|
|
35
58
|
import { createFormSchema as createFormSchemaTile } from './{{pascalCase tile.title}}CreateFormSchema';
|
|
36
59
|
{{/if}}
|
|
37
|
-
{{#if tile.config.
|
|
38
|
-
import {
|
|
60
|
+
{{#if tile.config.customEvents}}
|
|
61
|
+
import { customActions } from './{{pascalCase tile.title}}EventsConfig';
|
|
39
62
|
{{/if}}
|
|
63
|
+
{{#if tile.config.enableFilters}}
|
|
40
64
|
{{#if tile.config.filterFormUiSchema~}}
|
|
41
65
|
import { filterFormSchema as filterFormSchemaTile } from './{{pascalCase tile.title}}FilterFormSchema';
|
|
42
66
|
{{/if}}
|
|
43
|
-
{{#if tile.config.columns~}}
|
|
44
|
-
import { columnDefs as columnDefsTile } from './{{pascalCase tile.title}}ColumnDefs';
|
|
45
67
|
{{/if}}
|
|
46
68
|
{{#if tile.config.gridOptions~}}
|
|
47
|
-
import { GridOptions } from '@ag-grid-community/core';
|
|
48
69
|
import { gridOptions as gridOptionsTile } from './{{pascalCase tile.title}}GridOptions';
|
|
49
70
|
{{/if}}
|
|
50
|
-
{{#if tile.config.
|
|
51
|
-
|
|
71
|
+
{{#if tile.config.updateEvent}}
|
|
72
|
+
{{#if tile.config.updateFormUiSchema~}}
|
|
73
|
+
import { updateFormSchema as updateFormSchemaTile } from './{{pascalCase tile.title}}UpdateFormSchema';
|
|
52
74
|
{{/if}}
|
|
53
|
-
{{#if tile.config.eventing.listener}}
|
|
54
|
-
import { useSelector } from 'react-redux';
|
|
55
|
-
import { selectors } from '../../../store/store';
|
|
56
75
|
{{/if}}
|
|
57
|
-
{{#ifAny tile.config.snapshot tile.config.reqrep tile.config.eventing.listener}}
|
|
58
|
-
{{#ifContains 'entity-manager|grid-pro' tile.type}}
|
|
59
|
-
import { DatasourceConfiguration } from '@genesislcap/foundation-entity-management';
|
|
60
|
-
{{/ifContains}}
|
|
61
|
-
{{/ifAny}}
|
|
62
76
|
import './{{pascalCase tile.title}}Component.css';
|
|
63
77
|
|
|
64
78
|
{{#ifAny tile.metadata.comment tile.metadata.todo}}
|
|
@@ -69,13 +83,19 @@ import './{{pascalCase tile.title}}Component.css';
|
|
|
69
83
|
* TODO: {{{ tile.metadata.todo }}}{{/if}}
|
|
70
84
|
*/
|
|
71
85
|
{{/ifAny}}
|
|
72
|
-
|
|
73
86
|
export const {{pascalCase tile.componentName}}: React.FC = () => {
|
|
74
|
-
{{#if tile.config.
|
|
75
|
-
const hasUserPermission = (permissionCode: string): string | boolean =>
|
|
76
|
-
|
|
77
|
-
const hasUserPermission = (permissionCode: string): string | boolean => getViewUpdateRightComponent(getUser(), permissionCode);
|
|
87
|
+
{{#if tile.config.usesPermissionHelper}}
|
|
88
|
+
const hasUserPermission = (permissionCode: string): string | boolean =>
|
|
89
|
+
getViewUpdateRightComponent(getUser(), permissionCode);
|
|
78
90
|
{{/if}}
|
|
91
|
+
{{#ifEquals tile.type 'entity-manager'}}
|
|
92
|
+
{{#if tile.config.permissions.updateRight}}
|
|
93
|
+
{{#ifAny tile.config.createEvent tile.config.updateEvent tile.config.deleteEvent}}
|
|
94
|
+
{{! Hoisted so the CRUD event props stay inside the print width whatever the event names are. }}
|
|
95
|
+
const canUpdate = hasUserPermission('{{tile.config.permissions.updateRight}}');
|
|
96
|
+
{{/ifAny}}
|
|
97
|
+
{{/if}}
|
|
98
|
+
{{/ifEquals}}
|
|
79
99
|
{{#if tile.config.eventing.publishEventName}}
|
|
80
100
|
const handleRowSelection = (e: any) => {
|
|
81
101
|
{{#ifEquals tile.type 'entity-manager'}}
|
|
@@ -91,18 +111,24 @@ export const {{pascalCase tile.componentName}}: React.FC = () => {
|
|
|
91
111
|
actions.eventing.publish{{pascalCase tile.config.eventing.publishEventName}}(data);
|
|
92
112
|
};
|
|
93
113
|
{{/if}}
|
|
114
|
+
{{#if tile.config.createEvent}}
|
|
94
115
|
{{#if tile.config.createFormUiSchema}}
|
|
95
116
|
const createFormSchema: typeof createFormSchemaTile = createFormSchemaTile;
|
|
96
117
|
{{/if}}
|
|
118
|
+
{{/if}}
|
|
97
119
|
{{#if tile.config.uischema}}
|
|
98
120
|
const uischema: typeof createFormSchemaTile = createFormSchemaTile;
|
|
99
121
|
{{/if}}
|
|
122
|
+
{{#if tile.config.updateEvent}}
|
|
100
123
|
{{#if tile.config.updateFormUiSchema}}
|
|
101
124
|
const updateFormSchema: typeof updateFormSchemaTile = updateFormSchemaTile;
|
|
102
125
|
{{/if}}
|
|
126
|
+
{{/if}}
|
|
127
|
+
{{#if tile.config.enableFilters}}
|
|
103
128
|
{{#if tile.config.filterFormUiSchema}}
|
|
104
129
|
const filterFormSchema: typeof filterFormSchemaTile = filterFormSchemaTile;
|
|
105
130
|
{{/if}}
|
|
131
|
+
{{/if}}
|
|
106
132
|
{{#if tile.config.columns}}
|
|
107
133
|
const columnDefs: typeof columnDefsTile = [...columnDefsTile];
|
|
108
134
|
{{/if}}
|
|
@@ -116,7 +142,7 @@ export const {{pascalCase tile.componentName}}: React.FC = () => {
|
|
|
116
142
|
onSelectionChanged: handleRowSelection,
|
|
117
143
|
rowSelection: 'single',
|
|
118
144
|
{{/if}}
|
|
119
|
-
}
|
|
145
|
+
};
|
|
120
146
|
{{/ifAny}}
|
|
121
147
|
{{/ifEquals}}
|
|
122
148
|
{{#ifAny tile.config.snapshot tile.config.reqrep tile.config.eventing.listener}}
|
|
@@ -132,10 +158,11 @@ export const {{pascalCase tile.componentName}}: React.FC = () => {
|
|
|
132
158
|
{{#if tile.config.eventing.listener}}
|
|
133
159
|
criteria: useSelector(selectors.eventing.getCriteriaFor{{pascalCase tile.title}}),
|
|
134
160
|
{{/if}}
|
|
135
|
-
}
|
|
161
|
+
};
|
|
136
162
|
{{/ifContains}}
|
|
137
163
|
{{/ifAny}}
|
|
138
|
-
{{#
|
|
164
|
+
{{#ifEquals tile.type 'chart'}}
|
|
165
|
+
{{! Declared for every chart tile: the chart partial always passes config={chartConfig}. }}
|
|
139
166
|
const chartConfig: ChartConfig = {
|
|
140
167
|
{{#ifEquals tile.config.type 'pie'}}
|
|
141
168
|
radius: 0.75,
|
|
@@ -146,9 +173,24 @@ export const {{pascalCase tile.componentName}}: React.FC = () => {
|
|
|
146
173
|
yField: 'value',
|
|
147
174
|
{{/ifEquals}}
|
|
148
175
|
};
|
|
149
|
-
{{/
|
|
150
|
-
|
|
176
|
+
{{/ifEquals}}
|
|
177
|
+
{{#if tile.config.wholeTileRight}}
|
|
178
|
+
return hasUserPermission('{{tile.config.wholeTileRight}}') ? (
|
|
179
|
+
{{#ifEquals tile.type 'smart-form'}}
|
|
180
|
+
{{! smart-form renders as a single line; keep the partial inline so its trailing newline survives }}{{> (lookup tile 'type') tile}}
|
|
181
|
+
{{else}}
|
|
182
|
+
{{> (lookup tile 'type') tile}}
|
|
183
|
+
{{/ifEquals}}
|
|
184
|
+
) : (
|
|
185
|
+
<ErrorMessage elementType="h3" message="You do not have access to view this component." />
|
|
186
|
+
);
|
|
187
|
+
{{else}}
|
|
188
|
+
{{#ifEquals tile.type 'smart-form'}}
|
|
189
|
+
return {{> (lookup tile 'type') tile}};
|
|
190
|
+
{{else}}
|
|
151
191
|
return (
|
|
152
192
|
{{> (lookup tile 'type') tile}}
|
|
153
193
|
);
|
|
194
|
+
{{/ifEquals}}
|
|
195
|
+
{{/if}}
|
|
154
196
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UiSchema } from '@genesislcap/foundation-forms';
|
|
2
2
|
|
|
3
3
|
{{#if tile.config.updateFormUiSchema~}}
|
|
4
|
-
export const updateFormSchema: UiSchema = {{{ tile.config.updateFormUiSchema }}}
|
|
4
|
+
export const updateFormSchema: UiSchema = {{{ tile.config.updateFormUiSchema }}};
|
|
5
5
|
{{/if}}
|