Skip to content

Commit

Permalink
disabled button for manual import, added guard in rerun button (#1652)
Browse files Browse the repository at this point in the history
* disabled button for manual import,added guardin rerun button

* added description comments
  • Loading branch information
dzhaniivanov authored and tongo-angelov committed Nov 14, 2023
1 parent fb5bb25 commit f9262da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ import FormDatePicker from 'components/common/form/FormDatePicker'
import { useMutation } from '@tanstack/react-query'
import { AlertStore } from 'stores/AlertStore'

const validationSchema: yup.SchemaOf<RerunTransactionsDatesInput> = yup.object().defined().shape({
startDate: yup.date().required(),
endDate: yup.date().required(),
})
const validationSchema: yup.SchemaOf<RerunTransactionsDatesInput> = yup
.object()
.defined()
.shape({
startDate: yup.date().required().min(new Date('2023, 07, 17')), //* start date minimum is set to 17/07/2023 because on this date started auto-sync https://github.com/podkrepi-bg/frontend/issues/1649
endDate: yup.date().required(),
})

export default function RerunTransactionSyncModal({
isOpen,
Expand Down
19 changes: 11 additions & 8 deletions src/components/admin/donations/grid/GridAppbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next'
import { Box, TextField, Toolbar, Tooltip, Typography } from '@mui/material'
import { Box, Button, TextField, Toolbar, Tooltip, Typography } from '@mui/material'
import { Receipt, GetApp as DownloadFileIcon } from '@mui/icons-material'

import { routes } from 'common/routes'
Expand Down Expand Up @@ -77,13 +77,16 @@ export default function GridAppbar() {
/>
<Box sx={{ height: '64px', display: 'flex', alignItems: 'flex-end', pb: 1 }}>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Tooltip title={t('donations:form-heading-bank-transactions-file') || ''}>
<Receipt
sx={addIconStyles}
fontSize="large"
onClick={() => router.push(routes.admin.donations.addBankTransactionsFile)}
/>
</Tooltip>
{/* button is disabled because we have a bug(conflicting bank donations) https://github.com/podkrepi-bg/frontend/issues/1649 */}
<Button disabled>
<Tooltip title={t('donations:form-heading-bank-transactions-file') || ''}>
<Receipt
sx={addIconStyles}
fontSize="large"
onClick={() => router.push(routes.admin.donations.addBankTransactionsFile)}
/>
</Tooltip>
</Button>
<Tooltip title={t('donations:cta:download') || ''}>
<DownloadFileIcon
sx={addIconStyles}
Expand Down

0 comments on commit f9262da

Please sign in to comment.