diff --git a/client/src/components/index.js b/client/src/components/index.js index fb3a87114..18ade28b4 100644 --- a/client/src/components/index.js +++ b/client/src/components/index.js @@ -49,6 +49,7 @@ import ContextMenu from './ContextMenu' import TableFastCell from './Datatable/TableFastCell'; import DashboardContentTable from './Dashboard/DashboardContentTable'; import DashboardPageContent from './Dashboard/DashboardPageContent'; +import DashboardInsider from './Dashboard/DashboardInsider'; const Hint = FieldHint; @@ -103,5 +104,6 @@ export { Skeleton, ContextMenu, DashboardContentTable, - DashboardPageContent + DashboardPageContent, + DashboardInsider }; diff --git a/client/src/containers/Alerts/PaymentMades/ChangingFullAmountAlert.js b/client/src/containers/Alerts/PaymentMades/ChangingFullAmountAlert.js new file mode 100644 index 000000000..30f3c470f --- /dev/null +++ b/client/src/containers/Alerts/PaymentMades/ChangingFullAmountAlert.js @@ -0,0 +1,20 @@ +import React from 'react'; +import { Alert } from '@blueprintjs/core'; + +function ChangingFullAmountAlert() { + return ( + } + confirmButtonText={} + intent={Intent.DANGER} + isOpen={amountChangeAlert} + onCancel={handleCancelAmountChangeAlert} + onConfirm={handleConfirmAmountChangeAlert} + > +

+ Changing full amount will change all credit and payment were applied, Is + this okay? +

+
+ ); +} diff --git a/client/src/containers/Alerts/PaymentMades/ClearTransactionAlert.js b/client/src/containers/Alerts/PaymentMades/ClearTransactionAlert.js new file mode 100644 index 000000000..535417f08 --- /dev/null +++ b/client/src/containers/Alerts/PaymentMades/ClearTransactionAlert.js @@ -0,0 +1,24 @@ + + + + +export default function ClearTransactionAlert() { + + + + + return ( + } + confirmButtonText={} + intent={Intent.WARNING} + isOpen={clearFormAlert} + onCancel={handleCancelClearFormAlert} + onConfirm={handleConfirmCancelClearFormAlert} + > +

+ +

+
+ ) +} \ No newline at end of file diff --git a/client/src/containers/Alerts/PaymentMades/ClearningAllLinesAlert.js b/client/src/containers/Alerts/PaymentMades/ClearningAllLinesAlert.js new file mode 100644 index 000000000..c9ccc1a70 --- /dev/null +++ b/client/src/containers/Alerts/PaymentMades/ClearningAllLinesAlert.js @@ -0,0 +1,23 @@ + + + + +function ClearningAllLinesAlert() { + + return ( + + } + confirmButtonText={} + intent={Intent.DANGER} + isOpen={clearLinesAlert} + onCancel={handleCancelClearLines} + onConfirm={handleConfirmClearLines} + > +

+ Clearing the table lines will delete all credits and payments were + applied. Is this okay? +

+
+ ) +} \ No newline at end of file diff --git a/client/src/containers/Alerts/PaymentReceives/ChangingFullAmountAlert.js b/client/src/containers/Alerts/PaymentReceives/ChangingFullAmountAlert.js new file mode 100644 index 000000000..47f8676d4 --- /dev/null +++ b/client/src/containers/Alerts/PaymentReceives/ChangingFullAmountAlert.js @@ -0,0 +1,22 @@ + + + +function ChangingFullAmountAlert() { + + return ( + } + confirmButtonText={} + intent={Intent.WARNING} + isOpen={amountChangeAlert} + onCancel={handleCancelAmountChangeAlert} + onConfirm={handleConfirmAmountChangeAlert} + > +

+ +

+
+ ) +} \ No newline at end of file diff --git a/client/src/containers/Alerts/PaymentReceives/ClearTransactionAlert.js b/client/src/containers/Alerts/PaymentReceives/ClearTransactionAlert.js new file mode 100644 index 000000000..a8873302f --- /dev/null +++ b/client/src/containers/Alerts/PaymentReceives/ClearTransactionAlert.js @@ -0,0 +1,21 @@ + + + + +function ClearTransactionAlert() { + + return ( + } + confirmButtonText={} + intent={Intent.WARNING} + isOpen={clearFormAlert} + onCancel={handleCancelClearFormAlert} + onConfirm={handleConfirmCancelClearFormAlert} + > +

+ +

+
+ ) +} \ No newline at end of file diff --git a/client/src/containers/Alerts/PaymentReceives/ClearingAllLinesAlert.js b/client/src/containers/Alerts/PaymentReceives/ClearingAllLinesAlert.js new file mode 100644 index 000000000..856a5aeb7 --- /dev/null +++ b/client/src/containers/Alerts/PaymentReceives/ClearingAllLinesAlert.js @@ -0,0 +1,20 @@ + + + +function ClearingAllLinesAlert() { + + return ( + } + confirmButtonText={} + intent={Intent.WARNING} + isOpen={clearLinesAlert} + onCancel={handleCancelClearLines} + onConfirm={handleConfirmClearLines} + > +

+ +

+
+ ) +} \ No newline at end of file diff --git a/client/src/containers/Entries/EditableItemsEntriesTable.js b/client/src/containers/Entries/EditableItemsEntriesTable.js deleted file mode 100644 index 95eaa6180..000000000 --- a/client/src/containers/Entries/EditableItemsEntriesTable.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { FastField } from 'formik'; -import ItemsEntriesTable from './ItemsEntriesTable'; - -import 'style/components/DataTable/DataTableEditable.scss'; - -/** - * Editable items entries table. - */ -export default function EditableItemsEntriesTable({ - items, - filterSellableItems = false, - filterPurchasableItems = false, -}) { - - return ( - - ); -} diff --git a/client/src/containers/ItemsCategories/ItemCategoriesTable.js b/client/src/containers/ItemsCategories/ItemCategoriesTable.js index 2927baf75..7d2190683 100644 --- a/client/src/containers/ItemsCategories/ItemCategoriesTable.js +++ b/client/src/containers/ItemsCategories/ItemCategoriesTable.js @@ -1,12 +1,10 @@ import React from 'react'; -import classNames from 'classnames'; import { useItemsCategoriesTableColumns, ActionMenuList } from './components'; import DataTable from 'components/DataTable'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import { useItemsCategoriesContext } from './ItemsCategoriesProvider'; -import { CLASSES } from 'common/classes'; import withAlertActions from 'containers/Alert/withAlertActions'; import withDialogActions from 'containers/Dialog/withDialogActions'; @@ -36,8 +34,6 @@ function ItemsCategoryTable({ // Table columns. const columns = useItemsCategoriesTableColumns(); - const handleSelectedRowsChange = (selectedRows) => {}; - // Handle delete Item. const handleDeleteCategory = ({ id }) => { openAlert('item-category-delete', { itemCategoryId: id }); diff --git a/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFloatingActions.js b/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFloatingActions.js index cc29ef9e1..f03e6a45a 100644 --- a/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFloatingActions.js +++ b/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFloatingActions.js @@ -11,50 +11,42 @@ import { } from '@blueprintjs/core'; import { FormattedMessage as T } from 'react-intl'; import classNames from 'classnames'; +import { useFormikContext } from 'formik'; +import { usePaymentMadeFormContext } from './PaymentMadeFormProvider'; + import { CLASSES } from 'common/classes'; -import { saveInvoke } from 'utils'; + import { Icon } from 'components'; /** * Payment made floating actions bar. */ -export default function PaymentMadeFloatingActions({ - isSubmitting, - onSubmitClick, - onCancelClick, - onClearBtnClick, - onSubmitForm, - paymentMadeId, -}) { +export default function PaymentMadeFloatingActions() { + // Formik context. + const { isSubmitting } = useFormikContext(); + + // Payment made form context. + const { setSubmitPayload, paymentMadeId } = usePaymentMadeFormContext(); + + // Handle submit button click. const handleSubmitBtnClick = (event) => { - saveInvoke(onSubmitClick, event, { - redirect: true, - }); + setSubmitPayload({ redirect: true }); }; - const handleClearBtnClick = (event) => { - onClearBtnClick && onClearBtnClick(event); - }; + // Handle clear button click. + const handleClearBtnClick = (event) => {}; - const handleCancelBtnClick = (event) => { - onCancelClick && onCancelClick(event); - saveInvoke(onCancelClick, event); - }; + // Handle cancel button click. + const handleCancelBtnClick = (event) => {}; + // Handle submit & new button click. const handleSubmitAndNewClick = (event) => { - onSubmitForm(); - saveInvoke(onSubmitClick, event, { - redirect: false, - resetForm: true, - }); + setSubmitPayload({ redirect: false, resetForm: true }); }; + // handle submit & continue editing button click. const handleSubmitContinueEditingBtnClick = (event) => { - onSubmitForm(); - saveInvoke(onSubmitClick, event, { - redirect: false, - publish: true, - }); + setSubmitPayload({ redirect: false, publish: true }); }; return (
diff --git a/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFooter.js b/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFooter.js index d91bd7606..515baea79 100644 --- a/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFooter.js +++ b/client/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFooter.js @@ -2,31 +2,31 @@ import React from 'react'; import classNames from 'classnames'; import { FormGroup, TextArea } from '@blueprintjs/core'; import { FormattedMessage as T } from 'react-intl'; +import { FastField } from 'formik'; import { Row, Col } from 'components'; import { CLASSES } from 'common/classes'; /** * Payment made form footer. */ -export default function PaymentMadeFooter({ - getFieldProps -}) { +export default function PaymentMadeFooter({ getFieldProps }) { return (
{/* --------- Statement --------- */} - } - className={'form-group--statement'} - > -