Skip to content

Commit b7d0f9e

Browse files
committed
Merge branch 'feature/release-fixes' into develop
2 parents 5097ed1 + f373ca8 commit b7d0f9e

File tree

16 files changed

+75
-239
lines changed

16 files changed

+75
-239
lines changed

src/App/PageError/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { useEffect } from 'react';
22
import { useRouteError } from 'react-router-dom';
33

44
import useBooleanState from '#hooks/useBooleanState';
5-
import Button from '#components/Button';
6-
import Link from '#components/Link';
5+
import Button, { useButtonFeatures } from '#components/Button';
76

87
import styles from './styles.module.css';
98

@@ -25,6 +24,9 @@ function PageError() {
2524
toggle: toggleFullErrorVisibility,
2625
},
2726
] = useBooleanState(false);
27+
const {
28+
className: containerClassName,
29+
} = useButtonFeatures({});
2830

2931
return (
3032
<div className={styles.pageError}>
@@ -63,13 +65,14 @@ function PageError() {
6365
)}
6466
</div>
6567
<div className={styles.footer}>
66-
<Link
67-
to="home"
68-
variant="primary"
68+
{/* NOTE: using the anchor element as it will refresh the page */}
69+
<a
70+
className={containerClassName}
71+
href="/"
6972
>
7073
{/* FIXME: use translations */}
7174
Go back to homepage
72-
</Link>
75+
</a>
7376
</div>
7477
</div>
7578
</div>

src/components/Modal/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface Props extends Omit<ContainerProps, 'withInternalPadding' | 'wit
2727
closeOnEscape?: boolean;
2828
onClose?: () => void;
2929
overlayClassName?: string;
30+
modalContainerClassName?: string;
3031
size?: SizeType;
3132
withoutCloseButton?: boolean;
3233
}
@@ -43,6 +44,7 @@ function Modal(props: Props) {
4344
className,
4445
actions,
4546
childrenContainerClassName,
47+
modalContainerClassName,
4648

4749
...containerProps
4850
} = props;
@@ -78,7 +80,7 @@ function Modal(props: Props) {
7880
return (
7981
<BodyOverlay className={_cs(styles.overlay, overlayClassName)}>
8082
<FocusOn
81-
className={_cs(styles.modalContainer, sizeStyle)}
83+
className={_cs(styles.modalContainer, modalContainerClassName, sizeStyle)}
8284
onClickOutside={handleClickOutside}
8385
onEscapeKey={handleEscape}
8486
gapMode="padding"

src/components/Navbar/index.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -332,20 +332,6 @@ function Navbar(props: Props) {
332332
>
333333
{strings.userMenuCreateEarlyActionFieldReport}
334334
</DropdownMenuItem>
335-
<DropdownMenuItem
336-
type="link"
337-
to={undefined}
338-
variant="secondary"
339-
>
340-
{strings.userMenuSubmitEAPActivation}
341-
</DropdownMenuItem>
342-
<DropdownMenuItem
343-
type="link"
344-
to={undefined}
345-
variant="secondary"
346-
>
347-
{strings.userMenuSubmitEAPFinalReport}
348-
</DropdownMenuItem>
349335
<DropdownMenuItem
350336
type="link"
351337
to="flashUpdateFormNew"

src/components/SearchSelectInput/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export type Props<
4545
) => OPTION[];
4646
onSearchValueChange?: (value: string | undefined) => void;
4747
onShowDropdownChange?: (value: boolean) => void;
48+
onEnterWithoutOption?: (value: string | undefined) => void;
4849

4950
selectedOnTop: boolean;
5051
}, OMISSION>
@@ -74,6 +75,7 @@ export type Props<
7475
| 'hasValue'
7576
| 'hideOptionFilter'
7677
| 'onSelectAllButtonClick'
78+
| 'onEnterWithoutOption'
7779
| OMISSION
7880
>
7981
& ({
@@ -211,10 +213,14 @@ function SearchSelectInput<
211213
if (onShowDropdownChange) {
212214
onShowDropdownChange(false);
213215
}
216+
setSearchInputValue(undefined);
217+
if (onSearchValueChange) {
218+
onSearchValueChange(undefined);
219+
}
214220
if (onEnterWithoutOption) {
215-
onEnterWithoutOption();
221+
onEnterWithoutOption(searchInputValue);
216222
}
217-
}, [onShowDropdownChange, onEnterWithoutOption]);
223+
}, [searchInputValue, onShowDropdownChange, onEnterWithoutOption, onSearchValueChange]);
218224

219225
const handleChangeDropdown = useCallback(
220226
(myVal: boolean) => {

src/components/SelectInputContainer/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export type SelectInputContainerProps<
6363
onClearButtonClick: () => void;
6464
onSelectAllButtonClick?: () => void;
6565
onEnterWithoutOption?: () => void;
66+
dropdownHidden?: boolean;
6667
}, OMISSION>
6768
& Omit<InputContainerProps, 'input'>
6869
);
@@ -126,6 +127,7 @@ function SelectInputContainer<
126127
required,
127128
variant,
128129
errorOnTooltip,
130+
dropdownHidden,
129131
} = props;
130132

131133
const options = optionsFromProps ?? (emptyList as OPTION[]);
@@ -257,6 +259,8 @@ function SelectInputContainer<
257259
? `${strings.infoMessageAnd} ${totalOptionsCount - optionsCount} ${strings.infoMessageMore}`
258260
: undefined;
259261

262+
const dropdownShownActual = dropdownShown && !dropdownHidden;
263+
260264
return (
261265
<>
262266
<InputContainer
@@ -309,11 +313,11 @@ function SelectInputContainer<
309313
onClick={handleToggleDropdown}
310314
variant="tertiary"
311315
name={undefined}
312-
title={dropdownShown
316+
title={dropdownShownActual
313317
? strings.buttonTitleClose
314318
: strings.buttonTitleOpen}
315319
>
316-
{dropdownShown
320+
{dropdownShownActual
317321
? <ArrowUpSmallFillIcon className={styles.icon} />
318322
: <ArrowDownSmallFillIcon className={styles.icon} />}
319323
</Button>
@@ -338,7 +342,7 @@ function SelectInputContainer<
338342
/>
339343
)}
340344
/>
341-
{dropdownShown && (
345+
{dropdownShownActual && (
342346
<Popup
343347
elementRef={popupRef}
344348
parentRef={inputSectionRef}

src/components/domain/DrefShareModal/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ function DrefShareModal(props: Props) {
8989

9090
return (
9191
<Modal
92+
overlayClassName={styles.overlay}
93+
modalContainerClassName={styles.modalContainer}
9294
className={styles.drefShareModal}
9395
heading={strings.drefShareTitle}
9496
headerDescription={strings.drefShareDescription}
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
.dref-share-modal {
1+
.overlay {
22
display: flex;
3-
flex-direction: column;
43

5-
.content {
4+
.modal-container {
65
display: flex;
7-
flex-direction: column;
8-
gap: var(--go-ui-spacing-lg);
96

10-
.user-list {
7+
.dref-share-modal {
118
display: flex;
12-
flex-wrap: wrap;
13-
gap: var(--go-ui-spacing-xs);
14-
}
9+
flex-direction: column;
10+
min-height: 25rem;
11+
12+
.content {
13+
display: flex;
14+
flex-direction: column;
15+
gap: var(--go-ui-spacing-lg);
16+
17+
.user-list {
18+
display: flex;
19+
flex-wrap: wrap;
20+
gap: var(--go-ui-spacing-xs);
21+
}
1522

16-
.message {
17-
flex-grow: 1;
23+
.message {
24+
flex-grow: 1;
25+
}
26+
}
1827
}
1928
}
2029
}

src/components/domain/KeywordSearchSelectInput/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,23 +278,23 @@ function KeywordSearchSelectInput() {
278278
);
279279
}, [navigate]);
280280

281-
const handleSearchInputEnter = useCallback(() => {
281+
const handleSearchInputEnter = useCallback((text: string | undefined) => {
282282
// NOTE: We are not deliberately not using debouncedSearchText here
283-
const searchStringSafe = searchText?.trim() ?? '';
283+
const searchStringSafe = text?.trim() ?? '';
284284
if (searchStringSafe.length > 0) {
285285
navigate(
286286
'search',
287-
{ search: `${KEY_URL_SEARCH}=${searchText}` },
287+
{ search: `${KEY_URL_SEARCH}=${text}` },
288288
);
289289
}
290290
}, [
291-
searchText,
292291
navigate,
293292
]);
294293

295294
return (
296295
<SearchSelectInput
297296
// eslint-disable-next-line react/jsx-props-no-spreading
297+
dropdownHidden={isNotDefined(searchText) || searchText.trim().length <= 0}
298298
name="keyword"
299299
options={undefined}
300300
value={undefined}

src/components/domain/PerAssessmentSummary/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ function PerAssessmentSummary(props: Props) {
139139
* "0"(not - reviewed") component values
140140
*/
141141
const filteredComponents = areaResponse?.component_responses?.filter(
142-
(component) => isDefined(component?.rating) && component.rating > 1,
142+
(component) => isDefined(component?.rating_details)
143+
&& isDefined(component.rating_details.value)
144+
&& component.rating_details?.value > 1,
143145
) ?? [];
144146

145147
if (filteredComponents.length === 0) {

src/components/domain/UserSearchMultiSelectInput.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function UserSearchMultiSelectInput<const NAME>(
2929
) {
3030
const {
3131
className,
32+
options,
3233
...otherProps
3334
} = props;
3435

@@ -40,7 +41,7 @@ function UserSearchMultiSelectInput<const NAME>(
4041
pending,
4142
response,
4243
} = useRequest({
43-
skip: !dropdownShown,
44+
skip: (debouncedSearchText?.length ?? 0) < 1 || !dropdownShown,
4445
url: '/api/v2/users/',
4546
query: {
4647
name: debouncedSearchText,
@@ -57,7 +58,8 @@ function UserSearchMultiSelectInput<const NAME>(
5758
keySelector={keySelector}
5859
labelSelector={getUserName}
5960
onSearchValueChange={setSearchText}
60-
searchOptions={response?.results}
61+
options={options}
62+
searchOptions={response?.results ?? options}
6163
optionsPending={pending}
6264
totalOptionsCount={response?.count ?? 0}
6365
onShowDropdownChange={setShowDropdown}

0 commit comments

Comments
 (0)