feat: workspace global view, style: spreadsheet view revamp (#2273)

* chore: workspace view types, services and hooks added

* style: spreadsheet view revamp and code refactor

* feat: workspace view

* fix: build fix

* chore: sidebar workspace issues redirection updated
This commit is contained in:
Anmol Singh Bhatia 2023-09-26 19:56:59 +05:30 committed by GitHub
parent a187e7765c
commit 3a6d72e4b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 4253 additions and 733 deletions

View file

@ -14,6 +14,8 @@ import {
ICurrentUserResponse,
IWorkspaceBulkInviteFormData,
IWorkspaceViewProps,
IView,
IIssueFilterOptions,
} from "types";
class WorkspaceService extends APIService {
@ -261,6 +263,56 @@ class WorkspaceService extends APIService {
throw error?.response?.data;
});
}
async createView(workspaceSlug: string, data: IView): Promise<any> {
return this.post(`/api/workspaces/${workspaceSlug}/views/`, data)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async updateView(workspaceSlug: string, viewId: string, data: Partial<IView>): Promise<any> {
return this.patch(`/api/workspaces/${workspaceSlug}/views/${viewId}/`, data)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async deleteView(workspaceSlug: string, viewId: string): Promise<any> {
return this.delete(`/api/workspaces/${workspaceSlug}/views/${viewId}/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async getAllViews(workspaceSlug: string): Promise<IView[]> {
return this.get(`/api/workspaces/${workspaceSlug}/views/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async getViewDetails(workspaceSlug: string, viewId: string): Promise<IView> {
return this.get(`/api/workspaces/${workspaceSlug}/views/${viewId}/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async getViewIssues(workspaceSlug: string, params: IIssueFilterOptions): Promise<any> {
return this.get(`/api/workspaces/${workspaceSlug}/issues/`, {
params,
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}
export default new WorkspaceService();