Przeglądaj źródła

relocate action to the right most

tags/Baseline_180220205_Frontend
MSI\2Fi 8 miesięcy temu
rodzic
commit
c20bea533b
1 zmienionych plików z 32 dodań i 32 usunięć
  1. +32
    -32
      src/components/TimeLeaveModal/TimeLeaveInputTable.tsx

+ 32
- 32
src/components/TimeLeaveModal/TimeLeaveInputTable.tsx Wyświetl plik

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

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",
editable: true,
@@ -606,6 +574,38 @@ const TimeLeaveInputTable: React.FC<Props> = ({
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,


Ładowanie…
Anuluj
Zapisz