@acorex/platform 20.2.4-next.1 → 20.2.4-next.2

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.
@@ -6,7 +6,7 @@ import { AXDataSource, AXCommonModule } from '@acorex/cdk/common';
6
6
  import { AXFormatService } from '@acorex/core/format';
7
7
  import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPReloadEvent, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
8
8
  import * as i1$4 from '@acorex/platform/core';
9
- import { AXPExpressionEvaluatorService, AXPPlatformScope, AXPDistributedEventListenerService, getSmart, getChangedPaths, extractValue, setSmart } from '@acorex/platform/core';
9
+ import { AXPExpressionEvaluatorService, AXPPlatformScope, AXPDistributedEventListenerService, getChangedPaths, extractValue, setSmart } from '@acorex/platform/core';
10
10
  import * as i2$2 from '@acorex/platform/workflow';
11
11
  import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
12
12
  import * as i2 from '@acorex/platform/layout/builder';
@@ -2585,7 +2585,7 @@ class AXPLayoutAdapterBuilder {
2585
2585
  command: {
2586
2586
  name: 'navigate',
2587
2587
  options: {
2588
- path: `/${session.application?.name}/m/${moduleName}/e/${entityName}/${this.rootContext.id}/new-view`,
2588
+ path: `/${session.application?.name}/m/${moduleName}/e/${entityName}/${this.rootContext.id}/view`,
2589
2589
  },
2590
2590
  },
2591
2591
  },
@@ -2744,13 +2744,23 @@ class AXPPageDetailsConverter extends AXPBaseRelatedEntityConverter {
2744
2744
  async convert(relatedEntity, context) {
2745
2745
  const { entityDef } = await this.getEntityDefinition(relatedEntity, context.entityResolver);
2746
2746
  const helpers = this.createEntityHelpers(entityDef);
2747
+ const evaluateExpressions = async (actionData) => {
2748
+ const scope = {
2749
+ context: {
2750
+ eval: (path) => {
2751
+ return get(context.context, path);
2752
+ },
2753
+ },
2754
+ };
2755
+ return await context.expressionEvaluator.evaluate(actionData, scope);
2756
+ };
2747
2757
  return {
2748
2758
  id: entityDef?.name ?? '',
2749
2759
  title: relatedEntity.title ?? entityDef?.title ?? '',
2750
2760
  label: relatedEntity.title ?? entityDef?.formats.displayName ?? '',
2751
2761
  icon: relatedEntity.icon || entityDef.icon,
2752
2762
  settings: this.createPageSettings(),
2753
- load: this.createLoadFunction(entityDef, relatedEntity),
2763
+ load: this.createLoadFunction(entityDef, relatedEntity, evaluateExpressions),
2754
2764
  execute: this.createExecuteFunction(entityDef),
2755
2765
  content: [this.createGridLayoutStructure(helpers.singleInterface, helpers)],
2756
2766
  };
@@ -2773,11 +2783,12 @@ class AXPPageDetailsConverter extends AXPBaseRelatedEntityConverter {
2773
2783
  },
2774
2784
  };
2775
2785
  }
2776
- createLoadFunction(entityDef, relatedEntity) {
2786
+ createLoadFunction(entityDef, relatedEntity, evaluateExpressions) {
2777
2787
  return async (context) => {
2778
2788
  const fn = entityDef?.queries.byKey?.execute;
2779
- const conditionNames = relatedEntity.conditions?.map((c) => c.name) ?? [];
2780
- const id = getSmart(context, conditionNames[0]);
2789
+ const conditionValues = relatedEntity.conditions?.map((c) => c.value) ?? [];
2790
+ const evaluatedConditionValues = await evaluateExpressions(conditionValues);
2791
+ const id = evaluatedConditionValues[0];
2781
2792
  const result = await fn(id);
2782
2793
  return { success: true, result };
2783
2794
  };
@@ -2986,6 +2997,7 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
2986
2997
  hidden: true,
2987
2998
  };
2988
2999
  }) ?? [];
3000
+ const actions = await evaluateExpressions(relatedEntity.actions);
2989
3001
  return {
2990
3002
  id: entityDef?.name ?? '',
2991
3003
  title: relatedEntity.title ?? entityDef?.title ?? '',
@@ -2993,7 +3005,7 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
2993
3005
  content: [
2994
3006
  {
2995
3007
  type: AXPWidgetsCatalog.entityList,
2996
- name: 'tab-list',
3008
+ name: `${relatedEntity.entity}-tab-list`,
2997
3009
  defaultValue: {
2998
3010
  toolbar: {
2999
3011
  filters: await Promise.all(filters),
@@ -3002,7 +3014,8 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
3002
3014
  options: {
3003
3015
  entity: relatedEntity.entity,
3004
3016
  showEntityActions: true,
3005
- showToolbar: true,
3017
+ showToolbar: false,
3018
+ actions: actions,
3006
3019
  },
3007
3020
  },
3008
3021
  ],
@@ -3820,12 +3833,34 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
3820
3833
  this.entitySource = computed(() => this.options()['entity'], ...(ngDevMode ? [{ debugName: "entitySource" }] : []));
3821
3834
  this.excludeColumns = computed(() => this.options()['excludeColumns'], ...(ngDevMode ? [{ debugName: "excludeColumns" }] : []));
3822
3835
  this.includeColumns = computed(() => this.options()['includeColumns'], ...(ngDevMode ? [{ debugName: "includeColumns" }] : []));
3836
+ this.externalActions = computed(() => this.options()['actions'], ...(ngDevMode ? [{ debugName: "externalActions" }] : []));
3823
3837
  this.showEntityActions = computed(() => this.options()['showEntityActions'] ?? true, ...(ngDevMode ? [{ debugName: "showEntityActions" }] : []));
3824
3838
  this.showToolbar = computed(() => this.options()['showToolbar'] ?? true, ...(ngDevMode ? [{ debugName: "showToolbar" }] : []));
3825
3839
  //actions
3826
3840
  this.allActions = computed(() => {
3827
- const list = this.entity()?.interfaces?.master?.list?.actions ?? [];
3828
- return list.map((tr) => new AXPEntityCommandTriggerViewModel(this.entity(), tr)) ?? [];
3841
+ const originalList = this.entity()?.interfaces?.master?.list?.actions ?? [];
3842
+ const externalActionList = (this.options()['actions'] ?? []);
3843
+ const usedOverrideActions = new Set();
3844
+ const mergedActions = originalList.map((originalAction) => {
3845
+ const originalCommandName = typeof originalAction.command === 'string' ? originalAction.command : originalAction.command?.name;
3846
+ const overrideAction = externalActionList.find((action) => {
3847
+ const actionCommandName = typeof action?.command === 'string' ? action.command : action?.command?.name;
3848
+ return actionCommandName === originalCommandName;
3849
+ });
3850
+ if (overrideAction) {
3851
+ const overrideKey = `${typeof overrideAction.command === 'string' ? overrideAction.command : overrideAction.command?.name}`;
3852
+ usedOverrideActions.add(overrideKey);
3853
+ return new AXPEntityCommandTriggerViewModel(this.entity(), overrideAction);
3854
+ }
3855
+ return new AXPEntityCommandTriggerViewModel(this.entity(), originalAction);
3856
+ });
3857
+ const additionalActions = externalActionList
3858
+ .filter((action) => {
3859
+ const actionKey = `${typeof action?.command === 'string' ? action.command : action?.command?.name}`;
3860
+ return !usedOverrideActions.has(actionKey);
3861
+ })
3862
+ .map((action) => new AXPEntityCommandTriggerViewModel(this.entity(), action));
3863
+ return [...additionalActions, ...mergedActions];
3829
3864
  }, ...(ngDevMode ? [{ debugName: "allActions" }] : []));
3830
3865
  this.primaryActions = computed(() => {
3831
3866
  const actions = this.allActions()
@@ -5171,7 +5206,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5171
5206
  }
5172
5207
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type:
5173
5208
  //
5174
- AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXTagBoxModule }, { kind: "component", type: i6.AXTagBoxComponent, selector: "ax-tag-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "allowNull", "type", "look", "addOnComma", "addOnEnter", "valueField", "textField", "readonlyField", "allowDuplicateValues"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "component", type: AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5209
+ AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXTagBoxModule }, { kind: "component", type: i6.AXTagBoxComponent, selector: "ax-tag-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "allowNull", "type", "look", "addOnComma", "addOnEnter", "valueField", "textField", "readonlyField", "allowDuplicateValues"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "component", type: AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5175
5210
  }
5176
5211
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
5177
5212
  type: Component,
@@ -5512,7 +5547,7 @@ class AXPTagableBoxWidgetEditComponent extends AXPValueWidgetComponent {
5512
5547
  </ax-prefix>
5513
5548
  </ax-button>
5514
5549
  </div>
5515
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i5.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5550
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i5.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5516
5551
  }
5517
5552
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, decorators: [{
5518
5553
  type: Component,
@@ -6120,7 +6155,7 @@ class AXPShowDetailViewAction extends AXPWorkflowAction {
6120
6155
  const [module, entity] = context.getVariable('entity').split('.');
6121
6156
  const { id } = context.getVariable('data');
6122
6157
  const newPayload = {
6123
- commands: `/${this.sessionService.application?.name}/m/${module}/e/${entity}/${id}/new-view`,
6158
+ commands: `/${this.sessionService.application?.name}/m/${module}/e/${entity}/${id}/view`,
6124
6159
  };
6125
6160
  context.setVariable('payload', newPayload);
6126
6161
  this.navigation.execute(context);