feat: user profile analytics, views and filters (#1698)
* feat: user profile overview * chore: profile sidebar designed * feat: user issues filters and view options * refactor: filters * refactor: mutation logic * fix: percentage calculation logic and sidebar shadow
This commit is contained in:
parent
8930840a76
commit
10f145f85c
33 changed files with 2396 additions and 427 deletions
|
|
@ -7,6 +7,8 @@ import type {
|
|||
IIssue,
|
||||
IUser,
|
||||
IUserActivityResponse,
|
||||
IUserProfileData,
|
||||
IUserProfileProjectSegregation,
|
||||
IUserWorkspaceDashboard,
|
||||
} from "types";
|
||||
|
||||
|
|
@ -144,6 +146,55 @@ class UserService extends APIService {
|
|||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async getUserProfileData(workspaceSlug: string, userId: string): Promise<IUserProfileData> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/user-stats/${userId}/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async getUserProfileProjectsSegregation(
|
||||
workspaceSlug: string,
|
||||
userId: string
|
||||
): Promise<IUserProfileProjectSegregation> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/user-profile/${userId}/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async getUserProfileActivity(
|
||||
workspaceSlug: string,
|
||||
userId: string
|
||||
): Promise<IUserActivityResponse> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/user-activity/${userId}/?per_page=15`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async getUserProfileIssues(
|
||||
workspaceSlug: string,
|
||||
userId: string,
|
||||
params: any
|
||||
): Promise<
|
||||
| {
|
||||
[key: string]: IIssue[];
|
||||
}
|
||||
| IIssue[]
|
||||
> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/user-issues/${userId}/`, {
|
||||
params,
|
||||
})
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default new UserService();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue