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: Removing the global add in segmented header and updating the UI for new query tab #37757

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/client/src/IDE/Components/FileTab/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const Tab = styled.div`
border-left: 1px solid transparent;
border-right: 1px solid transparent;
border-top: 2px solid transparent;
flex-shrink: 0;

&.active {
background: var(--ads-v2-colors-control-field-default-bg);
Expand Down
4 changes: 0 additions & 4 deletions app/client/src/IDE/Components/HeaderDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ const Container = styled(Flex)`
& .t--entity-item {
grid-template-columns: 0 auto 1fr auto auto auto auto auto;
height: 32px;

& .t--entity-name {
padding-left: var(--ads-v2-spaces-3);
}
}
`;

Expand Down
2 changes: 0 additions & 2 deletions app/client/src/ce/entities/FeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const FEATURE_FLAG = {
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",
release_actions_redesign_enabled: "release_actions_redesign_enabled",
rollout_remove_feature_walkthrough_enabled:
Expand Down Expand Up @@ -68,7 +67,6 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
license_widget_rtl_support_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,
release_actions_redesign_enabled: false,
rollout_remove_feature_walkthrough_enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12765,7 +12765,6 @@ export const defaultAppState = {
rollout_app_sidebar_enabled: false,
ab_one_click_learning_popover_enabled: false,
release_side_by_side_ide_enabled: false,
release_global_add_pane_enabled: false,
license_git_unlimited_repo_enabled: false,
ask_ai_js: false,
license_connection_pool_size_enabled: false,
Expand Down
4 changes: 4 additions & 0 deletions app/client/src/pages/Editor/Explorer/Entity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export const EntityItem = styled.div<{
height: 36px;
}

& .t--entity-name {
padding-left: var(--ads-v2-spaces-3);
}

& .${EntityClassNames.COLLAPSE_TOGGLE} {
svg {
path {
Expand Down
7 changes: 1 addition & 6 deletions app/client/src/pages/Editor/Explorer/Widgets/WidgetIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IconWrapper } from "constants/IconConstants";
import type { WidgetType } from "constants/WidgetConstants";
import React from "react";
import useWidgetConfig from "utils/hooks/useWidgetConfig";
Expand All @@ -14,11 +13,7 @@ function WidgetIcon(props: {
const svg = useWidgetConfig(type, "iconSVG");

if (svg) {
return (
<IconWrapper height={height} width={width}>
<img src={svg} />
</IconWrapper>
);
return <img height={height} src={svg} width={width} />;
}
ankitakinger marked this conversation as resolved.
Show resolved Hide resolved

return null;
Expand Down
4 changes: 0 additions & 4 deletions app/client/src/pages/Editor/IDE/EditorPane/JS/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ const JSContainer = styled(Flex)`
& .t--entity-item {
grid-template-columns: 0 auto 1fr auto auto auto auto auto;
height: 32px;

& .t--entity-name {
padding-left: var(--ads-v2-spaces-3);
}
}
`;

Expand Down
4 changes: 0 additions & 4 deletions app/client/src/pages/Editor/IDE/EditorPane/Query/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const QueriesContainer = styled(Flex)`
& .t--entity-item {
grid-template-columns: 0 auto 1fr auto auto auto auto auto;
height: 32px;

& .t--entity-name {
padding-left: var(--ads-v2-spaces-3);
}
}
`;

Expand Down
3 changes: 0 additions & 3 deletions app/client/src/pages/Editor/IDE/EditorPane/UI/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ import styled from "styled-components";
const ListContainer = styled(Flex)`
& .t--entity-item {
height: 32px;
& .t--entity-name {
padding-left: var(--ads-v2-spaces-3);
}
}
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
import React from "react";
import { Button, Flex, SegmentedControl } from "@appsmith/ads";
import { Flex, SegmentedControl } from "@appsmith/ads";
import { createMessage, EDITOR_PANE_TEXTS } from "ee/constants/messages";
import { EditorEntityTab } from "ee/entities/IDE/constants";
import history from "utils/history";
import { globalAddURL } from "ee/RouteBuilder";
import { useSelector } from "react-redux";
import { useCurrentEditorState, useSegmentNavigation } from "../../hooks";
import styled from "styled-components";
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
import { getCurrentBasePageId } from "selectors/editorSelectors";

const Container = styled(Flex)`
#editor-pane-segment-control {
max-width: 247px;
}

button {
flex-shrink: 0;
flex-basis: auto;
}
`;

const SegmentedHeader = () => {
const isGlobalAddPaneEnabled = useFeatureFlag(
FEATURE_FLAG.release_global_add_pane_enabled,
);
const basePageId = useSelector(getCurrentBasePageId);
const onAddButtonClick = () => {
history.push(globalAddURL({ basePageId }));
};
const { segment } = useCurrentEditorState();
const { onSegmentChange } = useSegmentNavigation();

Expand Down Expand Up @@ -61,16 +43,6 @@ const SegmentedHeader = () => {
]}
value={segment}
/>
{isGlobalAddPaneEnabled ? (
<Button
className={"t--add-editor-button"}
isIconButton
kind="primary"
onClick={onAddButtonClick}
size="sm"
startIcon="add-line"
/>
) : null}
</Container>
);
};
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/pages/Editor/IDE/EditorTabs/AddTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
EditorEntityTab,
EditorEntityTabState,
} from "ee/entities/IDE/constants";
import { Text } from "@appsmith/ads";

const AddTab = ({
isListActive,
Expand Down Expand Up @@ -34,7 +35,7 @@ const AddTab = ({
onClose={(e) => onCloseClick(e)}
title={content}
>
{content}
<Text kind="body-s">{content}</Text>
</FileTab>
);
};
Expand Down
4 changes: 0 additions & 4 deletions app/client/src/pages/Editor/IDE/EditorTabs/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ const ListContainer = styled(Flex)`
& .t--entity-item {
grid-template-columns: 0 auto 1fr auto auto auto auto auto;
height: 32px;

& .t--entity-name {
padding-left: var(--ads-v2-spaces-3);
}
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const DropdownWithCTAWrapper = styled.div<DropdownWithCTAWrapperProps>`
display: flex;
gap: var(--ads-v2-spaces-3);

&&&&& .function-select-dropdown {
width: 230px;
.rc-select-selector {
min-width: unset;
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import { getCurrentAppWorkspace } from "ee/selectors/selectedWorkspaceSelectors"
const DropdownSelect = styled.div`
font-size: 14px;
width: 230px;

.rc-select-selector {
min-width: unset;
}
`;

const CreateDatasource = styled.div`
Expand Down
Loading