Staging/phase3#43
Merged
AccessiT3ch merged 20 commits intomainfrom Feb 3, 2026
Merged
Conversation
…rategy - Add architecture decisions (9 recommendations documented) - Define config file structure and scope - Break down into 4 incremental PRs - Document migration strategy: regions → resources → constants → cleanup - Defer Phase 3.1-3.3 (keeping Google Translate for now)
**Phase 3.4 PR1 - Config Infrastructure + Regions Migration** Created: - src/config/index.js - Central export with helper functions - src/config/regions.json - 19 CA Rapid Response Networks (extracted from Rights/content.jsx) - src/config/validators.js - Validation functions (no external deps) Updated: - Rights.jsx - Import regions from config, transform to ctaData structure - Header.jsx - Use getSacramentoPhoneNumber() helper - Rights/content.jsx - Removed data exports, kept only JSX content - rights.test.jsx - Import from config instead of content - header.test.jsx - Use getSacramentoPhoneNumber() helper All 239 tests passing ✅ Part of Phase 3.4: Centralize Configuration Data
…verage validation, typo Co-authored-by: AccessiT3ch <95449364+AccessiT3ch@users.noreply.github.com>
…ormat Co-authored-by: AccessiT3ch <95449364+AccessiT3ch@users.noreply.github.com>
Fix review comments: unused vars, displayName/email display, coverage validation, typo
…infrastructure Phase 3.4 PR1: Config Infrastructure + Regions Migration
**Phase 3.4 PR2 - Resources Migration** Created: - src/config/resources.json - All digital & printable resources - 2 digital resource sites (Informed Immigrant, CA Immigrant) - 16 Red Card language PDFs - 2 printable flyers - 3 QR code variants Updated: - config/index.js - Added helper functions: - getDigitalResources() - Legacy format for components - getPrintableResources() - Legacy format for components - getRedCardsPrintLinks() - For cache utility - Resources.jsx - Import from config instead of content.js - utils/cache.js - Use getRedCardsPrintLinks() from config - cache.test.js - Mock config module instead of content - Resources/content.js - Added deprecation notice All 239 tests passing ✅ Part of Phase 3.4: Centralize Configuration Data
…es-config refactor(config): migrate resources to centralized config
- Created src/config/constants.js with centralized configuration: - theme.colors: primary (#FFFFFF), secondary (#B11111) - urls.external: ILRC, Informed Immigrant, GitHub repo links - app: name, shortName, description, version, copyright, lang - pwa: display, startUrl, scope - analytics.GA_MEASUREMENT_ID: null (placeholder for future) - Updated vite.config.js: - Import constants from src/config/constants.js - Use app.name, theme.colors.secondary, etc. in manifest config - Replaced all hardcoded values with constant references - Updated src/config/index.js: - Import and re-export all constants for centralized access - Destructure named exports for convenience - Updated src/Components/Footer/Footer.jsx: - Import urls and app from config - Use urls.external.github for all GitHub links - Use app.copyright instead of hardcoded string - Updated src/Components/Share/Shar- Updated src/Components/Share/Shar- Updated src/Components/Share/Shar- Updated src/Components/Share/Shar- Updated ct lookup - Updated src/scss/variables.scss: - Add comment referen - Add comment referen - Add comment referen - Add cmain in SCSS for Bootstrap integration - Updated index.html and public/offline.html: - Add comments referencing constants.js for theme colors - Static HTML cannot import JS, so values stay inline - Updated src/pwa.test.js- Updated src/pwa.test.jst- Updated src/pwa.test.js- Updated src/pwa.test.fi- Updamports and uses constants correctly All 239 tests passing. No breaking changes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Phase 3.4 PR3: Centralize Constants
- Enhanced JSDoc comments in src/config/constants.js: - Added @module documentation for module-level overview - Comprehensive @Property documentation for all config objects - Usage examples and cross-references - Documented theme colors, URLs, app metadata, PWA, analytics - Enhanced documentation in src/config/index.js: - Added @module overview with usage examples - Documented central export point pattern - Added deprecation notices: - src/Components/Rights/content.jsx: Network data migrated to config - src/Components/Resources/content.js: Resource data migrated to config - Clear migration instructions with examples - Comprehensive README.md update: - Added About section with PWA features - Documented configuration system architecture - Detailed breakdown of all config files and their purposes - Technology stack and key features - Development setup and commands - Project structure overv - Project structure overv - Project structure overv - Project structure overv - Projtion complete.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Phase 3.4 PR4: Documentation and Cleanup
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements a comprehensive centralized configuration system for all resource data, network information, and application constants, replacing hardcoded values throughout the codebase. The changes significantly improve maintainability by establishing a single source of truth for all configuration data.
Changes:
- Created a new
src/config/directory with JSON data files, JavaScript constants, validation functions, and helper utilities - Migrated 19 rapid response network phone numbers from
Rights/content.jsxtosrc/config/regions.json - Migrated 16 language PDFs and resource links from
Resources/content.jstosrc/config/resources.json - Centralized theme colors, URLs, app metadata, and PWA settings in
src/config/constants.js - Updated all components (
Rights,Header,Footer,Resources) to import from the new config system - Enhanced README with comprehensive documentation of the new architecture, configuration system, and project structure
- Refactored tests to use config data, improving reliability as data changes
- Fixed typo in deprecated file ("htts://" → "https://")
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/config/constants.js |
New file defining theme colors, external URLs, app metadata, PWA settings, and analytics placeholders |
src/config/regions.json |
New file containing 19 California rapid response networks with phone numbers, regions, and coverage areas |
src/config/resources.json |
New file with digital resources, printable PDFs in 16 languages, flyers, and QR codes |
src/config/validators.js |
New file with validation functions for phone numbers, URLs, and network data with dev/prod error handling |
src/config/index.js |
Central export point with helper functions for backward compatibility |
src/Components/Rights/Rights.jsx |
Refactored to import from config and transform data for rendering |
src/Components/Rights/content.jsx |
Removed network data, kept JSX content, added deprecation notices |
src/Components/Header/Header.jsx |
Updated to use getSacramentoPhoneNumber() from config |
src/Components/Footer/Footer.jsx |
Updated to use GitHub URLs and copyright from config constants |
src/Components/Resources/Resources.jsx |
Refactored to use getDigitalResources() and getPrintableResources() from config |
src/Components/Resources/content.js |
Deprecated with clear migration notes, kept for reference |
src/Components/Share/Share.jsx |
Extracted status colors into local constant for better maintainability |
src/utils/cache.js |
Updated to import getRedCardsPrintLinks() from config |
vite.config.js |
Updated to import theme, app, and PWA constants from config |
src/scss/variables.scss |
Added synchronization comments referencing config constants |
index.html |
Added comments noting theme color synchronization with config |
public/offline.html |
Added comments noting theme color synchronization with config |
src/Components/Rights/rights.test.jsx |
Updated to transform config data for testing |
src/Components/Header/header.test.jsx |
Updated to use getSacramentoPhoneNumber() from config |
src/utils/cache.test.js |
Updated to mock getRedCardsPrintLinks() from config |
src/pwa.test.js |
Updated to verify config imports in vite.config.js |
README.md |
Major expansion with architecture, configuration system, tech stack, project structure, and development workflow documentation |
workplan.md |
Updated with detailed Phase 3.4 implementation plan and progress tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add comprehensive Vitest unit tests for the config and validators modules. Creates src/config/config.test.js to verify exported configs/constants and helpers (regions, resources, theme, urls, app, pwa, analytics, getNetworkById, getNetworksByRegion, getAllRegions, getSacramentoPhoneNumber, getDigitalResources, getRedCardsPrintLinks, getPrintableResources). Creates src/config/validators.test.js to cover validation helpers (validatePhoneNumber, validateUrl, validateNetwork, validateRegionsConfig) and error handling (handleValidationErrors), including dev vs production behavior and console error mocking.
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.
This pull request refactors the project to use a centralized configuration system for all resource and network data, replacing hardcoded values and deprecated content files. It also improves documentation and code clarity, updates the Footer and Rights sections to use config data, and synchronizes theme color usage across HTML files. These changes make the codebase more maintainable and easier to update, while improving test reliability and developer onboarding.
Centralized Configuration System
src/config/(includingconstants.js,regions.json,resources.json, and helper/validator functions). Components now import data and helpers from config rather than legacy files. [1] [2] [3] [4] [5] [6] [7] [8] [9]Documentation and Onboarding
README.mdwith clear architecture, configuration, technology stack, project structure, development workflow, and testing details, making onboarding and maintenance easier.Component Refactoring
Footer,Header,Rights, andResourcescomponents to use config data for URLs, app metadata, network info, and resource links. Deprecated and documented legacy content files, ensuring all dynamic data comes from config. [1] [2] [3] [4] [5] [6] [7] [8]Testing Improvements
HeaderandRightscomponents to use config data, improving reliability and maintainability as data changes. [1] [2]Theme Color Synchronization
index.htmlandpublic/offline.htmlare synchronized with the config system, improving branding consistency. [1] [2] [3]