refactor: centralise tech partner config to unblock ecosystem-agnostic deployment#94
Open
Harshit-Mishra2212 wants to merge 1 commit into
Conversation
|
@Harshit-Mishra2212 is attempting to deploy a commit to the SEETA's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Partner names, repo URLs, UI colors, and chart colors are hardcoded in three separate places in component files:
TECH_PARTNER_REPOS,PARTNER_COLORS,TechPartnerNameunion typeCOLORSrecordAdding any new ecosystem partner currently requires a developer to edit component source files in multiple places and update a TypeScript union type. This directly contradicts the acceptance criteria in #68: "New ecosystems can be added without code changes"
There is also a chart rendering bug caused by this:
TimeSeriesViewrenders a<Bar>for every entry in the hardcodedCOLORSobject regardless of what partners are present in the actual data. A new ecosystem with different partners would show empty bars for all the old PLDG partners and nothing for the new ones.Relates to: #68
Fix
TECH_PARTNER_CONFIGtoconstants.tsas a single source of truth; each entry holdsrepoUrl,color(UI), andchartColor(chart)TechPartnerChart.tsxnow reads fromTECH_PARTNER_CONFIGfor repo URLs and colors, with aDEFAULT_PARTNER_COLORfallback for unknown partnersTimeSeriesView.tsxnow derives<Bar>elements from the actualdataprop instead of the hardcoded list, chart automatically reflects whatever partners exist in the dataResult
Adding a new ecosystem partner now requires exactly one change: adding one entry to
TECH_PARTNER_CONFIGinconstants.ts.Files changed
src/lib/constants.ts- added partner config blocksrc/components/dashboard/TechPartnerChart.tsx- removed 3 hardcoded blocks, reads from constantssrc/components/dashboard/views/TimeSeriesView.tsx- removed hardcoded COLORS, derives bars from data