-
Notifications
You must be signed in to change notification settings - Fork 14
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
Issue #3415660 by govind.maloo: Arrows supporting Previous and Next buttons on webforms are not rendering as expected #1182
Merged
Merged
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6bc3afb
[CIVIC-1493] Added webform related fixes.
govindmaloo fbbaeb1
[CIVIC-1493] Updated webform templates and test.
govindmaloo 439eacb
Fixed indentation.
AlexSkrypnyk 81d3df3
Removed `modifier_class` from the container.
AlexSkrypnyk 7a5292c
Reverted the change ro submit button's theme.
AlexSkrypnyk e57f766
Fixed indentation.
AlexSkrypnyk 1beef14
[CIVIC-1493] Added webform related fixes.
govindmaloo 7cd22b4
[CIVIC-1493] Updated webform templates and test.
govindmaloo 397c11f
[CIVIC-1529] Fixed submit button arrow htmlentity.
govindmaloo 501b1e8
Updated webform and related test.
govindmaloo abf2ee3
Build fix.
govindmaloo dcc1b72
Updated tzdata package.
govindmaloo 1cfccc7
Updated webform configuration.
govindmaloo 6ece161
Merge branch 'develop' into feature/CIVIC-1529
AlexSkrypnyk 6fc6d4f
Removed unnecessary class.
AlexSkrypnyk 1e6596d
Merge branch 'develop' into feature/CIVIC-1493
AlexSkrypnyk 89fb1c6
Merge branch 'feature/CIVIC-1493' into feature/CIVIC-1529
AlexSkrypnyk c5ed680
Merge branch 'develop' into feature/CIVIC-1529
govindmaloo b2e3593
Removed webform related fixes from this branch.
govindmaloo b38be1c
Merge branch 'develop' into feature/CIVIC-1529
AlexSkrypnyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@p0 @civictheme @webform @test | ||
Feature: Webform render | ||
|
||
@api @javascript | ||
Scenario: Form inputs are correctly validated | ||
Given I am an anonymous user | ||
When I visit "/form/civictheme-feedback" | ||
And I should see 3 ".progress-step" elements | ||
And I should see the text "Personal information" | ||
And I should see the text "Additional information" | ||
And I should see an "[name='name']" element | ||
And I should see an "[name='email']" element | ||
And I should see an "[name='message']" element | ||
And I fill in "Your Name" with "[TEST] Name" | ||
And I fill in "Your Email" with "[email protected]" | ||
And I fill in "edit-message" with "[TEST] Message" | ||
And I should see the button "Next >" | ||
And I should not see the "< Previous" button | ||
And I press the "Next >" button | ||
And I should not see an "[name='name']" element | ||
And I should not see an "[name='email']" element | ||
And I should not see an "[name='message']" element | ||
And I should see an "[name='reason']" element | ||
And I should see the text "Reason for Contacting" | ||
And I should see the text "Subscribe to Newsletter" | ||
And I should see the text "Preferred Contact Method" | ||
And I should not see the "Next >" button | ||
And I should see the button "< Previous" | ||
Then I select "support" from "reason" | ||
And I should see an "[name='support_ticket_number']" element | ||
And I should not see a visible "[name='how_did_you_hear']" element | ||
Then I select "general" from "reason" | ||
And I should not see a visible "[name='support_ticket_number']" element | ||
And I should see an "[name='how_did_you_hear']" element | ||
And I should see the button "Submit" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
web/themes/contrib/civictheme/config/install/webform.webform.civictheme_feedback.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
langcode: en | ||
status: open | ||
dependencies: { } | ||
open: null | ||
close: null | ||
weight: 0 | ||
uid: 1 | ||
template: false | ||
archive: false | ||
id: civictheme_feedback | ||
title: 'General form' | ||
description: 'A simple multi-step form.' | ||
categories: { } | ||
elements: |- | ||
personal_information: | ||
'#type': webform_wizard_page | ||
'#title': 'Personal information' | ||
'#prev_button_label': '< Previous' | ||
'#next_button_label': 'Next >' | ||
name: | ||
'#type': textfield | ||
'#title': 'Your Name' | ||
'#required': true | ||
email: | ||
'#type': email | ||
'#title': 'Your Email' | ||
'#required': true | ||
message: | ||
'#type': textarea | ||
'#title': 'Your Message' | ||
'#rows': 5 | ||
'#required': true | ||
additional_information: | ||
'#type': webform_wizard_page | ||
'#title': 'Additional information' | ||
'#prev_button_label': '< Previous' | ||
'#next_button_label': 'Next >' | ||
reason: | ||
'#type': select | ||
'#title': 'Reason for Contacting' | ||
'#options': | ||
general: 'General Inquiry' | ||
support: 'Technical Support' | ||
feedback: Feedback | ||
'#required': true | ||
support_ticket_number: | ||
'#type': textfield | ||
'#title': 'Support Ticket Number' | ||
'#states': | ||
visible: | ||
':input[name="reason"]': | ||
value: support | ||
'#required_states': | ||
visible: | ||
':input[name="reason"]': | ||
value: support | ||
how_did_you_hear: | ||
'#type': textfield | ||
'#title': 'How did you hear about us?' | ||
'#states': | ||
visible: | ||
':input[name="reason"]': | ||
value: general | ||
subscription: | ||
'#type': checkboxes | ||
'#title': 'Subscribe to Newsletter' | ||
'#options': | ||
newsletter: Newsletter | ||
promotions: Promotions | ||
preferred_contact_method: | ||
'#type': radios | ||
'#title': 'Preferred Contact Method' | ||
'#options': | ||
email: Email | ||
phone: Phone | ||
mail: Mail | ||
actions: | ||
'#type': webform_actions | ||
'#title': 'Submit button(s)' | ||
'#submit__label': Submit | ||
css: '' | ||
javascript: '' | ||
settings: { } | ||
access: { } | ||
handlers: { } | ||
variants: { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
web/themes/contrib/civictheme/templates/form/container.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{# | ||
/** | ||
* @file | ||
* CivicTheme implementation of a container used to wrap child elements. | ||
*/ | ||
#} | ||
{% set classes = [ | ||
'container', | ||
has_parent ? 'js-form-wrapper form-wrapper', | ||
'ct-contianer', | ||
] %} | ||
<div {{ attributes.addClass(classes) }}> | ||
{{ children }} | ||
</div> |
9 changes: 9 additions & 0 deletions
9
web/themes/contrib/civictheme/templates/form/fieldset.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{# | ||
/** | ||
* @file | ||
* CivicTheme theme implementation to display a fieldset. | ||
*/ | ||
#} | ||
{% include '@atoms/fieldset/fieldset.twig' with { | ||
legend: legend.title | ||
} %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,14 @@ | |
/** | ||
* @file | ||
* CivicTheme implementation to display a 'submit' form element. | ||
* | ||
* Variables: | ||
* - value: [string] value. | ||
* - attributes: [string] Additional attributes. | ||
* - modifier_class: [string] Additional classes. | ||
*/ | ||
#} | ||
|
||
{% if 'secondary' in modifier_class %} | ||
{% set type = 'secondary' %} | ||
{% else %} | ||
|
@@ -12,7 +18,7 @@ | |
{% set children %} | ||
{% include "@atoms/button/button.twig" with { | ||
type: type, | ||
text: attributes.value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does |
||
text: value, | ||
modifier_class: modifier_class, | ||
attributes: attributes, | ||
kind: 'submit', | ||
|
@@ -23,3 +29,4 @@ | |
type: 'submit', | ||
children: children, | ||
} only %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
web/themes/contrib/civictheme/templates/webform/webform.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{# | ||
/** | ||
* @file | ||
* Webform component. | ||
* | ||
* Variables: | ||
* - attributes: [string] Additional attributes. | ||
* - modifier_class: [string] Additional classes. | ||
*/ | ||
#} | ||
|
||
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %} | ||
{% set modifier_class = '%s %s'|format(theme_class, modifier_class) %} | ||
|
||
<form class="ct-webform {{ modifier_class }}" {{ attributes }}> | ||
{{ title_prefix }} | ||
{{ children }} | ||
{{ title_suffix }} | ||
</form> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no class
ct-container
. Also, this is misspelt