From 5482fa0e99bed16c6a0906e0e044e9b0e6dacd62 Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Wed, 4 Dec 2024 16:46:29 +0530 Subject: [PATCH] chore: Remove one click binding --- app/client/src/widgets/ConnectDataOverlay.tsx | 33 +++++++------------ .../MultiSelectWidgetV2/widget/index.tsx | 5 +-- .../src/widgets/SelectWidget/widget/index.tsx | 4 +-- .../TableWidgetV2/constants/messages.ts | 2 +- .../widget/propertyConfig/contentConfig.ts | 3 +- 5 files changed, 18 insertions(+), 29 deletions(-) diff --git a/app/client/src/widgets/ConnectDataOverlay.tsx b/app/client/src/widgets/ConnectDataOverlay.tsx index 4398dd68ac0..529a4593523 100644 --- a/app/client/src/widgets/ConnectDataOverlay.tsx +++ b/app/client/src/widgets/ConnectDataOverlay.tsx @@ -1,6 +1,4 @@ -import { Colors } from "constants/Colors"; - -import { Button } from "@appsmith/ads"; +// import { Button } from "@appsmith/ads"; import React from "react"; import styled from "styled-components"; @@ -31,25 +29,24 @@ const Container = styled.div` `; const Header = styled.div` - font-weight: 600; - font-size: 16px; - line-height: 24px; - color: ${Colors.GREY_900}; - margin-bottom: 12px; + font-weight: 400; + font-size: 14px; + line-height: 19.6px; + color: var(--ads-v2-color-gray-500); `; -const ConnecData = styled(Button)` - margin-bottom: 16px; -`; +// const ConnecData = styled(Button)` +// margin-bottom: 16px; +// `; export function ConnectDataOverlay(props: { onConnectData: () => void; message: string; btnText: string; }) { - const onClick = () => { - props.onConnectData(); - }; + // const onClick = () => { + // props.onConnectData(); + // }; return ( @@ -57,14 +54,6 @@ export function ConnectDataOverlay(props: {
{props.message}
- - {props.btnText} -
); diff --git a/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx b/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx index e604d111bea..ab880e9d69d 100644 --- a/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx +++ b/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx @@ -237,7 +237,7 @@ class MultiSelectWidget extends BaseWidget< "Takes in an array of objects to display options. Bind data from an API using {{}}", propertyName: "sourceData", label: "Source Data", - controlType: "ONE_CLICK_BINDING_CONTROL", + controlType: "INPUT_TEXT", controlConfig: { aliases: [ { @@ -260,7 +260,6 @@ class MultiSelectWidget extends BaseWidget< 2, ), }, - isJSConvertible: true, placeholderText: '[{ "label": "Option1", "value": "Option2" }]', isBindProperty: true, isTriggerProperty: false, @@ -953,10 +952,12 @@ class MultiSelectWidget extends BaseWidget< } }; } + export interface OptionValue { label: string; value: string; } + export interface DropdownOption extends OptionValue { disabled?: boolean; } diff --git a/app/client/src/widgets/SelectWidget/widget/index.tsx b/app/client/src/widgets/SelectWidget/widget/index.tsx index 8bf1cf42ef9..bfbfc7f1120 100644 --- a/app/client/src/widgets/SelectWidget/widget/index.tsx +++ b/app/client/src/widgets/SelectWidget/widget/index.tsx @@ -61,6 +61,7 @@ class SelectWidget extends BaseWidget { constructor(props: SelectWidgetProps) { super(props); } + static type = "SELECT_WIDGET"; static getConfig() { @@ -259,7 +260,7 @@ class SelectWidget extends BaseWidget { "Takes in an array of objects to display options. Bind data from an API using {{}}", propertyName: "sourceData", label: "Source Data", - controlType: "ONE_CLICK_BINDING_CONTROL", + controlType: "INPUT_TEXT", controlConfig: { aliases: [ { @@ -282,7 +283,6 @@ class SelectWidget extends BaseWidget { 2, ), }, - isJSConvertible: true, placeholderText: '[{ "label": "label1", "value": "value1" }]', isBindProperty: true, isTriggerProperty: false, diff --git a/app/client/src/widgets/TableWidgetV2/constants/messages.ts b/app/client/src/widgets/TableWidgetV2/constants/messages.ts index 92641e1607b..b130bb7efd4 100644 --- a/app/client/src/widgets/TableWidgetV2/constants/messages.ts +++ b/app/client/src/widgets/TableWidgetV2/constants/messages.ts @@ -1,3 +1,3 @@ // Table widget export const TABLE_CONNECT_OVERLAY_TEXT = () => - "Connect your data or use sample data to display table"; + "Connect your data with a single JS line e.g. {{query1.data}}"; diff --git a/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts b/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts index 580daa70f83..ea6483e4767 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts +++ b/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts @@ -34,7 +34,7 @@ export default [ "Takes in an array of objects to display rows in the table. Bind data from an API using {{}}", propertyName: "tableData", label: "Table data", - controlType: "ONE_CLICK_BINDING_CONTROL", + controlType: "INPUT_TEXT", controlConfig: { searchableColumn: true, }, @@ -42,7 +42,6 @@ export default [ inputType: "ARRAY", isBindProperty: true, isTriggerProperty: false, - isJSConvertible: true, validation: { type: ValidationTypes.FUNCTION, params: {