| @@ -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, | ||||