@acorex/platform 19.1.2 → 19.1.3
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/common/index.d.ts +1 -0
- package/common/lib/app/application.types.d.ts +10 -8
- package/common/lib/configs/app.config.d.ts +0 -1
- package/common/lib/filters/filters.service.d.ts +8 -0
- package/common/lib/filters/filters.types.d.ts +18 -0
- package/common/lib/filters/index.d.ts +2 -0
- package/common/lib/settings/setting-definition.provider.d.ts +4 -2
- package/common/lib/settings/setting.builder.d.ts +3 -5
- package/fesm2022/acorex-platform-auth.mjs +5 -4
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +71 -14
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +72 -27
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +7 -7
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +280 -182
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-filters.mjs +47 -0
- package/fesm2022/acorex-platform-layout-filters.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-setting.mjs +174 -69
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/acorex-platform-layouts.mjs +1 -1
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-B13KvLX4.mjs → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs} +5 -5
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-B13KvLX4.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-B6MXHPWi.mjs → acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs} +81 -18
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-tKCGSRQT.mjs → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs} +6 -6
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-tKCGSRQT.mjs.map → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-CHvC0IAV.mjs → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs} +14 -14
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-CHvC0IAV.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs +78 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs +58 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +38 -112
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +187 -86
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-juhKoygA.mjs → acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs} +3 -3
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +213 -78
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/widget-renderer.component.directive.d.ts +3 -4
- package/layout/builder/lib/builder/widget.types.d.ts +11 -5
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -1
- package/layout/entity/lib/workflows/modify-entity.workflow.d.ts +14 -0
- package/layout/filters/README.md +3 -0
- package/layout/filters/index.d.ts +1 -0
- package/layout/filters/lib/filters.viewmodel.d.ts +20 -0
- package/layout/setting/lib/setting.viewmodel.d.ts +23 -21
- package/package.json +16 -12
- package/themes/default/index.d.ts +0 -1
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +5 -5
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-filters/list-view-option-filters.component.d.ts +11 -0
- package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +12 -0
- package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +47 -2
- package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +43 -0
- package/themes/shared/lib/components/layout-elements/index.d.ts +5 -3
- package/themes/shared/lib/components/layout-elements/{layout-page-actions.component.d.ts → layout-actions.component.d.ts} +5 -5
- package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +1 -1
- package/themes/shared/lib/components/layout-elements/layout-header.component.d.ts +12 -0
- package/themes/shared/lib/components/layout-elements/layout-list-component.d.ts +13 -0
- package/themes/shared/lib/components/layout-elements/layout-section.component.d.ts +9 -0
- package/themes/shared/lib/components/layout-elements/layout-side.component.d.ts +9 -0
- package/themes/shared/lib/shared.module.d.ts +3 -1
- package/widgets/lib/properties/editors.props.d.ts +2 -0
- package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +1 -0
- package/widgets/lib/widgets/property-editors/border/index.d.ts +1 -0
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +14 -3
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +6 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-B6MXHPWi.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-juhKoygA.mjs.map +0 -1
- package/themes/default/lib/layouts/setting-layout/index.d.ts +0 -1
- package/themes/shared/lib/components/layout-elements/layout-page-header.component.d.ts +0 -11
- package/themes/shared/lib/components/layout-elements/layout-page-side.component.d.ts +0 -5
|
@@ -708,6 +708,187 @@ const AXPDeleteEntityWorkflow = {
|
|
|
708
708
|
},
|
|
709
709
|
};
|
|
710
710
|
|
|
711
|
+
class AXPEntityMasterUpdateElementViewModel {
|
|
712
|
+
constructor(entity, property) {
|
|
713
|
+
this.entity = entity;
|
|
714
|
+
this.property = property;
|
|
715
|
+
this.name = signal(this.property.name);
|
|
716
|
+
this.title = signal(this.property.title);
|
|
717
|
+
this.description = signal(this.property.description);
|
|
718
|
+
this.editable = computed(() => {
|
|
719
|
+
return !(this.property.schema.readonly ?? false);
|
|
720
|
+
});
|
|
721
|
+
this.isRequired = computed(() => {
|
|
722
|
+
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
723
|
+
});
|
|
724
|
+
this.layout = computed(() => {
|
|
725
|
+
const updateProp = this.entity.interfaces?.master?.update?.properties?.find(c => c.name == this.property.name);
|
|
726
|
+
const source = cloneDeep(updateProp?.layout ?? {});
|
|
727
|
+
set(source, "positions.default.colSpan", 12);
|
|
728
|
+
return source;
|
|
729
|
+
});
|
|
730
|
+
this.node = computed(() => {
|
|
731
|
+
const schema = this.property.schema;
|
|
732
|
+
const widget = schema.interface;
|
|
733
|
+
return {
|
|
734
|
+
type: widget.type,
|
|
735
|
+
mode: this.editable() ? 'edit' : 'view',
|
|
736
|
+
path: this.name(),
|
|
737
|
+
children: widget.children,
|
|
738
|
+
formula: widget.formula,
|
|
739
|
+
triggers: widget.triggers,
|
|
740
|
+
options: merge(schema.interface?.options,
|
|
741
|
+
//this.property.options?.create?.widget,
|
|
742
|
+
{ validationRules: this.property.validations })
|
|
743
|
+
};
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
class AXPEntityMasterUpdateViewModel {
|
|
748
|
+
constructor(injector, config, entityData, props) {
|
|
749
|
+
this.injector = injector;
|
|
750
|
+
this.config = config;
|
|
751
|
+
this.entityData = entityData;
|
|
752
|
+
this.props = props;
|
|
753
|
+
this.entityDef = cloneDeep(this.config);
|
|
754
|
+
this.workflow = this.injector.get(AXPWorkflowService);
|
|
755
|
+
this.isInProgress = signal(false);
|
|
756
|
+
this.context = signal(cloneDeep(this.entityData));
|
|
757
|
+
this.elements = computed(() => {
|
|
758
|
+
const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
|
|
759
|
+
c.schema.hidden != true);
|
|
760
|
+
return props.map(e => {
|
|
761
|
+
return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
|
|
762
|
+
});
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
async save() {
|
|
766
|
+
this.isInProgress.set(true);
|
|
767
|
+
try {
|
|
768
|
+
const com = this.entityDef.commands?.update;
|
|
769
|
+
if (com) {
|
|
770
|
+
const exec = com.execute;
|
|
771
|
+
return await exec(this.context());
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
finally {
|
|
775
|
+
this.isInProgress.set(false);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
reset() {
|
|
779
|
+
this.context.set(cloneDeep(this.entityData));
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
class AXPEntityMasterUpdateViewModelFactory {
|
|
783
|
+
constructor() {
|
|
784
|
+
this.entityService = inject(AXPEntityDefinitionRegistryService);
|
|
785
|
+
this.layout = inject(AXPLayoutThemeService);
|
|
786
|
+
this.injector = inject(Injector);
|
|
787
|
+
}
|
|
788
|
+
async create(moduleName, entityName, id, props) {
|
|
789
|
+
const config = await this.entityService.resolve(moduleName, entityName);
|
|
790
|
+
this.layout.setNavigationLoading(true);
|
|
791
|
+
if (config.queries.byKey) {
|
|
792
|
+
const func = config.queries.byKey.execute;
|
|
793
|
+
const data = await func(id);
|
|
794
|
+
this.layout.setNavigationLoading(false);
|
|
795
|
+
return new AXPEntityMasterUpdateViewModel(this.injector, config, data, props);
|
|
796
|
+
}
|
|
797
|
+
this.layout.setNavigationLoading(false);
|
|
798
|
+
return Promise.reject('cannot fetch ');
|
|
799
|
+
}
|
|
800
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
801
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, providedIn: 'root' }); }
|
|
802
|
+
}
|
|
803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, decorators: [{
|
|
804
|
+
type: Injectable,
|
|
805
|
+
args: [{ providedIn: 'root' }]
|
|
806
|
+
}] });
|
|
807
|
+
|
|
808
|
+
const AXPEntityModifyEvent = createWorkFlowEvent('[Entity] Modified');
|
|
809
|
+
class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
810
|
+
constructor() {
|
|
811
|
+
super(...arguments);
|
|
812
|
+
this.popupService = inject(AXPopupService);
|
|
813
|
+
this.platform = inject(AXPlatform);
|
|
814
|
+
this.translateService = inject(AXTranslationService);
|
|
815
|
+
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
816
|
+
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
817
|
+
this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
|
|
818
|
+
}
|
|
819
|
+
async execute(context) {
|
|
820
|
+
const [moduleName, entityName] = context.getVariable('entity').split('.');
|
|
821
|
+
const { properties, id, title } = context.getVariable('data');
|
|
822
|
+
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
823
|
+
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
824
|
+
const com = await this.config.viewers.master.modify();
|
|
825
|
+
const popup = await this.popupService.open(com, {
|
|
826
|
+
title: title ?? `${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
827
|
+
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
828
|
+
data: {
|
|
829
|
+
vm,
|
|
830
|
+
properties,
|
|
831
|
+
entity: entityRef,
|
|
832
|
+
},
|
|
833
|
+
});
|
|
834
|
+
context.setOutput('result', false);
|
|
835
|
+
if (popup.data?.result == true) {
|
|
836
|
+
context.setOutput('result', true);
|
|
837
|
+
context.setVariable('data', cloneDeep(popup.data.context));
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
841
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction }); }
|
|
842
|
+
}
|
|
843
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction, decorators: [{
|
|
844
|
+
type: Injectable
|
|
845
|
+
}] });
|
|
846
|
+
class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
847
|
+
async execute(context) {
|
|
848
|
+
const updatedData = context.getVariable('data');
|
|
849
|
+
this.dispatch(AXPEntityModifyEvent({ entity: context.getVariable('entity'), values: updatedData }));
|
|
850
|
+
}
|
|
851
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
852
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
|
|
853
|
+
}
|
|
854
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction, decorators: [{
|
|
855
|
+
type: Injectable
|
|
856
|
+
}] });
|
|
857
|
+
const AXPModifyEntitySectionWorkflow = {
|
|
858
|
+
startStepId: 'modifyPopup',
|
|
859
|
+
steps: {
|
|
860
|
+
modifyPopup: {
|
|
861
|
+
id: 'modifyPopup',
|
|
862
|
+
action: 'AXPEntityModifySectionPopupAction',
|
|
863
|
+
nextSteps: [
|
|
864
|
+
{
|
|
865
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
866
|
+
nextStepId: 'successToast',
|
|
867
|
+
},
|
|
868
|
+
],
|
|
869
|
+
},
|
|
870
|
+
successToast: {
|
|
871
|
+
id: 'successToast',
|
|
872
|
+
action: 'AXPToastAction',
|
|
873
|
+
input: {
|
|
874
|
+
color: 'success',
|
|
875
|
+
title: 'workflow.entity-modified-title',
|
|
876
|
+
content: 'workflow.entity-modified-body',
|
|
877
|
+
},
|
|
878
|
+
nextSteps: [
|
|
879
|
+
{
|
|
880
|
+
conditions: [],
|
|
881
|
+
nextStepId: 'modifyConfirmed',
|
|
882
|
+
},
|
|
883
|
+
],
|
|
884
|
+
},
|
|
885
|
+
modifyConfirmed: {
|
|
886
|
+
id: 'modifyConfirmed',
|
|
887
|
+
action: 'AXPEntityModifyConfirmedAction',
|
|
888
|
+
},
|
|
889
|
+
},
|
|
890
|
+
};
|
|
891
|
+
|
|
711
892
|
class AXPEntityMasterListViewQueryViewModel {
|
|
712
893
|
constructor(entity, section, view) {
|
|
713
894
|
this.entity = entity;
|
|
@@ -887,9 +1068,10 @@ class AXPEntityMasterListViewModel {
|
|
|
887
1068
|
};
|
|
888
1069
|
this.sortedFields = signal([]);
|
|
889
1070
|
this.workflow.events$
|
|
890
|
-
.pipe(ofType(AXPEntityDeletedEvent, AXPEntityCreateEvent))
|
|
1071
|
+
.pipe(ofType(AXPEntityDeletedEvent, AXPEntityCreateEvent, AXPEntityModifyEvent))
|
|
891
1072
|
.pipe(takeUntil(this.destroyed))
|
|
892
1073
|
.subscribe((event) => {
|
|
1074
|
+
console.log('omed');
|
|
893
1075
|
if (event.payload.entity == getEntityInfo(this.entityDef).source) {
|
|
894
1076
|
this.selectedItems.set([]);
|
|
895
1077
|
this.events$.next({ action: 'refresh' });
|
|
@@ -911,6 +1093,23 @@ class AXPEntityMasterListViewModel {
|
|
|
911
1093
|
clearSelection() {
|
|
912
1094
|
this.selectedItems.set([]);
|
|
913
1095
|
}
|
|
1096
|
+
get filtersDef() {
|
|
1097
|
+
const props = this.entityDef.properties.filter((c) => c.options?.filter?.advance?.enabled);
|
|
1098
|
+
return props.map((e) => {
|
|
1099
|
+
return {
|
|
1100
|
+
title: e.title,
|
|
1101
|
+
field: e.name,
|
|
1102
|
+
operator: {
|
|
1103
|
+
type: 'equal',
|
|
1104
|
+
},
|
|
1105
|
+
widget: {
|
|
1106
|
+
type: e.schema.interface?.type,
|
|
1107
|
+
},
|
|
1108
|
+
filters: [],
|
|
1109
|
+
isParametric: false,
|
|
1110
|
+
};
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
914
1113
|
applyInlineFilter(value) {
|
|
915
1114
|
const props = this.entityDef.properties.filter((c) => c.options?.filter?.inline?.enabled);
|
|
916
1115
|
this.inlineFilters.filters = [];
|
|
@@ -1061,187 +1260,6 @@ const AXPEntityListViewModelResolver = (route, state, service = inject(AXPEntity
|
|
|
1061
1260
|
return service.create(moduleName, entityName);
|
|
1062
1261
|
};
|
|
1063
1262
|
|
|
1064
|
-
class AXPEntityMasterUpdateElementViewModel {
|
|
1065
|
-
constructor(entity, property) {
|
|
1066
|
-
this.entity = entity;
|
|
1067
|
-
this.property = property;
|
|
1068
|
-
this.name = signal(this.property.name);
|
|
1069
|
-
this.title = signal(this.property.title);
|
|
1070
|
-
this.description = signal(this.property.description);
|
|
1071
|
-
this.editable = computed(() => {
|
|
1072
|
-
return !(this.property.schema.readonly ?? false);
|
|
1073
|
-
});
|
|
1074
|
-
this.isRequired = computed(() => {
|
|
1075
|
-
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
1076
|
-
});
|
|
1077
|
-
this.layout = computed(() => {
|
|
1078
|
-
const updateProp = this.entity.interfaces?.master?.update?.properties?.find(c => c.name == this.property.name);
|
|
1079
|
-
const source = cloneDeep(updateProp?.layout ?? {});
|
|
1080
|
-
set(source, "positions.default.colSpan", 12);
|
|
1081
|
-
return source;
|
|
1082
|
-
});
|
|
1083
|
-
this.node = computed(() => {
|
|
1084
|
-
const schema = this.property.schema;
|
|
1085
|
-
const widget = schema.interface;
|
|
1086
|
-
return {
|
|
1087
|
-
type: widget.type,
|
|
1088
|
-
mode: this.editable() ? 'edit' : 'view',
|
|
1089
|
-
path: this.name(),
|
|
1090
|
-
children: widget.children,
|
|
1091
|
-
formula: widget.formula,
|
|
1092
|
-
triggers: widget.triggers,
|
|
1093
|
-
options: merge(schema.interface?.options,
|
|
1094
|
-
//this.property.options?.create?.widget,
|
|
1095
|
-
{ validationRules: this.property.validations })
|
|
1096
|
-
};
|
|
1097
|
-
});
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
class AXPEntityMasterUpdateViewModel {
|
|
1101
|
-
constructor(injector, config, entityData, props) {
|
|
1102
|
-
this.injector = injector;
|
|
1103
|
-
this.config = config;
|
|
1104
|
-
this.entityData = entityData;
|
|
1105
|
-
this.props = props;
|
|
1106
|
-
this.entityDef = cloneDeep(this.config);
|
|
1107
|
-
this.workflow = this.injector.get(AXPWorkflowService);
|
|
1108
|
-
this.isInProgress = signal(false);
|
|
1109
|
-
this.context = signal(cloneDeep(this.entityData));
|
|
1110
|
-
this.elements = computed(() => {
|
|
1111
|
-
const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
|
|
1112
|
-
c.schema.hidden != true);
|
|
1113
|
-
return props.map(e => {
|
|
1114
|
-
return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
|
|
1115
|
-
});
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
async save() {
|
|
1119
|
-
this.isInProgress.set(true);
|
|
1120
|
-
try {
|
|
1121
|
-
const com = this.entityDef.commands?.update;
|
|
1122
|
-
if (com) {
|
|
1123
|
-
const exec = com.execute;
|
|
1124
|
-
return await exec(this.context());
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
finally {
|
|
1128
|
-
this.isInProgress.set(false);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
reset() {
|
|
1132
|
-
this.context.set(cloneDeep(this.entityData));
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
class AXPEntityMasterUpdateViewModelFactory {
|
|
1136
|
-
constructor() {
|
|
1137
|
-
this.entityService = inject(AXPEntityDefinitionRegistryService);
|
|
1138
|
-
this.layout = inject(AXPLayoutThemeService);
|
|
1139
|
-
this.injector = inject(Injector);
|
|
1140
|
-
}
|
|
1141
|
-
async create(moduleName, entityName, id, props) {
|
|
1142
|
-
const config = await this.entityService.resolve(moduleName, entityName);
|
|
1143
|
-
this.layout.setNavigationLoading(true);
|
|
1144
|
-
if (config.queries.byKey) {
|
|
1145
|
-
const func = config.queries.byKey.execute;
|
|
1146
|
-
const data = await func(id);
|
|
1147
|
-
this.layout.setNavigationLoading(false);
|
|
1148
|
-
return new AXPEntityMasterUpdateViewModel(this.injector, config, data, props);
|
|
1149
|
-
}
|
|
1150
|
-
this.layout.setNavigationLoading(false);
|
|
1151
|
-
return Promise.reject('cannot fetch ');
|
|
1152
|
-
}
|
|
1153
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1154
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, providedIn: 'root' }); }
|
|
1155
|
-
}
|
|
1156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, decorators: [{
|
|
1157
|
-
type: Injectable,
|
|
1158
|
-
args: [{ providedIn: 'root' }]
|
|
1159
|
-
}] });
|
|
1160
|
-
|
|
1161
|
-
const AXPEntityModifyEvent = createWorkFlowEvent('[Entity] Modified');
|
|
1162
|
-
class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
1163
|
-
constructor() {
|
|
1164
|
-
super(...arguments);
|
|
1165
|
-
this.popupService = inject(AXPopupService);
|
|
1166
|
-
this.platform = inject(AXPlatform);
|
|
1167
|
-
this.translateService = inject(AXTranslationService);
|
|
1168
|
-
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
1169
|
-
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
1170
|
-
this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
|
|
1171
|
-
}
|
|
1172
|
-
async execute(context) {
|
|
1173
|
-
const [moduleName, entityName] = context.getVariable('entity').split('.');
|
|
1174
|
-
const { properties, id, title } = context.getVariable('data');
|
|
1175
|
-
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
1176
|
-
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
1177
|
-
const com = await this.config.viewers.master.modify();
|
|
1178
|
-
const popup = await this.popupService.open(com, {
|
|
1179
|
-
title: title ?? `${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
1180
|
-
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1181
|
-
data: {
|
|
1182
|
-
vm,
|
|
1183
|
-
properties,
|
|
1184
|
-
entity: entityRef,
|
|
1185
|
-
},
|
|
1186
|
-
});
|
|
1187
|
-
context.setOutput('result', false);
|
|
1188
|
-
if (popup.data?.result == true) {
|
|
1189
|
-
context.setOutput('result', true);
|
|
1190
|
-
context.setVariable('data', cloneDeep(popup.data.context));
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1194
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction }); }
|
|
1195
|
-
}
|
|
1196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction, decorators: [{
|
|
1197
|
-
type: Injectable
|
|
1198
|
-
}] });
|
|
1199
|
-
class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
1200
|
-
async execute(context) {
|
|
1201
|
-
const updatedData = context.getVariable('data');
|
|
1202
|
-
this.dispatch(AXPEntityModifyEvent({ entity: context.getVariable('entity'), values: updatedData }));
|
|
1203
|
-
}
|
|
1204
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1205
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
|
|
1206
|
-
}
|
|
1207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction, decorators: [{
|
|
1208
|
-
type: Injectable
|
|
1209
|
-
}] });
|
|
1210
|
-
const AXPModifyEntitySectionWorkflow = {
|
|
1211
|
-
startStepId: 'modifyPopup',
|
|
1212
|
-
steps: {
|
|
1213
|
-
modifyPopup: {
|
|
1214
|
-
id: 'modifyPopup',
|
|
1215
|
-
action: 'AXPEntityModifySectionPopupAction',
|
|
1216
|
-
nextSteps: [
|
|
1217
|
-
{
|
|
1218
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
1219
|
-
nextStepId: 'successToast',
|
|
1220
|
-
},
|
|
1221
|
-
],
|
|
1222
|
-
},
|
|
1223
|
-
successToast: {
|
|
1224
|
-
id: 'successToast',
|
|
1225
|
-
action: 'AXPToastAction',
|
|
1226
|
-
input: {
|
|
1227
|
-
color: 'success',
|
|
1228
|
-
title: 'workflow.entity-modified-title',
|
|
1229
|
-
content: 'workflow.entity-modified-body',
|
|
1230
|
-
},
|
|
1231
|
-
nextSteps: [
|
|
1232
|
-
{
|
|
1233
|
-
conditions: [],
|
|
1234
|
-
nextStepId: 'modifyConfirmed',
|
|
1235
|
-
},
|
|
1236
|
-
],
|
|
1237
|
-
},
|
|
1238
|
-
modifyConfirmed: {
|
|
1239
|
-
id: 'modifyConfirmed',
|
|
1240
|
-
action: 'AXPEntityModifyConfirmedAction',
|
|
1241
|
-
},
|
|
1242
|
-
},
|
|
1243
|
-
};
|
|
1244
|
-
|
|
1245
1263
|
class AXPEntityMasterSingleViewGroupViewModel {
|
|
1246
1264
|
constructor(entity, section) {
|
|
1247
1265
|
this.entity = entity;
|
|
@@ -2376,6 +2394,82 @@ const AXPWidgetSelectorWidget = {
|
|
|
2376
2394
|
},
|
|
2377
2395
|
};
|
|
2378
2396
|
|
|
2397
|
+
class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
|
|
2398
|
+
constructor() {
|
|
2399
|
+
super(...arguments);
|
|
2400
|
+
this.popupService = inject(AXPopupService);
|
|
2401
|
+
this.platform = inject(AXPlatform);
|
|
2402
|
+
this.translateService = inject(AXTranslationService);
|
|
2403
|
+
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
2404
|
+
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
2405
|
+
this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
|
|
2406
|
+
}
|
|
2407
|
+
async execute(context) {
|
|
2408
|
+
const [moduleName, entityName] = context.getVariable('entity').split('.');
|
|
2409
|
+
const data = context.getVariable('data');
|
|
2410
|
+
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
2411
|
+
const { id } = data;
|
|
2412
|
+
const { interfaces, title } = entityRef;
|
|
2413
|
+
const properties = interfaces?.master?.update?.properties?.map((p) => p.name) || [];
|
|
2414
|
+
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
2415
|
+
const com = await this.config.viewers.master.modify();
|
|
2416
|
+
const popup = await this.popupService.open(com, {
|
|
2417
|
+
title: title ??
|
|
2418
|
+
`${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
2419
|
+
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
2420
|
+
data: {
|
|
2421
|
+
vm,
|
|
2422
|
+
properties,
|
|
2423
|
+
entity: entityRef,
|
|
2424
|
+
},
|
|
2425
|
+
});
|
|
2426
|
+
context.setOutput('result', false);
|
|
2427
|
+
if (popup.data?.result == true) {
|
|
2428
|
+
context.setOutput('result', true);
|
|
2429
|
+
context.setVariable('data', cloneDeep(popup.data.context));
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPQuickEntityModifyPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2433
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPQuickEntityModifyPopupAction }); }
|
|
2434
|
+
}
|
|
2435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPQuickEntityModifyPopupAction, decorators: [{
|
|
2436
|
+
type: Injectable
|
|
2437
|
+
}] });
|
|
2438
|
+
const AXPQuickModifyEntityWorkflow = {
|
|
2439
|
+
startStepId: 'modifyPopup',
|
|
2440
|
+
steps: {
|
|
2441
|
+
modifyPopup: {
|
|
2442
|
+
id: 'modifyPopup',
|
|
2443
|
+
action: 'AXPQuickEntityModifyPopupAction',
|
|
2444
|
+
nextSteps: [
|
|
2445
|
+
{
|
|
2446
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
2447
|
+
nextStepId: 'successToast',
|
|
2448
|
+
},
|
|
2449
|
+
],
|
|
2450
|
+
},
|
|
2451
|
+
successToast: {
|
|
2452
|
+
id: 'successToast',
|
|
2453
|
+
action: 'AXPToastAction',
|
|
2454
|
+
input: {
|
|
2455
|
+
color: 'success',
|
|
2456
|
+
title: 'workflow.entity-modified-title',
|
|
2457
|
+
content: 'workflow.entity-modified-body',
|
|
2458
|
+
},
|
|
2459
|
+
nextSteps: [
|
|
2460
|
+
{
|
|
2461
|
+
conditions: [],
|
|
2462
|
+
nextStepId: 'modifyConfirmed',
|
|
2463
|
+
},
|
|
2464
|
+
],
|
|
2465
|
+
},
|
|
2466
|
+
modifyConfirmed: {
|
|
2467
|
+
id: 'modifyConfirmed',
|
|
2468
|
+
action: 'AXPEntityModifyConfirmedAction',
|
|
2469
|
+
},
|
|
2470
|
+
},
|
|
2471
|
+
};
|
|
2472
|
+
|
|
2379
2473
|
class AXPShowDetailViewAction extends AXPWorkflowAction {
|
|
2380
2474
|
constructor() {
|
|
2381
2475
|
super(...arguments);
|
|
@@ -2499,6 +2593,7 @@ class AXPEntityModule {
|
|
|
2499
2593
|
AXPEntityPerformDeleteAction,
|
|
2500
2594
|
'entity-perform-delete': AXPEntityPerformDeleteAction,
|
|
2501
2595
|
AXPEntityModifySectionPopupAction,
|
|
2596
|
+
AXPQuickEntityModifyPopupAction,
|
|
2502
2597
|
AXPEntityModifyConfirmedAction,
|
|
2503
2598
|
AXPShowDetailViewAction,
|
|
2504
2599
|
AXPEntityCreateSubmittedAction,
|
|
@@ -2508,6 +2603,7 @@ class AXPEntityModule {
|
|
|
2508
2603
|
'create-entity': AXPCreateEntityWorkflow,
|
|
2509
2604
|
'delete-entity': AXPDeleteEntityWorkflow,
|
|
2510
2605
|
'modify-entity-section': AXPModifyEntitySectionWorkflow,
|
|
2606
|
+
'quick-modify-entity': AXPQuickModifyEntityWorkflow,
|
|
2511
2607
|
'open-entity': AXPShowDetailsViewWorkflow,
|
|
2512
2608
|
'show-list-view': AXPShowListViewWorkflow,
|
|
2513
2609
|
},
|
|
@@ -2527,6 +2623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
2527
2623
|
AXPEntityPerformDeleteAction,
|
|
2528
2624
|
'entity-perform-delete': AXPEntityPerformDeleteAction,
|
|
2529
2625
|
AXPEntityModifySectionPopupAction,
|
|
2626
|
+
AXPQuickEntityModifyPopupAction,
|
|
2530
2627
|
AXPEntityModifyConfirmedAction,
|
|
2531
2628
|
AXPShowDetailViewAction,
|
|
2532
2629
|
AXPEntityCreateSubmittedAction,
|
|
@@ -2536,6 +2633,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
2536
2633
|
'create-entity': AXPCreateEntityWorkflow,
|
|
2537
2634
|
'delete-entity': AXPDeleteEntityWorkflow,
|
|
2538
2635
|
'modify-entity-section': AXPModifyEntitySectionWorkflow,
|
|
2636
|
+
'quick-modify-entity': AXPQuickModifyEntityWorkflow,
|
|
2539
2637
|
'open-entity': AXPShowDetailsViewWorkflow,
|
|
2540
2638
|
'show-list-view': AXPShowListViewWorkflow,
|
|
2541
2639
|
},
|