@genesislcap/blank-app-seed 5.2.0-prerelease.14 → 5.2.0-prerelease.16

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed-config",
3
3
  "description": "Genesis Blank App Seed Configuration",
4
- "version": "5.2.0-prerelease.14",
4
+ "version": "5.2.0-prerelease.16",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "lint": "eslint .",
@@ -1,8 +1,9 @@
1
1
  import { CustomEventHandler } from "../../../utils/customEvents";
2
+ import { UiSchema } from '@genesislcap/foundation-forms';
2
3
 
3
4
  {{#each tile.config.customEvents}}
4
5
  {{#if this.hasForm}}
5
- export const {{camelCase this.name}}FormSchema = {{{this.uischema}}};
6
+ export const {{camelCase this.name}}FormSchema: UiSchema = {{{this.uischema}}};
6
7
  {{/if}}
7
8
  {{/each}}
8
9
 
@@ -19,9 +19,9 @@ import { createPortal } from 'react-dom';
19
19
  import { getConnect } from '@genesislcap/foundation-comms';
20
20
  import type { ActionRendererParams } from '@genesislcap/rapid-grid-pro';
21
21
  import { RapidAgActionRenderer } from '@genesislcap/rapid-grid-pro';
22
- import { Modal } from '@genesislcap/rapid-design-system';
22
+ import { UiSchema } from '@genesislcap/foundation-forms';
23
23
  import { customEvents, customEventFormSchemas } from './{{pascalCase tile.title}}EventsConfig';
24
- import { useCustomEvent, type CustomEventHandler, type CustomEventState } from '../../../utils/customEvents';
24
+ import { useCustomEvent, type CustomEventState } from '../../../utils/customEvents';
25
25
  {{/if}}
26
26
  {{#if tile.config.createFormUiSchema~}}
27
27
  import { createFormSchema as createFormSchemaTile } from './{{pascalCase tile.title}}CreateFormSchema';
@@ -75,28 +75,33 @@ export const {{pascalCase tile.componentName}}: React.FC = () => {
75
75
  **/
76
76
  {{#each tile.config.customEvents}}
77
77
  {
78
- field: '',
79
78
  headerName: '',
80
79
  minWidth: 50,
81
80
  maxWidth: 50,
82
81
  headerTooltip: '{{this.tooltip}}',
83
82
  pinned: 'right',
83
+ suppressCellFlash: true,
84
84
  cellRenderer: RapidAgActionRenderer,
85
85
  cellRendererParams: {
86
86
  actionClick: async (rowData) => {
87
+ setIsModalVisible(false);
88
+
87
89
  const customEvent = customEvents.find(e => e.name === '{{this.name}}');
88
90
  if (customEvent) {
89
91
  const handleCustomEvent = useCustomEvent(
90
92
  customEvent,
91
93
  rowData,
92
94
  setCustomEventFormData,
93
- setActiveCustomEvent
95
+ setActiveCustomEvent,
96
+ setResourceName,
97
+ setUiSchema,
98
+ customEventFormSchemas
94
99
  );
95
100
  await handleCustomEvent();
96
101
  }
97
102
  },
98
103
  contentTemplate: `
99
- <rapid-icon name="{{this.icon}}"></rapid-icon>
104
+ <rapid-icon name="{{this.icon}}" title="{{this.name}}"></rapid-icon>
100
105
  `,
101
106
  } as ActionRendererParams,
102
107
  },
@@ -133,63 +138,31 @@ export const {{pascalCase tile.componentName}}: React.FC = () => {
133
138
  {{/if}}
134
139
 
135
140
  {{#if tile.config.customEvents}}
136
- const customEventModalRef = useRef<Modal>(null);
137
141
  const [activeCustomEvent, setActiveCustomEvent] = useState<CustomEventState | null>(null);
138
142
  const [customEventFormData, setCustomEventFormData] = useState<Record<string, any>>({});
143
+ const [resourceName, setResourceName] = useState<string>('');
144
+ const [uiSchema, setUiSchema] = useState<UiSchema | null>(null);
145
+ const [isModalVisible, setIsModalVisible] = useState<boolean>(false);
139
146
 
140
147
  useEffect(() => {
141
148
  if (activeCustomEvent) {
142
- customEventModalRef.current?.show();
143
- } else {
144
- customEventModalRef.current?.close();
149
+ setIsModalVisible(true);
145
150
  }
146
151
  }, [activeCustomEvent]);
147
152
 
148
- const handleCustomEventSubmit = () => {
149
- setActiveCustomEvent(null);
150
- setCustomEventFormData({});
151
- };
152
-
153
- const getActiveCustomEvent = () => {
154
- if (!activeCustomEvent) return null;
155
- return customEvents.find(e => e.name === activeCustomEvent.name);
156
- };
157
-
158
- const getCustomEventModalTitle = () => {
159
- const customEvent = getActiveCustomEvent();
160
- return customEvent?.name || 'Custom Event';
161
- };
162
-
163
- const getCustomEventResourceName = () => {
164
- if (!activeCustomEvent) return '';
165
- return `EVENT_${activeCustomEvent.event}`;
166
- };
167
-
168
- const getCustomEventUiSchema = () => {
169
- const customEvent = getActiveCustomEvent();
170
- return customEvent && customEvent.name in customEventFormSchemas
171
- ? customEventFormSchemas[customEvent.name as keyof typeof customEventFormSchemas]
172
- : null;
173
- };
174
-
175
153
  const renderFormModal = () => {
176
154
  if (!activeCustomEvent) return null;
177
155
 
178
156
  return createPortal(
179
- <rapid-modal
180
- ref={customEventModalRef}
181
- onCloseCallback={() => setActiveCustomEvent(null)}
182
- >
183
- <h4 slot="top">{getCustomEventModalTitle()}</h4>
184
- <foundation-form
185
- resourceName={getCustomEventResourceName()}
186
- uischema={getCustomEventUiSchema()}
187
- data={customEventFormData}
188
- onsubmit-success={handleCustomEventSubmit}
189
- onsubmit={submitFailureNotification}
190
- onsubmit-failure={submitFailureNotification}
191
- ></foundation-form>
192
- </rapid-modal>,
157
+ <smart-form-modal
158
+ entityLabel="{{ tile.config.entityName }}"
159
+ modal-position="{{ tile.config.modalPosition }}"
160
+ modalFormType={isModalVisible && 'update'}
161
+ editModalVisible={isModalVisible}
162
+ formResourceName={resourceName}
163
+ formUiSchema={uiSchema}
164
+ editedEntity={customEventFormData}
165
+ ></smart-form-modal>,
193
166
  document.querySelector('rapid-design-system-provider')!
194
167
  );
195
168
  };
@@ -49,6 +49,9 @@ hasUserPermission('{{config.permissions.viewRight}}') ? (
49
49
  {{#if config.columns~}}
50
50
  columns={columnDefs}
51
51
  {{/if}}
52
+ {{#if config.entityName}}
53
+ entityLabel="{{ config.entityName }}"
54
+ {{/if}}
52
55
  {{#if config.modalPosition~}}
53
56
  modal-position="{{ config.modalPosition }}"
54
57
  {{/if}}
@@ -10,7 +10,6 @@ import { ColDef } from '@ag-grid-community/core';
10
10
  {{#if tile.config.customEvents}}
11
11
  import type { ActionRendererParams } from '@genesislcap/rapid-grid-pro';
12
12
  import { RapidAgActionRenderer } from '@genesislcap/rapid-grid-pro';
13
- import { Modal } from '@genesislcap/rapid-design-system';
14
13
  import { customEvents, customEventFormSchemas } from './{{kebabCase tile.title}}.events.config';
15
14
  import { handleFormCustomEvent, handleNonFormCustomEvent, showCustomEventConfirmation, type CustomEventHandler, type CustomEventState } from '../../../utils/customEvents';
16
15
  {{/if}}
@@ -34,35 +33,24 @@ export class {{pascalCase tile.componentName}} extends GenesisElement {
34
33
  @Connect connect!: Connect;
35
34
 
36
35
  {{#if tile.config.customEvents}}
37
- customEventModal: Modal;
38
36
  @observable customEvents: CustomEventHandler[] = customEvents;
39
37
  @observable activeCustomEvent: CustomEventState | null = null;
40
38
  @observable customEventFormData: Record<string, any> = {};
41
39
 
42
- async handleCustomEventSubmit() {
43
- this.activeCustomEvent = null;
44
- this.customEventFormData = {};
45
- this.customEventModal.close();
46
- }
47
-
48
40
  async handleCustomEventClick(eventName: string, rowData: any) {
49
- const customEvent = this.customEvents.find(e => e.name === eventName);
41
+ const customEvent = this.customEvents.find((e) => e.name === eventName);
50
42
  if (!customEvent) return;
51
43
 
52
44
  if (customEvent.hasForm) {
53
45
  handleFormCustomEvent(
54
46
  customEvent,
55
47
  rowData,
56
- (data) => this.customEventFormData = data,
57
- (event) => this.activeCustomEvent = event,
58
- () => this.customEventModal.show()
48
+ (data) => (this.customEventFormData = data),
49
+ (event) => (this.activeCustomEvent = event),
59
50
  );
60
51
  } else {
61
- await handleNonFormCustomEvent(
62
- this.connect,
63
- customEvent,
64
- rowData,
65
- (onConfirm) => showCustomEventConfirmation(customEvent, onConfirm)
52
+ await handleNonFormCustomEvent(this.connect, customEvent, rowData, (onConfirm) =>
53
+ showCustomEventConfirmation(customEvent, onConfirm),
66
54
  );
67
55
  }
68
56
  }
@@ -72,11 +60,6 @@ export class {{pascalCase tile.componentName}} extends GenesisElement {
72
60
  return this.customEvents.find(e => e.name === this.activeCustomEvent.name);
73
61
  }
74
62
 
75
- getCustomEventModalTitle() {
76
- const customEvent = this.getActiveCustomEvent();
77
- return customEvent?.name || 'Custom Event';
78
- }
79
-
80
63
  getCustomEventResourceName() {
81
64
  if (!this.activeCustomEvent) return '';
82
65
  return `EVENT_${this.activeCustomEvent.event}`;
@@ -95,19 +78,19 @@ export class {{pascalCase tile.componentName}} extends GenesisElement {
95
78
  {{#if tile.config.customEvents}}
96
79
  {{#each tile.config.customEvents}}
97
80
  {
98
- field: '',
99
81
  headerName: '',
100
82
  minWidth: 50,
101
83
  maxWidth: 50,
102
84
  headerTooltip: '{{this.tooltip}}',
103
85
  pinned: 'right',
86
+ suppressCellFlash: true,
104
87
  cellRenderer: RapidAgActionRenderer,
105
88
  cellRendererParams: <ActionRendererParams>{
106
89
  actionClick: async (rowData) => {
107
90
  await this.handleCustomEventClick('{{this.name}}', rowData);
108
91
  },
109
92
  contentTemplate: `
110
- <rapid-icon name="{{this.icon}}"></rapid-icon>
93
+ <rapid-icon name="{{this.icon}}" title="{{this.name}}"></rapid-icon>
111
94
  `,
112
95
  },
113
96
  },
@@ -115,4 +98,4 @@ export class {{pascalCase tile.componentName}} extends GenesisElement {
115
98
  {{/if}}
116
99
  ];
117
100
  {{/if}}
118
- }
101
+ }
@@ -1,8 +1,5 @@
1
- import { html, when, whenElse, ref, repeat } from '@genesislcap/web-core';
2
- {{#if tile.config.customEvents}}
3
- import { customEvent } from '@genesislcap/foundation-events';
4
- {{/if}}
5
- import { getViewUpdateRightComponent{{#if tile.config.customEvents}}, submitFailureNotification{{/if}} } from '../../../utils';
1
+ import { html, whenElse, repeat } from '@genesislcap/web-core';
2
+ import { getViewUpdateRightComponent } from '../../../utils';
6
3
  import type { {{pascalCase tile.componentName}} } from './{{kebabCase tile.title}}';
7
4
  {{#if tile.config.createFormUiSchema}}
8
5
  import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
@@ -51,25 +51,15 @@ ${whenElse(
51
51
  {{/if}}
52
52
  ></entity-management>
53
53
  {{#if config.customEvents}}
54
- <rapid-modal
55
- ${ref('customEventModal')}
56
- :onCloseCallback=${(x) => (x.activeCustomEvent = null)}
57
- >
58
- <h4 slot="top">${(x) => x.getCustomEventModalTitle()}</h4>
59
- ${when(
60
- (x) => x.activeCustomEvent,
61
- html`
62
- <foundation-form
63
- resourceName=${(x) => x.getCustomEventResourceName()}
64
- :uischema=${(x) => x.getCustomEventUiSchema()}
65
- :data=${(x) => x.customEventFormData}
66
- @submit-success=${(x) => x.handleCustomEventSubmit()}
67
- @submit=${(_, c) => submitFailureNotification(customEvent(c))}
68
- @submit-failure=${(_, c) => submitFailureNotification(customEvent(c))}
69
- ></foundation-form>
70
- `,
71
- )}
72
- </rapid-modal>
54
+ <smart-form-modal
55
+ entityLabel="{{ config.entityName }}"
56
+ modal-position="{{ config.modalPosition }}"
57
+ :modalFormType=${(x) => !!x.activeCustomEvent && 'update'}
58
+ :editModalVisible=${(x) => !!x.activeCustomEvent}
59
+ :formResourceName=${(x) => x.getCustomEventResourceName()}
60
+ :formUiSchema=${(x) => x.getCustomEventUiSchema()}
61
+ :editedEntity=${(x) => x.customEventFormData}
62
+ ></smart-form-modal>
73
63
  {{/if}}
74
64
  `,
75
65
  html`
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.2.0-prerelease.16](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v5.2.0-prerelease.15...v5.2.0-prerelease.16) (2025-07-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * smart-form-modal react GENC-1162 d82bf2b
9
+ * use smart-form-modal GENC-1162 (#485) 744ad5b
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * update type for customEventFormSchemas GENC-1162 9985837
15
+ * use smart-form-modal GENC-1162 d4d112f
16
+
17
+ ## [5.2.0-prerelease.15](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v5.2.0-prerelease.14...v5.2.0-prerelease.15) (2025-07-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * remove field name for custom events PA-1716 7ed8191
23
+ * remove field name for custom events PA-1716 (#484) eb2ce71
24
+
3
25
  ## [5.2.0-prerelease.14](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v5.2.0-prerelease.13...v5.2.0-prerelease.14) (2025-07-08)
4
26
 
5
27
 
@@ -44,12 +44,16 @@
44
44
  {{#if FDC3.includeDependencies}}
45
45
  "@genesislcap/foundation-fdc3": "{{versions.UI}}",
46
46
  {{/if}}
47
+ "@genesislcap/foundation-events": "{{versions.UI}}",
48
+ "@genesislcap/foundation-forms": "{{versions.UI}}",
47
49
  "@genesislcap/foundation-header": "{{versions.UI}}",
48
50
  "@genesislcap/foundation-layout": "{{versions.UI}}",
49
51
  "@genesislcap/foundation-logger": "{{versions.UI}}",
50
52
  "@genesislcap/foundation-login": "{{versions.UI}}",
53
+ "@genesislcap/foundation-notifications": "{{versions.UI}}",
51
54
  "@genesislcap/foundation-shell": "{{versions.UI}}",
52
55
  "@genesislcap/foundation-ui": "{{versions.UI}}",
56
+ "@genesislcap/foundation-user": "{{versions.UI}}",
53
57
  "@genesislcap/foundation-utils": "{{versions.UI}}",
54
58
  "@genesislcap/foundation-zero-grid-tabulator": "{{versions.UI}}",
55
59
  "@genesislcap/rapid-design-system": "{{versions.UI}}",
@@ -8,6 +8,7 @@ declare module "react/jsx-runtime" {
8
8
  'rapid-design-system-provider': CustomElement;
9
9
  'entity-management': CustomElement;
10
10
  'foundation-form': CustomElement;
11
+ 'smart-form-modal': CustomElement;
11
12
  'rapid-grid-pro': CustomElement;
12
13
  'grid-pro-genesis-datasource': CustomElement;
13
14
  'grid-pro-column': CustomElement;
@@ -1,4 +1,4 @@
1
- import { EntityManagement } from '@genesislcap/foundation-entity-management';
1
+ import { EntityManagement, SmartFormModal } from '@genesislcap/foundation-entity-management';
2
2
  import { Form } from '@genesislcap/foundation-forms';
3
3
  import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
4
4
  import { getApp } from '@genesislcap/foundation-shell/app';
@@ -13,6 +13,7 @@ import { FoundationRouter } from '@genesislcap/foundation-ui';
13
13
  FoundationRouter;
14
14
  EntityManagement;
15
15
  Form;
16
+ SmartFormModal;
16
17
 
17
18
  /**
18
19
  * registerComponents.
@@ -1,4 +1,5 @@
1
1
  import { getConnect } from '@genesislcap/foundation-comms';
2
+ import { UiSchema } from '@genesislcap/foundation-forms';
2
3
  import { showNotification, showNotificationDialog } from '@genesislcap/foundation-notifications';
3
4
 
4
5
  interface ConfirmSubmit {
@@ -150,7 +151,10 @@ export const useCustomEvent =
150
151
  customEvent: CustomEventHandler,
151
152
  rowData: any,
152
153
  setFormData: (data: Record<string, any>) => void,
153
- setActiveEvent: (event: CustomEventState | null) => void
154
+ setActiveEvent: (event: CustomEventState | null) => void,
155
+ setResourceName?: (name: string) => void,
156
+ setUiSchema?: (schema: UiSchema) => void,
157
+ customEventFormSchemas?: Record<string, UiSchema>
154
158
  ) =>
155
159
  async () => {
156
160
  if (customEvent.hasForm) {
@@ -162,6 +166,15 @@ export const useCustomEvent =
162
166
  event: customEvent.baseEvent,
163
167
  rowData,
164
168
  });
169
+
170
+ if (setResourceName) {
171
+ setResourceName(`EVENT_${customEvent.baseEvent}`);
172
+ }
173
+
174
+ if (setUiSchema && customEventFormSchemas) {
175
+ const uiSchema = customEventFormSchemas[customEvent.name];
176
+ setUiSchema(uiSchema || null);
177
+ }
165
178
  } else {
166
179
  if (customEvent.confirmSubmit?.state === 'enabled') {
167
180
  showCustomEventConfirmation(customEvent, () =>
@@ -1,4 +1,4 @@
1
- import { EntityManagement } from '@genesislcap/foundation-entity-management';
1
+ import { EntityManagement, SmartFormModal } from '@genesislcap/foundation-entity-management';
2
2
  import { Form } from '@genesislcap/foundation-forms';
3
3
  import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
4
4
  import { getApp } from '@genesislcap/foundation-shell/app';
@@ -16,6 +16,7 @@ FoundationRouter;
16
16
  EntityManagement;
17
17
  Form;
18
18
  NotPermittedComponent;
19
+ SmartFormModal;
19
20
 
20
21
  /**
21
22
  * registerComponents.
@@ -144,14 +144,12 @@ export const handleFormCustomEvent = (
144
144
  rowData: any,
145
145
  setFormData: (data: Record<string, any>) => void,
146
146
  setActiveEvent: (event: CustomEventState) => void,
147
- showModal: () => void,
148
147
  ): void => {
149
148
  const defaultValues = customEvent.defaultValues || {};
150
149
  const formData = mapDefaultValues(defaultValues, rowData);
151
150
 
152
151
  setFormData(formData);
153
152
  setActiveEvent({ name: customEvent.name, event: customEvent.baseEvent, rowData });
154
- showModal();
155
153
  };
156
154
 
157
155
  export const handleNonFormCustomEvent = async (
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed",
3
3
  "description": "Genesis Blank App Seed",
4
- "version": "5.2.0-prerelease.14",
4
+ "version": "5.2.0-prerelease.16",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"