Skip to content
Snippets Groups Projects
Commit 26668a97 authored by Sandra Westerhoff's avatar Sandra Westerhoff
Browse files

Merge branch 'dev' into 'main'

merge dev into main

See merge request !380
parents 1b96ef61 37aa8cab
Branches
Tags
2 merge requests!380merge dev into main,!379Draft:Update: Refine login interface
Pipeline #1354038 passed
......@@ -37,6 +37,7 @@ const configuration = new MapperConfiguration((cfg) => {
return { [version]: factory.dataset() as unknown as Dataset };
}), // Set outside of the mapper
versions: (opt) => opt.mapFrom((_) => [version]),
actions: (opt) => opt.mapFrom((dto) => dto.actions),
});
cfg.createMap(TreeDto2FolderInformation, {
......
......@@ -42,5 +42,13 @@
"de": "Universität Paderborn",
"en": "Paderborn University"
}
},
{
"entityId": "https://aai.ruhr-uni-bochum.de/idp/shibboleth",
"displayName": {
"de": "Ruhr-Universität Bochum",
"en": "Ruhr University Bochum"
},
"logo": "https://aai.ruhr-uni-bochum.de/idp/images/logo/logo-rub-102.gif"
}
]
......@@ -732,6 +732,7 @@ export default defineComponent({
this.resource.id,
file.path,
file.name,
file.actions,
);
}
},
......
......@@ -996,6 +996,7 @@ export default defineComponent({
this.resource.id,
editableFile.path,
editableFile.name,
editableFile.actions,
);
}
}
......
......@@ -34,6 +34,7 @@ import {
import factory from "rdf-ext";
import fileSaver from "file-saver";
import type {
FileActionsDto,
RdfFormat,
GitlabBranchDto,
GitlabProjectDto,
......@@ -49,6 +50,7 @@ import type {
} from "@coscine/api-client/dist/types/Coscine.Api";
import { wrapListRequest } from "@/util/wrapListRequest";
import i18n from "@/plugins/vue-i18n";
/*
Store variable name is "this.<id>Store"
id: "resource" --> this.resourceStore
......@@ -836,24 +838,35 @@ export const useResourceStore = defineStore({
resourceId: string,
path: string,
name: string,
actions?: FileActionsDto,
) {
const notificationStore = useNotificationStore();
try {
const response = await this.getBlob(projectId, resourceId, path, true);
if (response !== null) {
// Trigger file download
fileSaver.saveAs(
new Blob([response.data], {
type: response.headers["content-type"],
}),
name,
);
// Easiest case: Use the provided download URL
if (actions?.download?.url) {
window.open(actions.download.url, "_blank");
} else {
// Handle other Status Codes
notificationStore.postGeneralApiWarningNotification(
"No Download Response",
const response = await this.getBlob(
projectId,
resourceId,
path,
true,
);
return null;
if (response !== null) {
// Trigger file download
fileSaver.saveAs(
new Blob([response.data], {
type: response.headers["content-type"],
}),
name,
);
} else {
// Handle other Status Codes
notificationStore.postGeneralApiWarningNotification(
"No Download Response",
);
return null;
}
}
} catch (error) {
// Handle other Status Codes
......
......@@ -4,6 +4,7 @@ import {
} from "@coscine/api-client/dist/types/Coscine.Api";
import type {
ApplicationProfileDto,
FileActionsDto,
GitlabBranchDto,
GitlabProjectDto,
Pagination,
......@@ -222,6 +223,7 @@ export interface GeneralInformation {
versions: number[];
latestVersion: number;
currentVersion: number;
actions?: FileActionsDto;
lastModified?: string | null;
readOnly?: boolean;
createdAt?: string;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment