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", "name": "ui",
"version": "2.15.0", "version": "2.16.0",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
......
...@@ -37,6 +37,7 @@ const configuration = new MapperConfiguration((cfg) => { ...@@ -37,6 +37,7 @@ const configuration = new MapperConfiguration((cfg) => {
return { [version]: factory.dataset() as unknown as Dataset }; return { [version]: factory.dataset() as unknown as Dataset };
}), // Set outside of the mapper }), // Set outside of the mapper
versions: (opt) => opt.mapFrom((_) => [version]), versions: (opt) => opt.mapFrom((_) => [version]),
actions: (opt) => opt.mapFrom((dto) => dto.actions),
}); });
cfg.createMap(TreeDto2FolderInformation, { cfg.createMap(TreeDto2FolderInformation, {
......
...@@ -42,5 +42,13 @@ ...@@ -42,5 +42,13 @@
"de": "Universität Paderborn", "de": "Universität Paderborn",
"en": "Paderborn University" "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({ ...@@ -732,6 +732,7 @@ export default defineComponent({
this.resource.id, this.resource.id,
file.path, file.path,
file.name, file.name,
file.actions,
); );
} }
}, },
......
...@@ -996,6 +996,7 @@ export default defineComponent({ ...@@ -996,6 +996,7 @@ export default defineComponent({
this.resource.id, this.resource.id,
editableFile.path, editableFile.path,
editableFile.name, editableFile.name,
editableFile.actions,
); );
} }
} }
......
...@@ -34,6 +34,7 @@ import { ...@@ -34,6 +34,7 @@ import {
import factory from "rdf-ext"; import factory from "rdf-ext";
import fileSaver from "file-saver"; import fileSaver from "file-saver";
import type { import type {
FileActionsDto,
RdfFormat, RdfFormat,
GitlabBranchDto, GitlabBranchDto,
GitlabProjectDto, GitlabProjectDto,
...@@ -49,6 +50,7 @@ import type { ...@@ -49,6 +50,7 @@ import type {
} from "@coscine/api-client/dist/types/Coscine.Api"; } from "@coscine/api-client/dist/types/Coscine.Api";
import { wrapListRequest } from "@/util/wrapListRequest"; import { wrapListRequest } from "@/util/wrapListRequest";
import i18n from "@/plugins/vue-i18n"; import i18n from "@/plugins/vue-i18n";
/* /*
Store variable name is "this.<id>Store" Store variable name is "this.<id>Store"
id: "resource" --> this.resourceStore id: "resource" --> this.resourceStore
...@@ -836,24 +838,35 @@ export const useResourceStore = defineStore({ ...@@ -836,24 +838,35 @@ export const useResourceStore = defineStore({
resourceId: string, resourceId: string,
path: string, path: string,
name: string, name: string,
actions?: FileActionsDto,
) { ) {
const notificationStore = useNotificationStore(); const notificationStore = useNotificationStore();
try { try {
const response = await this.getBlob(projectId, resourceId, path, true); // Easiest case: Use the provided download URL
if (response !== null) { if (actions?.download?.url) {
// Trigger file download window.open(actions.download.url, "_blank");
fileSaver.saveAs(
new Blob([response.data], {
type: response.headers["content-type"],
}),
name,
);
} else { } else {
// Handle other Status Codes const response = await this.getBlob(
notificationStore.postGeneralApiWarningNotification( projectId,
"No Download Response", 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) { } catch (error) {
// Handle other Status Codes // Handle other Status Codes
......
...@@ -4,6 +4,7 @@ import { ...@@ -4,6 +4,7 @@ import {
} from "@coscine/api-client/dist/types/Coscine.Api"; } from "@coscine/api-client/dist/types/Coscine.Api";
import type { import type {
ApplicationProfileDto, ApplicationProfileDto,
FileActionsDto,
GitlabBranchDto, GitlabBranchDto,
GitlabProjectDto, GitlabProjectDto,
Pagination, Pagination,
...@@ -222,6 +223,7 @@ export interface GeneralInformation { ...@@ -222,6 +223,7 @@ export interface GeneralInformation {
versions: number[]; versions: number[];
latestVersion: number; latestVersion: number;
currentVersion: number; currentVersion: number;
actions?: FileActionsDto;
lastModified?: string | null; lastModified?: string | null;
readOnly?: boolean; readOnly?: boolean;
createdAt?: string; createdAt?: string;
......