fix(ui): fix crashes
This commit is contained in:
parent
a981958940
commit
a70058cf5d
2 changed files with 5 additions and 3 deletions
|
|
@ -51,5 +51,5 @@ function DashboardListItem(props: Props) {
|
|||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
export default connect(state => ({ siteId: state.getIn([ 'site', 'siteId' ]) }))(withRouter(DashboardListItem))
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ function AddMetric({ metrics, history, siteId, title, description }: IProps) {
|
|||
</div>
|
||||
|
||||
<div className="grid h-full grid-cols-4 gap-4 px-8 items-start py-1" style={{ maxHeight: 'calc(100vh - 160px)', overflowY: 'auto' }}>
|
||||
{metrics.map((metric: any) => (
|
||||
{metrics ? metrics.map((metric: any) => (
|
||||
<WidgetWrapper
|
||||
key={metric.metricId}
|
||||
widget={metric}
|
||||
|
|
@ -76,7 +76,9 @@ function AddMetric({ metrics, history, siteId, title, description }: IProps) {
|
|||
isWidget={metric.metricType === 'predefined'}
|
||||
onClick={() => dashboardStore.toggleWidgetSelection(metric)}
|
||||
/>
|
||||
))}
|
||||
)) : (
|
||||
<div>No custom metrics created.</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="py-4 border-t px-8 bg-white w-full flex items-center justify-between">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue