diff --git a/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx b/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx index 8c7ed34a..06c94d78 100644 --- a/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx +++ b/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx @@ -1,7 +1,16 @@ import React, { SyntheticEvent } from 'react'; import { getLocationSrv } from '@grafana/runtime'; -import { Button, HorizontalGroup, IconButton, LoadingPlaceholder, VerticalGroup } from '@grafana/ui'; +import { + Button, + HorizontalGroup, + IconButton, + LoadingPlaceholder, + VerticalGroup, + PENDING_COLOR, + Tooltip, + Icon, +} from '@grafana/ui'; import cn from 'classnames/bind'; import dayjs from 'dayjs'; import { debounce } from 'lodash-es'; @@ -82,7 +91,7 @@ class SchedulesPage extends React.Component { + if (item.warnings.length > 0) { + const tooltipContent = ( +
+ {item.warnings.map((warning: string) => ( +

{warning}

+ ))} +
+ ); + return ( + + + + ); + } + + return null; + }; + renderStatus = (item: Schedule) => { const { store: { scheduleStore }, } = this.props; const relatedEscalationChains = scheduleStore.relatedEscalationChains[item.id]; - + console.log('esc chains', item.number_of_escalation_chains); return ( - - {relatedEscalationChains ? ( - relatedEscalationChains.length ? ( - relatedEscalationChains.map((escalationChain) => ( - - {escalationChain.name} - - )) + {item.number_of_escalation_chains > 0 && ( + + {relatedEscalationChains ? ( + relatedEscalationChains.length ? ( + relatedEscalationChains.map((escalationChain) => ( + + {escalationChain.name} + + )) + ) : ( + 'Not used yet' + ) ) : ( - 'Not used yet' - ) - ) : ( - Loading related escalation chains.... - )} - - } - onHover={this.getUpdateRelatedEscalationChainsHandler(item.id)} - /> + Loading related escalation chains.... + )} + + } + onHover={this.getUpdateRelatedEscalationChainsHandler(item.id)} + /> + )} + {/*