From b08814f7807c1443592af65cd68c2a51dfd4ee37 Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Fri, 20 Jul 2018 16:57:23 +0200 Subject: SONAR-11036 Install integration with GitHub or BitBucket Cloud * SONAR-11040 Update tutorial choices modal * SONAR-11041 Migrate manual installation tab * SONAR-11041 Rename button to start new project tutorial * SONAR-11041 Rework sonarcloud tabbed page styling * SONAR-11042 Add alm app install buttons in create project page * Make start script compatible with ALM integration --- server/sonar-web/src/main/js/api/components.ts | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'server/sonar-web/src/main/js/api/components.ts') diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index a069c38b17e..c917f8a4460 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { getJSON, postJSON, post, RequestData } from '../helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; +import { getJSON, postJSON, post, RequestData } from '../helpers/request'; import { Paging, Visibility, BranchParameters, MyProject } from '../app/types'; export interface BaseSearchProjectsParameters { @@ -31,29 +31,30 @@ export interface BaseSearchProjectsParameters { visibility?: Visibility; } -export interface SearchProjectsParameters extends BaseSearchProjectsParameters { - p?: number; - ps?: number; +export interface ProjectBase { + key: string; + name: string; + qualifier: string; + visibility: Visibility; } -export interface SearchProjectsResponseComponent { +export interface Project extends ProjectBase { id: string; - key: string; lastAnalysisDate?: string; - name: string; organization: string; - qualifier: string; - visibility: Visibility; } -export interface SearchProjectsResponse { - components: SearchProjectsResponseComponent[]; - paging: Paging; +export interface SearchProjectsParameters extends BaseSearchProjectsParameters { + p?: number; + ps?: number; } export function getComponents( parameters: SearchProjectsParameters -): Promise { +): Promise<{ + components: Project[]; + paging: Paging; +}> { return getJSON('/api/projects/search', parameters); } @@ -75,7 +76,7 @@ export function createProject(data: { name: string; project: string; organization?: string; -}): Promise { +}): Promise<{ project: ProjectBase }> { return postJSON('/api/projects/create', data).catch(throwGlobalError); } -- cgit v1.2.3