feat: issue link to create relation between issues (#2171)

* feat: issue linking

* fix: search params to filter out selected issue

* style: changed icons

* fix: build error on web-view

* fix: build error

* fix: build error on web-view component
This commit is contained in:
Dakshesh Jain 2023-09-13 19:41:11 +05:30 committed by GitHub
parent 32d08570e7
commit 9bac7cb036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 793 additions and 101 deletions

View file

@ -149,6 +149,52 @@ class ProjectIssuesServices extends APIService {
});
}
async createIssueRelation(
workspaceSlug: string,
projectId: string,
issueId: string,
user: ICurrentUserResponse,
data: {
related_list: Array<{
relation_type: "duplicate" | "relates_to" | "blocked_by";
related_issue: string;
}>;
}
) {
return this.post(
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/issue-relation/`,
data
)
.then((response) => {
if (trackEvent)
trackEventServices.trackIssueRelationEvent(response.data, "ISSUE_RELATION_CREATE", user);
return response?.data;
})
.catch((error) => {
throw error?.response;
});
}
async deleteIssueRelation(
workspaceSlug: string,
projectId: string,
issueId: string,
relationId: string,
user: ICurrentUserResponse
) {
return this.delete(
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/issue-relation/${relationId}/`
)
.then((response) => {
if (trackEvent)
trackEventServices.trackIssueRelationEvent(response.data, "ISSUE_RELATION_DELETE", user);
return response?.data;
})
.catch((error) => {
throw error?.response;
});
}
async createIssueProperties(workspaceSlug: string, projectId: string, data: any): Promise<any> {
return this.post(
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issue-properties/`,