Skip to content

Commit 4868676

Browse files
AkctarusMath-R
authored andcommitted
front: fix text input alignment
1 parent 05ab67f commit 4868676

File tree

12 files changed

+18
-9
lines changed

12 files changed

+18
-9
lines changed

front/src/applications/operationalStudies/components/ManageTrainSchedule/Allowances/AllowancesActions.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export default function AllowancesActions({
210210
unit="m"
211211
sm
212212
noMargin
213+
textRight
213214
min={0}
214215
isInvalid={beginPosition >= endPosition || (!beginPosition && beginPosition !== 0)}
215216
value={beginPosition}
@@ -242,6 +243,7 @@ export default function AllowancesActions({
242243
unit="m"
243244
sm
244245
noMargin
246+
textRight
245247
min={0}
246248
isInvalid={
247249
beginPosition >= endPosition ||
@@ -278,6 +280,7 @@ export default function AllowancesActions({
278280
unit="m"
279281
sm
280282
noMargin
283+
textRight
281284
min={1}
282285
isInvalid={allowanceLength < 1}
283286
value={allowanceLength}
@@ -310,6 +313,7 @@ export default function AllowancesActions({
310313
type={valueAndUnit?.value_type || defaultType()}
311314
min={0}
312315
isInvalid={!(getAllowanceValue(valueAndUnit) > 0)}
316+
textRight
313317
/>
314318
</div>
315319
{allowanceSelectedIndex !== undefined ? (

front/src/applications/operationalStudies/components/ManageTrainSchedule/Allowances/AllowancesStandardSettings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default function AllowancesStandardSettings({
7474
typeValue="number"
7575
min={0}
7676
isInvalid={getAllowanceValue(valueAndUnit) < 0}
77+
textRight
7778
/>
7879
</div>
7980
</div>

front/src/applications/operationalStudies/components/ManageTrainSchedule/Itinerary/DisplayVias.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function InputStopTime({ index, setIndexSelected, dispatchAndRun }: InputStopTim
4747
selectAllOnFocus
4848
sm
4949
noMargin
50+
textRight
5051
/>
5152
);
5253
}

front/src/applications/operationalStudies/components/ManageTrainSchedule/TrainAddingSettings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export default function TrainAddingSettings() {
9090
errorMsg={trainDelta < 1 ? t('errorMessages.noDeltaInput') : undefined}
9191
min={1}
9292
sm
93+
textRight
9394
/>
9495
</span>
9596
</div>

front/src/applications/operationalStudies/components/ManageTrainSchedule/TrainSettings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export default function TrainSettings() {
110110
value={initialSpeed}
111111
noMargin
112112
unit="km/h"
113+
textRight
113114
/>
114115
</div>
115116
<div className="col-xl-6 col-lg-12 mt-xl-0 mt-lg-3">

front/src/applications/operationalStudies/components/Study/AddOrEditStudyModal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export default function AddOrEditStudyModal({ editionMode, study }: Props) {
361361
}
362362
value={currentStudy?.budget || 0}
363363
onChange={(e) => setCurrentStudy({ ...currentStudy, budget: +e.target.value })}
364+
textRight
364365
/>
365366
</div>
366367
</div>

front/src/common/BootstrapSNCF/InputGroupSNCF.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function InputGroupSNCF({
5050
min,
5151
max,
5252
step,
53-
textRight = true,
53+
textRight = false,
5454
}: Props) {
5555
const [isDropdownShown, setIsDropdownShown] = useState(false);
5656
const [selected, setSelected] = useState(
@@ -61,7 +61,6 @@ export default function InputGroupSNCF({
6161
: { id: options[0].id, label: options[0].label, unit: options[0].unit }
6262
);
6363
const textAlignmentClass = textRight ? 'right-alignment' : 'left-alignment';
64-
6564
useEffect(() => {
6665
const selectedOption = options?.find((option) => option.id === type);
6766

front/src/common/BootstrapSNCF/InputSNCF.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const InputSNCF = ({
7272
step = 1,
7373
isFlex = false,
7474
condensed = false,
75-
textRight = true,
75+
textRight = false,
7676
}: InputSNCFProps): JSX.Element => {
7777
// Build custom classes
7878
const formSize = sm ? 'form-control-sm' : '';
@@ -83,7 +83,6 @@ const InputSNCF = ({
8383
const condensedIcon = condensed ? 'condensed-icon' : '';
8484
const condensedInput = condensed ? 'px-2' : '';
8585
const textAlignmentClass = textRight ? 'right-alignment' : 'left-alignment';
86-
8786
// Test and adapt display if entry is invalid
8887
let invalidClass = '';
8988
let invalidMsg: JSX.Element | null = null;

front/src/common/IntervalsEditor/IntervalsEditorMarginForm.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const IntervalsEditorMarginForm = ({
4040
value={(interval.value as number) || 0}
4141
noMargin
4242
sm
43+
textRight
4344
/>
4445
</div>
4546

front/src/modules/allowances/components/STDCMAllowances.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ const STDCMAllowances = () => {
5656
type="number"
5757
value={gridMarginBefore}
5858
unit={ALLOWANCE_UNITS_KEYS.time}
59-
condensed
6059
onChange={(e) => dispatch(updateGridMarginBefore(+e.target.value || 0))}
6160
sm
6261
noMargin
6362
label={t('allowances:gridMarginBeforeAfter')}
64-
textRight={false}
63+
textRight
6564
/>
6665
</div>
6766
<div className="col-3">
@@ -70,12 +69,11 @@ const STDCMAllowances = () => {
7069
type="number"
7170
value={gridMarginAfter}
7271
unit={ALLOWANCE_UNITS_KEYS.time}
73-
condensed
7472
onChange={(e) => dispatch(updateGridMarginAfter(+e.target.value || 0))}
7573
sm
7674
noMargin
7775
label=" "
78-
textRight={false}
76+
textRight
7977
/>
8078
</div>
8179
<div className="col-6">
@@ -90,7 +88,7 @@ const STDCMAllowances = () => {
9088
typeValue="number"
9189
condensed
9290
sm
93-
textRight={false}
91+
textRight
9492
/>
9593
</div>
9694
</div>

front/src/modules/project/components/AddOrEditProjectModal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ export default function AddOrEditProjectModal({
319319
}
320320
value={currentProject.budget}
321321
onChange={(e) => setCurrentProject({ ...currentProject, budget: +e.target.value })}
322+
textRight
322323
/>
323324
</div>
324325
</div>

front/src/modules/rollingStock/components/rollingStockEditor/RollingStockEditorFormHelpers.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ const RollingStockEditorParameterFormColumn = ({
174174
sm
175175
condensed
176176
orientation="right"
177+
textRight
177178
/>
178179
</div>
179180
) : (
@@ -211,6 +212,7 @@ const RollingStockEditorParameterFormColumn = ({
211212
sm
212213
isFlex
213214
key={index}
215+
{...(property.type === 'number' ? { textRight: true } : {})}
214216
/>
215217
);
216218
})}{' '}

0 commit comments

Comments
 (0)