Skip to content

Commit 2223a18

Browse files
committed
fix: payroll, payment point layout
1 parent 12f347e commit 2223a18

File tree

9 files changed

+423
-391
lines changed

9 files changed

+423
-391
lines changed

src/components/payment-point/PaymentPointFilter.jsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,23 @@ import {
1111
useTranslations,
1212
PublishedComponent,
1313
decodeId,
14+
GRID_RESPONSIVE_STANDARD,
1415
} from '@openimis/fe-core';
1516
import {
16-
CONTAINS_LOOKUP,
17-
DEFAULT_DEBOUNCE_TIME,
18-
EMPTY_STRING,
19-
MODULE_NAME,
17+
CONTAINS_LOOKUP, DEFAULT_DEBOUNCE_TIME, EMPTY_STRING, MODULE_NAME,
2018
} from '../../constants';
2119

2220
const StyledPaymentPointFilter = styled('div')(({ theme }) => ({
2321
'& .form': {
24-
padding: '0 0 10px 0',
22+
padding: theme.spacing(1),
2523
width: '100%',
2624
},
2725
'& .item': {
2826
padding: theme.spacing(1),
2927
},
3028
}));
3129

32-
function PaymentPointFilter({
33-
filters, onChangeFilters,
34-
}) {
30+
function PaymentPointFilter({ filters, onChangeFilters }) {
3531
const modulesManager = useModulesManager();
3632
const { formatMessage } = useTranslations(MODULE_NAME, modulesManager);
3733

@@ -83,7 +79,7 @@ function PaymentPointFilter({
8379
module="payroll"
8480
id="admin.PaymentPointManagerPicker"
8581
field={(
86-
<Grid className="item" size={3}>
82+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
8783
<PublishedComponent
8884
pubRef="admin.PaymentPointManagerPicker"
8985
value={filterValue('ppm_Id')}
@@ -100,7 +96,7 @@ function PaymentPointFilter({
10096
</Grid>
10197
)}
10298
/>
103-
<Grid size={3} className="item">
99+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
104100
<TextInput
105101
module="payroll"
106102
label="paymentPoint.name"
@@ -114,6 +110,7 @@ function PaymentPointFilter({
114110
field={(
115111
<Grid size={12} className="item">
116112
<FormControlLabel
113+
sx={{ ml: 0 }}
117114
control={(
118115
<Checkbox
119116
color="primary"

src/components/payroll/AdvancedFiltersRowValue.jsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ import {
2424
BOOL_OPTIONS,
2525
} from '../../constants';
2626

27-
const StyledAdvancedFiltersRowValue = styled(Grid)(({ theme }) => ({
28-
'&.item': theme.paper?.item ?? {},
27+
const StyledAdvancedFiltersRowValue = styled('div')(({ theme }) => ({
28+
'& .form': {
29+
padding: theme.spacing(1),
30+
},
31+
'& .item': {
32+
padding: theme.spacing(1),
33+
...(theme.paper?.item ?? {}),
34+
},
2935
}));
3036

3137
function AdvancedFiltersRowValue({
@@ -115,12 +121,13 @@ function AdvancedFiltersRowValue({
115121
};
116122

117123
return (
118-
<StyledAdvancedFiltersRowValue
119-
container
120-
direction="row"
121-
className="item"
122-
style={{ backgroundColor: '#DFEDEF' }}
123-
>
124+
<StyledAdvancedFiltersRowValue>
125+
<Grid
126+
container
127+
direction="row"
128+
className="form"
129+
style={{ backgroundColor: '#DFEDEF' }}
130+
>
124131
{filters.length > 0 && !readOnly ? (
125132
<div style={{
126133
backgroundColor: '#DFEDEF', width: '10px', height: '25px', marginTop: '25px',
@@ -166,6 +173,7 @@ function AdvancedFiltersRowValue({
166173
{renderInputBasedOnType(currentFilter.type)}
167174
</Grid>
168175
) : (<></>)}
176+
</Grid>
169177
</StyledAdvancedFiltersRowValue>
170178
);
171179
}

src/components/payroll/BenefitConsumptionFilter.jsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ import {
1010
useTranslations,
1111
TextInput,
1212
NumberInput,
13+
GRID_RESPONSIVE_STANDARD,
1314
} from '@openimis/fe-core';
1415
import { CONTAINS_LOOKUP, DEFAULT_DEBOUNCE_TIME, EMPTY_STRING } from '../../constants';
1516
import BenefitConsumptionStatusPicker from '../../pickers/BenefitConsumptionStatusPicker';
1617

1718
const StyledBenefitConsumptionFilter = styled('div')(({ theme }) => ({
1819
'& .form': {
19-
padding: 0,
20+
padding: theme.spacing(1),
2021
},
2122
'& .item': {
2223
padding: theme.spacing(1),
@@ -66,39 +67,39 @@ function BenefitConsumptionFilter({ filters, onChangeFilters }) {
6667
return (
6768
<StyledBenefitConsumptionFilter>
6869
<Grid container className="form">
69-
<Grid size={2} className="item">
70+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
7071
<TextInput
7172
module="payroll"
7273
label="benefitConsumption.individual.firstName"
7374
value={filterTextFieldValue('individual_FirstName')}
7475
onChange={onChangeStringFilter('individual_FirstName', CONTAINS_LOOKUP)}
7576
/>
7677
</Grid>
77-
<Grid size={2} className="item">
78+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
7879
<TextInput
7980
module="payroll"
8081
label="benefitConsumption.individual.lastName"
8182
value={filterTextFieldValue('individual_LastName')}
8283
onChange={onChangeStringFilter('individual_LastName', CONTAINS_LOOKUP)}
8384
/>
8485
</Grid>
85-
<Grid size={2} className="item">
86+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
8687
<TextInput
8788
module="payroll"
8889
label="benefitConsumption.photo"
8990
value={filterTextFieldValue('photo')}
9091
onChange={onChangeStringFilter('photo', CONTAINS_LOOKUP)}
9192
/>
9293
</Grid>
93-
<Grid size={2} className="item">
94+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
9495
<TextInput
9596
module="payroll"
9697
label="benefitConsumption.code"
9798
value={filterTextFieldValue('code')}
9899
onChange={onChangeStringFilter('code', CONTAINS_LOOKUP)}
99100
/>
100101
</Grid>
101-
<Grid size={2} className="item">
102+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
102103
<PublishedComponent
103104
pubRef="core.DatePicker"
104105
module="payroll"
@@ -113,23 +114,23 @@ function BenefitConsumptionFilter({ filters, onChangeFilters }) {
113114
])}
114115
/>
115116
</Grid>
116-
<Grid size={2} className="item">
117+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
117118
<TextInput
118119
module="payroll"
119120
label="benefitConsumption.receipt"
120121
value={filterTextFieldValue('receipt')}
121122
onChange={onChangeStringFilter('receipt', CONTAINS_LOOKUP)}
122123
/>
123124
</Grid>
124-
<Grid size={2} className="item">
125+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
125126
<TextInput
126127
module="payroll"
127128
label="benefitConsumption.type"
128129
value={filterTextFieldValue('type')}
129130
onChange={onChangeStringFilter('type', CONTAINS_LOOKUP)}
130131
/>
131132
</Grid>
132-
<Grid size={2} className="item">
133+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
133134
<BenefitConsumptionStatusPicker
134135
module="payroll"
135136
label={formatMessage('benefitConsumptions.status.label')}
@@ -145,7 +146,7 @@ function BenefitConsumptionFilter({ filters, onChangeFilters }) {
145146
])}
146147
/>
147148
</Grid>
148-
<Grid size={2} className="item">
149+
<Grid size={GRID_RESPONSIVE_STANDARD} className="item">
149150
<NumberInput
150151
module="payroll"
151152
label={formatMessage('benefitConsumption.amount')}

0 commit comments

Comments
 (0)