openedx / openedx/frontend-app-authoring
Use UPLOAD_FILE_MAX_SIZE constant more consistently
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 218
- Avg merge
- 9d 20h
- Merged PRs (30d)
- 20
Description
Not sure if this is an 'issue' per se, or an intentional design choice, but it appears (in my opinion) that we are creating some fragmentation of code here instead of reusing an already defined constant.
Should we not ideally have FilesPage.jsx import the value from constants.js?
https://github.com/openedx/frontend-app-authoring/blob/master/src/files-and-videos/files-page/FilesPage.jsx#L94
const maxFileSize = 20 * 1048576;
https://github.com/openedx/frontend-app-authoring/blob/master/src/constants.js#L55
export const UPLOAD_FILE_MAX_SIZE = 20 * 1024 * 1024;
Contributor guide
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.
Research direction
Start by reading src/files-and-videos/files-page/FilesPage.jsx around line 94 and the UPLOAD_FILE_MAX_SIZE definition in src/constants.js. Confirm the two values are equivalent, then verify that FilesPage uses the shared constant and no longer defines a duplicate size expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100