[WED-634] fix: profile issues not rendering correctly with GroupBy display filter (#3886)
* fix: Handled issue render in the display filters groupBy stateGroup and labels * chore: Optimized state_group filter and typo * Fix: removed workspaceLevel boolean and handled the states from stateMap
This commit is contained in:
parent
bce69bcbe1
commit
b535d8a23c
5 changed files with 38 additions and 17 deletions
|
|
@ -17,6 +17,7 @@ export interface IStateStore {
|
|||
// observables
|
||||
stateMap: Record<string, IState>;
|
||||
// computed
|
||||
workspaceStates: IState[] | undefined;
|
||||
projectStates: IState[] | undefined;
|
||||
groupedProjectStates: Record<string, IState[]> | undefined;
|
||||
// computed actions
|
||||
|
|
@ -73,13 +74,22 @@ export class StateStore implements IStateStore {
|
|||
this.router = _rootStore.app.router;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stateMap belongs to a specific workspace
|
||||
*/
|
||||
get workspaceStates() {
|
||||
const workspaceSlug = this.router.workspaceSlug || "";
|
||||
if (!workspaceSlug || !this.fetchedMap[workspaceSlug]) return;
|
||||
return sortStates(Object.values(this.stateMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stateMap belongs to a specific project
|
||||
*/
|
||||
get projectStates() {
|
||||
const projectId = this.router.projectId;
|
||||
const worksapceSlug = this.router.workspaceSlug || "";
|
||||
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[worksapceSlug])) return;
|
||||
const workspaceSlug = this.router.workspaceSlug || "";
|
||||
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[workspaceSlug])) return;
|
||||
return sortStates(Object.values(this.stateMap).filter((state) => state.project_id === projectId));
|
||||
}
|
||||
|
||||
|
|
@ -106,8 +116,8 @@ export class StateStore implements IStateStore {
|
|||
* @returns IState[]
|
||||
*/
|
||||
getProjectStates = computedFn((projectId: string) => {
|
||||
const worksapceSlug = this.router.workspaceSlug || "";
|
||||
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[worksapceSlug])) return;
|
||||
const workspaceSlug = this.router.workspaceSlug || "";
|
||||
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[workspaceSlug])) return;
|
||||
return sortStates(Object.values(this.stateMap).filter((state) => state.project_id === projectId));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue