This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d89fa6  AIRAVATA-2959 bug fix: unflag as dirty after experiment is 
saved
7d89fa6 is described below

commit 7d89fa605cc144648150789fb50ea7821dd0ff4a
Author: Marcus Christie <[email protected]>
AuthorDate: Mon Apr 22 11:15:41 2019 -0400

    AIRAVATA-2959 bug fix: unflag as dirty after experiment is saved
---
 .../js/components/experiment/ExperimentEditor.vue           | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 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 d59f947..6bd9645 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
@@ -173,7 +173,8 @@ export default {
       localExperiment: this.experiment.clone(),
       invalidInputs: [],
       invalidComputationalResourceSchedulingEditor: false,
-      dirty: false
+      edited: false,
+      saved: false
     };
   },
   components: {
@@ -216,6 +217,9 @@ export default {
     },
     isSaveDisabled: function() {
       return !this.valid;
+    },
+    dirty() {
+      return this.edited && !this.saved;
     }
   },
   methods: {
@@ -244,6 +248,9 @@ export default {
         return services.ExperimentService.update({
           lookup: this.localExperiment.experimentId,
           data: this.localExperiment
+        }).then(experiment => {
+          this.saved = true;
+          return experiment;
         });
       } else {
         return services.ExperimentService.create({
@@ -251,6 +258,7 @@ export default {
         }).then(experiment => {
           // Can't save sharing settings for a new experiment until it has been
           // created
+          this.saved = true;
           return this.$refs.shareButton
             .mergeAndSave(experiment.experimentId)
             .then(() => experiment);
@@ -296,7 +304,6 @@ export default {
       }
     },
     inputValueChanged: function() {
-      this.dirty = true;
       this.localExperiment.evaluateInputDependencies();
     }
   },
@@ -306,7 +313,7 @@ export default {
     },
     localExperiment: {
       handler() {
-        this.dirty = true;
+        this.edited = true;
       },
       deep: true
     }

Reply via email to