-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 213-implement-use-case-for-edit-files-met…
…adata-on-file-page
- Loading branch information
Showing
25 changed files
with
915 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Copy labels from issue to pull request | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
copy-labels: | ||
runs-on: ubuntu-latest | ||
name: Copy labels from linked issues | ||
steps: | ||
- name: copy-labels | ||
uses: michalvankodev/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
labels-to-exclude: | | ||
Size: 3 | ||
Size: 10 | ||
Size: 20 | ||
Size: 33 | ||
Size: 80 | ||
Original size: 3 | ||
Original size: 10 | ||
Original size: 20 | ||
Original size: 33 | ||
Original size: 80 |
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
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,20 @@ | ||
import { UseCase } from '../../../core/domain/useCases/UseCase' | ||
import { ICollectionsRepository } from '../repositories/ICollectionsRepository' | ||
|
||
export class DeleteCollection implements UseCase<void> { | ||
private collectionsRepository: ICollectionsRepository | ||
|
||
constructor(collectionsRepository: ICollectionsRepository) { | ||
this.collectionsRepository = collectionsRepository | ||
} | ||
|
||
/** | ||
* Deletes the Dataverse collection whose database ID or alias is given: | ||
* | ||
* @param {number | string} [collectionIdOrAlias] - A generic collection identifier, which can be either a string (for queries by CollectionAlias), or a number (for queries by CollectionId) | ||
* @returns {Promise<void>} -This method does not return anything upon successful completion. | ||
*/ | ||
async execute(collectionIdOrAlias: number | string): Promise<void> { | ||
return await this.collectionsRepository.deleteCollection(collectionIdOrAlias) | ||
} | ||
} |
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
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
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,28 @@ | ||
import { UseCase } from '../../../core/domain/useCases/UseCase' | ||
import { UploadedFileDTO } from '../dtos/UploadedFileDTO' | ||
import { IFilesRepository } from '../repositories/IFilesRepository' | ||
|
||
export class ReplaceFile implements UseCase<void> { | ||
private filesRepository: IFilesRepository | ||
|
||
constructor(filesRepository: IFilesRepository) { | ||
this.filesRepository = filesRepository | ||
} | ||
|
||
/** | ||
* Replaces an existing file. | ||
* | ||
* This method completes the flow initiated by the UploadFile use case, which involves replacing an existing file with a new one just uploaded. | ||
* (https://guides.dataverse.org/en/latest/developers/s3-direct-upload-api.html#replacing-an-existing-file-in-the-dataset) | ||
* | ||
* Note: This use case can be used independently of the UploadFile use case, e.g., supporting scenarios in which the files already exist in S3 or have been uploaded via some out-of-band method. | ||
* | ||
* @param {number | string} [fileId] - The File identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers). | ||
* @param {UploadedFileDTO} [uploadedFileDTO] - File DTO associated with the uploaded file. | ||
* @returns {Promise<void>} A promise that resolves when the file has been successfully replaced. | ||
* @throws {WriteError} - If there are errors while writing data. | ||
*/ | ||
async execute(fileId: number | string, uploadedFileDTO: UploadedFileDTO): Promise<void> { | ||
await this.filesRepository.replaceFile(fileId, uploadedFileDTO) | ||
} | ||
} |
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
Oops, something went wrong.