forked from IQSS/dataverse-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IQSS#418 from IQSS/feature/417-integrate-file-uplo…
…ad-page-with-use-cases Feature/417 integrate file upload page with use cases (early implementation)
- Loading branch information
Showing
22 changed files
with
1,383 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,64 @@ | ||
{ | ||
"breadcrumbActionItem": "Upload files", | ||
"cancel": "Cancel upload", | ||
"info": "Drag and drop files here.", | ||
"select": "Select files to add" | ||
"info": "Drag and drop files and/or directories here.", | ||
"select": "Select files to add", | ||
"delete": "Delete", | ||
"save": "Save", | ||
"saveUploaded": "Save uploaded files", | ||
"uploadedFileSize": "Uploaded file size", | ||
"restricted": "Restricted", | ||
"tags": { | ||
"documentation": "Documentation", | ||
"data": "Data", | ||
"code": "Code", | ||
"editTagOptions": "Edit tag options", | ||
"customFileTag": "Custom file tag", | ||
"creatingNewTag": "Creating a new tag will add it as a tag option for all files in this dataset.", | ||
"addNewTag": "Add new file tag...", | ||
"availableTagOptions": "Available tag options: ", | ||
"apply": "Apply", | ||
"close": "Close", | ||
"addCustomTag": "Add new custom file tag..." | ||
}, | ||
"restriction": { | ||
"restrictAccess": "Restrict Access", | ||
"restrictionInfoP1": "Restricting limits access to published files. People who want to use the restricted files can request access by default. If you disable request access, you must add information about access to the Terms of Access field.", | ||
"restrictionInfoP2": "Learn about restricting files and dataset access in the User Guide.", | ||
"termsOfAccess": "Terms of Access for Restricted Files", | ||
"enableAccessRequest": "Enable access request", | ||
"saveChanges": "Save Changes", | ||
"cancelChanges": "Cancel Changes" | ||
}, | ||
"fileForm": { | ||
"fileName": "File name", | ||
"filePath": "File path", | ||
"description": "Description", | ||
"tags": "Tags", | ||
"selectTags": "Select tags", | ||
"editTagOptions": "Edit tag options", | ||
"plus": "Add new tag option" | ||
}, | ||
"filesHeader": { | ||
"save": "Save", | ||
"cancel": "Cancel", | ||
"editFiles": "Edit files", | ||
"restrict": "Restrict", | ||
"unrestrict": "Unrestrict", | ||
"filesUploaded_one": "{{count}} file uploaded", | ||
"filesUploaded_other": "{{count}} files uploaded", | ||
"filesSelected_one": "{{count}} file selected", | ||
"filesSelected_other": "{{count}} files selected", | ||
"deleteSelected": "Delete selected", | ||
"addTagsToSelected": "Add tags to selected", | ||
"addTags": "Add tags", | ||
"selectAll": "Select all" | ||
}, | ||
"addTags": { | ||
"title": "Add tags to selected files", | ||
"customTag": "Custom tag", | ||
"selectTags": "Select tags to add", | ||
"saveChanges": "Save Changes", | ||
"cancelChanges": "Cancel Changes" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { FileUploadState } from '../models/FileUploadState' | ||
import { FileRepository } from '../repositories/FileRepository' | ||
|
||
export function addUploadedFiles( | ||
fileRepository: FileRepository, | ||
datasetId: number | string, | ||
files: FileUploadState[], | ||
done: () => void | ||
): void { | ||
fileRepository | ||
.addUploadedFiles(datasetId, files) | ||
.catch((error: Error) => { | ||
throw new Error(error.message) | ||
}) | ||
.finally(done) | ||
} | ||
|
||
export function addUploadedFile( | ||
fileRepository: FileRepository, | ||
datasetId: number | string, | ||
file: File, | ||
storageId: string, | ||
done: () => void | ||
): void { | ||
fileRepository | ||
.addUploadedFile(datasetId, { file: file }, storageId) | ||
.catch((error: Error) => { | ||
throw new Error(error.message) | ||
}) | ||
.finally(done) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.