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

New TPR service list component with search #494

Merged
merged 23 commits into from
Mar 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fca119e
Added twigs for list search and included new teaser view mode
dragos-dumi-ibm Nov 4, 2022
5811278
Added initial arrow link style for search teaser result card
dragos-dumi-ibm Nov 7, 2022
ce7b8a1
Added basic style for cards service list search
dragos-dumi-ibm Nov 7, 2022
278dfd7
added tags to service twig
Nov 7, 2022
be1c80f
removed unique channels var
Nov 7, 2022
e083bda
Stles for service search list
dragos-dumi-ibm Nov 8, 2022
2fed651
Merge branch 'service_list_search' of github.com:dragos-dumi-ibm/drup…
dragos-dumi-ibm Nov 8, 2022
04fe883
Merge branch 'main' into service_list_search
Nov 10, 2022
d1e2216
Merge pull request #2 from dragos-dumi-ibm/service_list_search
dragos-dumi-ibm Nov 10, 2022
694d6ca
Service list search design
oviag Nov 14, 2022
70a7bf8
PLAENH-258 - handle case when tpr search list has 1 page only
dragos-dumi-ibm Nov 16, 2022
b5b45cc
Merge branch 'City-of-Helsinki:main' into main
dragos-dumi-ibm Nov 25, 2022
03ed869
Merge branch 'City-of-Helsinki:main' into main
dragos-dumi-ibm Dec 5, 2022
79c3c7b
Merge branch 'main' of github.com:City-of-Helsinki/drupal-hdbt
dragos-dumi-ibm Jan 4, 2023
aec21d3
Changes for TPR service search after review
dragos-dumi-ibm Jan 5, 2023
3a91473
Refactored existing service list view to pass stylelint and comments …
dragos-dumi-ibm Jan 9, 2023
1dd0c9a
modify icon translation and fix for mobile
oviag Feb 7, 2023
7e2de81
added use statement
oviag Feb 7, 2023
0d5b96c
Merge branch 'main' into main
dragos-dumi-ibm Feb 7, 2023
4c3c6cf
fixed arrow motion to use transition transform instead of transition all
oviag Feb 7, 2023
9634352
Merge branch 'main' of github.com:dragos-dumi-ibm/drupal-hdbt
oviag Feb 7, 2023
3422de4
Merge branch 'main' of github.com:City-of-Helsinki/drupal-hdbt
oviag Mar 1, 2023
01168c5
Merge remote-tracking branch 'helsinki_remote/main'
oviag Mar 17, 2023
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
Next Next commit
Added twigs for list search and included new teaser view mode
dragos-dumi-ibm committed Nov 4, 2022
commit fca119e12540a450633002d2eb40a351db29e9bb
16 changes: 16 additions & 0 deletions hdbt.theme
Original file line number Diff line number Diff line change
@@ -811,6 +811,22 @@ function hdbt_preprocess_paragraph(array &$variables) {
}, $paragraph->field_service_list_services->getValue()));
}

if ($paragraph_type == 'service_list_search') {
$ids = '';
$service_ids = '';
if ($paragraph->hasField('field_service_list_services')) {
$ids = implode(',', array_map(function ($service) {
return $service['target_id'];
}, $paragraph->field_service_list_services->getValue()));
}
if ($paragraph->hasField('field_service_list_service_ids')) {
$service_ids = implode(',', array_map(function ($service) {
return $service['value'];
}, $paragraph->field_service_list_service_ids->getValue()));
}
$variables['services_list_views_argument'] = $ids . '|' . $service_ids;
}

// Contact card paragraph.
if (
$paragraph_type == 'contact_card' &&
37 changes: 24 additions & 13 deletions templates/module/helfi_tpr/tpr-service.html.twig
Original file line number Diff line number Diff line change
@@ -7,8 +7,31 @@
*/
#}

{% if view_mode != 'teaser' %}
{% if view_mode == 'teaser' %}

<div class="service service--teaser">
<a href="{{ url('entity.tpr_service.canonical', { 'tpr_service': entity.id() }) }}" class="service__link">
<h3 class="service__title">
{{ entity.label }}
</h3>
{% include '@hdbt/misc/icon.twig' ignore missing with {icon: 'arrow-right'} %}
</a>
</div>

{% elseif view_mode == 'teaser_search_result' %}
dragos-dumi-ibm marked this conversation as resolved.
Show resolved Hide resolved
<div class="service service--teaser-search-result">
<a href="{{ url('entity.tpr_service.canonical', { 'tpr_service': entity.id() }) }}" class="service__link">
dragos-dumi-ibm marked this conversation as resolved.
Show resolved Hide resolved
<h3 class="service__title">
{{ entity.label }}
</h3>
<div class="short-desc">
{{ content.description }}
</div>
{% include '@hdbt/misc/icon.twig' ignore missing with {icon: 'arrow-right'} %}
</a>
</div>

{% else %}
<article class="service service--full">

{% embed "@hdbt/misc/lead-in.twig" with { content: content.description_summary } %}{% endembed %}
@@ -34,16 +57,4 @@
{% endif %}

</article>

{% elseif view_mode == 'teaser' %}

<div class="service service--teaser">
<a href="{{ url('entity.tpr_service.canonical', { 'tpr_service': entity.id() }) }}" class="service__link">
<h3 class="service__title">
{{ entity.label }}
</h3>
{% include '@hdbt/misc/icon.twig' ignore missing with {icon: 'arrow-right'} %}
</a>
</div>

{% endif %}
15 changes: 15 additions & 0 deletions templates/paragraphs/paragraph--service-list-search.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% block paragraph %}
{% embed "@hdbt/misc/component.twig" with
{
component_classes: [ 'component--service-list-search' ],
component_title: content.field_service_list_title,
component_description: content.field_service_list_description,
}
%}

{% block component_content %}
{{ drupal_view('service_list', 'block_1', services_list_views_argument) }}

{% endblock component_content %}
{% endembed %}
{% endblock paragraph %}