@genexus/genexus-ide-ui 0.0.115 → 0.0.117

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 (79) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-bpm-app-declaration.cjs.entry.js.map +1 -1
  3. package/dist/cjs/gx-ide-bpm-assign-roles.cjs.entry.js +138 -0
  4. package/dist/cjs/gx-ide-bpm-assign-roles.cjs.entry.js.map +1 -0
  5. package/dist/cjs/{gx-ide-container_3.cjs.entry.js → gx-ide-container_2.cjs.entry.js} +127 -53
  6. package/dist/cjs/gx-ide-container_2.cjs.entry.js.map +1 -0
  7. package/dist/cjs/gx-ide-manage-module-references.cjs.entry.js +26 -24
  8. package/dist/cjs/gx-ide-manage-module-references.cjs.entry.js.map +1 -1
  9. package/dist/cjs/gx-ide-title_2.cjs.entry.js +77 -0
  10. package/dist/cjs/gx-ide-title_2.cjs.entry.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/collection-manifest.json +2 -1
  13. package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/bpm-app-declaration.js +19 -19
  14. package/dist/collection/components/bpm/application-declaration/bpm-app-declaration.js.map +1 -0
  15. package/dist/collection/components/bpm/application-declaration/helpers.js.map +1 -0
  16. package/dist/collection/components/bpm/assign-roles/assign-roles.css +557 -0
  17. package/dist/collection/components/bpm/assign-roles/assign-roles.js +265 -0
  18. package/dist/collection/components/bpm/assign-roles/assign-roles.js.map +1 -0
  19. package/dist/collection/components/bpm/assign-roles/gx-ide-assets/bpm-assign-roles/langs/bpm-assign-roles.lang.en.json +24 -0
  20. package/dist/collection/components/bpm/assign-roles/gx-ide-assets/bpm-assign-roles/langs/bpm-assign-roles.lang.ja.json +3 -0
  21. package/dist/collection/components/bpm/assign-roles/gx-ide-assets/bpm-assign-roles/langs/bpm-assign-roles.lang.zh.json +3 -0
  22. package/dist/collection/components/modules/manage-module-references/manage-module-references.css +4 -0
  23. package/dist/collection/components/modules/manage-module-references/manage-module-references.js +29 -26
  24. package/dist/collection/components/modules/manage-module-references/manage-module-references.js.map +1 -1
  25. package/dist/components/gx-ide-bpm-app-declaration.js.map +1 -1
  26. package/dist/components/gx-ide-bpm-assign-roles.d.ts +11 -0
  27. package/dist/components/gx-ide-bpm-assign-roles.js +236 -0
  28. package/dist/components/gx-ide-bpm-assign-roles.js.map +1 -0
  29. package/dist/components/gx-ide-manage-module-references.js +27 -24
  30. package/dist/components/gx-ide-manage-module-references.js.map +1 -1
  31. package/dist/esm/genexus-ide-ui.js +1 -1
  32. package/dist/esm/gx-ide-bpm-app-declaration.entry.js.map +1 -1
  33. package/dist/esm/gx-ide-bpm-assign-roles.entry.js +134 -0
  34. package/dist/esm/gx-ide-bpm-assign-roles.entry.js.map +1 -0
  35. package/dist/esm/{gx-ide-container_3.entry.js → gx-ide-container_2.entry.js} +128 -53
  36. package/dist/esm/gx-ide-container_2.entry.js.map +1 -0
  37. package/dist/esm/gx-ide-manage-module-references.entry.js +26 -24
  38. package/dist/esm/gx-ide-manage-module-references.entry.js.map +1 -1
  39. package/dist/esm/gx-ide-title_2.entry.js +72 -0
  40. package/dist/esm/gx-ide-title_2.entry.js.map +1 -0
  41. package/dist/esm/loader.js +1 -1
  42. package/dist/genexus-ide-ui/genexus-ide-ui.css +2 -2
  43. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  44. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  45. package/dist/genexus-ide-ui/gx-ide-assets/bpm-assign-roles/langs/bpm-assign-roles.lang.en.json +24 -0
  46. package/dist/genexus-ide-ui/gx-ide-assets/bpm-assign-roles/langs/bpm-assign-roles.lang.ja.json +3 -0
  47. package/dist/genexus-ide-ui/gx-ide-assets/bpm-assign-roles/langs/bpm-assign-roles.lang.zh.json +3 -0
  48. package/dist/genexus-ide-ui/{p-9d7a1451.entry.js → p-3ad793aa.entry.js} +89 -165
  49. package/dist/genexus-ide-ui/p-3ad793aa.entry.js.map +1 -0
  50. package/dist/genexus-ide-ui/{p-6b0ea3c8.entry.js → p-7a5810d6.entry.js} +192 -116
  51. package/dist/genexus-ide-ui/p-7a5810d6.entry.js.map +1 -0
  52. package/dist/genexus-ide-ui/p-874d336e.entry.js +232 -0
  53. package/dist/genexus-ide-ui/p-874d336e.entry.js.map +1 -0
  54. package/dist/genexus-ide-ui/{p-ef061e8e.entry.js → p-b19e8dbf.entry.js} +31 -27
  55. package/dist/genexus-ide-ui/p-b19e8dbf.entry.js.map +1 -0
  56. package/dist/genexus-ide-ui/p-b4294776.entry.js.map +1 -1
  57. package/dist/types/components/{bpm-application-declaration → bpm/application-declaration}/bpm-app-declaration.d.ts +1 -1
  58. package/dist/types/components/bpm/assign-roles/assign-roles.d.ts +59 -0
  59. package/dist/types/components/modules/manage-module-references/manage-module-references.d.ts +5 -1
  60. package/dist/types/components.d.ts +132 -58
  61. package/package.json +3 -3
  62. package/dist/cjs/gx-ide-container_3.cjs.entry.js.map +0 -1
  63. package/dist/cjs/gxg-form-checkbox.cjs.entry.js +0 -151
  64. package/dist/cjs/gxg-form-checkbox.cjs.entry.js.map +0 -1
  65. package/dist/collection/components/bpm-application-declaration/bpm-app-declaration.js.map +0 -1
  66. package/dist/collection/components/bpm-application-declaration/helpers.js.map +0 -1
  67. package/dist/esm/gx-ide-container_3.entry.js.map +0 -1
  68. package/dist/esm/gxg-form-checkbox.entry.js +0 -147
  69. package/dist/esm/gxg-form-checkbox.entry.js.map +0 -1
  70. package/dist/genexus-ide-ui/p-6b0ea3c8.entry.js.map +0 -1
  71. package/dist/genexus-ide-ui/p-9d7a1451.entry.js.map +0 -1
  72. package/dist/genexus-ide-ui/p-ef061e8e.entry.js.map +0 -1
  73. /package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/bpm-app-declaration.css +0 -0
  74. /package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/gx-ide-assets/bpm-app-declaration/langs/bpm-app-declaration.lang.en.json +0 -0
  75. /package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/gx-ide-assets/bpm-app-declaration/langs/bpm-app-declaration.lang.ja.json +0 -0
  76. /package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/gx-ide-assets/bpm-app-declaration/langs/bpm-app-declaration.lang.zh.json +0 -0
  77. /package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/gx-ide-assets/bpm-app-declaration/shortcuts.json +0 -0
  78. /package/dist/collection/components/{bpm-application-declaration → bpm/application-declaration}/helpers.js +0 -0
  79. /package/dist/types/components/{bpm-application-declaration → bpm/application-declaration}/helpers.d.ts +0 -0
@@ -0,0 +1,265 @@
1
+ /* STENCIL IMPORTS */
2
+ import { Host, h } from "@stencil/core";
3
+ /* OTHER LIBRARIES IMPORTS */
4
+ /* CUSTOM IMPORTS */
5
+ import { Locale } from "../../../common/locale";
6
+ import { config } from "../../../common/config";
7
+ export class GxIdeBpmAssignRoles {
8
+ constructor() {
9
+ this.renderedFirstTime = false;
10
+ // 7.LISTENERS //
11
+ // 8.PUBLIC METHODS API //
12
+ // 9.LOCAL METHODS //
13
+ this.confirmCallbackHandler = () => {
14
+ this.confirmCallback(this.assignedRolesState);
15
+ };
16
+ this.cancelCallbackHandler = () => {
17
+ this.cancelCallback();
18
+ };
19
+ this.handleAssignedCheckedChange = (e) => {
20
+ this.assignedSelected = e.detail[0] && e.detail[0].checked === true;
21
+ };
22
+ this.handleUnassignedCheckedChange = (e) => {
23
+ this.unassignedSelected = e.detail[0] && e.detail[0].checked === true;
24
+ };
25
+ this.handleUnassignedInput = (e) => {
26
+ this.filterUnassignedInput = e.detail;
27
+ };
28
+ this.handleAssignedInput = (e) => {
29
+ this.filterAssignedInput = e.detail;
30
+ };
31
+ this.getCheckedItems = (listBox) => {
32
+ const checkedItems = [];
33
+ const listBoxItems = listBox.querySelectorAll("gxg-list-box-item");
34
+ listBoxItems.forEach((item) => {
35
+ if (item.checked) {
36
+ checkedItems.push(item.value);
37
+ }
38
+ });
39
+ return checkedItems;
40
+ };
41
+ this.addAll = () => {
42
+ this.assignedRolesState = [
43
+ ...this.assignedRolesState,
44
+ ...this.unassignedRolesState
45
+ ];
46
+ this.unassignedRolesState = [];
47
+ };
48
+ this.addSelectedRoles = () => {
49
+ const checkedItems = this.getCheckedItems(this.unassignedRolesEL);
50
+ if (checkedItems.length) {
51
+ this.unassignedRolesState = this.unassignedRolesState.filter(role => !checkedItems.includes(role));
52
+ this.assignedRolesState = [...this.assignedRolesState, ...checkedItems];
53
+ this.unassignedSelected = false;
54
+ }
55
+ };
56
+ this.removeAll = () => {
57
+ this.unassignedRolesState = [
58
+ ...this.unassignedRolesState,
59
+ ...this.assignedRolesState
60
+ ];
61
+ this.assignedRolesState = [];
62
+ };
63
+ this.removeSelectedRoles = () => {
64
+ const checkedItems = this.getCheckedItems(this.assignedRolesEl);
65
+ if (checkedItems.length) {
66
+ this.assignedRolesState = this.assignedRolesState.filter(role => {
67
+ return !checkedItems.includes(role);
68
+ });
69
+ this.unassignedRolesState = [
70
+ ...this.unassignedRolesState,
71
+ ...checkedItems
72
+ ];
73
+ this.assignedSelected = false;
74
+ }
75
+ };
76
+ this.renderRolesToAdd = () => {
77
+ return (h("div", { class: "roles__list" }, h("gxg-list-box", { checkboxes: true, disabled: false, part: "add-roles-selection", onCheckedChanged: this.handleUnassignedCheckedChange, ref: (el) => (this.unassignedRolesEL = el), noBorder: true, borderBottom: true, borderStart: true, borderEnd: true }, this.unassignedRolesState
78
+ .filter(role => this.filterUnassignedInput.toLowerCase() === "" ||
79
+ role
80
+ .toLowerCase()
81
+ .includes(this.filterUnassignedInput.toLowerCase()))
82
+ .map(role => (h("gxg-list-box-item", { value: role, checkbox: true, key: `${role}-${this.assignedRolesState.includes(role)
83
+ ? "assigned"
84
+ : "unassigned"}` }, role))))));
85
+ };
86
+ this.renderRolesToRemove = () => {
87
+ return (h("div", { class: "roles__list" }, h("gxg-list-box", { checkboxes: true, disabled: false, part: "remove-roles-selection", onCheckedChanged: this.handleAssignedCheckedChange, ref: (el) => (this.assignedRolesEl = el), noBorder: true, borderBottom: true, borderStart: true, borderEnd: true }, this.assignedRolesState
88
+ .filter(role => this.filterAssignedInput.toLowerCase() === "" ||
89
+ role
90
+ .toLowerCase()
91
+ .includes(this.filterAssignedInput.toLowerCase()))
92
+ .map(role => (h("gxg-list-box-item", { value: role, checkbox: true, key: `${role}-${this.assignedRolesState.includes(role)
93
+ ? "assigned"
94
+ : "unassigned"}` }, role))))));
95
+ };
96
+ this.unassignedRolesState = [];
97
+ this.assignedRolesState = [];
98
+ this.filterUnassignedInput = "";
99
+ this.filterAssignedInput = "";
100
+ this.unassignedSelected = false;
101
+ this.assignedSelected = false;
102
+ this.displayTitle = false;
103
+ this.roles = undefined;
104
+ this.assignedRoles = undefined;
105
+ this.confirmCallback = undefined;
106
+ this.cancelCallback = undefined;
107
+ }
108
+ // 6.COMPONENT LIFECYCLE METHODS //
109
+ async componentWillLoad() {
110
+ this._componentLocale = await Locale.getComponentStrings(this.el);
111
+ this.unassignedRolesState = this.roles.filter(role => !this.assignedRoles.includes(role));
112
+ this.assignedRolesState = this.assignedRoles;
113
+ }
114
+ componentDidRender() {
115
+ if (!this.renderedFirstTime) {
116
+ this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
117
+ this.renderedFirstTime = true;
118
+ }
119
+ }
120
+ // 10.RENDER() FUNCTION //
121
+ render() {
122
+ return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { noAboveFooterPadding: true, containerTitle: this.displayTitle ? this._componentLocale.componentName : null, slimmerFooter: config.gxIdeContainer.slimmerFooter }, h("div", { class: "roles__container" }, h("section", { class: "roles__role" }, h("header", { class: "roles__list-header" }, h("gxg-form-text", { label: this._componentLocale.main.assignRoles.searchRoles, placeholder: this._componentLocale.main.assignRoles.placeholder, labelPosition: "above", clearButton: true, part: "add-roles-filter", class: { "add-roles-filter": true }, onInput: this.handleUnassignedInput }), h("div", { class: "roles__list-title" }, h("gxg-title", { type: "title-04" }, this._componentLocale.main.assignRoles.title), h("gxg-icon", { type: "navigation/chevron-right", color: "mercury-neutral" }))), this.renderRolesToAdd()), h("section", { class: "roles__role" }, h("header", { class: "roles__list-header" }, h("gxg-form-text", { label: this._componentLocale.main.removeRoles.searchRoles, placeholder: this._componentLocale.main.removeRoles.placeholder, labelPosition: "above", clearButton: true, part: "remove-roles-filter", class: { "remove-roles-filter": true }, onInput: this.handleAssignedInput }), h("div", { class: "roles__list-title" }, h("gxg-icon", { type: "navigation/chevron-left", color: "mercury-neutral" }), h("gxg-title", { type: "title-04" }, this._componentLocale.main.removeRoles.title))), this.renderRolesToRemove())), h("footer", { class: "add-remove-buttons", slot: "footer-above" }, h("footer", { class: "add-remove-buttons__add" }, h("gxg-button", { id: "add-all", part: "add-all-roles-btn", onClick: this.addAll, disabled: this.unassignedRolesState.length === 0, type: "secondary-text-only" }, this._componentLocale.main.assignRoles.addAllButton), h("gxg-button", { id: "add-selected", part: "add-selected-roles-btn", onClick: this.addSelectedRoles, disabled: !this.unassignedSelected ||
123
+ !this.unassignedRolesState.length, type: "secondary-text-only" }, this._componentLocale.main.assignRoles.addSelectedButton)), h("footer", { class: "add-remove-buttons__remove" }, h("gxg-button", { id: "add-all", part: "remove-all-roles-btn", onClick: this.removeAll, disabled: this.assignedRolesState.length === 0, type: "secondary-text-only" }, this._componentLocale.main.removeRoles.removeAllButton), h("gxg-button", { id: "add-selected", part: "remove-selected-roles-btn", onClick: this.removeSelectedRoles, disabled: !this.assignedSelected || !this.assignedRolesState.length, type: "secondary-text-only" }, this._componentLocale.main.removeRoles.removeSelectedButton))), h("gxg-button", { type: "outlined", slot: "footer-end", onClick: this.cancelCallbackHandler }, this._componentLocale.footer.cancelButton), h("gxg-button", { slot: "footer-end", onClick: this.confirmCallbackHandler }, this._componentLocale.footer.confirmButton)))));
124
+ }
125
+ static get is() { return "gx-ide-bpm-assign-roles"; }
126
+ static get encapsulation() { return "shadow"; }
127
+ static get originalStyleUrls() {
128
+ return {
129
+ "$": ["assign-roles.scss"]
130
+ };
131
+ }
132
+ static get styleUrls() {
133
+ return {
134
+ "$": ["assign-roles.css"]
135
+ };
136
+ }
137
+ static get assetsDirs() { return ["gx-ide-assets/bpm-assign-roles"]; }
138
+ static get properties() {
139
+ return {
140
+ "displayTitle": {
141
+ "type": "boolean",
142
+ "mutable": false,
143
+ "complexType": {
144
+ "original": "false",
145
+ "resolved": "boolean",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": "If true it displays the component title on the header"
153
+ },
154
+ "attribute": "display-title",
155
+ "reflect": false,
156
+ "defaultValue": "false"
157
+ },
158
+ "roles": {
159
+ "type": "unknown",
160
+ "mutable": false,
161
+ "complexType": {
162
+ "original": "string[]",
163
+ "resolved": "string[]",
164
+ "references": {}
165
+ },
166
+ "required": false,
167
+ "optional": false,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": "Array with all available roles"
171
+ }
172
+ },
173
+ "assignedRoles": {
174
+ "type": "unknown",
175
+ "mutable": false,
176
+ "complexType": {
177
+ "original": "string[]",
178
+ "resolved": "string[]",
179
+ "references": {}
180
+ },
181
+ "required": false,
182
+ "optional": false,
183
+ "docs": {
184
+ "tags": [],
185
+ "text": "Array with currently assigned roles"
186
+ }
187
+ },
188
+ "confirmCallback": {
189
+ "type": "unknown",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "ConfirmCallback",
193
+ "resolved": "(assignedRoles: string[]) => Promise<void>",
194
+ "references": {
195
+ "ConfirmCallback": {
196
+ "location": "local",
197
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/assign-roles/assign-roles.tsx",
198
+ "id": "src/components/bpm/assign-roles/assign-roles.tsx::ConfirmCallback"
199
+ }
200
+ }
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "Callback invoked when user confirms assignation"
207
+ }
208
+ },
209
+ "cancelCallback": {
210
+ "type": "unknown",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "CancelCallback",
214
+ "resolved": "() => Promise<void>",
215
+ "references": {
216
+ "CancelCallback": {
217
+ "location": "local",
218
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/assign-roles/assign-roles.tsx",
219
+ "id": "src/components/bpm/assign-roles/assign-roles.tsx::CancelCallback"
220
+ }
221
+ }
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": "Callback invoked when user cancels assignation"
228
+ }
229
+ }
230
+ };
231
+ }
232
+ static get states() {
233
+ return {
234
+ "unassignedRolesState": {},
235
+ "assignedRolesState": {},
236
+ "filterUnassignedInput": {},
237
+ "filterAssignedInput": {},
238
+ "unassignedSelected": {},
239
+ "assignedSelected": {}
240
+ };
241
+ }
242
+ static get events() {
243
+ return [{
244
+ "method": "componentDidRenderFirstTime",
245
+ "name": "componentDidRenderFirstTime",
246
+ "bubbles": true,
247
+ "cancelable": true,
248
+ "composed": true,
249
+ "docs": {
250
+ "tags": [{
251
+ "name": "description",
252
+ "text": "Gets fired when the component has rendered for the first time."
253
+ }],
254
+ "text": ""
255
+ },
256
+ "complexType": {
257
+ "original": "string",
258
+ "resolved": "string",
259
+ "references": {}
260
+ }
261
+ }];
262
+ }
263
+ static get elementRef() { return "el"; }
264
+ }
265
+ //# sourceMappingURL=assign-roles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assign-roles.js","sourceRoot":"","sources":["../../../../src/components/bpm/assign-roles/assign-roles.tsx"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,6BAA6B;AAC7B,oBAAoB;AACp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C,CACN;wBACT,cAAQ,KAAK,EAAC,4BAA4B;4BACxC,kBACE,EAAE,EAAC,SAAS,EACZ,IAAI,EAAC,sBAAsB,EAC3B,OAAO,EAAE,IAAI,CAAC,SAAS,EACvB,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAC9C,IAAI,EAAC,qBAAqB,IAEzB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAC5C;4BACb,kBACE,EAAE,EAAC,cAAc,EACjB,IAAI,EAAC,2BAA2B,EAChC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,QAAQ,EACN,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAE3D,IAAI,EAAC,qBAAqB,IAEzB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,CACjD,CACN,CACF;oBAGT,kBACE,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,YAAY,EACjB,OAAO,EAAE,IAAI,CAAC,qBAAqB,IAElC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CAC/B;oBAEb,kBAAY,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAC/D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,CAChC,CACI,CACf,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/* STENCIL IMPORTS */\nimport {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State\n} from \"@stencil/core\";\n/* OTHER LIBRARIES IMPORTS */\n/* CUSTOM IMPORTS */\nimport { Locale } from \"../../../common/locale\";\nimport { config } from \"../../../common/config\";\n\n@Component({\n tag: \"gx-ide-bpm-assign-roles\",\n styleUrl: \"assign-roles.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-assign-roles\"]\n})\nexport class GxIdeBpmAssignRoles {\n // 1.OWN PROPERTIES //\n\n /**\n * The component hard-coded strings translations.\n */\n private _componentLocale: any;\n private renderedFirstTime = false;\n\n // 2. REFERENCE TO ELEMENTS //\n\n @Element() el: HTMLGxIdeBpmAssignRolesElement;\n private unassignedRolesEL: HTMLGxgListBoxElement;\n private assignedRolesEl: HTMLGxgListBoxElement;\n\n // 3.STATE() VARIABLES //\n\n @State() unassignedRolesState: string[] = [];\n @State() assignedRolesState: string[] = [];\n @State() filterUnassignedInput = \"\";\n @State() filterAssignedInput = \"\";\n @State() unassignedSelected = false;\n @State() assignedSelected = false;\n\n // 4.PUBLIC PROPERTY API | WATCH'S //\n\n /**\n * If true it displays the component title on the header\n */\n @Prop() readonly displayTitle = false;\n\n /**\n * Array with all available roles\n */\n @Prop() readonly roles: string[];\n\n /**\n * Array with currently assigned roles\n */\n @Prop() readonly assignedRoles: string[];\n\n /**\n * Callback invoked when user confirms assignation\n */\n @Prop() readonly confirmCallback: ConfirmCallback;\n\n /**\n * Callback invoked when user cancels assignation\n */\n @Prop() readonly cancelCallback: CancelCallback;\n\n // 5.EVENTS (EMIT) //\n\n /**\n * @description Gets fired when the component has rendered for the first time.\n */\n @Event() componentDidRenderFirstTime: EventEmitter<string>;\n\n // 6.COMPONENT LIFECYCLE METHODS //\n\n async componentWillLoad() {\n this._componentLocale = await Locale.getComponentStrings(this.el);\n this.unassignedRolesState = this.roles.filter(\n role => !this.assignedRoles.includes(role)\n );\n this.assignedRolesState = this.assignedRoles;\n }\n\n componentDidRender() {\n if (!this.renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this._componentLocale.componentName\n );\n this.renderedFirstTime = true;\n }\n }\n\n // 7.LISTENERS //\n\n // 8.PUBLIC METHODS API //\n\n // 9.LOCAL METHODS //\n\n private confirmCallbackHandler = () => {\n this.confirmCallback(this.assignedRolesState);\n };\n\n private cancelCallbackHandler = () => {\n this.cancelCallback();\n };\n\n private handleAssignedCheckedChange = (e: any) => {\n this.assignedSelected = e.detail[0] && e.detail[0].checked === true;\n };\n\n private handleUnassignedCheckedChange = (e: any) => {\n this.unassignedSelected = e.detail[0] && e.detail[0].checked === true;\n };\n\n private handleUnassignedInput = (e: any) => {\n this.filterUnassignedInput = e.detail;\n };\n\n private handleAssignedInput = (e: any) => {\n this.filterAssignedInput = e.detail;\n };\n private getCheckedItems = (listBox: any) => {\n const checkedItems: string[] = [];\n const listBoxItems = listBox.querySelectorAll(\"gxg-list-box-item\");\n\n listBoxItems.forEach((item: any) => {\n if (item.checked) {\n checkedItems.push(item.value);\n }\n });\n\n return checkedItems;\n };\n\n private addAll = () => {\n this.assignedRolesState = [\n ...this.assignedRolesState,\n ...this.unassignedRolesState\n ];\n this.unassignedRolesState = [];\n };\n\n private addSelectedRoles = () => {\n const checkedItems = this.getCheckedItems(this.unassignedRolesEL);\n if (checkedItems.length) {\n this.unassignedRolesState = this.unassignedRolesState.filter(\n role => !checkedItems.includes(role)\n );\n this.assignedRolesState = [...this.assignedRolesState, ...checkedItems];\n this.unassignedSelected = false;\n }\n };\n\n private removeAll = () => {\n this.unassignedRolesState = [\n ...this.unassignedRolesState,\n ...this.assignedRolesState\n ];\n this.assignedRolesState = [];\n };\n\n private removeSelectedRoles = () => {\n const checkedItems = this.getCheckedItems(this.assignedRolesEl);\n\n if (checkedItems.length) {\n this.assignedRolesState = this.assignedRolesState.filter(role => {\n return !checkedItems.includes(role);\n });\n this.unassignedRolesState = [\n ...this.unassignedRolesState,\n ...checkedItems\n ];\n this.assignedSelected = false;\n }\n };\n\n private renderRolesToAdd = () => {\n return (\n <div class=\"roles__list\">\n <gxg-list-box\n checkboxes\n disabled={false}\n part=\"add-roles-selection\"\n onCheckedChanged={this.handleUnassignedCheckedChange}\n ref={(el: HTMLGxgListBoxElement) =>\n (this.unassignedRolesEL = el as HTMLGxgListBoxElement)\n }\n noBorder\n borderBottom\n borderStart\n borderEnd\n >\n {this.unassignedRolesState\n .filter(\n role =>\n this.filterUnassignedInput.toLowerCase() === \"\" ||\n role\n .toLowerCase()\n .includes(this.filterUnassignedInput.toLowerCase())\n )\n .map(role => (\n <gxg-list-box-item\n value={role}\n checkbox\n key={`${role}-${\n this.assignedRolesState.includes(role)\n ? \"assigned\"\n : \"unassigned\"\n }`}\n >\n {role}\n </gxg-list-box-item>\n ))}\n </gxg-list-box>\n </div>\n );\n };\n private renderRolesToRemove = () => {\n return (\n <div class=\"roles__list\">\n <gxg-list-box\n checkboxes\n disabled={false}\n part=\"remove-roles-selection\"\n onCheckedChanged={this.handleAssignedCheckedChange}\n ref={(el: HTMLGxgListBoxElement) =>\n (this.assignedRolesEl = el as HTMLGxgListBoxElement)\n }\n noBorder\n borderBottom\n borderStart\n borderEnd\n >\n {this.assignedRolesState\n .filter(\n role =>\n this.filterAssignedInput.toLowerCase() === \"\" ||\n role\n .toLowerCase()\n .includes(this.filterAssignedInput.toLowerCase())\n )\n .map(role => (\n <gxg-list-box-item\n value={role}\n checkbox\n key={`${role}-${\n this.assignedRolesState.includes(role)\n ? \"assigned\"\n : \"unassigned\"\n }`}\n >\n {role}\n </gxg-list-box-item>\n ))}\n </gxg-list-box>\n </div>\n );\n };\n\n // 10.RENDER() FUNCTION //\n\n render() {\n return (\n <Host class=\"gx-ide-component\">\n <div class=\"gx-ide-main-wrapper\">\n <gx-ide-container\n noAboveFooterPadding\n containerTitle={\n this.displayTitle ? this._componentLocale.componentName : null\n }\n slimmerFooter={config.gxIdeContainer.slimmerFooter}\n >\n <div class=\"roles__container\">\n {/* add roles section */}\n <section class=\"roles__role\">\n {/* roles to add listbox*/}\n <header class=\"roles__list-header\">\n {/* roles to add filter*/}\n <gxg-form-text\n label={this._componentLocale.main.assignRoles.searchRoles}\n placeholder={\n this._componentLocale.main.assignRoles.placeholder\n }\n labelPosition=\"above\"\n clearButton\n part=\"add-roles-filter\"\n class={{ \"add-roles-filter\": true }}\n onInput={this.handleUnassignedInput}\n ></gxg-form-text>\n <div class=\"roles__list-title\">\n <gxg-title type=\"title-04\">\n {this._componentLocale.main.assignRoles.title}\n </gxg-title>\n <gxg-icon\n type=\"navigation/chevron-right\"\n color=\"mercury-neutral\"\n ></gxg-icon>\n </div>\n </header>\n {this.renderRolesToAdd()}\n </section>\n\n {/* remove roles section */}\n <section class=\"roles__role\">\n <header class=\"roles__list-header\">\n {/* roles to remove filter*/}\n <gxg-form-text\n label={this._componentLocale.main.removeRoles.searchRoles}\n placeholder={\n this._componentLocale.main.removeRoles.placeholder\n }\n labelPosition=\"above\"\n clearButton\n part=\"remove-roles-filter\"\n class={{ \"remove-roles-filter\": true }}\n onInput={this.handleAssignedInput}\n ></gxg-form-text>\n <div class=\"roles__list-title\">\n <gxg-icon\n type=\"navigation/chevron-left\"\n color=\"mercury-neutral\"\n ></gxg-icon>\n <gxg-title type=\"title-04\">\n {this._componentLocale.main.removeRoles.title}\n </gxg-title>\n </div>\n </header>\n {/* roles to remove listbox*/}\n {this.renderRolesToRemove()}\n </section>\n </div>\n\n <footer class=\"add-remove-buttons\" slot=\"footer-above\">\n <footer class=\"add-remove-buttons__add\">\n <gxg-button\n id=\"add-all\"\n part=\"add-all-roles-btn\"\n onClick={this.addAll}\n disabled={this.unassignedRolesState.length === 0}\n type=\"secondary-text-only\"\n >\n {this._componentLocale.main.assignRoles.addAllButton}\n </gxg-button>\n <gxg-button\n id=\"add-selected\"\n part=\"add-selected-roles-btn\"\n onClick={this.addSelectedRoles}\n disabled={\n !this.unassignedSelected ||\n !this.unassignedRolesState.length\n }\n type=\"secondary-text-only\"\n >\n {this._componentLocale.main.assignRoles.addSelectedButton}\n </gxg-button>\n </footer>\n <footer class=\"add-remove-buttons__remove\">\n <gxg-button\n id=\"add-all\"\n part=\"remove-all-roles-btn\"\n onClick={this.removeAll}\n disabled={this.assignedRolesState.length === 0}\n type=\"secondary-text-only\"\n >\n {this._componentLocale.main.removeRoles.removeAllButton}\n </gxg-button>\n <gxg-button\n id=\"add-selected\"\n part=\"remove-selected-roles-btn\"\n onClick={this.removeSelectedRoles}\n disabled={\n !this.assignedSelected || !this.assignedRolesState.length\n }\n type=\"secondary-text-only\"\n >\n {this._componentLocale.main.removeRoles.removeSelectedButton}\n </gxg-button>\n </footer>\n </footer>\n\n {/* cancel button*/}\n <gxg-button\n type=\"outlined\"\n slot=\"footer-end\"\n onClick={this.cancelCallbackHandler}\n >\n {this._componentLocale.footer.cancelButton}\n </gxg-button>\n {/* apply button*/}\n <gxg-button slot=\"footer-end\" onClick={this.confirmCallbackHandler}>\n {this._componentLocale.footer.confirmButton}\n </gxg-button>\n </gx-ide-container>\n </div>\n </Host>\n );\n }\n}\n\nexport type ConfirmCallback = (assignedRoles: string[]) => Promise<void>;\n\nexport type CancelCallback = () => Promise<void>;\n"]}
@@ -0,0 +1,24 @@
1
+ {
2
+ "componentName": "Assign Roles",
3
+ "header": {},
4
+ "main": {
5
+ "assignRoles": {
6
+ "title": "Assign Roles",
7
+ "searchRoles": "Search Roles to Add:",
8
+ "placeholder": "Type to filter by role",
9
+ "addAllButton": "Add All",
10
+ "addSelectedButton": "Add Selected"
11
+ },
12
+ "removeRoles": {
13
+ "title": "Remove Roles",
14
+ "searchRoles": "Search Roles to Remove:",
15
+ "placeholder": "Type to filter by role",
16
+ "removeAllButton": "Remove All",
17
+ "removeSelectedButton": "Remove Selected"
18
+ }
19
+ },
20
+ "footer": {
21
+ "confirmButton": "Apply",
22
+ "cancelButton": "Cancel"
23
+ }
24
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "presentation": "「こんにちは、私の名前は {0} です。オレゴンに住んでいます。」"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "presentation": "你好,我的名字是 {0},我住在俄勒冈州。"
3
+ }
@@ -599,6 +599,10 @@ ch-grid-row[selected] gxg-icon[data-action=mercury-primary-disabled] {
599
599
  flex-direction: column;
600
600
  gap: var(--mer-spacing--xs);
601
601
  }
602
+ .modules__server-commands {
603
+ display: flex;
604
+ gap: var(--mer-spacing--xs);
605
+ }
602
606
  .modules__combo {
603
607
  display: flex;
604
608
  flex-direction: row;
@@ -52,10 +52,10 @@ export class GxManageModuleReferences {
52
52
  /**
53
53
  * Change the server selected value in response to callbackServerSelected callback
54
54
  */
55
- this.serverSelectedCallbackHandler = async (id) => {
55
+ this.serverSelectedCallbackHandler = async (id, reload) => {
56
56
  if (this.serverSelectedCallback) {
57
57
  this.loadingServer = true;
58
- const resolvedObjects = await this.serverSelectedCallback(id);
58
+ const resolvedObjects = await this.serverSelectedCallback(id, reload);
59
59
  this.selectedServerId = id;
60
60
  this.modulesAll = [...resolvedObjects];
61
61
  this.filterModulesByType("browse");
@@ -76,6 +76,9 @@ export class GxManageModuleReferences {
76
76
  this.filteredModules = this.modulesAll;
77
77
  }
78
78
  };
79
+ this.handleFilterChangeHandler = (e) => {
80
+ return this.handleFilterChange(e);
81
+ };
79
82
  /**
80
83
  * Perform an action relative to a module using callbackExecuteAction callback and receive the state of that action with onProgress callback
81
84
  */
@@ -84,7 +87,7 @@ export class GxManageModuleReferences {
84
87
  const moduleSelectedVersionId = this.modulesSelectedVersion.get(module.id);
85
88
  const actionCompleted = await this.executeActionCallback(this.selectedServerId, module.id, moduleSelectedVersionId, this.getActionFromCurrentModuleVersion(), this.onProgress);
86
89
  if (actionCompleted) {
87
- this.serverSelectedCallbackHandler(this.selectedServerId);
90
+ this.serverSelectedCallbackHandler(this.selectedServerId, true);
88
91
  }
89
92
  this.actionCompleted = actionCompleted;
90
93
  }
@@ -129,14 +132,15 @@ export class GxManageModuleReferences {
129
132
  }
130
133
  return selectedVersionData;
131
134
  };
135
+ this.moduleActionHandler = () => {
136
+ this.actionCompleted = false;
137
+ this.closeProgressBar = false;
138
+ this.executeActionCallbackHandler(module);
139
+ };
132
140
  this.renderModulesGrid = () => {
133
141
  return (h("gxg-grid", { noBorder: true, fullHeight: true }, h("ch-grid", { rowSelectionMode: "single", part: "ch-grid-pending-commits", class: "servers-detail no-border", onSelectionChanged: this.handleModuleChange }, h("ch-grid-columnset", null, h("ch-grid-column", { settingable: false, size: "min-content" }), h("ch-grid-column", { settingable: false }), h("ch-grid-column", { settingable: false, size: "min-content" })), this.filteredModules.map((module) => (h("ch-grid-row", { rowid: module.id, key: module.id, selected: this.selectedModule && this.selectedModule.id === module.id }, h("ch-grid-cell", null, h("gxg-icon", { type: "objects/module", "data-action": this.moduleVersionIconColor(module), color: this.moduleVersionIconColor(module), size: "small" })), h("ch-grid-cell", { class: "grid-cell-module__info" }, h("span", { class: "grid-cell-module__name" }, this.getModuleData(module, "name")), h("span", { class: "grid-cell-module__description" }, this.getModuleData(module, "description"))), h("ch-grid-cell", null, this.selectedModule && this.selectedModule.id === module.id ? (h("gxg-button", { disabled: !this.actionCompleted ||
134
142
  this.getModuleData(module, "action") === "incompatible" ||
135
- this.getModuleData(module, "action") === "not-installable", fit: true, part: "module-action", onClick: () => {
136
- this.actionCompleted = false;
137
- this.closeProgressBar = false;
138
- this.executeActionCallbackHandler(module);
139
- } }, this.getActionFromCurrentModuleVersion())) : null)))))));
143
+ this.getModuleData(module, "action") === "not-installable", fit: true, part: "module-action", onClick: this.moduleActionHandler }, this.getActionFromCurrentModuleVersion())) : null)))))));
140
144
  };
141
145
  this.renderEmptyStateModules = () => {
142
146
  return (h("gx-ide-empty-state", { stateIcon: "mercury/filters", stateTitle: this._componentLocale.modules.noModulesFilter }));
@@ -167,16 +171,12 @@ export class GxManageModuleReferences {
167
171
  const action = this.getActionFromCurrentModuleVersion();
168
172
  let actionDescription;
169
173
  let cssClass = "module-info__action-container";
170
- if (action === "restore" || action === "update") {
171
- actionDescription = `${this._componentLocale.modulesInformation.moduleProperties.installed}: ${this.selectedModule.currentVersion}`;
172
- cssClass += ` module-info__action-container--installed`;
173
- }
174
- else if (action === "incompatible" || action === "not-installable") {
174
+ if (action === "incompatible" || action === "not-installable") {
175
175
  actionDescription = "Can not be installed";
176
176
  }
177
177
  else {
178
- actionDescription =
179
- this._componentLocale.modulesInformation.moduleProperties.notInstalled;
178
+ cssClass += ` module-info__action-container--installed`;
179
+ actionDescription = `${this._componentLocale.modulesInformation.moduleProperties.installed}: ${this.selectedModule.currentVersion}`;
180
180
  }
181
181
  return (h("div", { class: cssClass }, h("gxg-text", { part: "module-info__action" }, actionDescription)));
182
182
  };
@@ -190,8 +190,8 @@ export class GxManageModuleReferences {
190
190
  };
191
191
  this.updateSelectedModuleVersion = (versionId) => {
192
192
  if (versionId) {
193
- this.selectedModule = Object.assign(Object.assign({}, this.selectedModule), { currentVersion: versionId });
194
193
  this.modulesSelectedVersion.set(this.selectedModule.id, versionId);
194
+ this.reRenderCounter++;
195
195
  }
196
196
  };
197
197
  this.renderModuleVersions = () => {
@@ -204,11 +204,11 @@ export class GxManageModuleReferences {
204
204
  };
205
205
  this.serverItemSelectedHandler = (e) => {
206
206
  const serverId = e.detail.value;
207
- this.serverSelectedCallbackHandler(serverId);
207
+ this.serverSelectedCallbackHandler(serverId, false);
208
208
  };
209
209
  this.serverValueChangedHandler = (e) => {
210
210
  const serverId = e.detail;
211
- this.serverSelectedCallbackHandler(serverId);
211
+ this.serverSelectedCallbackHandler(serverId, false);
212
212
  };
213
213
  this.progressBarCloseHandler = () => {
214
214
  setTimeout(() => {
@@ -220,6 +220,9 @@ export class GxManageModuleReferences {
220
220
  }, 400);
221
221
  // delay to force the footer line disappear after the top-state-bar has been closed.
222
222
  };
223
+ this.reloadServer = () => {
224
+ this.serverSelectedCallbackHandler(this.selectedServerId, true);
225
+ };
223
226
  this.modulesAll = [];
224
227
  this.filteredModules = [];
225
228
  this.selectedModule = undefined;
@@ -235,13 +238,14 @@ export class GxManageModuleReferences {
235
238
  this.progressValue = 0;
236
239
  this.progressState = "in-progress";
237
240
  this.loadingServer = false;
241
+ this.reRenderCounter = 0;
238
242
  this.displayTitle = false;
239
243
  this.servers = [];
240
244
  this.serverSelectedCallback = undefined;
241
245
  this.executeActionCallback = undefined;
242
246
  this.addServerCallback = undefined;
243
247
  this.serverContextMenuCallback = undefined;
244
- this.showServerCommands = true;
248
+ this.showServerCommands = false;
245
249
  }
246
250
  modulesAllWatcher(modulesAll) {
247
251
  this.updateModulesSelectedVersion(modulesAll);
@@ -265,7 +269,7 @@ export class GxManageModuleReferences {
265
269
  this._componentLocale = await Locale.getComponentStrings(this.el);
266
270
  }
267
271
  async componentDidLoad() {
268
- await this.serverSelectedCallbackHandler(this.servers[0].id);
272
+ await this.serverSelectedCallbackHandler(this.servers[0].id, false);
269
273
  }
270
274
  // 7.LISTENERS //
271
275
  onPropValueChange(newModulesData) {
@@ -282,9 +286,7 @@ export class GxManageModuleReferences {
282
286
  render() {
283
287
  return (h(Host, { class: {
284
288
  "gx-ide-component": true
285
- } }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { noContentPadding: true, noAboveFooterPadding: true, noBorderAboveFooter: this.closeProgressBar, part: "servers", containerTitle: this.displayTitle ? this._componentLocale.componentName : null }, h("main", { class: "main" }, h("div", { class: "modules__container" }, h("header", { class: "modules__header" }, h("div", { class: "modules__combo-container" }, h("gxg-label", null, this._componentLocale.modules.selectServer), h("div", { class: "modules__combo" }, h("gxg-combo-box", { disableFilter: true, onValueChanged: this.serverValueChangedHandler }, this.servers.map(item => (h("gxg-combo-box-item", { value: item.id, onItemSelected: this.serverItemSelectedHandler }, item.name)))), this.showServerCommands ? (h("span", { class: "modules__menu-container" }, h("gxg-button", { type: "secondary-icon-only", icon: "gemini-tools/show-more-horizontal", onClick: this.showModuleMenu }))) : null))), h("div", { class: "modules__main" }, h("div", { class: "modules__main-header" }, h("gxg-form-text", { label: this._componentLocale.modules.searchModules, labelPosition: "above", centerLabel: false, onValueChanged: (event) => {
286
- this.handleFilterChange(event.detail);
287
- }, disabled: this.loadingServer }), h("gxg-buttons-container", { reduced: true, fullWidth: true, class: "modules__browser", onSelectedButtonChanged: this.selectedButtonChangedHandler }, h("gxg-button", { id: "btn-browse", selected: true, disabled: this.loadingServer }, this._componentLocale.modules.buttonsContainer.browse), h("gxg-button", { id: "btn-installed", disabled: this.loadingServer }, this._componentLocale.modules.buttonsContainer
289
+ } }, h("div", { class: "gx-ide-main-wrapper" }, h("gx-ide-container", { noContentPadding: true, noAboveFooterPadding: true, noBorderAboveFooter: this.closeProgressBar, part: "servers", containerTitle: this.displayTitle ? this._componentLocale.componentName : null }, h("main", { class: "main" }, h("div", { class: "modules__container" }, h("header", { class: "modules__header" }, h("div", { class: "modules__combo-container" }, h("gxg-label", null, this._componentLocale.modules.selectServer), h("div", { class: "modules__combo" }, h("gxg-combo-box", { disableFilter: true, onValueChanged: this.serverValueChangedHandler }, this.servers.map(item => (h("gxg-combo-box-item", { value: item.id, onItemSelected: this.serverItemSelectedHandler }, item.name)))), this.showServerCommands ? (h("span", { class: "modules__server-commands" }, h("gxg-button", { type: "secondary-icon-only", icon: "gemini-tools/show-more-horizontal", onClick: this.showModuleMenu }), h("gxg-button", { type: "secondary-icon-only", icon: "gemini-tools/reset", onClick: this.reloadServer }))) : null))), h("div", { class: "modules__main" }, h("div", { class: "modules__main-header" }, h("gxg-form-text", { label: this._componentLocale.modules.searchModules, labelPosition: "above", centerLabel: false, onValueChanged: this.handleFilterChangeHandler, disabled: this.loadingServer }), h("gxg-buttons-container", { reduced: true, fullWidth: true, class: "modules__browser", onSelectedButtonChanged: this.selectedButtonChangedHandler }, h("gxg-button", { id: "btn-browse", selected: true, disabled: this.loadingServer }, this._componentLocale.modules.buttonsContainer.browse), h("gxg-button", { id: "btn-installed", disabled: this.loadingServer }, this._componentLocale.modules.buttonsContainer
288
290
  .installed), h("gxg-button", { id: "btn-updates", disabled: this.loadingServer }, this._componentLocale.modules.buttonsContainer.updates))), h("div", { class: "grid-container", ref: el => (this.serversDetail = el) }, this.filteredModules.length > 0
289
291
  ? this.renderModulesGrid()
290
292
  : this.renderEmptyStateModules()))), this.selectedModule ? (h("div", { class: "module-info" }, h("header", { class: "module-info__header" }, this.renderModuleName(), this.renderModuleAlertMessage(), this.renderModuleAction(), this.renderModuleVersions()), h("div", { class: "module-info__properties gxg-scrollbar" }, renderModuleDataProperties(this.getModuleData(this.selectedModule, "properties"))))) : (h("gx-ide-empty-state", { class: "recent-objects__empty-state", stateIcon: "objects/module", stateTitle: this._componentLocale.modulesInformation.emptyState.title, stateDescription: this._componentLocale.modulesInformation.emptyState
@@ -351,7 +353,7 @@ export class GxManageModuleReferences {
351
353
  "mutable": false,
352
354
  "complexType": {
353
355
  "original": "ServerSelectedCallback",
354
- "resolved": "(id: string) => Promise<ModuleData[]>",
356
+ "resolved": "(id: string, reload: boolean) => Promise<ModuleData[]>",
355
357
  "references": {
356
358
  "ServerSelectedCallback": {
357
359
  "location": "local",
@@ -446,7 +448,7 @@ export class GxManageModuleReferences {
446
448
  },
447
449
  "attribute": "show-server-commands",
448
450
  "reflect": false,
449
- "defaultValue": "true"
451
+ "defaultValue": "false"
450
452
  }
451
453
  };
452
454
  }
@@ -462,7 +464,8 @@ export class GxManageModuleReferences {
462
464
  "closeProgressBar": {},
463
465
  "progressValue": {},
464
466
  "progressState": {},
465
- "loadingServer": {}
467
+ "loadingServer": {},
468
+ "reRenderCounter": {}
466
469
  };
467
470
  }
468
471
  static get events() {