Skip to content
Open
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
43500e1
Make a generic Edit location detail form
Duncan-Brain Mar 15, 2026
ff825e8
Replace Edit Barn container with new generic form
Duncan-Brain Mar 15, 2026
ad0a7eb
add new translation string to match others
Duncan-Brain Mar 15, 2026
9055788
Pattern emerging for the formatting function extract into util
Duncan-Brain Mar 23, 2026
4f53cec
Replace Edit ceremonial area with generic component
Duncan-Brain Mar 23, 2026
4d12361
cleanup console log
Duncan-Brain Mar 23, 2026
b1d9032
Remove edit farm site boundary and use generic component
Duncan-Brain Mar 23, 2026
7a28a86
Remove edit field location container and replace with generic component
Duncan-Brain Mar 23, 2026
23d11f1
remove garden container and replace with generic
Duncan-Brain Mar 23, 2026
14eb91a
remove greenhouse edit container and replace with generic
Duncan-Brain Mar 23, 2026
ab61e68
Map filter strings are actually present, use template string instead …
Duncan-Brain Mar 23, 2026
aa52beb
replace edit natural area container with generic component
Duncan-Brain Mar 23, 2026
13d8a48
remove residence edit container and replace with generic component
Duncan-Brain Mar 23, 2026
aacd64a
remove surface water edit form and replace with generic
Duncan-Brain Mar 23, 2026
814b768
remove edit buffer zone form, replace with generic component
Duncan-Brain Mar 23, 2026
c0e6680
remove edit fence form containere and replace with generic component
Duncan-Brain Mar 23, 2026
8d802a1
Remove watercourse edit form container and replace with generic
Duncan-Brain Mar 23, 2026
861a029
remove gate edit form and use generic component
Duncan-Brain Mar 23, 2026
4f22d7e
cleanup unused imports and functions
Duncan-Brain Mar 23, 2026
6e52262
remove soil sample location edit form and use generic component
Duncan-Brain Mar 23, 2026
bb88c47
remove edit water valve form and replace with generic component
Duncan-Brain Mar 23, 2026
c9dc724
Make the routes files into a reusable file and delete duplicated code
Duncan-Brain Mar 24, 2026
332b18d
WIP first draft of the post location by type form
Duncan-Brain Mar 24, 2026
45d464f
Replace post barn route with reusable route
Duncan-Brain Mar 24, 2026
b2c86f0
Delete the rest of the post forms and sagas
Duncan-Brain Mar 24, 2026
b02d9b9
Remove get locations saga and slices
Duncan-Brain Mar 24, 2026
85ff3f8
Remove soil sample selector after deletion, it was known but separati…
Duncan-Brain Mar 24, 2026
e1d1133
WIP Make reusable component skeleton that works for Barn
Duncan-Brain Mar 24, 2026
e65d903
refactor and create util for component reuse
Duncan-Brain Mar 24, 2026
e193a7f
Fix surface water properties picked
Duncan-Brain Mar 24, 2026
a03c6ba
Generic components work for all areas in edit and post
Duncan-Brain Mar 24, 2026
08af12c
Update geneirc componetns for lines
Duncan-Brain Mar 24, 2026
198d4e4
Adapt generic wrapper for use with points
Duncan-Brain Mar 24, 2026
22beaa5
Make on cancel not a boolean to handle type error
Duncan-Brain Mar 24, 2026
1a57c51
Use generic component in container, delete unused files
Duncan-Brain Mar 24, 2026
7dd1d96
Move area line and point details files
Duncan-Brain Mar 24, 2026
8b1f07b
Replace duplicative stories with combined story and rtk store for new…
Duncan-Brain Mar 25, 2026
ca152a0
Add missing reducers causing storybook crash on new stories using state
Duncan-Brain Mar 25, 2026
93d771b
remove location type reducers
Duncan-Brain Mar 25, 2026
737681c
export types for location stories util
Duncan-Brain Mar 25, 2026
fee73b6
Remove warning box now that snackbars are used
Duncan-Brain Mar 25, 2026
620e6e3
Warningbox would show for all errors, lets not do that actually
Duncan-Brain Mar 25, 2026
ca3ed02
Replace Barn
Duncan-Brain Mar 25, 2026
bc6c186
remove unnecessary dispatch
Duncan-Brain Mar 25, 2026
9eadc0f
move files up a folder
Duncan-Brain Mar 25, 2026
22a4296
Merge branch 'integration' into rtk-upgrade/locations-2-location-details
Duncan-Brain May 7, 2026
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
111 changes: 21 additions & 90 deletions packages/webapp/.storybook/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -1383,96 +1383,6 @@ export default {
},
},
},
barnReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
ceremonialReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
farmSiteBoundaryReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
fieldReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
gardenReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
greenhouseReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
surfaceWaterReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
naturalAreaReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
residenceReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
bufferZoneReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
watercourseReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
fenceReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
gateReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
waterValveReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
soilSampleLocationReducer: {
ids: [],
entities: {},
loading: false,
loaded: false,
},
showedSpotlightReducer: {
loaded: true,
loading: false,
Expand Down Expand Up @@ -1708,6 +1618,13 @@ export default {
loading: false,
loaded: false,
},
irrigationTaskReducer: {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing some reducers...

ids: [],
entities: {},
loading: false,
error: null,
loaded: false,
},
irrigationTaskTypesReducer: {
irrigationTaskTypes: [
{
Expand Down Expand Up @@ -1746,6 +1663,20 @@ export default {
ids: [],
entities: {},
},
animalMovementTaskReducer: {
ids: [],
entities: {},
loading: false,
error: null,
loaded: false,
},
soilSampleTaskReducer: {
ids: [],
entities: {},
loading: false,
error: null,
loaded: false,
},
},
persistedStateReducer: {
userLogReducer: {
Expand Down
1 change: 1 addition & 0 deletions packages/webapp/public/locales/en/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"MAP": {
"FAIL_PATCH": "Failed to update",
"FAIL_POST": "Failed to add new",
"FAIL_DELETE": "Failed to retire",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using snackbars instead of WarningBox

"SUCCESS_DELETE": "Successfully retired",
"SUCCESS_PATCH": "Successfully updated",
"SUCCESS_POST": "Successfully saved"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useFormContext } from 'react-hook-form';
import Input from '../../Form/Input';
import PureWarningBox from '../../WarningBox';
import { Label } from '../../Typography';
import Unit from '../../Form/Unit';
import { fieldEnum as areaEnum } from '../../../containers/constants';
import { area_perimeter, area_total_area } from '../../../util/convert-units/unit';
import InputAutoSize from '../../Form/InputAutoSize';
import Input from '../Form/Input';
import Unit from '../Form/Unit';
import { fieldEnum as areaEnum } from '../../containers/constants';
import { area_perimeter, area_total_area } from '../../util/convert-units/unit';
import InputAutoSize from '../Form/InputAutoSize';

export default function AreaDetails({
name,
showPerimeter,
history,
children,
system,
isCreateLocationPage,
Expand All @@ -30,31 +26,9 @@ export default function AreaDetails({
control,
formState: { errors },
} = useFormContext();
const [errorMessage, setErrorMessage] = useState();
useEffect(() => {
const handleOffline = () => setErrorMessage(t('FARM_MAP.AREA_DETAILS.NETWORK'));
const handleOnline = () => setErrorMessage(null);
window.addEventListener('offline', handleOffline);
window.addEventListener('online', handleOnline);
return () => {
window.removeEventListener('offline', handleOffline);
window.removeEventListener('online', handleOnline);
};
}, []);

useEffect(() => {
if (history?.location?.state?.error && !history?.location?.state?.error?.retire) {
setErrorMessage(history?.location?.state?.error);
}
}, [history?.location?.state?.error]);

return (
<>
{errorMessage && (
<PureWarningBox style={{ border: '1px solid var(--red700)', marginBottom: '48px' }}>
<Label style={{ marginBottom: '12px' }}>{errorMessage}</Label>
</PureWarningBox>
)}
<Input
data-cy="areaDetails-name"
label={`${name}`}
Expand Down

This file was deleted.

This file was deleted.

Loading