Skip to content

Commit

Permalink
SRL-443: fixed render conflict with feedback component
Browse files Browse the repository at this point in the history
  • Loading branch information
melwong-jcc committed Aug 18, 2021
1 parent ae25215 commit d8c8e99
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{#
/**
* @file
* Theme override to display a block.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_block()
*/
#}

{% set feedback_form = drupal_entity('webform', 'was_this_information_helpful_') %}
{% set classes = [
'block',
bundle ? 'block--' ~ bundle|clean_class,
id ? 'block--' ~ id|replace({"_": "-"})|clean_class,
]|merge(classes|default([])) %}

<div {{ attributes|without('id').addClass(classes) }}>
{% include '@molecules/blocks/feedback/feedback.twig' with {
feedback: {
id: feedback_form['#webform_id'],
embed: content,
button: {
text: feedback_form.elements.was_this_information_helpful_['#title'],
}
}
} %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
{% include '@organisms/sections/drawer/drawer.twig' with {
drawer: {
feedback: elements.webform,
chatbot: elements.jccchatbot
}
} %}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
*/
#}

{% include '@molecules/blocks/feedback/feedback.twig' with {
feedback: {
id: element['#webform_id_trunc'],
form: {
attributes: attributes,
children: children
},
button: {
title: element.elements.was_this_information_helpful_['#admin_title']
}
}
} %}
<form{{ attributes }}>
{{ children }}
</form>

1 comment on commit d8c8e99

@sleepingmonk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visit Site

Created multidev environment ci-3318 for jcc-srl.

Please sign in to comment.