Skip to content

Commit 0f9c225

Browse files
committed
fix: update migration controller and service for consistent response handling and improve AuditFilterModal styling
1 parent 75a0469 commit 0f9c225

File tree

4 files changed

+25
-32
lines changed

4 files changed

+25
-32
lines changed

api/src/controllers/migration.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const deleteTestStack = async (req: Request, res: Response): Promise<void> => {
5151
};
5252
const getAuditData = async (req: Request, res: Response): Promise<void> => {
5353
const resp = await migrationService.getAuditData(req);
54-
res.status(resp?.status).json(resp);
54+
res.status(200).json(resp);
5555
};
5656
const getLogs = async (req: Request, res: Response): Promise<void> => {
5757
const resp = await migrationService.getLogs(req);

api/src/services/migration.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,22 @@ const getAuditData = async (req: Request): Promise<any> => {
192192
throw new BadRequestError(`No audit data found for module: ${moduleName}`);
193193
}
194194
let transformedData = transformAndFlattenData(fileData);
195-
if (filter != GET_AUDT_DATA?.FILTERALL) {
195+
if (filter != GET_AUDT_DATA.FILTERALL) {
196196
const filters = filter.split("-");
197-
transformedData = transformedData.filter((log) => {
197+
moduleName === 'Entries_Select_feild' ? transformedData = transformedData.filter((log) => {
198198
return filters.some((filter) => {
199199
return (
200200
log?.display_type?.toLowerCase()?.includes(filter?.toLowerCase())
201201
);
202202
});
203+
}) : transformedData = transformedData.filter((log) => {
204+
return filters.some((filter) => {
205+
return (
206+
log?.data_type?.toLowerCase()?.includes(filter?.toLowerCase())
207+
);
208+
});
203209
});
210+
204211
}
205212
if (searchText && searchText !== null && searchText !== "null") {
206213
transformedData = transformedData?.filter((item: any) => {

ui/src/components/AuditFilterModal/index.scss

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,19 @@
33
.tableFilterModalStories {
44
position: absolute;
55
z-index: 1000;
6-
width: 250px;
6+
width: 350px;
77
background-color: #ffffff;
8-
border: 1px solid #e0e0e0;
9-
border-radius: 4px;
10-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
11-
display: block;
12-
margin-top: 5px;
8+
border-radius: 12px;
9+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
10+
display: flex;
11+
flex-direction: column;
12+
max-height: 350px;
13+
overflow: hidden;
1314
font-family: 'Inter', sans-serif;
1415
}
1516

16-
.tableFilterModalStories.position-bottom {
17-
top: auto !important;
18-
bottom: 0px !important;
19-
}
20-
21-
.tableFilterModalStories.position-right {
22-
left: auto !important;
23-
right: 0px !important;
24-
}
25-
2617
.tableFilterModalStories__header {
27-
padding: 16px;
18+
padding: 16px 16px;
2819
color: #3d3f4c;
2920
border-bottom: 1px solid #e5e7eb;
3021
display: flex;
@@ -36,12 +27,6 @@
3627
padding: 8px 16px;
3728
}
3829

39-
.tableFilterModalStories__no-data {
40-
padding: 8px 16px;
41-
color: #6b7280;
42-
font-size: $size-font-medium;
43-
}
44-
4530
.Checkbox {
4631
display: flex;
4732
align-items: center;
@@ -77,17 +62,17 @@
7762
justify-content: center;
7863
width: 32px;
7964
height: 32px;
80-
cursor: pointer;
81-
transition:
82-
box-shadow 0.2s ease,
83-
transform 0.2s ease;
8465
}
8566

8667
.close-btn:hover {
8768
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
8869
transform: scale(1.05);
8970
border-radius: 8px;
9071
background-color: #f0f1f3;
72+
cursor: pointer;
73+
transition:
74+
box-shadow 0.2s ease,
75+
transform 0.2s ease;
9176
}
9277

9378
.close-btn:active {

ui/src/components/AuditFilterModal/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const AuditFilterModal = ({
2727
if (selectedFileType?.includes?.('content-types') || selectedFileType?.includes?.('global-fields')) {
2828
return [
2929
{ label: 'global_field', value: 'global_field' },
30-
{ label: 'reference', value: 'reference' }
30+
{ label: 'reference', value: 'reference' },
31+
{ label: 'group', value: 'group' },
3132
];
3233
}
3334

@@ -77,7 +78,7 @@ const AuditFilterModal = ({
7778
<div className="tableFilterModalStories__list">
7879
{filterOptions?.length > 0 ? (
7980
filterOptions.map((item, index) => (
80-
<div key={'item' + index?.toString()?.replace(/[^a-zA-Z0-9_.\s-]/g, '')} >
81+
<div key={''} >
8182
<div className="tableFilterModalStories__suggestion-item">
8283
<Checkbox
8384
checked={selectedLevels?.some((v) => v?.value === item?.value)}

0 commit comments

Comments
 (0)