openedx / openedx/frontend-app-authoring

Use UPLOAD_FILE_MAX_SIZE constant more consistently

Open
#2,294 3 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.