diff --git a/frontend/app/PrivateRoutes.tsx b/frontend/app/PrivateRoutes.tsx index af356772d..aacb1b133 100644 --- a/frontend/app/PrivateRoutes.tsx +++ b/frontend/app/PrivateRoutes.tsx @@ -1,4 +1,5 @@ import withSiteIdUpdater from 'HOCs/withSiteIdUpdater'; +import withSiteIdUpdater from 'HOCs/withSiteIdUpdater'; import React, { Suspense, lazy } from 'react'; import { Redirect, Route, Switch } from 'react-router-dom'; import { observer } from 'mobx-react-lite'; diff --git a/frontend/app/components/Dashboard/components/MetricsList/ListView.tsx b/frontend/app/components/Dashboard/components/MetricsList/ListView.tsx index 061a2c94f..cc8da4096 100644 --- a/frontend/app/components/Dashboard/components/MetricsList/ListView.tsx +++ b/frontend/app/components/Dashboard/components/MetricsList/ListView.tsx @@ -1,20 +1,17 @@ -import React, { useState, useMemo } from 'react'; +import React, { useState } from 'react'; import { Table, Typography, - Tag, Tooltip, Input, Button, Dropdown, Modal as AntdModal, - Avatar, TableColumnType + Avatar, TableColumnType, Spin } from 'antd'; import { - TeamOutlined, - LockOutlined, EditOutlined, - DeleteOutlined + DeleteOutlined, } from '@ant-design/icons'; import { EllipsisVertical } from 'lucide-react'; import { TablePaginationConfig, SorterResult } from 'antd/lib/table/interface'; @@ -27,6 +24,7 @@ import cn from 'classnames'; import { TYPE_ICONS, TYPE_NAMES } from 'App/constants/card'; import Widget from 'App/mstore/types/widget'; import { useTranslation } from 'react-i18next'; +import ORLoader from 'Shared/ORLoader'; const { Text } = Typography; @@ -41,14 +39,14 @@ interface Props { } const ListView: React.FC = ({ - list, - siteId, - selectedList, - toggleSelection, - disableSelection = false, - inLibrary = false, - loading = false - }) => { + list, + siteId, + selectedList, + toggleSelection, + disableSelection = false, + inLibrary = false, + loading = false +}) => { const { t } = useTranslation(); const [editingMetricId, setEditingMetricId] = useState(null); const [newName, setNewName] = useState(''); @@ -238,14 +236,6 @@ const ListView: React.FC = ({ }); } - // if (metricStore.sort.field) { - // columns.forEach((col) => { - // col.sortOrder = col.key === metricStore.sort.field ? metricStore.sort.order : false; - // }); - // } - - console.log('store', metricStore.sort); - const handleTableChange = ( pag: TablePaginationConfig, _filters: Record, @@ -264,13 +254,17 @@ const ListView: React.FC = ({ return ( <> } />, + }} onRow={ inLibrary ? (record) => ({ diff --git a/frontend/app/components/shared/ORLoader.tsx b/frontend/app/components/shared/ORLoader.tsx new file mode 100644 index 000000000..ae486d716 --- /dev/null +++ b/frontend/app/components/shared/ORLoader.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +const OpenReplayPreloader = require('../../svg/openreplay-preloader.svg').default + +interface ORLoaderProps { + width?: string; + height?: string; +} + +const ORLoader: React.FC = ({ width = '50px', height = '50px' }) => { + return ( +
+ Loading... +
+ ); +}; + +export default ORLoader;