Skip to content

feat: centralize all constants in constants.ts#230

Closed
ritoban23 wants to merge 11 commits into
datazip-inc:masterfrom
ritoban23:feat/centralize-constants
Closed

feat: centralize all constants in constants.ts#230
ritoban23 wants to merge 11 commits into
datazip-inc:masterfrom
ritoban23:feat/centralize-constants

Conversation

@ritoban23
Copy link
Copy Markdown

Description

This PR centralizes all scattered constants throughout the codebase into a single constants.ts file. Previously, constants like connector types, status values, tab types, and default values were hardcoded in multiple files.

Key Changes:

  • Added 5 new constant groups to ui/src/utils/constants.ts:
    • STREAM_FILTERS - Filter options for job streams
    • CONNECTOR_TYPE_MAP - Mapping between lowercase and proper case connector names
    • DEFAULT_CONNECTORS - Default connector values for sources and destinations
    • TAB_TYPE_VALUES - Tab navigation constants with proper TypeScript literal types
    • STATUS_VALUES - Status constants for entities and jobs
  • Updated 10 component files to import and use centralized constants instead of hardcoded strings

Benefits:

  • Improved maintainability - constants are now defined in one place
  • Better type safety - proper TypeScript literal types prevent invalid values
  • Consistency - eliminates potential for typos and inconsistencies across components
  • Easier refactoring - changes to constants only need to be made in one location

Fixes #152

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Build verification - pnpm run build completes successfully
  • Linting verification - pnpm run lint passes with 0 errors and 0 warnings
  • TypeScript compilation - All type errors resolved, proper literal types enforced
  • Import verification - All components successfully import and use centralized constants
  • Functionality testing - Application starts and navigates correctly with new constants

Test Configuration:

  • Node.js environment with pnpm package manager
  • TypeScript strict mode enabled
  • ESLint with max-warnings set to 0
  • Vite build system

Screenshots or Recordings

No visual changes - this is an internal refactoring that improves code organization and maintainability.

Related PR's (If Any):

deepanshupal09-datazip and others added 10 commits October 1, 2025 16:31
* chore: add comments

* chore: 🚨 lint fix
…atazip-inc#195)

* feat: add error logs i check conenction for source and destination

* fix: parse json message as string

* chore: update response key

* chore: refactor

* chore: remove logEntry struct

* fix: log parsing

* fix: log parsing

* fix: logs parsing logic

* docs: updated api contract
…ogs-in-test-connection

feat: show error logs in test connection
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 12, 2025

CLA assistant check
All committers have signed the CLA.

@Akshay-datazip
Copy link
Copy Markdown
Contributor

Akshay-datazip commented Oct 15, 2025

hey thanks a lot for your contribution @ritoban23 can you also go ahead and share the pr on our slack in contribute-to-olake channel?
Would help our devs to expedite
regards
https://join.slack.com/t/getolake/shared_invite/zt-2uyphqf69-KQxih9Gwd4GCQRD_XFcuyw

@deepanshupal09-datazip
Copy link
Copy Markdown
Collaborator

Hi @ritoban23, please raise PR to the staging branch

@ritoban23 ritoban23 force-pushed the feat/centralize-constants branch from 57059e1 to 23df4d4 Compare October 15, 2025 09:49
@ritoban23
Copy link
Copy Markdown
Author

@deepanshupal09-datazip should i close this and make a new pr?

@deepanshupal09-datazip
Copy link
Copy Markdown
Collaborator

@deepanshupal09-datazip should i close this and make a new pr?

yes, please

@ritoban23
Copy link
Copy Markdown
Author

ritoban23 commented Oct 15, 2025

closing to reopen with a pr to the staging branch
#231

@ritoban23 ritoban23 closed this Oct 15, 2025
@deepanshupal09-datazip deepanshupal09-datazip added hacktoberfest Issues open for Hacktoberfest contributors and removed hacktoberfest Issues open for Hacktoberfest contributors labels Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move all constants to constants.ts

7 participants