mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
refactor, align config with rest
This commit is contained in:
@@ -82,26 +82,7 @@ export class AdminNotifyDashboardComponent implements OnInit{
|
|||||||
return this.metricsConfig.map(row => {
|
return this.metricsConfig.map(row => {
|
||||||
return {
|
return {
|
||||||
...row,
|
...row,
|
||||||
boxes: row.boxes.map(rowBox => {
|
boxes: row.boxes.map(rowBox =>boxesWithCount.find(boxWithCount => boxWithCount.config === rowBox.config))
|
||||||
// TODO remove aggregate once rest is updated
|
|
||||||
if (rowBox.isRowAggregateCount) {
|
|
||||||
const currentRowBoxesWithCount = row.boxes.filter(box => !box.isRowAggregateCount)
|
|
||||||
.map(notAggregateBox => {
|
|
||||||
return {
|
|
||||||
...notAggregateBox,
|
|
||||||
count: boxesWithCount.find(boxWithCount => boxWithCount.config === notAggregateBox.config)?.count
|
|
||||||
};
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
...rowBox,
|
|
||||||
count: currentRowBoxesWithCount.map(box => box.count).reduce((accumulator, currentValue) => {
|
|
||||||
return accumulator + currentValue;
|
|
||||||
},0)
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return boxesWithCount.find(boxWithCount => boxWithCount.config === rowBox.config);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,6 @@ export interface AdminNotifyMetricsBox {
|
|||||||
title: string;
|
title: string;
|
||||||
config: string;
|
config: string;
|
||||||
count?: number;
|
count?: number;
|
||||||
isRowAggregateCount?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminNotifyMetricsRow {
|
export interface AdminNotifyMetricsRow {
|
||||||
|
@@ -475,8 +475,7 @@ export class DefaultAppConfig implements AppConfig {
|
|||||||
color: '#43515F',
|
color: '#43515F',
|
||||||
title: 'admin-notify-dashboard.involved-items',
|
title: 'admin-notify-dashboard.involved-items',
|
||||||
textColor: '#fff',
|
textColor: '#fff',
|
||||||
config: '',
|
config: 'NOTIFY.incoming.involvedItems',
|
||||||
isRowAggregateCount: true
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -507,8 +506,7 @@ export class DefaultAppConfig implements AppConfig {
|
|||||||
color: '#43515F',
|
color: '#43515F',
|
||||||
title: 'admin-notify-dashboard.involved-items',
|
title: 'admin-notify-dashboard.involved-items',
|
||||||
textColor: '#fff',
|
textColor: '#fff',
|
||||||
config: '',
|
config: 'NOTIFY.outgoing.involvedItems',
|
||||||
isRowAggregateCount: true
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -347,8 +347,7 @@ export const environment: BuildConfig = {
|
|||||||
color: '#43515F',
|
color: '#43515F',
|
||||||
title: 'admin-notify-dashboard.involved-items',
|
title: 'admin-notify-dashboard.involved-items',
|
||||||
textColor: '#fff',
|
textColor: '#fff',
|
||||||
config: '',
|
config: 'NOTIFY.incoming.involvedItems',
|
||||||
isRowAggregateCount: true
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -379,8 +378,7 @@ export const environment: BuildConfig = {
|
|||||||
color: '#43515F',
|
color: '#43515F',
|
||||||
title: 'admin-notify-dashboard.involved-items',
|
title: 'admin-notify-dashboard.involved-items',
|
||||||
textColor: '#fff',
|
textColor: '#fff',
|
||||||
config: '',
|
config: 'NOTIFY.outgoing.involvedItems',
|
||||||
isRowAggregateCount: true
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user