17579: added check if search input contains value
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Fri, 10 Dec 2021 15:12:09 +0000 (16:12 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Fri, 10 Dec 2021 15:12:09 +0000 (16:12 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

cypress/integration/project.spec.js
src/components/search-input/search-input.tsx

index b3d6bbed83b657ab3990c0aeb435aa1a34b8e67a..23e1ba248584ed1883180a98667ae36e8b310167 100644 (file)
@@ -64,7 +64,7 @@ describe('Project tests', function() {
         .then(function() {
             expect(this.projects).to.have.lengthOf(1);
             expect(this.projects[0].properties).to.deep.equal(
         .then(function() {
             expect(this.projects).to.have.lengthOf(1);
             expect(this.projects[0].properties).to.deep.equal(
-                {IDTAGCOLORS: 'IDVALCOLORS3'});
+                { Color: 'Magenta' });
         });
     });
 
         });
     });
 
index 955cf5e5296b1a38bf72aa52a6646ec66e92abf8..50338f401c9387b680ef417a715e2130d932b265 100644 (file)
@@ -97,7 +97,7 @@ export const SearchInput = withStyles(styles)(
             if (nextProps.value !== this.props.value) {
                 this.setState({ value: nextProps.value });
             }
             if (nextProps.value !== this.props.value) {
                 this.setState({ value: nextProps.value });
             }
-            if (nextProps.selfClearProp !== this.state.selfClearProp) {
+            if (this.state.value !== '' && nextProps.selfClearProp && nextProps.selfClearProp !== this.state.selfClearProp) {
                 this.props.onSearch('');
                 this.setState({ selfClearProp: nextProps.selfClearProp });
             }
                 this.props.onSearch('');
                 this.setState({ selfClearProp: nextProps.selfClearProp });
             }