mmhglobal-dynamicform 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { NavigationStart, NavigationEnd, NavigationError, RouterModule } from '@
6
6
  import { of, switchMap, forkJoin, tap, Subject, BehaviorSubject, map as map$1, isObservable, interval, takeWhile, from, delay as delay$1, filter as filter$1, first } from 'rxjs';
7
7
  import { map, tap as tap$1, switchMap as switchMap$1, delay, take, filter, concatMap, ignoreElements } from 'rxjs/operators';
8
8
  import * as i2 from 'mmhglobal-zcore';
9
- import { ZComponentHelper, ZComponentProperties, ZGroup, MESSAGETYPE, ZSelectPostApiParams, UploadMetaData, DefaultPageSettingParams, ZCoreModule } from 'mmhglobal-zcore';
9
+ import { ZComponentHelper, ZComponentProperties, ZGroup, MESSAGETYPE, DefaultMessage, DefaultDialogTitle, ZSelectPostApiParams, UploadMetaData, DefaultPageSettingParams, ZCoreModule } from 'mmhglobal-zcore';
10
10
  import * as i1$1 from '@progress/kendo-angular-dialog';
11
11
  import { DialogContentBase } from '@progress/kendo-angular-dialog';
12
12
  import * as i4 from 'mmhglobal-zmodal';
@@ -2775,8 +2775,8 @@ class MainService {
2775
2775
  isFormDirtyAndValid(fg, group, isSkipDirty = false, event) {
2776
2776
  if (!isSkipDirty && !fg.dirty) {
2777
2777
  console.warn("Form is not dirty hence record is not save.");
2778
- const message = event && event.data && event.data[`FormNotDirtyMessage`] ? event.data[`FormNotDirtyMessage`] : "Data has not been changed since it was last saved.";
2779
- this.alertService.showOkay("Nothing to update", message);
2778
+ const message = event && event.data && event.data[`FormNotDirtyMessage`] ? event.data[`FormNotDirtyMessage`] : DefaultMessage.notDirtyMessage;
2779
+ this.alertService.showOkay(DefaultDialogTitle.nothingToUpdate, message, ["col-5"]);
2780
2780
  return false;
2781
2781
  }
2782
2782
  if (!fg.valid) {
@@ -2796,7 +2796,7 @@ class MainService {
2796
2796
  }
2797
2797
  beforeDeleteModel(group) {
2798
2798
  if (!group.beforeDeleteModel) {
2799
- console.warn("group.beforeUpdateModel is undefined");
2799
+ console.warn("group.beforeDeleteModel is undefined");
2800
2800
  return of({});
2801
2801
  }
2802
2802
  return group.beforeDeleteModel(group);
@@ -2810,7 +2810,7 @@ class MainService {
2810
2810
  }
2811
2811
  beforeCreateModel(group) {
2812
2812
  if (!group.beforeCreateModel) {
2813
- console.warn("group.beforeUpdateModel is undefined");
2813
+ console.warn("group.beforeCreateModel is undefined");
2814
2814
  return of({});
2815
2815
  }
2816
2816
  return group.beforeCreateModel(group);
@@ -3145,37 +3145,44 @@ class ZGridBindingDirective extends DataBindingDirective {
3145
3145
  }
3146
3146
  generateGridColumns() {
3147
3147
  const columnFields$ = ZComponentHelper.getGroupValue(this.field.ColumnFields, this.grp);
3148
- columnFields$.pipe(tap$1((data) => {
3149
- const gridSetting = this.getGridSettings();
3150
- ZComponentHelper.getGridColumns(data, this.gridColumns, this.zgridbinding.group, gridSetting, this.usableColumns);
3151
- this.getFilterParamsColumns();
3152
- this.getFilter();
3153
- this.getFilterParams();
3154
- this.getSorting();
3155
- this.getGrantType();
3156
- this.setHiddenColumn(gridSetting);
3157
- this.params.referId = this.getFieldReferenceId() || this.grp.referenceId || null;
3158
- // }),
3159
- // switchMap(() => {
3160
- // //Get Session
3161
- // return this.getGridSessionFilter(this.grp, this);
3162
- // }),
3163
- // switchMap(() => {
3164
- // //Before get grid data
3165
- // return this.beforeGridGetData(this.grp, this);
3166
- // }),
3167
- // switchMap(() => {
3168
- // //Set grid data
3169
- // return this.setGridSessionFilter(this.grp, this);
3170
- })).subscribe(() => {
3171
- if (this.field['SkipLoadResourceURLData']) {
3172
- this.grid.loading = false;
3173
- this.gridSubject.next(this);
3174
- }
3175
- else {
3176
- this.getDataBinding();
3177
- }
3178
- });
3148
+ if (columnFields$) {
3149
+ columnFields$.pipe(tap$1((data) => {
3150
+ const gridSetting = this.getGridSettings();
3151
+ ZComponentHelper.getGridColumns(data, this.gridColumns, this.zgridbinding.group, gridSetting, this.usableColumns);
3152
+ this.getFilterParamsColumns();
3153
+ this.getFilter();
3154
+ this.getFilterParams();
3155
+ this.getSorting();
3156
+ this.getGrantType();
3157
+ this.setHiddenColumn(gridSetting);
3158
+ this.params.referId = this.getFieldReferenceId() || this.grp.referenceId || null;
3159
+ // }),
3160
+ // switchMap(() => {
3161
+ // //Get Session
3162
+ // return this.getGridSessionFilter(this.grp, this);
3163
+ // }),
3164
+ // switchMap(() => {
3165
+ // //Before get grid data
3166
+ // return this.beforeGridGetData(this.grp, this);
3167
+ // }),
3168
+ // switchMap(() => {
3169
+ // //Set grid data
3170
+ // return this.setGridSessionFilter(this.grp, this);
3171
+ })).subscribe(() => {
3172
+ if (this.field['SkipLoadResourceURLData']) {
3173
+ this.grid.loading = false;
3174
+ this.gridSubject.next(this);
3175
+ }
3176
+ else {
3177
+ this.getDataBinding();
3178
+ }
3179
+ });
3180
+ }
3181
+ else {
3182
+ console.log('Fail to generate grid column fields.');
3183
+ console.log(this.field.ColumnFields);
3184
+ console.log(this.grp);
3185
+ }
3179
3186
  }
3180
3187
  setSkipLoadResourceURLData(settingValue) {
3181
3188
  this.field['SkipLoadResourceURLData'] = !settingValue;
@@ -8229,6 +8236,11 @@ class ZgridComponent extends DataListingFieldBase {
8229
8236
  if (!this.data.ColumnFields) {
8230
8237
  console.warn('Invalid/Empty grid(' + this.data.Name + ') columnField');
8231
8238
  }
8239
+ if (!columnFields$) {
8240
+ console.log('Fail to generate grid column fields.');
8241
+ console.log(this.data.ColumnFields);
8242
+ console.log(this.group);
8243
+ }
8232
8244
  return columnFields$.pipe(tap$1(data => {
8233
8245
  if (!data) {
8234
8246
  console.warn('Invalid/Empty grid(' + this.data.Name + ') data to generate column');