From ad88b65d956d5f9b13b0bfe4e03a6f5ccc42219c Mon Sep 17 00:00:00 2001 From: Ayush Pahwa Date: Mon, 13 Nov 2023 16:07:29 +0700 Subject: [PATCH] chore: split for env walkthrough PR (#28806) ## Description PR to split code for env walkthrough. EE PR: [#2762](https://github.com/appsmithorg/appsmith-ee/pull/2762) Changes: - Update CSS for walkthrough section - Create new selector for permission checking #### PR fixes following issue(s) Fixes [#27335](https://github.com/appsmithorg/appsmith/issues/27335) #### Type of change - New feature (non-breaking change which adds functionality) ## 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 --- .../utils/BusinessFeatures/permissionPageHelpers.tsx | 11 +++++++++++ app/client/src/ce/utils/permissionHelpers.tsx | 4 ++++ .../featureWalkthrough/walkthroughRenderer.tsx | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/client/src/ce/utils/BusinessFeatures/permissionPageHelpers.tsx b/app/client/src/ce/utils/BusinessFeatures/permissionPageHelpers.tsx index 8fc561e5eb..04a00accf0 100644 --- a/app/client/src/ce/utils/BusinessFeatures/permissionPageHelpers.tsx +++ b/app/client/src/ce/utils/BusinessFeatures/permissionPageHelpers.tsx @@ -8,6 +8,9 @@ import { hasCreateDatasourcePermission as hasCreateDatasourcePermission_EE } fro import { hasManageDatasourcePermission as hasManageDatasourcePermission_CE } from "ce/utils/permissionHelpers"; import { hasManageDatasourcePermission as hasManageDatasourcePermission_EE } from "@appsmith/utils/permissionHelpers"; +import { hasManageWorkspaceDatasourcePermission as hasManageWorkspaceDatasourcePermission_CE } from "ce/utils/permissionHelpers"; +import { hasManageWorkspaceDatasourcePermission as hasManageWorkspaceDatasourcePermission_EE } from "@appsmith/utils/permissionHelpers"; + import { hasDeleteDatasourcePermission as hasDeleteDatasourcePermission_CE } from "ce/utils/permissionHelpers"; import { hasDeleteDatasourcePermission as hasDeleteDatasourcePermission_EE } from "@appsmith/utils/permissionHelpers"; @@ -62,6 +65,14 @@ export const getHasManageDatasourcePermission = ( else return hasManageDatasourcePermission_CE(permissions); }; +export const getHasManageWorkspaceDatasourcePermission = ( + isEnabled: boolean, + permissions?: string[], +) => { + if (isEnabled) return hasManageWorkspaceDatasourcePermission_EE(permissions); + else return hasManageWorkspaceDatasourcePermission_CE(permissions); +}; + export const getHasDeleteDatasourcePermission = ( isEnabled: boolean, permissions?: string[], diff --git a/app/client/src/ce/utils/permissionHelpers.tsx b/app/client/src/ce/utils/permissionHelpers.tsx index b2a7f479f6..353974ffdf 100644 --- a/app/client/src/ce/utils/permissionHelpers.tsx +++ b/app/client/src/ce/utils/permissionHelpers.tsx @@ -81,6 +81,10 @@ export const hasCreateDatasourcePermission = (_permissions?: string[]) => true; export const hasManageDatasourcePermission = (_permissions?: string[]) => true; +export const hasManageWorkspaceDatasourcePermission = ( + _permissions?: string[], +) => true; + export const hasDeleteDatasourcePermission = (_permissions?: string[]) => true; export const hasCreateDatasourceActionPermission = (_permissions?: string[]) => diff --git a/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx b/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx index c03df294b6..31c7a907f9 100644 --- a/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx +++ b/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx @@ -16,6 +16,11 @@ import AnalyticsUtil from "utils/AnalyticsUtil"; const CLIPID = "clip__feature"; const Z_INDEX = 1000; +const WalkthroughDescription = styled(Text)` + // CSS to add new line for each \n in the description + white-space: pre-line; +`; + const WalkthroughWrapper = styled.div<{ overlayColor?: string }>` left: 0px; top: 0px; @@ -304,7 +309,7 @@ const InstructionsComponent = ({ size="md" /> - {details.description} + {details.description} {details.imageURL && (