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-9500: Fix service list search component styles #866

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

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.

1 change: 1 addition & 0 deletions src/scss/06_components/paragraphs/__index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@import 'react-search';
@import 'remote-video';
@import 'service-list';
@import 'service-list-search';
@import 'sidebar-text';
@import 'target-group-links';
@import 'text';
Expand Down
4 changes: 4 additions & 0 deletions src/scss/06_components/paragraphs/_service-list-search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.component--service-list-search {
@include component-side-padding;
background-color: $color-silver-light;
}
103 changes: 1 addition & 102 deletions src/scss/06_components/paragraphs/_service-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,110 +11,9 @@
@include breakpoint($breakpoint-l) {
columns: 1;
}

@include breakpoint($breakpoint-xl) {
column-gap: $spacing-triple;
columns: 2;
}
}

.views--service-list {
.form-actions [data-hds-component='button']:not([class*='hds-button']):not([data-hds-variant]), // When variant is not defined, we fallback to primary styles
.form-actions [data-hds-component='button']:not([class*='hds-button'])[data-hds-variant='primary'],
.form-actions .hds-button--primary {
width: 100%;

@include breakpoint($breakpoint-m) {
margin-left: $spacing-and-half;
}
}

.views-exposed-form {
border-bottom: 1px solid $color-black-10;
padding-bottom: $spacing-triple;

@include breakpoint($breakpoint-l) {
padding-bottom: $spacing-quadruple;
}

@include breakpoint($breakpoint-m) {
align-items: flex-end;
display: flex;
}
}

.form-item {
@include breakpoint($breakpoint-m) {
margin-bottom: 0;
width: 70%;
}
}

.hds-text-input__input-wrapper {
&::after {
@include pseudo-icon('search', 20px, $color-black, block);
position: absolute;
right: $spacing;
top: 50%;
transform: translateY(-50%);
}

.hds-text-input__input {
border-radius: 0;
padding-right: $spacing-triple;
}
}

.form-actions {
@include breakpoint($breakpoint-m) {
display: flex;
width: 30%;
}
}
}

.service-search__results {
margin-top: $spacing-and-half;

@include breakpoint($breakpoint-l) {
display: flex;
flex-wrap: wrap;
margin-inline: calc(-#{$spacing-and-half} / 2);
margin-top: $spacing-triple;
}

.views-row {
@include breakpoint($breakpoint-l) {
display: flex;
flex-wrap: wrap;
margin-left: calc(-#{$spacing-and-half} / 2);
margin-right: calc(-#{$spacing-and-half} / 2);
margin-top: $spacing-triple;
}
}
}

.views--service-list--block-search {
.services-search__results {
> .views-row + .views-row {
margin-top: $spacing;
}
}
}

.views--service-list--block {
.views-row {
@include breakpoint($breakpoint-l) {
margin-top: $spacing-and-half;
width: 25%;
}

&:nth-child(-n+4) {
margin-top: 0;
}
}
}

.component--service-list-search {
@include component-side-padding;
background-color: $color-silver-light;
}
25 changes: 13 additions & 12 deletions templates/views/views-view--service-list--block-search.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
set classes = [
'views',
'views--service-list',
'views--service-list--block-search',
'views--service-list--search',
'views--unit-search',
dom_id ? 'js-view-dom-id-' ~ dom_id,
]
%}
Expand All @@ -51,25 +52,25 @@
{% endif %}

{{ exposed }}
<div class="services-search__results" data-id-number="{{ dom_id }}">
<span class="service-list__count-container">
<div class="service-list-search__results unit-search__results" data-id-number="{{ dom_id }}">
<span class="service-list-search__count-container unit-search__count-container">
{% if total_rows %}
<span class="service-list__count">{{ total_rows }}</span>
{% trans with {'context': 'Service list count'}%}service{% plural total_rows %}services{% endtrans %}
<span class="service-list-search__count unit-search__count">{{ total_rows }}</span>
{% trans with {'context': 'Service list search count'}%}service{% plural total_rows %}services{% endtrans %}
{% endif %}

{{ empty }}
</span>
</div>
{{ attachment_before }}
{{ attachment_before }}

{{ rows }}

{{ rows }}
{{ pager }}


{{ pager }}
{{ attachment_after }}
{{ more }}

{{ attachment_after }}
{{ more }}
</div>

{% if footer %}
<footer>
Expand Down
6 changes: 6 additions & 0 deletions translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -928,3 +928,9 @@ msgstr "Kadun eri osuuksilla on erilaiset tavoiteaikataulut auraukselle. Alla on
msgctxt "Ploughing schedule: Result title"
msgid "Estimated ploughing schedule"
msgstr "Arvioitu aurausaikataulu"

msgctxt "Service list search count"
msgid "service"
msgid_plural "services"
msgstr[0] "palvelu"
msgstr[1] "palvelua"
6 changes: 6 additions & 0 deletions translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -921,3 +921,9 @@ msgstr "Vi har olika mål för när olika avsnitt av gatan ska vara plogade. Ned
msgctxt "Ploughing schedule: Result title"
msgid "Estimated ploughing schedule"
msgstr "Uppskattad tidsplan för plogning"

msgctxt "Service list search count"
msgid "service"
msgid_plural "services"
msgstr[0] "tjänst"
msgstr[1] "tjänster"