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

Search Form Template #3976

Merged
merged 15 commits into from
Aug 5, 2020
Merged

Conversation

areeshatariq
Copy link
Contributor

Description:

HTML Templatization of Search form using Template::Toolkit

Related issues and discussion: #2416

@teolemon teolemon added the Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. label Aug 3, 2020
@teolemon teolemon requested a review from a team August 3, 2020 09:10
<select name="tagtype_${type.id}" id="tagtype_${type.id}">
[% FOREACH value IN type.type_arrays %]
[% IF value.type_labels == 'choose a criterion...' %]
<option value="[% value.type_values %]" label="[% value.type_labels %]" selected="selected"></option>
Copy link
Contributor

Choose a reason for hiding this comment

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

The selected value is not necessarily the first one. You probably need to compare value.type_value to the type_value variable you are also passing:

		push @{$template_data_ref->{criteria}}, {
			id => $i,
			type_value => $search_tags[$i][0],
			type_arrays => \@type_array,
			contain_value => $search_tags[$i][1],
			contain_array => \@contains,
			input_value => $search_tags[$i][2],
		};

Maybe to make it clearer:

- type_value could be renamed to selected_type_value
- type_arrays could be renamed to type_options, with inside the array of { value => .. , label => .. }


Same for the other parts of the form below.

Copy link
Contributor Author

@areeshatariq areeshatariq Aug 3, 2020

Choose a reason for hiding this comment

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

Alright. I'll fix this

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 4, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@stephanegigandet stephanegigandet merged commit 9723733 into master Aug 5, 2020
@stephanegigandet stephanegigandet deleted the areesha-search-form-template-wip branch August 5, 2020 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants