## Description This PR adds builds on top of existing slash command menu feature. Today when we enter JS mode for any of the properties and type in `/` command, we are able to see the following menu. <img width="290" alt="Screenshot 2024-03-21 at 1 31 26 PM" src="https://github.com/appsmithorg/appsmith/assets/30018882/319d5be1-33f7-49e3-9b8d-fd8aa5fa9aed"> With the changes in this PR, now whenever we switch to JS mode for data property of Table and JSON form widgets, if we focus on the input box, we should be able to see the menu with options showing up as shown below: https://github.com/appsmithorg/appsmith/assets/30018882/30496f3c-615a-4a70-ba05-e0151c6bcdd5 **Limitations**: - This feature is only implemented for Table and JSON form widgets data property, based on mixpanel results we can further decide to include it for all or not. Fixes #31900 _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.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8386142777> > Commit: `90bea1f91b3d864c984548b11ec4d3a5bd70b3f7` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8386142777&attempt=2" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> ## Summary by CodeRabbit - **New Features** - Enhanced the code editor to dynamically show a slash command menu for certain widgets, improving the user editing experience. - Introduced logic to selectively enable slash command functionality for table and JSON widgets, specifically for the `data` property. - **Enhancements** - Updated the code editor hint system to support additional context, including datasource information and feature flags, enriching the autocomplete and suggestion capabilities. - **Bug Fixes** - Fixed an issue where unnecessary bindings were applied to widgets, ensuring cleaner and more relevant code generation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced `CodeEditor` with advanced properties to support diverse functionalities including AI assistance and plugin integrations. - Introduced a function to determine the visibility of the slash command menu based on widget types. - Added specific widget properties for table and JSON widgets to enable focused functionalities. - Implemented a new feature flag to toggle learnability and ease of initial use improvements. - **Tests** - Added tests for Property Pane Suggestions functionality to ensure reliable autocomplete features. - **Chores** - Improved `PropertyPane` interaction by adding a method for focusing and asserting auto-save in text fields. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”>
103 lines
4.6 KiB
TypeScript
103 lines
4.6 KiB
TypeScript
// Please follow naming convention : https://www.notion.so/appsmith/Using-Feature-Flags-in-Appsmith-d362fe7acc7d4ef0aa12e1f5f9b83b5f?pvs=4#f6d4242e56284e84af25cadef71b7aeb to create feature flags.
|
|
export const FEATURE_FLAG = {
|
|
TEST_FLAG: "TEST_FLAG",
|
|
release_datasource_environments_enabled:
|
|
"release_datasource_environments_enabled",
|
|
release_appnavigationlogoupload_enabled:
|
|
"release_appnavigationlogoupload_enabled",
|
|
release_embed_hide_share_settings_enabled:
|
|
"release_embed_hide_share_settings_enabled",
|
|
ab_wds_enabled: "ab_wds_enabled",
|
|
release_table_serverside_filtering_enabled:
|
|
"release_table_serverside_filtering_enabled",
|
|
license_branding_enabled: "license_branding_enabled",
|
|
license_sso_saml_enabled: "license_sso_saml_enabled",
|
|
license_sso_oidc_enabled: "license_sso_oidc_enabled",
|
|
license_private_embeds_enabled: "license_private_embeds_enabled",
|
|
release_show_publish_app_to_community_enabled:
|
|
"release_show_publish_app_to_community_enabled",
|
|
license_gac_enabled: "license_gac_enabled",
|
|
release_anvil_enabled: "release_anvil_enabled",
|
|
ab_show_templates_instead_of_blank_canvas_enabled:
|
|
"ab_show_templates_instead_of_blank_canvas_enabled",
|
|
release_server_dsl_migrations_enabled:
|
|
"release_server_dsl_migrations_enabled",
|
|
license_git_branch_protection_enabled:
|
|
"license_git_branch_protection_enabled",
|
|
license_git_continuous_delivery_enabled:
|
|
"license_git_continuous_delivery_enabled",
|
|
release_git_continuous_delivery_enabled:
|
|
"release_git_continuous_delivery_enabled",
|
|
release_git_autocommit_feature_enabled:
|
|
"release_git_autocommit_feature_enabled",
|
|
license_widget_rtl_support_enabled: "license_widget_rtl_support_enabled",
|
|
release_show_partial_import_export_enabled:
|
|
"release_show_partial_import_export_enabled",
|
|
release_show_new_sidebar_pages_pane_enabled:
|
|
"release_show_new_sidebar_pages_pane_enabled",
|
|
ab_one_click_learning_popover_enabled:
|
|
"ab_one_click_learning_popover_enabled",
|
|
release_side_by_side_ide_enabled: "release_side_by_side_ide_enabled",
|
|
release_global_add_pane_enabled: "release_global_add_pane_enabled",
|
|
ab_appsmith_ai_query: "ab_appsmith_ai_query",
|
|
rollout_consolidated_page_load_fetch_enabled:
|
|
"rollout_consolidated_page_load_fetch_enabled",
|
|
release_actions_redesign_enabled: "release_actions_redesign_enabled",
|
|
rollout_editor_pane_segments_enabled: "rollout_editor_pane_segments_enabled",
|
|
rollout_remove_feature_walkthrough_enabled:
|
|
"rollout_remove_feature_walkthrough_enabled",
|
|
release_drag_drop_building_blocks_enabled:
|
|
"release_drag_drop_building_blocks_enabled",
|
|
rollout_js_enabled_one_click_binding_enabled:
|
|
"rollout_js_enabled_one_click_binding_enabled",
|
|
rollout_side_by_side_enabled: "rollout_side_by_side_enabled",
|
|
ab_learnability_ease_of_initial_use_enabled:
|
|
"ab_learnability_ease_of_initial_use_enabled",
|
|
} as const;
|
|
|
|
export type FeatureFlag = keyof typeof FEATURE_FLAG;
|
|
|
|
export type FeatureFlags = Record<FeatureFlag, boolean>;
|
|
|
|
export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
|
|
TEST_FLAG: true,
|
|
release_datasource_environments_enabled: false,
|
|
release_appnavigationlogoupload_enabled: false,
|
|
release_embed_hide_share_settings_enabled: false,
|
|
ab_wds_enabled: false,
|
|
release_table_serverside_filtering_enabled: false,
|
|
license_branding_enabled: false,
|
|
license_sso_saml_enabled: false,
|
|
license_sso_oidc_enabled: false,
|
|
license_private_embeds_enabled: false,
|
|
release_show_publish_app_to_community_enabled: false,
|
|
license_gac_enabled: false,
|
|
release_anvil_enabled: false,
|
|
ab_show_templates_instead_of_blank_canvas_enabled: false,
|
|
release_server_dsl_migrations_enabled: false,
|
|
release_drag_drop_building_blocks_enabled: false,
|
|
license_git_branch_protection_enabled: false,
|
|
release_git_autocommit_feature_enabled: false,
|
|
license_git_continuous_delivery_enabled: false,
|
|
release_git_continuous_delivery_enabled: false,
|
|
license_widget_rtl_support_enabled: false,
|
|
release_show_partial_import_export_enabled: false,
|
|
release_show_new_sidebar_pages_pane_enabled: false,
|
|
ab_one_click_learning_popover_enabled: false,
|
|
release_side_by_side_ide_enabled: false,
|
|
release_global_add_pane_enabled: false,
|
|
ab_appsmith_ai_query: false,
|
|
rollout_consolidated_page_load_fetch_enabled: false,
|
|
release_actions_redesign_enabled: false,
|
|
rollout_editor_pane_segments_enabled: false,
|
|
rollout_remove_feature_walkthrough_enabled: false,
|
|
rollout_js_enabled_one_click_binding_enabled: false,
|
|
rollout_side_by_side_enabled: false,
|
|
ab_learnability_ease_of_initial_use_enabled: false,
|
|
};
|
|
|
|
export const AB_TESTING_EVENT_KEYS = {
|
|
abTestingFlagLabel: "abTestingFlagLabel",
|
|
abTestingFlagValue: "abTestingFlagValue",
|
|
};
|