]> source.dussan.org Git - sonarqube.git/commitdiff
fix background tasks page on a project level
authorStas Vilchik <vilchiks@gmail.com>
Tue, 8 Dec 2015 11:18:42 +0000 (12:18 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 8 Dec 2015 11:18:42 +0000 (12:18 +0100)
server/sonar-web/src/main/js/apps/background-tasks/search.js
server/sonar-web/src/main/js/apps/background-tasks/tasks.js
server/sonar-web/tests/apps/background-tasks-test.js

index 92f9cc5d1a8281704c3de8cd7f1eaed89d4b2645..5d122b614ab2859a2cd0dbe78e1c63180afbd74e 100644 (file)
@@ -94,7 +94,7 @@ export default React.createClass({
   },
 
   renderSearchBox() {
-    if (this.props.options.component) {
+    if (this.props.options && this.props.options.component) {
       // do not render search form on the project-level page
       return null;
     }
index ffd4af2782dce917a5b0c2651a68eb09c56371d3..54b05fa0eeddf6d48709bd72e9bbcb8586a10367 100644 (file)
@@ -93,7 +93,7 @@ export default React.createClass({
   },
 
   renderFilter(task) {
-    if (this.props.options.component) {
+    if (this.props.options && this.props.options.component) {
       return null;
     }
     return <td className="thin nowrap">
index 15ac381e2a01f7facffb3bccc32749969edea1c4..9bc486c7d633d9c13b8f8677704a24d2ee1ab895 100644 (file)
@@ -49,7 +49,7 @@ describe('Background Tasks', function () {
 
     it('should not render search form', () => {
       let spy = sinon.spy();
-      let component = TestUtils.renderIntoDocument(<Search options={{ componentId: 'ABCD' }}
+      let component = TestUtils.renderIntoDocument(<Search options={{ component: { id: 'ABCD' } }}
                                                            onStatusChange={spy}
                                                            onCurrentsChange={spy}
                                                            onDateChange={spy}/>),