[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:
guru_sainath 2024-03-07 13:25:23 +05:30 committed by GitHub
parent bce69bcbe1
commit b535d8a23c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 17 deletions

View file

@ -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));
});