Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code to have a single state variable keep track of application status #1587

Open
1 of 4 tasks
edwinjue opened this issue Sep 20, 2023 · 3 comments
Open
1 of 4 tasks
Labels
draft Feature: Code Health Make our code more readable, testable, and modular Needs More Info Request for more info...Issue not clear ready for dev lead ready for developer lead to review the issue Role: Frontend React front end work Size: 8pt Can be done in 31-48 hours

Comments

@edwinjue
Copy link
Member

edwinjue commented Sep 20, 2023

Overview

Currently, our app makes use of several different redux state variables to keep track of different application states such as isDbLoading, isMapLoading and an error object (see: /redux/reducers/data.js#L137).

To prevent impossible states, mitigate the misuse of and the need to maintain disparate state variables throughout our codebase, it may be prudent to combine these multiple state variables into a single state variable called status with each value represented by an ENUM value describing the application's current state.

This would allow our components to operate on a single source of truth and avoid potential bugs

We would like a volunteer take a look at refactoring our code to make this change and apply it throughout the codebase

The Concept

image
image
image

Action Items

  • See where in our code we are making use of isMapLoading, isDbLoading and error object defined in /redux/reducers/data.js#L137
  • See whether it is possible to combine these states into a single state variable called status and create a new status as an ENUM that corresponds to the given application state (refer to The Concept above)
  • Add/remove any statuses as needed
  • Update all instance throughout the codebase to make use of this new single state variable

Resources/Instructions

/redux/reducers/data.js#L137

@edwinjue edwinjue added Role: Frontend React front end work Size: 8pt Can be done in 31-48 hours Milestone: Missing labels Sep 20, 2023
@edwinjue edwinjue changed the title Refactor code to avoid having multiple state variables to keep track of our application's status Refactor code to have a single state variable keep track of application status Sep 20, 2023
@MBasil03 MBasil03 added the p-feature: Dashboard Dashboard page including info boxes and charts label Sep 21, 2023
@edwinjue edwinjue added Feature: Code Health Make our code more readable, testable, and modular and removed p-feature: Dashboard Dashboard page including info boxes and charts labels Sep 21, 2023
@cottonchristopher cottonchristopher added this to the X - Technical Debt milestone Oct 25, 2023
@bberhane
Copy link
Member

bberhane commented Jun 3, 2024

@qnlee Is this still in progress?

@ryanfchase
Copy link
Member

ryanfchase commented Jun 4, 2024

If this ticket is not in progress, I think it should be moved to ice-box with dependency reason: "needs ticket refinement"

Actually I guess we don't use the Icebox for that reason. Rather, we'll assign draft label and do the refinement at that point.

As for what refinements it needs, I think this ticket can be converted to a Spike. The first 2 Action Items would yield useful information -- but the application state has been modified since this ticket was made. We would then carry out refinements in the usual way:

  • clear and concise overview
  • achievable action items
  • necessary images moved into dropdowns
  • additional info moved into later sections

@ryanfchase ryanfchase moved this from In progress to New Issue Approval in P: 311: Project Board Jun 13, 2024
@ryanfchase ryanfchase added Needs More Info Request for more info...Issue not clear draft labels Jun 13, 2024
@ryanfchase
Copy link
Member

Unassigning, moving back to draft for leads to review if it needs more info

@ryanfchase ryanfchase added the ready for dev lead ready for developer lead to review the issue label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft Feature: Code Health Make our code more readable, testable, and modular Needs More Info Request for more info...Issue not clear ready for dev lead ready for developer lead to review the issue Role: Frontend React front end work Size: 8pt Can be done in 31-48 hours
Projects
Status: New Issue Approval
Development

No branches or pull requests

6 participants