Browse Source

relocate action to the right most

tags/Baseline_180220205_Frontend
MSI\2Fi 8 months ago
parent
commit
c20bea533b
1 changed files with 32 additions and 32 deletions
  1. +32
    -32
      src/components/TimeLeaveModal/TimeLeaveInputTable.tsx

+ 32
- 32
src/components/TimeLeaveModal/TimeLeaveInputTable.tsx View File

@@ -278,38 +278,6 @@ const TimeLeaveInputTable: React.FC<Props> = ({


const columns = useMemo<GridColDef[]>( const columns = useMemo<GridColDef[]>(
() => [ () => [
{
type: "actions",
field: "actions",
headerName: t("Actions"),
getActions: ({ id }) => {
if (rowModesModel[id]?.mode === GridRowModes.Edit) {
return [
<GridActionsCellItem
key="accpet-action"
icon={<Check />}
label={t("Save")}
onClick={handleSave(id)}
/>,
<GridActionsCellItem
key="cancel-action"
icon={<Close />}
label={t("Cancel")}
onClick={handleCancel(id)}
/>,
];
}

return [
<GridActionsCellItem
key="delete-action"
icon={<Delete />}
label={t("Remove")}
onClick={handleDelete(id)}
/>,
];
},
},
{ {
field: "projectId", field: "projectId",
editable: true, editable: true,
@@ -606,6 +574,38 @@ const TimeLeaveInputTable: React.FC<Props> = ({
return <TwoLineCell>{params.value}</TwoLineCell>; return <TwoLineCell>{params.value}</TwoLineCell>;
}, },
}, },
{
type: "actions",
field: "actions",
headerName: t("Actions"),
getActions: ({ id }) => {
if (rowModesModel[id]?.mode === GridRowModes.Edit) {
return [
<GridActionsCellItem
key="accpet-action"
icon={<Check />}
label={t("Save")}
onClick={handleSave(id)}
/>,
<GridActionsCellItem
key="cancel-action"
icon={<Close />}
label={t("Cancel")}
onClick={handleCancel(id)}
/>,
];
}

return [
<GridActionsCellItem
key="delete-action"
icon={<Delete />}
label={t("Remove")}
onClick={handleDelete(id)}
/>,
];
},
},
], ],
[ [
t, t,


Loading…
Cancel
Save