@genesislcap/blank-app-seed 3.20.5 → 3.21.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/.genx/package.json +1 -1
- package/.genx/static.js +8 -0
- package/.genx/templates/web-components/component/component.column.defs.hbs +6 -0
- package/.genx/templates/web-components/component/component.create.form.hbs +8 -0
- package/.genx/templates/web-components/component/component.gridOptions.hbs +6 -0
- package/.genx/templates/web-components/component/component.hbs +13 -0
- package/.genx/templates/web-components/component/component.index.hbs +1 -0
- package/.genx/templates/web-components/component/component.styles.hbs +7 -0
- package/.genx/templates/web-components/component/component.template.hbs +23 -0
- package/.genx/templates/web-components/component/component.update.form.hbs +5 -0
- package/.genx/templates/web-components/entityManager.hbs +4 -10
- package/.genx/templates/web-components/form.hbs +1 -3
- package/.genx/templates/web-components/grid.hbs +1 -3
- package/.genx/templates/web-components/gridLayout.hbs +30 -0
- package/.genx/templates/web-components/horizontalLayout.hbs +7 -0
- package/.genx/templates/web-components/route.template.hbs +8 -2
- package/.genx/templates/web-components/tabsLayout.hbs +7 -0
- package/.genx/utils/formatRouteData.js +5 -0
- package/.genx/utils/generateRoute.js +8 -0
- package/.genx/utils/generateTile.js +137 -0
- package/.genx/utils/gridSerializers.js +10 -10
- package/.genx/utils/registerPartials.js +4 -3
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- /package/.genx/templates/{gridLayout.hbs → angular/gridLayout.hbs} +0 -0
- /package/.genx/templates/{horizontalLayout.hbs → angular/horizontalLayout.hbs} +0 -0
- /package/.genx/templates/{tabsLayout.hbs → angular/tabsLayout.hbs} +0 -0
package/.genx/package.json
CHANGED
package/.genx/static.js
CHANGED
|
@@ -54,6 +54,13 @@ const DIR_TEMPLATE_BY_FRAMEWORK = {
|
|
|
54
54
|
[FRAMEWORK_ANGULAR_ALIAS]: DIRS_MAP.get(DIR_TEMPLATE_ANGULAR_ALIAS),
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
const COMPONENT_TYPE = {
|
|
58
|
+
'entity-manager': 'manager',
|
|
59
|
+
'grid-pro': 'grid',
|
|
60
|
+
'smart-form': 'form',
|
|
61
|
+
'chart': 'chart'
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
const TEXTS = {
|
|
58
65
|
INTRO_API_HOST:
|
|
59
66
|
'You can override the default Genesis server URL used during local developent.',
|
|
@@ -77,6 +84,7 @@ const TEXTS = {
|
|
|
77
84
|
};
|
|
78
85
|
|
|
79
86
|
module.exports = {
|
|
87
|
+
COMPONENT_TYPE,
|
|
80
88
|
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
81
89
|
FRAMEWORK_ANGULAR_ALIAS,
|
|
82
90
|
FRAMEWORK_REACT_ALIAS,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ColDef } from '@ag-grid-community/core';
|
|
2
|
+
import { getDateFormatter, getNumberFormatter{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../../utils';
|
|
3
|
+
|
|
4
|
+
{{#if tile.config.columns}}
|
|
5
|
+
export const columnDefs: ColDef[] = {{{ tile.config.columns }}}
|
|
6
|
+
{{/if}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UiSchema } from '@genesislcap/foundation-forms';
|
|
2
|
+
|
|
3
|
+
{{#if tile.config.createFormUiSchema}}
|
|
4
|
+
export const createFormSchema: UiSchema = {{{ tile.config.createFormUiSchema }}}
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#if tile.config.uischema}}
|
|
7
|
+
export const createFormSchema: UiSchema = {{{ tile.config.uischema }}}
|
|
8
|
+
{{/if}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
|
|
2
|
+
import { getDateFormatter, getNumberFormatter{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../../utils';
|
|
3
|
+
|
|
4
|
+
{{#if tile.config.gridOptions}}
|
|
5
|
+
export const gridOptions: GridOptionsConfig = {{{ tile.config.gridOptions }}}
|
|
6
|
+
{{/if}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { User } from '@genesislcap/foundation-user';
|
|
2
|
+
import { customElement, GenesisElement } from '@genesislcap/web-core';
|
|
3
|
+
import { {{pascalCase tile.title}}Styles as styles } from './{{kebabCase tile.title}}.styles';
|
|
4
|
+
import { {{pascalCase tile.title}}Template as template } from './{{kebabCase tile.title}}.template';
|
|
5
|
+
|
|
6
|
+
@customElement({
|
|
7
|
+
name: '{{kebabCase tile.componentName}}',
|
|
8
|
+
template,
|
|
9
|
+
styles,
|
|
10
|
+
})
|
|
11
|
+
export class {{pascalCase tile.componentName}} extends GenesisElement {
|
|
12
|
+
@User user: User;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './{{kebabCase tile.title}}';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { html, whenElse } from '@genesislcap/web-core';
|
|
2
|
+
import { getViewUpdateRightComponent } from '../../../utils';
|
|
3
|
+
import type { {{pascalCase tile.componentName}} } from './{{kebabCase tile.title}}';
|
|
4
|
+
{{#if tile.config.createFormUiSchema}}
|
|
5
|
+
import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
|
|
6
|
+
{{/if}}
|
|
7
|
+
{{#if tile.config.uischema}}
|
|
8
|
+
import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
|
|
9
|
+
{{/if}}
|
|
10
|
+
{{#if tile.config.updateFormUiSchema}}
|
|
11
|
+
import { updateFormSchema } from './{{kebabCase tile.title}}.update.form.schema';
|
|
12
|
+
{{/if}}
|
|
13
|
+
{{#if tile.config.columns}}
|
|
14
|
+
import { columnDefs } from './{{kebabCase tile.title}}.column.defs';
|
|
15
|
+
{{/if}}
|
|
16
|
+
{{#if tile.config.gridOptions}}
|
|
17
|
+
import { gridOptions } from './{{kebabCase tile.title}}.gridOptions';
|
|
18
|
+
{{/if}}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export const {{pascalCase tile.title}}Template = html<{{pascalCase tile.componentName}}>`
|
|
22
|
+
{{> (lookup tile 'type') tile}}
|
|
23
|
+
`;
|
|
@@ -12,26 +12,20 @@ ${whenElse(
|
|
|
12
12
|
{{#if config.createEvent}}
|
|
13
13
|
createEvent="${(x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.createEvent }}')}"
|
|
14
14
|
{{#if config.createFormUiSchema}}
|
|
15
|
-
:createFormUiSchema=${() =>
|
|
16
|
-
{{{ config.createFormUiSchema }}}
|
|
17
|
-
)}
|
|
15
|
+
:createFormUiSchema=${() => createFormSchema }
|
|
18
16
|
{{/if}}
|
|
19
17
|
{{/if}}
|
|
20
18
|
{{#if config.updateEvent}}
|
|
21
19
|
updateEvent="${(x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.updateEvent }}')}"
|
|
22
20
|
{{#if config.updateFormUiSchema}}
|
|
23
|
-
:updateFormUiSchema=${() =>
|
|
24
|
-
{{{ config.updateFormUiSchema }}}
|
|
25
|
-
)}
|
|
21
|
+
:updateFormUiSchema=${() => updateFormSchema}
|
|
26
22
|
{{/if}}
|
|
27
23
|
{{/if}}
|
|
28
24
|
{{#if config.deleteEvent}}
|
|
29
25
|
deleteEvent="${(x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.deleteEvent }}')}"
|
|
30
26
|
{{/if}}
|
|
31
27
|
{{#if config.gridOptions}}
|
|
32
|
-
:gridOptions=${() =>
|
|
33
|
-
{{{config.gridOptions}}}
|
|
34
|
-
)}
|
|
28
|
+
:gridOptions=${() => gridOptions }
|
|
35
29
|
{{/if}}
|
|
36
30
|
{{#if config.snapshot}}
|
|
37
31
|
:datasourceConfig=${() => ({isSnapshot: {{ config.snapshot }} })}
|
|
@@ -40,7 +34,7 @@ ${whenElse(
|
|
|
40
34
|
:datasourceConfig=${() => ({pollingInterval: 5000 })}
|
|
41
35
|
{{/if}}
|
|
42
36
|
{{#if config.columns}}
|
|
43
|
-
:columns=${() =>
|
|
37
|
+
:columns=${() => columnDefs }
|
|
44
38
|
{{/if}}
|
|
45
39
|
{{#if config.modalPosition}}
|
|
46
40
|
modal-position="{{ config.modalPosition }}"
|
|
@@ -14,9 +14,7 @@ ${whenElse(
|
|
|
14
14
|
:datasourceConfig=${() => ({pollingInterval: 5000 })}
|
|
15
15
|
{{/if}}
|
|
16
16
|
{{#if config.gridOptions}}
|
|
17
|
-
:deferredGridOptions=${() =>
|
|
18
|
-
{{{config.gridOptions}}}
|
|
19
|
-
)}
|
|
17
|
+
:deferredGridOptions=${() => gridOptions}
|
|
20
18
|
{{/if}}
|
|
21
19
|
>
|
|
22
20
|
</grid-pro-genesis-datasource>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<rapid-layout-region type="horizontal">
|
|
2
|
+
<rapid-layout-region type="vertical">
|
|
3
|
+
{{#each route.tiles}}
|
|
4
|
+
{{#ifEquals @index 0}}
|
|
5
|
+
<rapid-layout-item title="{{../title}}">
|
|
6
|
+
<{{kebabCase ../componentName}}></{{kebabCase ../componentName}}>
|
|
7
|
+
</rapid-layout-item>
|
|
8
|
+
{{/ifEquals}}
|
|
9
|
+
{{#ifEquals @index 1}}
|
|
10
|
+
<rapid-layout-item title="{{../title}}">
|
|
11
|
+
<{{kebabCase ../componentName}}></{{kebabCase ../componentName}}>
|
|
12
|
+
</rapid-layout-item>
|
|
13
|
+
{{/ifEquals}}
|
|
14
|
+
{{/each}}
|
|
15
|
+
</rapid-layout-region>
|
|
16
|
+
<rapid-layout-region type="vertical">
|
|
17
|
+
{{#each route.tiles}}
|
|
18
|
+
{{#ifEquals @index 2}}
|
|
19
|
+
<rapid-layout-item title="{{../title}}">
|
|
20
|
+
<{{kebabCase ../componentName}}></{{kebabCase ../componentName}}>
|
|
21
|
+
</rapid-layout-item>
|
|
22
|
+
{{/ifEquals}}
|
|
23
|
+
{{#ifEquals @index 3}}
|
|
24
|
+
<rapid-layout-item title="{{../title}}">
|
|
25
|
+
<{{kebabCase ../componentName}}></{{kebabCase ../componentName}}>
|
|
26
|
+
</rapid-layout-item>
|
|
27
|
+
{{/ifEquals}}
|
|
28
|
+
{{/each}}
|
|
29
|
+
</rapid-layout-region>
|
|
30
|
+
</rapid-layout-region>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { isDev } from '@genesislcap/foundation-utils';
|
|
2
|
-
import { html
|
|
3
|
-
import { getDateFormatter, getNumberFormatter, getViewUpdateRightComponent{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../utils';
|
|
2
|
+
import { html } from '@genesislcap/web-core';
|
|
4
3
|
import type { {{pascalCase route.name}} } from './{{kebabCase route.name}}';
|
|
4
|
+
{{#each route.tiles}}
|
|
5
|
+
import { {{pascalCase this.componentName}} } from './{{kebabCase this.title}}-{{this.componentType}}';
|
|
6
|
+
{{/each}}
|
|
7
|
+
|
|
8
|
+
{{#each route.tiles}}
|
|
9
|
+
{{pascalCase this.componentName}};
|
|
10
|
+
{{/each}}
|
|
5
11
|
|
|
6
12
|
export const {{pascalCase route.name}}Template = html<{{pascalCase route.name}}>`
|
|
7
13
|
{{#if route.tiles}}
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
} = require('./gridSerializers');
|
|
5
5
|
const formatJSONValue = require('./formatJSONValue');
|
|
6
6
|
const getLayoutType = require('./getLayoutType');
|
|
7
|
+
const { COMPONENT_TYPE } = require('../static');
|
|
7
8
|
|
|
8
9
|
const formatRouteData = (route) => {
|
|
9
10
|
const layoutKey = route?.layoutKey || `${route.name}_${Date.now()}`;
|
|
@@ -15,6 +16,8 @@ const formatRouteData = (route) => {
|
|
|
15
16
|
);
|
|
16
17
|
const tiles = route.tiles?.map((tile, index) => {
|
|
17
18
|
const config = tile.config || {};
|
|
19
|
+
const componentType = COMPONENT_TYPE[tile.type];
|
|
20
|
+
const componentName = `${route.name}-${tile.title.replace(/[^0-9a-z]/gi, '')}-${componentType}`;
|
|
18
21
|
const {
|
|
19
22
|
gridOptions,
|
|
20
23
|
createFormUiSchema,
|
|
@@ -25,6 +28,8 @@ const formatRouteData = (route) => {
|
|
|
25
28
|
|
|
26
29
|
return {
|
|
27
30
|
...tile,
|
|
31
|
+
componentName,
|
|
32
|
+
componentType,
|
|
28
33
|
config: {
|
|
29
34
|
...config,
|
|
30
35
|
index,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { resolve } = require('node:path');
|
|
2
2
|
const makeDirectory = require('./makeDirectory');
|
|
3
|
+
const generateTile = require('./generateTile');
|
|
3
4
|
const {
|
|
4
5
|
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
5
6
|
FRAMEWORK_ANGULAR_ALIAS,
|
|
@@ -59,6 +60,13 @@ const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
|
|
|
59
60
|
resolve(__dirname, source),
|
|
60
61
|
);
|
|
61
62
|
});
|
|
63
|
+
|
|
64
|
+
// Remove condition after adding changes for angular
|
|
65
|
+
if (framework === FRAMEWORK_WEB_COMPONENTS_ALIAS && route?.tiles?.length) {
|
|
66
|
+
route.tiles.forEach((tile) => {
|
|
67
|
+
generateTile(tile, route, { changeCase, writeFileWithData }, framework);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
62
70
|
};
|
|
63
71
|
|
|
64
72
|
module.exports = generateRoute;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
const makeDirectory = require('./makeDirectory');
|
|
3
|
+
const {
|
|
4
|
+
COMPONENT_TYPE,
|
|
5
|
+
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
6
|
+
FRAMEWORK_ANGULAR_ALIAS,
|
|
7
|
+
DIR_TEMPLATE_BY_FRAMEWORK,
|
|
8
|
+
} = require('../static');
|
|
9
|
+
|
|
10
|
+
const getPathByFramework = {
|
|
11
|
+
[FRAMEWORK_WEB_COMPONENTS_ALIAS]: {
|
|
12
|
+
clientSrcPath: `../../client/src/routes`,
|
|
13
|
+
route: (clientSrcPath, tileName, tileType, routeName) => `${clientSrcPath}/${routeName}/${tileName}-${tileType}`,
|
|
14
|
+
index: (componentPath) => `${componentPath}/index.ts`,
|
|
15
|
+
component: (componentPath, tileName) => `${componentPath}/${tileName}.ts`,
|
|
16
|
+
template: (componentPath, tileName) => `${componentPath}/${tileName}.template.ts`,
|
|
17
|
+
style: (componentPath, tileName) => `${componentPath}/${tileName}.styles.ts`,
|
|
18
|
+
addForm: (componentPath, tileName) => `${componentPath}/${tileName}.create.form.schema.ts`,
|
|
19
|
+
updateForm: (componentPath, tileName) => `${componentPath}/${tileName}.update.form.schema.ts`,
|
|
20
|
+
columnDefs: (componentPath, tileName) => `${componentPath}/${tileName}.column.defs.ts`,
|
|
21
|
+
gridOptions: (componentPath, tileName) => `${componentPath}/${tileName}.gridOptions.ts`,
|
|
22
|
+
},
|
|
23
|
+
// Placeholder for angular part
|
|
24
|
+
[FRAMEWORK_ANGULAR_ALIAS]: {},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const getFilesToWrite = (tile, tileName, routeName, path, sourceTemplateDir) => {
|
|
28
|
+
const {
|
|
29
|
+
clientSrcPath,
|
|
30
|
+
route: getRouteDir,
|
|
31
|
+
index: getComponentIndexTarget,
|
|
32
|
+
component: getComponentTarget,
|
|
33
|
+
template: getTemplateTarget,
|
|
34
|
+
style: getStyleTarget,
|
|
35
|
+
addForm: getAddFormTarget,
|
|
36
|
+
updateForm: getUpdateFormTarget,
|
|
37
|
+
columnDefs: getColumnDefsTarget,
|
|
38
|
+
gridOptions: getGridOptionsTarget,
|
|
39
|
+
} = path;
|
|
40
|
+
|
|
41
|
+
const routeDir = getRouteDir(clientSrcPath, tileName, tile.componentType, routeName);
|
|
42
|
+
|
|
43
|
+
const componentIndexFile = {
|
|
44
|
+
source: `${sourceTemplateDir}/component/component.index.hbs`,
|
|
45
|
+
target: getComponentIndexTarget(routeDir, tileName),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const componentFile = {
|
|
49
|
+
source: `${sourceTemplateDir}/component/component.hbs`,
|
|
50
|
+
target: getComponentTarget(routeDir, tileName),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const componentTemplateFile = {
|
|
54
|
+
source: `${sourceTemplateDir}/component/component.template.hbs`,
|
|
55
|
+
target: getTemplateTarget(routeDir, tileName),
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const componentStylesFile = {
|
|
59
|
+
source: `${sourceTemplateDir}/component/component.styles.hbs`,
|
|
60
|
+
target: getStyleTarget(routeDir, tileName),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const componentAddFormFile = {
|
|
64
|
+
source: `${sourceTemplateDir}/component/component.create.form.hbs`,
|
|
65
|
+
target: getAddFormTarget(routeDir, tileName),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const componentUpdateFormFile = {
|
|
69
|
+
source: `${sourceTemplateDir}/component/component.update.form.hbs`,
|
|
70
|
+
target: getUpdateFormTarget(routeDir, tileName),
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const componentColumnsFile = {
|
|
74
|
+
source: `${sourceTemplateDir}/component/component.column.defs.hbs`,
|
|
75
|
+
target: getColumnDefsTarget(routeDir, tileName),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const componentGridOptionsFile = {
|
|
79
|
+
source: `${sourceTemplateDir}/component/component.gridOptions.hbs`,
|
|
80
|
+
target: getGridOptionsTarget(routeDir, tileName),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const filesToWrite = [componentIndexFile, componentFile, componentTemplateFile, componentStylesFile];
|
|
84
|
+
|
|
85
|
+
switch (tile.type) {
|
|
86
|
+
case 'entity-manager':
|
|
87
|
+
if (tile.config?.columns) {
|
|
88
|
+
filesToWrite.push(componentColumnsFile);
|
|
89
|
+
}
|
|
90
|
+
if (tile.config?.gridOptions) {
|
|
91
|
+
filesToWrite.push(componentGridOptionsFile);
|
|
92
|
+
}
|
|
93
|
+
if (tile.config?.createFormUiSchema) {
|
|
94
|
+
filesToWrite.push(componentAddFormFile);
|
|
95
|
+
}
|
|
96
|
+
if (tile.config?.updateFormUiSchema) {
|
|
97
|
+
filesToWrite.push(componentUpdateFormFile);
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case 'grid-pro':
|
|
101
|
+
if (tile.config?.gridOptions) {
|
|
102
|
+
filesToWrite.push(componentGridOptionsFile);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case 'smart-form':
|
|
106
|
+
filesToWrite.push(componentAddFormFile);
|
|
107
|
+
break
|
|
108
|
+
default:
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return filesToWrite
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const generateTile = (tile, route, { changeCase, writeFileWithData }, framework) => {
|
|
116
|
+
const tileName = changeCase.paramCase(tile.title);
|
|
117
|
+
const routeName = changeCase.paramCase(route.name);
|
|
118
|
+
const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
|
|
119
|
+
const {
|
|
120
|
+
clientSrcPath,
|
|
121
|
+
route: getRouteDir,
|
|
122
|
+
} = getPathByFramework[framework];
|
|
123
|
+
const routeDir = getRouteDir(clientSrcPath, tileName, tile.componentType, routeName);
|
|
124
|
+
|
|
125
|
+
const filesToWrite = getFilesToWrite(tile, tileName, routeName, getPathByFramework[framework], sourceTemplateDir)
|
|
126
|
+
|
|
127
|
+
makeDirectory(resolve(__dirname, routeDir));
|
|
128
|
+
filesToWrite.forEach(({ source, target }) => {
|
|
129
|
+
writeFileWithData(
|
|
130
|
+
resolve(__dirname, target),
|
|
131
|
+
{ tile, route },
|
|
132
|
+
resolve(__dirname, source),
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
module.exports = generateTile;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
const formatJSONValue = require('./formatJSONValue');
|
|
2
2
|
|
|
3
|
-
function gridColumnsSerializer(columns, pad
|
|
3
|
+
function gridColumnsSerializer(columns, pad) {
|
|
4
4
|
if (!columns) {
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
try {
|
|
9
9
|
const columnsSerialized = columns.map((column) => {
|
|
10
|
-
return gridOptionsSerializer(column);
|
|
10
|
+
return gridOptionsSerializer(column, pad);
|
|
11
11
|
});
|
|
12
|
-
return `[
|
|
12
|
+
return `[${columnsSerialized}\n]`;
|
|
13
13
|
} catch (e) {
|
|
14
14
|
console.error('Error serializing grid columns:', e.message);
|
|
15
15
|
throw e;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function gridOptionsSerializer(options, pad = '
|
|
19
|
+
function gridOptionsSerializer(options, pad = ' ') {
|
|
20
20
|
if (!options) {
|
|
21
21
|
return undefined;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
try {
|
|
25
|
-
let output =
|
|
25
|
+
let output = `\n${pad}{\n`;
|
|
26
26
|
Object.keys(options).forEach((key) => {
|
|
27
27
|
const value = options[key];
|
|
28
28
|
if (key === 'columns') {
|
|
29
|
-
output += `${pad}${'columnDefs'}: ${gridColumnsSerializer(value)},\n`;
|
|
29
|
+
output += `${pad}${pad}${'columnDefs'}: ${gridColumnsSerializer(value, ' ')},\n`;
|
|
30
30
|
} else if (
|
|
31
31
|
value?.type === 'function' ||
|
|
32
32
|
value?.type === 'valueFormatter'
|
|
33
33
|
) {
|
|
34
34
|
const args = value.arguments?.map(JSON.stringify).join(', ');
|
|
35
|
-
output += `${pad}${key}: ${value.name}(${args}),\n`;
|
|
35
|
+
output += `${pad}${pad}${key}: ${value.name}(${args}),\n`;
|
|
36
36
|
} else if (key === 'hide') {
|
|
37
|
-
output += `${pad}${key}: ${value},\n`;
|
|
37
|
+
output += `${pad}${pad}${key}: ${value},\n`;
|
|
38
38
|
} else {
|
|
39
|
-
output += `${pad}${key}: ${formatJSONValue(value)},\n`;
|
|
39
|
+
output += `${pad}${pad}${key}: ${formatJSONValue(value)},\n`;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
output += `${pad}}
|
|
42
|
+
output += `${pad}}`;
|
|
43
43
|
return output;
|
|
44
44
|
} catch (e) {
|
|
45
45
|
console.error('Error serializing grid options:', e.message);
|
|
@@ -6,20 +6,21 @@ const {
|
|
|
6
6
|
} = require('../static');
|
|
7
7
|
|
|
8
8
|
const registerPartials = ({ registerPartial }, framework) => {
|
|
9
|
+
// It can be reverted after adding changes for angular
|
|
9
10
|
const rootTemplateDir = `../${DIRS_MAP.get(DIR_TEMPLATE_ROOT_ALIAS)}`;
|
|
10
11
|
const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
|
|
11
12
|
|
|
12
13
|
registerPartial(
|
|
13
14
|
'grid-layout',
|
|
14
|
-
resolve(__dirname, `${
|
|
15
|
+
resolve(__dirname, `${sourceTemplateDir}/gridLayout.hbs`),
|
|
15
16
|
);
|
|
16
17
|
registerPartial(
|
|
17
18
|
'tabs-layout',
|
|
18
|
-
resolve(__dirname, `${
|
|
19
|
+
resolve(__dirname, `${sourceTemplateDir}/tabsLayout.hbs`),
|
|
19
20
|
);
|
|
20
21
|
registerPartial(
|
|
21
22
|
'horizontal-layout',
|
|
22
|
-
resolve(__dirname, `${
|
|
23
|
+
resolve(__dirname, `${sourceTemplateDir}/horizontalLayout.hbs`),
|
|
23
24
|
);
|
|
24
25
|
registerPartial(
|
|
25
26
|
'smart-form',
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.21.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.20.5...v3.21.0) (2024-07-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* implement the generated UI code structure proposal GENC-533 (#275) 9bc3847
|
|
9
|
+
|
|
3
10
|
## [3.20.5](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.20.4...v3.20.5) (2024-07-09)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|