(props)
| 66 | This is the container that generates the Charts together with the menu |
| 67 | */ |
| 68 | function Chart(props) { |
| 69 | const { |
| 70 | chart, |
| 71 | isPublic = false, |
| 72 | print = "", |
| 73 | height = 300, |
| 74 | showExport = false, |
| 75 | editingLayout = false, |
| 76 | onEditLayout = () => {}, |
| 77 | dashboardFilters: externalDashboardFilters = null, |
| 78 | chartFilters: externalChartFilters = null, |
| 79 | onAddChartFilter = null, |
| 80 | onClearChartFilter = null, |
| 81 | onRefreshRuntimeChart = null, |
| 82 | } = props; |
| 83 | |
| 84 | const team = useSelector(selectTeam); |
| 85 | const user = useSelector(selectUser); |
| 86 | |
| 87 | const params = useParams(); |
| 88 | const navigate = useNavigate(); |
| 89 | const dispatch = useDispatch(); |
| 90 | |
| 91 | const [chartLoading, setChartLoading] = useState(false); |
| 92 | const [error, setError] = useState(false); |
| 93 | const [deleteModal, setDeleteModal] = useState(false); |
| 94 | const [publicModal, setPublicModal] = useState(false); |
| 95 | const [embedModal, setEmbedModal] = useState(false); |
| 96 | const [updateModal, setUpdateModal] = useState(false); |
| 97 | const [updateFrequency, setUpdateFrequency] = useState(false); |
| 98 | const [autoUpdateLoading, setAutoUpdateLoading] = useState(false); |
| 99 | const [publicLoading, setPublicLoading] = useState(false); |
| 100 | const [dashboardFilters, setDashboardFilters] = useState( |
| 101 | getFiltersFromStorage(params.projectId) |
| 102 | ); |
| 103 | const [conditions, setConditions] = useState([]); |
| 104 | const [redraw, setRedraw] = useState(false); |
| 105 | const [updateFreqType, setUpdateFreqType] = useState("hours"); |
| 106 | const [customUpdateFreq, setCustomUpdateFreq] = useState(""); |
| 107 | const [autoUpdateError, setAutoUpdateError] = useState(""); |
| 108 | const [exportLoading, setExportLoading] = useState(false); |
| 109 | const [alertsModal, setAlertsModal] = useState(false); |
| 110 | const [alertsDatasetId, setAlertsDatasetId] = useState(null); |
| 111 | const chartSize = useChartSize(chart.layout); |
| 112 | const [isCompact, setIsCompact] = useState(false); |
| 113 | const containerRef = useRef(null); |
| 114 | const isRuntimeManaged = typeof onRefreshRuntimeChart === "function"; |
| 115 | const activeDashboardFilters = Array.isArray(externalDashboardFilters) |
| 116 | ? externalDashboardFilters |
| 117 | : (dashboardFilters || []); |
| 118 | const activeChartFilters = Array.isArray(externalChartFilters) |
| 119 | ? externalChartFilters |
| 120 | : conditions; |
| 121 | const runtimeRequest = buildChartRuntimeRequest({ |
| 122 | chart, |
| 123 | dashboardFilters: activeDashboardFilters, |
| 124 | chartFilters: activeChartFilters, |
| 125 | }); |
nothing calls this directly
no test coverage detected