@acorex/platform 19.1.1 → 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 +14 -9
- 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/common/lib/settings/settings.types.d.ts +1 -0
- package/fesm2022/acorex-platform-auth.mjs +5 -4
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +72 -15
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +80 -28
- 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 +364 -256
- 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 +175 -70
- 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-CJ_HVKX-.mjs → acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CJ_HVKX-.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-BJ-ELNnN.mjs → acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs} +83 -20
- 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-DveB-N1Z.mjs → acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DveB-N1Z.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-q_DOP0cT.mjs → acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs} +11 -11
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-q_DOP0cT.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 +47 -98
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +248 -54
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +258 -34
- 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 +12 -5
- package/layout/entity/lib/entity-master-create.viewmodel.d.ts +3 -3
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -1
- package/layout/entity/lib/entity.viewmodel.d.ts +1 -0
- 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 +15 -11
- package/themes/default/index.d.ts +0 -1
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +48 -3
- 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 +51 -0
- 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 -1
- package/themes/shared/lib/components/layout-elements/layout-actions.component.d.ts +20 -0
- 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/properties/layout.props.d.ts +2 -0
- package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/index.d.ts +1 -0
- package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +12 -0
- package/widgets/lib/widgets/property-editors/border/border-widget-type.d.ts +18 -0
- package/widgets/lib/widgets/property-editors/border/border-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/property-editors/border/index.d.ts +3 -0
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +14 -4
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +9 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BJ-ELNnN.mjs.map +0 -1
- package/themes/default/lib/layouts/setting-layout/index.d.ts +0 -2
- package/themes/default/lib/layouts/setting-layout/setting-menu/setting-menu.component.d.ts +0 -10
- package/themes/shared/lib/components/layout-elements/layout-page-header.component.d.ts +0 -11
|
@@ -6,16 +6,16 @@ import * as i1$3 from '@acorex/platform/workflow';
|
|
|
6
6
|
import { AXPWorkflowService, createWorkFlowEvent, AXPWorkflowAction, ofType, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { InjectionToken, inject, Injectable, computed, signal, Injector, effect, Component, ChangeDetectionStrategy, HostBinding, DestroyRef, ViewChild, NgModule } from '@angular/core';
|
|
9
|
-
import { cloneDeep, set, merge, isNil, get, sortBy } from 'lodash-es';
|
|
10
9
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
|
10
|
+
import { cloneDeep, set, merge, isNil, get, sortBy } from 'lodash-es';
|
|
11
11
|
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
|
12
12
|
import { Subject, takeUntil } from 'rxjs';
|
|
13
|
-
import { AXDialogService } from '@acorex/components/dialog';
|
|
14
|
-
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
15
|
-
import * as i8 from '@acorex/core/translation';
|
|
16
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
17
13
|
import { AXPopupService } from '@acorex/components/popup';
|
|
18
14
|
import { AXPlatform } from '@acorex/core/platform';
|
|
15
|
+
import * as i8 from '@acorex/core/translation';
|
|
16
|
+
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
17
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
18
|
+
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
19
19
|
import * as i7 from '@acorex/platform/layout/builder';
|
|
20
20
|
import { AXPWidgetComponent, AXPLayoutBuilderModule, AXPLayoutBuilderService, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_GROUP, AXPWidgetsCatalog, AXPWidgetRegistryService } from '@acorex/platform/layout/builder';
|
|
21
21
|
import { RouterModule, ROUTES } from '@angular/router';
|
|
@@ -77,7 +77,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
77
77
|
|
|
78
78
|
class AXPEntityCommandTriggerViewModel {
|
|
79
79
|
constructor(entity, action) {
|
|
80
|
-
this.name = action.command;
|
|
80
|
+
this.name = typeof action.command === 'string' ? action.command : action.command.name;
|
|
81
|
+
this.options = typeof action.command === 'object' ? action.command.options : undefined;
|
|
81
82
|
const resolvedLook = resolveActionLook(action);
|
|
82
83
|
this.priority = action.priority;
|
|
83
84
|
this.title = action.title;
|
|
@@ -354,28 +355,25 @@ class AXPEntityCreateViewSectionViewModel {
|
|
|
354
355
|
constructor(entity, section) {
|
|
355
356
|
this.entity = entity;
|
|
356
357
|
this.section = section;
|
|
357
|
-
this.group = this.entity.groups?.find(c => c.id == this.section.id);
|
|
358
|
+
this.group = this.entity.groups?.find((c) => c.id == this.section.id);
|
|
358
359
|
this.name = signal(this.group.id);
|
|
359
360
|
this.title = computed(() => {
|
|
360
361
|
return this.group.title ?? this.group.id;
|
|
361
362
|
});
|
|
362
363
|
this.description = computed(() => {
|
|
363
364
|
return this.group.description;
|
|
364
|
-
;
|
|
365
365
|
});
|
|
366
366
|
this.layout = computed(() => {
|
|
367
367
|
const source = cloneDeep(this.section.layout ?? {});
|
|
368
|
-
set(source,
|
|
368
|
+
set(source, 'positions.default.colSpan', 12);
|
|
369
369
|
return source;
|
|
370
370
|
});
|
|
371
371
|
this.elements = computed(() => {
|
|
372
372
|
const { interfaces, properties } = this.entity;
|
|
373
373
|
const createProps = interfaces?.master?.create?.properties ?? [];
|
|
374
374
|
const createPropNames = new Set(createProps.map(({ name }) => name));
|
|
375
|
-
const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId === this.group.id &&
|
|
376
|
-
|
|
377
|
-
createPropNames.has(name));
|
|
378
|
-
return filteredProperties.map(property => {
|
|
375
|
+
const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId === this.group.id && !schema.hidden && createPropNames.has(name));
|
|
376
|
+
return filteredProperties.map((property) => {
|
|
379
377
|
const createProp = createProps.find(({ name }) => name === property.name);
|
|
380
378
|
return new AXPEntityCreateViewElementViewModel(this.entity, this, property, createProp);
|
|
381
379
|
});
|
|
@@ -395,11 +393,11 @@ class AXPEntityCreateViewElementViewModel {
|
|
|
395
393
|
return !(this.property.schema.readonly ?? false);
|
|
396
394
|
});
|
|
397
395
|
this.isRequired = computed(() => {
|
|
398
|
-
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
396
|
+
return this.property.validations?.some((c) => c.rule == 'required') || false;
|
|
399
397
|
});
|
|
400
398
|
this.layout = computed(() => {
|
|
401
399
|
const source = cloneDeep(this.createProp.layout ?? {});
|
|
402
|
-
set(source,
|
|
400
|
+
set(source, 'positions.default.colSpan', 12);
|
|
403
401
|
return source;
|
|
404
402
|
});
|
|
405
403
|
this.node = computed(() => {
|
|
@@ -414,7 +412,7 @@ class AXPEntityCreateViewElementViewModel {
|
|
|
414
412
|
triggers: widget.triggers,
|
|
415
413
|
options: merge(schema.interface?.options,
|
|
416
414
|
//this.property.options?.create?.widget,
|
|
417
|
-
{ validationRules: this.property.validations })
|
|
415
|
+
{ validationRules: this.property.validations }),
|
|
418
416
|
};
|
|
419
417
|
});
|
|
420
418
|
}
|
|
@@ -435,13 +433,13 @@ class AXPEntityMasterCreateViewModel {
|
|
|
435
433
|
const createProps = interfaces?.master?.create?.properties?.map(({ name }) => name) ?? [];
|
|
436
434
|
const visibleProperties = properties.filter(({ groupId, schema, name }) => groupId && !schema.hidden && createProps.includes(name));
|
|
437
435
|
const sections = interfaces?.master?.create?.sections?.filter(({ id }) => visibleProperties.some(({ groupId }) => groupId === id)) ?? [];
|
|
438
|
-
return sections.map(section => new AXPEntityCreateViewSectionViewModel(this.entityDef, section));
|
|
436
|
+
return sections.map((section) => new AXPEntityCreateViewSectionViewModel(this.entityDef, section));
|
|
439
437
|
});
|
|
440
438
|
if (!initialData)
|
|
441
439
|
initialData = {};
|
|
442
440
|
this.config.properties
|
|
443
|
-
.filter(c => c.schema.defaultValue != null)
|
|
444
|
-
.forEach(p => {
|
|
441
|
+
.filter((c) => c.schema.defaultValue != null)
|
|
442
|
+
.forEach((p) => {
|
|
445
443
|
if (typeof p.schema.defaultValue === 'function') {
|
|
446
444
|
const func = p.schema.defaultValue;
|
|
447
445
|
set(initialData, p.name, func(initialData));
|
|
@@ -459,7 +457,7 @@ class AXPEntityMasterCreateViewModel {
|
|
|
459
457
|
try {
|
|
460
458
|
this.isInProgress.set(true);
|
|
461
459
|
const exec = this.entityDef.commands?.create?.execute;
|
|
462
|
-
return await exec(
|
|
460
|
+
return await exec(this.context());
|
|
463
461
|
}
|
|
464
462
|
finally {
|
|
465
463
|
this.isInProgress.set(false);
|
|
@@ -467,7 +465,11 @@ class AXPEntityMasterCreateViewModel {
|
|
|
467
465
|
}
|
|
468
466
|
async createNewOne() {
|
|
469
467
|
await this.workflow.execute('create-entity', {
|
|
470
|
-
entity: getEntityInfo(this.entityDef).source
|
|
468
|
+
entity: getEntityInfo(this.entityDef).source,
|
|
469
|
+
options: {
|
|
470
|
+
redirect: false,
|
|
471
|
+
canCreateNewOne: this.canCreateNewOne,
|
|
472
|
+
},
|
|
471
473
|
});
|
|
472
474
|
}
|
|
473
475
|
}
|
|
@@ -478,6 +480,7 @@ class AXPEntityCreateViewModelFactory {
|
|
|
478
480
|
this.injector = inject(Injector);
|
|
479
481
|
}
|
|
480
482
|
async create(moduleName, entityName, initialData = null, options = { canCreateNewOne: false, redirect: true }) {
|
|
483
|
+
console.log(options);
|
|
481
484
|
this.layout.setNavigationLoading(true);
|
|
482
485
|
const config = await this.entityService.resolve(moduleName, entityName);
|
|
483
486
|
this.layout.setNavigationLoading(false);
|
|
@@ -491,6 +494,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
491
494
|
args: [{ providedIn: 'root' }]
|
|
492
495
|
}] });
|
|
493
496
|
|
|
497
|
+
const AXPEntityCreateEvent = createWorkFlowEvent('[Entity] Created!');
|
|
498
|
+
class AXPEntityCreatePopupAction extends AXPWorkflowAction {
|
|
499
|
+
constructor() {
|
|
500
|
+
super(...arguments);
|
|
501
|
+
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
502
|
+
this.popupService = inject(AXPopupService);
|
|
503
|
+
this.platform = inject(AXPlatform);
|
|
504
|
+
this.factory = inject(AXPEntityCreateViewModelFactory);
|
|
505
|
+
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
506
|
+
this.translateService = inject(AXTranslationService);
|
|
507
|
+
}
|
|
508
|
+
async execute(context) {
|
|
509
|
+
const [module, entity] = context.getVariable('entity').split('.');
|
|
510
|
+
const data = context.getVariable('data');
|
|
511
|
+
const options = context.getVariable('options');
|
|
512
|
+
const redirect = options?.['redirect'];
|
|
513
|
+
const canCreateNewOne = options?.['canCreateNewOne'];
|
|
514
|
+
const entityRef = await this.entityRegistery.resolve(module, entity);
|
|
515
|
+
const com = await this.config.viewers.master.create();
|
|
516
|
+
const result = await this.popupService.open(com, {
|
|
517
|
+
title: `${await this.translateService.translateAsync('create-new')} ${await this.translateService.translateAsync(entityRef.formats.individual)}`,
|
|
518
|
+
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
519
|
+
data: {
|
|
520
|
+
vm: await this.factory.create(module, entity, data, { canCreateNewOne, redirect }),
|
|
521
|
+
entity,
|
|
522
|
+
},
|
|
523
|
+
});
|
|
524
|
+
context.setOutput('result', false);
|
|
525
|
+
if (result.data?.save) {
|
|
526
|
+
context.setOutput('result', true);
|
|
527
|
+
const prevData = context.getVariable('data');
|
|
528
|
+
context.setVariable('data', { ...prevData, ...result.data.item });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
532
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreatePopupAction }); }
|
|
533
|
+
}
|
|
534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreatePopupAction, decorators: [{
|
|
535
|
+
type: Injectable
|
|
536
|
+
}] });
|
|
537
|
+
class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
|
|
538
|
+
async execute(context) {
|
|
539
|
+
this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity'), meta: context.getVariable('meta') }));
|
|
540
|
+
}
|
|
541
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateSubmittedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
542
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateSubmittedAction }); }
|
|
543
|
+
}
|
|
544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateSubmittedAction, decorators: [{
|
|
545
|
+
type: Injectable
|
|
546
|
+
}] });
|
|
547
|
+
const AXPCreateEntityWorkflow = {
|
|
548
|
+
startStepId: 'show-popup',
|
|
549
|
+
steps: {
|
|
550
|
+
'show-popup': {
|
|
551
|
+
action: 'AXPEntityCreatePopupAction',
|
|
552
|
+
nextSteps: [
|
|
553
|
+
{
|
|
554
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
555
|
+
nextStepId: 'show-toast',
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
},
|
|
559
|
+
'show-toast': {
|
|
560
|
+
action: 'AXPToastAction',
|
|
561
|
+
input: {
|
|
562
|
+
color: 'success',
|
|
563
|
+
title: 'workflow.entity-created',
|
|
564
|
+
content: 'workflow.entity-created-body',
|
|
565
|
+
},
|
|
566
|
+
nextSteps: [
|
|
567
|
+
{
|
|
568
|
+
conditions: [],
|
|
569
|
+
nextStepId: 'dispatch-event',
|
|
570
|
+
},
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
'dispatch-event': {
|
|
574
|
+
action: 'AXPEntityCreateSubmittedAction',
|
|
575
|
+
nextSteps: [
|
|
576
|
+
{
|
|
577
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getVariable("options")?.redirect != false' }],
|
|
578
|
+
nextStepId: 'show-entity',
|
|
579
|
+
},
|
|
580
|
+
],
|
|
581
|
+
},
|
|
582
|
+
'show-entity': {
|
|
583
|
+
action: 'AXPShowDetailViewAction',
|
|
584
|
+
},
|
|
585
|
+
},
|
|
586
|
+
};
|
|
587
|
+
|
|
494
588
|
const AXPEntityDeletedEvent = createWorkFlowEvent('[Entity] Deleted');
|
|
495
589
|
class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
496
590
|
constructor() {
|
|
@@ -614,6 +708,187 @@ const AXPDeleteEntityWorkflow = {
|
|
|
614
708
|
},
|
|
615
709
|
};
|
|
616
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
|
+
|
|
617
892
|
class AXPEntityMasterListViewQueryViewModel {
|
|
618
893
|
constructor(entity, section, view) {
|
|
619
894
|
this.entity = entity;
|
|
@@ -659,9 +934,6 @@ class AXPEntityMasterListViewModel {
|
|
|
659
934
|
//****************** Views ******************//
|
|
660
935
|
this.views = computed(() => {
|
|
661
936
|
const views = this.entityDef.interfaces?.master?.list?.views ?? [];
|
|
662
|
-
console.log(views.map((v) => {
|
|
663
|
-
return new AXPEntityMasterListViewQueryViewModel(this.entityDef, this, v);
|
|
664
|
-
}));
|
|
665
937
|
return views.map((v) => {
|
|
666
938
|
return new AXPEntityMasterListViewQueryViewModel(this.entityDef, this, v);
|
|
667
939
|
});
|
|
@@ -796,9 +1068,10 @@ class AXPEntityMasterListViewModel {
|
|
|
796
1068
|
};
|
|
797
1069
|
this.sortedFields = signal([]);
|
|
798
1070
|
this.workflow.events$
|
|
799
|
-
.pipe(ofType(AXPEntityDeletedEvent))
|
|
1071
|
+
.pipe(ofType(AXPEntityDeletedEvent, AXPEntityCreateEvent, AXPEntityModifyEvent))
|
|
800
1072
|
.pipe(takeUntil(this.destroyed))
|
|
801
1073
|
.subscribe((event) => {
|
|
1074
|
+
console.log('omed');
|
|
802
1075
|
if (event.payload.entity == getEntityInfo(this.entityDef).source) {
|
|
803
1076
|
this.selectedItems.set([]);
|
|
804
1077
|
this.events$.next({ action: 'refresh' });
|
|
@@ -820,6 +1093,23 @@ class AXPEntityMasterListViewModel {
|
|
|
820
1093
|
clearSelection() {
|
|
821
1094
|
this.selectedItems.set([]);
|
|
822
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
|
+
}
|
|
823
1113
|
applyInlineFilter(value) {
|
|
824
1114
|
const props = this.entityDef.properties.filter((c) => c.options?.filter?.inline?.enabled);
|
|
825
1115
|
this.inlineFilters.filters = [];
|
|
@@ -924,9 +1214,18 @@ class AXPEntityMasterListViewModel {
|
|
|
924
1214
|
? c.scope == AXPEntityCommandScope.Selected
|
|
925
1215
|
: c.scope == AXPEntityCommandScope.Individual) ||
|
|
926
1216
|
c.scope == AXPEntityCommandScope.TypeLevel));
|
|
1217
|
+
console.log('action: ', action);
|
|
927
1218
|
await this.workflow.execute(commandName, {
|
|
928
1219
|
entity: getEntityInfo(this.entityDef).source,
|
|
1220
|
+
entityInfo: {
|
|
1221
|
+
name: this.entityDef.name,
|
|
1222
|
+
module: this.entityDef.module,
|
|
1223
|
+
title: this.entityDef.title,
|
|
1224
|
+
parentKey: this.entityDef.parentKey,
|
|
1225
|
+
source: this.entityDef.source,
|
|
1226
|
+
},
|
|
929
1227
|
data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
|
|
1228
|
+
options: action?.options,
|
|
930
1229
|
});
|
|
931
1230
|
}
|
|
932
1231
|
//
|
|
@@ -961,187 +1260,6 @@ const AXPEntityListViewModelResolver = (route, state, service = inject(AXPEntity
|
|
|
961
1260
|
return service.create(moduleName, entityName);
|
|
962
1261
|
};
|
|
963
1262
|
|
|
964
|
-
class AXPEntityMasterUpdateElementViewModel {
|
|
965
|
-
constructor(entity, property) {
|
|
966
|
-
this.entity = entity;
|
|
967
|
-
this.property = property;
|
|
968
|
-
this.name = signal(this.property.name);
|
|
969
|
-
this.title = signal(this.property.title);
|
|
970
|
-
this.description = signal(this.property.description);
|
|
971
|
-
this.editable = computed(() => {
|
|
972
|
-
return !(this.property.schema.readonly ?? false);
|
|
973
|
-
});
|
|
974
|
-
this.isRequired = computed(() => {
|
|
975
|
-
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
976
|
-
});
|
|
977
|
-
this.layout = computed(() => {
|
|
978
|
-
const updateProp = this.entity.interfaces?.master?.update?.properties?.find(c => c.name == this.property.name);
|
|
979
|
-
const source = cloneDeep(updateProp?.layout ?? {});
|
|
980
|
-
set(source, "positions.default.colSpan", 12);
|
|
981
|
-
return source;
|
|
982
|
-
});
|
|
983
|
-
this.node = computed(() => {
|
|
984
|
-
const schema = this.property.schema;
|
|
985
|
-
const widget = schema.interface;
|
|
986
|
-
return {
|
|
987
|
-
type: widget.type,
|
|
988
|
-
mode: this.editable() ? 'edit' : 'view',
|
|
989
|
-
path: this.name(),
|
|
990
|
-
children: widget.children,
|
|
991
|
-
formula: widget.formula,
|
|
992
|
-
triggers: widget.triggers,
|
|
993
|
-
options: merge(schema.interface?.options,
|
|
994
|
-
//this.property.options?.create?.widget,
|
|
995
|
-
{ validationRules: this.property.validations })
|
|
996
|
-
};
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
class AXPEntityMasterUpdateViewModel {
|
|
1001
|
-
constructor(injector, config, entityData, props) {
|
|
1002
|
-
this.injector = injector;
|
|
1003
|
-
this.config = config;
|
|
1004
|
-
this.entityData = entityData;
|
|
1005
|
-
this.props = props;
|
|
1006
|
-
this.entityDef = cloneDeep(this.config);
|
|
1007
|
-
this.workflow = this.injector.get(AXPWorkflowService);
|
|
1008
|
-
this.isInProgress = signal(false);
|
|
1009
|
-
this.context = signal(cloneDeep(this.entityData));
|
|
1010
|
-
this.elements = computed(() => {
|
|
1011
|
-
const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
|
|
1012
|
-
c.schema.hidden != true);
|
|
1013
|
-
return props.map(e => {
|
|
1014
|
-
return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
|
|
1015
|
-
});
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
async save() {
|
|
1019
|
-
this.isInProgress.set(true);
|
|
1020
|
-
try {
|
|
1021
|
-
const com = this.entityDef.commands?.update;
|
|
1022
|
-
if (com) {
|
|
1023
|
-
const exec = com.execute;
|
|
1024
|
-
return await exec(this.context());
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
finally {
|
|
1028
|
-
this.isInProgress.set(false);
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
reset() {
|
|
1032
|
-
this.context.set(cloneDeep(this.entityData));
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
class AXPEntityMasterUpdateViewModelFactory {
|
|
1036
|
-
constructor() {
|
|
1037
|
-
this.entityService = inject(AXPEntityDefinitionRegistryService);
|
|
1038
|
-
this.layout = inject(AXPLayoutThemeService);
|
|
1039
|
-
this.injector = inject(Injector);
|
|
1040
|
-
}
|
|
1041
|
-
async create(moduleName, entityName, id, props) {
|
|
1042
|
-
const config = await this.entityService.resolve(moduleName, entityName);
|
|
1043
|
-
this.layout.setNavigationLoading(true);
|
|
1044
|
-
if (config.queries.byKey) {
|
|
1045
|
-
const func = config.queries.byKey.execute;
|
|
1046
|
-
const data = await func(id);
|
|
1047
|
-
this.layout.setNavigationLoading(false);
|
|
1048
|
-
return new AXPEntityMasterUpdateViewModel(this.injector, config, data, props);
|
|
1049
|
-
}
|
|
1050
|
-
this.layout.setNavigationLoading(false);
|
|
1051
|
-
return Promise.reject('cannot fetch ');
|
|
1052
|
-
}
|
|
1053
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1054
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, providedIn: 'root' }); }
|
|
1055
|
-
}
|
|
1056
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, decorators: [{
|
|
1057
|
-
type: Injectable,
|
|
1058
|
-
args: [{ providedIn: 'root' }]
|
|
1059
|
-
}] });
|
|
1060
|
-
|
|
1061
|
-
const AXPEntityModifyEvent = createWorkFlowEvent('[Entity] Modified');
|
|
1062
|
-
class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
1063
|
-
constructor() {
|
|
1064
|
-
super(...arguments);
|
|
1065
|
-
this.popupService = inject(AXPopupService);
|
|
1066
|
-
this.platform = inject(AXPlatform);
|
|
1067
|
-
this.translateService = inject(AXTranslationService);
|
|
1068
|
-
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
1069
|
-
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
1070
|
-
this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
|
|
1071
|
-
}
|
|
1072
|
-
async execute(context) {
|
|
1073
|
-
const [moduleName, entityName] = context.getVariable('entity').split('.');
|
|
1074
|
-
const { properties, id, title } = context.getVariable('data');
|
|
1075
|
-
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
1076
|
-
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
1077
|
-
const com = await this.config.viewers.master.modify();
|
|
1078
|
-
const popup = await this.popupService.open(com, {
|
|
1079
|
-
title: title ?? `${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
1080
|
-
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1081
|
-
data: {
|
|
1082
|
-
vm,
|
|
1083
|
-
properties,
|
|
1084
|
-
entity: entityRef,
|
|
1085
|
-
},
|
|
1086
|
-
});
|
|
1087
|
-
context.setOutput('result', false);
|
|
1088
|
-
if (popup.data?.result == true) {
|
|
1089
|
-
context.setOutput('result', true);
|
|
1090
|
-
context.setVariable('data', cloneDeep(popup.data.context));
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1094
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction }); }
|
|
1095
|
-
}
|
|
1096
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifySectionPopupAction, decorators: [{
|
|
1097
|
-
type: Injectable
|
|
1098
|
-
}] });
|
|
1099
|
-
class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
1100
|
-
async execute(context) {
|
|
1101
|
-
const updatedData = context.getVariable('data');
|
|
1102
|
-
this.dispatch(AXPEntityModifyEvent({ entity: context.getVariable('entity'), values: updatedData }));
|
|
1103
|
-
}
|
|
1104
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1105
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
|
|
1106
|
-
}
|
|
1107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModifyConfirmedAction, decorators: [{
|
|
1108
|
-
type: Injectable
|
|
1109
|
-
}] });
|
|
1110
|
-
const AXPModifyEntitySectionWorkflow = {
|
|
1111
|
-
startStepId: 'modifyPopup',
|
|
1112
|
-
steps: {
|
|
1113
|
-
modifyPopup: {
|
|
1114
|
-
id: 'modifyPopup',
|
|
1115
|
-
action: 'AXPEntityModifySectionPopupAction',
|
|
1116
|
-
nextSteps: [
|
|
1117
|
-
{
|
|
1118
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
1119
|
-
nextStepId: 'successToast',
|
|
1120
|
-
},
|
|
1121
|
-
],
|
|
1122
|
-
},
|
|
1123
|
-
successToast: {
|
|
1124
|
-
id: 'successToast',
|
|
1125
|
-
action: 'AXPToastAction',
|
|
1126
|
-
input: {
|
|
1127
|
-
color: 'success',
|
|
1128
|
-
title: 'workflow.entity-modified-title',
|
|
1129
|
-
content: 'workflow.entity-modified-body',
|
|
1130
|
-
},
|
|
1131
|
-
nextSteps: [
|
|
1132
|
-
{
|
|
1133
|
-
conditions: [],
|
|
1134
|
-
nextStepId: 'modifyConfirmed',
|
|
1135
|
-
},
|
|
1136
|
-
],
|
|
1137
|
-
},
|
|
1138
|
-
modifyConfirmed: {
|
|
1139
|
-
id: 'modifyConfirmed',
|
|
1140
|
-
action: 'AXPEntityModifyConfirmedAction',
|
|
1141
|
-
},
|
|
1142
|
-
},
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
1263
|
class AXPEntityMasterSingleViewGroupViewModel {
|
|
1146
1264
|
constructor(entity, section) {
|
|
1147
1265
|
this.entity = entity;
|
|
@@ -2276,92 +2394,78 @@ const AXPWidgetSelectorWidget = {
|
|
|
2276
2394
|
},
|
|
2277
2395
|
};
|
|
2278
2396
|
|
|
2279
|
-
|
|
2280
|
-
class AXPEntityCreatePopupAction extends AXPWorkflowAction {
|
|
2397
|
+
class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
|
|
2281
2398
|
constructor() {
|
|
2282
2399
|
super(...arguments);
|
|
2283
|
-
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
2284
2400
|
this.popupService = inject(AXPopupService);
|
|
2285
2401
|
this.platform = inject(AXPlatform);
|
|
2286
|
-
this.factory = inject(AXPEntityCreateViewModelFactory);
|
|
2287
|
-
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
2288
2402
|
this.translateService = inject(AXTranslationService);
|
|
2403
|
+
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
2404
|
+
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
2405
|
+
this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
|
|
2289
2406
|
}
|
|
2290
2407
|
async execute(context) {
|
|
2291
|
-
const [
|
|
2408
|
+
const [moduleName, entityName] = context.getVariable('entity').split('.');
|
|
2292
2409
|
const data = context.getVariable('data');
|
|
2293
|
-
const
|
|
2294
|
-
const
|
|
2295
|
-
const
|
|
2296
|
-
const
|
|
2297
|
-
const
|
|
2298
|
-
|
|
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)}`,
|
|
2299
2419
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
2300
2420
|
data: {
|
|
2301
|
-
vm
|
|
2302
|
-
|
|
2421
|
+
vm,
|
|
2422
|
+
properties,
|
|
2423
|
+
entity: entityRef,
|
|
2303
2424
|
},
|
|
2304
2425
|
});
|
|
2305
2426
|
context.setOutput('result', false);
|
|
2306
|
-
if (
|
|
2427
|
+
if (popup.data?.result == true) {
|
|
2307
2428
|
context.setOutput('result', true);
|
|
2308
|
-
|
|
2309
|
-
context.setVariable('data', { ...prevData, ...result.data.item });
|
|
2429
|
+
context.setVariable('data', cloneDeep(popup.data.context));
|
|
2310
2430
|
}
|
|
2311
2431
|
}
|
|
2312
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
|
2313
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
|
2314
|
-
}
|
|
2315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreatePopupAction, decorators: [{
|
|
2316
|
-
type: Injectable
|
|
2317
|
-
}] });
|
|
2318
|
-
class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
|
|
2319
|
-
async execute(context) {
|
|
2320
|
-
this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity'), meta: context.getVariable('meta') }));
|
|
2321
|
-
}
|
|
2322
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateSubmittedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2323
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateSubmittedAction }); }
|
|
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 }); }
|
|
2324
2434
|
}
|
|
2325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
|
2435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPQuickEntityModifyPopupAction, decorators: [{
|
|
2326
2436
|
type: Injectable
|
|
2327
2437
|
}] });
|
|
2328
|
-
const
|
|
2329
|
-
startStepId: '
|
|
2438
|
+
const AXPQuickModifyEntityWorkflow = {
|
|
2439
|
+
startStepId: 'modifyPopup',
|
|
2330
2440
|
steps: {
|
|
2331
|
-
|
|
2332
|
-
|
|
2441
|
+
modifyPopup: {
|
|
2442
|
+
id: 'modifyPopup',
|
|
2443
|
+
action: 'AXPQuickEntityModifyPopupAction',
|
|
2333
2444
|
nextSteps: [
|
|
2334
2445
|
{
|
|
2335
2446
|
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
2336
|
-
nextStepId: '
|
|
2447
|
+
nextStepId: 'successToast',
|
|
2337
2448
|
},
|
|
2338
2449
|
],
|
|
2339
2450
|
},
|
|
2340
|
-
|
|
2451
|
+
successToast: {
|
|
2452
|
+
id: 'successToast',
|
|
2341
2453
|
action: 'AXPToastAction',
|
|
2342
2454
|
input: {
|
|
2343
2455
|
color: 'success',
|
|
2344
|
-
title: 'workflow.entity-
|
|
2345
|
-
content: 'workflow.entity-
|
|
2456
|
+
title: 'workflow.entity-modified-title',
|
|
2457
|
+
content: 'workflow.entity-modified-body',
|
|
2346
2458
|
},
|
|
2347
2459
|
nextSteps: [
|
|
2348
2460
|
{
|
|
2349
2461
|
conditions: [],
|
|
2350
|
-
nextStepId: '
|
|
2351
|
-
},
|
|
2352
|
-
],
|
|
2353
|
-
},
|
|
2354
|
-
'dispatch-event': {
|
|
2355
|
-
action: 'AXPEntityCreateSubmittedAction',
|
|
2356
|
-
nextSteps: [
|
|
2357
|
-
{
|
|
2358
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getVariable("redirect") != false' }],
|
|
2359
|
-
nextStepId: 'show-entity',
|
|
2462
|
+
nextStepId: 'modifyConfirmed',
|
|
2360
2463
|
},
|
|
2361
2464
|
],
|
|
2362
2465
|
},
|
|
2363
|
-
|
|
2364
|
-
|
|
2466
|
+
modifyConfirmed: {
|
|
2467
|
+
id: 'modifyConfirmed',
|
|
2468
|
+
action: 'AXPEntityModifyConfirmedAction',
|
|
2365
2469
|
},
|
|
2366
2470
|
},
|
|
2367
2471
|
};
|
|
@@ -2489,6 +2593,7 @@ class AXPEntityModule {
|
|
|
2489
2593
|
AXPEntityPerformDeleteAction,
|
|
2490
2594
|
'entity-perform-delete': AXPEntityPerformDeleteAction,
|
|
2491
2595
|
AXPEntityModifySectionPopupAction,
|
|
2596
|
+
AXPQuickEntityModifyPopupAction,
|
|
2492
2597
|
AXPEntityModifyConfirmedAction,
|
|
2493
2598
|
AXPShowDetailViewAction,
|
|
2494
2599
|
AXPEntityCreateSubmittedAction,
|
|
@@ -2498,6 +2603,7 @@ class AXPEntityModule {
|
|
|
2498
2603
|
'create-entity': AXPCreateEntityWorkflow,
|
|
2499
2604
|
'delete-entity': AXPDeleteEntityWorkflow,
|
|
2500
2605
|
'modify-entity-section': AXPModifyEntitySectionWorkflow,
|
|
2606
|
+
'quick-modify-entity': AXPQuickModifyEntityWorkflow,
|
|
2501
2607
|
'open-entity': AXPShowDetailsViewWorkflow,
|
|
2502
2608
|
'show-list-view': AXPShowListViewWorkflow,
|
|
2503
2609
|
},
|
|
@@ -2517,6 +2623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
2517
2623
|
AXPEntityPerformDeleteAction,
|
|
2518
2624
|
'entity-perform-delete': AXPEntityPerformDeleteAction,
|
|
2519
2625
|
AXPEntityModifySectionPopupAction,
|
|
2626
|
+
AXPQuickEntityModifyPopupAction,
|
|
2520
2627
|
AXPEntityModifyConfirmedAction,
|
|
2521
2628
|
AXPShowDetailViewAction,
|
|
2522
2629
|
AXPEntityCreateSubmittedAction,
|
|
@@ -2526,6 +2633,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
2526
2633
|
'create-entity': AXPCreateEntityWorkflow,
|
|
2527
2634
|
'delete-entity': AXPDeleteEntityWorkflow,
|
|
2528
2635
|
'modify-entity-section': AXPModifyEntitySectionWorkflow,
|
|
2636
|
+
'quick-modify-entity': AXPQuickModifyEntityWorkflow,
|
|
2529
2637
|
'open-entity': AXPShowDetailsViewWorkflow,
|
|
2530
2638
|
'show-list-view': AXPShowListViewWorkflow,
|
|
2531
2639
|
},
|