From 7d18320c50a04a34a843d4da37898fbb5378eb9a Mon Sep 17 00:00:00 2001 From: Satbir Singh Date: Thu, 23 Jan 2020 13:32:05 +0000 Subject: [PATCH] Minor fixes for column actions --- .../syncfusion/TableComponent.tsx | 18 +++++++++++++++++- .../propertyControls/ActionSelector.tsx | 3 ++- .../propertyControls/ActionSelectorControl.tsx | 2 +- .../ColumnActionSelectorControl.tsx | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/client/src/components/designSystems/syncfusion/TableComponent.tsx b/app/client/src/components/designSystems/syncfusion/TableComponent.tsx index 3b40912a1c..6c9f0472be 100644 --- a/app/client/src/components/designSystems/syncfusion/TableComponent.tsx +++ b/app/client/src/components/designSystems/syncfusion/TableComponent.tsx @@ -12,6 +12,8 @@ import { CommandColumn, CommandModel, CommandClickEventArgs, + ColumnMenuOpenEventArgs, + ColumnMenuItemModel, PageSettingsModel, } from "@syncfusion/ej2-react-grids"; import React, { useRef, MutableRefObject, useEffect, memo } from "react"; @@ -148,6 +150,19 @@ const TableComponent = memo( } } + function columnMenuOpen(args: ColumnMenuOpenEventArgs) { + for (const item of args.items) { + if (item.text) { + if (item.text === "Autofit all columns") { + (item as ColumnMenuItemModel).hide = true; + } + if (item.text === "Autofit this column") { + (item as ColumnMenuItemModel).text = "Autofit column"; + } + } + } + } + return ( @@ -172,7 +188,7 @@ const TableComponent = memo( ); })} {commands.length > 0 && ( - + )} diff --git a/app/client/src/components/propertyControls/ActionSelector.tsx b/app/client/src/components/propertyControls/ActionSelector.tsx index 806184246a..5b98be6f8a 100644 --- a/app/client/src/components/propertyControls/ActionSelector.tsx +++ b/app/client/src/components/propertyControls/ActionSelector.tsx @@ -273,11 +273,12 @@ export default function ActionSelector(props: ActionSelectorProps) { diff --git a/app/client/src/components/propertyControls/ActionSelectorControl.tsx b/app/client/src/components/propertyControls/ActionSelectorControl.tsx index 3b165969fa..c339cbb514 100644 --- a/app/client/src/components/propertyControls/ActionSelectorControl.tsx +++ b/app/client/src/components/propertyControls/ActionSelectorControl.tsx @@ -175,7 +175,7 @@ export function FinalActionSelector(props: FinalActionSelectorProps) { actionTypeOptions={actionTypeOptions} selectedActionType={selectedErrorActionType} selectedActionLabel={selectedErrorActionLabel} - identifier={"On SucceErrorss"} + identifier={"On Error"} label={"On Error"} actionResolutionType={ACTION_RESOLUTION_TYPE.ERROR} updateActions={props.updateActions} diff --git a/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx b/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx index ca7417d79d..70413fc96b 100644 --- a/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx +++ b/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx @@ -123,7 +123,7 @@ class ColumnActionSelectorControl extends BaseControl< const columnActions = this.props.propertyValue || []; const columnActionsClone = columnActions.slice(); columnActionsClone.push({ - label: "newColumnAction", + label: "Action", id: generateReactKey(), actionPayloads: [], });