machristie commented on a change in pull request #52:
URL:
https://github.com/apache/airavata-django-portal/pull/52#discussion_r536164395
##########
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:
No I'm talking about the link produced here. The link should be the path
to the file, like before
https://github.com/apache/airavata-django-portal/blob/develop/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue#L209.
Well, I guess, I don't quite understand why the dataProductUri needs to be a
query parameter. Looks like UserStorageContainer uses it to get the path, but
it wouldn't need that if the path were used like before. Can you explain why
dataProductUri is needed as a query parameter?
----------------------------------------------------------------
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]