Skip to content

Commit 930df4a

Browse files
authored
Merge branch 'dev' into CU-86bznypcf_Notifications-End-To-End-Testing
2 parents 7e212e1 + acd5d0a commit 930df4a

File tree

18 files changed

+114
-67
lines changed

18 files changed

+114
-67
lines changed

JeMPI_Apps/JeMPI_API/src/main/resources/application.conf

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ akka.http {
88
linger-timeout = 5 s
99
parsing {
1010
max-to-strict-bytes = 128m
11+
max-to-strict-bytes = ${?JEMPI_FILE_IMPORT_MAX_SIZE_BYTE}
1112
}
1213
}
1314
}

JeMPI_Apps/JeMPI_API_KC/src/main/java/org/jembi/jempi/api/httpServer/httpServerRoutes/routes/UserRoutes.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.jembi.jempi.api.keyCloak.KeyCloakAuthenticator;
1313
import org.jembi.jempi.api.keyCloak.OAuthCodeRequestPayload;
1414
import org.jembi.jempi.api.user.UserSession;
15+
import org.jembi.jempi.libapi.Routes;
1516
import org.jembi.jempi.libmpi.MpiServiceError;
1617
import org.jembi.jempi.shared.models.GlobalConstants;
1718

@@ -82,7 +83,10 @@ private Route routeLogout() {
8283
public Route getRouteEntries() {
8384
return concat(post(() -> path(GlobalConstants.SEGMENT_VALIDATE_OAUTH, () -> routeLoginWithKeycloakRequest(checkHeader))),
8485
get(() -> concat(path(GlobalConstants.SEGMENT_CURRENT_USER, this::routeCurrentUser),
85-
path(GlobalConstants.SEGMENT_LOGOUT, this::routeLogout)))
86+
path(GlobalConstants.SEGMENT_LOGOUT, this::routeLogout),
87+
path(GlobalConstants.SEGMENT_GET_CONFIGURATION,
88+
() -> Routes.getConfiguration(this.httpServer.getActorSystem(),
89+
this.httpServer.getBackEnd()))))
8690

8791
);
8892
}

JeMPI_Apps/JeMPI_API_KC/src/main/resources/application.conf

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ akka.http {
66
idle-timeout = 10 s
77
request-timeout = 5 s
88
linger-timeout = 5 s
9+
parsing {
10+
max-to-strict-bytes = 128m
11+
max-to-strict-bytes = ${?JEMPI_FILE_IMPORT_MAX_SIZE_BYTE}
12+
}
913
}
1014
}
1115

JeMPI_Apps/JeMPI_LibAPI/src/main/java/org/jembi/jempi/libapi/Routes.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ private static CompletionStage<Boolean> processOnNotificationResolution(
536536

537537
}
538538

539-
private static Route getConfiguration(
539+
public static Route getConfiguration(
540540
final ActorSystem<Void> actorSystem,
541541
final ActorRef<BackEnd.Event> backEnd) {
542542
return onComplete(Ask.getConfiguration(actorSystem, backEnd),

JeMPI_Apps/JeMPI_UI/src/components/browseRecords/BrowseRecords.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import getCellComponent from 'components/shared/getCellComponent'
4848
import { useNavigate, useSearchParams } from 'react-router-dom'
4949
import { Search } from '@mui/icons-material'
5050
import { useConfig } from 'hooks/useConfig'
51-
import CustomPagination from 'components/shared/CustomDataGridPagination'
5251

5352
// TODO: Later - We can update this at a later stage, such the field configuration info can contain the getAlignment, since this can be dynamic
5453
const getAlignment = (fieldName: string) =>
@@ -339,7 +338,7 @@ const Records = () => {
339338
page: filterPayload.offset / filterPayload.limit,
340339
pageSize: filterPayload.limit
341340
}}
342-
slots={{ pagination: CustomPagination }}
341+
// slots={{ pagination: CustomPagination }}
343342
columns={columns}
344343
rows={rows}
345344
pageSizeOptions={[25, 50, 100]}

JeMPI_Apps/JeMPI_UI/src/components/notificationWorklist/NotificationWorklist.tsx

+28-26
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
Divider,
77
Paper,
88
Stack,
9+
TextField,
10+
TextFieldProps,
911
debounce
1012
} from '@mui/material'
1113
import { DataGrid, GridFilterModel, gridClasses } from '@mui/x-data-grid'
@@ -18,13 +20,12 @@ import Notification, {
1820
Notifications
1921
} from '../../types/Notification'
2022
import PageHeader from '../shell/PageHeader'
21-
import { useCallback, useEffect, useState } from 'react'
23+
import { useCallback, useState } from 'react'
2224
import dayjs, { Dayjs } from 'dayjs'
2325
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
2426
import NOTIFICATIONS_COLUMNS from './notificationsColumns'
2527
import { useNavigate } from 'react-router-dom'
2628
import { useConfig } from 'hooks/useConfig'
27-
import CustomPagination from 'components/shared/CustomDataGridPagination'
2829
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker'
2930
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
3031
import SelectDropdown from 'components/shared/SelectDropdown'
@@ -96,29 +97,22 @@ const NotificationWorklist = () => {
9697
paddingY={'1rem'}
9798
flexDirection={{ xs: 'column', md: 'row' }}
9899
>
99-
<DateTimePicker
100-
value={startDateFilter}
101-
format="YYYY/MM/DD HH:mm:ss"
102-
onChange={value => value && setStartDateFilter(value)}
103-
slotProps={{
104-
textField: {
105-
variant: 'outlined',
106-
label: 'Start Date',
107-
inputProps: { id: 'start-date-filter' }
108-
}
109-
}}
100+
< DateTimePicker
101+
label="Start Date"
102+
value={startDateFilter}
103+
onChange={(newValue) => newValue && setStartDateFilter(newValue)}
104+
slots={{
105+
textField: (params) => CustomTextField(params, 'start-date-filter'),
106+
}}
110107
/>
111-
<DateTimePicker
112-
value={endDateFilter}
113-
format="YYYY/MM/DD HH:mm:ss"
114-
onChange={value => value && setEndDateFilter(value)}
115-
slotProps={{
116-
textField: {
117-
variant: 'outlined',
118-
label: 'End Date',
119-
inputProps: { id: 'end-date-filter' }
120-
}
121-
}}
108+
109+
< DateTimePicker
110+
label="End Date"
111+
value={endDateFilter}
112+
onChange={(newValue) => newValue && setEndDateFilter(newValue)}
113+
slots={{
114+
textField: (params) => CustomTextField(params, 'end-date-filter'),
115+
}}
122116
/>
123117
<SelectDropdown
124118
listValues={[
@@ -178,7 +172,7 @@ const NotificationWorklist = () => {
178172
}}
179173
columns={NOTIFICATIONS_COLUMNS}
180174
rows={data.records as Notification[]}
181-
slots={{ pagination: CustomPagination }}
175+
// slots={{ pagination: CustomPagination }}
182176
pageSizeOptions={[25, 50, 100]}
183177
paginationModel={paginationModel}
184178
onPaginationModelChange={model => setPaginationModel(model)}
@@ -219,4 +213,12 @@ const NotificationWorklist = () => {
219213
)
220214
}
221215

222-
export default NotificationWorklist
216+
export default NotificationWorklist;
217+
218+
function CustomTextField(params: TextFieldProps, id: string) {
219+
return (
220+
<TextField variant='outlined'
221+
label="End Date"
222+
inputProps={{ id: id }}{...params} />
223+
);
224+
}
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,55 @@
1-
import { GridPagination } from '@mui/x-data-grid'
2-
import MuiPagination from '@mui/material/Pagination'
1+
import React, { forwardRef } from 'react';
2+
import { GridPagination } from '@mui/x-data-grid';
3+
import MuiPagination from '@mui/material/Pagination';
4+
import { TablePaginationProps as MuiTablePaginationProps } from '@mui/material/TablePagination';
5+
6+
interface PaginationProps {
7+
count: number;
8+
page: number;
9+
rowsPerPage: number;
10+
onPageChange: (
11+
event: React.MouseEvent<HTMLElement> | React.ChangeEvent<unknown> | null,
12+
page: number
13+
) => void;
14+
boundaryCount?: number;
15+
}
316

417
const Pagination = ({
518
count,
619
page,
720
rowsPerPage,
821
onPageChange,
9-
boundaryCount,
22+
boundaryCount = 2,
1023
...other
11-
}: // eslint-disable-next-line @typescript-eslint/no-explicit-any
12-
any) => {
13-
const pagesCount = Math.ceil(count / rowsPerPage)
24+
}: PaginationProps) => {
25+
const pagesCount = Math.ceil(count / rowsPerPage);
1426

1527
return (
1628
<MuiPagination
1729
count={pagesCount}
1830
page={page + 1}
1931
boundaryCount={boundaryCount}
2032
onChange={(event, page) => {
21-
onPageChange(event, page - 1)
33+
onPageChange(event as React.ChangeEvent<unknown>, page - 1);
2234
}}
2335
{...other}
2436
/>
25-
)
26-
}
37+
);
38+
};
2739

28-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
29-
function CustomPagination(props: any) {
30-
return <GridPagination ActionsComponent={Pagination} {...props} />
31-
}
40+
export const CustomPagination = forwardRef<HTMLDivElement, MuiTablePaginationProps>((props, ref) => {
41+
const { slotProps, ...rest } = props;
42+
43+
return (
44+
<GridPagination
45+
ActionsComponent={(subProps: any) => <Pagination {...subProps} />}
46+
ref={ref as any}
47+
slotProps={slotProps}
48+
{...rest}
49+
/>
50+
);
51+
});
52+
53+
CustomPagination.displayName = 'CustomPagination';
3254

33-
export default CustomPagination
55+
export default CustomPagination;

JeMPI_Apps/JeMPI_UI/src/components/shell/NavigationBar.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const NavigationBar = () => {
6262
const handleDrawerToggle = () => {
6363
setMobileOpen(prevState => !prevState)
6464
}
65+
6566
const drawer = (
6667
<>
6768
{config.showBrandLogo && (
@@ -89,7 +90,7 @@ const NavigationBar = () => {
8990
>
9091
{navigationItems.map(item => (
9192
<LabeledIconBox
92-
key={item.label}
93+
key={item.label}
9394
icon={item.icon}
9495
label={item.label}
9596
link={item.link}
@@ -158,12 +159,12 @@ const NavigationBar = () => {
158159
>
159160
{navigationItems.map((item, index) => (
160161
<Box
162+
key={item.label}
161163
sx={{
162164
ml: index < navigationItems.length - 1 ? 0 : 'auto'
163165
}}
164166
>
165167
<LabeledIconBox
166-
key={item.label}
167168
icon={item.icon}
168169
label={item.label}
169170
link={item.link}

JeMPI_Apps/JeMPI_UI/src/pages/settings/deterministic/BasicTabs.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ export function CustomTabPanel(props: TabPanelProps) {
2121
>
2222
{value === index && (
2323
<Box sx={{ py: 3, backgroundColor: '#f5f5f5' }}>
24-
<Typography>{children}</Typography>
24+
{React.Children.map(children, child => {
25+
if (typeof child === 'string' || typeof child === 'number') {
26+
return <Typography>{child}</Typography>
27+
}
28+
return child
29+
})}
2530
</Box>
2631
)}
2732
</div>

JeMPI_Apps/JeMPI_UI/src/pages/settings/interactiveNode/InteractiveNode.tsx

+13-11
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ const InteractiveNode = () => {
2626
endPlug: 'behind',
2727
path: 'straight'
2828
}
29-
)
30-
29+
);
3130
const newLine2 = new window.LeaderLine(
3231
document.getElementById('end1'),
3332
document.getElementById('start2'),
@@ -37,8 +36,7 @@ const InteractiveNode = () => {
3736
endPlug: 'behind',
3837
path: 'straight'
3938
}
40-
)
41-
39+
);
4240
const newLine3 = new window.LeaderLine(
4341
document.getElementById('start1'),
4442
document.getElementById('start2'),
@@ -49,15 +47,19 @@ const InteractiveNode = () => {
4947
endPlug: 'behind',
5048
dash: true
5149
}
52-
)
53-
54-
setLine1(newLine1)
55-
setLine2(newLine2)
56-
setLine3(newLine3)
50+
);
51+
setLine1(newLine1);
52+
setLine2(newLine2);
53+
setLine3(newLine3);
54+
return () => {
55+
newLine1.remove();
56+
newLine2.remove();
57+
newLine3.remove();
58+
};
5759
} else {
58-
console.error('LeaderLine library not loaded!')
60+
console.error('LeaderLine library not loaded!');
5961
}
60-
}, [])
62+
}, []);
6163

6264
const handleDrag = () => {
6365
if (line1) line1.position()

JeMPI_Apps/JeMPI_UI/src/pages/settings/probabilistic/Probabilistic.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Typography, Grid, TextField, Slider } from '@mui/material'
1+
import { Typography, Grid, TextField, Slider, Button } from '@mui/material'
22
import { Box } from '@mui/system'
33
import { Form, Formik } from 'formik'
44
import {
@@ -8,7 +8,6 @@ import {
88
} from './ProbabilisticConstants'
99
import { useConfiguration } from 'hooks/useUIConfiguration'
1010
import { Configuration } from 'types/Configuration'
11-
import { LoadingButton } from '@mui/lab'
1211
import { useEffect, useState } from 'react'
1312
import { useSnackbar } from 'notistack'
1413

@@ -320,15 +319,15 @@ const Probabilistic = () => {
320319
</Grid>
321320

322321
<Box sx={{ marginTop: '20px' }}>
323-
<LoadingButton
322+
<Button
324323
type="submit"
325324
variant="contained"
326325
color="primary"
327-
loadingPosition="start"
326+
328327
disabled={isSubmitting}
329328
>
330329
Save
331-
</LoadingButton>
330+
</Button>
332331
</Box>
333332
</Form>
334333
</Box>

devops/linux/docker/conf/env/create-env-linux-high-1.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export KC_JEMPI_CLIENT_ID="jempi-oauth"
6565
export KC_JEMPI_CLIENT_SECRET="Nsuhj2lQiCgSE7eVPLBgnLEEeaijufeh"
6666
export KC_JEMPI_ROOT_URL="http://localhost:3000"
6767
export JEMPI_SESSION_SECRET="c05ll3lesrinf39t7mc5h6un6r0c69lgfno69dsak3vabeqamouq4328cuaekros401ajdpkh60rrt"
68-
export JEMPI_FILE_IMPORT_MAX_SIZE_BYTE=10485760
68+
export JEMPI_FILE_IMPORT_MAX_SIZE_BYTE=128m
6969
# Deployment related env vars
7070
export JEMPI_SESSION_SECURE="false"
7171
export JEMPI_SESSION_DOMAIN_NAME="localhost"

devops/linux/docker/conf/env/create-env-linux-low-1.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export KC_JEMPI_CLIENT_ID="jempi-oauth"
5151
export KC_JEMPI_CLIENT_SECRET="Nsuhj2lQiCgSE7eVPLBgnLEEeaijufeh"
5252
export KC_JEMPI_ROOT_URL="http://localhost:3000"
5353
export JEMPI_SESSION_SECRET="c05ll3lesrinf39t7mc5h6un6r0c69lgfno69dsak3vabeqamouq4328cuaekros401ajdpkh60rrt"
54-
export JEMPI_FILE_IMPORT_MAX_SIZE_BYTE=10485760
54+
export JEMPI_FILE_IMPORT_MAX_SIZE_BYTE=128m
5555
# Deployment related env vars
5656
export JEMPI_SESSION_SECURE="false"
5757
export JEMPI_SESSION_DOMAIN_NAME="localhost"

devops/linux/docker/conf/stack/docker-stack-high-0.yml

+2
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ services:
664664
API_CONFIG_REFERENCE_FILENAME: ${API_CONFIG_REFERENCE_FILENAME}
665665
API_CONFIG_MASTER_FILENAME: ${API_CONFIG_MASTER_FILENAME}
666666
API_FIELDS_CONFIG_FILENAME: ${API_FIELDS_CONFIG_FILENAME}
667+
JEMPI_FILE_IMPORT_MAX_SIZE_BYTE: ${JEMPI_FILE_IMPORT_MAX_SIZE_BYTE}
667668
networks:
668669
- backend
669670
volumes:
@@ -729,6 +730,7 @@ services:
729730
API_CONFIG_REFERENCE_FILENAME: ${API_CONFIG_REFERENCE_FILENAME}
730731
API_CONFIG_MASTER_FILENAME: ${API_CONFIG_MASTER_FILENAME}
731732
API_FIELDS_CONFIG_FILENAME: ${API_FIELDS_CONFIG_FILENAME}
733+
JEMPI_FILE_IMPORT_MAX_SIZE_BYTE: ${JEMPI_FILE_IMPORT_MAX_SIZE_BYTE}
732734
networks:
733735
- frontend
734736
- backend

0 commit comments

Comments
 (0)