From 39b7d4bb66e75c242e6d11d30c88b9a506fe4326 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Wed, 7 Feb 2024 14:51:25 +0530 Subject: [PATCH] fix: Airgap instance issues (#30924) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - 30919 : Since airgap instance doesn't allow saas and ai datasources hence the dividers with no datasources were present - 30920 : The members link is removed from individual app settings #### PR fixes following issue(s) Fixes #30919 Fixes #30920 > if no issue exists, please create an issue and ask the maintainers about this first > > #### 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 ## Summary by CodeRabbit - **Refactor** - Improved the visual layout and organization in the creation of new SaaS and AI integrations interface. - Simplified logic and removed unused functions in the ApplicationCard component. --- app/client/src/ce/utils/index.ts | 11 ---- .../pages/Applications/ApplicationCard.tsx | 17 +----- .../CreateNewDatasourceTab.tsx | 52 ++++++++++--------- 3 files changed, 29 insertions(+), 51 deletions(-) diff --git a/app/client/src/ce/utils/index.ts b/app/client/src/ce/utils/index.ts index bc96aff19e..fb1f6b79ac 100644 --- a/app/client/src/ce/utils/index.ts +++ b/app/client/src/ce/utils/index.ts @@ -1,16 +1,5 @@ -import type { MenuItemProps } from "design-system-old"; import _ from "lodash"; -export const addItemsInContextMenu = ( - // eslint-disable-next-line @typescript-eslint/no-unused-vars - args: boolean[], - history: any, - workspaceId: string, - moreActionItems: MenuItemProps[], -) => { - return moreActionItems; -}; - // eslint-disable-next-line @typescript-eslint/no-unused-vars export const getHtmlPageTitle = (instanceName: string) => { return "Appsmith"; diff --git a/app/client/src/pages/Applications/ApplicationCard.tsx b/app/client/src/pages/Applications/ApplicationCard.tsx index b8f9beb291..bdacf2feb6 100644 --- a/app/client/src/pages/Applications/ApplicationCard.tsx +++ b/app/client/src/pages/Applications/ApplicationCard.tsx @@ -49,15 +49,11 @@ import { builderURL, viewerURL } from "@appsmith/RouteBuilder"; import history from "utils/history"; import urlBuilder from "@appsmith/entities/URLRedirect/URLAssembly"; import { toast } from "design-system"; -import { getAppsmithConfigs } from "@appsmith/configs"; -import { addItemsInContextMenu } from "@appsmith/utils"; import { getCurrentUser } from "actions/authActions"; import Card, { ContextMenuTrigger } from "components/common/Card"; import { generateEditedByText } from "./helpers"; import { noop } from "lodash"; -const { cloudHosting } = getAppsmithConfigs(); - interface ApplicationCardProps { application: ApplicationPayload; share?: (applicationId: string) => void; @@ -161,18 +157,7 @@ export function ApplicationCard(props: ApplicationCardProps) { "data-testid": "t--export-app", }); } - const updatedMoreActionItems: ModifiedMenuItemProps[] = - addItemsInContextMenu( - [ - props.permissions?.hasManageWorkspacePermissions || false, - props.permissions?.canInviteToWorkspace || false, - !cloudHosting, - ], - history, - props.workspaceId, - moreActionItems, - ); - setMoreActionItems(updatedMoreActionItems); + setMoreActionItems(moreActionItems); addDeleteOption(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx b/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx index 66c3bd5ef3..ba3fd37a37 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx @@ -194,17 +194,20 @@ function CreateNewSaasIntegration({ } }, [active]); return !isAirgappedInstance ? ( -
- SaaS Integrations - -
+ <> + +
+ SaaS Integrations + +
+ ) : null; } @@ -217,17 +220,20 @@ function CreateNewAIIntegration({ const isAirgappedInstance = isAirgapped(); return !isAirgappedInstance ? ( -
- AI Integrations - -
+ <> + +
+ AI Integrations + +
+ ) : null; } @@ -325,7 +331,6 @@ class CreateNewDatasourceTab extends React.Component< pageId={pageId} showUnsupportedPluginDialog={this.showUnsupportedPluginDialog} /> - -