PromucFlow_constructor/app/client/src/ce/entities/FeatureFlag.ts
Jacques Ikot 0cf09018b9
feat: list building blocks in explorer (#31199)
## Description
This is step 1 of completing the addition of building blocks within the
canvas explorer. It adds building blocks to the explorer and hides the
functionality behind a feature flag -
release_drag_drop_building_blocks_enabled.

1. Create a new hook to manage explorer items - widgets and building
blocks
2. Define the max items to display in the explorer for each tag
3. Define a utility function to return all explorer items alongside the
maxNoToRender per tag
4. Rename WidgetSidebarWithTags to UIEntitySidebar and move into a new
sidebar folder
5. Adjust newly renamed UIEntitySidebar to implement loading for
building blocks, new listing of blocks and widgets and manage "See more"
functionality for all items in explorer.

#### PR fixes following issue(s)
Fixes #31146

#### Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video
>
>
#### Type of change
> Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced new constants and functions to optimize widget management
and search functionality.
- Added loading indicators and a "See More" button for better user
interaction with widget cards.
- Enhanced widget filtering and display based on user interactions and
tag categories.
- Implemented a custom hook for managing UI explorer items like widgets
and building blocks.

- **Refactor**
  - Updated import paths for better code organization and readability.

- **Style**
- Adjusted widget card rendering based on tags for an improved visual
hierarchy and user experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Rahul Barwal <rahul.barwal@appsmith.com>
2024-03-08 10:05:02 +01:00

105 lines
4.8 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",
ab_create_new_apps_enabled: "ab_create_new_apps_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",
ab_start_with_data_default_enabled: "ab_start_with_data_default_enabled",
release_actions_redesign_enabled: "release_actions_redesign_enabled",
rollout_editor_pane_segments_enabled: "rollout_editor_pane_segments_enabled",
release_show_create_app_from_templates_enabled:
"release_show_create_app_from_templates_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",
} 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,
ab_create_new_apps_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,
ab_start_with_data_default_enabled: false,
release_actions_redesign_enabled: false,
rollout_editor_pane_segments_enabled: false,
release_show_create_app_from_templates_enabled: false,
rollout_remove_feature_walkthrough_enabled: false,
rollout_js_enabled_one_click_binding_enabled: false,
};
export const AB_TESTING_EVENT_KEYS = {
abTestingFlagLabel: "abTestingFlagLabel",
abTestingFlagValue: "abTestingFlagValue",
};