icipe-official / icipe-official/vectoratlas-software-code
Add 'Approve' button to the review page
Open
@andykitch is already working on this.
Since Feb 3, 2023.
8
sprint 8
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 8
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 11
Description
Add an 'Approve' button to the review page created in #180. This calls a new API endpoint, passing in the dataset-id of that dataset. The endpoint adds the reviewer to the approvedBy array for that dataset, and adds the time to the approvedAt array. It then marks that dataset as 'approved' in the db if more than one reviewer has approved, and emails the reviewers list and the uploader to say that the data has been approved.
Acceptance Criteria:
- A new endpoint has been added to the API, which requires a dataset-id to be passed in. This endpoint is restricted to a user with the 'reviewer' role, any other request will be met with a 403 error.
- This endpoint sets the dataset to 'approved' in the dataset table if another reviewer has already approved, and emails the reviewers list and the uploader to say that the data has been approved.
- If this is the first approval, the endpoint adds this user to the 'ApprovedBy' array and the time to the 'ApprovedAt' array
- If an invalid dataset_id is passed to the endpoint an error message is returned
- A new 'Approve' button exists on the UI review page. When clicked, it calls the new API endpoint with the page's dataset-id
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.