mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
refactor: remove lazy loading for metrics page (#733)
This commit is contained in:
parent
33b5e4abac
commit
49c25cbaa6
@ -1,5 +1,5 @@
|
|||||||
import { Tab, Tabs, useMediaQuery } from '@material-ui/core';
|
import { Tab, Tabs, useMediaQuery } from '@material-ui/core';
|
||||||
import React, { Suspense, useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Archive, FileCopy, Label, WatchLater } from '@material-ui/icons';
|
import { Archive, FileCopy, Label, WatchLater } from '@material-ui/icons';
|
||||||
import { Link, Route, useHistory, useParams } from 'react-router-dom';
|
import { Link, Route, useHistory, useParams } from 'react-router-dom';
|
||||||
import useFeatureApi from '../../../hooks/api/actions/useFeatureApi/useFeatureApi';
|
import useFeatureApi from '../../../hooks/api/actions/useFeatureApi/useFeatureApi';
|
||||||
@ -19,6 +19,7 @@ import FeatureLog from './FeatureLog/FeatureLog';
|
|||||||
import FeatureOverview from './FeatureOverview/FeatureOverview';
|
import FeatureOverview from './FeatureOverview/FeatureOverview';
|
||||||
import FeatureStrategies from './FeatureStrategies/FeatureStrategies';
|
import FeatureStrategies from './FeatureStrategies/FeatureStrategies';
|
||||||
import FeatureVariants from './FeatureVariants/FeatureVariants';
|
import FeatureVariants from './FeatureVariants/FeatureVariants';
|
||||||
|
import { FeatureMetrics } from './FeatureMetrics/FeatureMetrics';
|
||||||
import { useStyles } from './FeatureView.styles';
|
import { useStyles } from './FeatureView.styles';
|
||||||
import FeatureSettings from './FeatureSettings/FeatureSettings';
|
import FeatureSettings from './FeatureSettings/FeatureSettings';
|
||||||
import useLoading from '../../../hooks/useLoading';
|
import useLoading from '../../../hooks/useLoading';
|
||||||
@ -203,33 +204,31 @@ const FeatureView = () => {
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Suspense fallback={null}>
|
<Route
|
||||||
<Route
|
exact
|
||||||
exact
|
path={`/projects/:projectId/features/:featureId`}
|
||||||
path={`/projects/:projectId/features/:featureId`}
|
component={FeatureOverview}
|
||||||
component={FeatureOverview}
|
/>
|
||||||
/>
|
<Route
|
||||||
<Route
|
path={`/projects/:projectId/features/:featureId/strategies`}
|
||||||
path={`/projects/:projectId/features/:featureId/strategies`}
|
component={FeatureStrategies}
|
||||||
component={FeatureStrategies}
|
/>
|
||||||
/>
|
<Route
|
||||||
<Route
|
path={`/projects/:projectId/features/:featureId/metrics`}
|
||||||
path={`/projects/:projectId/features/:featureId/metrics`}
|
component={FeatureMetrics}
|
||||||
component={FeatureMetricsLazy}
|
/>
|
||||||
/>
|
<Route
|
||||||
<Route
|
path={`/projects/:projectId/features/:featureId/logs`}
|
||||||
path={`/projects/:projectId/features/:featureId/logs`}
|
component={FeatureLog}
|
||||||
component={FeatureLog}
|
/>
|
||||||
/>
|
<Route
|
||||||
<Route
|
path={`/projects/:projectId/features/:featureId/variants`}
|
||||||
path={`/projects/:projectId/features/:featureId/variants`}
|
component={FeatureVariants}
|
||||||
component={FeatureVariants}
|
/>
|
||||||
/>
|
<Route
|
||||||
<Route
|
path={`/projects/:projectId/features/:featureId/settings`}
|
||||||
path={`/projects/:projectId/features/:featureId/settings`}
|
component={FeatureSettings}
|
||||||
component={FeatureSettings}
|
/>
|
||||||
/>
|
|
||||||
</Suspense>
|
|
||||||
<Dialogue
|
<Dialogue
|
||||||
onClick={() => archiveToggle()}
|
onClick={() => archiveToggle()}
|
||||||
open={showDelDialog}
|
open={showDelDialog}
|
||||||
@ -256,8 +255,4 @@ const FeatureView = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const FeatureMetricsLazy = React.lazy(
|
|
||||||
() => import('./FeatureMetrics/FeatureMetrics')
|
|
||||||
);
|
|
||||||
|
|
||||||
export default FeatureView;
|
export default FeatureView;
|
||||||
|
Loading…
Reference in New Issue
Block a user