Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • coscine/frontend/apps/ui
1 result
Select Git revision
Show changes
Commits on Source (6)
{
"name": "ui",
"version": "2.15.0",
"version": "2.16.0",
"scripts": {
"dev": "vite",
"build": "vite build",
......
......@@ -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;
......