mmhglobal-dynamicform 2.16.0 → 2.17.0

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.
@@ -6670,20 +6670,14 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
6670
6670
  this.rightBtns = [];
6671
6671
  this.items = [];
6672
6672
  // Get WFS_DocumentId if any.
6673
- let documentId = null;
6674
- if (this.group.zModel) {
6675
- documentId = this.group.zModel['WFS_DocumentId'];
6676
- }
6673
+ const documentId = this.group.zModel?.['WFS_DocumentId'];
6677
6674
  // Set the documentId to the service
6678
6675
  this.workflowService.appendWFS_DocumentsInfo(this.data.WorkflowCode, documentId);
6679
6676
  // button count
6680
6677
  this.group.zButtonsCount++;
6681
- if (this.group.zButtonsCount === 1) {
6682
- this.FirstZbtn = true;
6683
- }
6678
+ this.FirstZbtn = this.group.zButtonsCount === 1;
6684
6679
  try {
6685
- of(true)
6686
- .pipe(concatMap(() => {
6680
+ of(true).pipe(concatMap(() => {
6687
6681
  // retrieve the workflow button
6688
6682
  return this.workflowService.getWorkflowButtonsField(this.data.WorkflowCode, this.e1wfs_wfcGetWorkflowButtonURL, String(this.isLocalHostAPI));
6689
6683
  }), tap(resultData => {
@@ -6696,7 +6690,7 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
6696
6690
  const attributes = JSON.parse(button.Attributes);
6697
6691
  const isUseCustomClass = attributes.Color ? false : true;
6698
6692
  button = this.appendToAttributeUsefulDetail(button);
6699
- let btn = {
6693
+ const btn = {
6700
6694
  name: button.Name,
6701
6695
  text: label,
6702
6696
  icon: ZComponentHelper.getIcon(attributes.Icon),
@@ -6711,39 +6705,33 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
6711
6705
  this.buttonClick(button);
6712
6706
  }
6713
6707
  };
6714
- if (attributes.PositionX && attributes.PositionX === "right") {
6708
+ if (attributes.PositionX && attributes.PositionX === 'right') {
6715
6709
  this.rightBtns.push(btn);
6716
6710
  }
6717
6711
  else {
6718
6712
  this.leftBtns.push(btn);
6719
6713
  }
6720
- const mappedInfo = {
6721
- 'role': [],
6722
- 'status': [],
6723
- 'parentStatus': []
6724
- };
6725
- //ZComponentHelper.collectWorkflowButton(this.group, this.data.WorkflowCode, buttonLabel, button, attributes, mappedInfo);
6726
6714
  });
6727
6715
  this.items.push(...this.leftBtns, ...this.rightBtns);
6728
6716
  }
6729
6717
  else {
6730
- console.warn('unable to get workflow button. data returned null.');
6718
+ console.warn('Unable to get workflow button. Data returned null.');
6731
6719
  }
6732
6720
  }), switchMap(() => {
6733
6721
  return super.translateButtonsLabel(this.items);
6734
- }), map(() => {
6722
+ }), switchMap(() => {
6735
6723
  if (!this.data.DisableSyncWorkflowStatus) {
6736
6724
  // Set default status
6737
6725
  // eslint-disable-next-line @typescript-eslint/dot-notation
6738
- if (!this.group.zModel["WFS_StatusName"]) {
6726
+ if (!this.group.zModel['WFS_StatusName']) {
6739
6727
  const params = {
6740
- "WorkflowMasterCode": this.data.WorkflowCode
6728
+ WorkflowMasterCode: this.data.WorkflowCode,
6741
6729
  };
6742
- return this.webApiService.httpPost$(this.e1wfs_wfc_getWorkflowInitialStatusURL, params).pipe(map(res => {
6730
+ return this.webApiService.httpPost$(this.e1wfs_wfc_getWorkflowInitialStatusURL, params).pipe(tap(res => {
6743
6731
  if (res.Data) {
6744
- ZComponentHelper.presetModelValue("WFS_StatusId", res.Data["Id"], this.group);
6745
- ZComponentHelper.presetModelValue("WFS_StatusName", res.Data["Name"], this.group);
6746
- ZComponentHelper.presetModelValue("WFS_StatusCode", res.Data["Code"], this.group);
6732
+ ZComponentHelper.presetModelValue('WFS_StatusId', res.Data['Id'], this.group);
6733
+ ZComponentHelper.presetModelValue('WFS_StatusName', res.Data['Name'], this.group);
6734
+ ZComponentHelper.presetModelValue('WFS_StatusCode', res.Data['Code'], this.group);
6747
6735
  this.workflowService.setCurrentDocumentStatus(res.Data);
6748
6736
  }
6749
6737
  }));
@@ -6751,10 +6739,10 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
6751
6739
  else {
6752
6740
  // When loading also to get current Status Information if any.
6753
6741
  const docInfoParam = {
6754
- "WorkflowMasterCode": this.data.WorkflowCode,
6755
- "DocumentId": documentId,
6742
+ WorkflowMasterCode: this.data.WorkflowCode,
6743
+ DocumentId: documentId,
6756
6744
  };
6757
- this.webApiService.httpPost$(this.e1wfs_wfc_getDocumentStatusURL, docInfoParam).pipe(map(res => {
6745
+ return this.webApiService.httpPost$(this.e1wfs_wfc_getDocumentStatusURL, docInfoParam).pipe(tap(res => {
6758
6746
  this.workflowService.setCurrentDocumentStatus(res);
6759
6747
  if (res.Data) {
6760
6748
  this.workflowService.setCurrentDocumentStatus(res.Data);
@@ -6762,10 +6750,11 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
6762
6750
  }));
6763
6751
  }
6764
6752
  }
6753
+ return of(null);
6765
6754
  })).subscribe();
6766
6755
  }
6767
6756
  catch (error) {
6768
- console.error("error: ", error);
6757
+ console.error('Error:', error);
6769
6758
  }
6770
6759
  }
6771
6760
  buttonClick(button) {
@@ -9423,7 +9412,7 @@ class ZgridComponent extends DataListingFieldBase {
9423
9412
  this.closeEditor(sender);
9424
9413
  // loop all column to get validation and create form control
9425
9414
  const colFormControl = {};
9426
- this.zgrid.gridColumns.forEach(col => {
9415
+ this.columns.forEach(col => {
9427
9416
  const validators = [];
9428
9417
  if (col.IsRequired) {
9429
9418
  validators.push(Validators.required);
@@ -9496,7 +9485,7 @@ class ZgridComponent extends DataListingFieldBase {
9496
9485
  this.closeEditor(sender);
9497
9486
  // loop all column to get validation and create form control, append current row value
9498
9487
  const colFormControl = {};
9499
- this.zgrid.gridColumns.forEach(col => {
9488
+ this.columns.forEach(col => {
9500
9489
  const validators = [];
9501
9490
  if (col.IsRequired) {
9502
9491
  validators.push(Validators.required);