style: github integration ui (#329)

* fix: ellipsis added to issue title

* feat: toolttip added

* feat: assignees tooltip added

* fix: build fix

* fix: build fix

* fix: build error

* fix: minor bugs and ux improvements

* style: github integration ui

* chore: updated .env.example file

---------

Co-authored-by: Anmol Singh Bhatia <anmolsinghbhatia@caravel.tech>
This commit is contained in:
Aaryan Khandelwal 2023-02-23 18:12:07 +05:30 committed by GitHub
parent 2b3cb839ad
commit 36a733cd06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 447 additions and 124 deletions

View file

@ -1,7 +1,13 @@
// services
import APIService from "services/api.service";
// types
import type { IProject, IProjectMember, IProjectMemberInvitation, ProjectViewTheme } from "types";
import type {
GithubRepositoriesResponse,
IProject,
IProjectMember,
IProjectMemberInvitation,
ProjectViewTheme,
} from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
@ -202,7 +208,10 @@ class ProjectServices extends APIService {
});
}
async getGithubRepositories(slug: string, workspaceIntegrationId: string): Promise<any> {
async getGithubRepositories(
slug: string,
workspaceIntegrationId: string
): Promise<GithubRepositoriesResponse> {
return this.get(
`/api/workspaces/${slug}/workspace-integrations/${workspaceIntegrationId}/github-repositories/`
)
@ -232,6 +241,20 @@ class ProjectServices extends APIService {
throw error?.response?.data;
});
}
async getProjectGithubRepository(
workspaceSlug: string,
projectId: string,
integrationId: string
): Promise<any> {
return this.get(
`/api/workspaces/${workspaceSlug}/projects/${projectId}/workspace-integrations/${integrationId}/github-repository-sync/`
)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}
export default new ProjectServices();

View file

@ -9,6 +9,8 @@ import {
IWorkspaceMember,
IWorkspaceMemberInvitation,
ILastActiveWorkspaceDetails,
IAppIntegrations,
IWorkspaceIntegrations,
} from "types";
class WorkspaceService extends APIService {
@ -169,20 +171,32 @@ class WorkspaceService extends APIService {
throw error?.response?.data;
});
}
async getIntegrations(): Promise<any> {
async getIntegrations(): Promise<IAppIntegrations[]> {
return this.get(`/api/integrations/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async getWorkspaceIntegrations(slug: string): Promise<any> {
return this.get(`/api/workspaces/${slug}/workspace-integrations/`)
async getWorkspaceIntegrations(workspaceSlug: string): Promise<IWorkspaceIntegrations[]> {
return this.get(`/api/workspaces/${workspaceSlug}/workspace-integrations/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async deleteWorkspaceIntegration(workspaceSlug: string, integrationId: string): Promise<any> {
return this.delete(
`/api/workspaces/${workspaceSlug}/workspace-integrations/${integrationId}/provider/`
)
.then((res) => res?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}
export default new WorkspaceService();