[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

@ -77,6 +77,7 @@ const GroupByList: React.FC<IGroupByList> = (props) => {
label,
projectState,
member,
true,
true
);
@ -97,6 +98,10 @@ const GroupByList: React.FC<IGroupByList> = (props) => {
preloadedData = { ...preloadedData, label_ids: [value] };
} else if (groupByKey === "assignees" && value != "None") {
preloadedData = { ...preloadedData, assignee_ids: [value] };
} else if (groupByKey === "cycle" && value != "None") {
preloadedData = { ...preloadedData, cycle_id: value };
} else if (groupByKey === "module" && value != "None") {
preloadedData = { ...preloadedData, module_ids: [value] };
} else if (groupByKey === "created_by") {
preloadedData = { ...preloadedData };
} else {

View file

@ -24,7 +24,8 @@ export const getGroupByColumns = (
label: ILabelStore,
projectState: IStateStore,
member: IMemberRootStore,
includeNone?: boolean
includeNone?: boolean,
isWorkspaceLevel?: boolean
): IGroupByColumn[] | undefined => {
switch (groupBy) {
case "project":
@ -40,7 +41,7 @@ export const getGroupByColumns = (
case "priority":
return getPriorityColumns();
case "labels":
return getLabelsColumns(label) as any;
return getLabelsColumns(label, isWorkspaceLevel) as any;
case "assignees":
return getAssigneeColumns(member) as any;
case "created_by":
@ -177,12 +178,13 @@ const getPriorityColumns = () => {
}));
};
const getLabelsColumns = (label: ILabelStore) => {
const { projectLabels } = label;
const getLabelsColumns = (label: ILabelStore, isWorkspaceLevel: boolean = false) => {
const { workspaceLabels, projectLabels } = label;
if (!projectLabels) return;
const labels = [...projectLabels, { id: "None", name: "None", color: "#666" }];
const labels = [
...(isWorkspaceLevel ? workspaceLabels || [] : projectLabels || []),
{ id: "None", name: "None", color: "#666" },
];
return labels.map((label) => ({
id: label.id,