You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2023/02/22 20:22:51 UTC

[airavata-django-portal] branch develop updated (4cb78711 -> f1440349)

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

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


    from 4cb78711 AIRAVATA-3682 Bug fix: check if data product exists in user storage before trying to determine if writable
     new 742b739e AIRAVATA-3688 Null output file input when file is no longer available
     new f1440349 AIRAVATA-3688 Fixing onbeforeunload issue with Chrome

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../experiment/input-editors/FileInputEditor.vue   | 27 ++++++++++++++--------
 .../common/js/components/UnsavedChangesGuard.vue   | 10 +++++++-
 2 files changed, 27 insertions(+), 10 deletions(-)


[airavata-django-portal] 01/02: AIRAVATA-3688 Null output file input when file is no longer available

Posted by ma...@apache.org.
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

commit 742b739e13380f80224a130ded75f8d0dee1bea8
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Feb 22 15:18:57 2023 -0500

    AIRAVATA-3688 Null output file input when file is no longer available
---
 .../experiment/input-editors/FileInputEditor.vue   | 27 ++++++++++++++--------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue
index 0781e90f..7986024b 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue
@@ -36,9 +36,9 @@
 </template>
 
 <script>
-import {models, services, utils} from "django-airavata-api";
-import {InputEditorMixin} from "django-airavata-workspace-plugin-api";
-import {components} from "django-airavata-common-ui";
+import { models, services, utils } from "django-airavata-api";
+import { InputEditorMixin } from "django-airavata-workspace-plugin-api";
+import { components } from "django-airavata-common-ui";
 import InputFileSelector from "./InputFileSelector";
 import UserStorageLink from "../../storage/storage-edit/UserStorageLink";
 
@@ -48,7 +48,7 @@ export default {
   components: {
     UserStorageLink,
     "delete-link": components.DeleteLink,
-    InputFileSelector
+    InputFileSelector,
   },
   computed: {
     isDataProductURI() {
@@ -90,8 +90,17 @@ export default {
   },
   methods: {
     loadDataProduct(dataProductURI) {
-      services.DataProductService.retrieve({lookup: dataProductURI})
-        .then((dataProduct) => (this.dataProduct = dataProduct))
+      services.DataProductService.retrieve({ lookup: dataProductURI })
+        .then((dataProduct) => {
+          if (dataProduct.downloadURL === null) {
+            // Null out this field when the file is no longer available. Force
+            // user to select or upload another file.
+            this.data = null;
+            this.valueChanged();
+          } else {
+            this.dataProduct = dataProduct;
+          }
+        })
         .catch(() => {
           // If we're unable to load data product, reset data to null
           this.data = null;
@@ -101,7 +110,7 @@ export default {
     deleteDataProduct() {
       utils.FetchUtils.delete(
         "/api/delete-file?data-product-uri=" + encodeURIComponent(this.value),
-        {ignoreErrors: true}
+        { ignoreErrors: true }
       )
         .then(() => {
           this.data = null;
@@ -146,8 +155,8 @@ export default {
       if (this.isDataProductURI && value !== oldValue) {
         this.loadDataProduct(value);
       }
-    }
-  }
+    },
+  },
 };
 </script>
 


[airavata-django-portal] 02/02: AIRAVATA-3688 Fixing onbeforeunload issue with Chrome

Posted by ma...@apache.org.
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

commit f144034967312e5f060cfdd55b5fdbfd9bcd637f
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Feb 22 15:22:43 2023 -0500

    AIRAVATA-3688 Fixing onbeforeunload issue with Chrome
---
 .../static/common/js/components/UnsavedChangesGuard.vue        | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/django_airavata/static/common/js/components/UnsavedChangesGuard.vue b/django_airavata/static/common/js/components/UnsavedChangesGuard.vue
index 0df81746..9bd38077 100644
--- a/django_airavata/static/common/js/components/UnsavedChangesGuard.vue
+++ b/django_airavata/static/common/js/components/UnsavedChangesGuard.vue
@@ -21,7 +21,15 @@ export default {
     onBeforeUnload(event) {
       if (this.dirty) {
         event.preventDefault();
-        return "You have unsaved changes. Are you sure that you want to leave this page?";
+        // Have to return a message for some browsers in order to trigger popup
+        // asking user if they want to leave the page. I don't think any browser
+        // displays the message that we return here, but a returned message is
+        // still required.
+        const msg =
+          "You have unsaved changes. Are you sure that you want to leave this page?";
+        // For Chrome, set event.returnValue
+        event.returnValue = msg;
+        return msg;
       }
     },
   },