Skip to content

Commit 3752bf5

Browse files
authored
Merge pull request #2577 from Rushikesh-Sonawane99/feat-batch-revamp
Issue #PS-6223 chore: Updated ordering of form fields in batch and center creation form
2 parents 39421c5 + 7c47a70 commit 3752bf5

File tree

4 files changed

+50
-32
lines changed

4 files changed

+50
-32
lines changed

apps/admin-app-repo/public/locales/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@
550550
"WAS_BELONG_TO": "was archived in the below location",
551551
"CONFIRM_TO_ACTIVATE": "Are you sure you want to activate this user again?",
552552
"WORKING_LOCATION": "Working Location",
553-
"CATCHMENT_AREA": "Catchment Area"
553+
"CATCHMENT_AREA": "Catchment Area",
554+
"TYPE_OF_BATCH": "Type of Batch"
554555
},
555556
"FORM_ERROR_MESSAGES": {
556557
"INVALID_INPUT": "Invalid Input.",

apps/admin-app-repo/src/constant/Forms/BatchCreate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const BatchCreateSchema = {
131131
};
132132

133133
export const BatchCreateUISchema = {
134-
'ui:order': ['board', 'medium', 'grade', 'name', 'batch_type'],
134+
'ui:order': ['name', 'batch_type', 'board', 'medium', 'grade'],
135135
board: {
136136
'ui:widget': 'AutoCompleteMultiSelectWidget',
137137
'ui:options': {

apps/admin-app-repo/src/pages/centers.tsx

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import SimpleModal from '@/components/SimpleModal';
1212
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
1313
import editIcon from '../../public/images/editIcon.svg';
1414
import deleteIcon from '../../public/images/deleteIcon.svg';
15-
import MapIcon from '@mui/icons-material/Map';
15+
// import MapIcon from '@mui/icons-material/Map';
1616
import Image from 'next/image';
1717
import {
1818
extractMatchingKeys,
@@ -162,6 +162,22 @@ const Centers = () => {
162162

163163
//set 2 grid layout
164164
let alterUISchema = responseForm?.uiSchema;
165+
alterUISchema['ui:order'] = [
166+
"name",
167+
"center_type",
168+
"state",
169+
"district",
170+
"block",
171+
"village",
172+
"address",
173+
"image",
174+
"google_map_link",
175+
'industry',
176+
"catchment_area",
177+
"board",
178+
"medium",
179+
"grade",
180+
];
165181
alterUISchema = enhanceUiSchemaWithGrid(alterUISchema);
166182

167183
setAddUiSchema(alterUISchema);
@@ -424,35 +440,35 @@ const Centers = () => {
424440

425441
// Define actions
426442
const actions = [
427-
{
428-
icon: (
429-
<Box
430-
sx={{
431-
display: 'flex',
432-
flexDirection: 'column',
433-
alignItems: 'center',
434-
cursor: 'pointer',
435-
// backgroundColor: 'rgb(227, 234, 240)',
436-
justifyContent: 'center',
437-
padding: '10px',
438-
}}
439-
title="Google Map Link"
440-
>
441-
<MapIcon />
442-
</Box>
443-
),
444-
callback: async (row: any) => {
445-
window.open(
446-
row.customFields.find((field) => field.label === 'GOOGLE_MAP_LINK')
447-
?.selectedValues,
448-
'_blank',
449-
'noopener,noreferrer'
450-
);
451-
},
452-
show: (row) =>
453-
row.customFields.find((field) => field.label === 'GOOGLE_MAP_LINK')
454-
?.selectedValues,
455-
},
443+
// {
444+
// icon: (
445+
// <Box
446+
// sx={{
447+
// display: 'flex',
448+
// flexDirection: 'column',
449+
// alignItems: 'center',
450+
// cursor: 'pointer',
451+
// // backgroundColor: 'rgb(227, 234, 240)',
452+
// justifyContent: 'center',
453+
// padding: '10px',
454+
// }}
455+
// title="Google Map Link"
456+
// >
457+
// <MapIcon />
458+
// </Box>
459+
// ),
460+
// callback: async (row: any) => {
461+
// window.open(
462+
// row.customFields.find((field) => field.label === 'GOOGLE_MAP_LINK')
463+
// ?.selectedValues,
464+
// '_blank',
465+
// 'noopener,noreferrer'
466+
// );
467+
// },
468+
// show: (row) =>
469+
// row.customFields.find((field) => field.label === 'GOOGLE_MAP_LINK')
470+
// ?.selectedValues,
471+
// },
456472
{
457473
icon: (
458474
<Box

libs/shared-lib-v2/src/lib/context/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"UNEMPLOYED_HOUSEWIFE_DOMESTIC_WORK": "Unemployed, Housewife or Domestic Work",
7171
"WORKING_LOCATION": "Working Location",
7272
"CATCHMENT_AREA": "Catchment Area",
73+
"TYPE_OF_BATCH": "Type of Batch",
7374
"SURVEYS": {
7475
"SURVEYS": "Surveys",
7576
"ACTIVE_SURVEYS": "Active Surveys",

0 commit comments

Comments
 (0)