Northeastern-Electric-Racing / Northeastern-Electric-Racing/FinishLine

Abstract userToAutocompleteOption everywhere in the frontend

Open
#1,286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficult front-end technical improvement
Dominant language
TypeScript
Stars
36
Forks
9
Avg merge
4d 21h
Merged PRs (30d)
11

Description

Description

Currently we have a lot of places where we have an autocomplete of users (see examples below). The problem is that each of these places have their own userToAutocompleteOption, several of which are implemented differently from each other. We wanna standardize how each of these places uses this method then, abstract it into a single method and put it in a new users.utils.ts file in the utils folder. (you'll probably need two versions of this method, one with the user's role and one without)

Acceptance Criteria

All of the places where userToAutocompleteOption is used have been abstracted as much as possible and are implemented the same way (returning an option with this form: { label: string; id: string }, so that it can be used by the NERAutocomplete component)

Proposed Solution

Abstract everywhere this method (might even be a couple more spots with a slightly different name), and pull the abstracted method out in a file in the utils folder.

Mocks

Examples of user autocompletes:
image
image

Contributor guide

No contributing guide indexed for this repository

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

Search the frontend for userToAutocompleteOption and similarly named helpers, then compare every user autocomplete implementation. Add the shared versions to a new users.utils.ts file and ensure each site supplies an option shaped as { label: string; id: string } for NERAutocomplete, including variants with and without the user's role.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.