Skip to content

Commit 58c891c

Browse files
committed
Merge branch 'release-1.0.101'
2 parents f01ac4c + c5c3189 commit 58c891c

18 files changed

Lines changed: 1122 additions & 181 deletions

client/package-lock.json

Lines changed: 9 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "foodoasis-client",
33
"description": "React Client for Food Oasis",
4-
"version": "1.0.100",
4+
"version": "1.0.101",
55
"author": "Hack for LA",
66
"license": "GPL-2.0",
77
"private": true,

client/src/Routes.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useWidget } from "./appReducer";
1111
import useFeatureFlag from "./hooks/useFeatureFlag";
1212
import SurveySnackbar from "./components/UI/SurveySnackbar";
1313
import AnnouncementSnackbar from "components/UI/AnnouncementSnackbar";
14+
import ScrollToTop from "./components/ScrollToTop";
1415

1516
const VerificationAdmin = lazy(() =>
1617
import("components/Admin/VerificationAdmin")
@@ -116,6 +117,16 @@ export default function AppRoutes() {
116117
/>
117118
<Route path="resetPassword/:token" element={<ResetPassword />} />
118119

120+
<Route
121+
path="organizationedit"
122+
element={
123+
<PrivateRoute
124+
roles={["isAdmin", "isDataEntry", "isCoordinator"]}
125+
>
126+
<OrganizationEdit />
127+
</PrivateRoute>
128+
}
129+
/>
119130
<Route
120131
path="organizationedit/:id"
121132
element={
@@ -231,6 +242,7 @@ function AppWrapper() {
231242
wrap="nowrap"
232243
alignContent="stretch"
233244
spacing={0}
245+
id="app-container"
234246
sx={{
235247
color: "black",
236248
backgroundColor: "#fff",
@@ -239,6 +251,7 @@ function AppWrapper() {
239251
overflowX: "hidden",
240252
}}
241253
>
254+
<ScrollToTop />
242255
{isAlertLocation && <AnnouncementSnackbar />}
243256

244257
{isWidget ? null : <Header />}

client/src/components/Admin/OrganizationEdit.jsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ import {
4444
TENANT_ID,
4545
} from "../../helpers/Constants";
4646
import { useSuggestionByStakeholderId } from "hooks/useSuggestionByStakeholderId";
47+
import { useStakeholderLog } from "hooks/useStakeholderLog";
4748
import SuggestionHistory from "./OrganizationEdit/SuggestionHistory";
49+
import ChangeHistory from "./OrganizationEdit/ChangeHistory";
4850

4951
const phoneRegExp = /^\(\d{3}\) \d{3}-\d{4}$/;
5052

@@ -169,6 +171,7 @@ const emptyOrganization = {
169171
submittedUser: "",
170172
approvedDate: "",
171173
approvedUser: "",
174+
neighborhoodName: "",
172175
selectedCategoryIds: [],
173176
hours: [],
174177
instagram: "",
@@ -226,11 +229,17 @@ const OrganizationEdit = (props) => {
226229
const { data: stakeholderSuggestions, refetch: refetchSuggestions } =
227230
useSuggestionByStakeholderId(editId);
228231

232+
const {
233+
data: versionHistory,
234+
loading: historyLoading,
235+
error: historyError,
236+
} = useStakeholderLog(editId);
237+
229238
useEffect(() => {
230239
const fetchData = async () => {
231240
try {
232241
if (editId) {
233-
const stakeholder = await stakeholderService.getById(editId);
242+
const stakeholder = await stakeholderService.getById(editId);
234243
// For editing purposes, it is better to convert the
235244
// stakeholder.categories array of objects to an array of
236245
// categoryIds as stakeholder.categoryIds
@@ -561,6 +570,9 @@ const OrganizationEdit = (props) => {
561570
<Tab label="Donations" {...a11yProps(4)} />
562571
<Tab label="Verification" {...a11yProps(5)} />
563572
<Tab label="Suggestion History" {...a11yProps(6)} />
573+
{(user?.isAdmin || user?.isCoordinator) && (
574+
<Tab label="Change History" {...a11yProps(7)} />
575+
)}
564576
</Tabs>
565577
</AppBar>
566578
<Identification
@@ -623,6 +635,14 @@ const OrganizationEdit = (props) => {
623635
editedSuggestions={editedSuggestions}
624636
onEdit={handleSuggestionEdit}
625637
/>
638+
{(user?.isAdmin || user?.isCoordinator) && (
639+
<ChangeHistory
640+
tabPage={tabPage}
641+
versions={versionHistory}
642+
loading={historyLoading}
643+
error={historyError}
644+
/>
645+
)}
626646
</Box>
627647
<Stack direction="row">
628648
<div style={{ flexBasis: "20%", flexGrow: 1 }}>

0 commit comments

Comments
 (0)