feat: centralize all constants in constants.ts#231
feat: centralize all constants in constants.ts#231ritoban23 wants to merge 18 commits intodatazip-inc:stagingfrom
Conversation
* 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
|
@deepanshupal09-datazip Thanks for the feedback! some quick questions... should I then create a separate |
* test: ✅ base setup for automation testing using playwright , add test cases fro major flows * fix: integration workflow changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * fix: ci changes * test: add postgres flow * fix: lint changes * test: add iceberg specific test * fix: tests * fix: stream name * fix: test fix * fix: test fix * fix: test fix * fix: test fix * fix: changes * fix: ci changes * fix: ci changes * fix: ci changes * test: fail test on test connection failure * fix: ci changes * fix: changes * fix: changes * fix: changes * fix: changes * fix: changes * fix: changes * fix: test fix * fix: changes * fix: changes * fix: test-data fix * fix: test-data fix * fix: changes * fix: changes * fix: changes * fix: host and port changes * fix: changes * fix: change * test: login test updated * test: refactor create source and destination page * test: refactor tests * fix: test fix * fix: changes * fix: fix changes * fix: changes * fix: changes * fix: review changes * refactor: refactor tests to use authenticated state of playwright * fix: changes * docs: update tests readme * test: intercept and log destination spec response * docs: update readme * fix: update timeouts for playwright tests * test: update readme * fix: add retries in playwright config * test: fix timeout duration * fix: update readme * test: add connector data test-id * fix: resolve comments * refactor(test): make and use enums instead of strings * fix: fix test data builder * fix: test data job name * fix: add todo --------- Co-authored-by: Duke Dhal <duke@datazip.io> Co-authored-by: deepanshupal09-datazip <deepanshu@datazip.io>
Hi @ritoban23, sorry for the late reply, been caught up in some work. Answer to your questions:
Also make separate enums for source and destination connector like |
b962dff to
955c859
Compare
| @@ -0,0 +1,10 @@ | |||
| export enum StatusValue { | |||
There was a problem hiding this comment.
The name StatusValue is unclear. Since it’s used on the Sources page, please rename it to something more descriptive to improve readability.
There was a problem hiding this comment.
Also there are only two status in Sources page... Active and Inactive
We don't need these many statuses, please remove useless values
There was a problem hiding this comment.
Also, please use this enum in Destinations page as well for consistency.
| @@ -0,0 +1,6 @@ | |||
| export enum TabType { | |||
There was a problem hiding this comment.
This enum is currently being used in both StreamConfiguration and SourceEdit. Since these components serve different purposes and contexts, sharing the same enum may lead to confusion or unintended coupling in the future. It would be better to define separate enums for each component to maintain clear separation of concerns and improve maintainability.
Also, please ensure that each enum is named appropriately (e.g., StreamTab, SourceTab) so that its purpose and scope are clear.
| const connectorTypeMap: Record<string, string> = { | ||
| mongodb: "MongoDB", | ||
| postgres: "Postgres", | ||
| mysql: "MySQL", | ||
| oracle: "Oracle", | ||
| [SourceConnector.MONGODB.toLowerCase()]: SourceConnector.MONGODB, | ||
| [SourceConnector.POSTGRES.toLowerCase()]: SourceConnector.POSTGRES, | ||
| [SourceConnector.MYSQL.toLowerCase()]: SourceConnector.MYSQL, | ||
| [SourceConnector.ORACLE.toLowerCase()]: SourceConnector.ORACLE, |
There was a problem hiding this comment.
| const connectorTypeMap: Record<string, string> = { | |
| mongodb: "MongoDB", | |
| postgres: "Postgres", | |
| mysql: "MySQL", | |
| oracle: "Oracle", | |
| [SourceConnector.MONGODB.toLowerCase()]: SourceConnector.MONGODB, | |
| [SourceConnector.POSTGRES.toLowerCase()]: SourceConnector.POSTGRES, | |
| [SourceConnector.MYSQL.toLowerCase()]: SourceConnector.MYSQL, | |
| [SourceConnector.ORACLE.toLowerCase()]: SourceConnector.ORACLE, | |
| const SourceConnectorLabel: Record<string, string> = { | |
| [SourceConnector.MONGODB]: "MongoDB", | |
| [SourceConnector.POSTGRES]: "Postgres", | |
| [SourceConnector.MYSQL]: "MySQL", | |
| [SourceConnector.ORACLE]: "Oracle", | |
| } |
Also, please move this to the constants file
There was a problem hiding this comment.
Also, please do the same thing for DestinationEdit as well
* Added success message on Job History refetch * Update ui/src/modules/jobs/pages/JobHistory.tsx Co-authored-by: deepanshupal09-datazip <deepanshu@datazip.io> --------- Co-authored-by: vikash choudhary <vikash@datazip.io> Co-authored-by: deepanshupal09-datazip <deepanshu@datazip.io>
…datazip-inc#216) * fix: replace deprecated Phosphor icons with latest *Icon alternatives * fix: update Phosphor icons to latest alternatives in DestinationEdit and SourceEdit components and fix Lint issue * refactor: remove EditSourceModal * fix: update icon import --------- Co-authored-by: vikash choudhary <vikash@datazip.io>
* feat: add append only mode in ui * fix: data filter bug * fix: fix color of append only mode switch * fix: add custom option in all streams ingestion mode change * fix: use clsx for conditional styling * fix: fix icons
…>SourceStatus, centralize connector labels in constants
cbc6c3a to
142f19f
Compare
|
@deepanshupal09-datazip I have addressed all the feedbacks . apologies for the late update, thanks! |
No worries... linter is failing... please run |
|
Also, please avoid using force push in the future. When you force pushed, the previous commits (and my comments on them) were removed, which makes it difficult to track changes since the last review. Force pushing disrupts the review process and removes useful context from the commit history. Now I'll have to review from the start, which will take more time. Please avoid doing that unless it's absolutely necessary. |
|
@deepanshupal09-datazip I'll make sure to not do that from next time, I usually force push after rebasing ,didn't realize I shouldn't do it when i was updating after you merged the staging branch |
0c10a25 to
8335e7e
Compare
Description
This PR centralizes all scattered constants throughout the codebase into a single
constants.tsfile. Previously, constants like connector types, status values, tab types, and default values were hardcoded in multiple files, leading to maintenance issues and potential inconsistencies.Key Changes:
ui/src/utils/constants.ts:STREAM_FILTERS- Filter options for job streamsCONNECTOR_TYPE_MAP- Mapping between lowercase and proper case connector namesDEFAULT_CONNECTORS- Default connector values for sources and destinationsTAB_TYPE_VALUES- Tab navigation constants with proper TypeScript literal typesSTATUS_VALUES- Status constants for entities and jobsFixes #152
Type of change
How Has This Been Tested?
pnpm run buildcompletes successfullypnpm run lintpasses with 0 errors and 0 warningsTest Configuration:
Screenshots or Recordings
No visual changes - this is an internal refactoring that improves code organization and maintainability.
Related PR's (If Any):