@mediusinc/mng-commons 0.2.23 → 0.3.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.
- package/esm2020/lib/api/models/filter-param.model.mjs +1 -2
- package/esm2020/lib/api/models/mappers.mjs +2 -6
- package/esm2020/lib/api/models/query-mode.model.mjs +1 -2
- package/esm2020/lib/api/models/query-param.model.mjs +1 -2
- package/esm2020/lib/api/models/query-result.model.mjs +6 -34
- package/esm2020/lib/api/services/api.abstract.service.mjs +34 -0
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +15 -32
- package/esm2020/lib/api/services/get-all-api.abstract.service.mjs +23 -0
- package/esm2020/lib/api/services/index.mjs +3 -1
- package/esm2020/lib/components/action/action.component.mjs +29 -7
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +9 -8
- package/esm2020/lib/components/action/models/action-execution.model.mjs +1 -1
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +4 -6
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +30 -9
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
- package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
- package/esm2020/lib/descriptors/action.descriptor.mjs +87 -4
- package/esm2020/lib/descriptors/editor.descriptor.mjs +11 -12
- package/esm2020/lib/descriptors/table.descriptor.mjs +4 -1
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +5 -5
- package/esm2020/lib/mng-commons.module.mjs +6 -2
- package/esm2020/lib/models/error.model.mjs +1 -1
- package/esm2020/lib/pipes/enum.pipe.mjs +4 -1
- package/esm2020/lib/pipes/index.mjs +2 -1
- package/esm2020/lib/pipes/link-formatter.pipe.mjs +39 -0
- package/esm2020/lib/services/action-executor.service.mjs +36 -41
- package/esm2020/lib/utils/index.mjs +2 -2
- package/esm2020/lib/utils/notification.util.mjs +47 -0
- package/fesm2015/mediusinc-mng-commons.mjs +417 -246
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +413 -244
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/query-result.model.d.ts +4 -17
- package/lib/api/services/api.abstract.service.d.ts +19 -0
- package/lib/api/services/crud-api.abstract.service.d.ts +3 -11
- package/lib/api/services/get-all-api.abstract.service.d.ts +11 -0
- package/lib/api/services/index.d.ts +2 -0
- package/lib/components/action/action.component.d.ts +12 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/components/tableview/route/tableview-route.component.d.ts +4 -1
- package/lib/descriptors/action.descriptor.d.ts +35 -1
- package/lib/descriptors/editor.descriptor.d.ts +4 -6
- package/lib/descriptors/tableview.descriptor.d.ts +2 -2
- package/lib/mng-commons.module.d.ts +69 -68
- package/lib/models/error.model.d.ts +2 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/pipes/link-formatter.pipe.d.ts +11 -0
- package/lib/services/action-executor.service.d.ts +5 -3
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/{toast.util.d.ts → notification.util.d.ts} +7 -10
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_button.scss +4 -0
- package/{assets/templates → templates}/tableview-route.component.html +0 -0
- package/esm2020/lib/utils/toast.util.mjs +0 -44
|
@@ -2,7 +2,7 @@ import * as i4 from '@angular/common';
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { InjectionToken, Injectable, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, Input, Output, Directive, ContentChildren, ViewChild, forwardRef,
|
|
5
|
+
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
6
6
|
import * as i2$1 from '@angular/forms';
|
|
7
7
|
import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
8
8
|
import * as i1 from '@angular/router';
|
|
@@ -169,7 +169,6 @@ var MediusFilterMatchType;
|
|
|
169
169
|
MediusFilterMatchType["GreaterThan"] = "GREATER_THAN";
|
|
170
170
|
})(MediusFilterMatchType || (MediusFilterMatchType = {}));
|
|
171
171
|
|
|
172
|
-
/* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
|
|
173
172
|
class MediusFilterParam {
|
|
174
173
|
static getAttributeTypeMap() {
|
|
175
174
|
return MediusFilterParam.attributeTypeMap;
|
|
@@ -203,7 +202,6 @@ MediusFilterParam.attributeTypeMap = [
|
|
|
203
202
|
}
|
|
204
203
|
];
|
|
205
204
|
|
|
206
|
-
/* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
|
|
207
205
|
/**
|
|
208
206
|
* Generated API
|
|
209
207
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
@@ -222,7 +220,6 @@ var MediusQueryMode;
|
|
|
222
220
|
MediusQueryMode["All"] = "ALL";
|
|
223
221
|
})(MediusQueryMode || (MediusQueryMode = {}));
|
|
224
222
|
|
|
225
|
-
/* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
|
|
226
223
|
class MediusQueryParam {
|
|
227
224
|
static getAttributeTypeMap() {
|
|
228
225
|
return MediusQueryParam.attributeTypeMap;
|
|
@@ -291,45 +288,17 @@ MediusQueryParam.attributeTypeMap = [
|
|
|
291
288
|
}
|
|
292
289
|
];
|
|
293
290
|
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
class MediusQueryResult {
|
|
292
|
+
static getAttributeTypeMap() {
|
|
293
|
+
return MediusQueryResult.attributeTypeMap;
|
|
294
|
+
}
|
|
296
295
|
}
|
|
297
|
-
|
|
298
|
-
MediusQueryResultBase.attributeTypeMap = [
|
|
296
|
+
MediusQueryResult.attributeTypeMap = [
|
|
299
297
|
{
|
|
300
298
|
name: 'allDataCount',
|
|
301
299
|
baseName: 'all_data_count',
|
|
302
300
|
type: 'number'
|
|
303
301
|
},
|
|
304
|
-
{
|
|
305
|
-
name: 'selectInTwoSteps',
|
|
306
|
-
baseName: 'selectInTwoSteps',
|
|
307
|
-
type: 'boolean'
|
|
308
|
-
}
|
|
309
|
-
];
|
|
310
|
-
class MediusQueryResultWithObject extends MediusQueryResultBase {
|
|
311
|
-
static getAttributeTypeMap() {
|
|
312
|
-
return MediusQueryResultWithObject.attributeTypeMap;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
MediusQueryResultWithObject.discriminator = undefined;
|
|
316
|
-
MediusQueryResultWithObject.attributeTypeMap = [
|
|
317
|
-
...MediusQueryResultBase.attributeTypeMap,
|
|
318
|
-
{
|
|
319
|
-
name: 'pageData',
|
|
320
|
-
baseName: 'page_data',
|
|
321
|
-
type: 'Array<object>'
|
|
322
|
-
}
|
|
323
|
-
];
|
|
324
|
-
class MediusQueryResult extends MediusQueryResultBase {
|
|
325
|
-
static getAttributeTypeMap() {
|
|
326
|
-
return MediusQueryResultWithObject.attributeTypeMap;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
MediusQueryResult.discriminator = undefined;
|
|
330
|
-
MediusQueryResult.attributeTypeMapBase = MediusQueryResultBase.attributeTypeMap;
|
|
331
|
-
MediusQueryResult.attributeTypeMap = [
|
|
332
|
-
...MediusQueryResultBase.attributeTypeMap,
|
|
333
302
|
{
|
|
334
303
|
name: 'pageData',
|
|
335
304
|
baseName: 'page_data',
|
|
@@ -384,16 +353,13 @@ class MediusQueryParamBuilder {
|
|
|
384
353
|
}
|
|
385
354
|
}
|
|
386
355
|
|
|
387
|
-
/* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
|
|
388
356
|
const enumsMapBase = {
|
|
389
357
|
FilterMatchType: MediusFilterMatchType,
|
|
390
358
|
QueryMode: MediusQueryMode
|
|
391
359
|
};
|
|
392
360
|
const typeMapBase = {
|
|
393
361
|
FilterParam: MediusFilterParam,
|
|
394
|
-
QueryParam: MediusQueryParam
|
|
395
|
-
QueryResult: MediusQueryResult,
|
|
396
|
-
QueryResultWithObject: MediusQueryResultWithObject
|
|
362
|
+
QueryParam: MediusQueryParam
|
|
397
363
|
};
|
|
398
364
|
|
|
399
365
|
class TableDataProvider extends DataProvider {
|
|
@@ -433,6 +399,9 @@ class ActionDescriptor {
|
|
|
433
399
|
this._routeUrl = null;
|
|
434
400
|
this._className = '';
|
|
435
401
|
this._size = ActionDescriptor.SizeEnum.Normal;
|
|
402
|
+
this._isStyleText = false;
|
|
403
|
+
this._isStyleOutlined = false;
|
|
404
|
+
this._isStyleRaised = false;
|
|
436
405
|
this._hasRunConfirmation = false;
|
|
437
406
|
this._hasRunNotificationSuccess = true;
|
|
438
407
|
this._hasRunNotificationError = true;
|
|
@@ -508,6 +477,15 @@ class ActionDescriptor {
|
|
|
508
477
|
get className() {
|
|
509
478
|
return this._className;
|
|
510
479
|
}
|
|
480
|
+
get isStyleText() {
|
|
481
|
+
return this._isStyleText;
|
|
482
|
+
}
|
|
483
|
+
get isStyleOutlined() {
|
|
484
|
+
return this._isStyleOutlined;
|
|
485
|
+
}
|
|
486
|
+
get isStyleRaised() {
|
|
487
|
+
return this._isStyleRaised;
|
|
488
|
+
}
|
|
511
489
|
get size() {
|
|
512
490
|
return this._size;
|
|
513
491
|
}
|
|
@@ -619,6 +597,12 @@ class ActionDescriptor {
|
|
|
619
597
|
this._size = size;
|
|
620
598
|
return this;
|
|
621
599
|
}
|
|
600
|
+
withStyle(styleText = false, styleOutlined = false, styleRaised = false) {
|
|
601
|
+
this._isStyleText = styleText;
|
|
602
|
+
this._isStyleOutlined = styleOutlined;
|
|
603
|
+
this._isStyleRaised = styleRaised;
|
|
604
|
+
return this;
|
|
605
|
+
}
|
|
622
606
|
withPosition(position) {
|
|
623
607
|
this._position = position;
|
|
624
608
|
return this;
|
|
@@ -659,6 +643,7 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
659
643
|
this._editorActions = [];
|
|
660
644
|
this._editorTitle = undefined;
|
|
661
645
|
this._hasFetchNotificationSuccess = false;
|
|
646
|
+
this._dialogClassName = '';
|
|
662
647
|
this._type = ActionTypeEnum.Editor;
|
|
663
648
|
this._editorDescriptor = editorDescriptor;
|
|
664
649
|
this._editorActions.push(new ActionEditorSubmitDescriptor(this), new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel));
|
|
@@ -669,6 +654,9 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
669
654
|
get editorDescriptor() {
|
|
670
655
|
return this._editorDescriptor;
|
|
671
656
|
}
|
|
657
|
+
get dialogClassName() {
|
|
658
|
+
return this._dialogClassName;
|
|
659
|
+
}
|
|
672
660
|
get hasFetchNotificationSuccess() {
|
|
673
661
|
return this._hasFetchNotificationSuccess;
|
|
674
662
|
}
|
|
@@ -715,6 +703,10 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
715
703
|
this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
716
704
|
return this;
|
|
717
705
|
}
|
|
706
|
+
withDialogClassName(className) {
|
|
707
|
+
this._dialogClassName = className;
|
|
708
|
+
return this;
|
|
709
|
+
}
|
|
718
710
|
withRunFunction(fn) {
|
|
719
711
|
return this.withSubmitFunction(fn);
|
|
720
712
|
}
|
|
@@ -751,6 +743,7 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
|
|
|
751
743
|
this._editorAction = editorAction;
|
|
752
744
|
this._submitType = submitType;
|
|
753
745
|
this._position = ActionPositionEnum.FooterRight;
|
|
746
|
+
this._isStyleText = true;
|
|
754
747
|
}
|
|
755
748
|
get submitType() {
|
|
756
749
|
return this._submitType;
|
|
@@ -775,7 +768,7 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
|
775
768
|
: throwError(new Error(`Data provider fetch function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
|
|
776
769
|
});
|
|
777
770
|
this.withEditorActions([new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
|
|
778
|
-
this.
|
|
771
|
+
this.withDialogClassName('mng-details-dynamic-dialog');
|
|
779
772
|
}
|
|
780
773
|
withServiceType(serviceType) {
|
|
781
774
|
return this.withServiceFetchFunction(serviceType);
|
|
@@ -797,7 +790,7 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
|
797
790
|
this.withSubmitFunction(ctx => { var _a, _b; return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.create) ? ctx.dataProvider.create((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)); });
|
|
798
791
|
this.withLevel(ActionLevelEnum.Success);
|
|
799
792
|
this.withIcon('pi pi-plus');
|
|
800
|
-
this.
|
|
793
|
+
this.withDialogClassName('mng-details-dynamic-dialog');
|
|
801
794
|
}
|
|
802
795
|
withServiceType(serviceType) {
|
|
803
796
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -833,7 +826,7 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
|
833
826
|
: throwError(new Error(`Data provider update function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
|
|
834
827
|
});
|
|
835
828
|
this.withIcon('pi pi-pencil');
|
|
836
|
-
this.
|
|
829
|
+
this.withDialogClassName('mng-details-dynamic-dialog');
|
|
837
830
|
}
|
|
838
831
|
withServiceType(serviceType) {
|
|
839
832
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -878,6 +871,62 @@ class ActionDeleteDescriptor extends ActionDescriptor {
|
|
|
878
871
|
return this;
|
|
879
872
|
}
|
|
880
873
|
}
|
|
874
|
+
class ActionLinkDescriptor extends ActionDescriptor {
|
|
875
|
+
constructor(model) {
|
|
876
|
+
super(model, 'link');
|
|
877
|
+
this._url = '';
|
|
878
|
+
this._pathSegments = [];
|
|
879
|
+
this._replaceUrl = false;
|
|
880
|
+
this._target = '_self';
|
|
881
|
+
this._isStyleLink = false;
|
|
882
|
+
}
|
|
883
|
+
get url() {
|
|
884
|
+
return this._url;
|
|
885
|
+
}
|
|
886
|
+
get pathSegments() {
|
|
887
|
+
return this._pathSegments;
|
|
888
|
+
}
|
|
889
|
+
get queryParams() {
|
|
890
|
+
return this._queryParams;
|
|
891
|
+
}
|
|
892
|
+
get queryParamsHandling() {
|
|
893
|
+
return this._queryParamsHandling;
|
|
894
|
+
}
|
|
895
|
+
get replaceUrl() {
|
|
896
|
+
return this._replaceUrl;
|
|
897
|
+
}
|
|
898
|
+
get target() {
|
|
899
|
+
return this._target;
|
|
900
|
+
}
|
|
901
|
+
get isStyleLink() {
|
|
902
|
+
return this._isStyleLink;
|
|
903
|
+
}
|
|
904
|
+
withHref(url) {
|
|
905
|
+
this._url = url;
|
|
906
|
+
return this;
|
|
907
|
+
}
|
|
908
|
+
withRouterLink(...pathSegments) {
|
|
909
|
+
this._pathSegments = pathSegments;
|
|
910
|
+
return this;
|
|
911
|
+
}
|
|
912
|
+
withQueryParams(queryParams, queryParamsHandling) {
|
|
913
|
+
this._queryParams = queryParams;
|
|
914
|
+
this._queryParamsHandling = queryParamsHandling;
|
|
915
|
+
return this;
|
|
916
|
+
}
|
|
917
|
+
withReplaceUrl(replaceUrl = false) {
|
|
918
|
+
this._replaceUrl = replaceUrl;
|
|
919
|
+
return this;
|
|
920
|
+
}
|
|
921
|
+
withTarget(target = '_self') {
|
|
922
|
+
this._target = target;
|
|
923
|
+
return this;
|
|
924
|
+
}
|
|
925
|
+
withStyleLink(isStyleLink) {
|
|
926
|
+
this._isStyleLink = isStyleLink;
|
|
927
|
+
return this;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
881
930
|
var ActionPositionEnum;
|
|
882
931
|
(function (ActionPositionEnum) {
|
|
883
932
|
ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
|
|
@@ -1030,13 +1079,13 @@ class EditorDescriptor {
|
|
|
1030
1079
|
this.addFieldDescriptor(field);
|
|
1031
1080
|
return field;
|
|
1032
1081
|
}
|
|
1033
|
-
addFieldManyEditor(property,
|
|
1034
|
-
const field = new FieldManyEditorDescriptor(this, property,
|
|
1082
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
1083
|
+
const field = new FieldManyEditorDescriptor(this, property, tableviewDescriptor);
|
|
1035
1084
|
this.addFieldDescriptor(field);
|
|
1036
1085
|
return field;
|
|
1037
1086
|
}
|
|
1038
|
-
addFieldManyToManyEditor(property,
|
|
1039
|
-
const field = new FieldManyToManyEditorDescriptor(this, property,
|
|
1087
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
1088
|
+
const field = new FieldManyToManyEditorDescriptor(this, property, mainTableDescriptor, lookupTableDescriptor);
|
|
1040
1089
|
this.addFieldDescriptor(field);
|
|
1041
1090
|
return field;
|
|
1042
1091
|
}
|
|
@@ -1605,7 +1654,7 @@ class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
|
1605
1654
|
}
|
|
1606
1655
|
}
|
|
1607
1656
|
class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
1608
|
-
constructor(editor, property,
|
|
1657
|
+
constructor(editor, property, mainTableDescriptor, lookupTableDescriptor) {
|
|
1609
1658
|
super(editor, property);
|
|
1610
1659
|
this._fieldType = FieldManyToManyEditorDescriptor.TypeEnum.DialogTableMultiselect;
|
|
1611
1660
|
this._lookupTableDataProvider = null;
|
|
@@ -1613,7 +1662,6 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1613
1662
|
this._hasLookupExcludeValues = false;
|
|
1614
1663
|
this._excludeFilterProperty = '';
|
|
1615
1664
|
this._excludeValueProperty = '';
|
|
1616
|
-
this._model = new ModelDescriptor(modelType);
|
|
1617
1665
|
this._mainTableDescriptor = mainTableDescriptor;
|
|
1618
1666
|
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1619
1667
|
this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
|
|
@@ -1643,7 +1691,7 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1643
1691
|
return this._lookupTableDescriptor;
|
|
1644
1692
|
}
|
|
1645
1693
|
withLookup(getAll, serviceType) {
|
|
1646
|
-
const dataProvider = new TableviewDataProvider(this.
|
|
1694
|
+
const dataProvider = new TableviewDataProvider(this._mainTableDescriptor.model.type);
|
|
1647
1695
|
if (serviceType) {
|
|
1648
1696
|
dataProvider.withServiceType(serviceType);
|
|
1649
1697
|
}
|
|
@@ -1666,7 +1714,7 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1666
1714
|
return this;
|
|
1667
1715
|
}
|
|
1668
1716
|
copy() {
|
|
1669
|
-
const field = new FieldManyToManyEditorDescriptor(this._editor, this._property, this.
|
|
1717
|
+
const field = new FieldManyToManyEditorDescriptor(this._editor, this._property, this._mainTableDescriptor.copy(), this._lookupTableDescriptor.copy());
|
|
1670
1718
|
this.copyFieldsTo(field);
|
|
1671
1719
|
field._fieldType = this._fieldType;
|
|
1672
1720
|
field._actions = this._actions.map(a => a);
|
|
@@ -1689,12 +1737,12 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1689
1737
|
})(ActionEnum = FieldManyToManyEditorDescriptor.ActionEnum || (FieldManyToManyEditorDescriptor.ActionEnum = {}));
|
|
1690
1738
|
})(FieldManyToManyEditorDescriptor || (FieldManyToManyEditorDescriptor = {}));
|
|
1691
1739
|
class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
1692
|
-
constructor(editor, property,
|
|
1740
|
+
constructor(editor, property, tableviewDescriptor) {
|
|
1693
1741
|
super(editor, property);
|
|
1694
1742
|
this._fieldType = FieldManyEditorDescriptor.TypeEnum.DialogEditor;
|
|
1695
1743
|
this._fieldActions = [];
|
|
1696
1744
|
this._actions = [];
|
|
1697
|
-
this._modelType = modelType;
|
|
1745
|
+
// this._modelType = modelType;
|
|
1698
1746
|
this._tableviewDescriptor = tableviewDescriptor;
|
|
1699
1747
|
this._fieldActions.push(FieldManyEditorDescriptor.ActionEnum.View, FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
|
|
1700
1748
|
}
|
|
@@ -1735,7 +1783,7 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1735
1783
|
return this;
|
|
1736
1784
|
}
|
|
1737
1785
|
copy() {
|
|
1738
|
-
const field = new FieldManyEditorDescriptor(this._editor, this._property, this.
|
|
1786
|
+
const field = new FieldManyEditorDescriptor(this._editor, this._property, this._tableviewDescriptor.copy());
|
|
1739
1787
|
this.copyFieldsTo(field);
|
|
1740
1788
|
field._fieldType = this._fieldType;
|
|
1741
1789
|
field._fieldActions = this._fieldActions.map(a => a);
|
|
@@ -2189,6 +2237,9 @@ class ColumnDescriptor {
|
|
|
2189
2237
|
descriptor._isSortEnabled = this._isSortEnabled;
|
|
2190
2238
|
descriptor._columnType = this._columnType;
|
|
2191
2239
|
descriptor._filterDescriptor = (_a = this._filterDescriptor) === null || _a === void 0 ? void 0 : _a.copy();
|
|
2240
|
+
descriptor._enumType = this._enumType;
|
|
2241
|
+
descriptor._enumTitlePath = this._enumTitlePath;
|
|
2242
|
+
descriptor._enumNameAsValue = this._enumNameAsValue;
|
|
2192
2243
|
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
2193
2244
|
descriptor._booleanYes = this._booleanYes;
|
|
2194
2245
|
descriptor._booleanNo = this._booleanNo;
|
|
@@ -2533,14 +2584,14 @@ class TableviewDescriptor {
|
|
|
2533
2584
|
this._editEditor.addFieldDescriptor(field);
|
|
2534
2585
|
return field;
|
|
2535
2586
|
}
|
|
2536
|
-
addFieldManyEditor(property,
|
|
2537
|
-
const field = this._viewEditor.addFieldManyEditor(property,
|
|
2587
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
2588
|
+
const field = this._viewEditor.addFieldManyEditor(property, tableviewDescriptor);
|
|
2538
2589
|
this._addEditor.addFieldDescriptor(field);
|
|
2539
2590
|
this._editEditor.addFieldDescriptor(field);
|
|
2540
2591
|
return field;
|
|
2541
2592
|
}
|
|
2542
|
-
addFieldManyToManyEditor(property,
|
|
2543
|
-
const field = this._viewEditor.addFieldManyToManyEditor(property,
|
|
2593
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
2594
|
+
const field = this._viewEditor.addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor);
|
|
2544
2595
|
this._addEditor.addFieldDescriptor(field);
|
|
2545
2596
|
this._editEditor.addFieldDescriptor(field);
|
|
2546
2597
|
return field;
|
|
@@ -3045,14 +3096,17 @@ class ModelUtil {
|
|
|
3045
3096
|
}
|
|
3046
3097
|
}
|
|
3047
3098
|
|
|
3048
|
-
class
|
|
3099
|
+
class NotificationUtil {
|
|
3049
3100
|
static notification(viewContainer, title, message, severity = 'success') {
|
|
3050
3101
|
const messageService = viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getMessageService();
|
|
3051
|
-
|
|
3102
|
+
const notification = { severity: severity, summary: title, detail: message, life: severity === 'error' ? 10000 : 5000 };
|
|
3103
|
+
if (messageService) {
|
|
3104
|
+
messageService.add(notification);
|
|
3105
|
+
}
|
|
3106
|
+
else {
|
|
3052
3107
|
console.warn(`No message service was provided through view container, message will not be displayed.`);
|
|
3053
|
-
return;
|
|
3054
3108
|
}
|
|
3055
|
-
|
|
3109
|
+
return notification;
|
|
3056
3110
|
}
|
|
3057
3111
|
static tableNotificationError(translationService, table, error, viewContainer) {
|
|
3058
3112
|
var _a, _b;
|
|
@@ -3066,13 +3120,13 @@ class ToastUtil {
|
|
|
3066
3120
|
console.log(params);
|
|
3067
3121
|
const tableErrorTitle = (_a = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params)) !== null && _a !== void 0 ? _a : undefined;
|
|
3068
3122
|
const tableErrorMessage = (_b = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== null && _b !== void 0 ? _b : undefined;
|
|
3069
|
-
|
|
3123
|
+
return NotificationUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
|
|
3070
3124
|
}
|
|
3071
3125
|
static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
|
|
3072
3126
|
var _a, _b;
|
|
3073
3127
|
const actionSuccessTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName)) !== null && _a !== void 0 ? _a : undefined;
|
|
3074
3128
|
const actionSuccessMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName)) !== null && _b !== void 0 ? _b : undefined;
|
|
3075
|
-
|
|
3129
|
+
return NotificationUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
|
|
3076
3130
|
}
|
|
3077
3131
|
static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
|
|
3078
3132
|
var _a, _b;
|
|
@@ -3081,7 +3135,7 @@ class ToastUtil {
|
|
|
3081
3135
|
};
|
|
3082
3136
|
const actionErrorTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params)) !== null && _a !== void 0 ? _a : undefined;
|
|
3083
3137
|
const actionErrorMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params)) !== null && _b !== void 0 ? _b : undefined;
|
|
3084
|
-
|
|
3138
|
+
return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
|
|
3085
3139
|
}
|
|
3086
3140
|
static getFormEditorWarningMessage(translationService, title, message) {
|
|
3087
3141
|
var _a, _b;
|
|
@@ -3665,8 +3719,142 @@ class DefaultMngErrorMapperService extends MngErrorMapperService {
|
|
|
3665
3719
|
}
|
|
3666
3720
|
}
|
|
3667
3721
|
|
|
3722
|
+
class MngBooleanPipe {
|
|
3723
|
+
transform(value, yes, no, icon = false) {
|
|
3724
|
+
if (typeof value === 'boolean') {
|
|
3725
|
+
if (icon) {
|
|
3726
|
+
return value ? yes !== null && yes !== void 0 ? yes : 'pi pi-check' : no !== null && no !== void 0 ? no : 'pi pi-times';
|
|
3727
|
+
}
|
|
3728
|
+
else {
|
|
3729
|
+
return value ? yes !== null && yes !== void 0 ? yes : 'general.yes' : no !== null && no !== void 0 ? no : 'general.no';
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
else {
|
|
3733
|
+
return value;
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
MngBooleanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3738
|
+
MngBooleanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, name: "boolean" });
|
|
3739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, decorators: [{
|
|
3740
|
+
type: Pipe,
|
|
3741
|
+
args: [{
|
|
3742
|
+
name: 'boolean',
|
|
3743
|
+
pure: true
|
|
3744
|
+
}]
|
|
3745
|
+
}] });
|
|
3746
|
+
|
|
3747
|
+
class MngEnumPipe {
|
|
3748
|
+
transform(value, enumObj, i18nPath, nameAsValue = false) {
|
|
3749
|
+
if (!value || !enumObj) {
|
|
3750
|
+
return value;
|
|
3751
|
+
}
|
|
3752
|
+
const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
|
|
3753
|
+
if (typeof i18nPath === 'undefined') {
|
|
3754
|
+
i18nPath = TypeUtil.findEnumName(enumObj);
|
|
3755
|
+
}
|
|
3756
|
+
return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3760
|
+
MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
|
|
3761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
|
|
3762
|
+
type: Pipe,
|
|
3763
|
+
args: [{
|
|
3764
|
+
name: 'enum',
|
|
3765
|
+
pure: true
|
|
3766
|
+
}]
|
|
3767
|
+
}] });
|
|
3768
|
+
|
|
3769
|
+
class MngI18nPropertyPipe {
|
|
3770
|
+
transform(property, model) {
|
|
3771
|
+
return I18nUtil.getModelPropertyKey(model, property);
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3775
|
+
MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
|
|
3776
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
|
|
3777
|
+
type: Pipe,
|
|
3778
|
+
args: [{
|
|
3779
|
+
name: 'i18nProperty',
|
|
3780
|
+
pure: true
|
|
3781
|
+
}]
|
|
3782
|
+
}] });
|
|
3783
|
+
|
|
3784
|
+
class MngLinkFormatterPipe {
|
|
3785
|
+
parseUrl(s, itemId, itemAny, model, actionData) {
|
|
3786
|
+
var _a, _b;
|
|
3787
|
+
if (s === ':itemId') {
|
|
3788
|
+
return itemId;
|
|
3789
|
+
}
|
|
3790
|
+
else if (model && s.startsWith(`:${model.typeName}.`)) {
|
|
3791
|
+
return (_a = itemAny[s.substring(model.typeName.length + 2)]) !== null && _a !== void 0 ? _a : '';
|
|
3792
|
+
}
|
|
3793
|
+
else if (s.startsWith(':')) {
|
|
3794
|
+
return (_b = actionData === null || actionData === void 0 ? void 0 : actionData[s.substring(1)]) !== null && _b !== void 0 ? _b : '';
|
|
3795
|
+
}
|
|
3796
|
+
else {
|
|
3797
|
+
return s;
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
transform(value, itemId, item, model, actionData) {
|
|
3801
|
+
const itemAny = (item !== null && item !== void 0 ? item : {});
|
|
3802
|
+
if (typeof value === 'string') {
|
|
3803
|
+
return value.split('/').map(s => this.parseUrl(s, itemId, itemAny, model, actionData));
|
|
3804
|
+
}
|
|
3805
|
+
else {
|
|
3806
|
+
const transformedItems = [];
|
|
3807
|
+
value.forEach(val => transformedItems.push(...val.split('/').map(s => this.parseUrl(s, itemId, itemAny, model, actionData))));
|
|
3808
|
+
return transformedItems;
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
MngLinkFormatterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngLinkFormatterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3813
|
+
MngLinkFormatterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngLinkFormatterPipe, name: "linkFormatter" });
|
|
3814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngLinkFormatterPipe, decorators: [{
|
|
3815
|
+
type: Pipe,
|
|
3816
|
+
args: [{
|
|
3817
|
+
name: 'linkFormatter',
|
|
3818
|
+
pure: true
|
|
3819
|
+
}]
|
|
3820
|
+
}] });
|
|
3821
|
+
|
|
3822
|
+
class MngPropertyPathPipe {
|
|
3823
|
+
transform(value, path = '') {
|
|
3824
|
+
if (path.indexOf('.') >= 0) {
|
|
3825
|
+
const pathSplit = path.split('.');
|
|
3826
|
+
let currValue = value;
|
|
3827
|
+
for (const p of pathSplit) {
|
|
3828
|
+
if (typeof currValue === 'undefined' || currValue === null) {
|
|
3829
|
+
return currValue;
|
|
3830
|
+
}
|
|
3831
|
+
else if (typeof currValue === 'object') {
|
|
3832
|
+
currValue = currValue[p];
|
|
3833
|
+
}
|
|
3834
|
+
else {
|
|
3835
|
+
console.warn(`Path ${path} is not valid for object`, value);
|
|
3836
|
+
return currValue;
|
|
3837
|
+
}
|
|
3838
|
+
}
|
|
3839
|
+
return currValue;
|
|
3840
|
+
}
|
|
3841
|
+
else {
|
|
3842
|
+
return typeof value === 'object' ? value[path] : value;
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
MngPropertyPathPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3847
|
+
MngPropertyPathPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, name: "propertyPath" });
|
|
3848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, decorators: [{
|
|
3849
|
+
type: Pipe,
|
|
3850
|
+
args: [{
|
|
3851
|
+
name: 'propertyPath',
|
|
3852
|
+
pure: true
|
|
3853
|
+
}]
|
|
3854
|
+
}] });
|
|
3855
|
+
|
|
3668
3856
|
class MngActionExecutorService {
|
|
3669
|
-
constructor(injector, router, dialogService, confirmationService, translate, navigationService, errorMapper, defaultEditorDialogComponent) {
|
|
3857
|
+
constructor(injector, router, dialogService, confirmationService, translate, navigationService, errorMapper, linkFormatter, defaultEditorDialogComponent) {
|
|
3670
3858
|
this.injector = injector;
|
|
3671
3859
|
this.router = router;
|
|
3672
3860
|
this.dialogService = dialogService;
|
|
@@ -3674,11 +3862,13 @@ class MngActionExecutorService {
|
|
|
3674
3862
|
this.translate = translate;
|
|
3675
3863
|
this.navigationService = navigationService;
|
|
3676
3864
|
this.errorMapper = errorMapper;
|
|
3865
|
+
this.linkFormatter = linkFormatter;
|
|
3677
3866
|
this.defaultEditorDialogComponent = defaultEditorDialogComponent;
|
|
3678
3867
|
}
|
|
3679
3868
|
prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
|
|
3680
3869
|
var _a, _b;
|
|
3681
|
-
|
|
3870
|
+
const ctxDataProvider = (_a = dataProvider !== null && dataProvider !== void 0 ? dataProvider : action.dataProvider) !== null && _a !== void 0 ? _a : viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getDataProvider();
|
|
3871
|
+
return new ActionExecContext(ctxDataProvider, (_b = this.getDataProviderService(ctxDataProvider)) !== null && _b !== void 0 ? _b : undefined, {
|
|
3682
3872
|
item,
|
|
3683
3873
|
itemId,
|
|
3684
3874
|
actionData
|
|
@@ -3722,17 +3912,17 @@ class MngActionExecutorService {
|
|
|
3722
3912
|
confirmParams.accept = () => {
|
|
3723
3913
|
action
|
|
3724
3914
|
.runFunction(context)
|
|
3725
|
-
.pipe(first(), map(res => new ActionRunResult(context, res)), map(
|
|
3915
|
+
.pipe(first(), map(res => new ActionRunResult(context, res)), map(runResult => {
|
|
3726
3916
|
if (action.hasRunNotificationSuccess) {
|
|
3727
|
-
|
|
3917
|
+
runResult.notification = NotificationUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
|
|
3728
3918
|
}
|
|
3729
|
-
return
|
|
3919
|
+
return runResult;
|
|
3730
3920
|
}), catchError(err => {
|
|
3731
3921
|
const actionError = this.toMngActionError(err);
|
|
3732
3922
|
if (action.hasRunNotificationError) {
|
|
3733
|
-
|
|
3923
|
+
actionError.notification = NotificationUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
|
|
3734
3924
|
}
|
|
3735
|
-
|
|
3925
|
+
return throwError(() => actionError);
|
|
3736
3926
|
}))
|
|
3737
3927
|
.subscribe(res => {
|
|
3738
3928
|
observer.next(res);
|
|
@@ -3747,17 +3937,17 @@ class MngActionExecutorService {
|
|
|
3747
3937
|
return observable;
|
|
3748
3938
|
}
|
|
3749
3939
|
else {
|
|
3750
|
-
return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(
|
|
3940
|
+
return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(runResult => {
|
|
3751
3941
|
if (action.hasRunNotificationSuccess) {
|
|
3752
|
-
|
|
3942
|
+
runResult.notification = NotificationUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
|
|
3753
3943
|
}
|
|
3754
|
-
return
|
|
3944
|
+
return runResult;
|
|
3755
3945
|
}), catchError(err => {
|
|
3756
3946
|
const actionError = this.toMngActionError(err);
|
|
3757
3947
|
if (action.hasRunNotificationError) {
|
|
3758
|
-
|
|
3948
|
+
actionError.notification = NotificationUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
|
|
3759
3949
|
}
|
|
3760
|
-
|
|
3950
|
+
return throwError(() => actionError);
|
|
3761
3951
|
}));
|
|
3762
3952
|
}
|
|
3763
3953
|
}
|
|
@@ -3777,17 +3967,17 @@ class MngActionExecutorService {
|
|
|
3777
3967
|
if (typeof action.submitFunction !== 'function') {
|
|
3778
3968
|
throw new Error(`Submit function for action ${action.actionName} cannot be invoked.`);
|
|
3779
3969
|
}
|
|
3780
|
-
return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(
|
|
3970
|
+
return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(runResult => {
|
|
3781
3971
|
if (action.hasRunNotificationSuccess) {
|
|
3782
|
-
|
|
3972
|
+
runResult.notification = NotificationUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, formItem);
|
|
3783
3973
|
}
|
|
3784
|
-
return
|
|
3974
|
+
return runResult;
|
|
3785
3975
|
}), catchError(err => {
|
|
3786
3976
|
const actionError = this.toMngActionError(err);
|
|
3787
3977
|
if (action.hasRunNotificationError) {
|
|
3788
|
-
|
|
3978
|
+
actionError.notification = NotificationUtil.actionNotificationError(this.translate, action, actionError, 'submit', viewContainer, formItem);
|
|
3789
3979
|
}
|
|
3790
|
-
|
|
3980
|
+
return throwError(() => actionError);
|
|
3791
3981
|
}));
|
|
3792
3982
|
}
|
|
3793
3983
|
/**
|
|
@@ -3825,7 +4015,7 @@ class MngActionExecutorService {
|
|
|
3825
4015
|
if (!ctxDataProvider) {
|
|
3826
4016
|
const viewContainerDataProvider = viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getDataProvider();
|
|
3827
4017
|
if (viewContainerDataProvider) {
|
|
3828
|
-
ctxDataProvider =
|
|
4018
|
+
ctxDataProvider = viewContainerDataProvider;
|
|
3829
4019
|
}
|
|
3830
4020
|
}
|
|
3831
4021
|
const context = new ActionExecContext(ctxDataProvider, (_a = this.getDataProviderService(ctxDataProvider)) !== null && _a !== void 0 ? _a : undefined, {
|
|
@@ -3861,14 +4051,20 @@ class MngActionExecutorService {
|
|
|
3861
4051
|
activateAction(action, itemId, item, actionData, viewContainer, sourceComponent) {
|
|
3862
4052
|
if (action.type === ActionTypeEnum.Editor) {
|
|
3863
4053
|
let dialogComponent = this.defaultEditorDialogComponent;
|
|
3864
|
-
|
|
3865
|
-
|
|
4054
|
+
let dialogClassName = '';
|
|
4055
|
+
if (action instanceof ActionEditorDescriptor) {
|
|
4056
|
+
if (action.editorComponent) {
|
|
4057
|
+
dialogComponent = action.editorComponent;
|
|
4058
|
+
}
|
|
4059
|
+
if (action.dialogClassName) {
|
|
4060
|
+
dialogClassName = action.dialogClassName;
|
|
4061
|
+
}
|
|
3866
4062
|
}
|
|
3867
4063
|
const dialogConfig = {
|
|
3868
4064
|
data: {
|
|
3869
4065
|
action
|
|
3870
4066
|
},
|
|
3871
|
-
styleClass:
|
|
4067
|
+
styleClass: dialogClassName
|
|
3872
4068
|
};
|
|
3873
4069
|
if (itemId) {
|
|
3874
4070
|
dialogConfig.data.itemId = itemId;
|
|
@@ -3928,22 +4124,7 @@ class MngActionExecutorService {
|
|
|
3928
4124
|
if (actionUrl.startsWith('/')) {
|
|
3929
4125
|
actionUrl = actionUrl.substring(1);
|
|
3930
4126
|
}
|
|
3931
|
-
const
|
|
3932
|
-
const actionUrlSegments = actionUrl.split('/').map(s => {
|
|
3933
|
-
var _a, _b;
|
|
3934
|
-
if (s === ':itemId') {
|
|
3935
|
-
return itemId;
|
|
3936
|
-
}
|
|
3937
|
-
else if (s.startsWith(`:${action.model.typeName}.`)) {
|
|
3938
|
-
return (_a = itemAny[s.substring(action.model.typeName.length + 2)]) !== null && _a !== void 0 ? _a : '';
|
|
3939
|
-
}
|
|
3940
|
-
else if (s.startsWith(':')) {
|
|
3941
|
-
return (_b = actionData === null || actionData === void 0 ? void 0 : actionData[s.substring(1)]) !== null && _b !== void 0 ? _b : '';
|
|
3942
|
-
}
|
|
3943
|
-
else {
|
|
3944
|
-
return s;
|
|
3945
|
-
}
|
|
3946
|
-
});
|
|
4127
|
+
const actionUrlSegments = this.linkFormatter.transform(actionUrl, itemId, item, action.model, actionData);
|
|
3947
4128
|
return of(new ActionTriggerResult(undefined, from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: route, queryParams: parsedUrl.queryParams }))));
|
|
3948
4129
|
}
|
|
3949
4130
|
else {
|
|
@@ -3992,12 +4173,12 @@ class MngActionExecutorService {
|
|
|
3992
4173
|
return this.errorMapper.toMngError(error, actionError);
|
|
3993
4174
|
}
|
|
3994
4175
|
}
|
|
3995
|
-
MngActionExecutorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: i3$1.TranslateService }, { token: MngNavigationService }, { token: MngErrorMapperService }, { token: ACTION_EDITOR_DIALOG_COMPONENT_SETTING }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4176
|
+
MngActionExecutorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: i3$1.TranslateService }, { token: MngNavigationService }, { token: MngErrorMapperService }, { token: MngLinkFormatterPipe }, { token: ACTION_EDITOR_DIALOG_COMPONENT_SETTING }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3996
4177
|
MngActionExecutorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService });
|
|
3997
4178
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, decorators: [{
|
|
3998
4179
|
type: Injectable
|
|
3999
4180
|
}], ctorParameters: function () {
|
|
4000
|
-
return [{ type: i0.Injector }, { type: i1.Router }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: i3$1.TranslateService }, { type: MngNavigationService }, { type: MngErrorMapperService }, { type: i0.Type, decorators: [{
|
|
4181
|
+
return [{ type: i0.Injector }, { type: i1.Router }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: i3$1.TranslateService }, { type: MngNavigationService }, { type: MngErrorMapperService }, { type: MngLinkFormatterPipe }, { type: i0.Type, decorators: [{
|
|
4001
4182
|
type: Inject,
|
|
4002
4183
|
args: [ACTION_EDITOR_DIALOG_COMPONENT_SETTING]
|
|
4003
4184
|
}] }];
|
|
@@ -4461,22 +4642,39 @@ class MngActionComponent {
|
|
|
4461
4642
|
this.actionExecutor = actionExecutor;
|
|
4462
4643
|
this.confirmationService = confirmationService;
|
|
4463
4644
|
this.viewContainerService = viewContainerService;
|
|
4645
|
+
this.levelDefault = ActionLevelEnum.Default;
|
|
4646
|
+
this.levelPrimary = ActionLevelEnum.Primary;
|
|
4647
|
+
this.levelSecondary = ActionLevelEnum.Secondary;
|
|
4648
|
+
this.levelInfo = ActionLevelEnum.Info;
|
|
4649
|
+
this.levelHelp = ActionLevelEnum.Help;
|
|
4650
|
+
this.levelSuccess = ActionLevelEnum.Success;
|
|
4651
|
+
this.levelWarning = ActionLevelEnum.Warning;
|
|
4652
|
+
this.levelDanger = ActionLevelEnum.Danger;
|
|
4653
|
+
this.hostClass = 'mng-action-button';
|
|
4464
4654
|
this.inputDisabled = of(false);
|
|
4465
4655
|
this.inputLoading = of(false);
|
|
4466
4656
|
this.triggerEventEmitter = new EventEmitter();
|
|
4467
4657
|
this.loadingSubject = new ReplaySubject(1);
|
|
4468
4658
|
this.$loading = this.loadingSubject.asObservable();
|
|
4469
4659
|
this.cmpId = Math.random().toString(36).substring(2);
|
|
4660
|
+
this.hasNoTitle = false;
|
|
4470
4661
|
this.loadingSubject.next(false);
|
|
4471
4662
|
}
|
|
4472
4663
|
ngOnInit() {
|
|
4473
4664
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4474
4665
|
this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
|
|
4666
|
+
this.hasNoTitle = this.action.title === null;
|
|
4475
4667
|
const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, (_c = this.viewContainer) !== null && _c !== void 0 ? _c : undefined, this, this.actionData);
|
|
4476
4668
|
this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
|
|
4477
4669
|
this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
|
|
4478
|
-
this.$label = I18nUtil.streamActionTranslation(this.translate, this.action, 'title', (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : undefined, this.item);
|
|
4670
|
+
this.$label = this.hasNoTitle ? of(null) : I18nUtil.streamActionTranslation(this.translate, this.action, 'title', (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : undefined, this.item);
|
|
4479
4671
|
this.$tooltip = I18nUtil.streamActionTranslation(this.translate, this.action, 'tooltip', (_g = (_f = this.action) === null || _f === void 0 ? void 0 : _f.tooltip) !== null && _g !== void 0 ? _g : undefined, this.item);
|
|
4672
|
+
if (this.action instanceof ActionLinkDescriptor) {
|
|
4673
|
+
this.actionLink = this.action;
|
|
4674
|
+
}
|
|
4675
|
+
if (this.action.className) {
|
|
4676
|
+
this.hostClass = this.action.className;
|
|
4677
|
+
}
|
|
4480
4678
|
}
|
|
4481
4679
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4482
4680
|
triggerAction(event) {
|
|
@@ -4492,8 +4690,8 @@ class MngActionComponent {
|
|
|
4492
4690
|
this.loadingSubject.next(false);
|
|
4493
4691
|
},
|
|
4494
4692
|
error: err => {
|
|
4495
|
-
console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
|
|
4496
4693
|
this.loadingSubject.next(false);
|
|
4694
|
+
console.warn(`Error occurred while executing action ${this.action.actionName}.`, err);
|
|
4497
4695
|
}
|
|
4498
4696
|
});
|
|
4499
4697
|
}
|
|
@@ -4505,15 +4703,18 @@ class MngActionComponent {
|
|
|
4505
4703
|
}
|
|
4506
4704
|
}
|
|
4507
4705
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i3$1.TranslateService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
4508
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <
|
|
4706
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, host: { properties: { "class": "this.hostClass" } }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <a *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [href]=\"actionLink.url\"\n [target]=\"actionLink.target\"\n [icon]=\"$any(action.icon)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\">{{ ($label | async) ?? '' }}</a>\n <ng-template #routerLink>\n <a *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"actionLink.pathSegments | linkFormatter:itemId:item:action.model:actionData\"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [icon]=\"$any(action.icon)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\">{{ ($label | async) ?? '' }}</a>\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], components: [{ type: i5.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4.AsyncPipe, "linkFormatter": MngLinkFormatterPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4509
4707
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
4510
4708
|
type: Component,
|
|
4511
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <
|
|
4709
|
+
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <a *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [href]=\"actionLink.url\"\n [target]=\"actionLink.target\"\n [icon]=\"$any(action.icon)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\">{{ ($label | async) ?? '' }}</a>\n <ng-template #routerLink>\n <a *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"actionLink.pathSegments | linkFormatter:itemId:item:action.model:actionData\"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [icon]=\"$any(action.icon)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\">{{ ($label | async) ?? '' }}</a>\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
4512
4710
|
}], ctorParameters: function () {
|
|
4513
4711
|
return [{ type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
4514
4712
|
type: Optional
|
|
4515
4713
|
}] }];
|
|
4516
|
-
}, propDecorators: {
|
|
4714
|
+
}, propDecorators: { hostClass: [{
|
|
4715
|
+
type: HostBinding,
|
|
4716
|
+
args: ['class']
|
|
4717
|
+
}], action: [{
|
|
4517
4718
|
type: Input
|
|
4518
4719
|
}], item: [{
|
|
4519
4720
|
type: Input
|
|
@@ -4768,7 +4969,7 @@ class MngFormEditorComponent {
|
|
|
4768
4969
|
}
|
|
4769
4970
|
const event = new MngFormEditorSubmitEvent(formSubmitItem);
|
|
4770
4971
|
event.success = false;
|
|
4771
|
-
this.formMessages.push(
|
|
4972
|
+
this.formMessages.push(NotificationUtil.getFormEditorWarningMessage(this.translateService, 'mngEditor.invalidFormToastTitle', 'mngEditor.invalidFormToastMessage'));
|
|
4772
4973
|
this.formSubmitEventEmitter.next(event);
|
|
4773
4974
|
}
|
|
4774
4975
|
}
|
|
@@ -5224,13 +5425,13 @@ class MngActionEditorComponent {
|
|
|
5224
5425
|
// assign run operations
|
|
5225
5426
|
action.withRunNotificationSuccess(undefined, undefined, false);
|
|
5226
5427
|
if (action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit) {
|
|
5227
|
-
action.withRunFunction(
|
|
5428
|
+
action.withRunFunction(() => {
|
|
5228
5429
|
this.triggerSubmit();
|
|
5229
5430
|
return of(undefined);
|
|
5230
5431
|
});
|
|
5231
5432
|
}
|
|
5232
5433
|
else {
|
|
5233
|
-
action.withRunFunction(
|
|
5434
|
+
action.withRunFunction(() => {
|
|
5234
5435
|
this.cancel();
|
|
5235
5436
|
return of(undefined);
|
|
5236
5437
|
});
|
|
@@ -5299,15 +5500,16 @@ class MngActionEditorComponent {
|
|
|
5299
5500
|
this.actionExecutor
|
|
5300
5501
|
.runEditorFetch(this.action, this.item, this.itemId, this.dataProvider, this.sourceComponent, this.viewContainer)
|
|
5301
5502
|
.pipe(first(), catchError(err => {
|
|
5503
|
+
const actionError = this.actionExecutor.toMngActionError(err);
|
|
5302
5504
|
if (this.action.hasRunNotificationError) {
|
|
5303
|
-
|
|
5505
|
+
NotificationUtil.actionNotificationError(this.translate, this.action, actionError, 'fetch', this.viewContainer, this.item);
|
|
5304
5506
|
}
|
|
5305
|
-
|
|
5507
|
+
return throwError(() => actionError);
|
|
5306
5508
|
}), finalize(() => this.loadingSubject.next(false)))
|
|
5307
5509
|
.subscribe(res => {
|
|
5308
5510
|
this.item = res.result;
|
|
5309
5511
|
if (this.action.hasFetchNotificationSuccess) {
|
|
5310
|
-
|
|
5512
|
+
NotificationUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.viewContainer, this.item);
|
|
5311
5513
|
}
|
|
5312
5514
|
this.setTitle();
|
|
5313
5515
|
});
|
|
@@ -5526,84 +5728,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5526
5728
|
type: Input
|
|
5527
5729
|
}] } });
|
|
5528
5730
|
|
|
5529
|
-
class MngPropertyPathPipe {
|
|
5530
|
-
transform(value, path = '') {
|
|
5531
|
-
if (path.indexOf('.') >= 0) {
|
|
5532
|
-
const pathSplit = path.split('.');
|
|
5533
|
-
let currValue = value;
|
|
5534
|
-
for (const p of pathSplit) {
|
|
5535
|
-
if (typeof currValue === 'undefined' || currValue === null) {
|
|
5536
|
-
return currValue;
|
|
5537
|
-
}
|
|
5538
|
-
else if (typeof currValue === 'object') {
|
|
5539
|
-
currValue = currValue[p];
|
|
5540
|
-
}
|
|
5541
|
-
else {
|
|
5542
|
-
console.warn(`Path ${path} is not valid for object`, value);
|
|
5543
|
-
return currValue;
|
|
5544
|
-
}
|
|
5545
|
-
}
|
|
5546
|
-
return currValue;
|
|
5547
|
-
}
|
|
5548
|
-
else {
|
|
5549
|
-
return typeof value === 'object' ? value[path] : value;
|
|
5550
|
-
}
|
|
5551
|
-
}
|
|
5552
|
-
}
|
|
5553
|
-
MngPropertyPathPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5554
|
-
MngPropertyPathPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, name: "propertyPath" });
|
|
5555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, decorators: [{
|
|
5556
|
-
type: Pipe,
|
|
5557
|
-
args: [{
|
|
5558
|
-
name: 'propertyPath',
|
|
5559
|
-
pure: true
|
|
5560
|
-
}]
|
|
5561
|
-
}] });
|
|
5562
|
-
|
|
5563
|
-
class MngBooleanPipe {
|
|
5564
|
-
transform(value, yes, no, icon = false) {
|
|
5565
|
-
if (typeof value === 'boolean') {
|
|
5566
|
-
if (icon) {
|
|
5567
|
-
return value ? yes !== null && yes !== void 0 ? yes : 'pi pi-check' : no !== null && no !== void 0 ? no : 'pi pi-times';
|
|
5568
|
-
}
|
|
5569
|
-
else {
|
|
5570
|
-
return value ? yes !== null && yes !== void 0 ? yes : 'general.yes' : no !== null && no !== void 0 ? no : 'general.no';
|
|
5571
|
-
}
|
|
5572
|
-
}
|
|
5573
|
-
else {
|
|
5574
|
-
return value;
|
|
5575
|
-
}
|
|
5576
|
-
}
|
|
5577
|
-
}
|
|
5578
|
-
MngBooleanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5579
|
-
MngBooleanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, name: "boolean" });
|
|
5580
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, decorators: [{
|
|
5581
|
-
type: Pipe,
|
|
5582
|
-
args: [{
|
|
5583
|
-
name: 'boolean',
|
|
5584
|
-
pure: true
|
|
5585
|
-
}]
|
|
5586
|
-
}] });
|
|
5587
|
-
|
|
5588
|
-
class MngEnumPipe {
|
|
5589
|
-
transform(value, enumObj, i18nPath, nameAsValue = false) {
|
|
5590
|
-
const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
|
|
5591
|
-
if (typeof i18nPath === 'undefined') {
|
|
5592
|
-
i18nPath = TypeUtil.findEnumName(enumObj);
|
|
5593
|
-
}
|
|
5594
|
-
return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
|
|
5595
|
-
}
|
|
5596
|
-
}
|
|
5597
|
-
MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5598
|
-
MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
|
|
5599
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
|
|
5600
|
-
type: Pipe,
|
|
5601
|
-
args: [{
|
|
5602
|
-
name: 'enum',
|
|
5603
|
-
pure: true
|
|
5604
|
-
}]
|
|
5605
|
-
}] });
|
|
5606
|
-
|
|
5607
5731
|
class MngTableColumnValueComponent {
|
|
5608
5732
|
constructor() {
|
|
5609
5733
|
this.columnTypeString = ColumnDescriptor.TypeEnum.String;
|
|
@@ -5624,21 +5748,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5624
5748
|
type: Input
|
|
5625
5749
|
}] } });
|
|
5626
5750
|
|
|
5627
|
-
class MngI18nPropertyPipe {
|
|
5628
|
-
transform(property, model) {
|
|
5629
|
-
return I18nUtil.getModelPropertyKey(model, property);
|
|
5630
|
-
}
|
|
5631
|
-
}
|
|
5632
|
-
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5633
|
-
MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
|
|
5634
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
|
|
5635
|
-
type: Pipe,
|
|
5636
|
-
args: [{
|
|
5637
|
-
name: 'i18nProperty',
|
|
5638
|
-
pure: true
|
|
5639
|
-
}]
|
|
5640
|
-
}] });
|
|
5641
|
-
|
|
5642
5751
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
5643
5752
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
5644
5753
|
class MngTableComponent {
|
|
@@ -5838,7 +5947,7 @@ class MngTableComponent {
|
|
|
5838
5947
|
this.dataProviderLoadingSubject.next(false);
|
|
5839
5948
|
}, err => {
|
|
5840
5949
|
var _a;
|
|
5841
|
-
|
|
5950
|
+
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined);
|
|
5842
5951
|
const emptyQueryResult = new MediusQueryResult();
|
|
5843
5952
|
emptyQueryResult.pageData = [];
|
|
5844
5953
|
emptyQueryResult.allDataCount = 0;
|
|
@@ -6070,28 +6179,51 @@ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
|
6070
6179
|
this.route = route;
|
|
6071
6180
|
}
|
|
6072
6181
|
createTableviewDescriptor() {
|
|
6073
|
-
|
|
6182
|
+
var _a;
|
|
6183
|
+
if (this.descriptorInit) {
|
|
6184
|
+
return this.descriptorInit;
|
|
6185
|
+
}
|
|
6186
|
+
const routeData = this.route.snapshot.data;
|
|
6187
|
+
if (!((_a = routeData === null || routeData === void 0 ? void 0 : routeData.tableview) === null || _a === void 0 ? void 0 : _a.descriptor)) {
|
|
6074
6188
|
throw Error('Tableview requires a descriptor.');
|
|
6075
6189
|
}
|
|
6076
|
-
return
|
|
6190
|
+
return routeData.tableview.descriptor;
|
|
6077
6191
|
}
|
|
6078
6192
|
createTableviewDataProvider() {
|
|
6079
|
-
|
|
6193
|
+
var _a;
|
|
6194
|
+
if (this.dataProviderInit) {
|
|
6195
|
+
return this.dataProviderInit;
|
|
6196
|
+
}
|
|
6197
|
+
const routeData = this.route.snapshot.data;
|
|
6198
|
+
if (!((_a = routeData === null || routeData === void 0 ? void 0 : routeData.tableview) === null || _a === void 0 ? void 0 : _a.dataProvider)) {
|
|
6080
6199
|
throw Error('Tableview requires a data provider.');
|
|
6081
6200
|
}
|
|
6082
|
-
return
|
|
6201
|
+
return routeData.tableview.dataProvider;
|
|
6083
6202
|
}
|
|
6084
6203
|
createActionDescriptors() {
|
|
6085
|
-
var _a;
|
|
6086
|
-
|
|
6204
|
+
var _a, _b;
|
|
6205
|
+
if (this.actionsInit) {
|
|
6206
|
+
return this.actionsInit;
|
|
6207
|
+
}
|
|
6208
|
+
const routeData = this.route.snapshot.data;
|
|
6209
|
+
return (_b = (_a = routeData === null || routeData === void 0 ? void 0 : routeData.tableview) === null || _a === void 0 ? void 0 : _a.actions) !== null && _b !== void 0 ? _b : super.createActionDescriptors();
|
|
6087
6210
|
}
|
|
6088
6211
|
}
|
|
6089
6212
|
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
6090
|
-
MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewRouteComponent, selector: "mng-tableview-route", usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", components: [{ type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
|
|
6213
|
+
MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewRouteComponent, selector: "mng-tableview-route", inputs: { descriptorInit: ["descriptor", "descriptorInit"], dataProviderInit: ["dataProvider", "dataProviderInit"], actionsInit: ["actions", "actionsInit"] }, usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", components: [{ type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
|
|
6091
6214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
6092
6215
|
type: Component,
|
|
6093
6216
|
args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
|
|
6094
|
-
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; }
|
|
6217
|
+
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; }, propDecorators: { descriptorInit: [{
|
|
6218
|
+
type: Input,
|
|
6219
|
+
args: ['descriptor']
|
|
6220
|
+
}], dataProviderInit: [{
|
|
6221
|
+
type: Input,
|
|
6222
|
+
args: ['dataProvider']
|
|
6223
|
+
}], actionsInit: [{
|
|
6224
|
+
type: Input,
|
|
6225
|
+
args: ['actions']
|
|
6226
|
+
}] } });
|
|
6095
6227
|
|
|
6096
6228
|
class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
6097
6229
|
constructor(injector) {
|
|
@@ -6281,9 +6413,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6281
6413
|
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.viewEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
|
|
6282
6414
|
.withPosition(ActionPositionEnum.RowClick)
|
|
6283
6415
|
.withTitle(null)
|
|
6284
|
-
.
|
|
6285
|
-
.withClassName('mng-formly-field-table-form-dialog')
|
|
6286
|
-
.withSize(SizeEnum.ExtraSmall);
|
|
6416
|
+
.withDialogClassName('mng-formly-field-table-form-dialog');
|
|
6287
6417
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
|
|
6288
6418
|
this.rowClickActions.push(viewAction);
|
|
6289
6419
|
}
|
|
@@ -6292,7 +6422,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6292
6422
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
6293
6423
|
.withTitle(null)
|
|
6294
6424
|
.withIcon('pi pi-plus')
|
|
6295
|
-
.
|
|
6425
|
+
.withDialogClassName('mng-formly-field-table-form-dialog')
|
|
6296
6426
|
.withSize(SizeEnum.ExtraSmall)
|
|
6297
6427
|
.withSubmitFunction(ctx => {
|
|
6298
6428
|
var _a;
|
|
@@ -6313,7 +6443,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6313
6443
|
const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
|
|
6314
6444
|
.withTitle(null)
|
|
6315
6445
|
.withIcon('pi pi-pencil')
|
|
6316
|
-
.
|
|
6446
|
+
.withDialogClassName('mng-formly-field-table-form-dialog')
|
|
6317
6447
|
.withSize(SizeEnum.ExtraSmall)
|
|
6318
6448
|
.withSubmitFunction(ctx => {
|
|
6319
6449
|
var _a, _b;
|
|
@@ -7342,6 +7472,7 @@ const declarations = [
|
|
|
7342
7472
|
MngEnumPipe,
|
|
7343
7473
|
MngBooleanPipe,
|
|
7344
7474
|
MngI18nPropertyPipe,
|
|
7475
|
+
MngLinkFormatterPipe,
|
|
7345
7476
|
// layout components
|
|
7346
7477
|
MngBreadcrumbComponent,
|
|
7347
7478
|
MngFooterComponent,
|
|
@@ -7388,6 +7519,7 @@ class MngCommonsModule {
|
|
|
7388
7519
|
MngActionExecutorService,
|
|
7389
7520
|
MngNavigationService,
|
|
7390
7521
|
MngCommonsService,
|
|
7522
|
+
MngLinkFormatterPipe,
|
|
7391
7523
|
// component service
|
|
7392
7524
|
MngMainLayoutComponentService,
|
|
7393
7525
|
MngViewContainerComponentService,
|
|
@@ -7444,6 +7576,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
7444
7576
|
MngEnumPipe,
|
|
7445
7577
|
MngBooleanPipe,
|
|
7446
7578
|
MngI18nPropertyPipe,
|
|
7579
|
+
MngLinkFormatterPipe,
|
|
7447
7580
|
// layout components
|
|
7448
7581
|
MngBreadcrumbComponent,
|
|
7449
7582
|
MngFooterComponent,
|
|
@@ -7558,6 +7691,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
7558
7691
|
MngEnumPipe,
|
|
7559
7692
|
MngBooleanPipe,
|
|
7560
7693
|
MngI18nPropertyPipe,
|
|
7694
|
+
MngLinkFormatterPipe,
|
|
7561
7695
|
// layout components
|
|
7562
7696
|
MngBreadcrumbComponent,
|
|
7563
7697
|
MngFooterComponent,
|
|
@@ -7658,37 +7792,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
7658
7792
|
}]
|
|
7659
7793
|
}] });
|
|
7660
7794
|
|
|
7661
|
-
class
|
|
7662
|
-
constructor(type,
|
|
7795
|
+
class AMngApiService {
|
|
7796
|
+
constructor(type, http) {
|
|
7663
7797
|
this.type = type;
|
|
7664
|
-
this.queryResultType = queryResultType;
|
|
7665
7798
|
this.http = http;
|
|
7666
7799
|
this.objectSerializer = ObjectSerializer.get();
|
|
7667
7800
|
}
|
|
7668
|
-
|
|
7669
|
-
|
|
7801
|
+
getUrl(...pathSegments) {
|
|
7802
|
+
let path = pathSegments.join('/');
|
|
7803
|
+
if (!path.startsWith('/')) {
|
|
7804
|
+
path = path.substring(1);
|
|
7805
|
+
}
|
|
7806
|
+
return `${this.getBasePath()}${this.getServiceBasePath()}${path}`;
|
|
7807
|
+
}
|
|
7808
|
+
deserialize(item) {
|
|
7809
|
+
return this.deserializeClass(item, this.type);
|
|
7810
|
+
}
|
|
7811
|
+
serialize(item) {
|
|
7812
|
+
return this.serializeClass(item, this.type);
|
|
7813
|
+
}
|
|
7814
|
+
serializeQueryParam(queryParam, type = 'QueryParam') {
|
|
7815
|
+
return this.objectSerializer.serialize(queryParam, type);
|
|
7816
|
+
}
|
|
7817
|
+
deserializeQueryResult(item, qrType) {
|
|
7818
|
+
return this.deserializeClass(item, qrType);
|
|
7819
|
+
}
|
|
7820
|
+
deserializeClass(item, type) {
|
|
7821
|
+
return this.objectSerializer.deserializeClass(item, type);
|
|
7822
|
+
}
|
|
7823
|
+
serializeClass(item, type) {
|
|
7824
|
+
return this.objectSerializer.serializeClass(item, type);
|
|
7825
|
+
}
|
|
7826
|
+
}
|
|
7827
|
+
|
|
7828
|
+
class AMngGetAllApiService extends AMngApiService {
|
|
7829
|
+
constructor(type, queryResultType, http) {
|
|
7830
|
+
super(type, http);
|
|
7831
|
+
this.queryResultType = queryResultType;
|
|
7832
|
+
}
|
|
7833
|
+
getAllPost(queryParamBody, params) {
|
|
7834
|
+
const url = this.getUrl(this.getGetAllPostPath());
|
|
7670
7835
|
return this.http
|
|
7671
|
-
.post(url, this.
|
|
7836
|
+
.post(url, queryParamBody ? this.serializeQueryParam(queryParamBody) : undefined, {
|
|
7672
7837
|
withCredentials: true,
|
|
7673
7838
|
observe: 'body',
|
|
7674
7839
|
reportProgress: false,
|
|
7675
7840
|
params: params
|
|
7676
7841
|
})
|
|
7677
|
-
.pipe(map(res => this.
|
|
7842
|
+
.pipe(map(res => this.deserializeQueryResult(res, this.queryResultType)));
|
|
7678
7843
|
}
|
|
7679
|
-
|
|
7680
|
-
|
|
7844
|
+
getGetAllPostPath() {
|
|
7845
|
+
return '/get-all';
|
|
7846
|
+
}
|
|
7847
|
+
}
|
|
7848
|
+
|
|
7849
|
+
class AMngCrudApiService extends AMngGetAllApiService {
|
|
7850
|
+
constructor(type, queryResultType, http) {
|
|
7851
|
+
super(type, queryResultType, http);
|
|
7852
|
+
}
|
|
7853
|
+
createPost(item, params) {
|
|
7854
|
+
const url = this.getUrl(this.getCreatePostPath());
|
|
7681
7855
|
return this.http
|
|
7682
|
-
.post(url, this.
|
|
7856
|
+
.post(url, this.serialize(item), {
|
|
7683
7857
|
withCredentials: true,
|
|
7684
7858
|
observe: 'body',
|
|
7685
7859
|
reportProgress: false,
|
|
7686
7860
|
params: params
|
|
7687
7861
|
})
|
|
7688
|
-
.pipe(map(res => this.
|
|
7862
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7689
7863
|
}
|
|
7690
7864
|
getByIdGet(id, params) {
|
|
7691
|
-
const url =
|
|
7865
|
+
const url = this.getUrl(this.getGetByIdGetPath(id));
|
|
7692
7866
|
return this.http
|
|
7693
7867
|
.get(url, {
|
|
7694
7868
|
withCredentials: true,
|
|
@@ -7696,33 +7870,30 @@ class AMngCrudApiService {
|
|
|
7696
7870
|
reportProgress: false,
|
|
7697
7871
|
params: params
|
|
7698
7872
|
})
|
|
7699
|
-
.pipe(map(res => this.
|
|
7873
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7700
7874
|
}
|
|
7701
7875
|
updatePut(id, item, params) {
|
|
7702
|
-
const url =
|
|
7876
|
+
const url = this.getUrl(this.getUpdatePutPath(id, item));
|
|
7703
7877
|
return this.http
|
|
7704
|
-
.put(url, this.
|
|
7878
|
+
.put(url, this.serialize(item), {
|
|
7705
7879
|
withCredentials: true,
|
|
7706
7880
|
observe: 'body',
|
|
7707
7881
|
reportProgress: false,
|
|
7708
7882
|
params: params
|
|
7709
7883
|
})
|
|
7710
|
-
.pipe(map(res => this.
|
|
7884
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7711
7885
|
}
|
|
7712
7886
|
removeDelete(id, item, params) {
|
|
7713
|
-
const url =
|
|
7887
|
+
const url = this.getUrl(this.getRemoveDeletePath(id, item));
|
|
7714
7888
|
return this.http
|
|
7715
7889
|
.request('delete', url, {
|
|
7716
7890
|
withCredentials: true,
|
|
7717
7891
|
observe: 'body',
|
|
7718
7892
|
reportProgress: false,
|
|
7719
|
-
body: item ? this.
|
|
7893
|
+
body: item ? this.serialize(item) : undefined,
|
|
7720
7894
|
params: params
|
|
7721
7895
|
})
|
|
7722
|
-
.pipe(map(res => this.
|
|
7723
|
-
}
|
|
7724
|
-
getGetAllPostPath() {
|
|
7725
|
-
return '/get-all';
|
|
7896
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7726
7897
|
}
|
|
7727
7898
|
getCreatePostPath() {
|
|
7728
7899
|
return '';
|
|
@@ -8202,5 +8373,5 @@ class RouteDataBuilder {
|
|
|
8202
8373
|
* Generated bundle index. Do not edit.
|
|
8203
8374
|
*/
|
|
8204
8375
|
|
|
8205
|
-
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult,
|
|
8376
|
+
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
8206
8377
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|