@ironcode/vas-lib 1.6.2 → 1.7.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.
@@ -637,7 +637,7 @@ class VasJobDataModel extends VasAccountObjectModel {
637
637
  * VasFieldModel
638
638
  */
639
639
  class VasFieldModel extends VasJobDataModel {
640
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, job, control, fieldJobPointers, value, version) {
640
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, job, control, fieldJobPointers, value, version, controlName, controlTitle, controlTypeName) {
641
641
  super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, job);
642
642
  this.id = id;
643
643
  this.created = created;
@@ -654,13 +654,16 @@ class VasFieldModel extends VasJobDataModel {
654
654
  this.fieldJobPointers = fieldJobPointers;
655
655
  this.value = value;
656
656
  this.version = version;
657
+ this.controlName = controlName;
658
+ this.controlTitle = controlTitle;
659
+ this.controlTypeName = controlTypeName;
657
660
  }
658
661
  /**
659
662
  * @param {VasFieldDto} fieldDto
660
663
  * @return {VasFieldModel}
661
664
  */
662
665
  static fromDto(fieldDto) {
663
- return new VasFieldModel(fieldDto.id || '', fieldDto.created || '', fieldDto.serverCreated || '', fieldDto.createdBy || '', fieldDto.modified || '', fieldDto.serverModified || '', fieldDto.modifiedBy || '', fieldDto.createdByName || '', fieldDto.modifiedByName || '', fieldDto.account || '', fieldDto.job || '', fieldDto.control || '', fieldDto.fieldJobPointers || [], fieldDto.value || '', fieldDto.version || 0);
666
+ return new VasFieldModel(fieldDto.id || '', fieldDto.created || '', fieldDto.serverCreated || '', fieldDto.createdBy || '', fieldDto.modified || '', fieldDto.serverModified || '', fieldDto.modifiedBy || '', fieldDto.createdByName || '', fieldDto.modifiedByName || '', fieldDto.account || '', fieldDto.job || '', fieldDto.control || '', fieldDto.fieldJobPointers || [], fieldDto.value || '', fieldDto.version || 0, fieldDto.controlName || '', fieldDto.controlTitle || '', fieldDto.controlTypeName || '');
664
667
  }
665
668
  /**
666
669
  * @return {VasFieldDto}
@@ -682,6 +685,9 @@ class VasFieldModel extends VasJobDataModel {
682
685
  fieldJobPointers: this.fieldJobPointers,
683
686
  value: this.value,
684
687
  version: this.version,
688
+ controlName: this.controlName,
689
+ controlTitle: this.controlTitle,
690
+ controlTypeName: this.controlTypeName,
685
691
  };
686
692
  }
687
693
  /**
@@ -1879,7 +1885,8 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
1879
1885
  * This method is similar to `getFields` except that this method will only
1880
1886
  * return values where a value was set, as opposed to `getFields` which will
1881
1887
  * return a value for every control even if not value was set, because it uses
1882
- * the form to drive the logic
1888
+ * the form to drive the logic. Note also this method will return values for
1889
+ * any Fields in the fields array.
1883
1890
  * @return {Record<string, VasFieldDtoValue>}
1884
1891
  */
1885
1892
  getFields2() {
@@ -1892,6 +1899,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
1892
1899
  fields[controlName] = this.getValueByPath([groupName, controlName]);
1893
1900
  });
1894
1901
  }, {});
1902
+ this.fields.forEach(field => fields[field.controlName] = field.value);
1895
1903
  return fields;
1896
1904
  }
1897
1905
  /**