refactor: fix dashboard filter issue
This commit is contained in:
@@ -276,6 +276,7 @@ export default function DashboardPage() {
|
|||||||
setProjectSummary(null);
|
setProjectSummary(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setProjectSummary(null);
|
||||||
|
|
||||||
const loadProjectSummary = async () => {
|
const loadProjectSummary = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -360,9 +361,11 @@ export default function DashboardPage() {
|
|||||||
: projectSummary.packages || {};
|
: projectSummary.packages || {};
|
||||||
|
|
||||||
for (const [pkgName, pkg] of Object.entries(packagesToProcess)) {
|
for (const [pkgName, pkg] of Object.entries(packagesToProcess)) {
|
||||||
|
if (!pkg) continue;
|
||||||
|
|
||||||
const chainagesToProcess =
|
const chainagesToProcess =
|
||||||
selectedChainageId && selectedChainageId !== 'all'
|
selectedChainageId && selectedChainageId !== 'all'
|
||||||
? { [selectedChainageId]: pkg.chainages[selectedChainageId] }
|
? { [selectedChainageId]: pkg.chainages?.[selectedChainageId] }
|
||||||
: pkg.chainages || {};
|
: pkg.chainages || {};
|
||||||
|
|
||||||
for (const [chnName, chn] of Object.entries(chainagesToProcess)) {
|
for (const [chnName, chn] of Object.entries(chainagesToProcess)) {
|
||||||
|
|||||||
@@ -58,9 +58,11 @@ export function DashboardMap({
|
|||||||
: projectSummary.packages || {};
|
: projectSummary.packages || {};
|
||||||
|
|
||||||
for (const [pkgName, pkg] of Object.entries(packagesToProcess)) {
|
for (const [pkgName, pkg] of Object.entries(packagesToProcess)) {
|
||||||
|
if (!pkg) continue;
|
||||||
|
|
||||||
const chainagesToProcess =
|
const chainagesToProcess =
|
||||||
selectedChainageId && selectedChainageId !== 'all'
|
selectedChainageId && selectedChainageId !== 'all'
|
||||||
? { [selectedChainageId]: (pkg as any).chainages[selectedChainageId] }
|
? { [selectedChainageId]: (pkg as any).chainages?.[selectedChainageId] }
|
||||||
: (pkg as any).chainages || {};
|
: (pkg as any).chainages || {};
|
||||||
|
|
||||||
for (const [chnName, chn] of Object.entries(chainagesToProcess)) {
|
for (const [chnName, chn] of Object.entries(chainagesToProcess)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user