diff --git a/client/package.json b/client/package.json
index e88487f62..b992af0d1 100644
--- a/client/package.json
+++ b/client/package.json
@@ -42,7 +42,7 @@
"eslint-plugin-react-hooks": "^1.6.1",
"file-loader": "4.3.0",
"flow-bin": "^0.123.0",
- "formik": "^2.1.4",
+ "formik": "^2.2.5",
"fs-extra": "^8.1.0",
"html-webpack-plugin": "4.0.0-beta.11",
"identity-obj-proxy": "3.0.0",
@@ -70,6 +70,7 @@
"react-dev-utils": "^10.2.0",
"react-dom": "^16.12.0",
"react-dropzone": "^11.0.1",
+ "react-error-boundary": "^3.0.2",
"react-grid-system": "^6.2.3",
"react-hook-form": "^4.9.4",
"react-intl": "^3.12.0",
@@ -130,6 +131,7 @@
},
"devDependencies": {
"@babel/preset-flow": "^7.9.0",
+ "@welldone-software/why-did-you-render": "^6.0.0-rc.1",
"http-proxy-middleware": "^1.0.0",
"react-query-devtools": "^2.1.1",
"redux-devtools": "^3.5.0"
diff --git a/client/src/common/classes.js b/client/src/common/classes.js
index 570417074..6b8f3f395 100644
--- a/client/src/common/classes.js
+++ b/client/src/common/classes.js
@@ -2,6 +2,9 @@ import { Classes } from '@blueprintjs/core';
const CLASSES = {
DASHBOARD_DATATABLE: 'dashboard__datatable',
+ DASHBOARD_CARD: 'dashboard__card',
+ DASHBOARD_CARD_PAGE: 'dashboard__card--page',
+
DATATABLE_EDITOR: 'datatable-editor',
DATATABLE_EDITOR_ACTIONS: 'datatable-editor__actions',
DATATABLE_EDITOR_ITEMS_ENTRIES: 'items-entries-table',
@@ -13,7 +16,7 @@ const CLASSES = {
PAGE_FORM_HEADER_BIG_NUMBERS: 'page-form__big-numbers',
PAGE_FORM_TABS: 'page-form__tabs',
PAGE_FORM_BODY: 'page-form__body',
-
+
PAGE_FORM_FOOTER: 'page-form__footer',
PAGE_FORM_FLOATING_ACTIONS: 'page-form__floating-actions',
diff --git a/client/src/components/Dashboard/DashboardCard.js b/client/src/components/Dashboard/DashboardCard.js
new file mode 100644
index 000000000..6818b3124
--- /dev/null
+++ b/client/src/components/Dashboard/DashboardCard.js
@@ -0,0 +1,17 @@
+import React from 'react';
+import classNames from 'classnames';
+
+import { CLASSES } from 'common/classes';
+
+// Dashboard card.
+export default function DashboardCard({ children, page }) {
+ return (
+
+ {children}
+
+ );
+}
diff --git a/client/src/components/Dashboard/DashboardContent.js b/client/src/components/Dashboard/DashboardContent.js
index 01b3ae95e..506469501 100644
--- a/client/src/components/Dashboard/DashboardContent.js
+++ b/client/src/components/Dashboard/DashboardContent.js
@@ -1,15 +1,18 @@
import React from 'react';
+import { ErrorBoundary } from 'react-error-boundary';
import DashboardTopbar from 'components/Dashboard/DashboardTopbar';
import DashboardContentRoute from 'components/Dashboard/DashboardContentRoute';
import DashboardFooter from 'components/Dashboard/DashboardFooter';
+import DashboardErrorBoundary from './DashboardErrorBoundary';
-export default function() {
+export default function () {
return (
-
-
-
-
-
-
+
+
+
+
+
+
+
);
-}
\ No newline at end of file
+}
diff --git a/client/src/components/Dashboard/DashboardErrorBoundary.js b/client/src/components/Dashboard/DashboardErrorBoundary.js
new file mode 100644
index 000000000..111a9e294
--- /dev/null
+++ b/client/src/components/Dashboard/DashboardErrorBoundary.js
@@ -0,0 +1,12 @@
+import React from 'react';
+import { Icon } from 'components';
+
+export default function DashboardErrorBoundary({}) {
+ return (
+
+
Sorry about that! Something went wrong
+
If the problem stuck, please contact us as soon as possible.
+
+
+ )
+}
\ No newline at end of file
diff --git a/client/src/components/Dashboard/DashboardTopbar.js b/client/src/components/Dashboard/DashboardTopbar.js
index 50326792a..9799e908b 100644
--- a/client/src/components/Dashboard/DashboardTopbar.js
+++ b/client/src/components/Dashboard/DashboardTopbar.js
@@ -1,5 +1,4 @@
import React from 'react';
-import { connect } from 'react-redux';
import { useHistory } from 'react-router';
import {
Navbar,
@@ -14,7 +13,7 @@ import { FormattedMessage as T } from 'react-intl';
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
-import { Icon, If } from 'components';
+import { Icon, Hint, If } from 'components';
import withSearch from 'containers/GeneralSearch/withSearch';
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
@@ -78,8 +77,18 @@ function DashboardTopbar({
{pageTitle}
+
+
+
+
+
+
- { pageSubtitle }
+ {pageSubtitle}
diff --git a/client/src/components/DataTable.js b/client/src/components/DataTable.js
index 6db7f3536..d1998c244 100644
--- a/client/src/components/DataTable.js
+++ b/client/src/components/DataTable.js
@@ -343,6 +343,7 @@ export default function DataTable({
-
+
);
diff --git a/client/src/components/Forms/Checkbox.tsx b/client/src/components/Forms/Checkbox.tsx
new file mode 100644
index 000000000..0bd1b9647
--- /dev/null
+++ b/client/src/components/Forms/Checkbox.tsx
@@ -0,0 +1,27 @@
+import React, { useState } from 'react';
+import {
+ Checkbox as BPCheckbox,
+} from '@blueprintjs/core';
+
+export default function CheckboxComponent(props) {
+ const { field, form, ...rest } = props;
+ const [value, setValue] = useState(field.value || false);
+
+ const handleChange = () => {
+ const checked = !value;
+ form.setFieldValue(field.name, checked);
+ setValue(checked);
+ };
+
+ const handleBlur = () => {
+ form.setFieldTouched(field.name);
+ };
+
+ const checkboxProps = {
+ ...rest,
+ onChange: handleChange,
+ onBlur: handleBlur,
+ checked: value,
+ }
+ return
;
+}
\ No newline at end of file
diff --git a/client/src/components/index.js b/client/src/components/index.js
index 5d7d8e9cc..e58492757 100644
--- a/client/src/components/index.js
+++ b/client/src/components/index.js
@@ -38,6 +38,7 @@ import DisplayNameList from './DisplayNameList';
import MoneyInputGroup from './MoneyInputGroup';
import Dragzone from './Dragzone';
import EmptyStatus from './EmptyStatus';
+import DashboardCard from './Dashboard/DashboardCard';
const Hint = FieldHint;
@@ -81,5 +82,6 @@ export {
SalutationList,
MoneyInputGroup,
Dragzone,
- EmptyStatus
+ EmptyStatus,
+ DashboardCard,
};
diff --git a/client/src/containers/Accounting/MakeJournalEntriesForm.js b/client/src/containers/Accounting/MakeJournalEntriesForm.js
index dec6f8304..fb8025875 100644
--- a/client/src/containers/Accounting/MakeJournalEntriesForm.js
+++ b/client/src/containers/Accounting/MakeJournalEntriesForm.js
@@ -444,7 +444,6 @@ function MakeJournalEntriesForm({
},
[changePageSubtitle],
);
- console.log(values, 'Val');
return (