Skip to content

Commit 85d3d92

Browse files
committed
#1506 | Bug Fixes
Delete logs.txt
1 parent 2abcef9 commit 85d3d92

File tree

65 files changed

+1044
-2051
lines changed

Some content is hidden

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

65 files changed

+1044
-2051
lines changed

.circleci/config.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ commands:
100100
jobs:
101101
app_test:
102102
docker:
103-
- image: cimg/node:20.2.0
103+
- image: cimg/node:24.4.1
104104

105105
working_directory: ~/openchs-webapp
106106

@@ -113,7 +113,7 @@ jobs:
113113

114114
app_build:
115115
docker:
116-
- image: cimg/node:20.2.0
116+
- image: cimg/node:24.4.1
117117
resource_class: large
118118

119119
working_directory: ~/openchs-webapp
@@ -123,7 +123,9 @@ jobs:
123123

124124
- run: yarn install
125125

126-
- run: yarn run build
126+
- run:
127+
name: Build
128+
command: NODE_OPTIONS=--max_old_space_size=4096 yarn run build
127129

128130
- run: cd build; zip -r ../openchs-webapp.zip *
129131

@@ -234,7 +236,7 @@ jobs:
234236

235237
PERF_deploy:
236238
docker:
237-
- image: cimg/node:20.2.0
239+
- image: cimg/node:24.4.1
238240
working_directory: ~/
239241
steps:
240242
- aws-cli/setup:

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v24
1+
v24.4.1

logs.txt

Lines changed: 0 additions & 546 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"react-markdown": "^10.1.0",
6161
"react-redux": "^7.2.1",
6262
"react-router-dom": "^7.7.0",
63-
"react-select": "^3.0.8",
63+
"react-select": "^5.10.2",
6464
"react-show-more-text": "^1.5.2",
6565
"react-simple-code-editor": "^0.14.1",
6666
"react-tagsinput": "^3.19.0",
@@ -81,11 +81,11 @@
8181
},
8282
"scripts": {
8383
"analyze": "source-map-explorer 'build/static/js/*.js'",
84-
"start": "BACKEND_URL=http://localhost:8021 vite",
85-
"start-with-staging": "BACKEND_URL=https://staging.avniproject.org vite",
86-
"start-with-prerelease": "BACKEND_URL=https://prerelease.avniproject.org vite",
87-
"start-with-prod": "BACKEND_URL=https://app.avniproject.org vite",
88-
"start-with-rwb-prod": "BACKEND_URL=https://app.rwb.avniproject.org vite",
84+
"start": "NODE_OPTIONS=--max_old_space_size=4096 BACKEND_URL=http://localhost:8021 vite",
85+
"start-with-staging": "NODE_OPTIONS=--max_old_space_size=4096 BACKEND_URL=https://staging.avniproject.org vite",
86+
"start-with-prerelease": "NODE_OPTIONS=--max_old_space_size=4096 BACKEND_URL=https://prerelease.avniproject.org vite",
87+
"start-with-prod": "NODE_OPTIONS=--max_old_space_size=4096 BACKEND_URL=https://app.avniproject.org vite",
88+
"start-with-rwb-prod": "NODE_OPTIONS=--max_old_space_size=4096 BACKEND_URL=https://app.rwb.avniproject.org vite",
8989
"build": "vite build",
9090
"test": "NODE_OPTIONS='--experimental-vm-modules --max-old-space-size=4096' jest",
9191
"test:watch": "NODE_OPTIONS='--experimental-vm-modules' jest --watch ",

src/adminApp/AccountOrgAdminUser.jsx

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import {
1717
TextField,
1818
TextInput,
1919
required,
20-
useRecordContext
20+
useRecordContext,
21+
useResourceContext
2122
} from "react-admin";
2223
import { useFormContext, useWatch } from "react-hook-form";
2324
import CardActions from "@mui/material/CardActions";
@@ -49,7 +50,9 @@ export const AccountOrgAdminUserEdit = ({ user, region, ...props }) => (
4950
mutationMode="pessimistic"
5051
filter={{ searchURI: "orgAdmin" }}
5152
>
52-
<UserForm edit user={user} region={region} />
53+
<SimpleForm toolbar={<CustomToolbar />} redirect="list">
54+
<UserFormFields edit user={user} region={region} />
55+
</SimpleForm>
5356
</Edit>
5457
);
5558

@@ -82,12 +85,14 @@ export const AccountOrgAdminUserList = props => (
8285

8386
const CustomShowActions = () => {
8487
const record = useRecordContext();
88+
const resource = useResourceContext();
8589
return record ? (
8690
<CardActions style={{ zIndex: 2, display: "inline-block", float: "right" }}>
8791
<EditButton label="Edit User" />
8892
<EnableDisableButton
8993
disabled={record.disabledInCognito}
9094
record={record}
95+
resource={resource}
9196
/>
9297
</CardActions>
9398
) : null;
@@ -115,18 +120,29 @@ export const AccountOrgAdminUserDetail = ({ user, ...props }) => (
115120
source="accountIds"
116121
>
117122
<SingleFieldList>
118-
<TitleChip source="name" />
123+
<TitleChip />
119124
</SingleFieldList>
120125
</ReferenceArrayField>
121126
</SimpleShowLayout>
122127
</Show>
123128
);
124129

125130
const UserForm = ({ edit = false, region }) => {
131+
return (
132+
<SimpleForm toolbar={<CustomToolbar />} redirect="list">
133+
<UserFormFields edit={edit} region={region} />
134+
</SimpleForm>
135+
);
136+
};
137+
138+
const UserFormFields = ({ edit = false, region }) => {
126139
const [nameSuffix, setNameSuffix] = useState("");
127-
const { control, setValue } = useFormContext();
140+
141+
const formContext = useFormContext();
142+
143+
const { control, setValue } = formContext;
128144
const organisationId = useWatch({ control, name: "organisationId" });
129-
const ignored = useWatch({ control, name: "ignored" });
145+
const username = useWatch({ control, name: "username" });
130146

131147
const autoComplete = ApplicationContext.isDevEnv() ? "on" : "off";
132148

@@ -139,13 +155,13 @@ const UserForm = ({ edit = false, region }) => {
139155
}, [organisationId]);
140156

141157
useEffect(() => {
142-
if (ignored && nameSuffix) {
143-
setValue("username", `${ignored}@${nameSuffix}`);
158+
if (username && nameSuffix && setValue) {
159+
setValue("username", `${username}@${nameSuffix}`);
144160
}
145-
}, [ignored, nameSuffix, setValue]);
161+
}, [username, nameSuffix, setValue]);
146162

147163
return (
148-
<SimpleForm toolbar={<CustomToolbar />} redirect="list">
164+
<>
149165
<ReferenceArrayInput
150166
reference="account"
151167
source="accountIds"
@@ -158,19 +174,24 @@ const UserForm = ({ edit = false, region }) => {
158174
</ReferenceArrayInput>
159175

160176
{edit ? (
161-
<TextInput
162-
disabled
163-
source="username"
164-
label="Login ID (admin username)"
165-
/>
177+
<>
178+
<TextInput
179+
disabled
180+
source="username"
181+
label="Login ID (admin username)"
182+
/>
183+
{/* Hidden field to ensure username is included in payload */}
184+
<TextInput source="username" style={{ display: "none" }} />
185+
</>
166186
) : (
167187
<>
168188
<TextInput
169-
source="ignored"
189+
source="username"
170190
validate={isRequired}
171191
label="Login ID (username)"
172192
/>
173193
{nameSuffix && <span>@{nameSuffix}</span>}
194+
<TextInput source="username" style={{ display: "none" }} />
174195
</>
175196
)}
176197

@@ -192,6 +213,6 @@ const UserForm = ({ edit = false, region }) => {
192213
validate={getPhoneValidator(region)}
193214
autoComplete={autoComplete}
194215
/>
195-
</SimpleForm>
216+
</>
196217
);
197218
};

src/adminApp/ApplicationMenu/ApplicationMenuEdit.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useReducer, useState } from "react";
2-
import { Navigate } from "react-router-dom";
2+
import { Navigate, useParams } from "react-router-dom";
33
import Box from "@mui/material/Box";
44
import { Title } from "react-admin";
55
import Button from "@mui/material/Button";
@@ -14,7 +14,8 @@ import ApplicationMenuService from "../service/ApplicationMenuService";
1414
import _ from "lodash";
1515
import FormLabel from "@mui/material/FormLabel";
1616

17-
const ApplicationMenuEdit = props => {
17+
const ApplicationMenuEdit = () => {
18+
const { id } = useParams();
1819
const [state, dispatch] = useReducer(
1920
ApplicationMenuReducer.execute,
2021
ApplicationMenuReducer.createApplicationMenuInitialState()
@@ -23,12 +24,12 @@ const ApplicationMenuEdit = props => {
2324
const [deleteAlert, setDeleteAlert] = useState(false);
2425

2526
function isCreate() {
26-
return _.isEmpty(props.match.params.id);
27+
return _.isEmpty(id);
2728
}
2829

2930
useEffect(() => {
3031
if (!isCreate())
31-
ApplicationMenuService.getMenuItem(props.match.params.id).then(menuItem =>
32+
ApplicationMenuService.getMenuItem(id).then(menuItem =>
3233
dispatch({
3334
type: ApplicationMenuReducer.INITIAL_MENU_ITEM,
3435
payload: menuItem
@@ -121,7 +122,7 @@ const ApplicationMenuEdit = props => {
121122
<SaveComponent
122123
name="save"
123124
onSubmit={onSubmit}
124-
styleClass={{ marginLeft: "14px" }}
125+
styles={{ marginLeft: "14px" }}
125126
/>
126127
</Grid>
127128
{!isCreate() && (
@@ -138,7 +139,7 @@ const ApplicationMenuEdit = props => {
138139
onClick={() =>
139140
EntityEditUtil.onDelete(
140141
"menuItem",
141-
props.match.params.id,
142+
id,
142143
"application menu",
143144
() => setDeleteAlert(true)
144145
)
@@ -155,7 +156,7 @@ const ApplicationMenuEdit = props => {
155156
to={
156157
isCreate()
157158
? "/appDesigner/applicationMenu"
158-
: `/appDesigner/applicationMenu/${props.match.params.id}/show`
159+
: `/appDesigner/applicationMenu/${id}/show`
159160
}
160161
/>
161162
)}

src/adminApp/ApplicationMenu/ApplicationMenuList.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ const ApplicationMenuList = () => {
5858
);
5959

6060
const fetchData = useMemo(
61-
() => ({ page, pageSize }) =>
61+
() => () =>
6262
new Promise(resolve =>
6363
ApplicationMenuService.getMenuList().then(response => {
64-
const data = response.content || [];
65-
const start = page * pageSize;
66-
const paginatedData = data.slice(start, start + pageSize);
6764
resolve({
68-
data: paginatedData,
69-
totalCount: data.length
65+
data: response.data,
66+
page: response.page,
67+
totalCount: response.totalCount
7068
});
7169
})
7270
),

src/adminApp/CustomFilters.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ const CustomFilters = ({ organisation, filename }) => {
175175
filterType,
176176
selectedFilter: row.original,
177177
settings,
178-
omitTableData,
179178
operationalModules,
180179
title,
181180
worklistUpdationRule,
@@ -286,7 +285,6 @@ const CustomFilters = ({ organisation, filename }) => {
286285
filterType: typeOfFilter,
287286
selectedFilter: null,
288287
settings,
289-
omitTableData,
290288
operationalModules,
291289
title: `Add ${_.startCase(typeOfFilter)}`,
292290
worklistUpdationRule,

src/adminApp/DeploymentManager.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useSelector, useDispatch } from "react-redux";
55

66
import { authProvider, dataProvider, LogoutButton } from "./react-admin-config";
77
import { WithProps } from "../common/components/utils";
8-
import customRoutes from "./customRoutes";
98
import AdminLayout from "../common/components/AdminLayout";
109
import { getAdminOrgs } from "../rootApp/ducks";
1110

@@ -38,7 +37,6 @@ const DeploymentManager = () => {
3837
const dispatch = useDispatch();
3938
const user = useSelector(state => state.app.authSession);
4039
const userInfo = useSelector(state => state.app.userInfo);
41-
const organisations = useSelector(state => state.app.organisations);
4240

4341
useEffect(() => {
4442
dispatch(getAdminOrgs());
@@ -49,7 +47,6 @@ const DeploymentManager = () => {
4947
authProvider={authProvider}
5048
dataProvider={dataProvider}
5149
logoutButton={WithProps({ user }, LogoutButton)}
52-
customRoutes={customRoutes}
5350
layout={AdminLayout}
5451
basename="/admin"
5552
darkTheme={null}

0 commit comments

Comments
 (0)