@smartbit4all/ng-client 1.0.22 → 1.0.23
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/esm2020/lib/view-context/smart-view-context.interceptor.mjs +2 -2
- package/esm2020/lib/view-context/smart-view-context.service.mjs +33 -41
- package/fesm2015/smartbit4all-ng-client.mjs +29 -38
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +29 -38
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/view-context/smart-view-context.interceptor.d.ts +0 -1
- package/lib/view-context/smart-view-context.service.d.ts +8 -7
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.0.23.tgz +0 -0
- package/smartbit4all-ng-client-1.0.22.tgz +0 -0
|
@@ -1988,8 +1988,8 @@ class SmartViewContextService {
|
|
|
1988
1988
|
this.session = session;
|
|
1989
1989
|
this.navigation = navigation;
|
|
1990
1990
|
this.dialog = dialog;
|
|
1991
|
-
this.tabIdName =
|
|
1992
|
-
this.tabIdhttpHeaderName =
|
|
1991
|
+
this.tabIdName = 'viewContextUuid';
|
|
1992
|
+
this.tabIdhttpHeaderName = 'viewContextUuid';
|
|
1993
1993
|
this.viewHandlers = new Array();
|
|
1994
1994
|
this.openedViewUuids = new Array();
|
|
1995
1995
|
this.uuidOfPageHasBeenChanged = new Subject();
|
|
@@ -2022,7 +2022,7 @@ class SmartViewContextService {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
getActionDescriptors() {
|
|
2024
2024
|
if (!this.actionDescriptors) {
|
|
2025
|
-
console.error(
|
|
2025
|
+
console.error('No action descriptors has been set to ViewContext.');
|
|
2026
2026
|
}
|
|
2027
2027
|
return this.actionDescriptors;
|
|
2028
2028
|
}
|
|
@@ -2043,7 +2043,7 @@ class SmartViewContextService {
|
|
|
2043
2043
|
this.view.configuration.basePath = this.url;
|
|
2044
2044
|
}
|
|
2045
2045
|
setUrl(url) {
|
|
2046
|
-
this.url = url +
|
|
2046
|
+
this.url = url + '/view';
|
|
2047
2047
|
this.setUpUrlForViewService();
|
|
2048
2048
|
}
|
|
2049
2049
|
async getAndSyncViewContext(uuid) {
|
|
@@ -2057,7 +2057,7 @@ class SmartViewContextService {
|
|
|
2057
2057
|
async getViewContext(uuid) {
|
|
2058
2058
|
this.viewContext = await this.view.getViewContext(uuid).toPromise();
|
|
2059
2059
|
if (!this.viewContext) {
|
|
2060
|
-
throw new Error(
|
|
2060
|
+
throw new Error('ViewContext does not exist with the given uuid.');
|
|
2061
2061
|
}
|
|
2062
2062
|
return this.viewContext;
|
|
2063
2063
|
}
|
|
@@ -2065,7 +2065,7 @@ class SmartViewContextService {
|
|
|
2065
2065
|
if (!this.viewContext) {
|
|
2066
2066
|
let viewContextUuid = sessionStorage.getItem(this.tabIdName);
|
|
2067
2067
|
if (!viewContextUuid) {
|
|
2068
|
-
throw new Error(
|
|
2068
|
+
throw new Error('View context is not initialized!');
|
|
2069
2069
|
}
|
|
2070
2070
|
await this.getViewContext(viewContextUuid);
|
|
2071
2071
|
}
|
|
@@ -2077,9 +2077,7 @@ class SmartViewContextService {
|
|
|
2077
2077
|
return viewContextByPageName;
|
|
2078
2078
|
}
|
|
2079
2079
|
async updateViewContext(viewContextUpdate) {
|
|
2080
|
-
this.viewContext = await this.view
|
|
2081
|
-
.updateViewContext(viewContextUpdate)
|
|
2082
|
-
.toPromise();
|
|
2080
|
+
this.viewContext = await this.view.updateViewContext(viewContextUpdate).toPromise();
|
|
2083
2081
|
return this.viewContext;
|
|
2084
2082
|
}
|
|
2085
2083
|
clearSessionStorage() {
|
|
@@ -2098,7 +2096,7 @@ class SmartViewContextService {
|
|
|
2098
2096
|
.createViewContext()
|
|
2099
2097
|
.toPromise();
|
|
2100
2098
|
if (!newViewContext) {
|
|
2101
|
-
throw new Error(
|
|
2099
|
+
throw new Error('No ViewContext was created');
|
|
2102
2100
|
}
|
|
2103
2101
|
this.viewContext = newViewContext;
|
|
2104
2102
|
this.setTabId(newViewContext.uuid);
|
|
@@ -2109,7 +2107,7 @@ class SmartViewContextService {
|
|
|
2109
2107
|
throw new Error("There aren't any viewHandlers in SmartViewContextService! Provide some to use its functions.");
|
|
2110
2108
|
}
|
|
2111
2109
|
if (!this.messageDialogname) {
|
|
2112
|
-
throw new Error(
|
|
2110
|
+
throw new Error('The messageDialogName provided by the backend has not been set.');
|
|
2113
2111
|
}
|
|
2114
2112
|
if (uuid) {
|
|
2115
2113
|
let subscription = this.session.headersUpdated.subscribe(async () => {
|
|
@@ -2153,10 +2151,10 @@ class SmartViewContextService {
|
|
|
2153
2151
|
if (viewHandler.route === undefined) {
|
|
2154
2152
|
throw new Error(`Route is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
|
|
2155
2153
|
}
|
|
2156
|
-
this.navigation.navigateTo(viewHandler.route.split(
|
|
2154
|
+
this.navigation.navigateTo(viewHandler.route.split('/'));
|
|
2157
2155
|
}
|
|
2158
2156
|
else {
|
|
2159
|
-
throw new Error(
|
|
2157
|
+
throw new Error('The type of the view and its viewHandler is not the same!');
|
|
2160
2158
|
}
|
|
2161
2159
|
view.state = ViewState.Opened;
|
|
2162
2160
|
this.openedViewUuids.push(view.uuid);
|
|
@@ -2185,7 +2183,7 @@ class SmartViewContextService {
|
|
|
2185
2183
|
this.dialogRefs.splice(index, 1);
|
|
2186
2184
|
}
|
|
2187
2185
|
else {
|
|
2188
|
-
throw new Error(
|
|
2186
|
+
throw new Error('DialogRef is not found by uuid.');
|
|
2189
2187
|
}
|
|
2190
2188
|
}
|
|
2191
2189
|
else if (view.type === ViewType.Normal) {
|
|
@@ -2193,7 +2191,7 @@ class SmartViewContextService {
|
|
|
2193
2191
|
// this.navigation.navigateTo(viewHandler.route.split("/"));
|
|
2194
2192
|
}
|
|
2195
2193
|
else {
|
|
2196
|
-
throw new Error(
|
|
2194
|
+
throw new Error('The type of the view and its viewHandler is not the same!');
|
|
2197
2195
|
}
|
|
2198
2196
|
view.state = ViewState.Closed;
|
|
2199
2197
|
this.openedViewUuids.slice(this.openedViewUuids.indexOf(view.uuid), 1);
|
|
@@ -2238,7 +2236,7 @@ class SmartViewContextService {
|
|
|
2238
2236
|
}
|
|
2239
2237
|
async message(messageData, messageResult) {
|
|
2240
2238
|
await this.view
|
|
2241
|
-
.message(messageData.viewUuid ??
|
|
2239
|
+
.message(messageData.viewUuid ?? '', messageData.uuid, messageResult)
|
|
2242
2240
|
.toPromise();
|
|
2243
2241
|
await this.getAndSyncViewContext();
|
|
2244
2242
|
}
|
|
@@ -2246,32 +2244,29 @@ class SmartViewContextService {
|
|
|
2246
2244
|
if (!this.smartViewContextApiErrors) {
|
|
2247
2245
|
return {
|
|
2248
2246
|
code,
|
|
2249
|
-
message:
|
|
2250
|
-
buttonLabel:
|
|
2251
|
-
dialogTitle:
|
|
2247
|
+
message: 'An error has occured.',
|
|
2248
|
+
buttonLabel: 'Ok',
|
|
2249
|
+
dialogTitle: 'Hiba',
|
|
2252
2250
|
};
|
|
2253
2251
|
}
|
|
2254
2252
|
let apiErrorsWithCode = this.smartViewContextApiErrors.viewContextApiErrors.filter((apiError) => {
|
|
2255
2253
|
return apiError.code === code;
|
|
2256
2254
|
});
|
|
2257
|
-
if (!apiErrorsWithCode ||
|
|
2258
|
-
(apiErrorsWithCode && !apiErrorsWithCode.length)) {
|
|
2255
|
+
if (!apiErrorsWithCode || (apiErrorsWithCode && !apiErrorsWithCode.length)) {
|
|
2259
2256
|
console.error(`SmartViewContextApiError with code ${code} could not be found.`);
|
|
2260
2257
|
return {
|
|
2261
2258
|
code,
|
|
2262
|
-
message:
|
|
2263
|
-
buttonLabel:
|
|
2264
|
-
dialogTitle:
|
|
2259
|
+
message: 'An error has occured.',
|
|
2260
|
+
buttonLabel: 'Ok',
|
|
2261
|
+
dialogTitle: 'Hiba',
|
|
2265
2262
|
};
|
|
2266
2263
|
}
|
|
2267
2264
|
return apiErrorsWithCode[0];
|
|
2268
2265
|
}
|
|
2269
2266
|
async getViewConstraint(uuid) {
|
|
2270
|
-
let viewConstraintResponse = await this.view
|
|
2271
|
-
.getViewConstraint(uuid)
|
|
2272
|
-
.toPromise();
|
|
2267
|
+
let viewConstraintResponse = await this.view.getViewConstraint(uuid).toPromise();
|
|
2273
2268
|
if (!viewConstraintResponse)
|
|
2274
|
-
throw new Error(
|
|
2269
|
+
throw new Error('Could not get ViewConstraint with the given uuid.');
|
|
2275
2270
|
return viewConstraintResponse;
|
|
2276
2271
|
}
|
|
2277
2272
|
async showPublishedView(channel, uuid) {
|
|
@@ -2292,14 +2287,10 @@ class SmartViewContextService {
|
|
|
2292
2287
|
return await this.handlePerformActionResponse(await this.view.performAction(uuid, uiActionRequest).toPromise());
|
|
2293
2288
|
}
|
|
2294
2289
|
async performWidgetAction(uuid, widgetId, nodeId, uiActionRequest) {
|
|
2295
|
-
return await this.handlePerformActionResponse(await this.view
|
|
2296
|
-
.performWidgetAction(uuid, widgetId, nodeId, uiActionRequest)
|
|
2297
|
-
.toPromise());
|
|
2290
|
+
return await this.handlePerformActionResponse(await this.view.performWidgetAction(uuid, widgetId, nodeId, uiActionRequest).toPromise());
|
|
2298
2291
|
}
|
|
2299
2292
|
async performWidgetMainAction(uuid, widgetId, uiActionRequest) {
|
|
2300
|
-
return await this.handlePerformActionResponse(await this.view
|
|
2301
|
-
.performWidgetMainAction(uuid, widgetId, uiActionRequest)
|
|
2302
|
-
.toPromise());
|
|
2293
|
+
return await this.handlePerformActionResponse(await this.view.performWidgetMainAction(uuid, widgetId, uiActionRequest).toPromise());
|
|
2303
2294
|
}
|
|
2304
2295
|
async handlePerformActionResponse(viewContextChange) {
|
|
2305
2296
|
this.viewContext = viewContextChange?.viewContext;
|
|
@@ -2321,13 +2312,14 @@ class SmartViewContextService {
|
|
|
2321
2312
|
}
|
|
2322
2313
|
}
|
|
2323
2314
|
SmartViewContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, deps: [{ token: ViewService }, { token: SmartSessionService }, { token: i3$1.SmartNavigationService }, { token: i4.SmartdialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2324
|
-
SmartViewContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, providedIn:
|
|
2315
|
+
SmartViewContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, providedIn: 'root' });
|
|
2325
2316
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, decorators: [{
|
|
2326
2317
|
type: Injectable,
|
|
2327
2318
|
args: [{
|
|
2328
|
-
providedIn:
|
|
2319
|
+
providedIn: 'root',
|
|
2329
2320
|
}]
|
|
2330
2321
|
}], ctorParameters: function () { return [{ type: ViewService }, { type: SmartSessionService }, { type: i3$1.SmartNavigationService }, { type: i4.SmartdialogService }]; } });
|
|
2322
|
+
const IS_ASYNC_PARAM_NAME = 'isAsync';
|
|
2331
2323
|
|
|
2332
2324
|
class SmartNgClientService {
|
|
2333
2325
|
constructor(session, viewContext) {
|
|
@@ -3027,7 +3019,6 @@ SmartViewContextInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "1
|
|
|
3027
3019
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextInterceptor, decorators: [{
|
|
3028
3020
|
type: Injectable
|
|
3029
3021
|
}], ctorParameters: function () { return [{ type: SmartViewContextErrorDialogService }]; } });
|
|
3030
|
-
const IS_ASYNC_PARAM_NAME = 'isAsync';
|
|
3031
3022
|
|
|
3032
3023
|
class SmartViewRedirect {
|
|
3033
3024
|
constructor(service, navigation, route) {
|
|
@@ -3970,5 +3961,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3970
3961
|
* Generated bundle index. Do not edit.
|
|
3971
3962
|
*/
|
|
3972
3963
|
|
|
3973
|
-
export { APIS, ApiModule, BASE_PATH, COLLECTION_FORMATS, CloseResult, Configuration, MessageOptionType, MessageType, SessionAPIS, SessionErrorBehaviour, SessionService, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewService, ViewState, ViewType };
|
|
3964
|
+
export { APIS, ApiModule, BASE_PATH, COLLECTION_FORMATS, CloseResult, Configuration, IS_ASYNC_PARAM_NAME, MessageOptionType, MessageType, SessionAPIS, SessionErrorBehaviour, SessionService, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewService, ViewState, ViewType };
|
|
3974
3965
|
//# sourceMappingURL=smartbit4all-ng-client.mjs.map
|