dinukadesilva commented on a change in pull request #52:
URL: 
https://github.com/apache/airavata-django-portal/pull/52#discussion_r535376717



##########
File path: 
django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/storage-edit/UserStorageLink.vue
##########
@@ -0,0 +1,54 @@
+<template>
+  <b-link :href="storageFileViewRouteUrl()" @click="showFilePreview($event)">
+    {{ fileName }}
+    <b-modal :title="fileName" ref="modal" scrollable size="lg">
+      <user-storage-file-edit-viewer
+        :file-name="fileName"
+        :data-product-uri="dataProductUri"
+        :mime-type="mimeType"
+        @file-content-changed="
+          (fileContent) => $emit('file-content-changed', fileContent)
+        "
+      />
+      <template slot="modal-footer">
+        <a :href="storageFileViewRouteUrl()" target="_blank">Open in a new 
window</a>
+      </template>
+    </b-modal>
+  </b-link>
+</template>
+
+<script>
+import UserStorageFileEditViewer from "./UserStorageEditViewer";
+
+export default {
+  name: "user-storage-link",
+  components: {UserStorageFileEditViewer},
+  props: {
+    fileName: {
+      required: true
+    },
+    dataProductUri: {
+      required: true
+    },
+    mimeType: {
+      required: true
+    },
+    allowPreview: {
+      default: true,
+      required: true
+    }
+  },
+  methods: {
+    showFilePreview(event) {
+      if (this.allowPreview) {
+        this.$refs.modal.show();
+        event.preventDefault();
+      }
+    },
+    storageFileViewRouteUrl() {
+      // This endpoint can handle XHR upload or a TUS uploadURL
+      return `/workspace/storage/~?dataProductUri=${this.dataProductUri}`;

Review comment:
       @machristie dataProductUri  is a prop already passed to this component
   
   
https://github.com/apache/airavata-django-portal/pull/52/files/3c049283cb5211f76c4576251ffb59e55afd7a52#diff-589038988d47ba2be64cd940ebaa158b28630aa899bf0104ab66d9c69b09b2a9R30




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to