wt-front-shared 1.0.56 → 1.0.58

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.
@@ -2208,7 +2208,7 @@ const _requestsStateReducer = createReducer(initialState$f, on(CreateRequestList
2208
2208
  }
2209
2209
  }), on(UpdateRequestData, (state, action) => {
2210
2210
  var _a;
2211
- const { endPointUrl, secondEndPointUrl, status, error, itemId, method, responseData } = action.payload;
2211
+ const { endPointUrl, secondEndPointUrl, status, error, itemId, method, data } = action.payload;
2212
2212
  const ids = getRequestIdVariants(endPointUrl, (_a = action.payload) === null || _a === void 0 ? void 0 : _a.itemId, method, secondEndPointUrl);
2213
2213
  let existsId = getExistId(state.ids, ids);
2214
2214
  if (existsId) {
@@ -2219,7 +2219,7 @@ const _requestsStateReducer = createReducer(initialState$f, on(CreateRequestList
2219
2219
  itemId,
2220
2220
  status,
2221
2221
  error,
2222
- data: responseData
2222
+ data: Object.assign({}, data)
2223
2223
  }));
2224
2224
  }
2225
2225
  return state;
@@ -6644,6 +6644,15 @@ class StaticDataFacade {
6644
6644
  }
6645
6645
  }));
6646
6646
  }
6647
+ updateSuccess(contentType, itemId, data) {
6648
+ this.store.dispatch(StaticDataUpdateSuccess({
6649
+ payload: {
6650
+ contentType,
6651
+ itemId,
6652
+ data
6653
+ }
6654
+ }));
6655
+ }
6647
6656
  patchUpdate(formId, contentType, itemId, data, publicApi = false) {
6648
6657
  this.store.dispatch(StaticDataPatchUpdate({
6649
6658
  payload: {
@@ -9956,7 +9965,6 @@ class SiteHelperComponent {
9956
9965
  }
9957
9966
  }
9958
9967
  runSiteHelper(configuration) {
9959
- console.log('runSiteHelper', this.siteHelperRunning, configuration);
9960
9968
  this.stopSiteTour();
9961
9969
  if (this.siteHelperRunning) {
9962
9970
  this.activeConfigStep = -1;
@@ -9966,10 +9974,8 @@ class SiteHelperComponent {
9966
9974
  else if (this.configurations[this.pageUrl]) {
9967
9975
  const helperKey = `url-${this.pageUrl}`;
9968
9976
  const cookieKey = this.getCookieKey(helperKey);
9969
- console.log('helperKey', helperKey, cookieKey);
9970
9977
  if (!this.cookieService.get(cookieKey)) {
9971
9978
  this.currentSiteHelperKey = `url-${this.pageUrl}`;
9972
- console.log('this.currentSiteHelperKey', this.currentSiteHelperKey);
9973
9979
  this.currentSiteHelperConfiguration = this.configurations[this.pageUrl];
9974
9980
  }
9975
9981
  }
@@ -9981,7 +9987,6 @@ class SiteHelperComponent {
9981
9987
  runSiteHelperNextStep() {
9982
9988
  var _a, _b, _c;
9983
9989
  return __awaiter(this, void 0, void 0, function* () {
9984
- console.log('runSiteHelperNextStep');
9985
9990
  if (!this.siteHelperRunning) {
9986
9991
  return;
9987
9992
  }
@@ -12184,7 +12189,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
12184
12189
  }] });
12185
12190
 
12186
12191
  class HeadersInterceptor {
12187
- constructor(authenticationService, routerFacade, usersFacade, formErrorsFacade, formsFacade, filesFacade, publicationMessagesFacade, requestsFacade, notificationsFacade) {
12192
+ constructor(authenticationService, routerFacade, usersFacade, formErrorsFacade, formsFacade, filesFacade, publicationMessagesFacade, requestsFacade, notificationsFacade, staticDataFacade) {
12188
12193
  this.authenticationService = authenticationService;
12189
12194
  this.routerFacade = routerFacade;
12190
12195
  this.usersFacade = usersFacade;
@@ -12194,12 +12199,14 @@ class HeadersInterceptor {
12194
12199
  this.publicationMessagesFacade = publicationMessagesFacade;
12195
12200
  this.requestsFacade = requestsFacade;
12196
12201
  this.notificationsFacade = notificationsFacade;
12202
+ this.staticDataFacade = staticDataFacade;
12197
12203
  this.modelAdapter = BaseModelAdapter.createInstance();
12198
12204
  }
12199
12205
  intercept(request, next) {
12200
12206
  return next.handle(request).pipe(tap((response) => {
12201
12207
  try {
12202
12208
  this.handlePublicationMessagesAndFiles(response);
12209
+ this.updateStaticData(response);
12203
12210
  }
12204
12211
  catch (e) {
12205
12212
  console.error('[ headers.interceptor ][ intercept.tap ]', e);
@@ -12224,7 +12231,7 @@ class HeadersInterceptor {
12224
12231
  hasError: true,
12225
12232
  isComplete: true,
12226
12233
  error: errResponse.error.error,
12227
- code: errResponse.error.code,
12234
+ code: errResponse.error.code
12228
12235
  });
12229
12236
  }
12230
12237
  if ((_a = errResponse.error.data) === null || _a === void 0 ? void 0 : _a.publicationResult) {
@@ -12253,6 +12260,19 @@ class HeadersInterceptor {
12253
12260
  const itemIdOrSlug = +urlParams2[2];
12254
12261
  this.requestsFacade.updateRequestData(endPointUrl, httpMethod.toLowerCase(), itemIdOrSlug, RequestStatus.LOADED, secondEndPointUrl, error);
12255
12262
  }
12263
+ updateStaticData(response) {
12264
+ var _a, _b, _c, _d, _e, _f, _g, _h;
12265
+ try {
12266
+ if (((_b = (_a = response.body) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.autoAction) === 'update-static-data' && ((_c = response.body.meta) === null || _c === void 0 ? void 0 : _c.staticDataType)) {
12267
+ if ((_e = (_d = response.body) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.id) {
12268
+ this.staticDataFacade.updateSuccess(response.body.meta.staticDataType, (_g = (_f = response.body) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.id, (_h = response.body) === null || _h === void 0 ? void 0 : _h.data);
12269
+ }
12270
+ }
12271
+ }
12272
+ catch (e) {
12273
+ console.error('[ headers.interceptor ][ intercept ][ updateStaticData ]', e);
12274
+ }
12275
+ }
12256
12276
  handlePublicationMessagesAndFiles(response) {
12257
12277
  var _a, _b, _c, _d, _e, _f, _g, _h;
12258
12278
  try {
@@ -12359,7 +12379,7 @@ class HeadersInterceptor {
12359
12379
  list = Object.values(error);
12360
12380
  }
12361
12381
  list.forEach(errorItem => {
12362
- const { formId, form_id, field, message, errorMessage, errorCode, } = errorItem;
12382
+ const { formId, form_id, field, message, errorMessage, errorCode } = errorItem;
12363
12383
  const formError = {
12364
12384
  formId: formId || form_id,
12365
12385
  field,
@@ -12382,11 +12402,11 @@ class HeadersInterceptor {
12382
12402
  this.notificationsFacade.showForbiddenError();
12383
12403
  }
12384
12404
  }
12385
- HeadersInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HeadersInterceptor, deps: [{ token: AuthenticationService }, { token: RouterFacade }, { token: UsersFacade }, { token: FormErrorsFacade }, { token: FormsFacade }, { token: FilesFacade }, { token: PublicationMessagesFacade }, { token: RequestsFacade }, { token: NotificationsFacade }], target: i0.ɵɵFactoryTarget.Injectable });
12405
+ HeadersInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HeadersInterceptor, deps: [{ token: AuthenticationService }, { token: RouterFacade }, { token: UsersFacade }, { token: FormErrorsFacade }, { token: FormsFacade }, { token: FilesFacade }, { token: PublicationMessagesFacade }, { token: RequestsFacade }, { token: NotificationsFacade }, { token: StaticDataFacade }], target: i0.ɵɵFactoryTarget.Injectable });
12386
12406
  HeadersInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HeadersInterceptor });
12387
12407
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HeadersInterceptor, decorators: [{
12388
12408
  type: Injectable
12389
- }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: RouterFacade }, { type: UsersFacade }, { type: FormErrorsFacade }, { type: FormsFacade }, { type: FilesFacade }, { type: PublicationMessagesFacade }, { type: RequestsFacade }, { type: NotificationsFacade }]; } });
12409
+ }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: RouterFacade }, { type: UsersFacade }, { type: FormErrorsFacade }, { type: FormsFacade }, { type: FilesFacade }, { type: PublicationMessagesFacade }, { type: RequestsFacade }, { type: NotificationsFacade }, { type: StaticDataFacade }]; } });
12390
12410
 
12391
12411
  class JwtInterceptor {
12392
12412
  constructor(authenticationService) {