Skip to content

Commit 6732ef6

Browse files
authored
Merge pull request #2113 from IFRCGo/fix/per-prioritization-form-checkbox
Fix PER prioritization form checkbox
2 parents dac73f5 + 2a8e1d2 commit 6732ef6

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

app/src/components/Navbar/CountryDropdown/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ function CountryDropdown() {
176176
icons={<SearchLineIcon />}
177177
/>
178178
)}
179+
withPadding
179180
>
180181
<ListView
181182
layout="grid"

app/src/components/Navbar/CountryDropdown/styles.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
.dropdown {
22
display: flex;
33
flex-direction: row;
4-
padding: var(--go-ui-spacing-md);
54
max-width: 64rem;
65
min-height: 16rem;
7-
gap: var(--go-ui-spacing-md);
86
overflow: auto;
97

108
.region-list {
119
flex-basis: 10rem;
1210
flex-shrink: 0;
11+
padding: var(--go-ui-spacing-md) 0 0 var(--go-ui-spacing-md);
1312
}
1413

1514
.region-border {

app/src/components/domain/HighlightedOperations/OperationCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function OperationCard(props: Props) {
196196
<ButtonLayout
197197
// FIXME: we should use Tag component here
198198
textSize="sm"
199-
spacing="2xs"
199+
spacing="3xs"
200200
withEllipsizedContent
201201
readOnly
202202
>

app/src/views/PerPrioritizationForm/ComponentInput/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ interface Props {
4949
index: number | undefined;
5050
error: Error<Value> | undefined;
5151
component: NonNullable<PerFormComponentResponse['results']>[number];
52-
onSelectionChange: (checked: boolean, index: number, componentId: number) => void;
52+
onSelectionChange: (checked: boolean, index: number | undefined, componentId: number) => void;
5353
questionResponses: ComponentResponse['question_responses'];
5454
ratingDisplay?: string | undefined | null;
5555
readOnly?: boolean;
@@ -144,7 +144,7 @@ function ComponentInput(props: Props) {
144144
);
145145

146146
const handleCheck = useCallback((checked: boolean, checkIndex: number | undefined) => {
147-
if (!readOnly && isDefined(checkIndex)) {
147+
if (!readOnly) {
148148
onSelectionChange(checked, checkIndex, component.id);
149149
}
150150
}, [component.id, readOnly, onSelectionChange]);
@@ -167,7 +167,7 @@ function ComponentInput(props: Props) {
167167
headerIcons={(
168168
<Checkbox
169169
name={index}
170-
value={isDefined(value)}
170+
value={!!value}
171171
onChange={handleCheck}
172172
readOnly={readOnly}
173173
/>
@@ -180,15 +180,16 @@ function ComponentInput(props: Props) {
180180
spacing="sm"
181181
>
182182
<ButtonLayout
183-
spacing="sm"
183+
spacing="2xs"
184+
textSize="sm"
184185
readOnly
185-
styleVariant="translucent"
186186
// FIXME: use tag component
187187
>
188188
{ratingDisplay ?? strings.notReviewed}
189189
</ButtonLayout>
190190
<ButtonLayout
191-
spacing="sm"
191+
spacing="2xs"
192+
textSize="sm"
192193
readOnly
193194
styleVariant="translucent"
194195
// FIXME: use tag component

app/src/views/PerPrioritizationForm/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ export function Component() {
285285
);
286286

287287
const handleSelectionChange = useCallback(
288-
(checked: boolean, index: number, componentId: number) => {
288+
(checked: boolean, index: number | undefined, componentId: number) => {
289289
if (!checked) {
290-
removeComponentValue(index);
290+
removeComponentValue(index!);
291291
return;
292292
}
293293

go-api

packages/ui/src/components/TabLayout/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function TabLayout(props: Props) {
8484
className,
8585
)}
8686
spacingOffset={spacingOffset}
87+
withAdditionalInlinePadding={styleVariant === 'pill'}
8788
>
8889
{children}
8990
<span className={styles.visualFeedback} />

0 commit comments

Comments
 (0)