From 448e7832aef7c97439a88e55482993abf1fb56ee Mon Sep 17 00:00:00 2001
From: mdelez <60604010+mdelez@users.noreply.github.com>
Date: Thu, 1 Sep 2022 09:49:30 +0200
Subject: [PATCH] refactor(upload): use file extensions for valid file types
instead of MIME types (DEV-1203) (#808)
* refactor(upload): use file extensions for valid file types instead of MIME types
* chore(upload): align allowed file types with dsp-api v24.0.1
* chore(upload): alphabetize supported file types
---
.../default-data/default-resource-classes.ts | 4 ++--
.../archive/archive.component.ts | 4 ++--
.../upload/upload.component.html | 10 +++-------
.../upload/upload.component.spec.ts | 7 +++----
.../representation/upload/upload.component.ts | 19 ++++++++-----------
5 files changed, 18 insertions(+), 26 deletions(-)
diff --git a/src/app/project/ontology/default-data/default-resource-classes.ts b/src/app/project/ontology/default-data/default-resource-classes.ts
index eae519ac4b..0991366614 100644
--- a/src/app/project/ontology/default-data/default-resource-classes.ts
+++ b/src/app/project/ontology/default-data/default-resource-classes.ts
@@ -128,7 +128,7 @@ export class DefaultResourceClasses {
},
{
iri: Constants.DocumentRepresentation,
- label: 'Document (PDF, etc.)',
+ label: 'Document',
icons: [
'description',
'article',
@@ -143,7 +143,7 @@ export class DefaultResourceClasses {
},
{
iri: Constants.ArchiveRepresentation,
- label: 'Archive (zip, x-tar, gzip)',
+ label: 'Archive',
icons: [
'archive',
'folder',
diff --git a/src/app/workspace/resource/representation/archive/archive.component.ts b/src/app/workspace/resource/representation/archive/archive.component.ts
index 4c9ad0f0c3..c848924757 100644
--- a/src/app/workspace/resource/representation/archive/archive.component.ts
+++ b/src/app/workspace/resource/representation/archive/archive.component.ts
@@ -82,7 +82,7 @@ export class ArchiveComponent implements OnInit, AfterViewInit {
document.body.removeChild(e);
}
- openReplaceFileDialog(){
+ openReplaceFileDialog() {
const propId = this.parentResource.properties[Constants.HasArchiveFileValue][0].id;
const dialogConfig: MatDialogConfig = {
@@ -91,7 +91,7 @@ export class ArchiveComponent implements OnInit, AfterViewInit {
position: {
top: '112px'
},
- data: { mode: 'replaceFile', title: 'Archive (zip, x-tar, gzip)', subtitle: 'Update the archive file of this resource' , representation: 'archive', id: propId },
+ data: { mode: 'replaceFile', title: 'Archive', subtitle: 'Update the archive file of this resource', representation: 'archive', id: propId },
disableClose: true
};
const dialogRef = this._dialog.open(
diff --git a/src/app/workspace/resource/representation/upload/upload.component.html b/src/app/workspace/resource/representation/upload/upload.component.html
index 7d45c960bd..1667507536 100644
--- a/src/app/workspace/resource/representation/upload/upload.component.html
+++ b/src/app/workspace/resource/representation/upload/upload.component.html
@@ -9,13 +9,9 @@
Upload file
The following file types are supported:
-
- {{ item | split: '/':1 }}
- ,
-
+ {{ item }}
+ ,
- mp3
- csv, txt, xml