@veloceapps/sdk 11.0.0-122 → 11.0.0-124
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/core/services/flow-info.service.d.ts +5 -5
- package/esm2020/core/services/flow-info.service.mjs +14 -14
- package/esm2020/src/guards/product-unload.guard.mjs +4 -2
- package/esm2020/src/pages/product/product.component.mjs +34 -10
- package/esm2020/src/services/flow-router.service.mjs +10 -10
- package/fesm2015/veloceapps-sdk-core.mjs +13 -13
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +40 -15
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +13 -13
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +39 -15
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/pages/product/product.component.d.ts +11 -3
- package/src/services/flow-router.service.d.ts +3 -3
@@ -456,6 +456,15 @@ class FlowRouterService {
|
|
456
456
|
this.integrationState.dispatch(FlowAction.CloseGuidedSelling({ keepState: true }));
|
457
457
|
});
|
458
458
|
}
|
459
|
+
get route$() {
|
460
|
+
return this.lastChildRoute$;
|
461
|
+
}
|
462
|
+
get params$() {
|
463
|
+
return this.lastChildParams$;
|
464
|
+
}
|
465
|
+
get params() {
|
466
|
+
return this.getLastChildParams(this.route.snapshot);
|
467
|
+
}
|
459
468
|
getFlowRootRoute(route) {
|
460
469
|
const path = [...route.pathFromRoot];
|
461
470
|
while (path.length) {
|
@@ -480,15 +489,6 @@ class FlowRouterService {
|
|
480
489
|
.join('/');
|
481
490
|
return '/' + path;
|
482
491
|
}
|
483
|
-
get route$() {
|
484
|
-
return this.lastChildRoute$;
|
485
|
-
}
|
486
|
-
get params$() {
|
487
|
-
return this.lastChildParams$;
|
488
|
-
}
|
489
|
-
get params() {
|
490
|
-
return this.getLastChildParams(this.route.snapshot);
|
491
|
-
}
|
492
492
|
isConfigurationRoute$() {
|
493
493
|
return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
|
494
494
|
}
|
@@ -756,7 +756,9 @@ class ProductUnloadGuard {
|
|
756
756
|
return observable.pipe(map(unload => {
|
757
757
|
if (unload) {
|
758
758
|
this.configurationService.reset();
|
759
|
-
|
759
|
+
const currentUrl = currentState.url.split('?')[0];
|
760
|
+
const nextUrl = (nextState?.url ?? '').split('?')[0];
|
761
|
+
if (!nextState || currentUrl === nextUrl) {
|
760
762
|
return true;
|
761
763
|
}
|
762
764
|
// clear obsolete queryParams
|
@@ -1106,28 +1108,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1106
1108
|
}] });
|
1107
1109
|
|
1108
1110
|
class ProductComponent {
|
1109
|
-
constructor(configurationRuntimeService, configurationStateService) {
|
1111
|
+
constructor(configurationRuntimeService, configurationStateService, flowService, route) {
|
1110
1112
|
this.configurationRuntimeService = configurationRuntimeService;
|
1111
1113
|
this.configurationStateService = configurationStateService;
|
1114
|
+
this.flowService = flowService;
|
1115
|
+
this.route = route;
|
1112
1116
|
this.uiDefinitionContainer$ = new BehaviorSubject(null);
|
1113
1117
|
this.showNotFound$ = new BehaviorSubject(false);
|
1118
|
+
this.isInitialized$ = new BehaviorSubject(true);
|
1119
|
+
this.destroy$ = new Subject();
|
1114
1120
|
this.uiDefinitionContainer$.next(this.configurationRuntimeService.uiDefinitionContainer);
|
1115
1121
|
this.config = {
|
1116
1122
|
init$: () => this.init$(),
|
1117
1123
|
};
|
1118
1124
|
}
|
1125
|
+
ngOnInit() {
|
1126
|
+
let prevParams;
|
1127
|
+
this.route.queryParams
|
1128
|
+
.pipe(tap(params => {
|
1129
|
+
if (prevParams && prevParams['productId'] !== params['productId']) {
|
1130
|
+
this.isInitialized$.next(false);
|
1131
|
+
setTimeout(() => {
|
1132
|
+
this.isInitialized$.next(true);
|
1133
|
+
}, 0);
|
1134
|
+
}
|
1135
|
+
prevParams = params;
|
1136
|
+
}))
|
1137
|
+
.subscribe();
|
1138
|
+
}
|
1139
|
+
ngOnDestroy() {
|
1140
|
+
this.destroy$.next();
|
1141
|
+
this.destroy$.complete();
|
1142
|
+
}
|
1119
1143
|
init$() {
|
1120
1144
|
return this.configurationStateService.init$().pipe(tap(() => {
|
1121
1145
|
this.showNotFound$.next(Boolean(!this.uiDefinitionContainer$.value));
|
1122
1146
|
}));
|
1123
1147
|
}
|
1124
1148
|
}
|
1125
|
-
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i3$1.ConfigurationRuntimeService }, { token: i3$1.ConfigurationStateService }], target: i0.ɵɵFactoryTarget.Component });
|
1126
|
-
ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"
|
1149
|
+
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i3$1.ConfigurationRuntimeService }, { token: i3$1.ConfigurationStateService }, { token: i3$1.FlowInfoService }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
1150
|
+
ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview\n *ngIf=\"isInitialized$ | async\"\n [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"\n [config]=\"config\"\n></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1127
1151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
|
1128
1152
|
type: Component,
|
1129
|
-
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"
|
1130
|
-
}], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }]; } });
|
1153
|
+
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview\n *ngIf=\"isInitialized$ | async\"\n [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"\n [config]=\"config\"\n></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"] }]
|
1154
|
+
}], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }, { type: i3$1.FlowInfoService }, { type: i1$2.ActivatedRoute }]; } });
|
1131
1155
|
|
1132
1156
|
class ProductModule {
|
1133
1157
|
}
|