@crystaldesign/diva-core 25.4.0-beta.3 → 25.4.0-beta.31
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/build/esm/{ModalsWrapper-b818dd4f.js → ModalsWrapper-0fd3bcae.js} +4 -16
- package/build/esm/{index-63d33033.js → index-1eaba691.js} +343 -307
- package/build/esm/{index-ded2933f.js → index-9fa23e1f.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/types/core/src/elements/Modal/index.d.ts.map +1 -1
- package/build/types/core/src/externalTypes.d.ts +4 -2
- package/build/types/core/src/externalTypes.d.ts.map +1 -1
- package/build/types/core/src/handler/InternalApiHandler.d.ts +0 -1
- package/build/types/core/src/handler/InternalApiHandler.d.ts.map +1 -1
- package/build/types/core/src/handler/MediaHandler/index.d.ts +3 -2
- package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts +1 -1
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/store/DataStore.d.ts +1 -1
- package/build/umd/126.diva-core.umd.min.js +2 -0
- package/build/umd/126.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{109.diva-core.umd.min.js → 135.diva-core.umd.min.js} +2 -2
- package/build/umd/135.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/146.diva-core.umd.min.js +2 -0
- package/build/umd/146.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/215.diva-core.umd.min.js +2 -0
- package/build/umd/215.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{962.diva-core.umd.min.js → 263.diva-core.umd.min.js} +2 -2
- package/build/umd/263.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/429.diva-core.umd.min.js +2 -0
- package/build/umd/429.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{535.diva-core.umd.min.js → 700.diva-core.umd.min.js} +2 -2
- package/build/umd/700.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/731.diva-core.umd.min.js +2 -0
- package/build/umd/731.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{304.diva-core.umd.min.js → 800.diva-core.umd.min.js} +2 -2
- package/build/umd/800.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/83.diva-core.umd.min.js +2 -0
- package/build/umd/83.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/diva-core.umd.min.js +29 -2
- package/build/umd/diva-core.umd.min.js.LICENSE.txt +11 -1
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
- package/build/umd/109.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/304.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/41.diva-core.umd.min.js +0 -2
- package/build/umd/41.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/53.diva-core.umd.min.js +0 -2
- package/build/umd/53.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/535.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/671.diva-core.umd.min.js +0 -2
- package/build/umd/671.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/704.diva-core.umd.min.js +0 -2
- package/build/umd/704.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/806.diva-core.umd.min.js +0 -2
- package/build/umd/806.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/902.diva-core.umd.min.js +0 -2
- package/build/umd/902.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/962.diva-core.umd.min.js.LICENSE.txt +0 -1
|
@@ -44,7 +44,7 @@ import { actions } from '@storybook/addon-actions';
|
|
|
44
44
|
import * as Styles from '@mui/styles';
|
|
45
45
|
|
|
46
46
|
(function() {
|
|
47
|
-
const env = {"STAGE":"production","VERSION":"25.4.0-beta.
|
|
47
|
+
const env = {"STAGE":"production","VERSION":"25.4.0-beta.31"};
|
|
48
48
|
try {
|
|
49
49
|
if (process) {
|
|
50
50
|
process.env = Object.assign({}, process.env);
|
|
@@ -876,7 +876,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
876
876
|
}, {
|
|
877
877
|
key: "navigation",
|
|
878
878
|
get: function get() {
|
|
879
|
-
var _this$_configuration9, _this$_configuration10, _this$_configuration11, _this$_configuration12, _this$_configuration13, _this$_configuration14, _this$_configuration15, _this$_configuration16, _this$_configuration17, _this$_configuration18, _this$_configuration19, _this$_configuration20, _this$_configuration21, _this$_configuration22, _this$_configuration23, _this$_configuration24, _this$_configuration25, _this$_configuration26;
|
|
879
|
+
var _this$_configuration9, _this$_configuration10, _this$_configuration11, _this$_configuration12, _this$_configuration13, _this$_configuration14, _this$_configuration15, _this$_configuration16, _this$_configuration17, _this$_configuration18, _this$_configuration19, _this$_configuration20, _this$_configuration21, _this$_configuration22, _this$_configuration23, _this$_configuration24, _this$_configuration25, _this$root$dataStore$, _this$_configuration26;
|
|
880
880
|
return {
|
|
881
881
|
buttons: ((_this$_configuration9 = this._configuration) === null || _this$_configuration9 === void 0 || (_this$_configuration9 = _this$_configuration9.navigation) === null || _this$_configuration9 === void 0 ? void 0 : _this$_configuration9.buttons) || [],
|
|
882
882
|
imprintUrl: (_this$_configuration10 = this._configuration) === null || _this$_configuration10 === void 0 || (_this$_configuration10 = _this$_configuration10.navigation) === null || _this$_configuration10 === void 0 ? void 0 : _this$_configuration10.imprintUrl,
|
|
@@ -895,9 +895,9 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
895
895
|
qrCodeScanner: (_this$_configuration23 = this._configuration) === null || _this$_configuration23 === void 0 || (_this$_configuration23 = _this$_configuration23.navigation) === null || _this$_configuration23 === void 0 ? void 0 : _this$_configuration23.qrCodeScanner,
|
|
896
896
|
greetingsText: (_this$_configuration24 = this._configuration) === null || _this$_configuration24 === void 0 || (_this$_configuration24 = _this$_configuration24.navigation) === null || _this$_configuration24 === void 0 ? void 0 : _this$_configuration24.greetingsText,
|
|
897
897
|
showSnow: (_this$_configuration25 = this._configuration) === null || _this$_configuration25 === void 0 || (_this$_configuration25 = _this$_configuration25.navigation) === null || _this$_configuration25 === void 0 ? void 0 : _this$_configuration25.showSnow,
|
|
898
|
-
pricePreviewActive: (_this$_configuration26 = this._configuration) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.components.available.find(function (c) {
|
|
898
|
+
pricePreviewActive: ((_this$root$dataStore$ = this.root.dataStore.organization) === null || _this$root$dataStore$ === void 0 || (_this$root$dataStore$ = _this$root$dataStore$.settings) === null || _this$root$dataStore$ === void 0 ? void 0 : _this$root$dataStore$.pricePreview) && this.root.dataStore.organization.settings.pricePreview !== 'off' || ((_this$_configuration26 = this._configuration) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.components.available.find(function (c) {
|
|
899
899
|
return c.type === 'DIVA_WEBPLANNER';
|
|
900
|
-
})) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.settings) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.ViewConfig) === null || _this$_configuration26 === void 0 ? void 0 : _this$_configuration26.pricePreview
|
|
900
|
+
})) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.settings) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.ViewConfig) === null || _this$_configuration26 === void 0 ? void 0 : _this$_configuration26.pricePreview)
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
903
|
}, {
|
|
@@ -1000,14 +1000,14 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
1000
1000
|
get: function get() {
|
|
1001
1001
|
var _this$_configuration53;
|
|
1002
1002
|
if ((_this$_configuration53 = this._configuration) !== null && _this$_configuration53 !== void 0 && _this$_configuration53.priceFormat) {
|
|
1003
|
-
var _this$_configuration54, _this$root$dataStore
|
|
1003
|
+
var _this$_configuration54, _this$root$dataStore$2, _this$root$dataStore$3, _this$_configuration55;
|
|
1004
1004
|
return _objectSpread$g(_objectSpread$g({}, (_this$_configuration54 = this._configuration) === null || _this$_configuration54 === void 0 ? void 0 : _this$_configuration54.priceFormat), {}, {
|
|
1005
|
-
currency: (_this$root$dataStore$ = (_this$root$dataStore$
|
|
1005
|
+
currency: (_this$root$dataStore$2 = (_this$root$dataStore$3 = this.root.dataStore.organization) === null || _this$root$dataStore$3 === void 0 ? void 0 : _this$root$dataStore$3.settings.defaultCurrency) !== null && _this$root$dataStore$2 !== void 0 ? _this$root$dataStore$2 : (_this$_configuration55 = this._configuration) === null || _this$_configuration55 === void 0 ? void 0 : _this$_configuration55.priceFormat.currency
|
|
1006
1006
|
});
|
|
1007
1007
|
} else {
|
|
1008
|
-
var _this$root$dataStore$
|
|
1008
|
+
var _this$root$dataStore$4, _this$root$dataStore$5;
|
|
1009
1009
|
return _objectSpread$g(_objectSpread$g({}, DivaUtils.defaultPriceFormat), {}, {
|
|
1010
|
-
currency: (_this$root$dataStore$
|
|
1010
|
+
currency: (_this$root$dataStore$4 = (_this$root$dataStore$5 = this.root.dataStore.organization) === null || _this$root$dataStore$5 === void 0 ? void 0 : _this$root$dataStore$5.settings.defaultCurrency) !== null && _this$root$dataStore$4 !== void 0 ? _this$root$dataStore$4 : DivaUtils.defaultPriceFormat.currency
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
@@ -2235,8 +2235,14 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2235
2235
|
value:
|
|
2236
2236
|
/*#__PURE__*/
|
|
2237
2237
|
_regeneratorRuntime.mark(function openComponent(action) {
|
|
2238
|
-
var _this$componentChange,
|
|
2239
|
-
|
|
2238
|
+
var _this$componentChange,
|
|
2239
|
+
_config2,
|
|
2240
|
+
_config3,
|
|
2241
|
+
_this2 = this,
|
|
2242
|
+
_config6,
|
|
2243
|
+
_config8,
|
|
2244
|
+
_config9;
|
|
2245
|
+
var _this$componentChange2, _this$componentChange3, _this$openInNewTab, _this$openInNewTab2, link, _window, _ref2, type, parameters, internal, route, openInFullscreen, keepOldState, config, parent, _this$root$dataStore$, _this$root$dataStore$2, _config4, newTab, _config7, base, settings, openModuleLables, _parameters, otherPrams, module, prevType, prevState, currentState, componentState, _this$root$dataStore$3, _config$barrier, _parameters2;
|
|
2240
2246
|
return _regeneratorRuntime.wrap(function openComponent$(_context) {
|
|
2241
2247
|
while (1) switch (_context.prev = _context.next) {
|
|
2242
2248
|
case 0:
|
|
@@ -2283,18 +2289,59 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2283
2289
|
return c.route && (route === null || route === void 0 ? void 0 : route.startsWith(c.route));
|
|
2284
2290
|
});
|
|
2285
2291
|
}
|
|
2286
|
-
|
|
2292
|
+
if (!(((_config2 = config) === null || _config2 === void 0 ? void 0 : _config2.type) == 'CATEGORY_MANAGER' || ((_config3 = config) === null || _config3 === void 0 ? void 0 : _config3.type) == 'ASSORTMENT_MANAGER')) {
|
|
2293
|
+
_context.next = 23;
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2296
|
+
parent = undefined;
|
|
2297
|
+
if (this.root.dataStore.organization.type == undefined && this.root.dataStore.organization.parentType == 'RETAILER') {
|
|
2298
|
+
parent = (_this$root$dataStore$ = this.root.dataStore.organization.parentOrganizations) === null || _this$root$dataStore$ === void 0 ? void 0 : _this$root$dataStore$.find(function (o) {
|
|
2299
|
+
return o.type == 'RETAILER';
|
|
2300
|
+
});
|
|
2301
|
+
} else if (this.root.dataStore.organization.type == undefined && this.root.dataStore.organization.parentType == 'ASSOCIATION') {
|
|
2302
|
+
parent = (_this$root$dataStore$2 = this.root.dataStore.organization.parentOrganizations) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.find(function (o) {
|
|
2303
|
+
return o.type == 'ASSOCIATION';
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
if (!parent) {
|
|
2307
|
+
_context.next = 23;
|
|
2308
|
+
break;
|
|
2309
|
+
}
|
|
2310
|
+
this.openModal({
|
|
2311
|
+
title: this.root.t('action.opencomponent.diva6.warning.title'),
|
|
2312
|
+
text: this.root.t('action.opencomponent.diva6.warning.text', {
|
|
2313
|
+
type: ((_config4 = config) === null || _config4 === void 0 ? void 0 : _config4.type) == 'CATEGORY_MANAGER' ? 'Category Manager' : 'Sortiments Manager',
|
|
2314
|
+
parent: parent.displayName
|
|
2315
|
+
}),
|
|
2316
|
+
accept: true,
|
|
2317
|
+
reject: true,
|
|
2318
|
+
rejectByIcon: true,
|
|
2319
|
+
callback: function callback(accept) {
|
|
2320
|
+
if (accept) {
|
|
2321
|
+
var _config5;
|
|
2322
|
+
var url = "".concat(window.location.origin).concat((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.route, "?lang=").concat(_this2.root.language, "&organizationId=").concat(parent._id);
|
|
2323
|
+
_this2.openInNewTab({
|
|
2324
|
+
url: url,
|
|
2325
|
+
openInNewTab: true
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
});
|
|
2330
|
+
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
2331
|
+
return _context.abrupt("return");
|
|
2332
|
+
case 23:
|
|
2333
|
+
newTab = action.openInNewTab || ((_config6 = config) === null || _config6 === void 0 ? void 0 : _config6.openInNewTab);
|
|
2287
2334
|
if (!newTab) {
|
|
2288
|
-
_context.next =
|
|
2335
|
+
_context.next = 29;
|
|
2289
2336
|
break;
|
|
2290
2337
|
}
|
|
2291
2338
|
base = typeof action.openInNewTab == 'string' ? action.openInNewTab : window.origin;
|
|
2292
|
-
this.openInNewTab(action, "".concat(base).concat(((
|
|
2339
|
+
this.openInNewTab(action, "".concat(base).concat(((_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.route) || ''));
|
|
2293
2340
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
2294
2341
|
return _context.abrupt("return");
|
|
2295
|
-
case
|
|
2342
|
+
case 29:
|
|
2296
2343
|
if (!(!this.root.dataStore.user && !this.isPublic(action))) {
|
|
2297
|
-
_context.next =
|
|
2344
|
+
_context.next = 35;
|
|
2298
2345
|
break;
|
|
2299
2346
|
}
|
|
2300
2347
|
LOG$9.debug("Component is restricted, open login form");
|
|
@@ -2302,9 +2349,9 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2302
2349
|
this.root.authorizationStore.showLogin();
|
|
2303
2350
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
2304
2351
|
return _context.abrupt("return");
|
|
2305
|
-
case
|
|
2352
|
+
case 35:
|
|
2306
2353
|
if (config) {
|
|
2307
|
-
_context.next =
|
|
2354
|
+
_context.next = 40;
|
|
2308
2355
|
break;
|
|
2309
2356
|
}
|
|
2310
2357
|
this._restrictedComponent = action;
|
|
@@ -2316,7 +2363,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2316
2363
|
}
|
|
2317
2364
|
}), 'CORE_0005');
|
|
2318
2365
|
return _context.abrupt("return");
|
|
2319
|
-
case
|
|
2366
|
+
case 40:
|
|
2320
2367
|
settings = undefined;
|
|
2321
2368
|
if (config.settings) {
|
|
2322
2369
|
settings = config.settings;
|
|
@@ -2329,8 +2376,8 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2329
2376
|
openModuleLables = parameters;
|
|
2330
2377
|
parameters = otherPrams;
|
|
2331
2378
|
}
|
|
2332
|
-
module = this.mapTypeToModule((
|
|
2333
|
-
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((
|
|
2379
|
+
module = this.mapTypeToModule((_config8 = config) === null || _config8 === void 0 ? void 0 : _config8.type);
|
|
2380
|
+
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((_config9 = config) === null || _config9 === void 0 ? void 0 : _config9.type), openModuleLables);
|
|
2334
2381
|
prevType = this.visible;
|
|
2335
2382
|
prevState = this.state.get(this.visible || '');
|
|
2336
2383
|
currentState = this.state.get(config.type);
|
|
@@ -2342,7 +2389,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2342
2389
|
this.state.set(config.type, componentState);
|
|
2343
2390
|
this.visible = config.type;
|
|
2344
2391
|
if (config.isPublic == 'barrier') {
|
|
2345
|
-
if (!this.root.dataStore.user || !((_this$root$dataStore$ = this.root.dataStore.user) !== null && _this$root$dataStore$ !== void 0 && _this$root$dataStore
|
|
2392
|
+
if (!this.root.dataStore.user || !((_this$root$dataStore$3 = this.root.dataStore.user) !== null && _this$root$dataStore$3 !== void 0 && _this$root$dataStore$3.isEmailVerified)) {
|
|
2346
2393
|
if (!((_config$barrier = config.barrier) !== null && _config$barrier !== void 0 && _config$barrier.excludeParams) || !Object.keys((_parameters2 = parameters) !== null && _parameters2 !== void 0 ? _parameters2 : {}).find(function (p) {
|
|
2347
2394
|
return config.barrier.excludeParams.includes(p);
|
|
2348
2395
|
})) this.loginBarrier(true, config.barrier);
|
|
@@ -2374,7 +2421,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2374
2421
|
}
|
|
2375
2422
|
this.setGlobalClass();
|
|
2376
2423
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
2377
|
-
case
|
|
2424
|
+
case 60:
|
|
2378
2425
|
case "end":
|
|
2379
2426
|
return _context.stop();
|
|
2380
2427
|
}
|
|
@@ -2383,7 +2430,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2383
2430
|
}, {
|
|
2384
2431
|
key: "openComponentInFullscreen",
|
|
2385
2432
|
value: /*#__PURE__*/_regeneratorRuntime.mark(function openComponentInFullscreen(component) {
|
|
2386
|
-
var
|
|
2433
|
+
var _config10, _config11;
|
|
2387
2434
|
var type, parameters, internal, route, config, settings, module, componentState;
|
|
2388
2435
|
return _regeneratorRuntime.wrap(function openComponentInFullscreen$(_context2) {
|
|
2389
2436
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -2433,8 +2480,8 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2433
2480
|
case 17:
|
|
2434
2481
|
settings = _context2.sent;
|
|
2435
2482
|
case 18:
|
|
2436
|
-
module = this.mapTypeToModule((
|
|
2437
|
-
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((
|
|
2483
|
+
module = this.mapTypeToModule((_config10 = config) === null || _config10 === void 0 ? void 0 : _config10.type);
|
|
2484
|
+
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((_config11 = config) === null || _config11 === void 0 ? void 0 : _config11.type));
|
|
2438
2485
|
componentState = {
|
|
2439
2486
|
key: config.type,
|
|
2440
2487
|
parameters: parameters,
|
|
@@ -2505,7 +2552,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2505
2552
|
value: function loginBarrier(anon, settings) {
|
|
2506
2553
|
var _settings$title,
|
|
2507
2554
|
_settings$text,
|
|
2508
|
-
|
|
2555
|
+
_this3 = this;
|
|
2509
2556
|
this.openBarrier({
|
|
2510
2557
|
type: settings !== null && settings !== void 0 && settings.skipVerify ? 'SIMPLE' : 'GET_EMAIL',
|
|
2511
2558
|
rejectable: false,
|
|
@@ -2520,22 +2567,22 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2520
2567
|
return;
|
|
2521
2568
|
}
|
|
2522
2569
|
LOG$9.debug("Request email verification for ".concat(email));
|
|
2523
|
-
|
|
2570
|
+
_this3.root.apiHandler.sendVerificationEmail({
|
|
2524
2571
|
email: email,
|
|
2525
2572
|
emailVariant: (_settings$emailVarian = settings === null || settings === void 0 ? void 0 : settings.emailVariant) !== null && _settings$emailVarian !== void 0 ? _settings$emailVarian : 'DEMO'
|
|
2526
2573
|
});
|
|
2527
|
-
|
|
2528
|
-
title:
|
|
2529
|
-
text:
|
|
2574
|
+
_this3.openModal({
|
|
2575
|
+
title: _this3.root.t('loginbarrier.verify.title'),
|
|
2576
|
+
text: _this3.root.t('loginbarrier.verify.text'),
|
|
2530
2577
|
maxWidth: 500,
|
|
2531
2578
|
actions: [{
|
|
2532
|
-
text:
|
|
2579
|
+
text: _this3.root.t('loginbarrier.verify.button'),
|
|
2533
2580
|
variant: 'contained',
|
|
2534
2581
|
id: 'verify',
|
|
2535
2582
|
closeable: false
|
|
2536
2583
|
}],
|
|
2537
2584
|
callback: function callback() {
|
|
2538
|
-
|
|
2585
|
+
_this3.loginBarrier(false, settings);
|
|
2539
2586
|
}
|
|
2540
2587
|
});
|
|
2541
2588
|
}
|
|
@@ -2551,9 +2598,9 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2551
2598
|
* @param logo the custom logo
|
|
2552
2599
|
*/
|
|
2553
2600
|
function updateCustomLogo(components, logo) {
|
|
2554
|
-
var
|
|
2601
|
+
var _this4 = this;
|
|
2555
2602
|
components.forEach(function (c) {
|
|
2556
|
-
return logo ?
|
|
2603
|
+
return logo ? _this4.customLogoMap.set(c, logo) : _this4.customLogoMap["delete"](c);
|
|
2557
2604
|
});
|
|
2558
2605
|
}
|
|
2559
2606
|
|
|
@@ -2565,9 +2612,9 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2565
2612
|
}, {
|
|
2566
2613
|
key: "updateCustomHeaderElement",
|
|
2567
2614
|
value: function updateCustomHeaderElement(components, element) {
|
|
2568
|
-
var
|
|
2615
|
+
var _this5 = this;
|
|
2569
2616
|
components.forEach(function (c) {
|
|
2570
|
-
return element ?
|
|
2617
|
+
return element ? _this5.customHeaderComponentMap.set(c, element) : _this5.customHeaderComponentMap["delete"](c);
|
|
2571
2618
|
});
|
|
2572
2619
|
}
|
|
2573
2620
|
|
|
@@ -2646,7 +2693,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2646
2693
|
}, {
|
|
2647
2694
|
key: "breadcrumbs",
|
|
2648
2695
|
get: function get() {
|
|
2649
|
-
var
|
|
2696
|
+
var _this6 = this;
|
|
2650
2697
|
if (!this.visible) {
|
|
2651
2698
|
return undefined;
|
|
2652
2699
|
}
|
|
@@ -2658,7 +2705,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2658
2705
|
var group = _step2.value;
|
|
2659
2706
|
var path = group.path.find(function (p) {
|
|
2660
2707
|
return componentsEqual(p.component, {
|
|
2661
|
-
type:
|
|
2708
|
+
type: _this6.visible,
|
|
2662
2709
|
parameters: state.parameters,
|
|
2663
2710
|
internal: state.internal
|
|
2664
2711
|
});
|
|
@@ -2712,9 +2759,9 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2712
2759
|
}, {
|
|
2713
2760
|
key: "currentComponent",
|
|
2714
2761
|
get: function get() {
|
|
2715
|
-
var
|
|
2762
|
+
var _this7 = this;
|
|
2716
2763
|
return this.root.configurationStore.components.find(function (c) {
|
|
2717
|
-
return c.type ==
|
|
2764
|
+
return c.type == _this7.visible;
|
|
2718
2765
|
});
|
|
2719
2766
|
}
|
|
2720
2767
|
|
|
@@ -2751,11 +2798,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2751
2798
|
}, {
|
|
2752
2799
|
key: "allowHidePrices",
|
|
2753
2800
|
get: function get() {
|
|
2754
|
-
var _this$root$dataStore$
|
|
2801
|
+
var _this$root$dataStore$4;
|
|
2755
2802
|
if (!this.visible) {
|
|
2756
2803
|
return false;
|
|
2757
2804
|
}
|
|
2758
|
-
if (((_this$root$dataStore$
|
|
2805
|
+
if (((_this$root$dataStore$4 = this.root.dataStore.organization) === null || _this$root$dataStore$4 === void 0 || (_this$root$dataStore$4 = _this$root$dataStore$4.settings) === null || _this$root$dataStore$4 === void 0 ? void 0 : _this$root$dataStore$4.hidePrices) !== undefined) {
|
|
2759
2806
|
return this.root.dataStore.organization.settings.hidePrices.startsWith('DEFAULT');
|
|
2760
2807
|
}
|
|
2761
2808
|
return true;
|
|
@@ -2770,8 +2817,8 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2770
2817
|
key: "hidePrices",
|
|
2771
2818
|
get: function get() {
|
|
2772
2819
|
if (this._hidePrices === undefined) {
|
|
2773
|
-
var _this$root$dataStore$
|
|
2774
|
-
if ((_this$root$dataStore$
|
|
2820
|
+
var _this$root$dataStore$5;
|
|
2821
|
+
if ((_this$root$dataStore$5 = this.root.dataStore.organization) !== null && _this$root$dataStore$5 !== void 0 && (_this$root$dataStore$5 = _this$root$dataStore$5.settings) !== null && _this$root$dataStore$5 !== void 0 && _this$root$dataStore$5.hidePrices) {
|
|
2775
2822
|
switch (this.root.dataStore.organization.settings.hidePrices) {
|
|
2776
2823
|
case 'DEFAULT_HIDDEN':
|
|
2777
2824
|
case 'ONLY_HIDDEN':
|
|
@@ -2995,11 +3042,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2995
3042
|
}, {
|
|
2996
3043
|
key: "openBarrier",
|
|
2997
3044
|
value: function openBarrier(barrier) {
|
|
2998
|
-
var _this$root$dataStore$
|
|
2999
|
-
_this$root$dataStore$
|
|
3045
|
+
var _this$root$dataStore$6,
|
|
3046
|
+
_this$root$dataStore$7,
|
|
3000
3047
|
_barrier$actions,
|
|
3001
|
-
|
|
3002
|
-
if (barrier.anonOnly && (_this$root$dataStore$
|
|
3048
|
+
_this8 = this;
|
|
3049
|
+
if (barrier.anonOnly && (_this$root$dataStore$6 = this.root.dataStore.user) !== null && _this$root$dataStore$6 !== void 0 && _this$root$dataStore$6.mainEmail) {
|
|
3003
3050
|
LOG$9.debug('Skip barrier because user is logged in');
|
|
3004
3051
|
return;
|
|
3005
3052
|
}
|
|
@@ -3014,25 +3061,25 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3014
3061
|
},
|
|
3015
3062
|
content: /*#__PURE__*/React.createElement(Barrier, {
|
|
3016
3063
|
type: barrier.type,
|
|
3017
|
-
currentEmail: (_this$root$dataStore$
|
|
3064
|
+
currentEmail: (_this$root$dataStore$7 = this.root.dataStore.user) === null || _this$root$dataStore$7 === void 0 ? void 0 : _this$root$dataStore$7.mainEmail,
|
|
3018
3065
|
actions: (_barrier$actions = barrier.actions) === null || _barrier$actions === void 0 ? void 0 : _barrier$actions.map(function (a) {
|
|
3019
3066
|
return _objectSpread$b(_objectSpread$b({}, a), {}, {
|
|
3020
3067
|
onClick: function () {
|
|
3021
3068
|
var _onClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(email) {
|
|
3022
|
-
var
|
|
3069
|
+
var _this8$root$dataStore;
|
|
3023
3070
|
var doLogin;
|
|
3024
3071
|
return _regeneratorRuntime.wrap(function _callee$(_context3) {
|
|
3025
3072
|
while (1) switch (_context3.prev = _context3.next) {
|
|
3026
3073
|
case 0:
|
|
3027
|
-
|
|
3074
|
+
_this8.closeModal();
|
|
3028
3075
|
doLogin = (a.loginType ? a.loginType : barrier.type) === 'SIMPLE';
|
|
3029
|
-
if (!(doLogin && ((
|
|
3076
|
+
if (!(doLogin && ((_this8$root$dataStore = _this8.root.dataStore.user) === null || _this8$root$dataStore === void 0 ? void 0 : _this8$root$dataStore.mainEmail) != email)) {
|
|
3030
3077
|
_context3.next = 11;
|
|
3031
3078
|
break;
|
|
3032
3079
|
}
|
|
3033
3080
|
_context3.prev = 3;
|
|
3034
3081
|
_context3.next = 6;
|
|
3035
|
-
return flowResult(
|
|
3082
|
+
return flowResult(_this8.root.authorizationStore.login(email, undefined, true, _this8.root.dataStore.organizationId));
|
|
3036
3083
|
case 6:
|
|
3037
3084
|
_context3.next = 11;
|
|
3038
3085
|
break;
|
|
@@ -3078,7 +3125,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3078
3125
|
}, {
|
|
3079
3126
|
key: "sendEmail",
|
|
3080
3127
|
value: function sendEmail(_ref4) {
|
|
3081
|
-
var
|
|
3128
|
+
var _this9 = this;
|
|
3082
3129
|
var dialogText = _ref4.dialogText,
|
|
3083
3130
|
showDialog = _ref4.showDialog,
|
|
3084
3131
|
callback = _ref4.callback,
|
|
@@ -3095,12 +3142,12 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3095
3142
|
}
|
|
3096
3143
|
_context4.next = 4;
|
|
3097
3144
|
return new Promise(function (resolve) {
|
|
3098
|
-
return
|
|
3145
|
+
return _this9.openModal({
|
|
3099
3146
|
reject: true,
|
|
3100
3147
|
accept: true,
|
|
3101
|
-
text: dialogText ?
|
|
3148
|
+
text: dialogText ? _this9.root.t(dialogText, {
|
|
3102
3149
|
to: content.to
|
|
3103
|
-
}) :
|
|
3150
|
+
}) : _this9.root.t('email.question.default', {
|
|
3104
3151
|
to: content.to
|
|
3105
3152
|
}),
|
|
3106
3153
|
callback: function callback(accept) {
|
|
@@ -3116,20 +3163,20 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3116
3163
|
}
|
|
3117
3164
|
return _context4.abrupt("return");
|
|
3118
3165
|
case 6:
|
|
3119
|
-
|
|
3166
|
+
_this9.root.loadingAndErrorStore.toggleLoading('sendingEmail');
|
|
3120
3167
|
_context4.prev = 7;
|
|
3121
|
-
content.language = (_content$language$toU = (_content$language = content.language) === null || _content$language === void 0 ? void 0 : _content$language.toUpperCase()) !== null && _content$language$toU !== void 0 ? _content$language$toU :
|
|
3168
|
+
content.language = (_content$language$toU = (_content$language = content.language) === null || _content$language === void 0 ? void 0 : _content$language.toUpperCase()) !== null && _content$language$toU !== void 0 ? _content$language$toU : _this9.root.language.toUpperCase();
|
|
3122
3169
|
_context4.next = 11;
|
|
3123
|
-
return
|
|
3170
|
+
return _this9.root.apiHandler.sendEmail({
|
|
3124
3171
|
content: content,
|
|
3125
|
-
organizationIds:
|
|
3172
|
+
organizationIds: _this9.root.dataStore.fullParentList
|
|
3126
3173
|
});
|
|
3127
3174
|
case 11:
|
|
3128
3175
|
if (callback) {
|
|
3129
3176
|
callback(true);
|
|
3130
3177
|
} else {
|
|
3131
|
-
|
|
3132
|
-
text:
|
|
3178
|
+
_this9.openModal({
|
|
3179
|
+
text: _this9.root.t('email.send.success'),
|
|
3133
3180
|
accept: true
|
|
3134
3181
|
});
|
|
3135
3182
|
}
|
|
@@ -3141,14 +3188,14 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3141
3188
|
if (callback) {
|
|
3142
3189
|
callback(false);
|
|
3143
3190
|
} else {
|
|
3144
|
-
|
|
3145
|
-
text:
|
|
3191
|
+
_this9.openModal({
|
|
3192
|
+
text: _this9.root.t('email.send.error'),
|
|
3146
3193
|
accept: true
|
|
3147
3194
|
});
|
|
3148
3195
|
}
|
|
3149
3196
|
case 17:
|
|
3150
3197
|
_context4.prev = 17;
|
|
3151
|
-
|
|
3198
|
+
_this9.root.loadingAndErrorStore.toggleLoading('sendingEmail');
|
|
3152
3199
|
return _context4.finish(17);
|
|
3153
3200
|
case 20:
|
|
3154
3201
|
case "end":
|
|
@@ -3244,10 +3291,10 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3244
3291
|
key: "availableComponents",
|
|
3245
3292
|
get: function get() {
|
|
3246
3293
|
var _this$root,
|
|
3247
|
-
|
|
3294
|
+
_this10 = this;
|
|
3248
3295
|
return (_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.configurationStore.components.filter(function (component) {
|
|
3249
3296
|
//the component must be passed to diva core
|
|
3250
|
-
if (!
|
|
3297
|
+
if (!_this10.configuration.find(function (config) {
|
|
3251
3298
|
return config.name == component.type;
|
|
3252
3299
|
})) {
|
|
3253
3300
|
return false;
|
|
@@ -3258,11 +3305,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3258
3305
|
return true;
|
|
3259
3306
|
}
|
|
3260
3307
|
//if the user is not logged in the component must be public
|
|
3261
|
-
if (!
|
|
3308
|
+
if (!_this10.root.dataStore.user) {
|
|
3262
3309
|
return false;
|
|
3263
3310
|
}
|
|
3264
3311
|
//if there is a permission specified, the user must have it
|
|
3265
|
-
return component.permission ?
|
|
3312
|
+
return component.permission ? _this10.root.dataStore.userHasPermission(component.permission) : true;
|
|
3266
3313
|
});
|
|
3267
3314
|
}
|
|
3268
3315
|
|
|
@@ -3272,14 +3319,14 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3272
3319
|
}, {
|
|
3273
3320
|
key: "components",
|
|
3274
3321
|
get: function get() {
|
|
3275
|
-
var
|
|
3322
|
+
var _this11 = this;
|
|
3276
3323
|
var componentDefinitionToRender = this.configuration.filter(function (config) {
|
|
3277
3324
|
//there must be a state present in order for the component to be rendered
|
|
3278
|
-
if (!
|
|
3325
|
+
if (!_this11.state.has(config.name)) {
|
|
3279
3326
|
return false;
|
|
3280
3327
|
}
|
|
3281
3328
|
//the component must be contained in the available components list in order to be rendered
|
|
3282
|
-
return
|
|
3329
|
+
return _this11.availableComponents.find(function (component) {
|
|
3283
3330
|
return component.type == config.name;
|
|
3284
3331
|
});
|
|
3285
3332
|
});
|
|
@@ -3287,7 +3334,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3287
3334
|
//when a new component is added we have to make sure that for the currently open components the existing instance is reused
|
|
3288
3335
|
//withTransaction creates a new instance if APM is active, so we would loose the state of currently open components
|
|
3289
3336
|
componentDefinitionToRender.forEach(function (cmp) {
|
|
3290
|
-
var toRender =
|
|
3337
|
+
var toRender = _this11._currentlyRendered.find(function (c) {
|
|
3291
3338
|
return c.name == cmp.name;
|
|
3292
3339
|
});
|
|
3293
3340
|
if (!toRender) {
|
|
@@ -3308,10 +3355,10 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3308
3355
|
}, {
|
|
3309
3356
|
key: "fullscreenComponent",
|
|
3310
3357
|
get: function get() {
|
|
3311
|
-
var
|
|
3358
|
+
var _this12 = this;
|
|
3312
3359
|
var component = this.availableComponents.find(function (component) {
|
|
3313
|
-
var
|
|
3314
|
-
return component.type == ((
|
|
3360
|
+
var _this12$_fullscreenCo;
|
|
3361
|
+
return component.type == ((_this12$_fullscreenCo = _this12._fullscreenComponent) === null || _this12$_fullscreenCo === void 0 ? void 0 : _this12$_fullscreenCo.key);
|
|
3315
3362
|
});
|
|
3316
3363
|
var cmp = this.configuration.find(function (config) {
|
|
3317
3364
|
return (component === null || component === void 0 ? void 0 : component.type) == config.name;
|
|
@@ -3358,24 +3405,24 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3358
3405
|
key: "availableButtons",
|
|
3359
3406
|
get: function get() {
|
|
3360
3407
|
var _this$root$configurat,
|
|
3361
|
-
|
|
3408
|
+
_this13 = this;
|
|
3362
3409
|
return (_this$root$configurat = this.root.configurationStore.navigation) === null || _this$root$configurat === void 0 ? void 0 : _this$root$configurat.buttons.filter(function (button) {
|
|
3363
3410
|
//if component is public it can be displayed
|
|
3364
3411
|
if (button.isPublic) {
|
|
3365
3412
|
return true;
|
|
3366
3413
|
}
|
|
3367
3414
|
//if the user is not logged in the component must be public
|
|
3368
|
-
if (!
|
|
3415
|
+
if (!_this13.root.dataStore.user) {
|
|
3369
3416
|
return false;
|
|
3370
3417
|
}
|
|
3371
3418
|
|
|
3372
3419
|
//if the button is opening a component, the component must be availalbe
|
|
3373
|
-
if (button.action.type && !
|
|
3420
|
+
if (button.action.type && !_this13.availableComponentList.includes(button.action.type)) {
|
|
3374
3421
|
return false;
|
|
3375
3422
|
}
|
|
3376
3423
|
|
|
3377
3424
|
//if there is a permission specified, the user must have it
|
|
3378
|
-
return button.permission ?
|
|
3425
|
+
return button.permission ? _this13.root.dataStore.userHasPermission(button.permission) : true;
|
|
3379
3426
|
});
|
|
3380
3427
|
}
|
|
3381
3428
|
|
|
@@ -3460,7 +3507,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3460
3507
|
}, {
|
|
3461
3508
|
key: "updateStateAfterLogout",
|
|
3462
3509
|
value: function updateStateAfterLogout() {
|
|
3463
|
-
var
|
|
3510
|
+
var _this14 = this;
|
|
3464
3511
|
var _iterator3 = _createForOfIteratorHelper(this.state.entries()),
|
|
3465
3512
|
_step3;
|
|
3466
3513
|
try {
|
|
@@ -3468,19 +3515,19 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3468
3515
|
var _step3$value = _slicedToArray(_step3.value, 2),
|
|
3469
3516
|
type = _step3$value[0],
|
|
3470
3517
|
component = _step3$value[1];
|
|
3471
|
-
var config =
|
|
3518
|
+
var config = _this14.root.configurationStore.components.find(function (c) {
|
|
3472
3519
|
return c.type == type;
|
|
3473
3520
|
});
|
|
3474
3521
|
if (!(config !== null && config !== void 0 && config.isPublic)) {
|
|
3475
|
-
|
|
3476
|
-
if (
|
|
3477
|
-
|
|
3478
|
-
|
|
3522
|
+
_this14.state["delete"](type);
|
|
3523
|
+
if (_this14.visible == type) {
|
|
3524
|
+
_this14.visible = undefined;
|
|
3525
|
+
_this14._restrictedComponent = {
|
|
3479
3526
|
type: type,
|
|
3480
3527
|
parameters: component.parameters,
|
|
3481
3528
|
internal: component.internal
|
|
3482
3529
|
};
|
|
3483
|
-
|
|
3530
|
+
_this14.root.authorizationStore.showLogin();
|
|
3484
3531
|
}
|
|
3485
3532
|
}
|
|
3486
3533
|
};
|
|
@@ -3513,7 +3560,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3513
3560
|
if (action.url) {
|
|
3514
3561
|
link = this.resoveUrl(action.url);
|
|
3515
3562
|
} else {
|
|
3516
|
-
var _this$root$dataStore$
|
|
3563
|
+
var _this$root$dataStore$8;
|
|
3517
3564
|
var _ref5 = action,
|
|
3518
3565
|
parameters = _ref5.parameters;
|
|
3519
3566
|
var url = new URL(baseUrl);
|
|
@@ -3524,7 +3571,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3524
3571
|
if (this.root.language) {
|
|
3525
3572
|
params.append('lang', this.root.language);
|
|
3526
3573
|
}
|
|
3527
|
-
if ((_this$root$dataStore$
|
|
3574
|
+
if ((_this$root$dataStore$8 = this.root.dataStore.organization) !== null && _this$root$dataStore$8 !== void 0 && _this$root$dataStore$8._id) {
|
|
3528
3575
|
params.append('organizationId', this.root.dataStore.organization._id);
|
|
3529
3576
|
}
|
|
3530
3577
|
link = url.href;
|
|
@@ -5602,14 +5649,14 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
5602
5649
|
return getOrganizationBySearch;
|
|
5603
5650
|
}()
|
|
5604
5651
|
}, {
|
|
5605
|
-
key: "
|
|
5652
|
+
key: "getOrganizationParentByType",
|
|
5606
5653
|
value: function () {
|
|
5607
|
-
var
|
|
5608
|
-
var url, response;
|
|
5654
|
+
var _getOrganizationParentByType = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(organizationId, type) {
|
|
5655
|
+
var url, response, _data$data, data;
|
|
5609
5656
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
5610
5657
|
while (1) switch (_context14.prev = _context14.next) {
|
|
5611
5658
|
case 0:
|
|
5612
|
-
url = new URL("".concat(this.authService, "/v2/organizations/").concat(organizationId));
|
|
5659
|
+
url = new URL("".concat(this.authService, "/v2/organizations/").concat(organizationId, "/parents/").concat(type.toLocaleLowerCase()));
|
|
5613
5660
|
_context14.prev = 1;
|
|
5614
5661
|
_context14.next = 4;
|
|
5615
5662
|
return this.fetch({
|
|
@@ -5619,88 +5666,38 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
5619
5666
|
case 4:
|
|
5620
5667
|
response = _context14.sent;
|
|
5621
5668
|
if (!response.ok) {
|
|
5622
|
-
_context14.next =
|
|
5623
|
-
break;
|
|
5624
|
-
}
|
|
5625
|
-
return _context14.abrupt("return", response.json());
|
|
5626
|
-
case 7:
|
|
5627
|
-
throw new DivaError("Error from server while searching organizations. HTTP status: ".concat(response.status), {
|
|
5628
|
-
code: 'CORE_0001'
|
|
5629
|
-
});
|
|
5630
|
-
case 10:
|
|
5631
|
-
_context14.prev = 10;
|
|
5632
|
-
_context14.t0 = _context14["catch"](1);
|
|
5633
|
-
if (!(_context14.t0 instanceof DivaError)) {
|
|
5634
|
-
_context14.next = 14;
|
|
5669
|
+
_context14.next = 10;
|
|
5635
5670
|
break;
|
|
5636
5671
|
}
|
|
5637
|
-
|
|
5638
|
-
case 14:
|
|
5639
|
-
throw new DivaError('Error while getting organization', {
|
|
5640
|
-
code: 'CORE_0001',
|
|
5641
|
-
cause: _context14.t0
|
|
5642
|
-
});
|
|
5643
|
-
case 15:
|
|
5644
|
-
case "end":
|
|
5645
|
-
return _context14.stop();
|
|
5646
|
-
}
|
|
5647
|
-
}, _callee14, this, [[1, 10]]);
|
|
5648
|
-
}));
|
|
5649
|
-
function getOrganizationDataById(_x24) {
|
|
5650
|
-
return _getOrganizationDataById.apply(this, arguments);
|
|
5651
|
-
}
|
|
5652
|
-
return getOrganizationDataById;
|
|
5653
|
-
}()
|
|
5654
|
-
}, {
|
|
5655
|
-
key: "getOrganizationParentByType",
|
|
5656
|
-
value: function () {
|
|
5657
|
-
var _getOrganizationParentByType = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(organizationId, type) {
|
|
5658
|
-
var url, response, _data$data, data;
|
|
5659
|
-
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
5660
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
5661
|
-
case 0:
|
|
5662
|
-
url = new URL("".concat(this.authService, "/v2/organizations/").concat(organizationId, "/parents/").concat(type.toLocaleLowerCase()));
|
|
5663
|
-
_context15.prev = 1;
|
|
5664
|
-
_context15.next = 4;
|
|
5665
|
-
return this.fetch({
|
|
5666
|
-
url: url.toString(),
|
|
5667
|
-
jwt: this.jwt
|
|
5668
|
-
});
|
|
5669
|
-
case 4:
|
|
5670
|
-
response = _context15.sent;
|
|
5671
|
-
if (!response.ok) {
|
|
5672
|
-
_context15.next = 10;
|
|
5673
|
-
break;
|
|
5674
|
-
}
|
|
5675
|
-
_context15.next = 8;
|
|
5672
|
+
_context14.next = 8;
|
|
5676
5673
|
return response.json();
|
|
5677
5674
|
case 8:
|
|
5678
|
-
data =
|
|
5679
|
-
return
|
|
5675
|
+
data = _context14.sent;
|
|
5676
|
+
return _context14.abrupt("return", (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data[0]);
|
|
5680
5677
|
case 10:
|
|
5681
5678
|
throw new DivaError("Error from server while searching organizations. HTTP status: ".concat(response.status), {
|
|
5682
5679
|
code: 'CORE_0001'
|
|
5683
5680
|
});
|
|
5684
5681
|
case 13:
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
if (!(
|
|
5688
|
-
|
|
5682
|
+
_context14.prev = 13;
|
|
5683
|
+
_context14.t0 = _context14["catch"](1);
|
|
5684
|
+
if (!(_context14.t0 instanceof DivaError)) {
|
|
5685
|
+
_context14.next = 17;
|
|
5689
5686
|
break;
|
|
5690
5687
|
}
|
|
5691
|
-
throw
|
|
5688
|
+
throw _context14.t0;
|
|
5692
5689
|
case 17:
|
|
5693
5690
|
throw new DivaError('Error while getting organization', {
|
|
5694
5691
|
code: 'CORE_0001',
|
|
5695
|
-
cause:
|
|
5692
|
+
cause: _context14.t0
|
|
5696
5693
|
});
|
|
5697
5694
|
case 18:
|
|
5698
5695
|
case "end":
|
|
5699
|
-
return
|
|
5696
|
+
return _context14.stop();
|
|
5700
5697
|
}
|
|
5701
|
-
},
|
|
5698
|
+
}, _callee14, this, [[1, 13]]);
|
|
5702
5699
|
}));
|
|
5703
|
-
function getOrganizationParentByType(
|
|
5700
|
+
function getOrganizationParentByType(_x24, _x25) {
|
|
5704
5701
|
return _getOrganizationParentByType.apply(this, arguments);
|
|
5705
5702
|
}
|
|
5706
5703
|
return getOrganizationParentByType;
|
|
@@ -5708,10 +5705,10 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
5708
5705
|
}, {
|
|
5709
5706
|
key: "getRetailerLocationsForArea",
|
|
5710
5707
|
value: function () {
|
|
5711
|
-
var _getRetailerLocationsForArea = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5708
|
+
var _getRetailerLocationsForArea = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(organizationId, location, radius) {
|
|
5712
5709
|
var url, response;
|
|
5713
|
-
return _regeneratorRuntime.wrap(function
|
|
5714
|
-
while (1) switch (
|
|
5710
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
5711
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
5715
5712
|
case 0:
|
|
5716
5713
|
url = new URL("".concat(this.authService, "/organizations/").concat(organizationId, "/retailer-locations"));
|
|
5717
5714
|
if (location) {
|
|
@@ -5719,43 +5716,43 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
5719
5716
|
url.searchParams.append('lng', String(location.lng()));
|
|
5720
5717
|
}
|
|
5721
5718
|
url.searchParams.append('radius', radius);
|
|
5722
|
-
|
|
5723
|
-
|
|
5719
|
+
_context15.prev = 3;
|
|
5720
|
+
_context15.next = 6;
|
|
5724
5721
|
return this.fetch({
|
|
5725
5722
|
url: url.toString(),
|
|
5726
5723
|
jwt: this.jwt
|
|
5727
5724
|
});
|
|
5728
5725
|
case 6:
|
|
5729
|
-
response =
|
|
5726
|
+
response = _context15.sent;
|
|
5730
5727
|
if (!response.ok) {
|
|
5731
|
-
|
|
5728
|
+
_context15.next = 9;
|
|
5732
5729
|
break;
|
|
5733
5730
|
}
|
|
5734
|
-
return
|
|
5731
|
+
return _context15.abrupt("return", response.json());
|
|
5735
5732
|
case 9:
|
|
5736
5733
|
throw new DivaError("Error from server while searching retailer locations. HTTP status: ".concat(response.status), {
|
|
5737
5734
|
code: 'CORE_0001'
|
|
5738
5735
|
});
|
|
5739
5736
|
case 12:
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
if (!(
|
|
5743
|
-
|
|
5737
|
+
_context15.prev = 12;
|
|
5738
|
+
_context15.t0 = _context15["catch"](3);
|
|
5739
|
+
if (!(_context15.t0 instanceof DivaError)) {
|
|
5740
|
+
_context15.next = 16;
|
|
5744
5741
|
break;
|
|
5745
5742
|
}
|
|
5746
|
-
throw
|
|
5743
|
+
throw _context15.t0;
|
|
5747
5744
|
case 16:
|
|
5748
5745
|
throw new DivaError('Error while getting retailer locations', {
|
|
5749
5746
|
code: 'CORE_0001',
|
|
5750
|
-
cause:
|
|
5747
|
+
cause: _context15.t0
|
|
5751
5748
|
});
|
|
5752
5749
|
case 17:
|
|
5753
5750
|
case "end":
|
|
5754
|
-
return
|
|
5751
|
+
return _context15.stop();
|
|
5755
5752
|
}
|
|
5756
|
-
},
|
|
5753
|
+
}, _callee15, this, [[3, 12]]);
|
|
5757
5754
|
}));
|
|
5758
|
-
function getRetailerLocationsForArea(_x27, _x28
|
|
5755
|
+
function getRetailerLocationsForArea(_x26, _x27, _x28) {
|
|
5759
5756
|
return _getRetailerLocationsForArea.apply(this, arguments);
|
|
5760
5757
|
}
|
|
5761
5758
|
return getRetailerLocationsForArea;
|
|
@@ -5771,10 +5768,10 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
5771
5768
|
};
|
|
5772
5769
|
return fetch;
|
|
5773
5770
|
}(/*#__PURE__*/function () {
|
|
5774
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5771
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref6) {
|
|
5775
5772
|
var url, _ref6$method, method, jwt, body, headers;
|
|
5776
|
-
return _regeneratorRuntime.wrap(function
|
|
5777
|
-
while (1) switch (
|
|
5773
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
5774
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
5778
5775
|
case 0:
|
|
5779
5776
|
url = _ref6.url, _ref6$method = _ref6.method, method = _ref6$method === void 0 ? 'GET' : _ref6$method, jwt = _ref6.jwt, body = _ref6.body;
|
|
5780
5777
|
headers = {
|
|
@@ -5784,21 +5781,21 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
5784
5781
|
if (jwt) {
|
|
5785
5782
|
headers.Authorization = "Bearer ".concat(jwt);
|
|
5786
5783
|
}
|
|
5787
|
-
|
|
5784
|
+
_context16.next = 5;
|
|
5788
5785
|
return fetch(url, {
|
|
5789
5786
|
method: method,
|
|
5790
5787
|
headers: headers,
|
|
5791
5788
|
body: body ? JSON.stringify(body) : undefined
|
|
5792
5789
|
});
|
|
5793
5790
|
case 5:
|
|
5794
|
-
return
|
|
5791
|
+
return _context16.abrupt("return", _context16.sent);
|
|
5795
5792
|
case 6:
|
|
5796
5793
|
case "end":
|
|
5797
|
-
return
|
|
5794
|
+
return _context16.stop();
|
|
5798
5795
|
}
|
|
5799
|
-
},
|
|
5796
|
+
}, _callee16);
|
|
5800
5797
|
}));
|
|
5801
|
-
return function (
|
|
5798
|
+
return function (_x29) {
|
|
5802
5799
|
return _ref7.apply(this, arguments);
|
|
5803
5800
|
};
|
|
5804
5801
|
}())
|
|
@@ -5967,7 +5964,7 @@ var OrganizationHandler = /*#__PURE__*/function () {
|
|
|
5967
5964
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
5968
5965
|
while (1) switch (_context5.prev = _context5.next) {
|
|
5969
5966
|
case 0:
|
|
5970
|
-
return _context5.abrupt("return", this.apiHandler.
|
|
5967
|
+
return _context5.abrupt("return", this.apiHandler.fetchOrganization(organizationId));
|
|
5971
5968
|
case 1:
|
|
5972
5969
|
case "end":
|
|
5973
5970
|
return _context5.stop();
|
|
@@ -6138,17 +6135,17 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6138
6135
|
return getMediaById;
|
|
6139
6136
|
}()
|
|
6140
6137
|
}, {
|
|
6141
|
-
key: "
|
|
6138
|
+
key: "getMediaItemByRefId",
|
|
6142
6139
|
value: function () {
|
|
6143
|
-
var
|
|
6140
|
+
var _getMediaItemByRefId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(refid) {
|
|
6144
6141
|
var fullUrl, res, resData;
|
|
6145
6142
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
6146
6143
|
while (1) switch (_context3.prev = _context3.next) {
|
|
6147
6144
|
case 0:
|
|
6148
|
-
fullUrl = this.mediaService + '/
|
|
6145
|
+
fullUrl = this.mediaService + '/v1/mediaitemref/' + refid + '/mediaitem';
|
|
6149
6146
|
_context3.prev = 1;
|
|
6150
6147
|
_context3.next = 4;
|
|
6151
|
-
return fetch(
|
|
6148
|
+
return fetch(fullUrl, {
|
|
6152
6149
|
headers: {
|
|
6153
6150
|
Authorization: 'Bearer ' + this.jwt,
|
|
6154
6151
|
'Content-Type': 'application/json'
|
|
@@ -6160,27 +6157,72 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6160
6157
|
return res.json();
|
|
6161
6158
|
case 7:
|
|
6162
6159
|
resData = _context3.sent;
|
|
6163
|
-
|
|
6164
|
-
|
|
6160
|
+
if (!res.ok) {
|
|
6161
|
+
_context3.next = 10;
|
|
6162
|
+
break;
|
|
6163
|
+
}
|
|
6164
|
+
return _context3.abrupt("return", resData);
|
|
6165
6165
|
case 10:
|
|
6166
|
-
|
|
6166
|
+
throw new Error(resData.error || 'Could not fetch mediaItem');
|
|
6167
|
+
case 13:
|
|
6168
|
+
_context3.prev = 13;
|
|
6167
6169
|
_context3.t0 = _context3["catch"](1);
|
|
6170
|
+
throw new Error("Could not fetch mediaItem: ".concat(_context3.t0.message));
|
|
6171
|
+
case 16:
|
|
6172
|
+
case "end":
|
|
6173
|
+
return _context3.stop();
|
|
6174
|
+
}
|
|
6175
|
+
}, _callee3, this, [[1, 13]]);
|
|
6176
|
+
}));
|
|
6177
|
+
function getMediaItemByRefId(_x3) {
|
|
6178
|
+
return _getMediaItemByRefId.apply(this, arguments);
|
|
6179
|
+
}
|
|
6180
|
+
return getMediaItemByRefId;
|
|
6181
|
+
}()
|
|
6182
|
+
}, {
|
|
6183
|
+
key: "getHQRenderScriptById",
|
|
6184
|
+
value: function () {
|
|
6185
|
+
var _getHQRenderScriptById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id) {
|
|
6186
|
+
var fullUrl, res, resData;
|
|
6187
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
6188
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
6189
|
+
case 0:
|
|
6190
|
+
fullUrl = this.mediaService + '/hqrenderscripts';
|
|
6191
|
+
_context4.prev = 1;
|
|
6192
|
+
_context4.next = 4;
|
|
6193
|
+
return fetch("".concat(fullUrl, "/").concat(id), {
|
|
6194
|
+
headers: {
|
|
6195
|
+
Authorization: 'Bearer ' + this.jwt,
|
|
6196
|
+
'Content-Type': 'application/json'
|
|
6197
|
+
}
|
|
6198
|
+
});
|
|
6199
|
+
case 4:
|
|
6200
|
+
res = _context4.sent;
|
|
6201
|
+
_context4.next = 7;
|
|
6202
|
+
return res.json();
|
|
6203
|
+
case 7:
|
|
6204
|
+
resData = _context4.sent;
|
|
6205
|
+
_context4.next = 13;
|
|
6206
|
+
break;
|
|
6207
|
+
case 10:
|
|
6208
|
+
_context4.prev = 10;
|
|
6209
|
+
_context4.t0 = _context4["catch"](1);
|
|
6168
6210
|
throw new Error('Could not fetch mediaItem');
|
|
6169
6211
|
case 13:
|
|
6170
6212
|
if (!res.ok) {
|
|
6171
|
-
|
|
6213
|
+
_context4.next = 15;
|
|
6172
6214
|
break;
|
|
6173
6215
|
}
|
|
6174
|
-
return
|
|
6216
|
+
return _context4.abrupt("return", resData);
|
|
6175
6217
|
case 15:
|
|
6176
6218
|
throw new Error(resData.error);
|
|
6177
6219
|
case 16:
|
|
6178
6220
|
case "end":
|
|
6179
|
-
return
|
|
6221
|
+
return _context4.stop();
|
|
6180
6222
|
}
|
|
6181
|
-
},
|
|
6223
|
+
}, _callee4, this, [[1, 10]]);
|
|
6182
6224
|
}));
|
|
6183
|
-
function getHQRenderScriptById(
|
|
6225
|
+
function getHQRenderScriptById(_x4) {
|
|
6184
6226
|
return _getHQRenderScriptById.apply(this, arguments);
|
|
6185
6227
|
}
|
|
6186
6228
|
return getHQRenderScriptById;
|
|
@@ -6188,10 +6230,10 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6188
6230
|
}, {
|
|
6189
6231
|
key: "getRooms",
|
|
6190
6232
|
value: function () {
|
|
6191
|
-
var _getRooms = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6233
|
+
var _getRooms = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, mainCategory, style, name) {
|
|
6192
6234
|
var fullUrl, filterParts, filter, res, resData;
|
|
6193
|
-
return _regeneratorRuntime.wrap(function
|
|
6194
|
-
while (1) switch (
|
|
6235
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
6236
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
6195
6237
|
case 0:
|
|
6196
6238
|
fullUrl = new URL(this.mediaService + '/rooms');
|
|
6197
6239
|
fullUrl.searchParams.append('limit', '20');
|
|
@@ -6214,8 +6256,8 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6214
6256
|
if (filter) {
|
|
6215
6257
|
fullUrl.searchParams.append('filter', encodeURIComponent(filter));
|
|
6216
6258
|
}
|
|
6217
|
-
|
|
6218
|
-
|
|
6259
|
+
_context5.prev = 7;
|
|
6260
|
+
_context5.next = 10;
|
|
6219
6261
|
return fetch(fullUrl.toString(), {
|
|
6220
6262
|
headers: {
|
|
6221
6263
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6223,32 +6265,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6223
6265
|
}
|
|
6224
6266
|
});
|
|
6225
6267
|
case 10:
|
|
6226
|
-
res =
|
|
6227
|
-
|
|
6268
|
+
res = _context5.sent;
|
|
6269
|
+
_context5.next = 13;
|
|
6228
6270
|
return res.json();
|
|
6229
6271
|
case 13:
|
|
6230
|
-
resData =
|
|
6231
|
-
|
|
6272
|
+
resData = _context5.sent;
|
|
6273
|
+
_context5.next = 19;
|
|
6232
6274
|
break;
|
|
6233
6275
|
case 16:
|
|
6234
|
-
|
|
6235
|
-
|
|
6276
|
+
_context5.prev = 16;
|
|
6277
|
+
_context5.t0 = _context5["catch"](7);
|
|
6236
6278
|
throw new Error('Could not get rooms');
|
|
6237
6279
|
case 19:
|
|
6238
6280
|
if (!res.ok) {
|
|
6239
|
-
|
|
6281
|
+
_context5.next = 21;
|
|
6240
6282
|
break;
|
|
6241
6283
|
}
|
|
6242
|
-
return
|
|
6284
|
+
return _context5.abrupt("return", resData);
|
|
6243
6285
|
case 21:
|
|
6244
6286
|
throw new Error(resData.error);
|
|
6245
6287
|
case 22:
|
|
6246
6288
|
case "end":
|
|
6247
|
-
return
|
|
6289
|
+
return _context5.stop();
|
|
6248
6290
|
}
|
|
6249
|
-
},
|
|
6291
|
+
}, _callee5, this, [[7, 16]]);
|
|
6250
6292
|
}));
|
|
6251
|
-
function getRooms(
|
|
6293
|
+
function getRooms(_x5, _x6, _x7, _x8) {
|
|
6252
6294
|
return _getRooms.apply(this, arguments);
|
|
6253
6295
|
}
|
|
6254
6296
|
return getRooms;
|
|
@@ -6256,20 +6298,17 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6256
6298
|
}, {
|
|
6257
6299
|
key: "getRoomsNew",
|
|
6258
6300
|
value: function () {
|
|
6259
|
-
var _getRoomsNew = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6301
|
+
var _getRoomsNew = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, mainCategory, organizationId) {
|
|
6260
6302
|
var fullUrl, filterParts, filter, res, resData;
|
|
6261
|
-
return _regeneratorRuntime.wrap(function
|
|
6262
|
-
while (1) switch (
|
|
6303
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
6304
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
6263
6305
|
case 0:
|
|
6264
6306
|
fullUrl = new URL(this.mediaService + '/rooms');
|
|
6265
|
-
fullUrl.searchParams.append('limit', '
|
|
6307
|
+
fullUrl.searchParams.append('limit', '1000');
|
|
6266
6308
|
fullUrl.searchParams.append('skip', '0');
|
|
6267
6309
|
if (organizationId) {
|
|
6268
6310
|
fullUrl.searchParams.append('organizationId', organizationId);
|
|
6269
6311
|
}
|
|
6270
|
-
if (hideStandardRooms) {
|
|
6271
|
-
fullUrl.searchParams.append('hideStandardRooms', hideStandardRooms.toString());
|
|
6272
|
-
}
|
|
6273
6312
|
filterParts = [];
|
|
6274
6313
|
if (id) {
|
|
6275
6314
|
filterParts.push("+[{_id,eq,".concat(id, "},{variants.id,eq,").concat(id, "}]"));
|
|
@@ -6282,41 +6321,41 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6282
6321
|
if (filter) {
|
|
6283
6322
|
fullUrl.searchParams.append('filter', encodeURIComponent(filter));
|
|
6284
6323
|
}
|
|
6285
|
-
|
|
6286
|
-
|
|
6324
|
+
_context6.prev = 8;
|
|
6325
|
+
_context6.next = 11;
|
|
6287
6326
|
return fetch(fullUrl.toString(), {
|
|
6288
6327
|
headers: {
|
|
6289
6328
|
Authorization: 'Bearer ' + this.jwt,
|
|
6290
6329
|
'Content-Type': 'application/json'
|
|
6291
6330
|
}
|
|
6292
6331
|
});
|
|
6293
|
-
case
|
|
6294
|
-
res =
|
|
6295
|
-
|
|
6332
|
+
case 11:
|
|
6333
|
+
res = _context6.sent;
|
|
6334
|
+
_context6.next = 14;
|
|
6296
6335
|
return res.json();
|
|
6297
|
-
case
|
|
6298
|
-
resData =
|
|
6299
|
-
|
|
6336
|
+
case 14:
|
|
6337
|
+
resData = _context6.sent;
|
|
6338
|
+
_context6.next = 20;
|
|
6300
6339
|
break;
|
|
6301
|
-
case
|
|
6302
|
-
|
|
6303
|
-
|
|
6340
|
+
case 17:
|
|
6341
|
+
_context6.prev = 17;
|
|
6342
|
+
_context6.t0 = _context6["catch"](8);
|
|
6304
6343
|
throw new Error('Could not get rooms');
|
|
6305
|
-
case
|
|
6344
|
+
case 20:
|
|
6306
6345
|
if (!res.ok) {
|
|
6307
|
-
|
|
6346
|
+
_context6.next = 22;
|
|
6308
6347
|
break;
|
|
6309
6348
|
}
|
|
6310
|
-
return
|
|
6311
|
-
case
|
|
6349
|
+
return _context6.abrupt("return", resData);
|
|
6350
|
+
case 22:
|
|
6312
6351
|
throw new Error(resData.error);
|
|
6313
|
-
case
|
|
6352
|
+
case 23:
|
|
6314
6353
|
case "end":
|
|
6315
|
-
return
|
|
6354
|
+
return _context6.stop();
|
|
6316
6355
|
}
|
|
6317
|
-
},
|
|
6356
|
+
}, _callee6, this, [[8, 17]]);
|
|
6318
6357
|
}));
|
|
6319
|
-
function getRoomsNew(
|
|
6358
|
+
function getRoomsNew(_x9, _x10, _x11) {
|
|
6320
6359
|
return _getRoomsNew.apply(this, arguments);
|
|
6321
6360
|
}
|
|
6322
6361
|
return getRoomsNew;
|
|
@@ -6324,17 +6363,14 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6324
6363
|
}, {
|
|
6325
6364
|
key: "getRoomsGrouped",
|
|
6326
6365
|
value: function () {
|
|
6327
|
-
var _getRoomsGrouped = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6366
|
+
var _getRoomsGrouped = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mainCategory, style, organizationId) {
|
|
6328
6367
|
var fullUrl, filterParts, filter, res, resData;
|
|
6329
|
-
return _regeneratorRuntime.wrap(function
|
|
6330
|
-
while (1) switch (
|
|
6368
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
6369
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
6331
6370
|
case 0:
|
|
6332
6371
|
fullUrl = new URL(this.mediaService + '/rooms');
|
|
6333
6372
|
if (organizationId) {
|
|
6334
6373
|
fullUrl = new URL(this.mediaService + "/rooms/".concat(organizationId, "/grouped"));
|
|
6335
|
-
if (hideStandardRooms) {
|
|
6336
|
-
fullUrl.searchParams.append('hideStandardRooms', hideStandardRooms.toString());
|
|
6337
|
-
}
|
|
6338
6374
|
}
|
|
6339
6375
|
fullUrl.searchParams.append('limit', '20');
|
|
6340
6376
|
fullUrl.searchParams.append('skip', '0');
|
|
@@ -6353,8 +6389,8 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6353
6389
|
if (filter) {
|
|
6354
6390
|
fullUrl.searchParams.append('filter', encodeURIComponent(filter));
|
|
6355
6391
|
}
|
|
6356
|
-
|
|
6357
|
-
|
|
6392
|
+
_context7.prev = 8;
|
|
6393
|
+
_context7.next = 11;
|
|
6358
6394
|
return fetch(fullUrl.toString(), {
|
|
6359
6395
|
headers: {
|
|
6360
6396
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6362,32 +6398,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6362
6398
|
}
|
|
6363
6399
|
});
|
|
6364
6400
|
case 11:
|
|
6365
|
-
res =
|
|
6366
|
-
|
|
6401
|
+
res = _context7.sent;
|
|
6402
|
+
_context7.next = 14;
|
|
6367
6403
|
return res.json();
|
|
6368
6404
|
case 14:
|
|
6369
|
-
resData =
|
|
6370
|
-
|
|
6405
|
+
resData = _context7.sent;
|
|
6406
|
+
_context7.next = 20;
|
|
6371
6407
|
break;
|
|
6372
6408
|
case 17:
|
|
6373
|
-
|
|
6374
|
-
|
|
6409
|
+
_context7.prev = 17;
|
|
6410
|
+
_context7.t0 = _context7["catch"](8);
|
|
6375
6411
|
throw new Error('Could not get rooms');
|
|
6376
6412
|
case 20:
|
|
6377
6413
|
if (!res.ok) {
|
|
6378
|
-
|
|
6414
|
+
_context7.next = 22;
|
|
6379
6415
|
break;
|
|
6380
6416
|
}
|
|
6381
|
-
return
|
|
6417
|
+
return _context7.abrupt("return", resData);
|
|
6382
6418
|
case 22:
|
|
6383
6419
|
throw new Error(resData.error);
|
|
6384
6420
|
case 23:
|
|
6385
6421
|
case "end":
|
|
6386
|
-
return
|
|
6422
|
+
return _context7.stop();
|
|
6387
6423
|
}
|
|
6388
|
-
},
|
|
6424
|
+
}, _callee7, this, [[8, 17]]);
|
|
6389
6425
|
}));
|
|
6390
|
-
function getRoomsGrouped(_x12, _x13, _x14, _x15
|
|
6426
|
+
function getRoomsGrouped(_x12, _x13, _x14, _x15) {
|
|
6391
6427
|
return _getRoomsGrouped.apply(this, arguments);
|
|
6392
6428
|
}
|
|
6393
6429
|
return getRoomsGrouped;
|
|
@@ -6395,15 +6431,15 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6395
6431
|
}, {
|
|
6396
6432
|
key: "getRoomColors",
|
|
6397
6433
|
value: function () {
|
|
6398
|
-
var _getRoomColors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6434
|
+
var _getRoomColors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(name) {
|
|
6399
6435
|
var fullUrl, res, resData;
|
|
6400
|
-
return _regeneratorRuntime.wrap(function
|
|
6401
|
-
while (1) switch (
|
|
6436
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
6437
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
6402
6438
|
case 0:
|
|
6403
6439
|
fullUrl = this.mediaService + '/rooms/' + name + '/colors';
|
|
6404
6440
|
resData = [];
|
|
6405
|
-
|
|
6406
|
-
|
|
6441
|
+
_context8.prev = 2;
|
|
6442
|
+
_context8.next = 5;
|
|
6407
6443
|
return fetch(fullUrl, {
|
|
6408
6444
|
headers: {
|
|
6409
6445
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6411,32 +6447,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6411
6447
|
}
|
|
6412
6448
|
});
|
|
6413
6449
|
case 5:
|
|
6414
|
-
res =
|
|
6415
|
-
|
|
6450
|
+
res = _context8.sent;
|
|
6451
|
+
_context8.next = 8;
|
|
6416
6452
|
return res.json();
|
|
6417
6453
|
case 8:
|
|
6418
|
-
resData =
|
|
6419
|
-
|
|
6454
|
+
resData = _context8.sent;
|
|
6455
|
+
_context8.next = 14;
|
|
6420
6456
|
break;
|
|
6421
6457
|
case 11:
|
|
6422
|
-
|
|
6423
|
-
|
|
6458
|
+
_context8.prev = 11;
|
|
6459
|
+
_context8.t0 = _context8["catch"](2);
|
|
6424
6460
|
throw new Error('Could not get room variants');
|
|
6425
6461
|
case 14:
|
|
6426
6462
|
if (!res.ok) {
|
|
6427
|
-
|
|
6463
|
+
_context8.next = 16;
|
|
6428
6464
|
break;
|
|
6429
6465
|
}
|
|
6430
|
-
return
|
|
6466
|
+
return _context8.abrupt("return", resData);
|
|
6431
6467
|
case 16:
|
|
6432
6468
|
throw new Error(resData.error);
|
|
6433
6469
|
case 17:
|
|
6434
6470
|
case "end":
|
|
6435
|
-
return
|
|
6471
|
+
return _context8.stop();
|
|
6436
6472
|
}
|
|
6437
|
-
},
|
|
6473
|
+
}, _callee8, this, [[2, 11]]);
|
|
6438
6474
|
}));
|
|
6439
|
-
function getRoomColors(
|
|
6475
|
+
function getRoomColors(_x16) {
|
|
6440
6476
|
return _getRoomColors.apply(this, arguments);
|
|
6441
6477
|
}
|
|
6442
6478
|
return getRoomColors;
|
|
@@ -6444,15 +6480,15 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6444
6480
|
}, {
|
|
6445
6481
|
key: "getRoomVariants",
|
|
6446
6482
|
value: function () {
|
|
6447
|
-
var _getRoomVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6483
|
+
var _getRoomVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(id) {
|
|
6448
6484
|
var fullUrl, res, resData;
|
|
6449
|
-
return _regeneratorRuntime.wrap(function
|
|
6450
|
-
while (1) switch (
|
|
6485
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
6486
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
6451
6487
|
case 0:
|
|
6452
6488
|
fullUrl = this.mediaService + '/rooms/' + id + '/variants';
|
|
6453
6489
|
resData = [];
|
|
6454
|
-
|
|
6455
|
-
|
|
6490
|
+
_context9.prev = 2;
|
|
6491
|
+
_context9.next = 5;
|
|
6456
6492
|
return fetch(fullUrl, {
|
|
6457
6493
|
headers: {
|
|
6458
6494
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6460,32 +6496,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6460
6496
|
}
|
|
6461
6497
|
});
|
|
6462
6498
|
case 5:
|
|
6463
|
-
res =
|
|
6464
|
-
|
|
6499
|
+
res = _context9.sent;
|
|
6500
|
+
_context9.next = 8;
|
|
6465
6501
|
return res.json();
|
|
6466
6502
|
case 8:
|
|
6467
|
-
resData =
|
|
6468
|
-
|
|
6503
|
+
resData = _context9.sent;
|
|
6504
|
+
_context9.next = 14;
|
|
6469
6505
|
break;
|
|
6470
6506
|
case 11:
|
|
6471
|
-
|
|
6472
|
-
|
|
6507
|
+
_context9.prev = 11;
|
|
6508
|
+
_context9.t0 = _context9["catch"](2);
|
|
6473
6509
|
throw new Error('Could not get room variants');
|
|
6474
6510
|
case 14:
|
|
6475
6511
|
if (!res.ok) {
|
|
6476
|
-
|
|
6512
|
+
_context9.next = 16;
|
|
6477
6513
|
break;
|
|
6478
6514
|
}
|
|
6479
|
-
return
|
|
6515
|
+
return _context9.abrupt("return", resData);
|
|
6480
6516
|
case 16:
|
|
6481
6517
|
throw new Error(resData.error);
|
|
6482
6518
|
case 17:
|
|
6483
6519
|
case "end":
|
|
6484
|
-
return
|
|
6520
|
+
return _context9.stop();
|
|
6485
6521
|
}
|
|
6486
|
-
},
|
|
6522
|
+
}, _callee9, this, [[2, 11]]);
|
|
6487
6523
|
}));
|
|
6488
|
-
function getRoomVariants(
|
|
6524
|
+
function getRoomVariants(_x17) {
|
|
6489
6525
|
return _getRoomVariants.apply(this, arguments);
|
|
6490
6526
|
}
|
|
6491
6527
|
return getRoomVariants;
|
|
@@ -6493,16 +6529,16 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6493
6529
|
}, {
|
|
6494
6530
|
key: "getRenderPackages",
|
|
6495
6531
|
value: function () {
|
|
6496
|
-
var _getRenderPackages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6532
|
+
var _getRenderPackages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(organizationId) {
|
|
6497
6533
|
var fullUrl, res, resData;
|
|
6498
|
-
return _regeneratorRuntime.wrap(function
|
|
6499
|
-
while (1) switch (
|
|
6534
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
6535
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
6500
6536
|
case 0:
|
|
6501
6537
|
fullUrl = new URL(this.mediaService + '/renderpackages');
|
|
6502
6538
|
if (organizationId) fullUrl.searchParams.append('organizationId', organizationId);
|
|
6503
6539
|
fullUrl.searchParams.append('sort', encodeURIComponent('{position}'));
|
|
6504
|
-
|
|
6505
|
-
|
|
6540
|
+
_context10.prev = 3;
|
|
6541
|
+
_context10.next = 6;
|
|
6506
6542
|
return fetch(fullUrl, {
|
|
6507
6543
|
headers: {
|
|
6508
6544
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6510,32 +6546,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6510
6546
|
}
|
|
6511
6547
|
});
|
|
6512
6548
|
case 6:
|
|
6513
|
-
res =
|
|
6514
|
-
|
|
6549
|
+
res = _context10.sent;
|
|
6550
|
+
_context10.next = 9;
|
|
6515
6551
|
return res.json();
|
|
6516
6552
|
case 9:
|
|
6517
|
-
resData =
|
|
6518
|
-
|
|
6553
|
+
resData = _context10.sent;
|
|
6554
|
+
_context10.next = 15;
|
|
6519
6555
|
break;
|
|
6520
6556
|
case 12:
|
|
6521
|
-
|
|
6522
|
-
|
|
6557
|
+
_context10.prev = 12;
|
|
6558
|
+
_context10.t0 = _context10["catch"](3);
|
|
6523
6559
|
throw new Error('Could not get render packages');
|
|
6524
6560
|
case 15:
|
|
6525
6561
|
if (!res.ok) {
|
|
6526
|
-
|
|
6562
|
+
_context10.next = 17;
|
|
6527
6563
|
break;
|
|
6528
6564
|
}
|
|
6529
|
-
return
|
|
6565
|
+
return _context10.abrupt("return", resData);
|
|
6530
6566
|
case 17:
|
|
6531
6567
|
throw new Error(resData.error);
|
|
6532
6568
|
case 18:
|
|
6533
6569
|
case "end":
|
|
6534
|
-
return
|
|
6570
|
+
return _context10.stop();
|
|
6535
6571
|
}
|
|
6536
|
-
},
|
|
6572
|
+
}, _callee10, this, [[3, 12]]);
|
|
6537
6573
|
}));
|
|
6538
|
-
function getRenderPackages(
|
|
6574
|
+
function getRenderPackages(_x18) {
|
|
6539
6575
|
return _getRenderPackages.apply(this, arguments);
|
|
6540
6576
|
}
|
|
6541
6577
|
return getRenderPackages;
|
|
@@ -9530,7 +9566,7 @@ var SideMenu$1 = observer(SideMenu);
|
|
|
9530
9566
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9531
9567
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9532
9568
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
9533
|
-
return import('./ModalsWrapper-
|
|
9569
|
+
return import('./ModalsWrapper-0fd3bcae.js');
|
|
9534
9570
|
});
|
|
9535
9571
|
function Fullscreen() {
|
|
9536
9572
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
@@ -9984,10 +10020,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
9984
10020
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9985
10021
|
var LOG$2 = getLogger('Framework', 'Root');
|
|
9986
10022
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
9987
|
-
return import('./index-
|
|
10023
|
+
return import('./index-9fa23e1f.js');
|
|
9988
10024
|
});
|
|
9989
10025
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
9990
|
-
return import('./ModalsWrapper-
|
|
10026
|
+
return import('./ModalsWrapper-0fd3bcae.js');
|
|
9991
10027
|
});
|
|
9992
10028
|
function ContentComponent() {
|
|
9993
10029
|
var context = useDivaCoreContext();
|