diff --git a/packages/presentation/src/status.ts b/packages/presentation/src/status.ts index 73e02cc582c..d5bc20c9816 100644 --- a/packages/presentation/src/status.ts +++ b/packages/presentation/src/status.ts @@ -227,7 +227,10 @@ export class StatusMiddleware extends BasePresentationMiddleware implements Pres const s = mgr.byId.get(sid) if (s !== undefined) { const statuses = mgr.statuses.filter( - (it) => it.ofAttribute === attr._id && it.name === s.name && it._id !== s._id + (it) => + it.ofAttribute === attr._id && + it.name.toLowerCase().trim() === s.name.toLowerCase().trim() && + it._id !== s._id ) if (statuses !== undefined) { target.push(...statuses.map((it) => it._id)) @@ -270,7 +273,7 @@ export class StatusMiddleware extends BasePresentationMiddleware implements Pres ret = (a.$lookup?.category?.order ?? 0) - (b.$lookup?.category?.order ?? 0) } if (ret === 0) { - if (a.name === b.name) { + if (a.name.toLowerCase().trim() === b.name.toLowerCase().trim()) { return 0 } ret = a.rank.localeCompare(b.rank) diff --git a/plugins/view-resources/src/utils.ts b/plugins/view-resources/src/utils.ts index 7d91fbde5b2..924bbe9d020 100644 --- a/plugins/view-resources/src/utils.ts +++ b/plugins/view-resources/src/utils.ts @@ -614,18 +614,18 @@ export async function groupByStatusCategories ( for (const v of categories) { const status = mgr.byId.get(v) if (status !== undefined) { - let fst = statusMap.get(status.name) + let fst = statusMap.get(status.name.toLowerCase().trim()) if (fst === undefined) { const statuses = mgr.statuses .filter( (it) => it.ofAttribute === status.ofAttribute && - it.name === status.name && + it.name.toLowerCase().trim() === status.name.toLowerCase().trim() && (categories.includes(it._id) || it.space === status.space) ) .sort((a, b) => a.rank.localeCompare(b.rank)) fst = new StatusValue(status.name, status.color, statuses) - statusMap.set(status.name, fst) + statusMap.set(status.name.toLowerCase().trim(), fst) existingCategories.push(fst) } }