Skip to content

Revert "chore: Remove HTML column type feature flag and related code"#39169

Closed
jacquesikot wants to merge 1 commit intoreleasefrom
revert-39108-rahulbarwal/remove-htmlcell-flag-in-table-widget-v2
Closed

Revert "chore: Remove HTML column type feature flag and related code"#39169
jacquesikot wants to merge 1 commit intoreleasefrom
revert-39108-rahulbarwal/remove-htmlcell-flag-in-table-widget-v2

Conversation

@jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Feb 11, 2025

Reverts #39108

Summary by CodeRabbit

  • New Features
    • Added support for HTML content in tables. Users can now enable an HTML column type to display rich content. When disabled, HTML columns automatically revert to a standard text display to ensure consistency. Configuration options in the table settings have been updated for clearer control over this feature.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2025

Walkthrough

This pull request introduces a new feature flag for managing HTML column types in the Table widget. The changes add the flag in the feature flag file with a default value of false and create a corresponding constant. Adjustments in the widget component ensure that if the flag is disabled, HTML columns are converted to text to prevent user confusion. Additionally, column configuration files are updated to conditionally show or hide HTML options, and testing files are modified to simulate the enabled condition.

Changes

File Path Change Summary
app/client/…/HTMLCell_spec.ts Added feature flag intercept in the test suite to simulate the HTML column type feature being enabled.
app/client/…/FeatureFlag.ts Introduced new feature flag release_table_html_column_type_enabled with default value set to false.
app/client/…/TableWidgetV2/constants.ts Added constant HTML_COLUMN_TYPE_ENABLED tied to the new feature flag.
app/client/…/TableWidgetV2/widget/index.tsx Updated the widget component to check the feature flag during lifecycle methods and render logic; converts HTML columns to TEXT when the feature is disabled.
app/client/…/PanelConfig/Data/ColumnType.ts Modified column type configurations: removed HTML type from the original array and added a new configuration (columnTypeWithHtmlConfig) that conditionally displays HTML based on the flag.
app/client/…/PanelConfig/Data/index.ts Imported and integrated the new columnTypeWithHtmlConfig into the property configuration children array.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant TW as TableWidgetV2
    participant FF as FeatureFlag

    U->>TW: Interact with Table widget
    TW->>FF: Check release_table_html_column_type_enabled flag
    alt HTML feature enabled
        TW->>TW: Render HTML column normally
    else HTML feature disabled
        TW->>TW: Convert HTML column to TEXT
    end
    TW->>U: Display updated table layout
Loading

Possibly related PRs

Suggested labels

Task, Bug, Widgets Product, Table Widget V2, ok-to-test, Needs Triaging, Query & JS Pod

Suggested reviewers

  • ApekshaBhosale
  • rahulbarwal

Poem

In the realm of code so neat,
A flag now guides each HTML feat.
Columns shift from HTML to text,
Testing ensures nothing's vexed.
With every commit, our code shines bright —
A festive update in pure delight!
🎉 Happy coding!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
app/client/src/widgets/TableWidgetV2/widget/index.tsx (1)

917-953: Safety net converting HTML columns to TEXT
This block prevents stale HTML types when the feature is disabled by forcibly converting them to TEXT, which avoids undefined behavior. However, silently toggling the column type risks user confusion. Consider providing an in-app notification or an explicit mention in the property pane indicating that HTML columns are reverted to TEXT whenever the feature flag is off.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/HTMLCell_spec.ts (1)

15-17: Enabled feature flag for HTML Cell tests
Enabling the release_table_html_column_type_enabled flag ensures coverage of the HTML column scenario. Consider adding tests for the disabled state to confirm the fallback behavior.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c66512e and f75b188.

📒 Files selected for processing (6)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/HTMLCell_spec.ts (1 hunks)
  • app/client/src/ce/entities/FeatureFlag.ts (2 hunks)
  • app/client/src/widgets/TableWidgetV2/constants.ts (1 hunks)
  • app/client/src/widgets/TableWidgetV2/widget/index.tsx (5 hunks)
  • app/client/src/widgets/TableWidgetV2/widget/propertyConfig/PanelConfig/Data/ColumnType.ts (3 hunks)
  • app/client/src/widgets/TableWidgetV2/widget/propertyConfig/PanelConfig/Data/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test ...

app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/HTMLCell_spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (17)
app/client/src/widgets/TableWidgetV2/widget/index.tsx (9)

1-1: Import for React, lazy, and Suspense
No issues identified; this is a standard import approach.


22-23: Imports from BaseWidget
These imports for WidgetProps, WidgetState, and BaseWidget look standard and raise no concerns.


29-30: New imports for EventType and Skeleton
Imports appear valid for usage in event handling and fallback UI rendering.


61-62: Constant HTML_COLUMN_TYPE_ENABLED import
This new feature flag constant is a welcome addition for clearer feature toggling. Ensure references to this flag are fully tested.


87-94: Additional imports (contentConfig, styleConfig, etc.)
These imports for widget property configuration appear consistent; no further issues noted.


95-97: Importing definitions and utilities
Bringing in DefaultAutocompleteDefinitions, sanitizeKey, etc., is straightforward. No problems found.


118-120: Additional type imports for transformData
Enriches functionality for data transformations. Looks good.


127-129: Imports for widget query generation types
No immediate concerns; the types are likely used for advanced query configurations.


137-144: Imports for layout, icons, and HTMLCell
Introducing HTMLCell and klonaRegularWithTelemetry indicates deeper feature handling and cloning. No issues noted.

app/client/src/widgets/TableWidgetV2/widget/propertyConfig/PanelConfig/Data/ColumnType.ts (5)

3-3: Importing HTML_COLUMN_TYPE_ENABLED
Brings in the feature flag for conditional logic. No issues found.


8-8: Importing Widget reference
Likely needed for accessing static methods (e.g., getFeatureFlag). No concerns.


71-77: columnTypeWithHtml array
Inserting “HTML” into the type list is straightforward, maintaining alphabetical order.


98-106: hidden logic for columnTypeConfig
The condition returns true when HTML_COLUMN_TYPE_ENABLED is true or the column type is EDIT_ACTIONS. Verify that this branch is intentional, as it inverts typical “hidden” checks.


109-136: columnTypeWithHtmlConfig export
Provides an alternate config incorporating HTML column type. The structure aligns well with existing pattern.

app/client/src/ce/entities/FeatureFlag.ts (1)

42-43: LGTM! Feature flag follows naming convention.

The feature flag release_table_html_column_type_enabled is properly defined and initialized with a default value of false.

Also applies to: 92-92

app/client/src/widgets/TableWidgetV2/constants.ts (1)

247-248: LGTM! HTML column type constant is properly defined.

The constant is correctly derived from the feature flag and HTML column type is consistently defined across all necessary type definitions.

app/client/src/widgets/TableWidgetV2/widget/propertyConfig/PanelConfig/Data/index.ts (1)

12-12: LGTM! HTML column type configuration is properly integrated.

The HTML column type configuration is correctly imported and added to the panel configuration.

Also applies to: 18-18

@github-actions
Copy link

🔴🔴🔴 Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

You can view the dependency diff in the run log. Look for the check-cyclic-dependencies job in the run.

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.

1 participant