@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
|
}
|
|
@@ -714,6 +702,10 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
714
702
|
this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
715
703
|
return this;
|
|
716
704
|
}
|
|
705
|
+
withDialogClassName(className) {
|
|
706
|
+
this._dialogClassName = className;
|
|
707
|
+
return this;
|
|
708
|
+
}
|
|
717
709
|
withRunFunction(fn) {
|
|
718
710
|
return this.withSubmitFunction(fn);
|
|
719
711
|
}
|
|
@@ -750,6 +742,7 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
|
|
|
750
742
|
this._editorAction = editorAction;
|
|
751
743
|
this._submitType = submitType;
|
|
752
744
|
this._position = ActionPositionEnum.FooterRight;
|
|
745
|
+
this._isStyleText = true;
|
|
753
746
|
}
|
|
754
747
|
get submitType() {
|
|
755
748
|
return this._submitType;
|
|
@@ -771,7 +764,7 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
|
771
764
|
? ctx.dataProvider.fetch(ctx.data?.itemId, ctx.serviceInstance)
|
|
772
765
|
: throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
|
|
773
766
|
this.withEditorActions([new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
|
|
774
|
-
this.
|
|
767
|
+
this.withDialogClassName('mng-details-dynamic-dialog');
|
|
775
768
|
}
|
|
776
769
|
withServiceType(serviceType) {
|
|
777
770
|
return this.withServiceFetchFunction(serviceType);
|
|
@@ -793,7 +786,7 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
|
793
786
|
this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
|
|
794
787
|
this.withLevel(ActionLevelEnum.Success);
|
|
795
788
|
this.withIcon('pi pi-plus');
|
|
796
|
-
this.
|
|
789
|
+
this.withDialogClassName('mng-details-dynamic-dialog');
|
|
797
790
|
}
|
|
798
791
|
withServiceType(serviceType) {
|
|
799
792
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -823,7 +816,7 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
|
823
816
|
? ctx.dataProvider.update(ctx.data.itemId, ctx.data?.item, ctx.serviceInstance)
|
|
824
817
|
: throwError(new Error(`Data provider update function or item id ${ctx.data?.itemId} is missing.`)));
|
|
825
818
|
this.withIcon('pi pi-pencil');
|
|
826
|
-
this.
|
|
819
|
+
this.withDialogClassName('mng-details-dynamic-dialog');
|
|
827
820
|
}
|
|
828
821
|
withServiceType(serviceType) {
|
|
829
822
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -867,6 +860,62 @@ class ActionDeleteDescriptor extends ActionDescriptor {
|
|
|
867
860
|
return this;
|
|
868
861
|
}
|
|
869
862
|
}
|
|
863
|
+
class ActionLinkDescriptor extends ActionDescriptor {
|
|
864
|
+
constructor(model) {
|
|
865
|
+
super(model, 'link');
|
|
866
|
+
this._url = '';
|
|
867
|
+
this._pathSegments = [];
|
|
868
|
+
this._replaceUrl = false;
|
|
869
|
+
this._target = '_self';
|
|
870
|
+
this._isStyleLink = false;
|
|
871
|
+
}
|
|
872
|
+
get url() {
|
|
873
|
+
return this._url;
|
|
874
|
+
}
|
|
875
|
+
get pathSegments() {
|
|
876
|
+
return this._pathSegments;
|
|
877
|
+
}
|
|
878
|
+
get queryParams() {
|
|
879
|
+
return this._queryParams;
|
|
880
|
+
}
|
|
881
|
+
get queryParamsHandling() {
|
|
882
|
+
return this._queryParamsHandling;
|
|
883
|
+
}
|
|
884
|
+
get replaceUrl() {
|
|
885
|
+
return this._replaceUrl;
|
|
886
|
+
}
|
|
887
|
+
get target() {
|
|
888
|
+
return this._target;
|
|
889
|
+
}
|
|
890
|
+
get isStyleLink() {
|
|
891
|
+
return this._isStyleLink;
|
|
892
|
+
}
|
|
893
|
+
withHref(url) {
|
|
894
|
+
this._url = url;
|
|
895
|
+
return this;
|
|
896
|
+
}
|
|
897
|
+
withRouterLink(...pathSegments) {
|
|
898
|
+
this._pathSegments = pathSegments;
|
|
899
|
+
return this;
|
|
900
|
+
}
|
|
901
|
+
withQueryParams(queryParams, queryParamsHandling) {
|
|
902
|
+
this._queryParams = queryParams;
|
|
903
|
+
this._queryParamsHandling = queryParamsHandling;
|
|
904
|
+
return this;
|
|
905
|
+
}
|
|
906
|
+
withReplaceUrl(replaceUrl = false) {
|
|
907
|
+
this._replaceUrl = replaceUrl;
|
|
908
|
+
return this;
|
|
909
|
+
}
|
|
910
|
+
withTarget(target = '_self') {
|
|
911
|
+
this._target = target;
|
|
912
|
+
return this;
|
|
913
|
+
}
|
|
914
|
+
withStyleLink(isStyleLink) {
|
|
915
|
+
this._isStyleLink = isStyleLink;
|
|
916
|
+
return this;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
870
919
|
var ActionPositionEnum;
|
|
871
920
|
(function (ActionPositionEnum) {
|
|
872
921
|
ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
|
|
@@ -1017,13 +1066,13 @@ class EditorDescriptor {
|
|
|
1017
1066
|
this.addFieldDescriptor(field);
|
|
1018
1067
|
return field;
|
|
1019
1068
|
}
|
|
1020
|
-
addFieldManyEditor(property,
|
|
1021
|
-
const field = new FieldManyEditorDescriptor(this, property,
|
|
1069
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
1070
|
+
const field = new FieldManyEditorDescriptor(this, property, tableviewDescriptor);
|
|
1022
1071
|
this.addFieldDescriptor(field);
|
|
1023
1072
|
return field;
|
|
1024
1073
|
}
|
|
1025
|
-
addFieldManyToManyEditor(property,
|
|
1026
|
-
const field = new FieldManyToManyEditorDescriptor(this, property,
|
|
1074
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
1075
|
+
const field = new FieldManyToManyEditorDescriptor(this, property, mainTableDescriptor, lookupTableDescriptor);
|
|
1027
1076
|
this.addFieldDescriptor(field);
|
|
1028
1077
|
return field;
|
|
1029
1078
|
}
|
|
@@ -1590,7 +1639,7 @@ class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
|
1590
1639
|
}
|
|
1591
1640
|
}
|
|
1592
1641
|
class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
1593
|
-
constructor(editor, property,
|
|
1642
|
+
constructor(editor, property, mainTableDescriptor, lookupTableDescriptor) {
|
|
1594
1643
|
super(editor, property);
|
|
1595
1644
|
this._fieldType = FieldManyToManyEditorDescriptor.TypeEnum.DialogTableMultiselect;
|
|
1596
1645
|
this._lookupTableDataProvider = null;
|
|
@@ -1598,7 +1647,6 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1598
1647
|
this._hasLookupExcludeValues = false;
|
|
1599
1648
|
this._excludeFilterProperty = '';
|
|
1600
1649
|
this._excludeValueProperty = '';
|
|
1601
|
-
this._model = new ModelDescriptor(modelType);
|
|
1602
1650
|
this._mainTableDescriptor = mainTableDescriptor;
|
|
1603
1651
|
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1604
1652
|
this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
|
|
@@ -1628,7 +1676,7 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1628
1676
|
return this._lookupTableDescriptor;
|
|
1629
1677
|
}
|
|
1630
1678
|
withLookup(getAll, serviceType) {
|
|
1631
|
-
const dataProvider = new TableviewDataProvider(this.
|
|
1679
|
+
const dataProvider = new TableviewDataProvider(this._mainTableDescriptor.model.type);
|
|
1632
1680
|
if (serviceType) {
|
|
1633
1681
|
dataProvider.withServiceType(serviceType);
|
|
1634
1682
|
}
|
|
@@ -1651,7 +1699,7 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1651
1699
|
return this;
|
|
1652
1700
|
}
|
|
1653
1701
|
copy() {
|
|
1654
|
-
const field = new FieldManyToManyEditorDescriptor(this._editor, this._property, this.
|
|
1702
|
+
const field = new FieldManyToManyEditorDescriptor(this._editor, this._property, this._mainTableDescriptor.copy(), this._lookupTableDescriptor.copy());
|
|
1655
1703
|
this.copyFieldsTo(field);
|
|
1656
1704
|
field._fieldType = this._fieldType;
|
|
1657
1705
|
field._actions = this._actions.map(a => a);
|
|
@@ -1674,12 +1722,12 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1674
1722
|
})(ActionEnum = FieldManyToManyEditorDescriptor.ActionEnum || (FieldManyToManyEditorDescriptor.ActionEnum = {}));
|
|
1675
1723
|
})(FieldManyToManyEditorDescriptor || (FieldManyToManyEditorDescriptor = {}));
|
|
1676
1724
|
class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
1677
|
-
constructor(editor, property,
|
|
1725
|
+
constructor(editor, property, tableviewDescriptor) {
|
|
1678
1726
|
super(editor, property);
|
|
1679
1727
|
this._fieldType = FieldManyEditorDescriptor.TypeEnum.DialogEditor;
|
|
1680
1728
|
this._fieldActions = [];
|
|
1681
1729
|
this._actions = [];
|
|
1682
|
-
this._modelType = modelType;
|
|
1730
|
+
// this._modelType = modelType;
|
|
1683
1731
|
this._tableviewDescriptor = tableviewDescriptor;
|
|
1684
1732
|
this._fieldActions.push(FieldManyEditorDescriptor.ActionEnum.View, FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
|
|
1685
1733
|
}
|
|
@@ -1720,7 +1768,7 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1720
1768
|
return this;
|
|
1721
1769
|
}
|
|
1722
1770
|
copy() {
|
|
1723
|
-
const field = new FieldManyEditorDescriptor(this._editor, this._property, this.
|
|
1771
|
+
const field = new FieldManyEditorDescriptor(this._editor, this._property, this._tableviewDescriptor.copy());
|
|
1724
1772
|
this.copyFieldsTo(field);
|
|
1725
1773
|
field._fieldType = this._fieldType;
|
|
1726
1774
|
field._fieldActions = this._fieldActions.map(a => a);
|
|
@@ -2172,6 +2220,9 @@ class ColumnDescriptor {
|
|
|
2172
2220
|
descriptor._isSortEnabled = this._isSortEnabled;
|
|
2173
2221
|
descriptor._columnType = this._columnType;
|
|
2174
2222
|
descriptor._filterDescriptor = this._filterDescriptor?.copy();
|
|
2223
|
+
descriptor._enumType = this._enumType;
|
|
2224
|
+
descriptor._enumTitlePath = this._enumTitlePath;
|
|
2225
|
+
descriptor._enumNameAsValue = this._enumNameAsValue;
|
|
2175
2226
|
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
2176
2227
|
descriptor._booleanYes = this._booleanYes;
|
|
2177
2228
|
descriptor._booleanNo = this._booleanNo;
|
|
@@ -2516,14 +2567,14 @@ class TableviewDescriptor {
|
|
|
2516
2567
|
this._editEditor.addFieldDescriptor(field);
|
|
2517
2568
|
return field;
|
|
2518
2569
|
}
|
|
2519
|
-
addFieldManyEditor(property,
|
|
2520
|
-
const field = this._viewEditor.addFieldManyEditor(property,
|
|
2570
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
2571
|
+
const field = this._viewEditor.addFieldManyEditor(property, tableviewDescriptor);
|
|
2521
2572
|
this._addEditor.addFieldDescriptor(field);
|
|
2522
2573
|
this._editEditor.addFieldDescriptor(field);
|
|
2523
2574
|
return field;
|
|
2524
2575
|
}
|
|
2525
|
-
addFieldManyToManyEditor(property,
|
|
2526
|
-
const field = this._viewEditor.addFieldManyToManyEditor(property,
|
|
2576
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
2577
|
+
const field = this._viewEditor.addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor);
|
|
2527
2578
|
this._addEditor.addFieldDescriptor(field);
|
|
2528
2579
|
this._editEditor.addFieldDescriptor(field);
|
|
2529
2580
|
return field;
|
|
@@ -3023,14 +3074,17 @@ class ModelUtil {
|
|
|
3023
3074
|
}
|
|
3024
3075
|
}
|
|
3025
3076
|
|
|
3026
|
-
class
|
|
3077
|
+
class NotificationUtil {
|
|
3027
3078
|
static notification(viewContainer, title, message, severity = 'success') {
|
|
3028
3079
|
const messageService = viewContainer?.getMessageService();
|
|
3029
|
-
|
|
3080
|
+
const notification = { severity: severity, summary: title, detail: message, life: severity === 'error' ? 10000 : 5000 };
|
|
3081
|
+
if (messageService) {
|
|
3082
|
+
messageService.add(notification);
|
|
3083
|
+
}
|
|
3084
|
+
else {
|
|
3030
3085
|
console.warn(`No message service was provided through view container, message will not be displayed.`);
|
|
3031
|
-
return;
|
|
3032
3086
|
}
|
|
3033
|
-
|
|
3087
|
+
return notification;
|
|
3034
3088
|
}
|
|
3035
3089
|
static tableNotificationError(translationService, table, error, viewContainer) {
|
|
3036
3090
|
const params = {};
|
|
@@ -3043,12 +3097,12 @@ class ToastUtil {
|
|
|
3043
3097
|
console.log(params);
|
|
3044
3098
|
const tableErrorTitle = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params) ?? undefined;
|
|
3045
3099
|
const tableErrorMessage = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params) ?? undefined;
|
|
3046
|
-
|
|
3100
|
+
return NotificationUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
|
|
3047
3101
|
}
|
|
3048
3102
|
static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
|
|
3049
3103
|
const actionSuccessTitle = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName) ?? undefined;
|
|
3050
3104
|
const actionSuccessMessage = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName) ?? undefined;
|
|
3051
|
-
|
|
3105
|
+
return NotificationUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
|
|
3052
3106
|
}
|
|
3053
3107
|
static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
|
|
3054
3108
|
const params = {
|
|
@@ -3057,7 +3111,7 @@ class ToastUtil {
|
|
|
3057
3111
|
const actionErrorTitle = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params) ??
|
|
3058
3112
|
undefined;
|
|
3059
3113
|
const actionErrorMessage = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params) ?? undefined;
|
|
3060
|
-
|
|
3114
|
+
return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
|
|
3061
3115
|
}
|
|
3062
3116
|
static getFormEditorWarningMessage(translationService, title, message) {
|
|
3063
3117
|
const actionErrorTitle = translationService.instant(title) ?? undefined;
|
|
@@ -3639,8 +3693,141 @@ class DefaultMngErrorMapperService extends MngErrorMapperService {
|
|
|
3639
3693
|
}
|
|
3640
3694
|
}
|
|
3641
3695
|
|
|
3696
|
+
class MngBooleanPipe {
|
|
3697
|
+
transform(value, yes, no, icon = false) {
|
|
3698
|
+
if (typeof value === 'boolean') {
|
|
3699
|
+
if (icon) {
|
|
3700
|
+
return value ? yes ?? 'pi pi-check' : no ?? 'pi pi-times';
|
|
3701
|
+
}
|
|
3702
|
+
else {
|
|
3703
|
+
return value ? yes ?? 'general.yes' : no ?? 'general.no';
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3706
|
+
else {
|
|
3707
|
+
return value;
|
|
3708
|
+
}
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
MngBooleanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3712
|
+
MngBooleanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, name: "boolean" });
|
|
3713
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, decorators: [{
|
|
3714
|
+
type: Pipe,
|
|
3715
|
+
args: [{
|
|
3716
|
+
name: 'boolean',
|
|
3717
|
+
pure: true
|
|
3718
|
+
}]
|
|
3719
|
+
}] });
|
|
3720
|
+
|
|
3721
|
+
class MngEnumPipe {
|
|
3722
|
+
transform(value, enumObj, i18nPath, nameAsValue = false) {
|
|
3723
|
+
if (!value || !enumObj) {
|
|
3724
|
+
return value;
|
|
3725
|
+
}
|
|
3726
|
+
const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
|
|
3727
|
+
if (typeof i18nPath === 'undefined') {
|
|
3728
|
+
i18nPath = TypeUtil.findEnumName(enumObj);
|
|
3729
|
+
}
|
|
3730
|
+
return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3734
|
+
MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
|
|
3735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
|
|
3736
|
+
type: Pipe,
|
|
3737
|
+
args: [{
|
|
3738
|
+
name: 'enum',
|
|
3739
|
+
pure: true
|
|
3740
|
+
}]
|
|
3741
|
+
}] });
|
|
3742
|
+
|
|
3743
|
+
class MngI18nPropertyPipe {
|
|
3744
|
+
transform(property, model) {
|
|
3745
|
+
return I18nUtil.getModelPropertyKey(model, property);
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3749
|
+
MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
|
|
3750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
|
|
3751
|
+
type: Pipe,
|
|
3752
|
+
args: [{
|
|
3753
|
+
name: 'i18nProperty',
|
|
3754
|
+
pure: true
|
|
3755
|
+
}]
|
|
3756
|
+
}] });
|
|
3757
|
+
|
|
3758
|
+
class MngLinkFormatterPipe {
|
|
3759
|
+
parseUrl(s, itemId, itemAny, model, actionData) {
|
|
3760
|
+
if (s === ':itemId') {
|
|
3761
|
+
return itemId;
|
|
3762
|
+
}
|
|
3763
|
+
else if (model && s.startsWith(`:${model.typeName}.`)) {
|
|
3764
|
+
return itemAny[s.substring(model.typeName.length + 2)] ?? '';
|
|
3765
|
+
}
|
|
3766
|
+
else if (s.startsWith(':')) {
|
|
3767
|
+
return actionData?.[s.substring(1)] ?? '';
|
|
3768
|
+
}
|
|
3769
|
+
else {
|
|
3770
|
+
return s;
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
transform(value, itemId, item, model, actionData) {
|
|
3774
|
+
const itemAny = (item ?? {});
|
|
3775
|
+
if (typeof value === 'string') {
|
|
3776
|
+
return value.split('/').map(s => this.parseUrl(s, itemId, itemAny, model, actionData));
|
|
3777
|
+
}
|
|
3778
|
+
else {
|
|
3779
|
+
const transformedItems = [];
|
|
3780
|
+
value.forEach(val => transformedItems.push(...val.split('/').map(s => this.parseUrl(s, itemId, itemAny, model, actionData))));
|
|
3781
|
+
return transformedItems;
|
|
3782
|
+
}
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
MngLinkFormatterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngLinkFormatterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3786
|
+
MngLinkFormatterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngLinkFormatterPipe, name: "linkFormatter" });
|
|
3787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngLinkFormatterPipe, decorators: [{
|
|
3788
|
+
type: Pipe,
|
|
3789
|
+
args: [{
|
|
3790
|
+
name: 'linkFormatter',
|
|
3791
|
+
pure: true
|
|
3792
|
+
}]
|
|
3793
|
+
}] });
|
|
3794
|
+
|
|
3795
|
+
class MngPropertyPathPipe {
|
|
3796
|
+
transform(value, path = '') {
|
|
3797
|
+
if (path.indexOf('.') >= 0) {
|
|
3798
|
+
const pathSplit = path.split('.');
|
|
3799
|
+
let currValue = value;
|
|
3800
|
+
for (const p of pathSplit) {
|
|
3801
|
+
if (typeof currValue === 'undefined' || currValue === null) {
|
|
3802
|
+
return currValue;
|
|
3803
|
+
}
|
|
3804
|
+
else if (typeof currValue === 'object') {
|
|
3805
|
+
currValue = currValue[p];
|
|
3806
|
+
}
|
|
3807
|
+
else {
|
|
3808
|
+
console.warn(`Path ${path} is not valid for object`, value);
|
|
3809
|
+
return currValue;
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
return currValue;
|
|
3813
|
+
}
|
|
3814
|
+
else {
|
|
3815
|
+
return typeof value === 'object' ? value[path] : value;
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
}
|
|
3819
|
+
MngPropertyPathPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3820
|
+
MngPropertyPathPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, name: "propertyPath" });
|
|
3821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, decorators: [{
|
|
3822
|
+
type: Pipe,
|
|
3823
|
+
args: [{
|
|
3824
|
+
name: 'propertyPath',
|
|
3825
|
+
pure: true
|
|
3826
|
+
}]
|
|
3827
|
+
}] });
|
|
3828
|
+
|
|
3642
3829
|
class MngActionExecutorService {
|
|
3643
|
-
constructor(injector, router, dialogService, confirmationService, translate, navigationService, errorMapper, defaultEditorDialogComponent) {
|
|
3830
|
+
constructor(injector, router, dialogService, confirmationService, translate, navigationService, errorMapper, linkFormatter, defaultEditorDialogComponent) {
|
|
3644
3831
|
this.injector = injector;
|
|
3645
3832
|
this.router = router;
|
|
3646
3833
|
this.dialogService = dialogService;
|
|
@@ -3648,10 +3835,12 @@ class MngActionExecutorService {
|
|
|
3648
3835
|
this.translate = translate;
|
|
3649
3836
|
this.navigationService = navigationService;
|
|
3650
3837
|
this.errorMapper = errorMapper;
|
|
3838
|
+
this.linkFormatter = linkFormatter;
|
|
3651
3839
|
this.defaultEditorDialogComponent = defaultEditorDialogComponent;
|
|
3652
3840
|
}
|
|
3653
3841
|
prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
|
|
3654
|
-
|
|
3842
|
+
const ctxDataProvider = dataProvider ?? action.dataProvider ?? viewContainer?.getDataProvider();
|
|
3843
|
+
return new ActionExecContext(ctxDataProvider, this.getDataProviderService(ctxDataProvider) ?? undefined, {
|
|
3655
3844
|
item,
|
|
3656
3845
|
itemId,
|
|
3657
3846
|
actionData
|
|
@@ -3694,17 +3883,17 @@ class MngActionExecutorService {
|
|
|
3694
3883
|
confirmParams.accept = () => {
|
|
3695
3884
|
action
|
|
3696
3885
|
.runFunction(context)
|
|
3697
|
-
.pipe(first(), map(res => new ActionRunResult(context, res)), map(
|
|
3886
|
+
.pipe(first(), map(res => new ActionRunResult(context, res)), map(runResult => {
|
|
3698
3887
|
if (action.hasRunNotificationSuccess) {
|
|
3699
|
-
|
|
3888
|
+
runResult.notification = NotificationUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
|
|
3700
3889
|
}
|
|
3701
|
-
return
|
|
3890
|
+
return runResult;
|
|
3702
3891
|
}), catchError(err => {
|
|
3703
3892
|
const actionError = this.toMngActionError(err);
|
|
3704
3893
|
if (action.hasRunNotificationError) {
|
|
3705
|
-
|
|
3894
|
+
actionError.notification = NotificationUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
|
|
3706
3895
|
}
|
|
3707
|
-
|
|
3896
|
+
return throwError(() => actionError);
|
|
3708
3897
|
}))
|
|
3709
3898
|
.subscribe(res => {
|
|
3710
3899
|
observer.next(res);
|
|
@@ -3719,17 +3908,17 @@ class MngActionExecutorService {
|
|
|
3719
3908
|
return observable;
|
|
3720
3909
|
}
|
|
3721
3910
|
else {
|
|
3722
|
-
return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(
|
|
3911
|
+
return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(runResult => {
|
|
3723
3912
|
if (action.hasRunNotificationSuccess) {
|
|
3724
|
-
|
|
3913
|
+
runResult.notification = NotificationUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
|
|
3725
3914
|
}
|
|
3726
|
-
return
|
|
3915
|
+
return runResult;
|
|
3727
3916
|
}), catchError(err => {
|
|
3728
3917
|
const actionError = this.toMngActionError(err);
|
|
3729
3918
|
if (action.hasRunNotificationError) {
|
|
3730
|
-
|
|
3919
|
+
actionError.notification = NotificationUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
|
|
3731
3920
|
}
|
|
3732
|
-
|
|
3921
|
+
return throwError(() => actionError);
|
|
3733
3922
|
}));
|
|
3734
3923
|
}
|
|
3735
3924
|
}
|
|
@@ -3749,17 +3938,17 @@ class MngActionExecutorService {
|
|
|
3749
3938
|
if (typeof action.submitFunction !== 'function') {
|
|
3750
3939
|
throw new Error(`Submit function for action ${action.actionName} cannot be invoked.`);
|
|
3751
3940
|
}
|
|
3752
|
-
return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(
|
|
3941
|
+
return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(runResult => {
|
|
3753
3942
|
if (action.hasRunNotificationSuccess) {
|
|
3754
|
-
|
|
3943
|
+
runResult.notification = NotificationUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, formItem);
|
|
3755
3944
|
}
|
|
3756
|
-
return
|
|
3945
|
+
return runResult;
|
|
3757
3946
|
}), catchError(err => {
|
|
3758
3947
|
const actionError = this.toMngActionError(err);
|
|
3759
3948
|
if (action.hasRunNotificationError) {
|
|
3760
|
-
|
|
3949
|
+
actionError.notification = NotificationUtil.actionNotificationError(this.translate, action, actionError, 'submit', viewContainer, formItem);
|
|
3761
3950
|
}
|
|
3762
|
-
|
|
3951
|
+
return throwError(() => actionError);
|
|
3763
3952
|
}));
|
|
3764
3953
|
}
|
|
3765
3954
|
/**
|
|
@@ -3796,7 +3985,7 @@ class MngActionExecutorService {
|
|
|
3796
3985
|
if (!ctxDataProvider) {
|
|
3797
3986
|
const viewContainerDataProvider = viewContainer?.getDataProvider();
|
|
3798
3987
|
if (viewContainerDataProvider) {
|
|
3799
|
-
ctxDataProvider =
|
|
3988
|
+
ctxDataProvider = viewContainerDataProvider;
|
|
3800
3989
|
}
|
|
3801
3990
|
}
|
|
3802
3991
|
const context = new ActionExecContext(ctxDataProvider, this.getDataProviderService(ctxDataProvider) ?? undefined, {
|
|
@@ -3832,14 +4021,20 @@ class MngActionExecutorService {
|
|
|
3832
4021
|
activateAction(action, itemId, item, actionData, viewContainer, sourceComponent) {
|
|
3833
4022
|
if (action.type === ActionTypeEnum.Editor) {
|
|
3834
4023
|
let dialogComponent = this.defaultEditorDialogComponent;
|
|
3835
|
-
|
|
3836
|
-
|
|
4024
|
+
let dialogClassName = '';
|
|
4025
|
+
if (action instanceof ActionEditorDescriptor) {
|
|
4026
|
+
if (action.editorComponent) {
|
|
4027
|
+
dialogComponent = action.editorComponent;
|
|
4028
|
+
}
|
|
4029
|
+
if (action.dialogClassName) {
|
|
4030
|
+
dialogClassName = action.dialogClassName;
|
|
4031
|
+
}
|
|
3837
4032
|
}
|
|
3838
4033
|
const dialogConfig = {
|
|
3839
4034
|
data: {
|
|
3840
4035
|
action
|
|
3841
4036
|
},
|
|
3842
|
-
styleClass:
|
|
4037
|
+
styleClass: dialogClassName
|
|
3843
4038
|
};
|
|
3844
4039
|
if (itemId) {
|
|
3845
4040
|
dialogConfig.data.itemId = itemId;
|
|
@@ -3898,21 +4093,7 @@ class MngActionExecutorService {
|
|
|
3898
4093
|
if (actionUrl.startsWith('/')) {
|
|
3899
4094
|
actionUrl = actionUrl.substring(1);
|
|
3900
4095
|
}
|
|
3901
|
-
const
|
|
3902
|
-
const actionUrlSegments = actionUrl.split('/').map(s => {
|
|
3903
|
-
if (s === ':itemId') {
|
|
3904
|
-
return itemId;
|
|
3905
|
-
}
|
|
3906
|
-
else if (s.startsWith(`:${action.model.typeName}.`)) {
|
|
3907
|
-
return itemAny[s.substring(action.model.typeName.length + 2)] ?? '';
|
|
3908
|
-
}
|
|
3909
|
-
else if (s.startsWith(':')) {
|
|
3910
|
-
return actionData?.[s.substring(1)] ?? '';
|
|
3911
|
-
}
|
|
3912
|
-
else {
|
|
3913
|
-
return s;
|
|
3914
|
-
}
|
|
3915
|
-
});
|
|
4096
|
+
const actionUrlSegments = this.linkFormatter.transform(actionUrl, itemId, item, action.model, actionData);
|
|
3916
4097
|
return of(new ActionTriggerResult(undefined, from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: route, queryParams: parsedUrl.queryParams }))));
|
|
3917
4098
|
}
|
|
3918
4099
|
else {
|
|
@@ -3959,11 +4140,11 @@ class MngActionExecutorService {
|
|
|
3959
4140
|
return this.errorMapper.toMngError(error, actionError);
|
|
3960
4141
|
}
|
|
3961
4142
|
}
|
|
3962
|
-
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 });
|
|
4143
|
+
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 });
|
|
3963
4144
|
MngActionExecutorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService });
|
|
3964
4145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, decorators: [{
|
|
3965
4146
|
type: Injectable
|
|
3966
|
-
}], ctorParameters: function () { 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: [{
|
|
4147
|
+
}], ctorParameters: function () { 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: [{
|
|
3967
4148
|
type: Inject,
|
|
3968
4149
|
args: [ACTION_EDITOR_DIALOG_COMPONENT_SETTING]
|
|
3969
4150
|
}] }]; } });
|
|
@@ -4415,21 +4596,38 @@ class MngActionComponent {
|
|
|
4415
4596
|
this.actionExecutor = actionExecutor;
|
|
4416
4597
|
this.confirmationService = confirmationService;
|
|
4417
4598
|
this.viewContainerService = viewContainerService;
|
|
4599
|
+
this.levelDefault = ActionLevelEnum.Default;
|
|
4600
|
+
this.levelPrimary = ActionLevelEnum.Primary;
|
|
4601
|
+
this.levelSecondary = ActionLevelEnum.Secondary;
|
|
4602
|
+
this.levelInfo = ActionLevelEnum.Info;
|
|
4603
|
+
this.levelHelp = ActionLevelEnum.Help;
|
|
4604
|
+
this.levelSuccess = ActionLevelEnum.Success;
|
|
4605
|
+
this.levelWarning = ActionLevelEnum.Warning;
|
|
4606
|
+
this.levelDanger = ActionLevelEnum.Danger;
|
|
4607
|
+
this.hostClass = 'mng-action-button';
|
|
4418
4608
|
this.inputDisabled = of(false);
|
|
4419
4609
|
this.inputLoading = of(false);
|
|
4420
4610
|
this.triggerEventEmitter = new EventEmitter();
|
|
4421
4611
|
this.loadingSubject = new ReplaySubject(1);
|
|
4422
4612
|
this.$loading = this.loadingSubject.asObservable();
|
|
4423
4613
|
this.cmpId = Math.random().toString(36).substring(2);
|
|
4614
|
+
this.hasNoTitle = false;
|
|
4424
4615
|
this.loadingSubject.next(false);
|
|
4425
4616
|
}
|
|
4426
4617
|
ngOnInit() {
|
|
4427
4618
|
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
4619
|
+
this.hasNoTitle = this.action.title === null;
|
|
4428
4620
|
const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, this.viewContainer ?? undefined, this, this.actionData);
|
|
4429
4621
|
this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
|
|
4430
4622
|
this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
|
|
4431
|
-
this.$label = I18nUtil.streamActionTranslation(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
|
|
4623
|
+
this.$label = this.hasNoTitle ? of(null) : I18nUtil.streamActionTranslation(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
|
|
4432
4624
|
this.$tooltip = I18nUtil.streamActionTranslation(this.translate, this.action, 'tooltip', this.action?.tooltip ?? undefined, this.item);
|
|
4625
|
+
if (this.action instanceof ActionLinkDescriptor) {
|
|
4626
|
+
this.actionLink = this.action;
|
|
4627
|
+
}
|
|
4628
|
+
if (this.action.className) {
|
|
4629
|
+
this.hostClass = this.action.className;
|
|
4630
|
+
}
|
|
4433
4631
|
}
|
|
4434
4632
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4435
4633
|
triggerAction(event) {
|
|
@@ -4445,8 +4643,8 @@ class MngActionComponent {
|
|
|
4445
4643
|
this.loadingSubject.next(false);
|
|
4446
4644
|
},
|
|
4447
4645
|
error: err => {
|
|
4448
|
-
console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
|
|
4449
4646
|
this.loadingSubject.next(false);
|
|
4647
|
+
console.warn(`Error occurred while executing action ${this.action.actionName}.`, err);
|
|
4450
4648
|
}
|
|
4451
4649
|
});
|
|
4452
4650
|
}
|
|
@@ -4458,13 +4656,16 @@ class MngActionComponent {
|
|
|
4458
4656
|
}
|
|
4459
4657
|
}
|
|
4460
4658
|
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 });
|
|
4461
|
-
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 <
|
|
4659
|
+
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 });
|
|
4462
4660
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
4463
4661
|
type: Component,
|
|
4464
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <
|
|
4662
|
+
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"] }]
|
|
4465
4663
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
4466
4664
|
type: Optional
|
|
4467
|
-
}] }]; }, propDecorators: {
|
|
4665
|
+
}] }]; }, propDecorators: { hostClass: [{
|
|
4666
|
+
type: HostBinding,
|
|
4667
|
+
args: ['class']
|
|
4668
|
+
}], action: [{
|
|
4468
4669
|
type: Input
|
|
4469
4670
|
}], item: [{
|
|
4470
4671
|
type: Input
|
|
@@ -4710,7 +4911,7 @@ class MngFormEditorComponent {
|
|
|
4710
4911
|
}
|
|
4711
4912
|
const event = new MngFormEditorSubmitEvent(formSubmitItem);
|
|
4712
4913
|
event.success = false;
|
|
4713
|
-
this.formMessages.push(
|
|
4914
|
+
this.formMessages.push(NotificationUtil.getFormEditorWarningMessage(this.translateService, 'mngEditor.invalidFormToastTitle', 'mngEditor.invalidFormToastMessage'));
|
|
4714
4915
|
this.formSubmitEventEmitter.next(event);
|
|
4715
4916
|
}
|
|
4716
4917
|
}
|
|
@@ -5159,13 +5360,13 @@ class MngActionEditorComponent {
|
|
|
5159
5360
|
// assign run operations
|
|
5160
5361
|
action.withRunNotificationSuccess(undefined, undefined, false);
|
|
5161
5362
|
if (action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit) {
|
|
5162
|
-
action.withRunFunction(
|
|
5363
|
+
action.withRunFunction(() => {
|
|
5163
5364
|
this.triggerSubmit();
|
|
5164
5365
|
return of(undefined);
|
|
5165
5366
|
});
|
|
5166
5367
|
}
|
|
5167
5368
|
else {
|
|
5168
|
-
action.withRunFunction(
|
|
5369
|
+
action.withRunFunction(() => {
|
|
5169
5370
|
this.cancel();
|
|
5170
5371
|
return of(undefined);
|
|
5171
5372
|
});
|
|
@@ -5233,15 +5434,16 @@ class MngActionEditorComponent {
|
|
|
5233
5434
|
this.actionExecutor
|
|
5234
5435
|
.runEditorFetch(this.action, this.item, this.itemId, this.dataProvider, this.sourceComponent, this.viewContainer)
|
|
5235
5436
|
.pipe(first(), catchError(err => {
|
|
5437
|
+
const actionError = this.actionExecutor.toMngActionError(err);
|
|
5236
5438
|
if (this.action.hasRunNotificationError) {
|
|
5237
|
-
|
|
5439
|
+
NotificationUtil.actionNotificationError(this.translate, this.action, actionError, 'fetch', this.viewContainer, this.item);
|
|
5238
5440
|
}
|
|
5239
|
-
|
|
5441
|
+
return throwError(() => actionError);
|
|
5240
5442
|
}), finalize(() => this.loadingSubject.next(false)))
|
|
5241
5443
|
.subscribe(res => {
|
|
5242
5444
|
this.item = res.result;
|
|
5243
5445
|
if (this.action.hasFetchNotificationSuccess) {
|
|
5244
|
-
|
|
5446
|
+
NotificationUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.viewContainer, this.item);
|
|
5245
5447
|
}
|
|
5246
5448
|
this.setTitle();
|
|
5247
5449
|
});
|
|
@@ -5457,84 +5659,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5457
5659
|
type: Input
|
|
5458
5660
|
}] } });
|
|
5459
5661
|
|
|
5460
|
-
class MngPropertyPathPipe {
|
|
5461
|
-
transform(value, path = '') {
|
|
5462
|
-
if (path.indexOf('.') >= 0) {
|
|
5463
|
-
const pathSplit = path.split('.');
|
|
5464
|
-
let currValue = value;
|
|
5465
|
-
for (const p of pathSplit) {
|
|
5466
|
-
if (typeof currValue === 'undefined' || currValue === null) {
|
|
5467
|
-
return currValue;
|
|
5468
|
-
}
|
|
5469
|
-
else if (typeof currValue === 'object') {
|
|
5470
|
-
currValue = currValue[p];
|
|
5471
|
-
}
|
|
5472
|
-
else {
|
|
5473
|
-
console.warn(`Path ${path} is not valid for object`, value);
|
|
5474
|
-
return currValue;
|
|
5475
|
-
}
|
|
5476
|
-
}
|
|
5477
|
-
return currValue;
|
|
5478
|
-
}
|
|
5479
|
-
else {
|
|
5480
|
-
return typeof value === 'object' ? value[path] : value;
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
5483
|
-
}
|
|
5484
|
-
MngPropertyPathPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5485
|
-
MngPropertyPathPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, name: "propertyPath" });
|
|
5486
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngPropertyPathPipe, decorators: [{
|
|
5487
|
-
type: Pipe,
|
|
5488
|
-
args: [{
|
|
5489
|
-
name: 'propertyPath',
|
|
5490
|
-
pure: true
|
|
5491
|
-
}]
|
|
5492
|
-
}] });
|
|
5493
|
-
|
|
5494
|
-
class MngBooleanPipe {
|
|
5495
|
-
transform(value, yes, no, icon = false) {
|
|
5496
|
-
if (typeof value === 'boolean') {
|
|
5497
|
-
if (icon) {
|
|
5498
|
-
return value ? yes ?? 'pi pi-check' : no ?? 'pi pi-times';
|
|
5499
|
-
}
|
|
5500
|
-
else {
|
|
5501
|
-
return value ? yes ?? 'general.yes' : no ?? 'general.no';
|
|
5502
|
-
}
|
|
5503
|
-
}
|
|
5504
|
-
else {
|
|
5505
|
-
return value;
|
|
5506
|
-
}
|
|
5507
|
-
}
|
|
5508
|
-
}
|
|
5509
|
-
MngBooleanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5510
|
-
MngBooleanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, name: "boolean" });
|
|
5511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBooleanPipe, decorators: [{
|
|
5512
|
-
type: Pipe,
|
|
5513
|
-
args: [{
|
|
5514
|
-
name: 'boolean',
|
|
5515
|
-
pure: true
|
|
5516
|
-
}]
|
|
5517
|
-
}] });
|
|
5518
|
-
|
|
5519
|
-
class MngEnumPipe {
|
|
5520
|
-
transform(value, enumObj, i18nPath, nameAsValue = false) {
|
|
5521
|
-
const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
|
|
5522
|
-
if (typeof i18nPath === 'undefined') {
|
|
5523
|
-
i18nPath = TypeUtil.findEnumName(enumObj);
|
|
5524
|
-
}
|
|
5525
|
-
return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
|
|
5526
|
-
}
|
|
5527
|
-
}
|
|
5528
|
-
MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5529
|
-
MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
|
|
5530
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
|
|
5531
|
-
type: Pipe,
|
|
5532
|
-
args: [{
|
|
5533
|
-
name: 'enum',
|
|
5534
|
-
pure: true
|
|
5535
|
-
}]
|
|
5536
|
-
}] });
|
|
5537
|
-
|
|
5538
5662
|
class MngTableColumnValueComponent {
|
|
5539
5663
|
constructor() {
|
|
5540
5664
|
this.columnTypeString = ColumnDescriptor.TypeEnum.String;
|
|
@@ -5555,21 +5679,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5555
5679
|
type: Input
|
|
5556
5680
|
}] } });
|
|
5557
5681
|
|
|
5558
|
-
class MngI18nPropertyPipe {
|
|
5559
|
-
transform(property, model) {
|
|
5560
|
-
return I18nUtil.getModelPropertyKey(model, property);
|
|
5561
|
-
}
|
|
5562
|
-
}
|
|
5563
|
-
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5564
|
-
MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
|
|
5565
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
|
|
5566
|
-
type: Pipe,
|
|
5567
|
-
args: [{
|
|
5568
|
-
name: 'i18nProperty',
|
|
5569
|
-
pure: true
|
|
5570
|
-
}]
|
|
5571
|
-
}] });
|
|
5572
|
-
|
|
5573
5682
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
5574
5683
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
5575
5684
|
class MngTableComponent {
|
|
@@ -5764,7 +5873,7 @@ class MngTableComponent {
|
|
|
5764
5873
|
this.isSortChanged = false;
|
|
5765
5874
|
this.dataProviderLoadingSubject.next(false);
|
|
5766
5875
|
}, err => {
|
|
5767
|
-
|
|
5876
|
+
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainerService ?? undefined);
|
|
5768
5877
|
const emptyQueryResult = new MediusQueryResult();
|
|
5769
5878
|
emptyQueryResult.pageData = [];
|
|
5770
5879
|
emptyQueryResult.allDataCount = 0;
|
|
@@ -5991,27 +6100,48 @@ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
|
5991
6100
|
this.route = route;
|
|
5992
6101
|
}
|
|
5993
6102
|
createTableviewDescriptor() {
|
|
5994
|
-
if (
|
|
6103
|
+
if (this.descriptorInit) {
|
|
6104
|
+
return this.descriptorInit;
|
|
6105
|
+
}
|
|
6106
|
+
const routeData = this.route.snapshot.data;
|
|
6107
|
+
if (!routeData?.tableview?.descriptor) {
|
|
5995
6108
|
throw Error('Tableview requires a descriptor.');
|
|
5996
6109
|
}
|
|
5997
|
-
return
|
|
6110
|
+
return routeData.tableview.descriptor;
|
|
5998
6111
|
}
|
|
5999
6112
|
createTableviewDataProvider() {
|
|
6000
|
-
if (
|
|
6113
|
+
if (this.dataProviderInit) {
|
|
6114
|
+
return this.dataProviderInit;
|
|
6115
|
+
}
|
|
6116
|
+
const routeData = this.route.snapshot.data;
|
|
6117
|
+
if (!routeData?.tableview?.dataProvider) {
|
|
6001
6118
|
throw Error('Tableview requires a data provider.');
|
|
6002
6119
|
}
|
|
6003
|
-
return
|
|
6120
|
+
return routeData.tableview.dataProvider;
|
|
6004
6121
|
}
|
|
6005
6122
|
createActionDescriptors() {
|
|
6006
|
-
|
|
6123
|
+
if (this.actionsInit) {
|
|
6124
|
+
return this.actionsInit;
|
|
6125
|
+
}
|
|
6126
|
+
const routeData = this.route.snapshot.data;
|
|
6127
|
+
return routeData?.tableview?.actions ?? super.createActionDescriptors();
|
|
6007
6128
|
}
|
|
6008
6129
|
}
|
|
6009
6130
|
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
6010
|
-
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"] }] });
|
|
6131
|
+
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"] }] });
|
|
6011
6132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
6012
6133
|
type: Component,
|
|
6013
6134
|
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" }]
|
|
6014
|
-
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; }
|
|
6135
|
+
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; }, propDecorators: { descriptorInit: [{
|
|
6136
|
+
type: Input,
|
|
6137
|
+
args: ['descriptor']
|
|
6138
|
+
}], dataProviderInit: [{
|
|
6139
|
+
type: Input,
|
|
6140
|
+
args: ['dataProvider']
|
|
6141
|
+
}], actionsInit: [{
|
|
6142
|
+
type: Input,
|
|
6143
|
+
args: ['actions']
|
|
6144
|
+
}] } });
|
|
6015
6145
|
|
|
6016
6146
|
class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
6017
6147
|
constructor(injector) {
|
|
@@ -6196,9 +6326,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6196
6326
|
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.viewEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
|
|
6197
6327
|
.withPosition(ActionPositionEnum.RowClick)
|
|
6198
6328
|
.withTitle(null)
|
|
6199
|
-
.
|
|
6200
|
-
.withClassName('mng-formly-field-table-form-dialog')
|
|
6201
|
-
.withSize(SizeEnum.ExtraSmall);
|
|
6329
|
+
.withDialogClassName('mng-formly-field-table-form-dialog');
|
|
6202
6330
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
|
|
6203
6331
|
this.rowClickActions.push(viewAction);
|
|
6204
6332
|
}
|
|
@@ -6207,7 +6335,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6207
6335
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
6208
6336
|
.withTitle(null)
|
|
6209
6337
|
.withIcon('pi pi-plus')
|
|
6210
|
-
.
|
|
6338
|
+
.withDialogClassName('mng-formly-field-table-form-dialog')
|
|
6211
6339
|
.withSize(SizeEnum.ExtraSmall)
|
|
6212
6340
|
.withSubmitFunction(ctx => {
|
|
6213
6341
|
if (!ctx.data?.item) {
|
|
@@ -6227,7 +6355,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6227
6355
|
const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
|
|
6228
6356
|
.withTitle(null)
|
|
6229
6357
|
.withIcon('pi pi-pencil')
|
|
6230
|
-
.
|
|
6358
|
+
.withDialogClassName('mng-formly-field-table-form-dialog')
|
|
6231
6359
|
.withSize(SizeEnum.ExtraSmall)
|
|
6232
6360
|
.withSubmitFunction(ctx => {
|
|
6233
6361
|
if (!ctx.data?.item) {
|
|
@@ -7240,6 +7368,7 @@ const declarations = [
|
|
|
7240
7368
|
MngEnumPipe,
|
|
7241
7369
|
MngBooleanPipe,
|
|
7242
7370
|
MngI18nPropertyPipe,
|
|
7371
|
+
MngLinkFormatterPipe,
|
|
7243
7372
|
// layout components
|
|
7244
7373
|
MngBreadcrumbComponent,
|
|
7245
7374
|
MngFooterComponent,
|
|
@@ -7286,6 +7415,7 @@ class MngCommonsModule {
|
|
|
7286
7415
|
MngActionExecutorService,
|
|
7287
7416
|
MngNavigationService,
|
|
7288
7417
|
MngCommonsService,
|
|
7418
|
+
MngLinkFormatterPipe,
|
|
7289
7419
|
// component service
|
|
7290
7420
|
MngMainLayoutComponentService,
|
|
7291
7421
|
MngViewContainerComponentService,
|
|
@@ -7342,6 +7472,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
7342
7472
|
MngEnumPipe,
|
|
7343
7473
|
MngBooleanPipe,
|
|
7344
7474
|
MngI18nPropertyPipe,
|
|
7475
|
+
MngLinkFormatterPipe,
|
|
7345
7476
|
// layout components
|
|
7346
7477
|
MngBreadcrumbComponent,
|
|
7347
7478
|
MngFooterComponent,
|
|
@@ -7454,6 +7585,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
7454
7585
|
MngEnumPipe,
|
|
7455
7586
|
MngBooleanPipe,
|
|
7456
7587
|
MngI18nPropertyPipe,
|
|
7588
|
+
MngLinkFormatterPipe,
|
|
7457
7589
|
// layout components
|
|
7458
7590
|
MngBreadcrumbComponent,
|
|
7459
7591
|
MngFooterComponent,
|
|
@@ -7554,37 +7686,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
7554
7686
|
}]
|
|
7555
7687
|
}] });
|
|
7556
7688
|
|
|
7557
|
-
class
|
|
7558
|
-
constructor(type,
|
|
7689
|
+
class AMngApiService {
|
|
7690
|
+
constructor(type, http) {
|
|
7559
7691
|
this.type = type;
|
|
7560
|
-
this.queryResultType = queryResultType;
|
|
7561
7692
|
this.http = http;
|
|
7562
7693
|
this.objectSerializer = ObjectSerializer.get();
|
|
7563
7694
|
}
|
|
7564
|
-
|
|
7565
|
-
|
|
7695
|
+
getUrl(...pathSegments) {
|
|
7696
|
+
let path = pathSegments.join('/');
|
|
7697
|
+
if (!path.startsWith('/')) {
|
|
7698
|
+
path = path.substring(1);
|
|
7699
|
+
}
|
|
7700
|
+
return `${this.getBasePath()}${this.getServiceBasePath()}${path}`;
|
|
7701
|
+
}
|
|
7702
|
+
deserialize(item) {
|
|
7703
|
+
return this.deserializeClass(item, this.type);
|
|
7704
|
+
}
|
|
7705
|
+
serialize(item) {
|
|
7706
|
+
return this.serializeClass(item, this.type);
|
|
7707
|
+
}
|
|
7708
|
+
serializeQueryParam(queryParam, type = 'QueryParam') {
|
|
7709
|
+
return this.objectSerializer.serialize(queryParam, type);
|
|
7710
|
+
}
|
|
7711
|
+
deserializeQueryResult(item, qrType) {
|
|
7712
|
+
return this.deserializeClass(item, qrType);
|
|
7713
|
+
}
|
|
7714
|
+
deserializeClass(item, type) {
|
|
7715
|
+
return this.objectSerializer.deserializeClass(item, type);
|
|
7716
|
+
}
|
|
7717
|
+
serializeClass(item, type) {
|
|
7718
|
+
return this.objectSerializer.serializeClass(item, type);
|
|
7719
|
+
}
|
|
7720
|
+
}
|
|
7721
|
+
|
|
7722
|
+
class AMngGetAllApiService extends AMngApiService {
|
|
7723
|
+
constructor(type, queryResultType, http) {
|
|
7724
|
+
super(type, http);
|
|
7725
|
+
this.queryResultType = queryResultType;
|
|
7726
|
+
}
|
|
7727
|
+
getAllPost(queryParamBody, params) {
|
|
7728
|
+
const url = this.getUrl(this.getGetAllPostPath());
|
|
7566
7729
|
return this.http
|
|
7567
|
-
.post(url, this.
|
|
7730
|
+
.post(url, queryParamBody ? this.serializeQueryParam(queryParamBody) : undefined, {
|
|
7568
7731
|
withCredentials: true,
|
|
7569
7732
|
observe: 'body',
|
|
7570
7733
|
reportProgress: false,
|
|
7571
7734
|
params: params
|
|
7572
7735
|
})
|
|
7573
|
-
.pipe(map(res => this.
|
|
7736
|
+
.pipe(map(res => this.deserializeQueryResult(res, this.queryResultType)));
|
|
7574
7737
|
}
|
|
7575
|
-
|
|
7576
|
-
|
|
7738
|
+
getGetAllPostPath() {
|
|
7739
|
+
return '/get-all';
|
|
7740
|
+
}
|
|
7741
|
+
}
|
|
7742
|
+
|
|
7743
|
+
class AMngCrudApiService extends AMngGetAllApiService {
|
|
7744
|
+
constructor(type, queryResultType, http) {
|
|
7745
|
+
super(type, queryResultType, http);
|
|
7746
|
+
}
|
|
7747
|
+
createPost(item, params) {
|
|
7748
|
+
const url = this.getUrl(this.getCreatePostPath());
|
|
7577
7749
|
return this.http
|
|
7578
|
-
.post(url, this.
|
|
7750
|
+
.post(url, this.serialize(item), {
|
|
7579
7751
|
withCredentials: true,
|
|
7580
7752
|
observe: 'body',
|
|
7581
7753
|
reportProgress: false,
|
|
7582
7754
|
params: params
|
|
7583
7755
|
})
|
|
7584
|
-
.pipe(map(res => this.
|
|
7756
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7585
7757
|
}
|
|
7586
7758
|
getByIdGet(id, params) {
|
|
7587
|
-
const url =
|
|
7759
|
+
const url = this.getUrl(this.getGetByIdGetPath(id));
|
|
7588
7760
|
return this.http
|
|
7589
7761
|
.get(url, {
|
|
7590
7762
|
withCredentials: true,
|
|
@@ -7592,33 +7764,30 @@ class AMngCrudApiService {
|
|
|
7592
7764
|
reportProgress: false,
|
|
7593
7765
|
params: params
|
|
7594
7766
|
})
|
|
7595
|
-
.pipe(map(res => this.
|
|
7767
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7596
7768
|
}
|
|
7597
7769
|
updatePut(id, item, params) {
|
|
7598
|
-
const url =
|
|
7770
|
+
const url = this.getUrl(this.getUpdatePutPath(id, item));
|
|
7599
7771
|
return this.http
|
|
7600
|
-
.put(url, this.
|
|
7772
|
+
.put(url, this.serialize(item), {
|
|
7601
7773
|
withCredentials: true,
|
|
7602
7774
|
observe: 'body',
|
|
7603
7775
|
reportProgress: false,
|
|
7604
7776
|
params: params
|
|
7605
7777
|
})
|
|
7606
|
-
.pipe(map(res => this.
|
|
7778
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7607
7779
|
}
|
|
7608
7780
|
removeDelete(id, item, params) {
|
|
7609
|
-
const url =
|
|
7781
|
+
const url = this.getUrl(this.getRemoveDeletePath(id, item));
|
|
7610
7782
|
return this.http
|
|
7611
7783
|
.request('delete', url, {
|
|
7612
7784
|
withCredentials: true,
|
|
7613
7785
|
observe: 'body',
|
|
7614
7786
|
reportProgress: false,
|
|
7615
|
-
body: item ? this.
|
|
7787
|
+
body: item ? this.serialize(item) : undefined,
|
|
7616
7788
|
params: params
|
|
7617
7789
|
})
|
|
7618
|
-
.pipe(map(res => this.
|
|
7619
|
-
}
|
|
7620
|
-
getGetAllPostPath() {
|
|
7621
|
-
return '/get-all';
|
|
7790
|
+
.pipe(map(res => this.deserialize(res)));
|
|
7622
7791
|
}
|
|
7623
7792
|
getCreatePostPath() {
|
|
7624
7793
|
return '';
|
|
@@ -8096,5 +8265,5 @@ class RouteDataBuilder {
|
|
|
8096
8265
|
* Generated bundle index. Do not edit.
|
|
8097
8266
|
*/
|
|
8098
8267
|
|
|
8099
|
-
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,
|
|
8268
|
+
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 };
|
|
8100
8269
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|