From 7dcc8cd0b2ac4e4ee71ef9fcb174e27b0396b81e Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Fri, 27 Oct 2017 11:50:26 +0100 Subject: [PATCH 1/3] fix: Show 'Please select...' only when there are results, and the not found message otherwise --- src/components/SchoolsLookUp/SchoolsLookUp.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/SchoolsLookUp/SchoolsLookUp.js b/src/components/SchoolsLookUp/SchoolsLookUp.js index a0593319..d6b17f4e 100644 --- a/src/components/SchoolsLookUp/SchoolsLookUp.js +++ b/src/components/SchoolsLookUp/SchoolsLookUp.js @@ -333,7 +333,11 @@ class SchoolsLookUp extends Component { return ( - Please select a school from the list below + { + results.length > 0 + ? 'Please select a school from the list below' + : "Sorry, that postcode isn't in our database of schools and nurseries. Please manually fill in the address below." + } { results.map((result, index) => ( @@ -384,7 +388,7 @@ class SchoolsLookUp extends Component { :
- {/* Disable cashing as it ignores a lot of results */} + {/* Disable caching as it ignores a lot of results */} Date: Sun, 29 Oct 2017 13:23:34 +0200 Subject: [PATCH 2/3] fix: Fix how no-results message is displayed --- src/components/SchoolsLookUp/SchoolsLookUp.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/SchoolsLookUp/SchoolsLookUp.js b/src/components/SchoolsLookUp/SchoolsLookUp.js index d6b17f4e..61ee8c69 100644 --- a/src/components/SchoolsLookUp/SchoolsLookUp.js +++ b/src/components/SchoolsLookUp/SchoolsLookUp.js @@ -332,21 +332,22 @@ class SchoolsLookUp extends Component { const MenuHeader = props =>
  • ; return ( - - { - results.length > 0 - ? 'Please select a school from the list below' - : "Sorry, that postcode isn't in our database of schools and nurseries. Please manually fill in the address below." - } - - { - results.map((result, index) => ( -
    - - {SchoolsLookUp.renderMenuItemChildren(result)} - -
    - )) + {results.length > 0 ? +
    + + Please select a school from the list below + + { + results.map((result, index) => ( +
    + + {SchoolsLookUp.renderMenuItemChildren(result)} + +
    + )) + } +
    : + null }
    ); @@ -393,6 +394,7 @@ class SchoolsLookUp extends Component { type="text" minLength={min} bsSize="large" + emptyLabel="Sorry, that postcode isn't in our database of schools and nurseries. Please manually fill in the address below." onSearch={this.handleSearch} onChange={this.handleChange} onInputChange={this.handleInputChange} From 3ab331b8ec5161463a6e4e7ee7a227b98f27e7c0 Mon Sep 17 00:00:00 2001 From: Mohamed Labib Date: Sun, 29 Oct 2017 13:31:15 +0200 Subject: [PATCH 3/3] fix: Update search placeholder --- src/components/SchoolsLookUp/SchoolsLookUp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SchoolsLookUp/SchoolsLookUp.js b/src/components/SchoolsLookUp/SchoolsLookUp.js index 61ee8c69..4194d86a 100644 --- a/src/components/SchoolsLookUp/SchoolsLookUp.js +++ b/src/components/SchoolsLookUp/SchoolsLookUp.js @@ -400,7 +400,7 @@ class SchoolsLookUp extends Component { onInputChange={this.handleInputChange} className="schoolsLookUpForm" labelKey={option => `${option.id !== 0 ? `${option.name} ${option.post_code}` : ''}`} - placeholder="Search" + placeholder="Type to start search (this may take a few seconds)" renderMenu={this.renderMenu} options={options} useCache={false}