]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7303 replace usage of /api/resources/search by /api/components/search
authorStas Vilchik <vilchiks@gmail.com>
Thu, 19 Jan 2017 09:56:07 +0000 (10:56 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 24 Jan 2017 17:36:48 +0000 (18:36 +0100)
server/sonar-web/src/main/js/apps/issues/facets/project-facet.js

index a1ec2a3041f5d16b61b1ea8e818e46515a3fff39..5f58f3caaca19f9ee246234f2a6ee85edab289b8 100644 (file)
@@ -27,10 +27,27 @@ export default CustomValuesFacet.extend({
     if (q === 'VW' || q === 'SVW') {
       return window.baseUrl + '/api/components/search_view_components';
     } else {
-      return window.baseUrl + '/api/resources/search?f=s2&q=TRK&display_uuid=true';
+      return window.baseUrl + '/api/components/search?qualifiers=TRK';
     }
   },
 
+  prepareAjaxSearch () {
+    return {
+      quietMillis: 300,
+      url: this.getUrl(),
+      data (term, page) {
+        return { q: term, p: page };
+      },
+      results: r => ({
+        more: r.paging.total > r.paging.pageIndex * r.paging.pageSize,
+        results: r.components.map(component => ({
+          id: component.id,
+          text: component.name
+        }))
+      })
+    };
+  },
+
   prepareSearch () {
     const q = this.options.app.state.get('contextComponentQualifier');
     if (q === 'VW' || q === 'SVW') {