Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expenses-improvements #1508

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/locales/bg/expenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"approvedById": "Одобрен от (Id)",
"approvedBy": "Одобрен от",
"approved": "Одобрен",
"action": "Действие",
"action": "Действия",
"empty": "Празно",
"date": "Дата",
"attached-files": "Прикачени файлове",
Expand Down
1 change: 0 additions & 1 deletion src/components/admin/expenses/grid/DetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default observer(function DetailsModal() {
{ name: t('common:fields.currency'), value: data?.currency },
{ name: t('expenses:fields.amount'), value: data?.amount },
{ name: t('expenses:fields.vaultId'), value: data?.vaultId },
{ name: t('expenses:fields.deleted'), value: data?.deleted?.toString() },
{ name: t('expenses:fields.description'), value: data?.description },
{ name: t('expenses:fields.documentId'), value: data?.documentId },
{
Expand Down
45 changes: 19 additions & 26 deletions src/components/admin/expenses/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ export default observer(function Grid() {

const columns: GridColDef[] = [
{ field: 'id', headerName: 'ID' },
{
field: 'actions',
headerName: t('expenses:fields.action'),
headerAlign: 'left',
width: 120,
type: 'actions',
headerClassName: classes.gridColumn,
renderCell: (params: GridRenderCellParams): React.ReactNode => {
return (
<GridActions
modalStore={ModalStore}
id={params.row.id}
name={params.row.id}
editLink={routes.admin.expenses.view(params.row.id)}
/>
)
},
},
{
field: 'type',
headerName: t('expenses:fields.type'),
Expand All @@ -68,7 +86,7 @@ export default observer(function Grid() {
headerName: t('expenses:fields.amount'),
headerClassName: classes.gridColumn,
align: 'right',
width: 90,
width: 100,
renderCell: (params: GridRenderCellParams): React.ReactNode => {
if (!params.row.amount) {
return '0'
Expand Down Expand Up @@ -102,30 +120,6 @@ export default observer(function Grid() {
},
flex: 1,
},
{
field: 'deleted',
headerName: t('expenses:fields.deleted'),
headerClassName: classes.gridColumn,
width: 90,
},
{
field: 'actions',
headerName: t('expenses:fields.action'),
headerAlign: 'left',
width: 120,
type: 'actions',
headerClassName: classes.gridColumn,
renderCell: (params: GridRenderCellParams): React.ReactNode => {
return (
<GridActions
modalStore={ModalStore}
id={params.row.id}
name={params.row.id}
editLink={routes.admin.expenses.view(params.row.id)}
/>
)
},
},
]

return (
Expand All @@ -142,7 +136,6 @@ export default observer(function Grid() {
pageSizeOptions={[5, 10]}
pagination
autoHeight
checkboxSelection
disableRowSelectionOnClick
/>
{/* making sure we don't sent requests to the API when not needed */}
Expand Down