Merge branch 'fix/col-actions' into 'release'
Minor fixes for column actions See merge request theappsmith/internal-tools-client!258
This commit is contained in:
commit
5489cd8fc9
|
|
@ -12,6 +12,8 @@ import {
|
||||||
CommandColumn,
|
CommandColumn,
|
||||||
CommandModel,
|
CommandModel,
|
||||||
CommandClickEventArgs,
|
CommandClickEventArgs,
|
||||||
|
ColumnMenuOpenEventArgs,
|
||||||
|
ColumnMenuItemModel,
|
||||||
PageSettingsModel,
|
PageSettingsModel,
|
||||||
} from "@syncfusion/ej2-react-grids";
|
} from "@syncfusion/ej2-react-grids";
|
||||||
import React, { useRef, MutableRefObject, useEffect, memo } from "react";
|
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 (
|
return (
|
||||||
<StyledGridComponent
|
<StyledGridComponent
|
||||||
selectionSettings={settings}
|
selectionSettings={settings}
|
||||||
|
|
@ -163,6 +178,7 @@ const TableComponent = memo(
|
||||||
columnDragStart={columnDragStart}
|
columnDragStart={columnDragStart}
|
||||||
columnDrop={columnDrop}
|
columnDrop={columnDrop}
|
||||||
commandClick={onCommandClick}
|
commandClick={onCommandClick}
|
||||||
|
columnMenuOpen={columnMenuOpen}
|
||||||
>
|
>
|
||||||
<Inject services={[Resize, Page, Reorder, ColumnMenu, CommandColumn]} />
|
<Inject services={[Resize, Page, Reorder, ColumnMenu, CommandColumn]} />
|
||||||
<ColumnsDirective>
|
<ColumnsDirective>
|
||||||
|
|
@ -172,7 +188,7 @@ const TableComponent = memo(
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
{commands.length > 0 && (
|
{commands.length > 0 && (
|
||||||
<ColumnDirective headerText="Commands" commands={commands} />
|
<ColumnDirective headerText="Actions" commands={commands} />
|
||||||
)}
|
)}
|
||||||
</ColumnsDirective>
|
</ColumnsDirective>
|
||||||
</StyledGridComponent>
|
</StyledGridComponent>
|
||||||
|
|
|
||||||
|
|
@ -273,11 +273,12 @@ export default function ActionSelector(props: ActionSelectorProps) {
|
||||||
</div>
|
</div>
|
||||||
<div hidden={!props.labelEditable}>
|
<div hidden={!props.labelEditable}>
|
||||||
<InputText
|
<InputText
|
||||||
label={"Name"}
|
label={"Action Name"}
|
||||||
value={props.label}
|
value={props.label}
|
||||||
onChange={onTextChange}
|
onChange={onTextChange}
|
||||||
isValid={true}
|
isValid={true}
|
||||||
></InputText>
|
></InputText>
|
||||||
|
<label>{"On Action Click"}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ActionSelectorDropDownContainer>
|
<ActionSelectorDropDownContainer>
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ export function FinalActionSelector(props: FinalActionSelectorProps) {
|
||||||
actionTypeOptions={actionTypeOptions}
|
actionTypeOptions={actionTypeOptions}
|
||||||
selectedActionType={selectedErrorActionType}
|
selectedActionType={selectedErrorActionType}
|
||||||
selectedActionLabel={selectedErrorActionLabel}
|
selectedActionLabel={selectedErrorActionLabel}
|
||||||
identifier={"On SucceErrorss"}
|
identifier={"On Error"}
|
||||||
label={"On Error"}
|
label={"On Error"}
|
||||||
actionResolutionType={ACTION_RESOLUTION_TYPE.ERROR}
|
actionResolutionType={ACTION_RESOLUTION_TYPE.ERROR}
|
||||||
updateActions={props.updateActions}
|
updateActions={props.updateActions}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ class ColumnActionSelectorControl extends BaseControl<
|
||||||
const columnActions = this.props.propertyValue || [];
|
const columnActions = this.props.propertyValue || [];
|
||||||
const columnActionsClone = columnActions.slice();
|
const columnActionsClone = columnActions.slice();
|
||||||
columnActionsClone.push({
|
columnActionsClone.push({
|
||||||
label: "newColumnAction",
|
label: "Action",
|
||||||
id: generateReactKey(),
|
id: generateReactKey(),
|
||||||
actionPayloads: [],
|
actionPayloads: [],
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user