Created an option to view and download file for admins when approving a file. - #200
Deadman1225 wants to merge 6 commits into
Conversation
Add example environment variables for client configuration
|
is there a way to see all the unverified files of any course together? can you add this so that admins can approve files in courses without br |
|
yup this looks good but push your commit to this branch so that I can see how you have fetched the unverified contributions, and what do you mean by "manually make them from compass", do you mean you iterate through all the contributions or something like that? |
|
It was just part of me testing the feature out, i had to copy the contributions of other courses on compass and manually make them related to the BRless course, since I was not able to figure out any other way to test it. |
DreamBot706
left a comment
There was a problem hiding this comment.
Two issues found, the first one breaks the course dashboard. Details inline.
| <button | ||
| onClick={() => handleContributionAction(contribution.contributionId, 'approve')} | ||
| className="inline-flex items-center gap-1.5 rounded-lg bg-green-600 px-3.5 py-2 text-sm font-semibold text-white hover:bg-green-700" | ||
| onClick={() => onAction(contribution.contributionId, "approve")} |
There was a problem hiding this comment.
Crash when a course has pending contributions. onAction and processingId aren't defined in CourseDashboard (they look copied from PendingContributions.jsx). As soon as an unapproved contribution renders, this throws ReferenceError: processingId is not defined and the dashboard can't be used to approve/reject. The existing handleContributionAction is still here but no longer called. Suggest wiring these buttons back to handleContributionAction and adding a local processing-id state (same for the Reject button below).
| <FiCheck /> Approve | ||
| </button> | ||
| <button | ||
| onClick={() => onAction(contribution.contributionId, "reject")} |
There was a problem hiding this comment.
Reject deletes files without confirmation. On the server, rejecting permanently deletes every file in the contribution from storage, removes them from the parent folder and deletes the contribution record. One misclick here loses a student's upload for good. The course dashboard confirms before rejecting; this page should too.




webUrl) and a Download button. Added ahandleDownloadhandler.getFileDownloadUrl(fileId), which calls the existingGET /api/file/download/:fileIDendpoint.
The Download button sends the file's OneDrive
fileIdto the existing/api/file/download/:fileIDendpoint, which asks Microsoft Graph for a fresh@microsoft.graph.downloadUrl(a direct-to-bytes link) and returns it. The browser is then navigated to that URL to trigger the download.