@genexus/genexus-ide-ui 1.0.73 → 1.0.74
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/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-bpm-sync-gam-roles.cjs.entry.js +104 -0
- package/dist/cjs/gx-ide-bpm-sync-gam-roles.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/bpm/sync-gam-roles/bpm-sync-gam-roles.css +6 -0
- package/dist/collection/components/bpm/sync-gam-roles/bpm-sync-gam-roles.js +167 -0
- package/dist/collection/components/bpm/sync-gam-roles/bpm-sync-gam-roles.js.map +1 -0
- package/dist/collection/components/bpm/sync-gam-roles/gx-ide-assets/bpm-sync-gam-roles/langs/bpm-sync-gam-roles.lang.en.json +18 -0
- package/dist/collection/components/bpm/sync-gam-roles/gx-ide-assets/bpm-sync-gam-roles/langs/bpm-sync-gam-roles.lang.ja.json +18 -0
- package/dist/collection/components/bpm/sync-gam-roles/gx-ide-assets/bpm-sync-gam-roles/langs/bpm-sync-gam-roles.lang.zh.json +18 -0
- package/dist/collection/components/bpm/sync-gam-roles/gx-ide-assets/bpm-sync-gam-roles/shortcuts.json +15 -0
- package/dist/collection/components/bpm/sync-gam-roles/helpers.js +12 -0
- package/dist/collection/components/bpm/sync-gam-roles/helpers.js.map +1 -0
- package/dist/collection/testing/locale.e2e.js +1 -0
- package/dist/collection/testing/locale.e2e.js.map +1 -1
- package/dist/components/gx-ide-bpm-sync-gam-roles.d.ts +11 -0
- package/dist/components/gx-ide-bpm-sync-gam-roles.js +122 -0
- package/dist/components/gx-ide-bpm-sync-gam-roles.js.map +1 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-bpm-sync-gam-roles.entry.js +100 -0
- package/dist/esm/gx-ide-bpm-sync-gam-roles.entry.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-sync-gam-roles/langs/bpm-sync-gam-roles.lang.en.json +18 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-sync-gam-roles/langs/bpm-sync-gam-roles.lang.ja.json +18 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-sync-gam-roles/langs/bpm-sync-gam-roles.lang.zh.json +18 -0
- package/dist/genexus-ide-ui/gx-ide-assets/bpm-sync-gam-roles/shortcuts.json +15 -0
- package/dist/genexus-ide-ui/p-ded7444c.entry.js +136 -0
- package/dist/genexus-ide-ui/p-ded7444c.entry.js.map +1 -0
- package/dist/types/components/bpm/sync-gam-roles/bpm-sync-gam-roles.d.ts +23 -0
- package/dist/types/components/bpm/sync-gam-roles/helpers.d.ts +2 -0
- package/dist/types/components.d.ts +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f)
|
|
3
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
5
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
6
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var _GxIdeBpmSyncGamRoles__componentLocale, _GxIdeBpmSyncGamRoles_shortcutsSrc, _GxIdeBpmSyncGamRoles_synchronizationTypes, _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl, _GxIdeBpmSyncGamRoles_chShortcutsEl, _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl, _GxIdeBpmSyncGamRoles_cancelButtonHandler, _GxIdeBpmSyncGamRoles_okButtonHandler, _GxIdeBpmSyncGamRoles_renderFooter;
|
|
18
|
+
import { Host, h, getAssetPath } from "@stencil/core";
|
|
19
|
+
import { Locale } from "../../../common/locale";
|
|
20
|
+
import { mapTypesToComboBoxItemModel } from "./helpers";
|
|
21
|
+
const CSS_BUNDLES = [
|
|
22
|
+
"resets/box-sizing",
|
|
23
|
+
"components/tooltip",
|
|
24
|
+
"utils/form--full",
|
|
25
|
+
"utils/layout",
|
|
26
|
+
"utils/typography",
|
|
27
|
+
"utils/spacing",
|
|
28
|
+
"chameleon/scrollbar"
|
|
29
|
+
];
|
|
30
|
+
export class GxIdeBpmSyncGamRoles {
|
|
31
|
+
constructor() {
|
|
32
|
+
_GxIdeBpmSyncGamRoles__componentLocale.set(this, void 0);
|
|
33
|
+
_GxIdeBpmSyncGamRoles_shortcutsSrc.set(this, getAssetPath(`./gx-ide-assets/bpm-sync-gam-roles/shortcuts.json`));
|
|
34
|
+
_GxIdeBpmSyncGamRoles_synchronizationTypes.set(this, []);
|
|
35
|
+
_GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl.set(this, void 0);
|
|
36
|
+
_GxIdeBpmSyncGamRoles_chShortcutsEl.set(this, void 0);
|
|
37
|
+
_GxIdeBpmSyncGamRoles_synchTypeComboBoxEl.set(this, void 0);
|
|
38
|
+
_GxIdeBpmSyncGamRoles_cancelButtonHandler.set(this, () => {
|
|
39
|
+
if (this.cancelCallback) {
|
|
40
|
+
this.cancelCallback();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
_GxIdeBpmSyncGamRoles_okButtonHandler.set(this, async () => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (this.saveCallback) {
|
|
46
|
+
const syncData = {
|
|
47
|
+
automaticBackup: !!((_a = __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl, "f")) === null || _a === void 0 ? void 0 : _a.value),
|
|
48
|
+
syncType: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl, "f").value
|
|
49
|
+
};
|
|
50
|
+
await this.saveCallback(syncData);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
_GxIdeBpmSyncGamRoles_renderFooter.set(this, () => {
|
|
54
|
+
return (h("footer", { class: "control-footer control-footer-with-border spacing-body-block-end spacing-body-inline" }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", id: "button-cancel", onClick: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_cancelButtonHandler, "f"), part: "button-cancel" }, __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").footer.cancelButtonText), h("button", { class: "button-primary", id: "button-create", onClick: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_okButtonHandler, "f"), part: "button-ok" }, __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").footer.okButtonText))));
|
|
55
|
+
});
|
|
56
|
+
this.cancelCallback = undefined;
|
|
57
|
+
this.saveCallback = undefined;
|
|
58
|
+
}
|
|
59
|
+
async componentWillLoad() {
|
|
60
|
+
__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles__componentLocale, await Locale.getComponentStrings(this.el), "f");
|
|
61
|
+
__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_synchronizationTypes, mapTypesToComboBoxItemModel(__classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").main.synchronizationTypeOptions), "f");
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Suspends or reactivates the shortcuts
|
|
65
|
+
*/
|
|
66
|
+
async suspendShortcuts(suspendShortcuts) {
|
|
67
|
+
if (suspendShortcuts) {
|
|
68
|
+
__classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_chShortcutsEl, "f").suspend = true;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
__classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_chShortcutsEl, "f").suspend = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_chShortcutsEl, el, "f")) }), h("section", { class: "section spacing-body" }, h("div", { class: "main field-group" }, h("div", { class: "field field-block" }, h("label", { class: "label", htmlFor: "synch-type" }, __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").main.synchronizationTypeLabel), h("ch-combo-box-render", { accessibleName: "Synchronization types", class: "combo-box", id: "synch-type", value: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_synchronizationTypes, "f")[0].caption, model: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_synchronizationTypes, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl, el, "f")) })), h("ch-checkbox", { class: "checkbox", caption: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").main.checkBoxLabel, checkedValue: "true", ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl, el, "f")) }))), __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_renderFooter, "f").call(this)));
|
|
76
|
+
}
|
|
77
|
+
static get is() { return "gx-ide-bpm-sync-gam-roles"; }
|
|
78
|
+
static get encapsulation() { return "shadow"; }
|
|
79
|
+
static get originalStyleUrls() {
|
|
80
|
+
return {
|
|
81
|
+
"$": ["bpm-sync-gam-roles.scss"]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
static get styleUrls() {
|
|
85
|
+
return {
|
|
86
|
+
"$": ["bpm-sync-gam-roles.css"]
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
static get assetsDirs() { return ["gx-ide-assets/bpm-sync-gam-roles"]; }
|
|
90
|
+
static get properties() {
|
|
91
|
+
return {
|
|
92
|
+
"cancelCallback": {
|
|
93
|
+
"type": "unknown",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "() => Promise<void>",
|
|
97
|
+
"resolved": "() => Promise<void>",
|
|
98
|
+
"references": {
|
|
99
|
+
"Promise": {
|
|
100
|
+
"location": "global",
|
|
101
|
+
"id": "global::Promise"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": "Callback invoked when the user press the 'Cancel' button"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"saveCallback": {
|
|
113
|
+
"type": "unknown",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "(syncData: SyncData) => Promise<boolean>",
|
|
117
|
+
"resolved": "(syncData: SyncData) => Promise<boolean>",
|
|
118
|
+
"references": {
|
|
119
|
+
"SyncData": {
|
|
120
|
+
"location": "local",
|
|
121
|
+
"path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/sync-gam-roles/bpm-sync-gam-roles.tsx",
|
|
122
|
+
"id": "src/components/bpm/sync-gam-roles/bpm-sync-gam-roles.tsx::SyncData"
|
|
123
|
+
},
|
|
124
|
+
"Promise": {
|
|
125
|
+
"location": "global",
|
|
126
|
+
"id": "global::Promise"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": "Callback invoked when the user press the 'Ok' button"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static get methods() {
|
|
140
|
+
return {
|
|
141
|
+
"suspendShortcuts": {
|
|
142
|
+
"complexType": {
|
|
143
|
+
"signature": "(suspendShortcuts: boolean) => Promise<void>",
|
|
144
|
+
"parameters": [{
|
|
145
|
+
"name": "suspendShortcuts",
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"docs": ""
|
|
148
|
+
}],
|
|
149
|
+
"references": {
|
|
150
|
+
"Promise": {
|
|
151
|
+
"location": "global",
|
|
152
|
+
"id": "global::Promise"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"return": "Promise<void>"
|
|
156
|
+
},
|
|
157
|
+
"docs": {
|
|
158
|
+
"text": "Suspends or reactivates the shortcuts",
|
|
159
|
+
"tags": []
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
static get elementRef() { return "el"; }
|
|
165
|
+
}
|
|
166
|
+
_GxIdeBpmSyncGamRoles__componentLocale = new WeakMap(), _GxIdeBpmSyncGamRoles_shortcutsSrc = new WeakMap(), _GxIdeBpmSyncGamRoles_synchronizationTypes = new WeakMap(), _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl = new WeakMap(), _GxIdeBpmSyncGamRoles_chShortcutsEl = new WeakMap(), _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl = new WeakMap(), _GxIdeBpmSyncGamRoles_cancelButtonHandler = new WeakMap(), _GxIdeBpmSyncGamRoles_okButtonHandler = new WeakMap(), _GxIdeBpmSyncGamRoles_renderFooter = new WeakMap();
|
|
167
|
+
//# sourceMappingURL=bpm-sync-gam-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bpm-sync-gam-roles.js","sourceRoot":"","sources":["../../../../src/components/bpm/sync-gam-roles/bpm-sync-gam-roles.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,YAAY,EACZ,MAAM,EACN,IAAI,EACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,eAAe;IACf,qBAAqB;CACtB,CAAC;AAQF,MAAM,OAAO,oBAAoB;;QAC/B,yDAAuB;QACvB,6CAAgB,YAAY,CAC1B,mDAAmD,CACpD,EAAC;QACF,qDAA6C,EAAE,EAAC;QAGhD,kEAAkD;QAClD,sDAAuC;QACvC,4DAAkD;QA+BlD,oDAAuB,GAAG,EAAE;YAC1B,IAAI,IAAI,CAAC,cAAc,EAAE;gBACvB,IAAI,CAAC,cAAc,EAAE,CAAC;aACvB;QACH,CAAC,EAAC;QACF,gDAAmB,KAAK,IAAI,EAAE;;YAC5B,IAAI,IAAI,CAAC,YAAY,EAAE;gBACrB,MAAM,QAAQ,GAAa;oBACzB,eAAe,EAAE,CAAC,CAAC,CAAA,MAAA,uBAAA,IAAI,uDAA2B,0CAAE,KAAK,CAAA;oBACzD,QAAQ,EAAE,uBAAA,IAAI,iDAAqB,CAAC,KAAiB;iBACtD,CAAC;gBAEF,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACnC;QACH,CAAC,EAAC;QAEF,6CAAgB,GAAG,EAAE;YACnB,OAAO,CACL,cA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AC,kBAAkB;oBAC3B,WAAK,KAAK,EAAC,mBAAmB;wBAC5B,aAAO,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,YAAY,IACtC,uBAAA,IAAI,8CAAkB,CAAC,IAAI,CAAC,wBAAwB,CAC/C;wBACR,2BACE,cAAc,EAAC,uBAAuB,EACtC,KAAK,EAAC,WAAW,EACjB,EAAE,EAAC,YAAY,EACf,KAAK,EAAE,uBAAA,IAAI,kDAAsB,CAAC,CAAC,CAAC,CAAC,OAAO,EAC5C,KAAK,EAAE,uBAAA,IAAI,kDAAsB,EACjC,GAAG,EAAE,CAAC,EAA+B,EAAE,EAAE,CACvC,CAAC,uBAAA,IAAI,6CACH,EAAiC,MAAA,CAAC,GAEjB,CACnB;oBAEN,mBACE,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,uBAAA,IAAI,8CAAkB,CAAC,IAAI,CAAC,aAAa,EAClD,YAAY,EAAC,MAAM,EACnB,GAAG,EAAE,CAAC,EAAyB,EAAE,EAAE,CACjC,CAAC,uBAAA,IAAI,mDAA8B,EAA2B,MAAA,CAAC,GAEpD,CACX,CACE;YACT,uBAAA,IAAI,0CAAc,MAAlB,IAAI,CAAgB,CAChB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n getAssetPath,\n Method,\n Prop\n} from \"@stencil/core\";\nimport { Locale } from \"../../../common/locale\";\nimport { MercuryBundles } from \"@genexus/mercury\";\nimport { ComboBoxItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/combo-box/types\";\nimport { mapTypesToComboBoxItemModel } from \"./helpers\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\n@Component({\n tag: \"gx-ide-bpm-sync-gam-roles\",\n styleUrl: \"bpm-sync-gam-roles.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-sync-gam-roles\"]\n})\nexport class GxIdeBpmSyncGamRoles {\n #_componentLocale: any;\n #shortcutsSrc = getAssetPath(\n `./gx-ide-assets/bpm-sync-gam-roles/shortcuts.json`\n );\n #synchronizationTypes: ComboBoxItemModel[] = [];\n\n @Element() el: HTMLGxIdeBpmSyncGamRolesElement;\n #automaticBackupCheckBoxEl: HTMLChCheckboxElement;\n #chShortcutsEl: HTMLChShortcutsElement;\n #synchTypeComboBoxEl: HTMLChComboBoxRenderElement;\n\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n this.#synchronizationTypes = mapTypesToComboBoxItemModel(\n this.#_componentLocale.main.synchronizationTypeOptions\n );\n }\n\n /**\n * Callback invoked when the user press the 'Cancel' button\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n /**\n * Callback invoked when the user press the 'Ok' button\n */\n @Prop() readonly saveCallback: (syncData: SyncData) => Promise<boolean>;\n\n /**\n * Suspends or reactivates the shortcuts\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n if (suspendShortcuts) {\n this.#chShortcutsEl.suspend = true;\n } else {\n this.#chShortcutsEl.suspend = false;\n }\n }\n\n #cancelButtonHandler = () => {\n if (this.cancelCallback) {\n this.cancelCallback();\n }\n };\n #okButtonHandler = async () => {\n if (this.saveCallback) {\n const syncData: SyncData = {\n automaticBackup: !!this.#automaticBackupCheckBoxEl?.value,\n syncType: this.#synchTypeComboBoxEl.value as SyncType\n };\n\n await this.saveCallback(syncData);\n }\n };\n\n #renderFooter = () => {\n return (\n <footer class=\"control-footer control-footer-with-border spacing-body-block-end spacing-body-inline\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n onClick={this.#cancelButtonHandler}\n part=\"button-cancel\"\n >\n {this.#_componentLocale.footer.cancelButtonText}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-create\"\n onClick={this.#okButtonHandler}\n part=\"button-ok\"\n >\n {this.#_componentLocale.footer.okButtonText}\n </button>\n </div>\n </footer>\n );\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section spacing-body\">\n <div class=\"main field-group\">\n <div class=\"field field-block\">\n <label class=\"label\" htmlFor=\"synch-type\">\n {this.#_componentLocale.main.synchronizationTypeLabel}\n </label>\n <ch-combo-box-render\n accessibleName=\"Synchronization types\"\n class=\"combo-box\"\n id=\"synch-type\"\n value={this.#synchronizationTypes[0].caption}\n model={this.#synchronizationTypes}\n ref={(el: HTMLChComboBoxRenderElement) =>\n (this.#synchTypeComboBoxEl =\n el as HTMLChComboBoxRenderElement)\n }\n ></ch-combo-box-render>\n </div>\n\n <ch-checkbox\n class=\"checkbox\"\n caption={this.#_componentLocale.main.checkBoxLabel}\n checkedValue=\"true\"\n ref={(el: HTMLChCheckboxElement) =>\n (this.#automaticBackupCheckBoxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </div>\n </section>\n {this.#renderFooter()}\n </Host>\n );\n }\n}\n\nexport type SyncType = \"From GAM\" | \"To GAM\" | \"Both\";\n\nexport type SyncData = {\n syncType: SyncType;\n automaticBackup: boolean;\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": {
|
|
3
|
+
"synchronizationTypeLabel": "Synchronization type",
|
|
4
|
+
"synchronizationTypeOptions": [
|
|
5
|
+
{ "value": "fromGam", "caption": "From GAM" },
|
|
6
|
+
{
|
|
7
|
+
"value": "toGam",
|
|
8
|
+
"caption": "To GAM"
|
|
9
|
+
},
|
|
10
|
+
{ "value": "both", "caption": "Both" }
|
|
11
|
+
],
|
|
12
|
+
"checkBoxLabel": "Automatic backup"
|
|
13
|
+
},
|
|
14
|
+
"footer": {
|
|
15
|
+
"okButtonText": "OK",
|
|
16
|
+
"cancelButtonText": "Cancel"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": {
|
|
3
|
+
"synchronizationTypeLabel": "",
|
|
4
|
+
"synchronizationTypeOptions": [
|
|
5
|
+
{ "value": "", "caption": "" },
|
|
6
|
+
{
|
|
7
|
+
"value": "",
|
|
8
|
+
"caption": ""
|
|
9
|
+
},
|
|
10
|
+
{ "value": "", "caption": "" }
|
|
11
|
+
],
|
|
12
|
+
"checkBoxLabel": ""
|
|
13
|
+
},
|
|
14
|
+
"footer": {
|
|
15
|
+
"okButtonText": "",
|
|
16
|
+
"cancelButtonText": ""
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": {
|
|
3
|
+
"synchronizationTypeLabel": "",
|
|
4
|
+
"synchronizationTypeOptions": [
|
|
5
|
+
{ "value": "", "caption": "" },
|
|
6
|
+
{
|
|
7
|
+
"value": "",
|
|
8
|
+
"caption": ""
|
|
9
|
+
},
|
|
10
|
+
{ "value": "", "caption": "" }
|
|
11
|
+
],
|
|
12
|
+
"checkBoxLabel": ""
|
|
13
|
+
},
|
|
14
|
+
"footer": {
|
|
15
|
+
"okButtonText": "",
|
|
16
|
+
"cancelButtonText": ""
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"selector": "[part='button-ok']",
|
|
4
|
+
"keyShortcuts": "Enter",
|
|
5
|
+
"action": "click",
|
|
6
|
+
"conditions": {
|
|
7
|
+
"focusExclude": "[part='button-cancel']"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"selector": "[part='button-cancel']",
|
|
12
|
+
"keyShortcuts": "Escape",
|
|
13
|
+
"action": "click"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const mapTypesToComboBoxItemModel = (synchronizationTypes) => {
|
|
2
|
+
const syncTypes = [];
|
|
3
|
+
synchronizationTypes.forEach(synchronizationType => {
|
|
4
|
+
const newSynchType = {
|
|
5
|
+
value: synchronizationType.value,
|
|
6
|
+
caption: synchronizationType.caption
|
|
7
|
+
};
|
|
8
|
+
syncTypes.push(newSynchType);
|
|
9
|
+
});
|
|
10
|
+
return syncTypes;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/components/bpm/sync-gam-roles/helpers.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,oBAA2B,EACN,EAAE;IACvB,MAAM,SAAS,GAAwB,EAAE,CAAC;IAE1C,oBAAoB,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE;QACjD,MAAM,YAAY,GAAsB;YACtC,KAAK,EAAE,mBAAmB,CAAC,KAAK;YAChC,OAAO,EAAE,mBAAmB,CAAC,OAAO;SACrC,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { ComboBoxItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/combo-box/types\";\n\nexport const mapTypesToComboBoxItemModel = (\n synchronizationTypes: any[]\n): ComboBoxItemModel[] => {\n const syncTypes: ComboBoxItemModel[] = [];\n\n synchronizationTypes.forEach(synchronizationType => {\n const newSynchType: ComboBoxItemModel = {\n value: synchronizationType.value,\n caption: synchronizationType.caption\n };\n syncTypes.push(newSynchType);\n });\n return syncTypes;\n};\n"]}
|
|
@@ -91,6 +91,7 @@ const allGeneXusIdeUIComponents = {
|
|
|
91
91
|
"gx-ide-bpm-import-files": 0,
|
|
92
92
|
"gx-ide-bpm-import-gxpm": 0,
|
|
93
93
|
"gx-ide-bpm-objects-selector": 0,
|
|
94
|
+
"gx-ide-bpm-sync-gam-roles": 0,
|
|
94
95
|
"gx-ide-bpm-task-documents": 0,
|
|
95
96
|
"gx-ide-bpm-timer-duration": 0,
|
|
96
97
|
"gx-ide-card": 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.e2e.js","sourceRoot":"","sources":["../../src/testing/locale.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,SAAS,GAAqC;IAClD,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;CACjC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,uBAAoD,EAAE,EAAE;IAC1E,QAAQ,CAAC,YAAY,uBAAuB,GAAG,EAAE,GAAG,EAAE;QACpD,IAAI,IAAa,CAAC;QAClB,MAAM,aAAa,GAAG,uBAAuB,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAE5E,8EAA8E;QAC9E,2EAA2E;QAC3E,cAAc;QACd,MAAM,eAAe,GAAG,GAAG,EAAE,CAC3B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;;YACxB,MAAM,aAAa,GAAG,gBAAgB,CAAC;YACvC,MAAM,gBAAgB,GAAG,IAAI,CAAC;YAC9B,MAA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zB,iBAAiB,EAAE,CAAC;IACpB,0BAA0B,EAAE,CAAC;IAC7B,eAAe,EAAE,CAAC;IAClB,qBAAqB,EAAE,CAAC;IACxB,wBAAwB,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAA8B;IACzE,mBAAmB;IACnB,uBAAuB;IACvB,kBAAkB;IAClB,0BAA0B;IAC1B,2BAA2B;IAC3B,oBAAoB;IACpB,sBAAsB;IACtB,2BAA2B;IAC3B,eAAe;IACf,qBAAqB;IACrB,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,0BAA0B,GAAG,MAAM,CAAC,IAAI,CAC5C,yBAAyB,CAC1B,CAAC,MAAM,CACN,SAAS,CAAC,EAAE,CACV,CAAC,6BAA6B,CAAC,GAAG,CAAC,SAAwC,CAAC,CAC/E,CAAC;AAEF,0BAA0B,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { E2EPage, newE2EPage } from \"@stencil/core/testing\";\nimport { GeneXusIdeUIControlsTagName } from \"../common/types\";\nimport { haveSameStructure } from \"./same-structure.e2e\";\n\nconst COMPONENT_PREFIX = \"gx-ide-\";\nconst languages: { name: string; attr: string }[] = [\n { name: \"chinese\", attr: \"zh\" },\n { name: \"english\", attr: \"en\" },\n { name: \"japanese\", attr: \"ja\" }\n];\n\nconst testLocale = (componentNameWithPrefix: GeneXusIdeUIControlsTagName) => {\n describe(`[locale][${componentNameWithPrefix}]`, () => {\n let page: E2EPage;\n const componentName = componentNameWithPrefix.replace(COMPONENT_PREFIX, \"\");\n\n // This implementation is a WA since we can't evaluate JS classes in the page.\n // TODO: Implement the locale utility as a function, which can be evaluated\n // in the page\n const getTranslations = () =>\n page.evaluate(component => {\n const ASSETS_FOLDER = \"gx-ide-assets/\";\n const DEFAULT_LANGUAGE = \"en\";\n const LANGS_FOLDER = \"langs/\";\n const LANG_PREFIX = \".lang.\";\n const LANG_EXTENSION = \".json\";\n const lang =\n document\n .getElementsByTagName(\"html\")[0]\n .getAttribute(\"lang\")\n ?.valueOf() ?? DEFAULT_LANGUAGE;\n const folder = `${component}/`;\n\n const path =\n `/build/${ASSETS_FOLDER}${folder}${LANGS_FOLDER}${component}${LANG_PREFIX}${lang}${LANG_EXTENSION}` as const;\n\n return new Promise(resolve => {\n fetch(path)\n .then(async langFile => {\n if (langFile.ok) {\n const fileObject = await langFile.json();\n resolve(fileObject);\n } else {\n resolve(undefined);\n }\n })\n .catch(() => resolve(undefined));\n });\n }, componentName);\n\n beforeEach(async () => {\n page = await newE2EPage({\n failOnConsoleError: true,\n html: \"\" // Necessary\n });\n });\n\n it(\"should work without specifying the language (lang attr) in the browser\", async () => {\n const languageFile: any | undefined = await getTranslations();\n expect(languageFile).toBeTruthy();\n });\n\n it(\"should default to english language when there is no language (lang attr) in the browser\", async () => {\n const languageFile: any | undefined = await getTranslations();\n expect(languageFile).toBeTruthy();\n\n await page.evaluate(() =>\n document.documentElement.setAttribute(\"lang\", \"en\")\n );\n\n const languageEnglishFile: any | undefined = await getTranslations();\n expect(languageEnglishFile).toBeTruthy();\n expect(languageFile).toEqual(languageEnglishFile);\n });\n\n languages.forEach(language => {\n it(`should work with ${language.name} language`, async () => {\n await page.evaluate(\n (attr: string) => document.documentElement.setAttribute(\"lang\", attr),\n language.attr\n );\n const languageFile: any | undefined = await getTranslations();\n expect(languageFile).toBeTruthy();\n });\n });\n\n for (let index = 0; index < languages.length - 1; index++) {\n const language1 = languages[index];\n const language2 = languages[index + 1];\n\n // TODO: Complete all translations. At this moment, Japanese and Chinese\n // translations have missing literals\n it(`should translate the same literals (${language1.name} and ${language2.name})`, async () => {\n await page.evaluate(\n (attr: string) => document.documentElement.setAttribute(\"lang\", attr),\n language1.attr\n );\n const language1File: any | undefined = await getTranslations();\n\n await page.evaluate(\n (attr: string) => document.documentElement.setAttribute(\"lang\", attr),\n language2.attr\n );\n const language2File: any | undefined = await getTranslations();\n\n expect(language1File).toBeTruthy();\n expect(language2File).toBeTruthy();\n expect(haveSameStructure(language1File, language2File)).toBe(true);\n });\n }\n });\n};\n\n// TypeScript does not have a built-in type to exhaust a list with union types\nconst allGeneXusIdeUIComponents: { [key in GeneXusIdeUIControlsTagName]: 0 } = {\n \"gx-ide-about\": 0,\n \"gx-ide-ai-assistant\": 0,\n \"gx-ide-ai-message\": 0,\n \"gx-ide-bpm-app-declaration\": 0,\n \"gx-ide-bpm-assign-roles\": 0,\n \"gx-ide-bpm-import-files\": 0,\n \"gx-ide-bpm-import-gxpm\": 0,\n \"gx-ide-bpm-objects-selector\": 0,\n \"gx-ide-bpm-task-documents\": 0,\n \"gx-ide-bpm-timer-duration\": 0,\n \"gx-ide-card\": 0,\n \"gx-ide-chat-container\": 0,\n \"gx-ide-sc-chat-container\": 0,\n \"gx-ide-connect-gx-server\": 0,\n \"gx-ide-container\": 0,\n \"gx-ide-create-kb-from-server\": 0,\n \"gx-ide-current-user-info\": 0,\n \"gx-ide-dashboard-home\": 0,\n \"gx-ide-data-selector\": 0,\n \"gx-ide-data-type-selector\": 0,\n \"gx-ide-design-import\": 0,\n \"gx-ide-directory-selector\": 0,\n \"gx-ide-edit-module-server\": 0,\n \"gx-ide-empty-state\": 0,\n \"gx-ide-entity-selector\": 0,\n \"gx-ide-gam-installation-settings\": 0,\n \"gx-ide-kb-manager-export\": 0,\n \"gx-ide-kb-manager-import\": 0,\n \"gx-ide-list-selector\": 0,\n \"gx-ide-list-selector-item\": 0,\n \"gx-ide-loader\": 0,\n \"gx-ide-manage-module-references\": 0,\n \"gx-ide-manage-module-references-v2\": 0,\n \"gx-ide-new-environment\": 0,\n \"gx-ide-new-kb\": 0,\n \"gx-ide-new-object\": 0,\n \"gx-ide-new-version\": 0,\n \"gx-ide-object-selector\": 0,\n \"gx-ide-references\": 0,\n \"gx-ide-select-kb-items\": 0,\n \"gx-ide-select-user-team\": 0,\n \"gx-ide-sign-in\": 0,\n \"gx-ide-sign-in-team\": 0,\n \"gx-ide-share-kb\": 0,\n \"gx-ide-start-page\": 0,\n \"gx-ide-status-buttons\": 0,\n \"gx-ide-switch-panel\": 0,\n \"gx-ide-switcher\": 0,\n \"gx-ide-team-dev-commit\": 0,\n \"gx-ide-team-dev-select-recent-comment\": 0,\n \"gx-ide-team-dev-update\": 0,\n \"gx-ide-team-dev-update-partial-selection\": 0,\n \"gx-ide-team-dev-update-to-revision\": 0,\n \"gx-ide-template\": 0,\n \"gx-ide-test\": 0,\n \"gx-ide-title\": 0,\n \"gx-ide-top-bar\": 0,\n \"gx-ide-wf-settings\": 0,\n \"gx-ide-ww-images\": 0,\n \"gx-ide-ww-attributes\": 0,\n \"gx-ide-ww-files\": 0,\n \"gx-ide-navigation-report\": 0,\n \"gx-ide-splash\": 0,\n \"gx-ide-welcome-page\": 0,\n \"gx-ide-bpm-export-xpdl\": 0\n};\n\nconst componentsWithoutTranslations = new Set<GeneXusIdeUIControlsTagName>([\n \"gx-ide-ai-message\",\n \"gx-ide-chat-container\",\n \"gx-ide-container\",\n \"gx-ide-sc-chat-container\",\n \"gx-ide-directory-selector\",\n \"gx-ide-empty-state\",\n \"gx-ide-list-selector\",\n \"gx-ide-list-selector-item\",\n \"gx-ide-loader\",\n \"gx-ide-switch-panel\",\n \"gx-ide-switcher\",\n \"gx-ide-test\",\n \"gx-ide-title\",\n \"gx-ide-top-bar\"\n]);\n\nconst componentsWithTranslations = Object.keys(\n allGeneXusIdeUIComponents\n).filter(\n component =>\n !componentsWithoutTranslations.has(component as GeneXusIdeUIControlsTagName)\n);\n\ncomponentsWithTranslations.forEach(testLocale);\n"]}
|
|
1
|
+
{"version":3,"file":"locale.e2e.js","sourceRoot":"","sources":["../../src/testing/locale.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,gBAAgB,GAAG,SAAS,CAAC;A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AC,CAC/E,CAAC;AAEF,0BAA0B,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { E2EPage, newE2EPage } from \"@stencil/core/testing\";\nimport { GeneXusIdeUIControlsTagName } from \"../common/types\";\nimport { haveSameStructure } from \"./same-structure.e2e\";\n\nconst COMPONENT_PREFIX = \"gx-ide-\";\nconst languages: { name: string; attr: string }[] = [\n { name: \"chinese\", attr: \"zh\" },\n { name: \"english\", attr: \"en\" },\n { name: \"japanese\", attr: \"ja\" }\n];\n\nconst testLocale = (componentNameWithPrefix: GeneXusIdeUIControlsTagName) => {\n describe(`[locale][${componentNameWithPrefix}]`, () => {\n let page: E2EPage;\n const componentName = componentNameWithPrefix.replace(COMPONENT_PREFIX, \"\");\n\n // This implementation is a WA since we can't evaluate JS classes in the page.\n // TODO: Implement the locale utility as a function, which can be evaluated\n // in the page\n const getTranslations = () =>\n page.evaluate(component => {\n const ASSETS_FOLDER = \"gx-ide-assets/\";\n const DEFAULT_LANGUAGE = \"en\";\n const LANGS_FOLDER = \"langs/\";\n const LANG_PREFIX = \".lang.\";\n const LANG_EXTENSION = \".json\";\n const lang =\n document\n .getElementsByTagName(\"html\")[0]\n .getAttribute(\"lang\")\n ?.valueOf() ?? DEFAULT_LANGUAGE;\n const folder = `${component}/`;\n\n const path =\n `/build/${ASSETS_FOLDER}${folder}${LANGS_FOLDER}${component}${LANG_PREFIX}${lang}${LANG_EXTENSION}` as const;\n\n return new Promise(resolve => {\n fetch(path)\n .then(async langFile => {\n if (langFile.ok) {\n const fileObject = await langFile.json();\n resolve(fileObject);\n } else {\n resolve(undefined);\n }\n })\n .catch(() => resolve(undefined));\n });\n }, componentName);\n\n beforeEach(async () => {\n page = await newE2EPage({\n failOnConsoleError: true,\n html: \"\" // Necessary\n });\n });\n\n it(\"should work without specifying the language (lang attr) in the browser\", async () => {\n const languageFile: any | undefined = await getTranslations();\n expect(languageFile).toBeTruthy();\n });\n\n it(\"should default to english language when there is no language (lang attr) in the browser\", async () => {\n const languageFile: any | undefined = await getTranslations();\n expect(languageFile).toBeTruthy();\n\n await page.evaluate(() =>\n document.documentElement.setAttribute(\"lang\", \"en\")\n );\n\n const languageEnglishFile: any | undefined = await getTranslations();\n expect(languageEnglishFile).toBeTruthy();\n expect(languageFile).toEqual(languageEnglishFile);\n });\n\n languages.forEach(language => {\n it(`should work with ${language.name} language`, async () => {\n await page.evaluate(\n (attr: string) => document.documentElement.setAttribute(\"lang\", attr),\n language.attr\n );\n const languageFile: any | undefined = await getTranslations();\n expect(languageFile).toBeTruthy();\n });\n });\n\n for (let index = 0; index < languages.length - 1; index++) {\n const language1 = languages[index];\n const language2 = languages[index + 1];\n\n // TODO: Complete all translations. At this moment, Japanese and Chinese\n // translations have missing literals\n it(`should translate the same literals (${language1.name} and ${language2.name})`, async () => {\n await page.evaluate(\n (attr: string) => document.documentElement.setAttribute(\"lang\", attr),\n language1.attr\n );\n const language1File: any | undefined = await getTranslations();\n\n await page.evaluate(\n (attr: string) => document.documentElement.setAttribute(\"lang\", attr),\n language2.attr\n );\n const language2File: any | undefined = await getTranslations();\n\n expect(language1File).toBeTruthy();\n expect(language2File).toBeTruthy();\n expect(haveSameStructure(language1File, language2File)).toBe(true);\n });\n }\n });\n};\n\n// TypeScript does not have a built-in type to exhaust a list with union types\nconst allGeneXusIdeUIComponents: { [key in GeneXusIdeUIControlsTagName]: 0 } = {\n \"gx-ide-about\": 0,\n \"gx-ide-ai-assistant\": 0,\n \"gx-ide-ai-message\": 0,\n \"gx-ide-bpm-app-declaration\": 0,\n \"gx-ide-bpm-assign-roles\": 0,\n \"gx-ide-bpm-import-files\": 0,\n \"gx-ide-bpm-import-gxpm\": 0,\n \"gx-ide-bpm-objects-selector\": 0,\n \"gx-ide-bpm-sync-gam-roles\": 0,\n \"gx-ide-bpm-task-documents\": 0,\n \"gx-ide-bpm-timer-duration\": 0,\n \"gx-ide-card\": 0,\n \"gx-ide-chat-container\": 0,\n \"gx-ide-sc-chat-container\": 0,\n \"gx-ide-connect-gx-server\": 0,\n \"gx-ide-container\": 0,\n \"gx-ide-create-kb-from-server\": 0,\n \"gx-ide-current-user-info\": 0,\n \"gx-ide-dashboard-home\": 0,\n \"gx-ide-data-selector\": 0,\n \"gx-ide-data-type-selector\": 0,\n \"gx-ide-design-import\": 0,\n \"gx-ide-directory-selector\": 0,\n \"gx-ide-edit-module-server\": 0,\n \"gx-ide-empty-state\": 0,\n \"gx-ide-entity-selector\": 0,\n \"gx-ide-gam-installation-settings\": 0,\n \"gx-ide-kb-manager-export\": 0,\n \"gx-ide-kb-manager-import\": 0,\n \"gx-ide-list-selector\": 0,\n \"gx-ide-list-selector-item\": 0,\n \"gx-ide-loader\": 0,\n \"gx-ide-manage-module-references\": 0,\n \"gx-ide-manage-module-references-v2\": 0,\n \"gx-ide-new-environment\": 0,\n \"gx-ide-new-kb\": 0,\n \"gx-ide-new-object\": 0,\n \"gx-ide-new-version\": 0,\n \"gx-ide-object-selector\": 0,\n \"gx-ide-references\": 0,\n \"gx-ide-select-kb-items\": 0,\n \"gx-ide-select-user-team\": 0,\n \"gx-ide-sign-in\": 0,\n \"gx-ide-sign-in-team\": 0,\n \"gx-ide-share-kb\": 0,\n \"gx-ide-start-page\": 0,\n \"gx-ide-status-buttons\": 0,\n \"gx-ide-switch-panel\": 0,\n \"gx-ide-switcher\": 0,\n \"gx-ide-team-dev-commit\": 0,\n \"gx-ide-team-dev-select-recent-comment\": 0,\n \"gx-ide-team-dev-update\": 0,\n \"gx-ide-team-dev-update-partial-selection\": 0,\n \"gx-ide-team-dev-update-to-revision\": 0,\n \"gx-ide-template\": 0,\n \"gx-ide-test\": 0,\n \"gx-ide-title\": 0,\n \"gx-ide-top-bar\": 0,\n \"gx-ide-wf-settings\": 0,\n \"gx-ide-ww-images\": 0,\n \"gx-ide-ww-attributes\": 0,\n \"gx-ide-ww-files\": 0,\n \"gx-ide-navigation-report\": 0,\n \"gx-ide-splash\": 0,\n \"gx-ide-welcome-page\": 0,\n \"gx-ide-bpm-export-xpdl\": 0\n};\n\nconst componentsWithoutTranslations = new Set<GeneXusIdeUIControlsTagName>([\n \"gx-ide-ai-message\",\n \"gx-ide-chat-container\",\n \"gx-ide-container\",\n \"gx-ide-sc-chat-container\",\n \"gx-ide-directory-selector\",\n \"gx-ide-empty-state\",\n \"gx-ide-list-selector\",\n \"gx-ide-list-selector-item\",\n \"gx-ide-loader\",\n \"gx-ide-switch-panel\",\n \"gx-ide-switcher\",\n \"gx-ide-test\",\n \"gx-ide-title\",\n \"gx-ide-top-bar\"\n]);\n\nconst componentsWithTranslations = Object.keys(\n allGeneXusIdeUIComponents\n).filter(\n component =>\n !componentsWithoutTranslations.has(component as GeneXusIdeUIControlsTagName)\n);\n\ncomponentsWithTranslations.forEach(testLocale);\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface GxIdeBpmSyncGamRoles extends Components.GxIdeBpmSyncGamRoles, HTMLElement {}
|
|
4
|
+
export const GxIdeBpmSyncGamRoles: {
|
|
5
|
+
prototype: GxIdeBpmSyncGamRoles;
|
|
6
|
+
new (): GxIdeBpmSyncGamRoles;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, getAssetPath, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { L as Locale } from './locale.js';
|
|
3
|
+
|
|
4
|
+
const mapTypesToComboBoxItemModel = (synchronizationTypes) => {
|
|
5
|
+
const syncTypes = [];
|
|
6
|
+
synchronizationTypes.forEach(synchronizationType => {
|
|
7
|
+
const newSynchType = {
|
|
8
|
+
value: synchronizationType.value,
|
|
9
|
+
caption: synchronizationType.caption
|
|
10
|
+
};
|
|
11
|
+
syncTypes.push(newSynchType);
|
|
12
|
+
});
|
|
13
|
+
return syncTypes;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const bpmSyncGamRolesCss = ":host{display:grid;block-size:100%;overflow:hidden;grid-template-rows:1fr max-content}";
|
|
17
|
+
|
|
18
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
19
|
+
if (kind === "a" && !f)
|
|
20
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
21
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
22
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
23
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m")
|
|
27
|
+
throw new TypeError("Private method is not writable");
|
|
28
|
+
if (kind === "a" && !f)
|
|
29
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
30
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
31
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
32
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
33
|
+
};
|
|
34
|
+
var _GxIdeBpmSyncGamRoles__componentLocale, _GxIdeBpmSyncGamRoles_shortcutsSrc, _GxIdeBpmSyncGamRoles_synchronizationTypes, _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl, _GxIdeBpmSyncGamRoles_chShortcutsEl, _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl, _GxIdeBpmSyncGamRoles_cancelButtonHandler, _GxIdeBpmSyncGamRoles_okButtonHandler, _GxIdeBpmSyncGamRoles_renderFooter;
|
|
35
|
+
const CSS_BUNDLES = [
|
|
36
|
+
"resets/box-sizing",
|
|
37
|
+
"components/tooltip",
|
|
38
|
+
"utils/form--full",
|
|
39
|
+
"utils/layout",
|
|
40
|
+
"utils/typography",
|
|
41
|
+
"utils/spacing",
|
|
42
|
+
"chameleon/scrollbar"
|
|
43
|
+
];
|
|
44
|
+
const GxIdeBpmSyncGamRoles$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeBpmSyncGamRoles extends HTMLElement {
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
this.__registerHost();
|
|
48
|
+
this.__attachShadow();
|
|
49
|
+
_GxIdeBpmSyncGamRoles__componentLocale.set(this, void 0);
|
|
50
|
+
_GxIdeBpmSyncGamRoles_shortcutsSrc.set(this, getAssetPath(`./gx-ide-assets/bpm-sync-gam-roles/shortcuts.json`));
|
|
51
|
+
_GxIdeBpmSyncGamRoles_synchronizationTypes.set(this, []);
|
|
52
|
+
_GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl.set(this, void 0);
|
|
53
|
+
_GxIdeBpmSyncGamRoles_chShortcutsEl.set(this, void 0);
|
|
54
|
+
_GxIdeBpmSyncGamRoles_synchTypeComboBoxEl.set(this, void 0);
|
|
55
|
+
_GxIdeBpmSyncGamRoles_cancelButtonHandler.set(this, () => {
|
|
56
|
+
if (this.cancelCallback) {
|
|
57
|
+
this.cancelCallback();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
_GxIdeBpmSyncGamRoles_okButtonHandler.set(this, async () => {
|
|
61
|
+
var _a;
|
|
62
|
+
if (this.saveCallback) {
|
|
63
|
+
const syncData = {
|
|
64
|
+
automaticBackup: !!((_a = __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl, "f")) === null || _a === void 0 ? void 0 : _a.value),
|
|
65
|
+
syncType: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl, "f").value
|
|
66
|
+
};
|
|
67
|
+
await this.saveCallback(syncData);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
_GxIdeBpmSyncGamRoles_renderFooter.set(this, () => {
|
|
71
|
+
return (h("footer", { class: "control-footer control-footer-with-border spacing-body-block-end spacing-body-inline" }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", id: "button-cancel", onClick: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_cancelButtonHandler, "f"), part: "button-cancel" }, __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").footer.cancelButtonText), h("button", { class: "button-primary", id: "button-create", onClick: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_okButtonHandler, "f"), part: "button-ok" }, __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").footer.okButtonText))));
|
|
72
|
+
});
|
|
73
|
+
this.cancelCallback = undefined;
|
|
74
|
+
this.saveCallback = undefined;
|
|
75
|
+
}
|
|
76
|
+
async componentWillLoad() {
|
|
77
|
+
__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles__componentLocale, await Locale.getComponentStrings(this.el), "f");
|
|
78
|
+
__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_synchronizationTypes, mapTypesToComboBoxItemModel(__classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").main.synchronizationTypeOptions), "f");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Suspends or reactivates the shortcuts
|
|
82
|
+
*/
|
|
83
|
+
async suspendShortcuts(suspendShortcuts) {
|
|
84
|
+
if (suspendShortcuts) {
|
|
85
|
+
__classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_chShortcutsEl, "f").suspend = true;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
__classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_chShortcutsEl, "f").suspend = false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_chShortcutsEl, el, "f")) }), h("section", { class: "section spacing-body" }, h("div", { class: "main field-group" }, h("div", { class: "field field-block" }, h("label", { class: "label", htmlFor: "synch-type" }, __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").main.synchronizationTypeLabel), h("ch-combo-box-render", { accessibleName: "Synchronization types", class: "combo-box", id: "synch-type", value: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_synchronizationTypes, "f")[0].caption, model: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_synchronizationTypes, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl, el, "f")) })), h("ch-checkbox", { class: "checkbox", caption: __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles__componentLocale, "f").main.checkBoxLabel, checkedValue: "true", ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl, el, "f")) }))), __classPrivateFieldGet(this, _GxIdeBpmSyncGamRoles_renderFooter, "f").call(this)));
|
|
93
|
+
}
|
|
94
|
+
static get assetsDirs() { return ["gx-ide-assets/bpm-sync-gam-roles"]; }
|
|
95
|
+
get el() { return this; }
|
|
96
|
+
static get style() { return bpmSyncGamRolesCss; }
|
|
97
|
+
}, [1, "gx-ide-bpm-sync-gam-roles", {
|
|
98
|
+
"cancelCallback": [16],
|
|
99
|
+
"saveCallback": [16],
|
|
100
|
+
"suspendShortcuts": [64]
|
|
101
|
+
}]);
|
|
102
|
+
_GxIdeBpmSyncGamRoles__componentLocale = new WeakMap(), _GxIdeBpmSyncGamRoles_shortcutsSrc = new WeakMap(), _GxIdeBpmSyncGamRoles_synchronizationTypes = new WeakMap(), _GxIdeBpmSyncGamRoles_automaticBackupCheckBoxEl = new WeakMap(), _GxIdeBpmSyncGamRoles_chShortcutsEl = new WeakMap(), _GxIdeBpmSyncGamRoles_synchTypeComboBoxEl = new WeakMap(), _GxIdeBpmSyncGamRoles_cancelButtonHandler = new WeakMap(), _GxIdeBpmSyncGamRoles_okButtonHandler = new WeakMap(), _GxIdeBpmSyncGamRoles_renderFooter = new WeakMap();
|
|
103
|
+
function defineCustomElement$1() {
|
|
104
|
+
if (typeof customElements === "undefined") {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const components = ["gx-ide-bpm-sync-gam-roles"];
|
|
108
|
+
components.forEach(tagName => { switch (tagName) {
|
|
109
|
+
case "gx-ide-bpm-sync-gam-roles":
|
|
110
|
+
if (!customElements.get(tagName)) {
|
|
111
|
+
customElements.define(tagName, GxIdeBpmSyncGamRoles$1);
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
} });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const GxIdeBpmSyncGamRoles = GxIdeBpmSyncGamRoles$1;
|
|
118
|
+
const defineCustomElement = defineCustomElement$1;
|
|
119
|
+
|
|
120
|
+
export { GxIdeBpmSyncGamRoles, defineCustomElement };
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=gx-ide-bpm-sync-gam-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"gx-ide-bpm-sync-gam-roles.js","mappings":";;;AAEO,MAAM,2BAA2B,GAAG,CACzC,oBAA2B;IAE3B,MAAM,SAAS,GAAwB,EAAE,CAAC;IAE1C,oBAAoB,CAAC,OAAO,CAAC,mBAAmB;QAC9C,MAAM,YAAY,GAAsB;YACtC,KAAK,EAAE,mBAAmB,CAAC,KAAK;YAChC,OAAO,EAAE,mBAAmB,CAAC,OAAO;SACrC,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC9B,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;;ACfD,MAAM,kBAAkB,GAAG,wFAAwF;;;;;;;;;;;;;;;;;;;ACcnH,MAAM,WAAW,GAAm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A8B,EAA2B,MAAA,CAAC,GAEpD,CACX,CACE,EACT,uBAAA,IAAI,0CAAc,MAAlB,IAAI,CAAgB,CAChB,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GxIdeBpmSyncGamRoles"],"sources":["src/components/bpm/sync-gam-roles/helpers.tsx","src/components/bpm/sync-gam-roles/bpm-sync-gam-roles.scss?tag=gx-ide-bpm-sync-gam-roles&encapsulation=shadow","src/components/bpm/sync-gam-roles/bpm-sync-gam-roles.tsx"],"sourcesContent":["import { ComboBoxItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/combo-box/types\";\n\nexport const mapTypesToComboBoxItemModel = (\n synchronizationTypes: any[]\n): ComboBoxItemModel[] => {\n const syncTypes: ComboBoxItemModel[] = [];\n\n synchronizationTypes.forEach(synchronizationType => {\n const newSynchType: ComboBoxItemModel = {\n value: synchronizationType.value,\n caption: synchronizationType.caption\n };\n syncTypes.push(newSynchType);\n });\n return syncTypes;\n};\n",":host {\n display: grid;\n block-size: 100%;\n overflow: hidden;\n grid-template-rows: 1fr max-content;\n}\n","import {\n Component,\n Host,\n h,\n Element,\n getAssetPath,\n Method,\n Prop\n} from \"@stencil/core\";\nimport { Locale } from \"../../../common/locale\";\nimport { MercuryBundles } from \"@genexus/mercury\";\nimport { ComboBoxItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/combo-box/types\";\nimport { mapTypesToComboBoxItemModel } from \"./helpers\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/tooltip\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\n@Component({\n tag: \"gx-ide-bpm-sync-gam-roles\",\n styleUrl: \"bpm-sync-gam-roles.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-sync-gam-roles\"]\n})\nexport class GxIdeBpmSyncGamRoles {\n #_componentLocale: any;\n #shortcutsSrc = getAssetPath(\n `./gx-ide-assets/bpm-sync-gam-roles/shortcuts.json`\n );\n #synchronizationTypes: ComboBoxItemModel[] = [];\n\n @Element() el: HTMLGxIdeBpmSyncGamRolesElement;\n #automaticBackupCheckBoxEl: HTMLChCheckboxElement;\n #chShortcutsEl: HTMLChShortcutsElement;\n #synchTypeComboBoxEl: HTMLChComboBoxRenderElement;\n\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n this.#synchronizationTypes = mapTypesToComboBoxItemModel(\n this.#_componentLocale.main.synchronizationTypeOptions\n );\n }\n\n /**\n * Callback invoked when the user press the 'Cancel' button\n */\n @Prop() readonly cancelCallback: () => Promise<void>;\n\n /**\n * Callback invoked when the user press the 'Ok' button\n */\n @Prop() readonly saveCallback: (syncData: SyncData) => Promise<boolean>;\n\n /**\n * Suspends or reactivates the shortcuts\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n if (suspendShortcuts) {\n this.#chShortcutsEl.suspend = true;\n } else {\n this.#chShortcutsEl.suspend = false;\n }\n }\n\n #cancelButtonHandler = () => {\n if (this.cancelCallback) {\n this.cancelCallback();\n }\n };\n #okButtonHandler = async () => {\n if (this.saveCallback) {\n const syncData: SyncData = {\n automaticBackup: !!this.#automaticBackupCheckBoxEl?.value,\n syncType: this.#synchTypeComboBoxEl.value as SyncType\n };\n\n await this.saveCallback(syncData);\n }\n };\n\n #renderFooter = () => {\n return (\n <footer class=\"control-footer control-footer-with-border spacing-body-block-end spacing-body-inline\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n onClick={this.#cancelButtonHandler}\n part=\"button-cancel\"\n >\n {this.#_componentLocale.footer.cancelButtonText}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-create\"\n onClick={this.#okButtonHandler}\n part=\"button-ok\"\n >\n {this.#_componentLocale.footer.okButtonText}\n </button>\n </div>\n </footer>\n );\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section spacing-body\">\n <div class=\"main field-group\">\n <div class=\"field field-block\">\n <label class=\"label\" htmlFor=\"synch-type\">\n {this.#_componentLocale.main.synchronizationTypeLabel}\n </label>\n <ch-combo-box-render\n accessibleName=\"Synchronization types\"\n class=\"combo-box\"\n id=\"synch-type\"\n value={this.#synchronizationTypes[0].caption}\n model={this.#synchronizationTypes}\n ref={(el: HTMLChComboBoxRenderElement) =>\n (this.#synchTypeComboBoxEl =\n el as HTMLChComboBoxRenderElement)\n }\n ></ch-combo-box-render>\n </div>\n\n <ch-checkbox\n class=\"checkbox\"\n caption={this.#_componentLocale.main.checkBoxLabel}\n checkedValue=\"true\"\n ref={(el: HTMLChCheckboxElement) =>\n (this.#automaticBackupCheckBoxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </div>\n </section>\n {this.#renderFooter()}\n </Host>\n );\n }\n}\n\nexport type SyncType = \"From GAM\" | \"To GAM\" | \"Both\";\n\nexport type SyncData = {\n syncType: SyncType;\n automaticBackup: boolean;\n};\n"],"version":3}
|