Skip to content

Commit e7fb8bf

Browse files
authored
Merge pull request #299 from wri/release/jovial-jacaranda
[RELEASE] Jovial Jacaranda
2 parents 9a865fe + 91488a1 commit e7fb8bf

File tree

540 files changed

+34383
-5993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+34383
-5993
lines changed

.env.local.sample

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ SENTRY_AUTH_TOKEN =
1414
SENTRY_PROJECT =
1515
SENTRY_ORG =
1616

17-
17+
18+
NEXT_PUBLIC_GEOSERVER_URL =
19+
NEXT_PUBLIC_GEOSERVER_WORKSPACE =
20+

next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const nextConfig = {
1919
publicRuntimeConfig: {
2020
TxNativePublicToken: process.env.TRANSIFEX_TOKEN
2121
},
22-
images: { domains: process.env.IMAGE_DOMAINS?.split(',') ?? ["s3-eu-west-1.amazonaws.com"] },
22+
images: { domains: process.env.IMAGE_DOMAINS?.split(",") ?? ["s3-eu-west-1.amazonaws.com"] },
2323
// webpack5: true,
2424
webpack(config) {
2525
config.module.rules.push({

public/icons/ic-bg.svg

Lines changed: 26 additions & 0 deletions
Loading

public/images/no-image-available.png

9.57 KB
Loading

src/admin/apiProvider/dataProviders/formDataProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const handleOptionFilesUpload = async (response: NormalizedFormObject, payload:
5050
upload(payloadOption.image.rawFile, {
5151
collection: "image",
5252
model: "form-question-option",
53-
uuid: option.uuid
53+
uuid: option.id
5454
})
5555
);
5656
}

src/admin/apiProvider/utils/entryFormat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const isDateType = (value: any) => {
2626
return isValid(parseISO(value));
2727
};
2828

29-
const convertDateFormat = (value: any) => {
29+
export const convertDateFormat = (value: any) => {
3030
if (typeof value === "string") {
3131
const dateObject = new Date(value);
3232
const formattedDay = dateObject.getUTCDate().toString().padStart(2, "0");

src/admin/components/Actions/ListActions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ interface ListActionsProps {
88

99
const ListActions = (props: ListActionsProps) => (
1010
<TopToolbar>
11-
<FilterButton />
11+
<FilterButton className="filter-button-page-admin" />
1212
<When condition={!!props.onExport}>
13-
<Button label="Export" startIcon={<DownloadIcon />} onClick={props.onExport} />
13+
<Button className="button-page-admin" label="Export" startIcon={<DownloadIcon />} onClick={props.onExport} />
1414
</When>
1515
</TopToolbar>
1616
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import DownloadIcon from "@mui/icons-material/GetApp";
2+
import { Button, CreateButton, TopToolbar } from "react-admin";
3+
import { When } from "react-if";
4+
5+
interface ListActionsCreateProps {
6+
onExport?: () => void;
7+
}
8+
9+
const ListActionsCreate = ({ onExport }: ListActionsCreateProps) => (
10+
<TopToolbar>
11+
<CreateButton className="filter-button-page-admin" />
12+
<When condition={!!onExport}>
13+
<Button className="button-page-admin" label="Export" startIcon={<DownloadIcon />} onClick={onExport} />
14+
</When>
15+
</TopToolbar>
16+
);
17+
18+
export default ListActionsCreate;

src/admin/components/Actions/ShowActions.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ import {
44
DeleteWithConfirmButton,
55
DeleteWithConfirmButtonProps,
66
EditButton,
7+
Link,
78
RaRecord,
89
TopToolbar,
9-
useRecordContext
10+
useRecordContext,
11+
useResourceContext
1012
} from "react-admin";
1113
import { When } from "react-if";
1214

15+
import Icon, { IconNames } from "@/components/extensive/Icon/Icon";
16+
1317
import ShowTitle from "../ShowTitle";
1418

1519
interface IProps {
@@ -32,6 +36,7 @@ const ShowActions = ({
3236
deleteProps = {}
3337
}: IProps) => {
3438
const record = useRecordContext<any>();
39+
const resource = useResourceContext();
3540

3641
const title = titleSource ? get(record, titleSource) : "";
3742

@@ -42,17 +47,30 @@ const ShowActions = ({
4247

4348
return (
4449
<Box sx={{ display: "flex", alignItems: "center" }}>
50+
<When condition={resource === "siteReport" || resource === "nurseryReport"}>
51+
<Link to={`/${resource}`}>
52+
<Icon name={IconNames.CHEVRON_LEFT_PA} className="mr-2 h-10 w-9" />
53+
</Link>
54+
</When>
4555
<When condition={!!(title || getTitle)}>
4656
<Typography variant="h4" component="h2" sx={{ flexGrow: 1 }}>
4757
<ShowTitle moduleName={moduleName} getTitle={getTitle ? getTitle : () => title} />
4858
</Typography>
4959
</When>
5060
<TopToolbar sx={{ marginBottom: 2, marginLeft: "auto" }}>
5161
<When condition={record && hasDelete}>
52-
<DeleteWithConfirmButton {...deleteProps} mutationMode="undoable" />
62+
<DeleteWithConfirmButton
63+
{...deleteProps}
64+
mutationMode="undoable"
65+
className="!text-sm !font-semibold !capitalize lg:!text-base wide:!text-md"
66+
icon={<Icon className="h-5 w-5" name={IconNames.TRASH_PA} />}
67+
/>
5368
</When>
5469
<When condition={record && hasEdit}>
55-
<EditButton />
70+
<EditButton
71+
className="!text-sm !font-semibold !capitalize !text-blueCustom-900 lg:!text-base wide:!text-md"
72+
icon={<Icon className="h-6 w-6" name={IconNames.EDIT} />}
73+
/>
5674
</When>
5775
</TopToolbar>
5876
</Box>

src/admin/components/App.tsx

Lines changed: 123 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
import { WatchLater } from "@mui/icons-material";
2-
import ArticleIcon from "@mui/icons-material/Article";
3-
import AttachMoneyIcon from "@mui/icons-material/AttachMoney";
4-
import BusinessIcon from "@mui/icons-material/Business";
5-
import ForestIcon from "@mui/icons-material/Forest";
6-
import FullscreenIcon from "@mui/icons-material/Fullscreen";
7-
import UserIcon from "@mui/icons-material/Group";
8-
import LanguageIcon from "@mui/icons-material/Language";
9-
import LibraryBooksIcon from "@mui/icons-material/LibraryBooks";
101
import SummarizeIcon from "@mui/icons-material/Summarize";
112
import { useEffect, useState } from "react";
123
import { Admin, Resource } from "react-admin";
@@ -15,6 +6,8 @@ import { authProvider } from "@/admin/apiProvider/authProvider";
156
import { dataProvider } from "@/admin/apiProvider/dataProviders";
167
import { AppLayout } from "@/admin/components/AppLayout";
178
import { theme } from "@/admin/components/theme";
9+
import Icon, { IconNames } from "@/components/extensive/Icon/Icon";
10+
import { LoadingProvider } from "@/context/loaderAdmin.provider";
1811

1912
import modules from "../modules";
2013
import AdminLoginPage from "../pages/AdminLoginPage";
@@ -38,124 +31,127 @@ const App = () => {
3831
}, [identity]);
3932

4033
return (
41-
<Admin
42-
theme={theme}
43-
authProvider={authProvider}
44-
dataProvider={dataProvider}
45-
layout={AppLayout}
46-
loginPage={AdminLoginPage}
47-
>
48-
<Resource
49-
name={modules.user.ResourceName}
50-
list={modules.user.List}
51-
show={modules.user.Show}
52-
edit={modules.user.Edit}
53-
icon={UserIcon}
54-
/>
55-
<Resource
56-
name={modules.organisation.ResourceName}
57-
list={modules.organisation.List}
58-
show={modules.organisation.Show}
59-
edit={modules.organisation.Edit}
60-
icon={BusinessIcon}
61-
/>
62-
<Resource
63-
name={modules.pitch.ResourceName}
64-
list={modules.pitch.List}
65-
show={modules.pitch.Show}
66-
edit={modules.pitch.Edit}
67-
icon={ForestIcon}
68-
/>
69-
<Resource
70-
name={modules.fundingProgramme.ResourceName}
71-
list={modules.fundingProgramme.List}
72-
edit={modules.fundingProgramme.Edit}
73-
show={modules.fundingProgramme.Show}
74-
create={modules.fundingProgramme.Create}
75-
icon={AttachMoneyIcon}
76-
options={{ label: "Funding Programmes" }}
77-
/>
78-
<Resource
79-
name={modules.reportingFramework.ResourceName}
80-
list={modules.reportingFramework.List}
81-
show={modules.reportingFramework.Show}
82-
edit={modules.reportingFramework.Edit}
83-
{...(canCreate ? { create: modules.reportingFramework.Create } : null)}
84-
icon={WatchLater}
85-
options={{ label: "Reporting Frameworks" }}
86-
/>
87-
<Resource
88-
name={modules.application.ResourceName}
89-
list={modules.application.List}
90-
show={modules.application.Show}
91-
icon={LibraryBooksIcon}
92-
/>
93-
<Resource
94-
name={modules.stage.ResourceName}
95-
show={modules.stage.Show}
96-
edit={modules.stage.Edit}
97-
create={modules.stage.Create}
98-
/>
99-
<Resource
100-
name={modules.form.ResourceName}
101-
list={modules.form.List}
102-
edit={modules.form.Edit}
103-
create={modules.form.Create}
104-
/>
105-
<Resource
106-
name={modules.project.ResourceName}
107-
list={modules.project.List}
108-
show={modules.project.Show}
109-
edit={modules.project.Edit}
110-
icon={ArticleIcon}
111-
/>
112-
<Resource
113-
name={modules.site.ResourceName}
114-
list={modules.site.List}
115-
show={modules.site.Show}
116-
edit={modules.site.Edit}
117-
icon={LanguageIcon}
118-
/>
119-
<Resource
120-
name={modules.nursery.ResourceName}
121-
list={modules.nursery.List}
122-
show={modules.nursery.Show}
123-
edit={modules.nursery.Edit}
124-
icon={FullscreenIcon}
125-
/>
126-
<Resource
127-
name={modules.task.ResourceName}
128-
list={modules.task.List}
129-
show={modules.task.Show}
130-
icon={SummarizeIcon}
131-
options={{ label: "Tasks" }}
132-
/>
133-
<Resource
134-
name={modules.projectReport.ResourceName}
135-
list={modules.projectReport.List}
136-
show={modules.projectReport.Show}
137-
edit={modules.projectReport.Edit}
138-
icon={SummarizeIcon}
139-
options={{ label: "Project Reports" }}
140-
/>
141-
<Resource
142-
name={modules.siteReport.ResourceName}
143-
list={modules.siteReport.List}
144-
show={modules.siteReport.Show}
145-
edit={modules.siteReport.Edit}
146-
icon={SummarizeIcon}
147-
options={{ label: "Site Reports" }}
148-
/>
149-
<Resource
150-
name={modules.nurseryReport.ResourceName}
151-
list={modules.nurseryReport.List}
152-
show={modules.nurseryReport.Show}
153-
edit={modules.nurseryReport.Edit}
154-
icon={SummarizeIcon}
155-
options={{ label: "Nursery Reports" }}
156-
/>
157-
<Resource name={modules.audit.ResourceName} />
158-
</Admin>
34+
<LoadingProvider>
35+
<Admin
36+
theme={theme}
37+
authProvider={authProvider}
38+
dataProvider={dataProvider}
39+
layout={AppLayout}
40+
loginPage={AdminLoginPage}
41+
>
42+
<Resource
43+
name={modules.user.ResourceName}
44+
list={modules.user.List}
45+
show={modules.user.Show}
46+
edit={modules.user.Edit}
47+
icon={() => <Icon className="h-8 w-8" name={IconNames.USERS} />}
48+
/>
49+
<Resource
50+
name={modules.organisation.ResourceName}
51+
list={modules.organisation.List}
52+
show={modules.organisation.Show}
53+
edit={modules.organisation.Edit}
54+
icon={() => <Icon className="h-8 w-8" name={IconNames.ORGANISATIONS} />}
55+
/>
56+
<Resource
57+
name={modules.pitch.ResourceName}
58+
list={modules.pitch.List}
59+
show={modules.pitch.Show}
60+
edit={modules.pitch.Edit}
61+
icon={() => <Icon className="h-8 w-8" name={IconNames.PITCHES} />}
62+
/>
63+
<Resource
64+
name={modules.fundingProgramme.ResourceName}
65+
list={modules.fundingProgramme.List}
66+
edit={modules.fundingProgramme.Edit}
67+
show={modules.fundingProgramme.Show}
68+
create={modules.fundingProgramme.Create}
69+
icon={() => <Icon className="h-8 w-8" name={IconNames.FUNDING_PROGRAMMES} />}
70+
options={{ label: "Funding Programmes" }}
71+
/>
72+
<Resource
73+
name={modules.reportingFramework.ResourceName}
74+
list={modules.reportingFramework.List}
75+
show={modules.reportingFramework.Show}
76+
edit={modules.reportingFramework.Edit}
77+
{...(canCreate ? { create: modules.reportingFramework.Create } : null)}
78+
icon={() => <Icon className="h-8 w-8" name={IconNames.REPORTING_FRAMEWORKS} />}
79+
options={{ label: "Reporting Frameworks" }}
80+
/>
81+
<Resource
82+
name={modules.application.ResourceName}
83+
list={modules.application.List}
84+
show={modules.application.Show}
85+
icon={() => <Icon className="h-8 w-8" name={IconNames.APPLICATIONS} />}
86+
/>
87+
<Resource
88+
name={modules.stage.ResourceName}
89+
show={modules.stage.Show}
90+
edit={modules.stage.Edit}
91+
create={modules.stage.Create}
92+
/>
93+
<Resource
94+
name={modules.form.ResourceName}
95+
list={modules.form.List}
96+
edit={modules.form.Edit}
97+
icon={() => <Icon className="h-8 w-8" name={IconNames.FORMS} />}
98+
create={modules.form.Create}
99+
/>
100+
<Resource
101+
name={modules.project.ResourceName}
102+
list={modules.project.List}
103+
show={modules.project.Show}
104+
edit={modules.project.Edit}
105+
icon={() => <Icon className="h-8 w-8" name={IconNames.PROJECTS} />}
106+
/>
107+
<Resource
108+
name={modules.site.ResourceName}
109+
list={modules.site.List}
110+
show={modules.site.Show}
111+
edit={modules.site.Edit}
112+
icon={() => <Icon className="h-8 w-8" name={IconNames.SITES} />}
113+
/>
114+
<Resource
115+
name={modules.nursery.ResourceName}
116+
list={modules.nursery.List}
117+
show={modules.nursery.Show}
118+
edit={modules.nursery.Edit}
119+
icon={() => <Icon className="h-8 w-8" name={IconNames.NURSERIES} />}
120+
/>
121+
<Resource
122+
name={modules.task.ResourceName}
123+
list={modules.task.List}
124+
show={modules.task.Show}
125+
icon={SummarizeIcon}
126+
options={{ label: "Tasks" }}
127+
/>
128+
<Resource
129+
name={modules.projectReport.ResourceName}
130+
list={modules.projectReport.List}
131+
show={modules.projectReport.Show}
132+
edit={modules.projectReport.Edit}
133+
icon={() => <Icon className="h-8 w-8" name={IconNames.REPORTS} />}
134+
options={{ label: "Project Reports" }}
135+
/>
136+
<Resource
137+
name={modules.siteReport.ResourceName}
138+
list={modules.siteReport.List}
139+
show={modules.siteReport.Show}
140+
edit={modules.siteReport.Edit}
141+
icon={() => <Icon className="h-8 w-8" name={IconNames.REPORTS} />}
142+
options={{ label: "Site Reports" }}
143+
/>
144+
<Resource
145+
name={modules.nurseryReport.ResourceName}
146+
list={modules.nurseryReport.List}
147+
show={modules.nurseryReport.Show}
148+
edit={modules.nurseryReport.Edit}
149+
icon={() => <Icon className="h-8 w-8" name={IconNames.REPORTS} />}
150+
options={{ label: "Nursery Reports" }}
151+
/>
152+
<Resource name={modules.audit.ResourceName} />
153+
</Admin>
154+
</LoadingProvider>
159155
);
160156
};
161157

0 commit comments

Comments
 (0)