@genesislcap/foundation-entity-management 11.3.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.
Files changed (114) hide show
  1. package/README.md +266 -0
  2. package/dist/dts/entities/entities.d.ts +550 -0
  3. package/dist/dts/entities/entities.d.ts.map +1 -0
  4. package/dist/dts/entities/entities.styles.d.ts +10 -0
  5. package/dist/dts/entities/entities.styles.d.ts.map +1 -0
  6. package/dist/dts/entities/entities.template.d.ts +7 -0
  7. package/dist/dts/entities/entities.template.d.ts.map +1 -0
  8. package/dist/dts/entities/index.d.ts +4 -0
  9. package/dist/dts/entities/index.d.ts.map +1 -0
  10. package/dist/dts/index.d.ts +5 -0
  11. package/dist/dts/index.d.ts.map +1 -0
  12. package/dist/dts/index.federated.d.ts +1 -0
  13. package/dist/dts/index.federated.d.ts.map +1 -0
  14. package/dist/dts/list/index.d.ts +2 -0
  15. package/dist/dts/list/index.d.ts.map +1 -0
  16. package/dist/dts/list/list.d.ts +29 -0
  17. package/dist/dts/list/list.d.ts.map +1 -0
  18. package/dist/dts/list/list.styles.d.ts +2 -0
  19. package/dist/dts/list/list.styles.d.ts.map +1 -0
  20. package/dist/dts/list/list.template.d.ts +26 -0
  21. package/dist/dts/list/list.template.d.ts.map +1 -0
  22. package/dist/dts/profiles/editProfileSchema.d.ts +19 -0
  23. package/dist/dts/profiles/editProfileSchema.d.ts.map +1 -0
  24. package/dist/dts/profiles/profiles.d.ts +43 -0
  25. package/dist/dts/profiles/profiles.d.ts.map +1 -0
  26. package/dist/dts/types.d.ts +3 -0
  27. package/dist/dts/types.d.ts.map +1 -0
  28. package/dist/dts/users/users.d.ts +566 -0
  29. package/dist/dts/users/users.d.ts.map +1 -0
  30. package/dist/dts/users/users.template.d.ts +3 -0
  31. package/dist/dts/users/users.template.d.ts.map +1 -0
  32. package/dist/dts/utils/formatting.d.ts +7 -0
  33. package/dist/dts/utils/formatting.d.ts.map +1 -0
  34. package/dist/dts/utils/index.d.ts +2 -0
  35. package/dist/dts/utils/index.d.ts.map +1 -0
  36. package/dist/esm/entities/entities.js +296 -0
  37. package/dist/esm/entities/entities.styles.js +29 -0
  38. package/dist/esm/entities/entities.template.js +43 -0
  39. package/dist/esm/entities/index.js +3 -0
  40. package/dist/esm/index.federated.js +1 -0
  41. package/dist/esm/index.js +4 -0
  42. package/dist/esm/list/index.js +1 -0
  43. package/dist/esm/list/list.js +111 -0
  44. package/dist/esm/list/list.styles.js +27 -0
  45. package/dist/esm/list/list.template.js +77 -0
  46. package/dist/esm/profiles/editProfileSchema.js +40 -0
  47. package/dist/esm/profiles/profiles.js +88 -0
  48. package/dist/esm/types.js +3 -0
  49. package/dist/esm/users/users.js +302 -0
  50. package/dist/esm/users/users.template.js +90 -0
  51. package/dist/esm/utils/formatting.js +6 -0
  52. package/dist/esm/utils/index.js +1 -0
  53. package/dist/foundation-entity-management.api.json +1727 -0
  54. package/dist/foundation-entity-management.d.ts +1172 -0
  55. package/dist/tsdoc-metadata.json +11 -0
  56. package/docs/.gitattributes +2 -0
  57. package/docs/api/foundation-entity-management.datasourceconfiguration.md +29 -0
  58. package/docs/api/foundation-entity-management.entitymanagement.closemodal.md +15 -0
  59. package/docs/api/foundation-entity-management.entitymanagement.columns.md +13 -0
  60. package/docs/api/foundation-entity-management.entitymanagement.connect.md +18 -0
  61. package/docs/api/foundation-entity-management.entitymanagement.createevent.md +13 -0
  62. package/docs/api/foundation-entity-management.entitymanagement.createformuischema.md +11 -0
  63. package/docs/api/foundation-entity-management.entitymanagement.datasourceconfig.md +18 -0
  64. package/docs/api/foundation-entity-management.entitymanagement.deepclone.md +17 -0
  65. package/docs/api/foundation-entity-management.entitymanagement.deleteevent.md +13 -0
  66. package/docs/api/foundation-entity-management.entitymanagement.editdialogtitle.md +13 -0
  67. package/docs/api/foundation-entity-management.entitymanagement.editedentity.md +13 -0
  68. package/docs/api/foundation-entity-management.entitymanagement.editentitymodal.md +11 -0
  69. package/docs/api/foundation-entity-management.entitymanagement.editmodalvisible.md +11 -0
  70. package/docs/api/foundation-entity-management.entitymanagement.editmodalvisiblechanged.md +15 -0
  71. package/docs/api/foundation-entity-management.entitymanagement.enablecellflashing.md +11 -0
  72. package/docs/api/foundation-entity-management.entitymanagement.enablefilterbar.md +11 -0
  73. package/docs/api/foundation-entity-management.entitymanagement.entitylabel.md +13 -0
  74. package/docs/api/foundation-entity-management.entitymanagement.errornotify.md +24 -0
  75. package/docs/api/foundation-entity-management.entitymanagement.formuischema.md +11 -0
  76. package/docs/api/foundation-entity-management.entitymanagement.md +74 -0
  77. package/docs/api/foundation-entity-management.entitymanagement.persistcolumnstatekey.md +18 -0
  78. package/docs/api/foundation-entity-management.entitymanagement.readevent.md +11 -0
  79. package/docs/api/foundation-entity-management.entitymanagement.readeventfn.md +11 -0
  80. package/docs/api/foundation-entity-management.entitymanagement.readonly.md +11 -0
  81. package/docs/api/foundation-entity-management.entitymanagement.resourcename.md +13 -0
  82. package/docs/api/foundation-entity-management.entitymanagement.selectedentity.md +18 -0
  83. package/docs/api/foundation-entity-management.entitymanagement.sizecolumnstofit.md +11 -0
  84. package/docs/api/foundation-entity-management.entitymanagement.submitentitychanges.md +24 -0
  85. package/docs/api/foundation-entity-management.entitymanagement.submitting.md +11 -0
  86. package/docs/api/foundation-entity-management.entitymanagement.title.md +13 -0
  87. package/docs/api/foundation-entity-management.entitymanagement.updateevent.md +13 -0
  88. package/docs/api/foundation-entity-management.entitymanagement.updateformuischema.md +11 -0
  89. package/docs/api/foundation-entity-management.geterrorformat.md +13 -0
  90. package/docs/api/foundation-entity-management.md +27 -0
  91. package/docs/api/foundation-entity-management.profiles._constructor_.md +13 -0
  92. package/docs/api/foundation-entity-management.profiles.deleteentity.md +22 -0
  93. package/docs/api/foundation-entity-management.profiles.md +40 -0
  94. package/docs/api/foundation-entity-management.profiles.readprofiledata.md +26 -0
  95. package/docs/api/foundation-entity-management.users._constructor_.md +13 -0
  96. package/docs/api/foundation-entity-management.users.additionalcreatefields.md +11 -0
  97. package/docs/api/foundation-entity-management.users.additionalupdatefields.md +11 -0
  98. package/docs/api/foundation-entity-management.users.allaccesstype.md +11 -0
  99. package/docs/api/foundation-entity-management.users.columns.md +13 -0
  100. package/docs/api/foundation-entity-management.users.connectedcallback.md +15 -0
  101. package/docs/api/foundation-entity-management.users.createevent.md +13 -0
  102. package/docs/api/foundation-entity-management.users.deepclone.md +15 -0
  103. package/docs/api/foundation-entity-management.users.deleteevent.md +13 -0
  104. package/docs/api/foundation-entity-management.users.md +69 -0
  105. package/docs/api/foundation-entity-management.users.updateevent.md +13 -0
  106. package/docs/api/foundation-entity-management.userscolumnconfig.md +35 -0
  107. package/docs/api/index.md +12 -0
  108. package/docs/api-report.md +200 -0
  109. package/docs/img/foundation-entity-management-form.png +0 -0
  110. package/docs/img/foundation-entity-management-grid.png +0 -0
  111. package/docs/img/foundation-profile-management.png +0 -0
  112. package/docs/img/foundation-user-management.png +0 -0
  113. package/license.txt +46 -0
  114. package/package.json +123 -0
package/README.md ADDED
@@ -0,0 +1,266 @@
1
+ # Foundation Entity Management
2
+
3
+ [API](./docs/api/index.md)
4
+
5
+ # Entity Management
6
+
7
+ ## Introduction
8
+
9
+ The Entity Management micro-front-end is used to connect to a resource on the back end and manage it from the front end. Handlers can be set up for create, update, and delete events; after adding an event, a button appears to perform the action. There is a list of pre-defined events and resources to manage, but you can manage custom resources that you create on the back-end too.
10
+
11
+ :::tip
12
+ The buttons are conditionally accessed, based on the specified events. For example, if the current user is only able to edit the entities, then you should only set the edit event on the entity-manager - you need to conditionally set the events based on user authorisations.
13
+ :::
14
+
15
+ Two core components are used to manage the entities - the grid and the form. The grid contains an entity on each row and data in each column.
16
+
17
+ Example grid used to manage counterparties
18
+ ![Example entity management grid](./docs/img/foundation-entity-management-grid.png)
19
+
20
+ The other component is the form, and this is used to update an existing entity or create a new one. An example form is shown here.
21
+ ![Example entity management form](./docs/img/foundation-entity-management-form.png)
22
+
23
+ ## Set-up
24
+
25
+ To enable this micro-front-end in your application, follow the steps below.
26
+
27
+ - Add `@genesislcap/foundation-entity-management` as a dependency in your *package.json* file. Whenever you change the dependencies of your project, ensure you run the `$ npm run bootstrap` command again. For more info see the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
28
+
29
+ ```javascript
30
+ {
31
+ ...
32
+ "dependencies": {
33
+ "@genesislcap/foundation-entity-management": "latest"
34
+ },
35
+ ...
36
+ }
37
+ ```
38
+
39
+ - Import and declare the class in the page of the class where you wish to use the Entity Manager. Then add the entity management into the template html where required:
40
+ ```javascript
41
+ // Import
42
+ import { EntityManagement, } from '@genesislcap/foundation-entity-management';
43
+
44
+ // Declare class
45
+ EntityManagement;
46
+
47
+ // Example html with the entity management used in two different tabs to manage two
48
+ // different resources - one managing the counterpartys, and one managing the users.
49
+ export const AdminTemplate: ViewTemplate = html`
50
+ <zero-tabs>
51
+ <zero-tab-panel slot="tabpanel">
52
+ <zero-error-boundary>
53
+ <entity-management
54
+ resourceName="ALL_COUNTERPARTYS"
55
+ title="Counterparty Management"
56
+ updateEvent="EVENT_COUNTERPARTY_MODIFY"
57
+ deleteEvent="EVENT_COUNTERPARTY_DELETE"
58
+ createEvent="EVENT_COUNTERPARTY_INSERT"
59
+ ></entity-management>
60
+ </zero-error-boundary>
61
+ </zero-tab-panel>
62
+ <zero-tab-panel slot="tabpanel">
63
+ <zero-error-boundary>
64
+ <entity-management
65
+ resourceName="ALL_USERS"
66
+ title="User Management"
67
+ updateEvent="EVENT_AMEND_USER"
68
+ deleteEvent="EVENT_DELETE_USER"
69
+ createEvent="EVENT_INSERT_USER"
70
+ ></entity-management>
71
+ </zero-error-boundary>
72
+ </zero-tab-panel>
73
+ </zero-tabs>
74
+ `;
75
+ ```
76
+
77
+ ## Config
78
+
79
+ The functionality of the Entity Manager is customised through the properties you set on it in the HTML. This section covers the main properties that you need to customise. For a full list of all of the properties, [see here](./docs/api/foundation-entity-management.md#properties).
80
+
81
+ ### Title
82
+
83
+ `title` customises the title of the entity list so that the user can see what resource they are managing.
84
+
85
+ ### Resource
86
+
87
+ `resourceName` refers to the name of either a `DATASERVER` query, a `ReqRep` definition or a specific `EVENT_HANDLER`. This essentially is the resource to be managed. In the [above example](#set-up), we use `ALL_COUNTERPARTYS` which is a `SDATASERVER` query, as, by convention, they all start with `ALL_`.
88
+
89
+ ### Events
90
+
91
+ `createEvent`, `updateEvent`, `deleteEvent` are set to be the events on the back end that handle the specific actions, such as deleting counterparty data. For the create and update functionality, these also define the resource in which the form is populated when the user is creating or updating an entity. After adding an event, a button for performing the selected action appears.
92
+
93
+ ### Datasource configuration
94
+
95
+ Set this object to configure how the Entity Manager interacts with the resource. [See here](./docs/api/foundation-entity-management.datasourceconfiguration/#example).
96
+
97
+ ### Persist column state
98
+ `persist-column-state-key` is a string value. It is used to control how the column states are persisted through actions such as page changes or refreshes. If no `persist-column-state-key` property is set, then the behaviour will be to _not_ persist the column state, and the grid will revert back to its default state every time the user navigates away from it.
99
+
100
+ :::warning
101
+ The string defines the key in which the serialised state of the columns is stored in an object in [session storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). Therefore, if you are setting multiple Entity Managers in your application to persist the state you need to use unique keys or you will get undefined behaviour.
102
+ :::
103
+
104
+ # User Management
105
+
106
+ The User Management micro front-end is used to manage the users on the front end. Two core components are used to manage the entities:
107
+ - the grid
108
+ - the form
109
+
110
+ The grid contains an entity on each row and data in each column.
111
+
112
+ :::info
113
+ User Management is a concrete use case of the [Entity Management](#entity-management) micro front-end, which is provided as part of `foundation-ui`.
114
+ :::
115
+
116
+ Here is an example grid view for managing users:
117
+ ![Example user management grid](./docs/img/foundation-user-management.png)
118
+
119
+ ## Set-up
120
+
121
+ To enable this micro-front-end in your application, follow the steps below:
122
+
123
+ - Add `@genesislcap/foundation-entity-management` as a dependency in your *package.json* file. Whenever you change the dependencies of your project, ensure you run the `$ npm run bootstrap` command again. You can find more information in the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
124
+
125
+ ```javascript
126
+ {
127
+ ...
128
+ "dependencies": {
129
+ "@genesislcap/foundation-entity-management": "latest"
130
+ },
131
+ ...
132
+ }
133
+ ```
134
+
135
+ - Import and declare the class in the page of the class where you wish to use the user manager. Then add User Management to the template html where required:
136
+
137
+ ```javascript
138
+ // Import
139
+ import { Users, } from '@genesislcap/foundation-entity-management';
140
+
141
+ // Declare class
142
+ Users;
143
+
144
+ // Example html with the user management
145
+ // You can customise this with additional fields, see futher in this documentation
146
+ export const AdminTemplate: ViewTemplate = html`
147
+ <zero-tabs>
148
+ <zero-tab-panel slot="tabpanel">
149
+ <zero-error-boundary>
150
+ <user-management></user-management>
151
+ </zero-error-boundary>
152
+ </zero-tab-panel>
153
+ </zero-tabs>
154
+ `;
155
+ ```
156
+
157
+ ## Config
158
+
159
+ You can customise the functionality of User Management through the properties you set in the html. This section covers the main properties that you can customise. For a full list of all of the properties, [see here](./docs/api/foundation-entity-management.users.md).
160
+
161
+ ### Columns
162
+
163
+ The primary way to configure the User Management functionality is via the columns that are displayed on the grid.
164
+ ```javascript
165
+ // Default usage, will contain the "default" columns:
166
+ // username, first name, last name, email, last login
167
+ // as well as the additional entity and status columns
168
+ <user-management></user-management>
169
+ ```
170
+ The default columns are contained in the [UserColumnConfig](./docs/api/foundation-entity-management.userscolumnconfig.md) variable. The `Entity` and `Status` columns are always added to the grid.
171
+
172
+ To configure the columns yourself, set the `columns` attribute when you define the User Management in the html. You can mix in your custom column config with the default user columns config, using the javascript `spread` operator.
173
+ ```javascript
174
+ // Custom usage, will contain the "default" columns:
175
+ // username, first name, last name, email, last login
176
+ // the custom "userColumns"
177
+ // as well as the additional entity and status columns
178
+ <user-management :columns=${() => [...UsersColumnConfig, ...userColumns]}>
179
+ </user-management>
180
+ ```
181
+ To see a more verbose version of this example, [see the second example here](./docs/api/foundation-entity-management.users.md).
182
+
183
+ ### Permissions
184
+
185
+ In contrast to Entity Management, we have a different way of displaying buttons and performing actions here. In this case, they are displayed if the user has the appropriate permissions from the server.
186
+
187
+ - `INSERT_USER` - the user can add new users
188
+ - `DELETE_USER` - the user can delete users
189
+ - `AMEND_USER` - the user can update existing users
190
+
191
+ ### Persist column state
192
+ `persist-column-state-key` is a string value, which is used to control how the column states are persisted through actions such as page changes or refreshes. When using this micro front-end, it is set to `entity_profiles_management`.
193
+
194
+ :::info
195
+ For more info on `persist-column-state-key` see [the section in the entity management.](#persist-column-state)
196
+ :::
197
+
198
+ # Profile Management
199
+
200
+ The Profile Management micro-front-end is used to manage the profiles on the front end. Two core components are used to manage the profiles - the grid and the form.
201
+
202
+ :::info
203
+ Profile Management is a concrete use case of the [Entity Management](#entity-management) micro front-end, which is provided as part of `foundation-ui`.
204
+ :::
205
+
206
+ Example grid view when managing profiles.
207
+ ![Example profile management grid](./docs/img/foundation-profile-management.png)
208
+
209
+ ## Set-up
210
+
211
+ To enable this micro-front-end in your application, follow the steps below.
212
+
213
+ - Add `@genesislcap/foundation-entity-management` as a dependency in your **package.json** file. Whenever you change the dependencies of your project, ensure you run the bootstrap command again. You can find more information in the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
214
+
215
+ ```javascript
216
+ {
217
+ ...
218
+ "dependencies": {
219
+ "@genesislcap/foundation-entity-management": "latest"
220
+ },
221
+ ...
222
+ }
223
+ ```
224
+
225
+ - Import and declare the class in the page of the class where you wish to use the Profile Manager. Then add the profile management into the template html where required:
226
+ ```javascript
227
+ // Import
228
+ import { Profiles } from '@genesislcap/foundation-entity-management';
229
+
230
+ // Declare class
231
+ Profiles;
232
+
233
+ // Example html with the profile management
234
+ export const AdminTemplate: ViewTemplate = html`
235
+ <zero-tabs>
236
+ <zero-tab-panel slot="tabpanel">
237
+ <zero-error-boundary>
238
+ <profile-management></profile-management>
239
+ </zero-error-boundary>
240
+ </zero-tab-panel>
241
+ </zero-tabs>
242
+ `;
243
+ ```
244
+
245
+ ## Config
246
+
247
+ The functionality of the profile manager is customised through the properties you set in the html. This section covers the main properties that you will want to customise. For a full list of all of the properties, [see here](./docs/api/foundation-entity-management.profiles.md).
248
+
249
+ ### Permissions
250
+
251
+ In contrast to Entity Management, we have a different way of displaying buttons and performing actions here. In this case, they are displayed if the user has the appropriate permissions from the server.
252
+
253
+ - `INSERT_PROFILE` - the user can add new profiles
254
+ - `DELETE_PROFILE` - the user can delete profiles
255
+ - `AMEND_PROFILE` - the user can update existing profiles
256
+
257
+ ### Persist column state
258
+ `persist-column-state-key` is a string value which is used to control how the column states are persisted through actions such as page changes or refreshes. If no `persist-column-state-key` property is set, then the behaviour will be to _not_ persist the column state, and the grid will revert back to its default state every time the user navigates away from it.
259
+
260
+ :::info
261
+ For more information on `persist-column-state-key` see [the section in the Entity Management](#persist-column-state) page.
262
+ :::
263
+
264
+ ## License
265
+
266
+ Note: this project provides front end dependencies and uses licensed components listed in the next section, thus licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.