Skip to content
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5d4790d
UHF-11098: Updated hds-react and hds-design-tokens to 4.1.0
khalima Jan 15, 2025
9aa38a1
UHF-11098: Updated HDS core to 4.1.0.
khalima Jan 15, 2025
35d3f64
UHF-11098: Build css.
khalima Jan 15, 2025
15fc9e7
UHF-11098: Fix school search build issues with HDS 4.x update
teroelonen Jan 15, 2025
e005086
UHF-11098: Update to HDS 4.x version
teroelonen Jan 15, 2025
153ad1f
UHF-11098: Merge branch 'UHF-11098' of https://github.com/City-of-Hel…
teroelonen Jan 16, 2025
f6d99b9
UHF-11098: Fix Warning: A component is changing an uncontrolled input…
teroelonen Jan 16, 2025
538de40
UHF-11098: Refactored formContainer for HDS 4.1
khalima Jan 16, 2025
4960778
UHF-11098: Refactored ResultsSort for HDS 4.1
khalima Jan 16, 2025
bbf29a5
UHF-11098: Refactored ResultsSort for HDS 4.1
khalima Jan 16, 2025
f04dea2
UHF-11098: Refactored news archive to use HDS 4.1
khalima Jan 16, 2025
bc7d51e
UHF-11098: Removed location helper as it is not needed anymore.
khalima Jan 16, 2025
101b095
UHF-11098: Refactored linked events components to use HDS 4.1
khalima Jan 16, 2025
03b6eb0
UHF-11098: Refactored Job search components to use HDS 4.1
khalima Jan 16, 2025
b7aab53
UHF-11098: Added "Search by text" filter for the select boxes.
khalima Jan 16, 2025
c2ab5ce
UHF-11098: Use state to keep the select dropdown open when user selec…
khalima Jan 16, 2025
01e01c8
UHF-11098: Do not show the "clear" button for sort select box.
khalima Jan 16, 2025
5285b25
UHF-11098: Do not open the dropdown when "clear selections" button is…
khalima Jan 16, 2025
817b744
UHF-11098: Change the onChange on selects to keep the dropdown open w…
teroelonen Jan 16, 2025
c63936a
UHF-11098: Merge branch 'UHF-11098' of https://github.com/City-of-Hel…
teroelonen Jan 16, 2025
3bcbbe3
UHF-11098: Build the javascripts for the React apps
teroelonen Jan 16, 2025
f1cb056
UHF-11098: Arrage form element props on school search
teroelonen Jan 16, 2025
9785e25
UHF-11098: Fix broken translation on Swedish school search
teroelonen Jan 16, 2025
26d225a
UHF-11098: Change the onChange on selects to keep the dropdown open w…
teroelonen Jan 16, 2025
01631f1
UHF-11098: Let's keep these properties in alphabetical order.
khalima Jan 17, 2025
cb0702e
UHF-11098: Set sort selection non-clearable.
khalima Jan 17, 2025
0de0f05
UHF-11098: Fixed empty spaces.
khalima Jan 17, 2025
3c3568d
UHF-11098: Change the onChange on selects to keep the dropdown open w…
khalima Jan 17, 2025
27988bc
UHF-11098: Fix selects on linkedevents search to work correctly
teroelonen Jan 17, 2025
86e5c54
UHF-11098: Fixed the language selection filter.
khalima Jan 17, 2025
feca200
UHF-11098: Merge branch 'UHF-11098' of https://github.com/City-of-Hel…
khalima Jan 17, 2025
8d6a2f7
UHF-11098: Added dist.
khalima Jan 17, 2025
aeeea51
UHF-11098: Fix koro issues after hds-core update
teroelonen Jan 17, 2025
4450b4f
UHF-11098: Merge branch 'UHF-11098' of https://github.com/City-of-Hel…
teroelonen Jan 17, 2025
2a06a61
UHF-11098: Fix district search filter form
teroelonen Jan 17, 2025
f2e9a63
UHF-11098: Remove root styles added to _hds.scss file that were orpha…
teroelonen Jan 20, 2025
46ed4df
UHF-11098: Change the way classes are assigned in koro twig
teroelonen Jan 21, 2025
d44047e
UHF-11098: Removed obsolete visual regression cleaup workflow, as the…
khalima Jan 21, 2025
2066ed2
UHF-11098: Merge branch 'main' of https://github.com/City-of-Helsinki…
teroelonen Jan 22, 2025
617d6fd
UHF-11098: Merge branch 'main' of https://github.com/City-of-Helsinki…
khalima Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/visual-regression-cleanup.yml

This file was deleted.

19 changes: 9 additions & 10 deletions dist/css/ckeditor.min.css

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions dist/css/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/district-and-project-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/health-station-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/job-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/linkedevents.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/maternity-and-child-health-clinic-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/news-archive.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/ploughing-schedule.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/school-search.min.js

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"classnames": "^2.3.1",
"focus-trap": "^7.5.4",
"glob": "^11.0.0",
"hds-design-tokens": "^3.3.0",
"hds-react": "^3.3.0",
"hds-core": "^4.1.0",
"hds-design-tokens": "^4.1.0",
"hds-react": "^4.1.0",
"html-react-parser": "^5.0.11",
"husky": "^9.0.0",
"hyphenopoly": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ const ResultsSort = () => {
return (
<div className="district-project-search-form__filter hdbt-search__filter">
<Select
label={Drupal.t('Sort search results', {}, { context: 'District and project search form label' })}
options={sortOptions}
onChange={(option: OptionType) => {
setSort(option);
clearable={false}
onChange={(_selectedOptions, clickedOption) => {
setSort(clickedOption);
setUrlParams({
...urlParams,
sort: option.value,
sort: clickedOption.value,
});
}}
value={sort}
options={sortOptions}
style={{ minWidth: '280px' }}
texts={{
label: Drupal.t('Sort search results', {}, { context: 'District and project search form label' }),
}}
value={[sort]}
/>
</div>

);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
import { useEffect } from 'react';
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import { Accordion, IconLocation, Button, TextInput, Combobox } from 'hds-react';
import {useEffect, useState} from 'react';
import {useAtom, useAtomValue, useSetAtom} from 'jotai';
import {
Accordion,
AccordionSize,
Button,
ButtonPresetTheme,
ButtonVariant,
defaultFilter,
IconLocation,
Select,
TextInput
} from 'hds-react';

import {
urlAtom,
urlUpdateAtom,
titleAtom,
districtsAtom,
districtSelectionAtom,
themesAtom,
themeSelectionAtom,
phasesAtom,
phaseSelectionAtom,
themesAtom,
themeSelectionAtom,
titleAtom,
typesAtom,
typeSelectionAtom
typeSelectionAtom,
urlAtom,
urlUpdateAtom
} from '../store';
import SelectionsContainer from './SelectionsContainer';
import SearchComponents from '../enum/SearchComponents';
import transformDropdownsValues from '../helpers/Params';
import { ComponentMap } from '../helpers/helpers';
import {ComponentMap} from '../helpers/helpers';
import type OptionType from '../types/OptionType';
import URLParams from '../types/URLParams';

Expand All @@ -28,12 +38,16 @@ const FormContainer = () => {
const [title, setTitle] = useAtom(titleAtom);
const districtOptions = useAtomValue(districtsAtom);
const [districtSelection, setDistrictFilter] = useAtom(districtSelectionAtom);
const [districtSelectOpen, setDistrictSelectOpen] = useState(false);
const themeOptions = useAtomValue(themesAtom);
const [themeSelection, setThemeFilter] = useAtom(themeSelectionAtom);
const [themeSelectOpen, setThemeSelectOpen] = useState(false);
const phaseOptions = useAtomValue(phasesAtom);
const [phaseSelection, setPhaseFilter] = useAtom(phaseSelectionAtom);
const [phaseSelectOpen, setPhaseSelectOpen] = useState(false);
const typeOptions = useAtomValue(typesAtom);
const [typeSelection, setTypeFilter] = useAtom(typeSelectionAtom);
const [typeSelectOpen, setTypeSelectOpen] = useState(false);

// Set form control values from url parameters on load
useEffect(() => {
Expand Down Expand Up @@ -70,106 +84,134 @@ const FormContainer = () => {
<TextInput
id="district-or-project-name"
label={Drupal.t('Name of residential area or project', {}, { context: 'District and project search form label' })}
placeholder={Drupal.t('For example, Pasila', {}, { context: 'District and project search form label' })}
onChange={handleTitleChange}
value={title}
placeholder={Drupal.t('For example, Pasila', {}, { context: 'District and project search form label' })}
type='search'
value={title}
/>
<Combobox
multiselect
<Select
filter={defaultFilter}
icon={<IconLocation />}
id={SearchComponents.DISTRICTS}
// @ts-ignore
multiSelect
noTags
onChange={(selectedOptions, clickedOption) => {
setDistrictFilter(selectedOptions);
if (clickedOption) setDistrictSelectOpen(true);
}}
onBlur={() => setDistrictSelectOpen(false)}
open={districtSelectOpen}
options={districtOptions}
value={districtSelection}
onChange={setDistrictFilter}
icon={<IconLocation />}
label={residentialAreaLabel}
placeholder={Drupal.t('All areas', {}, { context: 'District and project search form label' })}
clearButtonAriaLabel={Drupal.t('Clear @label selection', { '@label': residentialAreaLabel }, { context: 'React search clear selection label' })}
selectedItemRemoveButtonAriaLabel={Drupal.t('Remove item', {}, { context: 'React search remove item aria label' })}
toggleButtonAriaLabel={Drupal.t('Open the combobox', {}, { context: 'React search open dropdown aria label' })}
texts={{
clearButtonAriaLabel_one: Drupal.t('Clear @label selection', {'@label': residentialAreaLabel}, { context: 'React search clear selection label' }),
clearButtonAriaLabel_multiple: Drupal.t('Clear @label selection', {'@label': residentialAreaLabel}, { context: 'React search clear selection label' }),
label: residentialAreaLabel,
placeholder: Drupal.t('All areas', {}, { context: 'District and project search form label' }),
}}
theme={{
'--checkbox-background-selected': 'var(--hdbt-color-black)',
'--focus-outline-color': 'var(--hdbt-color-black)',
'--multiselect-checkbox-background-selected': 'var(--hdbt-color-black)',
'--placeholder-color': 'var(--hdbt-color-black)',
}}
value={districtSelection}
/>
</div>
<Accordion
className='district-project-search-form__additional-filters'
size='s'
initiallyOpen={accordionInitiallyOpen}
headingLevel={3}
heading={Drupal.t('Refine the project search', {}, { context: 'District and project search' })}
headingLevel={3}
initiallyOpen={accordionInitiallyOpen}
language={window.drupalSettings.path.currentLanguage || 'fi'}
size={AccordionSize.Small}
theme={{
'--header-font-size': 'var(--fontsize-heading-xxs)',
'--header-line-height': 'var(--lineheight-s)',
}}
>
<div className='district-project-search-form__filters'>
<Combobox
multiselect
<Select
filter={defaultFilter}
id={SearchComponents.THEME}
// @ts-ignore
multiSelect
noTags
onChange={(selectedOptions, clickedOption) => {
setThemeFilter(selectedOptions);
if (clickedOption) setThemeSelectOpen(true);
}}
onBlur={() => setThemeSelectOpen(false)}
open={themeSelectOpen}
options={themeOptions}
value={themeSelection}
onChange={setThemeFilter}
label={projectThemeLabel}
placeholder={Drupal.t('All themes', {}, { context: 'District and project search form label' })}
clearButtonAriaLabel={Drupal.t('Clear @label selection', { '@label': projectThemeLabel }, { context: 'React search clear selection label' })}
selectedItemRemoveButtonAriaLabel={Drupal.t('Remove item', {}, { context: 'React search remove item aria label' })}
toggleButtonAriaLabel={Drupal.t('Open the combobox', {}, { context: 'React search open dropdown aria label' })}
texts={{
clearButtonAriaLabel_one: Drupal.t('Clear @label selection', {'@label': projectThemeLabel}, { context: 'React search clear selection label' }),
clearButtonAriaLabel_multiple: Drupal.t('Clear @label selection', {'@label': projectThemeLabel}, { context: 'React search clear selection label' }),
label: projectThemeLabel,
placeholder: Drupal.t('All themes', {}, { context: 'District and project search form label' }),
}}
theme={{
'--checkbox-background-selected': 'var(--hdbt-color-black)',
'--focus-outline-color': 'var(--hdbt-color-black)',
'--multiselect-checkbox-background-selected': 'var(--hdbt-color-black)',
'--placeholder-color': 'var(--hdbt-color-black)',
}}
value={themeSelection}
/>
<Combobox
multiselect
<Select
filter={defaultFilter}
id={SearchComponents.PHASE}
// @ts-ignore
multiSelect
noTags
onChange={(selectedOptions, clickedOption) => {
setPhaseFilter(selectedOptions);
if (clickedOption) setPhaseSelectOpen(true);
}}
onBlur={() => setPhaseSelectOpen(false)}
open={phaseSelectOpen}
options={phaseOptions}
value={phaseSelection}
onChange={setPhaseFilter}
label={projectStageLabel}
placeholder={Drupal.t('All stages', {}, { context: 'District and project search form label' })}
clearButtonAriaLabel={Drupal.t('Clear @label selection', { '@label': projectStageLabel }, { context: 'React search clear selection label' })}
selectedItemRemoveButtonAriaLabel={Drupal.t('Remove item', {}, { context: 'React search remove item aria label' })}
toggleButtonAriaLabel={Drupal.t('Open the combobox', {}, { context: 'React search open dropdown aria label' })}
texts={{
clearButtonAriaLabel_one: Drupal.t('Clear @label selection', {'@label': projectStageLabel}, { context: 'React search clear selection label' }),
clearButtonAriaLabel_multiple: Drupal.t('Clear @label selection', {'@label': projectStageLabel}, { context: 'React search clear selection label' }),
label: projectStageLabel,
placeholder: Drupal.t('All stages', {}, { context: 'District and project search form label' }),
}}
theme={{
'--checkbox-background-selected': 'var(--hdbt-color-black)',
'--focus-outline-color': 'var(--hdbt-color-black)',
'--multiselect-checkbox-background-selected': 'var(--hdbt-color-black)',
'--placeholder-color': 'var(--hdbt-color-black)',
}}
value={phaseSelection}
/>
<Combobox
multiselect
<Select
filter={defaultFilter}
id={SearchComponents.TYPE}
// @ts-ignore
multiSelect
noTags
onChange={(selectedOptions, clickedOption) => {
setTypeFilter(selectedOptions);
if (clickedOption) setTypeSelectOpen(true);
}}
onBlur={() => setTypeSelectOpen(false)}
open={typeSelectOpen}
options={typeOptions}
value={typeSelection}
onChange={setTypeFilter}
label={projectTypeLabel}
placeholder={Drupal.t('All types', {}, { context: 'District and project search form label' })}
clearButtonAriaLabel={Drupal.t('Clear @label selection', { '@label': projectTypeLabel }, { context: 'React search clear selection label' })}
selectedItemRemoveButtonAriaLabel={Drupal.t('Remove item', {}, { context: 'React search remove item aria label' })}
toggleButtonAriaLabel={Drupal.t('Open the combobox', {}, { context: 'React search open dropdown aria label' })}
texts={{
clearButtonAriaLabel_one: Drupal.t('Clear @label selection', {'@label': projectTypeLabel}, { context: 'React search clear selection label' }),
clearButtonAriaLabel_multiple: Drupal.t('Clear @label selection', {'@label': projectTypeLabel}, { context: 'React search clear selection label' }),
label: projectTypeLabel,
placeholder: Drupal.t('All types', {}, { context: 'District and project search form label' }),
}}
theme={{
'--checkbox-background-selected': 'var(--hdbt-color-black)',
'--focus-outline-color': 'var(--hdbt-color-black)',
'--multiselect-checkbox-background-selected': 'var(--hdbt-color-black)',
'--placeholder-color': 'var(--hdbt-color-black)',
}}
value={typeSelection}
/>
</div>
</Accordion>
<div className='district-project-search-form__submit'>
<Button
className='district-project-search-form__submit-button'
theme={ButtonPresetTheme.Black}
type='submit'
variant='primary'
theme='black'
variant={ButtonVariant.Primary}
>
{Drupal.t('Search', {}, { context: 'React search: submit button label' })}
</Button>
Expand Down
Loading
Loading