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

Using GET by default (although configurable) in search forms. Fixes #846 #852

Merged
merged 4 commits into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay and change view o
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -776,7 +776,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay and change view o
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -1507,7 +1507,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay and change view o
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -2416,7 +2416,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay with grouped item
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -2977,7 +2977,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay with items and li
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -3878,7 +3878,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay with items and li
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -4917,7 +4917,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay with items and li
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -5648,7 +5648,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay with items and se
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down Expand Up @@ -6889,7 +6889,7 @@ exports[`ClayDatasetDisplay should render a ClayDatasetDisplay with ungrouped it
</ul>
<div class="navbar-form navbar-form-autofit navbar-overlay navbar-overlay-sm-down">
<div class="container-fluid container-fluid-max-xl">
<form action="mySearchURL" method="POST" name="mySearchName" role="search">
<form action="mySearchURL" method="GET" name="mySearchName" role="search">
<div class="input-group">
<div class="input-group-item">
<input aria-label="Search" class="form-control input-group-inset input-group-inset-after" name="mySearchInputName" placeholder="Search for..." ref="search" type="text">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"type": "type"
}
],
"searchFormMethod": "GET",
"searchFormName": "search-form-name",
"disabled": false,
"creationMenu": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"label": "label"
}
],
"searchFormMethod": "GET",
"searchFormName": "search-form-name",
"selectedItems": 1
}
9 changes: 9 additions & 0 deletions packages/clay-management-toolbar/src/ClayManagementToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ ClayManagementToolbar.STATE = {
*/
searchActionURL: Config.string(),

/**
* Method of the search form.
* @default GET
* @instance
* @memberof ClayManagementToolbar
* @type {?(string|undefined)}
*/
searchFormMethod: Config.oneOf(['GET', 'POST']).value('GET'),

/**
* Name of the search form.
* @default undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
]>}
{@param? id: string}
{@param? searchActionURL: string}
{@param? searchFormMethod: string}
{@param? searchFormName: string}
{@param? searchInputName: string}
{@param? searchValue: string}
Expand Down Expand Up @@ -141,6 +142,7 @@
{param disabled: $disabled /}
{param filterItems: $filterItems /}
{param searchActionURL: $searchActionURL /}
{param searchFormMethod: $searchFormMethod /}
{param searchFormName: $searchFormName /}
{param searchInputName: $searchInputName /}
{param searchValue: $searchValue /}
Expand Down Expand Up @@ -418,6 +420,7 @@
type: string
]>}
{@param? searchActionURL: string}
{@param? searchFormMethod: string}
{@param? searchFormName: string}
{@param? searchInputName: string}
{@param? searchValue: string}
Expand Down Expand Up @@ -541,6 +544,7 @@
{param disabled: $disabled and not $searchValue /}
{param onlySearch: $onlySearch /}
{param searchActionURL: $searchActionURL /}
{param searchFormMethod: $searchFormMethod /}
{param searchFormName: $searchFormName /}
{param searchInput kind="html"}
{call .searchInput}
Expand Down Expand Up @@ -746,6 +750,7 @@
{@param? disabled: bool}
{@param? onlySearch: bool}
{@param? searchActionURL: string}
{@param? searchFormMethod: string}
{@param? searchFormName: string}
{@param? searchInput: html}
{@param? searchInputName: string}
Expand All @@ -757,7 +762,8 @@
action="{$searchActionURL}"
{/if}

method="POST"
method="{$searchFormMethod ?: 'GET'}"

{if $searchFormName}
name="{$searchFormName}"
{/if}
Expand Down
Loading