Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-9327: Unified number of search results for the filter searches #900

Merged
merged 9 commits into from
Feb 12, 2024
Merged
2 changes: 1 addition & 1 deletion 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/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/school-search.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions hdbt.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ nav-global:
- hdbt/nav-toggle

event-list:
version: 1.1
version: 1.2
js:
dist/js/linkedevents.min.js: {
preprocess: false
Expand All @@ -152,7 +152,7 @@ event-list:
- core/drupal

school-search:
version: 1.3
version: 1.4
js:
dist/js/school-search.min.js: {
preprocess: false
Expand Down Expand Up @@ -183,7 +183,7 @@ job-search:
- core/drupal

district-and-project-search:
version: 1.1
version: 1.2
js:
dist/js/district-and-project-search.min.js: {
preprocess: false
Expand Down Expand Up @@ -216,7 +216,7 @@ table-figcaption:
- core/once

health-station-search:
version: 1.1
version: 1.2
js:
dist/js/health-station-search.min.js: {
preprocess: false
Expand All @@ -226,7 +226,7 @@ health-station-search:
- core/drupal

maternity-and-child-health-clinic-search:
version: 1.0
version: 1.1
js:
dist/js/maternity-and-child-health-clinic-search.min.js: {
preprocess: false
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Global = {
size: 10,
size: 15,
};

export default Global;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const AppSettings = {
index: 'health_stations',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=health_station_district&unit_include=id',
size: 10
size: 15
};

export default AppSettings;
4 changes: 3 additions & 1 deletion src/js/react/apps/linkedevents/components/ResultCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ function ResultCard({ end_time, id, location, name, keywords=[], start_time, ima
return urlPattern.test(urlToCheck);
}

const getOffers = (): boolean => offers?.some(({ info_url }) => isValidUrl(info_url[currentLanguage])) ?? false;
const getOffers = (): boolean => offers?.some(({ info_url }) =>
info_url != null && info_url[currentLanguage] != null && isValidUrl(info_url[currentLanguage])
) ?? false;

const imageToElement = (image: EventImage): JSX.Element => {
const imageProps: React.ImgHTMLAttributes<HTMLImageElement> & { 'data-photographer'?:string } = {};
Expand Down
2 changes: 1 addition & 1 deletion src/js/react/apps/linkedevents/components/SubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type SubmitButtonProps = {

function SubmitButton({ disabled }: SubmitButtonProps) {
return (
<Button type="submit" disabled={disabled} className='hdbt-search__submit-button event-list__submit-button'>{Drupal.t('Search', {}, { context: 'React search' })}</Button>
<Button type="submit" disabled={disabled} className='hdbt-search--react__submit-button event-list__submit-button'>{Drupal.t('Search', {}, { context: 'React search' })}</Button>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const AppSettings = {
index: 'maternity_and_child_health_clinic',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=maternity_clinic_district&unit_include=id',
size: 10
size: 15
};

export default AppSettings;
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ProximityFormContainer = () => {
label={Drupal.t('The child\'s home address', {}, { context: 'School search: input label'})}
type='search'
/>
<Button className='hdbt-search__submit-button' type='submit'>{Drupal.t('Search')}</Button>
<Button className='hdbt-search--react__submit-button' type='submit'>{Drupal.t('Search')}</Button>
</form>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/js/react/apps/school-search/enum/AppSettings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const AppSettings = {
index: 'schools',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&unit_include=id&type=lower_comprehensive_school_district_fi,lower_comprehensive_school_district_sv,upper_comprehensive_school_district_fi,upper_comprehensive_school_district_sv',
size: 10
size: 15
};

export default AppSettings;
23 changes: 3 additions & 20 deletions src/scss/06_components/forms/_react-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
}

.hdbt-search--react__submit-button {
margin-block: $spacing-double;
margin-bottom: $spacing-double;
margin-top: $spacing;
max-width: 280px;
width: 100%;
}
Expand All @@ -78,25 +79,7 @@
--color-focus: var(--hdbt-color-black);
--color-hover-focus: var(--hdbt-color-black);
--focus-outline-color: var(--hdbt-color-black);
margin-block: $spacing-double;
}

// Need specific selector here to override HDS styles
.hdbt-search__submit-button:not(:disabled) {
--background-color: var(--hdbt-color-black);
--background-color-hover: var(--hdbt-text-color);
--background-color-focus: var(--hdbt-text-color);
--background-color-hover-focus: var(--hdbt-text-color);
--border-color: var(--hdbt-color-black);
--border-color-hover: var(--hdbt-color-black);
--border-color-focus: var(--hdbt-color-black);
--border-color-hover-focus: var(--hdbt-color-black);
--color: var(--hdbt-text-color);
--color-hover: var(--hdbt-color-black);
--color-focus: var(--hdbt-color-black);
--color-hover-focus: var(--hdbt-color-black);
--focus-outline-color: var(--hdbt-color-black);
margin-bottom: $spacing-triple;
margin-bottom: $spacing-double;
margin-top: $spacing;
}

Expand Down
1 change: 0 additions & 1 deletion src/scss/06_components/paragraphs/_react-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ fieldset .hdbt-search--react__checkbox:not(:first-of-type) {

.hdbt-search--ploughing-schedule__submit-button:not(:disabled) {
margin-bottom: 0;
margin-top: $spacing;
}

.hdbt-search--ploughing-schedule__result-card {
Expand Down
Loading