shift-org / shift-org/shift-docs
Separate HTTP request and HTML building portions of getEventHTML(), and refactor previewEvent() to use that instead
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 30
- Forks
- 25
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
getEventHTML() currently makes an API request and modifies some values before sending it over to build the HTML. (e.g. sets the Audience label) When adding/editing an event and using the Preview function, there hasn't been a server request yet so previewEvent() has to duplicate some of the logic from getEventHTML().
Refector getEventHTML() to separate the actual request and the event data handling logic. It should be able to generate the representation of an event from an event object regardless of whether it came from an HTTP request or from local form data. Then, update previewEvent() to only make the modifications that are unique to its use case (e.g. showing print fields), but otherwise just use the same data-handling logic as the regular path.
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.
Research direction
Locate getEventHTML() and previewEvent() in the JavaScript code and compare their request, event-data handling, and HTML-building paths. Separate the shared event representation logic from the HTTP request, then verify that regular event rendering and local-form previews use it without duplicating data handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100