Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: premium and soon datasource display condition changed #38858

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Jan 27, 2025

Description

Earlier the condition for showing premium and soon datasources were dependent on the tenant instance being enterprise/business or free instance. Now after this PR it depends on the feature flag license_gac_enabled to show the premium/soon datasources.

Fixes #38802
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Datasource"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13005514213
Commit: e2f22a4
Cypress dashboard.
Tags: @tag.Datasource
Spec:


Tue, 28 Jan 2025 08:08:38 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new feature flag check isGACEnabled to control premium datasource functionality.
    • Updated premium datasource handling logic to use the new feature flag.
  • Refactor

    • Replaced free plan instance checks with a more specific feature flag mechanism.
    • Removed isFreePlanInstance variable and associated logic.
    • Updated component logic to use isGACEnabled for rendering and interaction conditions.

Copy link
Contributor

coderabbitai bot commented Jan 27, 2025

Walkthrough

The pull request modifies the handling of premium datasources in the application by replacing the isFreePlan selector with a new feature flag isGACEnabled. This change shifts the logic for displaying premium datasources from a plan-based check to a feature flag-based approach. The modifications occur in two key files related to the Integration Editor, updating how premium datasources are rendered and interacted with.

Changes

File Change Summary
app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/ContactForm.tsx Replaced isFreePlanInstance with isGACEnabled, updating submit logic, modal conditions, and button visibility.
app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx Removed isFreePlan selector, introduced useFeatureFlag hook, updated premium datasource rendering logic.

Assessment against linked issues

Objective Addressed Explanation
Show premium tag datasources correctly [#38802]
Limit soon tag datasources to EE feature users [#38802] Requires further verification of feature flag implementation.

Possibly related PRs

Suggested labels

Task, Enhancement, skip-changelog

Suggested reviewers

  • ApekshaBhosale
  • sneha122

Poem

Code flows like water, changing its course,
Feature flags dance with elegant force,
Premium tags shimmer, no longer constrained,
A refactor's magic, elegantly explained! 🚀✨


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.

@github-actions github-actions bot added Bug Something isn't working Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Production Query & JS Pod Issues related to the query & JS Pod Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets labels Jan 27, 2025
@AmanAgarwal041 AmanAgarwal041 added the ok-to-test Required label for CI label Jan 27, 2025
@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12997173517.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38858.
recreate: .

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 (1)
app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx (1)

64-64: Consider renaming the prop for clarity.

The prop name isBusinessOrEnterprise no longer reflects its actual usage with the GAC feature flag. Consider renaming it to better match its purpose.

-isBusinessOrEnterprise={isGACEnabled}
+isGACLicensed={isGACEnabled}

Also applies to: 68-68

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 235a0ed and 886f56c.

📒 Files selected for processing (2)
  • app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/ContactForm.tsx (6 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
🔇 Additional comments (5)
app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx (2)

9-10: LGTM! Clean import changes for feature flag implementation.

The imports are correctly structured for the new feature flag-based approach.


39-39: Verify consistent feature flag usage across the application.

The feature flag implementation looks correct, but let's verify its usage across the codebase.

Also applies to: 41-41

✅ Verification successful

Feature flag implementation is consistent across the codebase

The license_gac_enabled feature flag is properly implemented and follows the established pattern used throughout the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of the GAC feature flag to ensure consistent usage
rg -l "license_gac_enabled" --type ts --type tsx

Length of output: 76


Script:

#!/bin/bash
# Search for feature flag constant and usages
rg "license_gac_enabled" --type typescript --type ts

# Search for feature flag definition
fd -e ts -e tsx FEATURE_FLAG --exec cat {}

Length of output: 134


Script:

#!/bin/bash
# Search for any occurrence of the feature flag with context
rg -A 2 -B 2 "license_gac_enabled"

# Search for feature flag enum/constant definition
rg "FEATURE_FLAG.*license_gac_enabled"

Length of output: 48499

app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/ContactForm.tsx (3)

20-20: LGTM! Import statements are properly organized.

The new imports are correctly placed and necessary for the feature flag implementation.

Also applies to: 32-33


46-46: LGTM! Feature flag is properly integrated with form submission.

The implementation correctly handles the feature flag in the submission logic with proper dependency tracking.

Also applies to: 73-74


79-79: LGTM! UI elements consistently use the feature flag.

The feature flag is consistently applied across all UI elements and text generation functions.

Also applies to: 86-86, 100-100, 111-111

Copy link

Deploy-Preview-URL: https://ce-38858.dp.appsmith.com

sneha122
sneha122 previously approved these changes Jan 28, 2025
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 (1)
app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx (1)

64-70: Consider adding ARIA attributes for accessibility.

While the tag implementation looks correct, consider enhancing accessibility by adding appropriate ARIA attributes to the premium tag.

 <PremiumTag
   isBusinessOrEnterprise={isGACEnabled}
   isClosable={false}
   kind={"premium"}
+  role="status"
+  aria-label={`Premium feature status: ${getTagText(isGACEnabled)}`}
 >
   {getTagText(isGACEnabled)}
 </PremiumTag>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 886f56c and e2f22a4.

📒 Files selected for processing (2)
  • app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/ContactForm.tsx (6 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/ContactForm.tsx
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (3)
app/client/src/pages/Editor/IntegrationEditor/PremiumDatasources/index.tsx (3)

9-10: LGTM! Clean import additions.

The new feature flag imports are properly structured and necessary for the implementation.


41-44: Verify premium datasource click handler implementation.

The click handler update looks correct, but let's verify the implementation of handlePremiumDatasourceClick to ensure it properly handles the new flag-based logic.

✅ Verification successful

Premium datasource click handler implementation verified successfully

The handler correctly uses the flag to determine the appropriate analytics event.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check handlePremiumDatasourceClick implementation
ast-grep --pattern 'handlePremiumDatasourceClick($name, $isEnabled) {
  $$$
}'

Length of output: 80


Script:

#!/bin/bash
# Search for handlePremiumDatasourceClick with context
rg "handlePremiumDatasourceClick" -A 5

# Also try arrow function pattern
ast-grep --pattern 'const handlePremiumDatasourceClick = ($name, $isEnabled) => {
  $$$
}'

Length of output: 2166


39-40: Verify feature flag existence and configuration.

Good documentation with the Notion link. Let's verify the feature flag setup.

✅ Verification successful

Feature flag implementation verified

The FEATURE_FLAG.license_gac_enabled is properly defined and consistently used across the codebase. The implementation follows best practices with proper typing and documentation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify feature flag definition and usage
ast-grep --pattern 'FEATURE_FLAG.license_gac_enabled' 

Length of output: 92499


Script:

#!/bin/bash
# Search for feature flag definition
echo "=== Searching for feature flag definition ==="
rg -i "license_gac_enabled" --type ts --type js -C 2

echo -e "\n=== Searching for feature flag enum/constant ==="
ast-grep --pattern 'FEATURE_FLAG = {
  $$$
  license_gac_enabled: $_,
  $$$
}'

Length of output: 39939

@AmanAgarwal041 AmanAgarwal041 merged commit f0a6efd into release Jan 28, 2025
45 checks passed
@AmanAgarwal041 AmanAgarwal041 deleted the fix/premium-soon-ds branch January 28, 2025 08:17
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production Query & JS Pod Issues related to the query & JS Pod Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Show premium tag datasources to community users instead of community instance
2 participants