@alfresco/adf-core 9.1.0-16490451848 → 9.1.0-16490774779

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.
@@ -21814,25 +21814,25 @@ class FormModel {
21814
21814
  this.isValid = false;
21815
21815
  }
21816
21816
  parseOutcomes() {
21817
- if (this.json.fields) {
21818
- const saveOutcome = new FormOutcomeModel(this, {
21819
- id: FormModel.SAVE_OUTCOME,
21820
- name: 'SAVE',
21821
- isSystem: true
21822
- });
21823
- const completeOutcome = new FormOutcomeModel(this, {
21824
- id: FormModel.COMPLETE_OUTCOME,
21825
- name: 'COMPLETE',
21826
- isSystem: true
21827
- });
21828
- const startProcessOutcome = new FormOutcomeModel(this, {
21829
- id: FormModel.START_PROCESS_OUTCOME,
21830
- name: 'START PROCESS',
21831
- isSystem: true
21832
- });
21833
- const customOutcomes = (this.json.outcomes || []).map((obj) => new FormOutcomeModel(this, obj));
21834
- this.outcomes = [saveOutcome].concat(customOutcomes.length > 0 ? customOutcomes : [completeOutcome, startProcessOutcome]);
21835
- }
21817
+ if (!this.json.fields)
21818
+ return;
21819
+ const saveOutcome = new FormOutcomeModel(this, {
21820
+ id: FormModel.SAVE_OUTCOME,
21821
+ name: FormOutcomeModel.SAVE_ACTION,
21822
+ isSystem: true
21823
+ });
21824
+ const completeOutcome = new FormOutcomeModel(this, {
21825
+ id: FormModel.COMPLETE_OUTCOME,
21826
+ name: FormOutcomeModel.COMPLETE_ACTION,
21827
+ isSystem: true
21828
+ });
21829
+ const startProcessOutcome = new FormOutcomeModel(this, {
21830
+ id: FormModel.START_PROCESS_OUTCOME,
21831
+ name: FormOutcomeModel.START_PROCESS_ACTION,
21832
+ isSystem: true
21833
+ });
21834
+ const customOutcomes = (this.json.outcomes ?? []).map((formModel) => new FormOutcomeModel(this, formModel));
21835
+ this.outcomes = [saveOutcome].concat(customOutcomes.length > 0 ? customOutcomes : [completeOutcome, startProcessOutcome]);
21836
21836
  }
21837
21837
  addValuesNotPresent(valuesToSetIfNotPresent) {
21838
21838
  this.fieldsCache.forEach((field) => {
@@ -21954,7 +21954,7 @@ class FormService {
21954
21954
  if (!json.fields) {
21955
21955
  form.outcomes = [
21956
21956
  new FormOutcomeModel(form, {
21957
- id: '$save',
21957
+ id: FormModel.SAVE_OUTCOME,
21958
21958
  name: FormOutcomeModel.SAVE_ACTION,
21959
21959
  isSystem: true
21960
21960
  })
@@ -24664,7 +24664,7 @@ class FormBaseComponent {
24664
24664
  this.showTitle = true;
24665
24665
  /** Toggle rendering of the `Complete` outcome button. */
24666
24666
  this.showCompleteButton = true;
24667
- /** If true then the `Complete` outcome button is shown but it will be disabled. */
24667
+ /** If true then the `Complete` outcome button is shown, but it will be disabled. */
24668
24668
  this.disableCompleteButton = false;
24669
24669
  /** If true then the `Save` outcome button is shown but will be disabled. */
24670
24670
  this.disableSaveButton = false;
@@ -24694,12 +24694,24 @@ class FormBaseComponent {
24694
24694
  */
24695
24695
  this.formStyle = '';
24696
24696
  }
24697
- static { this.SAVE_OUTCOME_ID = '$save'; }
24698
- static { this.COMPLETE_OUTCOME_ID = '$complete'; }
24699
- static { this.START_PROCESS_OUTCOME_ID = '$startProcess'; }
24697
+ /**
24698
+ * @deprecated Use {@link FormModel.SAVE_OUTCOME} instead.
24699
+ */
24700
+ static { this.SAVE_OUTCOME_ID = FormModel.SAVE_OUTCOME; }
24701
+ /**
24702
+ * @deprecated Use {@link FormModel.COMPLETE_OUTCOME} instead.
24703
+ */
24704
+ static { this.COMPLETE_OUTCOME_ID = FormModel.COMPLETE_OUTCOME; }
24705
+ /**
24706
+ * @deprecated Use {@link FormModel.START_PROCESS_OUTCOME} instead.
24707
+ */
24708
+ static { this.START_PROCESS_OUTCOME_ID = FormModel.START_PROCESS_OUTCOME; }
24700
24709
  static { this.CUSTOM_OUTCOME_ID = '$custom'; }
24701
24710
  static { this.COMPLETE_BUTTON_COLOR = 'primary'; }
24702
- static { this.COMPLETE_OUTCOME_NAME = 'COMPLETE'; }
24711
+ /**
24712
+ * @deprecated Use {@link FormOutcomeModel.COMPLETE_ACTION} instead.
24713
+ */
24714
+ static { this.COMPLETE_OUTCOME_NAME = FormOutcomeModel.COMPLETE_ACTION; }
24703
24715
  get form() {
24704
24716
  return this._form;
24705
24717
  }
@@ -24728,7 +24740,7 @@ class FormBaseComponent {
24728
24740
  return titleEnabled;
24729
24741
  }
24730
24742
  getColorForOutcome(outcomeName) {
24731
- return outcomeName === FormBaseComponent.COMPLETE_OUTCOME_NAME ? FormBaseComponent.COMPLETE_BUTTON_COLOR : null;
24743
+ return outcomeName === FormOutcomeModel.COMPLETE_ACTION ? FormBaseComponent.COMPLETE_BUTTON_COLOR : null;
24732
24744
  }
24733
24745
  isOutcomeButtonEnabled(outcome) {
24734
24746
  if (this.form.readOnly) {
@@ -24766,18 +24778,18 @@ class FormBaseComponent {
24766
24778
  return false;
24767
24779
  }
24768
24780
  if (outcome.isSystem) {
24769
- if (outcome.id === FormBaseComponent.SAVE_OUTCOME_ID) {
24781
+ if (outcome.id === FormModel.SAVE_OUTCOME) {
24770
24782
  this.disableSaveButton = true;
24771
24783
  this.saveTaskForm();
24772
24784
  return true;
24773
24785
  }
24774
- if (outcome.id === FormBaseComponent.COMPLETE_OUTCOME_ID) {
24786
+ if (outcome.id === FormModel.COMPLETE_OUTCOME) {
24775
24787
  this.disableSaveButton = true;
24776
24788
  this.disableCompleteButton = true;
24777
24789
  this.completeTaskForm();
24778
24790
  return true;
24779
24791
  }
24780
- if (outcome.id === FormBaseComponent.START_PROCESS_OUTCOME_ID) {
24792
+ if (outcome.id === FormModel.START_PROCESS_OUTCOME) {
24781
24793
  this.completeTaskForm();
24782
24794
  return true;
24783
24795
  }