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 2019/06/10 15:32:22 UTC

[airavata-django-portal] branch master updated (935b2ba -> bb8a224)

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

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


    from 935b2ba  AIRAVATA-3063 Log and display error when username checking fails
     new f11790f  AIRAVATA-3057 Initial file selector in FileInputEditor
     new 7b386aa  AIRAVATA-3057 Canceling file selection
     new 1450a0d  AIRAVATA-3057 For URI_COLLECTION, only allow selecting file once
     new 53ca45c  AIRAVATA-3057 Keep track of most recent file selection path
     new a945fb5  AIRAVATA-3057 Retain null file entry in MultiFileInputEditor
     new 70a5669  AIRAVATA-3057 Improving file selection layout
     new 40b65ff  AIRAVATA-3057 Styling file selection cancel
     new bb8a224  Fix styling of background color

The 8 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:
 .../components/users/UserGroupMembershipEditor.vue |  4 +-
 .../experiment/input-editors/FileInputEditor.vue   | 66 +++++++++++++++++----
 .../input-editors/InputEditorContainer.vue         |  2 +-
 .../input-editors/InputEditorFormGroup.vue         |  5 +-
 .../input-editors/MultiFileInputEditor.vue         | 24 ++++++--
 .../experiment/input-editors/StringInputEditor.vue |  1 -
 .../input-editors/TextareaInputEditor.vue          |  1 -
 .../storage/UserStorageFileSelectionContainer.vue  | 67 ++++++++++++++++++++++
 .../storage/UserStoragePathBreadcrumb.vue          | 46 ++++++++-------
 .../components/storage/UserStoragePathViewer.vue   | 52 +++++++++++++++--
 .../js/containers/CreateExperimentContainer.vue    |  2 +-
 .../js/containers/EditExperimentContainer.vue      |  2 +-
 .../js/containers/EditProjectContainer.vue         |  2 +-
 .../js/containers/UserStorageContainer.vue         |  4 ++
 14 files changed, 227 insertions(+), 51 deletions(-)
 create mode 100644 django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue


[airavata-django-portal] 08/08: Fix styling of background color

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

commit bb8a224b298d61aae4fc46206d0dde356656a8e6
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 11:30:07 2019 -0400

    Fix styling of background color
---
 .../js/containers/CreateExperimentContainer.vue                         | 2 +-
 .../django_airavata_workspace/js/containers/EditExperimentContainer.vue | 2 +-
 .../django_airavata_workspace/js/containers/EditProjectContainer.vue    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue
index d820834..6c93a6e 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue
@@ -79,7 +79,7 @@ export default {
 </script>
 <style>
 /* style the containing div, in base.html template */
-.main-content {
+.main-content-wrapper {
   background-color: #ffffff;
 }
 </style>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditExperimentContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditExperimentContainer.vue
index 02afbf2..d5eae09 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditExperimentContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditExperimentContainer.vue
@@ -83,7 +83,7 @@ export default {
 </script>
 <style>
 /* style the containing div, in base.html template */
-.main-content {
+.main-content-wrapper {
   background-color: #ffffff;
 }
 </style>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditProjectContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditProjectContainer.vue
index 8e0dd66..303664d 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditProjectContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/EditProjectContainer.vue
@@ -55,7 +55,7 @@ export default {
 </script>
 <style>
 /* style the containing div, in base.html template */
-.main-content {
+.main-content-wrapper {
   background-color: #ffffff;
 }
 </style>


[airavata-django-portal] 03/08: AIRAVATA-3057 For URI_COLLECTION, only allow selecting file once

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

commit 1450a0db6f58dd5d1b5724d3f576dbf83fbc4bf4
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 10:16:42 2019 -0400

    AIRAVATA-3057 For URI_COLLECTION, only allow selecting file once
---
 .../experiment/input-editors/FileInputEditor.vue   | 24 ++++++++++++++++++++--
 .../input-editors/MultiFileInputEditor.vue         |  1 +
 .../storage/UserStorageFileSelectionContainer.vue  | 10 ++++++++-
 .../components/storage/UserStoragePathViewer.vue   | 12 ++++++++++-
 4 files changed, 43 insertions(+), 4 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 7c9dc0f..6fa28ba 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
@@ -29,9 +29,16 @@
       </b-link>
     </div>
     <div v-if="isSelectingFile">
-      <user-storage-file-selection-container @file-selected="fileSelected" @cancel="cancelFileSelection"/>
+      <user-storage-file-selection-container
+        @file-selected="fileSelected"
+        @cancel="cancelFileSelection"
+        :selected-data-product-uris="selectedDataProductURIs"
+      />
     </div>
-    <div class="d-flex" v-if="!isSelectingFile && !isDataProductURI">
+    <div
+      class="d-flex"
+      v-if="!isSelectingFile && !isDataProductURI"
+    >
       <!-- TODO: fix layout -->
       <b-button @click="isSelectingFile=true">Select user file</b-button>
       <span class="text-muted">OR</span>
@@ -65,6 +72,19 @@ export default {
     isDataProductURI() {
       // Just assume that if the value is a string then it's a data product URL
       return this.value && typeof this.value === "string";
+    },
+    // When used in the MultiFileInputEditor, don't allow selecting the same
+    // file more than once. This computed property creates an array of already
+    // selected files.
+    selectedDataProductURIs() {
+      if (
+        this.experimentInput.type === models.DataType.URI_COLLECTION &&
+        this.experimentInput.value
+      ) {
+        return this.experimentInput.value.split(",");
+      } else {
+        return [];
+      }
     }
   },
   data() {
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue
index 75b8c5d..0d02ec4 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue
@@ -58,6 +58,7 @@ export default {
         .filter(e => e.value) // exclude null entries
         .map(e => e.value)
         .join(",");
+      this.fileEntries = this.createFileEntries(this.data);
       this.valueChanged();
     },
     removeFile(fileEntry) {
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
index 3f5696e..7dbd070 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
@@ -7,7 +7,9 @@
       :include-delete-action="false"
       :include-select-file-action="true"
       :download-in-new-window="true"
-    />
+      :selected-data-product-uris="selectedDataProductUris"
+    >
+    </user-storage-path-viewer>
     <!-- TODO: push this right? -->
     <b-link class="card-link" @click="$emit('cancel')">Cancel</b-link>
   </b-card>
@@ -19,6 +21,12 @@ import UserStoragePathViewer from "./UserStoragePathViewer";
 
 export default {
   name: "user-storage-file-selection-container",
+  props: {
+    selectedDataProductUris: {
+      type: Array,
+      default: () => []
+    }
+  },
   data() {
     return {
       userStoragePath: null
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
index 61cd61b..e8e86ff 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
@@ -37,6 +37,7 @@
         <b-button
           v-if="includeSelectFileAction && data.item.type === 'file'"
           @click="$emit('file-selected', data.item)"
+          :disabled="isAlreadySelected(data.item)"
           variant="primary"
         >
           Select
@@ -72,6 +73,10 @@ export default {
     downloadInNewWindow: {
       type: Boolean,
       default: false
+    },
+    selectedDataProductUris: {
+      type: Array,
+      default: () => []
     }
   },
   components: {
@@ -135,7 +140,7 @@ export default {
       }
     },
     downloadTarget() {
-      return this.downloadInNewWindow ? '_blank' : '_self';
+      return this.downloadInNewWindow ? "_blank" : "_self";
     }
   },
   methods: {
@@ -159,6 +164,11 @@ export default {
     },
     directorySelected(item) {
       this.$emit("directory-selected", item.path);
+    },
+    isAlreadySelected(item) {
+      return this.selectedDataProductUris.find(
+        uri => item.type === "file" && uri === item.dataProductURI
+      );
     }
   }
 };


[airavata-django-portal] 05/08: AIRAVATA-3057 Retain null file entry in MultiFileInputEditor

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

commit a945fb5e49f3c8efa01894c66a653387bbe7ec1f
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 10:56:24 2019 -0400

    AIRAVATA-3057 Retain null file entry in MultiFileInputEditor
---
 .../input-editors/MultiFileInputEditor.vue         | 25 ++++++++++++++++------
 .../components/storage/UserStoragePathViewer.vue   |  6 ++++--
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue
index 0d02ec4..30204e3 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/MultiFileInputEditor.vue
@@ -49,7 +49,7 @@ export default {
       });
     },
     updatedFile(newValue, fileEntry) {
-      if (!newValue) {
+      if (!newValue && fileEntry.value) {
         this.removeFile(fileEntry);
       } else {
         fileEntry.value = newValue;
@@ -58,7 +58,6 @@ export default {
         .filter(e => e.value) // exclude null entries
         .map(e => e.value)
         .join(",");
-      this.fileEntries = this.createFileEntries(this.data);
       this.valueChanged();
     },
     removeFile(fileEntry) {
@@ -82,13 +81,25 @@ export default {
         };
       });
       // Add a null entry to accept an additional upload
-      fileEntries.push({
-        id: this.id + "-" + this.newFileCount++,
-        value: null,
-        uploading: false
-      });
+      fileEntries.push(this.getNullFileEntry());
       return fileEntries;
     },
+    getNullFileEntry() {
+      // Reuse the old null entry if it exists, otherwise create a new one
+      if (
+        this.fileEntries &&
+        this.fileEntries.length > 0 &&
+        this.fileEntries[this.fileEntries.length - 1].value === null
+      ) {
+        return this.fileEntries[this.fileEntries.length - 1];
+      } else {
+        return {
+          id: this.id + "-" + this.newFileCount++,
+          value: null,
+          uploading: false
+        };
+      }
+    },
     uploadStart(fileEntry) {
       fileEntry.uploading = true;
       this.$emit("uploadstart");
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
index e8e86ff..3351fd1 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
@@ -166,8 +166,10 @@ export default {
       this.$emit("directory-selected", item.path);
     },
     isAlreadySelected(item) {
-      return this.selectedDataProductUris.find(
-        uri => item.type === "file" && uri === item.dataProductURI
+      return (
+        this.selectedDataProductUris.find(
+          uri => item.type === "file" && uri === item.dataProductURI
+        ) !== undefined
       );
     }
   }


[airavata-django-portal] 02/08: AIRAVATA-3057 Canceling file selection

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

commit 7b386aa933b390e25d0dcf6c4fc605dd99dc62a6
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 09:31:49 2019 -0400

    AIRAVATA-3057 Canceling file selection
---
 .../js/components/experiment/input-editors/FileInputEditor.vue     | 7 +++++--
 .../js/components/storage/UserStorageFileSelectionContainer.vue    | 2 +-
 2 files changed, 6 insertions(+), 3 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 01b1d7e..7c9dc0f 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
@@ -29,8 +29,7 @@
       </b-link>
     </div>
     <div v-if="isSelectingFile">
-      <!-- TODO: handle @cancel -->
-      <user-storage-file-selection-container @file-selected="fileSelected"/>
+      <user-storage-file-selection-container @file-selected="fileSelected" @cancel="cancelFileSelection"/>
     </div>
     <div class="d-flex" v-if="!isSelectingFile && !isDataProductURI">
       <!-- TODO: fix layout -->
@@ -131,6 +130,10 @@ export default {
       this.isSelectingFile = false;
       this.loadDataProduct(dataProductURI);
       this.valueChanged();
+    },
+    cancelFileSelection() {
+      this.isSelectingFile = false;
+      this.unselect();
     }
   }
 };
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
index 51588aa..3f5696e 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
@@ -9,7 +9,7 @@
       :download-in-new-window="true"
     />
     <!-- TODO: push this right? -->
-    <b-link class="card-link">Cancel</b-link>
+    <b-link class="card-link" @click="$emit('cancel')">Cancel</b-link>
   </b-card>
 </template>
 


[airavata-django-portal] 06/08: AIRAVATA-3057 Improving file selection layout

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

commit 70a566918dc4a253aaa6814a26437a91ad197172
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 11:21:19 2019 -0400

    AIRAVATA-3057 Improving file selection layout
---
 .../experiment/input-editors/FileInputEditor.vue         | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 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 6fa28ba..2c65b9f 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,18 +36,18 @@
       />
     </div>
     <div
-      class="d-flex"
+      class="d-flex align-items-baseline"
       v-if="!isSelectingFile && !isDataProductURI"
     >
-      <!-- TODO: fix layout -->
-      <b-button @click="isSelectingFile=true">Select user file</b-button>
-      <span class="text-muted">OR</span>
+      <b-button @click="isSelectingFile=true" class="input-file-option">Select file from storage</b-button>
+      <span class="text-muted mx-3">OR</span>
       <b-form-file
         :id="id"
         v-model="file"
         v-if="!isDataProductURI"
-        :state="componentValidState"
+        placeholder="Upload file"
         @input="fileChanged"
+        class="input-file-option"
       />
     </div>
   </div>
@@ -158,3 +158,9 @@ export default {
   }
 };
 </script>
+
+<style scoped>
+.input-file-option {
+  flex: 1 1 50%;
+}
+</style>


[airavata-django-portal] 07/08: AIRAVATA-3057 Styling file selection cancel

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

commit 40b65ff4401af6a100894868da3fe0a0e2518732
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 11:28:38 2019 -0400

    AIRAVATA-3057 Styling file selection cancel
---
 .../storage/UserStorageFileSelectionContainer.vue           | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
index 9a4e581..154c14d 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
@@ -10,11 +10,14 @@
       :selected-data-product-uris="selectedDataProductUris"
     >
     </user-storage-path-viewer>
-    <!-- TODO: push this right? -->
-    <b-link
-      class="card-link"
-      @click="$emit('cancel')"
-    >Cancel</b-link>
+    <template slot="footer">
+      <div class="d-flex justify-content-end">
+        <b-link
+          class="text-secondary"
+          @click="$emit('cancel')"
+        >Cancel</b-link>
+      </div>
+    </template>
   </b-card>
 </template>
 


[airavata-django-portal] 01/08: AIRAVATA-3057 Initial file selector in FileInputEditor

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

commit f11790facea481be8b86a4e3eef22206a79327bf
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Sun Jun 9 17:43:59 2019 -0400

    AIRAVATA-3057 Initial file selector in FileInputEditor
---
 .../components/users/UserGroupMembershipEditor.vue |  4 +-
 .../experiment/input-editors/FileInputEditor.vue   | 37 ++++++++++++-----
 .../input-editors/InputEditorContainer.vue         |  2 +-
 .../input-editors/InputEditorFormGroup.vue         |  5 ++-
 .../experiment/input-editors/StringInputEditor.vue |  1 -
 .../input-editors/TextareaInputEditor.vue          |  1 -
 .../storage/UserStorageFileSelectionContainer.vue  | 48 ++++++++++++++++++++++
 .../storage/UserStoragePathBreadcrumb.vue          | 46 ++++++++++++---------
 .../components/storage/UserStoragePathViewer.vue   | 40 +++++++++++++++---
 .../js/containers/UserStorageContainer.vue         |  4 ++
 10 files changed, 146 insertions(+), 42 deletions(-)

diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/users/UserGroupMembershipEditor.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/users/UserGroupMembershipEditor.vue
index 37bee7c..a8572cf 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/users/UserGroupMembershipEditor.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/users/UserGroupMembershipEditor.vue
@@ -116,9 +116,7 @@ export default {
       return {
         text: group.name,
         value: group.id,
-        disabled:
-          !group.userHasWriteAccess ||
-          group.ownerId === this.airavataInternalUserId
+        disabled: !group.userHasWriteAccess || group.ownerId === this.airavataInternalUserId
       };
     }
   }
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 4c1eb24..01b1d7e 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
@@ -28,14 +28,22 @@
         ></i>
       </b-link>
     </div>
-    <b-form-file
-      :id="id"
-      v-model="file"
-      v-if="!isDataProductURI"
-      :placeholder="experimentInput.userFriendlyDescription"
-      :state="componentValidState"
-      @input="fileChanged"
-    />
+    <div v-if="isSelectingFile">
+      <!-- TODO: handle @cancel -->
+      <user-storage-file-selection-container @file-selected="fileSelected"/>
+    </div>
+    <div class="d-flex" v-if="!isSelectingFile && !isDataProductURI">
+      <!-- TODO: fix layout -->
+      <b-button @click="isSelectingFile=true">Select user file</b-button>
+      <span class="text-muted">OR</span>
+      <b-form-file
+        :id="id"
+        v-model="file"
+        v-if="!isDataProductURI"
+        :state="componentValidState"
+        @input="fileChanged"
+      />
+    </div>
   </div>
 </template>
 
@@ -44,13 +52,15 @@ import { models, services, utils } from "django-airavata-api";
 import { InputEditorMixin } from "django-airavata-workspace-plugin-api";
 import DataProductViewer from "../DataProductViewer.vue";
 import { components } from "django-airavata-common-ui";
+import UserStorageFileSelectionContainer from "../../storage/UserStorageFileSelectionContainer";
 
 export default {
   name: "file-input-editor",
   mixins: [InputEditorMixin],
   components: {
     DataProductViewer,
-    "delete-link": components.DeleteLink
+    "delete-link": components.DeleteLink,
+    UserStorageFileSelectionContainer
   },
   computed: {
     isDataProductURI() {
@@ -61,7 +71,8 @@ export default {
   data() {
     return {
       dataProduct: null,
-      file: null
+      file: null,
+      isSelectingFile: false
     };
   },
   created() {
@@ -114,6 +125,12 @@ export default {
       this.file = null;
       this.data = null;
       this.valueChanged();
+    },
+    fileSelected(dataProductURI) {
+      this.data = dataProductURI;
+      this.isSelectingFile = false;
+      this.loadDataProduct(dataProductURI);
+      this.valueChanged();
     }
   }
 };
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue
index 2de4ccb..44b4489 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue
@@ -1,6 +1,6 @@
 <template>
     <input-editor-form-group :label="experimentInput.name" :label-for="inputEditorComponentId"
-        :state="validationState" :feedback-messages="validationFeedback">
+        :state="validationState" :feedback-messages="validationFeedback" :description="experimentInput.userFriendlyDescription">
         <component :is="inputEditorComponentName"
             :id="inputEditorComponentId"
             :experiment-input="experimentInput"
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorFormGroup.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorFormGroup.vue
index 592214e..e1d40fc 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorFormGroup.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorFormGroup.vue
@@ -1,5 +1,5 @@
 <template>
-    <b-form-group :label="label" :label-for="labelFor" :state="state">
+    <b-form-group :label="label" :label-for="labelFor" :state="state" :description="description">
         <slot></slot>
         <template slot="invalid-feedback">
             <ul v-if="feedbackMessages && feedbackMessages.length > 1">
@@ -31,6 +31,9 @@ export default {
         feedbackMessages: {
             type: Array,
         },
+        description: {
+          type: String,
+        }
     },
 }
 </script>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/StringInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/StringInputEditor.vue
index 04ab99d..538f070 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/StringInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/StringInputEditor.vue
@@ -1,6 +1,5 @@
 <template>
     <b-form-input :id="id" type="text" v-model="data"
-        :placeholder="experimentInput.userFriendlyDescription"
         :state="componentValidState"
         @input="valueChanged"/>
 </template>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/TextareaInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/TextareaInputEditor.vue
index 2361fbc..35fd33e 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/TextareaInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/TextareaInputEditor.vue
@@ -1,7 +1,6 @@
 <template>
     <b-form-textarea :id="id" v-model="data"
         :rows="rows"
-        :placeholder="experimentInput.userFriendlyDescription"
         :state="componentValidState"
         @input="valueChanged"/>
 </template>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
new file mode 100644
index 0000000..51588aa
--- /dev/null
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
@@ -0,0 +1,48 @@
+<template>
+  <b-card header="Select a file">
+    <user-storage-path-viewer
+      :user-storage-path="userStoragePath"
+      @directory-selected="directorySelected"
+      @file-selected="fileSelected"
+      :include-delete-action="false"
+      :include-select-file-action="true"
+      :download-in-new-window="true"
+    />
+    <!-- TODO: push this right? -->
+    <b-link class="card-link">Cancel</b-link>
+  </b-card>
+</template>
+
+<script>
+import { services } from "django-airavata-api";
+import UserStoragePathViewer from "./UserStoragePathViewer";
+
+export default {
+  name: "user-storage-file-selection-container",
+  data() {
+    return {
+      userStoragePath: null
+    };
+  },
+  components: {
+    UserStoragePathViewer
+  },
+  created() {
+    return this.loadUserStoragePath("~");
+  },
+  methods: {
+    loadUserStoragePath(path) {
+      return services.UserStoragePathService.get({
+        path
+      }).then(result => (this.userStoragePath = result));
+    },
+    directorySelected(path) {
+      return this.loadUserStoragePath("~/" + path);
+    },
+    fileSelected(file) {
+      this.$emit('file-selected', file.dataProductURI);
+    }
+  }
+};
+</script>
+
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathBreadcrumb.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathBreadcrumb.vue
index 0860a83..27d4ba3 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathBreadcrumb.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathBreadcrumb.vue
@@ -1,5 +1,13 @@
 <template>
-  <b-breadcrumb :items="items"></b-breadcrumb>
+  <b-breadcrumb>
+    <b-breadcrumb-item
+      v-for="item in items"
+      :key="item.path"
+      :text="item.text"
+      :active="item.active"
+      @click="directorySelected(item.path)"
+    />
+  </b-breadcrumb>
 </template>
 
 <script>
@@ -13,25 +21,23 @@ export default {
   },
   computed: {
     items() {
-      const homeItem = [
-        {
-          text: "Home",
-          to: { path: "/~/" }
-        }
-      ];
-      if (this.parts) {
-        const subparts = [];
-        const partsItems = this.parts.map(part => {
-          subparts.push(part);
-          return {
-            text: part,
-            to: { path: "/~/" + subparts.join("/") + "/" }
-          };
-        });
-        return homeItem.concat(partsItems);
-      } else {
-        return homeItem;
-      }
+      const subparts = [];
+      const partsItems = this.parts.map((part, index) => {
+        subparts.push(part);
+        return {
+          text: part,
+          path: subparts.join("/"),
+          active: index === this.parts.length - 1
+        };
+      });
+      return [
+        { text: "Home", path: "", active: this.parts.length === 0 }
+      ].concat(partsItems);
+    }
+  },
+  methods: {
+    directorySelected(path) {
+      this.$emit("directory-selected", path);
     }
   }
 };
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
index 2e9a418..61cd61b 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
@@ -3,6 +3,7 @@
     <user-storage-path-breadcrumb
       v-if="userStoragePath"
       :parts="userStoragePath.parts"
+      @directory-selected="$emit('directory-selected', $event)"
     />
     <b-table
       :fields="fields"
@@ -13,26 +14,37 @@
         slot="name"
         slot-scope="data"
       >
-        <router-link
+        <b-link
           v-if="data.item.type === 'dir'"
-          :to="'/~/' + data.item.path"
-        > <i class="fa fa-folder-open"></i> {{ data.item.name }}</router-link>
+          @click="directorySelected(data.item)"
+        > <i class="fa fa-folder-open"></i> {{ data.item.name }}</b-link>
         <b-link
           v-else
           :href="data.item.downloadURL"
+          :target="downloadTarget"
         > <i class="fa fa-download"></i> {{ data.item.name }}</b-link>
       </template>
       <template
         slot="createdTimestamp"
         slot-scope="data"
       >
-        <human-date :date="data.item.createdTime"/>
+        <human-date :date="data.item.createdTime" />
       </template>
       <template
         slot="actions"
         slot-scope="data"
       >
-        <delete-button @delete="deleteItem(data.item)">
+        <b-button
+          v-if="includeSelectFileAction && data.item.type === 'file'"
+          @click="$emit('file-selected', data.item)"
+          variant="primary"
+        >
+          Select
+        </b-button>
+        <delete-button
+          v-if="includeDeleteAction"
+          @delete="deleteItem(data.item)"
+        >
           Are you sure you want to delete {{ data.item.name }}?
         </delete-button>
       </template>
@@ -48,6 +60,18 @@ export default {
   props: {
     userStoragePath: {
       required: true
+    },
+    includeDeleteAction: {
+      type: Boolean,
+      default: true
+    },
+    includeSelectFileAction: {
+      type: Boolean,
+      default: false
+    },
+    downloadInNewWindow: {
+      type: Boolean,
+      default: false
     }
   },
   components: {
@@ -109,6 +133,9 @@ export default {
       } else {
         return [];
       }
+    },
+    downloadTarget() {
+      return this.downloadInNewWindow ? '_blank' : '_self';
     }
   },
   methods: {
@@ -129,6 +156,9 @@ export default {
       } else if (item.type === "file") {
         this.$emit("delete-file", item.dataProductURI);
       }
+    },
+    directorySelected(item) {
+      this.$emit("directory-selected", item.path);
     }
   }
 };
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/UserStorageContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/UserStorageContainer.vue
index 03e5f03..7e39fd2 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/UserStorageContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/UserStorageContainer.vue
@@ -42,6 +42,7 @@
           <router-view
             :user-storage-path="userStoragePath"
             @delete-dir="deleteDir"
+            @directory-selected="directorySelected"
             @delete-file="deleteFile"
           ></router-view>
         </b-card>
@@ -144,6 +145,9 @@ export default {
       ).then(() => {
         this.loadUserStoragePath(this.storagePath);
       });
+    },
+    directorySelected(path) {
+      this.$router.push("/~/" + path);
     }
   },
   created() {


[airavata-django-portal] 04/08: AIRAVATA-3057 Keep track of most recent file selection path

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

commit 53ca45c4f71782c2572ee40139e1a2c3a20c6933
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 10 10:35:42 2019 -0400

    AIRAVATA-3057 Keep track of most recent file selection path
---
 .../storage/UserStorageFileSelectionContainer.vue        | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
index 7dbd070..9a4e581 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStorageFileSelectionContainer.vue
@@ -11,7 +11,10 @@
     >
     </user-storage-path-viewer>
     <!-- TODO: push this right? -->
-    <b-link class="card-link" @click="$emit('cancel')">Cancel</b-link>
+    <b-link
+      class="card-link"
+      @click="$emit('cancel')"
+    >Cancel</b-link>
   </b-card>
 </template>
 
@@ -19,6 +22,10 @@
 import { services } from "django-airavata-api";
 import UserStoragePathViewer from "./UserStoragePathViewer";
 
+// Keep track of most recent path so that when user needs to select an
+// additional file they are taken back to the last path
+let mostRecentPath = "~";
+
 export default {
   name: "user-storage-file-selection-container",
   props: {
@@ -36,7 +43,7 @@ export default {
     UserStoragePathViewer
   },
   created() {
-    return this.loadUserStoragePath("~");
+    return this.loadUserStoragePath(mostRecentPath);
   },
   methods: {
     loadUserStoragePath(path) {
@@ -45,10 +52,11 @@ export default {
       }).then(result => (this.userStoragePath = result));
     },
     directorySelected(path) {
-      return this.loadUserStoragePath("~/" + path);
+      mostRecentPath = "~/" + path;
+      return this.loadUserStoragePath(mostRecentPath);
     },
     fileSelected(file) {
-      this.$emit('file-selected', file.dataProductURI);
+      this.$emit("file-selected", file.dataProductURI);
     }
   }
 };