This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/develop by this push:
new f143150d AIRAVATA-3673 Validates that a group resource profile is
selected
f143150d is described below
commit f143150d33b3544f5d3914b91234d08166cd1f2f
Author: Marcus Christie <[email protected]>
AuthorDate: Fri Nov 18 17:54:57 2022 -0500
AIRAVATA-3673 Validates that a group resource profile is selected
---
.../js/components/experiment/ExperimentEditor.vue | 6 +++++-
.../experiment/GroupResourceProfileSelector.vue | 19 +++++++++++++++----
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
index 4485733e..d5205b98 100644
---
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
+++
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
@@ -130,6 +130,8 @@
</div>
<group-resource-profile-selector
v-model="localExperiment.userConfigurationData.groupResourceProfileId"
+ @invalid="invalidGroupResourceProfileSelector = true"
+ @valid="invalidGroupResourceProfileSelector = false"
>
</group-resource-profile-selector>
<div class="row">
@@ -213,6 +215,7 @@ export default {
localExperiment: this.experiment.clone(),
invalidInputs: [],
invalidComputationalResourceSchedulingEditor: false,
+ invalidGroupResourceProfileSelector: false,
edited: false,
saved: false,
uploadingInputs: [],
@@ -266,7 +269,8 @@ export default {
return (
Object.keys(validation).length === 0 &&
this.invalidInputs.length === 0 &&
- !this.invalidComputationalResourceSchedulingEditor
+ !this.invalidComputationalResourceSchedulingEditor &&
+ !this.invalidGroupResourceProfileSelector
);
},
isSaveDisabled: function () {
diff --git
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/GroupResourceProfileSelector.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/GroupResourceProfileSelector.vue
index 79323fbe..8758078e 100644
---
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/GroupResourceProfileSelector.vue
+++
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/GroupResourceProfileSelector.vue
@@ -35,10 +35,10 @@ export default {
workspacePreferences: null,
};
},
- mounted: function () {
- this.loadWorkspacePreferences().then(() => {
- return this.loadGroupResourceProfiles();
- });
+ async mounted() {
+ await this.loadWorkspacePreferences();
+ await this.loadGroupResourceProfiles();
+ this.validate();
},
computed: {
groupResourceProfileOptions: function () {
@@ -59,6 +59,9 @@ export default {
return [];
}
},
+ valid() {
+ return !!this.groupResourceProfileId;
+ },
},
methods: {
loadGroupResourceProfiles: function () {
@@ -91,6 +94,7 @@ export default {
this.emitValueChanged();
},
emitValueChanged: function () {
+ this.validate();
this.$emit("input", this.groupResourceProfileId);
},
selectedValueInGroupResourceProfileList(groupResourceProfiles) {
@@ -100,6 +104,13 @@ export default {
.indexOf(this.value) >= 0
);
},
+ validate() {
+ if (!this.valid) {
+ this.$emit("invalid");
+ } else {
+ this.$emit("valid");
+ }
+ },
},
watch: {},
};