Skip to content
Snippets Groups Projects

WIP: delete works and download partially (Issue/2586-migrateBlob)

Closed L. Ellenbeck requested to merge Issue/2586-migrateBlob into APIv2
All threads resolved!
Files
4
@@ -161,7 +161,10 @@ import { parseRDFDefinition } from "../../utils/linkedData";
import factory from "rdf-ext";
import type { Dataset, Literal } from "@rdfjs/types";
import type { BilingualLabels } from "@coscine/api-client/dist/types/Coscine.Api.Metadata";
import type { ResourceTypeInformationDto } from "@coscine/api-client/dist/types/Coscine.Api";
import type {
ProjectDto,
ResourceTypeInformationDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
export default defineComponent({
components: {
@@ -215,10 +218,12 @@ export default defineComponent({
applicationProfile(): Dataset | null {
return this.resourceStore.currentFullApplicationProfile;
},
project(): null | ProjectDto {
return this.projectStore.currentProject;
},
resource(): null | VisitedResourceObject {
return this.resourceStore.currentResource;
},
classes(): { [className: string]: BilingualLabels } {
return this.resourceStore.classes;
},
@@ -598,14 +603,19 @@ export default defineComponent({
},
async openFile(file: FileInformation) {
if (this.resource?.id) {
const response = await this.resourceStore.getFile(
if (this.project?.id && this.resource?.id) {
const response = await this.resourceStore.getBlob(
this.project.id,
this.resource.id,
file.absolutePath,
true
file.absolutePath
);
if (response !== null) {
fileSaver.saveAs(response, file.name);
fileSaver.saveAs(
new Blob([response.data], {
type: response.headers["content-type"],
}),
file.name
);
}
window.location.hash = this.currentFolder;
}
Loading