Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP-2990/AMP-3006: #489

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/components/dashboard/DashboardTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@
<td v-if="checkAvailability('itemName')">{{ rec.itemName }}</td>
<td v-if="checkAvailability('primaryfileName') && canAccessLink(rec, true)">
<a
v-bind:href="
workflowResultService.getSourceUrl(rec.primaryfileId)
"
href="#"
@click="workflowResultService.getSourceUrl(rec.primaryfileId)"
target="_blank"
class="complete-output"
>{{ rec.primaryfileName }}</a
Expand All @@ -155,7 +154,8 @@
outputReady(rec)"
>
<a
v-bind:href="workflowResultService.getOutputUrl(rec.id)"
href="#"
@click="workflowResultService.getOutputUrl(rec.id)"
target="_blank"
class="complete-output"
>{{ rec.outputName }}</a
Expand All @@ -173,7 +173,8 @@
outputReady(rec)"
>
<a
v-bind:href="workflowResultService.getOutputUrl(rec.id)"
href="#"
@click="workflowResultService.getOutputUrl(rec.id)"
target="_blank"
class="complete-output"
>{{ rec.outputLabel }}</a
Expand Down Expand Up @@ -517,8 +518,8 @@ export default {
canAccessLink(result, forMedia) {
// get units for media or output
let units = forMedia ? this.acUnitsMedia : this.acUnitsOutput;
console.log("forMedia: " + forMedia);
console.log("units: " + units);
// console.log("forMedia: " + forMedia);
// console.log("units: " + units);
return this.acIsAdmin || units && units.includes(result.unitId);
},
handleDeleteRow() {
Expand Down
3 changes: 2 additions & 1 deletion src/components/entity/EntityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1354,9 +1354,10 @@ export default {
self.showEdit = false;
}
} else if (self.baseUrl === "file") {
let mediaSourceUrl = self.workflowResultService.getSourceUrl(
let mediaSourceUrl = await self.workflowResultService.getSourceLink(
self.selectedFile.id
);
console.log("mediaSourceUrl = " + mediaSourceUrl);
let mediaSourceType = await self.primaryFileService.getPrimaryFile(
self.selectedFile.id
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/entity/OutputFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
disabled
/> -->
<a
:href="workflowResultService.getOutputUrl(output.id)"
href="#"
@click="workflowResultService.getOutputUrl(output.id)"
class="complete-output"
target="_blank"
v-if="
Expand Down
7 changes: 2 additions & 5 deletions src/components/evaluation/TestResultsVisualiz.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@
>
(<a
class="scores-files"
v-bind:href="
workflowResultService.getOutputUrl(
testResult.workflowResult.id
)
"
href="#"
@click="workflowResultService.getOutputUrl(testResult.workflowResult.id)"
target="_blank"
>{{
testResult.workflowResult.workflowStep
Expand Down
27 changes: 21 additions & 6 deletions src/service/workflow-result-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,28 @@ export default class WorkflowResultService extends BaseService {
return data;
}

getSourceUrl(primaryfileId) {
const url = `${this.API_URL}/primaryfiles/${primaryfileId}/media`;
return url;
async getSourceLink(primaryfileId) {
const url = `/primaryfiles/${primaryfileId}/media`;
var symlink = await super.get_auth(url).then((result) => {
return result.headers['location'];
});
return symlink;
}

async getSourceUrl(primaryfileId) {
const url = `/primaryfiles/${primaryfileId}/media`;
var content = await super.get_auth(url).then((result) => {
return result.data;
});
return content;
}
getOutputUrl(id) {
const url = `${this.API_URL}/workflow-results/${id}/output`;
return url;

async getOutputUrl(id) {
const url = `/workflow-results/${id}/output`;
var content = await super.get_auth(url).then((result) => {
return result.data;
});
return content;
}

async deleteWorkflowResult(id) {
Expand Down
Loading