Skip to content

Commit d8919c4

Browse files
authored
Merge pull request #3084 from LiteFarmOrg/hotfix/3.6.2
Hotfix 3.6.2
2 parents 86f73e0 + b7fcddc commit d8919c4

File tree

29 files changed

+238
-160
lines changed

29 files changed

+238
-160
lines changed

packages/api/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "litefarm-api",
3-
"version": "3.6.1",
3+
"version": "3.6.2",
44
"description": "LiteFarm API server",
55
"main": "./api/src/server.js",
66
"type": "module",

packages/api/src/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (process.env.SENTRY_DSN && environment !== 'development') {
3939
// Automatically instrument Node.js libraries and frameworks
4040
...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
4141
],
42-
release: '3.6.1',
42+
release: '3.6.2',
4343
// Set tracesSampleRate to 1.0 to capture 100%
4444
// of transactions for performance monitoring.
4545
// We recommend adjusting this value in production

packages/webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "litefarm-webapp",
3-
"version": "3.6.1",
3+
"version": "3.6.2",
44
"description": "LiteFarm Web application",
55
"type": "module",
66
"scripts": {

packages/webapp/src/components/Finances/AddTransactionButton/index.jsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,25 @@ import useIsAboveBreakpoint from '../../../hooks/useIsAboveBreakpoint';
2222
import DropdownButton from '../../Form/DropDownButton';
2323
import FloatingButtonMenu from '../../Menu/FloatingButtonMenu';
2424
import FloatingMenu from '../../Menu/FloatingButtonMenu/FloatingMenu';
25+
import {
26+
ADD_EXPENSE_URL,
27+
ADD_REVENUE_URL,
28+
EXPENSE_CATEGORIES_URL,
29+
REVENUE_TYPES_URL,
30+
} from '../../../util/siteMapConstants';
2531

2632
const Menu = forwardRef((props, ref) => {
2733
const { t } = useTranslation();
2834
const dispatch = useDispatch();
2935

3036
const handleAddRevenueClick = () => {
31-
dispatch(setPersistedPaths(['/revenue_types', '/add_sale']));
32-
history.push('/revenue_types');
37+
dispatch(setPersistedPaths([REVENUE_TYPES_URL, ADD_REVENUE_URL]));
38+
history.push(REVENUE_TYPES_URL);
3339
};
3440

3541
const handleAddExpenseClick = () => {
36-
dispatch(setPersistedPaths(['/expense_categories', '/add_expense']));
37-
history.push('/expense_categories');
42+
dispatch(setPersistedPaths([EXPENSE_CATEGORIES_URL, ADD_EXPENSE_URL]));
43+
history.push(EXPENSE_CATEGORIES_URL);
3844
};
3945

4046
return (

packages/webapp/src/components/Finances/FinancesCarrousel/index.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ import styles from './styles.module.scss';
2929
import { Semibold, Text } from '../../Typography';
3030
import clsx from 'clsx';
3131
import TextButton from '../../Form/Button/TextButton';
32+
import {
33+
ESTIMATED_REVENUE_URL,
34+
LABOUR_URL,
35+
OTHER_EXPENSE_URL,
36+
} from '../../../util/siteMapConstants';
3237

3338
ChartJS.register(ArcElement, Tooltip);
3439

@@ -143,7 +148,7 @@ const FinancesCarrousel = ({
143148
<div className={styles.expensesStatsContainer}>
144149
<TextButton
145150
className={clsx([styles.labourExpensesContainer, styles.clickableContainer])}
146-
onClick={() => history.push('/labour')}
151+
onClick={() => history.push(LABOUR_URL)}
147152
>
148153
<span>
149154
<span className={styles.labourExpensesTitle}>
@@ -159,7 +164,7 @@ const FinancesCarrousel = ({
159164
</TextButton>
160165
<TextButton
161166
className={clsx([styles.otherExpensesContainer, styles.clickableContainer])}
162-
onClick={() => history.push('/other_expense')}
167+
onClick={() => history.push(OTHER_EXPENSE_URL)}
163168
>
164169
<span>
165170
<span className={styles.otherExpensesTitle}>{t('SALE.FINANCES.TOTAL_OTHER')}</span>
@@ -194,7 +199,7 @@ const FinancesCarrousel = ({
194199
/>
195200
<TextButton
196201
className={clsx([styles.estimatedRevenueContainer, styles.clickableContainer])}
197-
onClick={() => history.push('/estimated_revenue')}
202+
onClick={() => history.push(ESTIMATED_REVENUE_URL)}
198203
>
199204
<span>
200205
<span className={styles.estimatedRevenueTitle}>

packages/webapp/src/components/Finances/Transaction/ExpandedContent/CropSaleTable.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useTranslation } from 'react-i18next';
1717
import Table from '../../../Table/v2';
1818
import history from '../../../../history';
1919
import styles from './styles.module.scss';
20+
import { createRevenueDetailsUrl } from '../../../../util/siteMapConstants';
2021

2122
const getColumns = (t, mobileView, totalAmount, quantityTotal, currencySymbol) => [
2223
{
@@ -91,7 +92,7 @@ export default function CropSaleTable({ data, currencySymbol, mobileView }) {
9192
? () => <FooterCell t={t} totalAmount={totalAmount} quantityTotal={quantityWithUnit} />
9293
: null
9394
}
94-
onClickMore={() => history.push(`/revenue/${relatedId}`)}
95+
onClickMore={() => history.push(createRevenueDetailsUrl(relatedId))}
9596
/>
9697
);
9798
}

packages/webapp/src/components/Finances/Transaction/ExpandedContent/index.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ import { useTranslation } from 'react-i18next';
1717
import { BsChevronRight } from 'react-icons/bs';
1818
import { transactionTypeEnum } from '../../../../containers/Finances/useTransactions';
1919
import history from '../../../../history';
20+
import {
21+
createExpenseDetailsUrl,
22+
createRevenueDetailsUrl,
23+
LABOUR_URL,
24+
} from '../../../../util/siteMapConstants';
2025
import TextButton from '../../../Form/Button/TextButton';
2126
import CropSaleTable from './CropSaleTable';
2227
import GeneralTransactionTable from './GeneralTransactionTable';
@@ -32,10 +37,10 @@ const components = {
3237

3338
const getDetailPageLink = ({ transactionType, relatedId }) => {
3439
return {
35-
LABOUR_EXPENSE: '/labour',
36-
EXPENSE: `/expense/${relatedId}`,
37-
REVENUE: `/revenue/${relatedId}`,
38-
CROP_REVENUE: `/revenue/${relatedId}`,
40+
LABOUR_EXPENSE: LABOUR_URL,
41+
EXPENSE: createExpenseDetailsUrl(relatedId),
42+
REVENUE: createRevenueDetailsUrl(relatedId),
43+
CROP_REVENUE: createRevenueDetailsUrl(relatedId),
3944
}[transactionType];
4045
};
4146

packages/webapp/src/containers/Finances/ActualRevenue/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ import {
2121
mapSalesToRevenueItems,
2222
} from '../util';
2323
import { getCropVarieties } from '../../saga';
24+
import { ADD_REVENUE_URL, REVENUE_TYPES_URL } from '../../../util/siteMapConstants';
2425

2526
export default function ActualRevenue({ history, match }) {
2627
const { t } = useTranslation();
2728
const dispatch = useDispatch();
2829
const onGoBack = () => history.back();
2930
const onAddRevenue = () => {
30-
dispatch(setPersistedPaths(['/revenue_types', '/add_sale']));
31-
history.push('/revenue_types');
31+
dispatch(setPersistedPaths([REVENUE_TYPES_URL, ADD_REVENUE_URL]));
32+
history.push(REVENUE_TYPES_URL);
3233
};
3334
// TODO: refactor sale data after finance reducer is remade
3435
const sales = useSelector(salesSelector);

packages/webapp/src/containers/Finances/ActualRevenueItem/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useDispatch } from 'react-redux';
44
import FinanceGroup from '../../../components/Finances/FinanceGroup';
55
import { getManagementPlanCardDate } from '../../../util/moment';
66
import { setSelectedSale } from '../actions';
7+
import { createRevenueDetailsUrl } from '../../../util/siteMapConstants';
78

89
const ActualRevenueItem = ({ revenueItem, history, ...props }) => {
910
const { sale_id, sale_date, customer_name } = revenueItem.sale;
@@ -12,7 +13,7 @@ const ActualRevenueItem = ({ revenueItem, history, ...props }) => {
1213

1314
const onClickForward = () => {
1415
dispatch(setSelectedSale(revenueItem.sale));
15-
history.push(`/revenue/${sale_id}`);
16+
history.push(createRevenueDetailsUrl(sale_id));
1617
};
1718

1819
return (

0 commit comments

Comments
 (0)