Skip to content

Cleanup and Refactoring after SelectField and SortableSelect Component Improvements #1919

@HussainTaj-arbisoft

Description

@HussainTaj-arbisoft

This GitHub issue encompasses the cleanup and refactoring tasks following the recent enhancements made to the SelectField and SortableSelect components, as documented in issue #1863. These improvements, controlled through environment feature flags, involve streamlining the codebase, removing obsolete elements, and updating related code to ensure a more efficient and maintainable codebase.

Description

We have recently introduced improvements to the SelectField and SortableSelect components, detailed in issue #1863. These changes have introduced several environment feature flags to control various aspects of these components. As we progress towards deploying these enhancements to production and validating their effectiveness, it's essential to initiate a cleanup and refactoring phase to ensure a streamlined and optimized codebase.

Tasks

  1. Remove Feature Flags and Conditional Logic

    • Remove the following feature flags:
      • FEATURE_SELECT_FIELD_INFINITE_SCROLL
      • FEATURE_SORTABLE_SELECT_PRESERVE_SEARCH_TEXT
      • FEATURE_SORTABLE_SELECT_HIDE_SELECTED
      • FEATURE_SORTABLE_SELECT_QUICK_ADD
    • Eliminate any conditional logic that was associated with the removed feature flags.
  2. Obsolete Code Removal

    • Delete the deprecated AsyncSelect component.
    • Remove the Add button from the SortableSelect component.
  3. Interface and Hook Updates

    • Evaluate and either remove or update the Additional interface as needed.
    • Revise the useWebsiteSelectOptions hook to eliminate the need for additional.callback.
  4. Test Refactoring

    • Refactor tests for SelectField, SortableSelect, and WebsiteCollectionField to align with the changes.
  5. isFeatureEnabled Function Review

    • If applicable, review and remove the isFeatureEnabled function, considering its relevance in light of potential future changes like a transition to LaunchDarkly.
  6. Code Analysis

    • Conduct a thorough code analysis to identify and address any other instances of code that have become inactive due to the removal of flags and components.

Acceptance Criteria

  • Feature flags and associated conditional logic are successfully removed.
  • Obsolete components (AsyncSelect, Add button) are eradicated.
  • The Additional interface is either removed or updated appropriately.
  • The useWebsiteSelectOptions hook no longer relies on additional.callback.
  • Test suites for affected components are effectively refactored.
  • If applicable, the necessity of the isFeatureEnabled function is re-evaluated.
  • The codebase is analyzed for any additional relevant redundant code or dead paths.

For reference, please consult the associated pull request #1888.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions