Tech debt pb 51 code dupicacy dev - #6662
Conversation
- Deleted orderFormCommentsTextAreaFieldHideInForm and orderFormRejectionReasonTextAreaField to streamline the configuration. - Removed associated sections from orderFormCommentsSectionHideInForm and orderFormRejectionReasonCommentsSection.
- Deleted FSOHomeConfig.js as it is no longer needed. - Removed TabFSOSearchConfig references from HomeConfig.js. - Deleted JudgeHomeConfig.js to streamline the codebase. - Cleaned up redundant role mappings in HomeConfig.js.
- Removed hardcoded tab search configurations from GenerateOrdersConfig.js and OrdersHomeConfig.js. - Introduced a new shared configuration file (individualCampaignSearchConfig.js) to build search configurations dynamically. - Implemented a function to generate individual search fields and API details for each tab. - Updated the OrdersHomeConfig.js to utilize the new dynamic configuration, including an option to add a document column in the submissions tab.
- Introduced epostFormShared.js with status options and fields for ePost tracking. - Created epostTrackingTabConfig.js to manage search configurations for ePost tracking, including API details and search result sections. - Added summonsSearchConfigShared.js for managing summons search fields, default values, and API details for various summons states.
- Introduced shared configuration files for bulk diary sign and issue CTC, consolidating search sections and API details. - Created new shared components for managing search fields and results, enhancing code reusability. - Updated existing configurations to leverage the new shared components, streamlining the overall structure.
…elated components
…components and improve code maintainability - Updated respondentConfig.js to import and use shared components for personal details note, phone, email, and address fields. - Simplified editComplainantDetailsConfig.js by replacing hardcoded address fields with shared inputs for current residential and company addresses. - Enhanced editRespondentConfig.js to leverage shared address building function and streamline address input handling. - Introduced new search fields and result columns for hearings, orders, submissions, and documents in admittedCasesSearchShared.js. - Refactored AdmittedCasesConfig.js to utilize new search sections and result configurations for hearings, orders, submissions, and documents.
…s for improved maintainability and readability. Consolidate respondent and witness configurations by integrating shared components and validation utilities, enhancing code reusability. Update eFiling validation utilities to streamline mobile and email duplicate checks, leveraging shared functions for cleaner logic. Simplify edit respondent configuration by replacing repetitive structures with shared steps, ensuring consistency across forms.
- Added a utility function `getUploadErrorToast` to standardize error messages for file uploads. - Updated `UploadModal` to accept `fileUploadError` and `setFileUploadError` props for better error management. - Refactored error handling in multiple components (e.g., `ESignSignatureModal`, `ComplainantSignature`, `WitnessDepositionSignatureModal`, etc.) to utilize the new error handling utility. - Removed redundant error handling code and replaced it with calls to `getUploadErrorToast` for consistency. - Ensured that error toasts are displayed correctly when file upload errors occur.
…components - Enhanced `ordersCreateConfig.js` and `submissionsCreateConfig.js` by importing shared field definitions from `ordersCreateConfigShared.js` and `submissionsCreateConfigShared.js`. - Replaced repetitive SelectCustomTextArea sections with shared components for better maintainability and readability. - Introduced new shared fields for additional comments, grounds, and other details in order forms. - Updated submission configurations to include new sections for extension benefits, document purposes, and additional information, streamlining the form structure.
- Moved respondent and complainant name and age validation logic to shared utility functions for better code reuse and maintainability. - Updated BulkRescheduleModal and BulkReschedule components to use centralized CloseBtn and Heading components, removing redundant code. - Refactored pending task actions in HomeConfig.js to utilize shared action builders, improving readability and reducing duplication. - Introduced new shared utility functions for building redirect details and pending task actions in pendingTaskActionsShared.js. - Cleaned up unused imports and components across various files to streamline the codebase.
- Simplified the editComplainantDetailsConfig by utilizing shared form step functions for better maintainability. - Enhanced editProfileValidationUtils to use new validation functions for checking mobile number duplicates and respondent inquiry affidavit validation. - Updated ordersCreateConfig to leverage new utility functions for building order reference fields and hearing date fields, reducing code duplication. - Introduced shared configuration for order reference fields and hearing date fields in ordersCreateConfigShared.js to streamline order form configurations.
…ce BulkSign and BulkWitnessDeposition views with modularized components and improved date formatting; streamline button styles in HearingSideCard; integrate tooltip utility for order generation; remove redundant XML parsing functions.
…for handling XML responses and streamline modal implementations across various views. Enhance readability and maintainability by centralizing common styles and logic, including the addition of new helper functions for building signed responses.
- Moved hook and library setup logic to a shared utility module in dristi. - Replaced inline hook overrides and library setups in various modules (hearings, home, orders, submissions) with calls to the new utility functions. - Updated MakeSubmissionConfig to import from home module instead of defining inline. - Simplified session storage management in BulkReschedule component by creating dedicated load, save, and clear functions. - Added new submissionAdditionalCommentsTextAreaField to submissionsCreateConfig. - Updated searchTestResultData service in multiple modules to import from the cases module.
…emove unused configurations
… modal components; enhance date handling and button implementations
…ayment inbox and scrutiny tasks; streamline API details and UI components for better maintainability
… enhance payment modal delivery note formatting; improve maintainability and readability
…izations for better maintainability and code reuse
…hared components for modal header and close button; streamline payment modals by consolidating payment selection logic into a reusable component; enhance address comparison and user option retrieval for order channels; improve code organization and readability.
…re flow - Added `bulkRescheduleShared.js` for managing bulk reschedule session data and signature handling. - Introduced `DocumentSignaturePickerModal` and `DocumentSignatureSignedModal` for consistent signature modals across different components. - Refactored `BailBondSignModal`, `DigitalDocumentSignModal`, `WitnessDepositionSignModal`, and `NewBulkRescheduleTab` to utilize the new shared modal components. - Improved session management by centralizing session storage operations in `bulkRescheduleShared.js`. - Enhanced user experience by streamlining the signature upload and e-sign processes across various document types.
…yment handling - Simplified PaymentForSummonModal by utilizing a new custom hook `useTaskOrderPaymentModal` to manage payment logic and state. - Introduced `submitModalInfoRpadPayment` for RPAD payment receipt defaults. - Enhanced payment processing functions to handle both POST and RPAD payment methods. - Updated fee options and modal configurations to accommodate new payment types. - Improved loading state management for better user experience during payment processing.
… ForgotPassword components - Replaced FormComposer with FormComposerV2 in ChangePassword and ForgotPassword pages for improved functionality. - Adjusted imports accordingly to reflect the new component usage. Enhancement: Introduce advocate name retrieval functions in UICustomizations - Added new utility functions for fetching advocate names using bar registration numbers. - Refactored existing code to utilize these new functions, improving maintainability and readability. Refactor: Simplify task details parsing logic in home and orders modules - Created a shared utility function `parseTaskDetails` to handle task details parsing across multiple components. - Removed redundant parsing logic from ReviewSummonsNoticeAndWarrant and other components. Improvement: Consolidate order form schema transformation logic - Moved order form schema transformation utilities into a dedicated file for better organization. - Updated references in UICustomizations to use the new shared transformation functions. Cleanup: Remove unused validation logic in ordersCreateConfig - Streamlined validation logic by replacing custom validation functions with direct references to shared validation configurations. - Enhanced readability and reduced complexity in order creation configurations.
|
Important Review skippedToo many files! This PR contains 191 files, which is 41 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (191)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Requirements
pucardotorg#51
support/release-<release-number>-<issue-number>-mdms.jsonsupport/release-<release-number>-<issue-number>-workflow.jsonsupport/release-<release-number>/deployment.mdSummary
Reduces Sonar code duplication across PUCAR digit-ui frontend modules via extract-only refactors—shared utilities, config builders, hooks, and components—with thin wrappers at existing import paths. No intentional UI or API behaviour changes.
Sonar impact
~17k net lines removed vs
develop(~191 files).Highlights
common:transformCreateData,EmployeeFlowResponse, case/upload helpers*Shared.js,configs/shared/)moduleSetup.js, canonicalsearchTestResultData(cases), hearings → homeMakeSubmissionConfigre-exportregistrationFlowShared), bulk reschedule/sign, schedule hearing, document sign modalsordersCreateConfigShared, POST/RPADuseTaskOrderPaymentModal, schema utils dedupeFormComposer.js; auth pages on FormComposerV2 onlyModules touched
common·dristi·home·orders·hearings·cases·submissions·coreTest plan
Related: PB-51 / tech-debt code duplication
Data Changes
Preview
Other