@mediusinc/mng-commons 0.3.0 → 0.3.1

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.
@@ -3619,7 +3619,8 @@ class MngActionExecutorService {
3619
3619
  this.defaultEditorDialogComponent = defaultEditorDialogComponent;
3620
3620
  }
3621
3621
  prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
3622
- return new ActionExecContext(dataProvider ?? action.dataProvider ?? viewContainer?.getDataProvider(), this.getDataProviderService(dataProvider) ?? undefined, {
3622
+ const ctxDataProvider = dataProvider ?? action.dataProvider ?? viewContainer?.getDataProvider();
3623
+ return new ActionExecContext(ctxDataProvider, this.getDataProviderService(ctxDataProvider) ?? undefined, {
3623
3624
  item,
3624
3625
  itemId,
3625
3626
  actionData
@@ -3764,7 +3765,7 @@ class MngActionExecutorService {
3764
3765
  if (!ctxDataProvider) {
3765
3766
  const viewContainerDataProvider = viewContainer?.getDataProvider();
3766
3767
  if (viewContainerDataProvider) {
3767
- ctxDataProvider = action.dataProvider;
3768
+ ctxDataProvider = viewContainerDataProvider;
3768
3769
  }
3769
3770
  }
3770
3771
  const context = new ActionExecContext(ctxDataProvider, this.getDataProviderService(ctxDataProvider) ?? undefined, {
@@ -4413,8 +4414,8 @@ class MngActionComponent {
4413
4414
  this.loadingSubject.next(false);
4414
4415
  },
4415
4416
  error: err => {
4416
- console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
4417
4417
  this.loadingSubject.next(false);
4418
+ console.warn(`Error occurred while executing action ${this.action.actionName}.`, err);
4418
4419
  }
4419
4420
  });
4420
4421
  }
@@ -5965,25 +5966,28 @@ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
5965
5966
  if (this.descriptorInit) {
5966
5967
  return this.descriptorInit;
5967
5968
  }
5968
- if (!this.route.snapshot.data['tableviewData'].descriptor) {
5969
+ const routeData = this.route.snapshot.data;
5970
+ if (!routeData?.tableview?.descriptor) {
5969
5971
  throw Error('Tableview requires a descriptor.');
5970
5972
  }
5971
- return this.route.snapshot.data['tableviewData'].descriptor;
5973
+ return routeData.tableview.descriptor;
5972
5974
  }
5973
5975
  createTableviewDataProvider() {
5974
5976
  if (this.dataProviderInit) {
5975
5977
  return this.dataProviderInit;
5976
5978
  }
5977
- if (!this.route.snapshot.data['tableviewData'].dataProvider) {
5979
+ const routeData = this.route.snapshot.data;
5980
+ if (!routeData?.tableview?.dataProvider) {
5978
5981
  throw Error('Tableview requires a data provider.');
5979
5982
  }
5980
- return this.route.snapshot.data['tableviewData'].dataProvider;
5983
+ return routeData.tableview.dataProvider;
5981
5984
  }
5982
5985
  createActionDescriptors() {
5983
5986
  if (this.actionsInit) {
5984
5987
  return this.actionsInit;
5985
5988
  }
5986
- return this.route.snapshot.data['tableviewData'].fieldActions ?? super.createActionDescriptors();
5989
+ const routeData = this.route.snapshot.data;
5990
+ return routeData?.tableview?.actions ?? super.createActionDescriptors();
5987
5991
  }
5988
5992
  }
5989
5993
  MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });