diff --git a/frontend/app/Router.js b/frontend/app/Router.js index 50bfc9566..e24997caf 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -68,6 +68,7 @@ const FFLAGS_PATH = routes.fflags(); const FFLAG_PATH = routes.fflag(); const FFLAG_CREATE_PATH = routes.newFFlag(); const NOTES_PATH = routes.notes(); +const BOOKMARKS_PATH = routes.bookmarks(); const ASSIST_PATH = routes.assist(); const RECORDINGS_PATH = routes.recordings(); // const ERRORS_PATH = routes.errors(); @@ -239,6 +240,7 @@ class Router extends React.Component { + } /> diff --git a/frontend/app/components/Overview/Overview.tsx b/frontend/app/components/Overview/Overview.tsx index c3dca2bd9..3bb78a4ce 100644 --- a/frontend/app/components/Overview/Overview.tsx +++ b/frontend/app/components/Overview/Overview.tsx @@ -9,7 +9,7 @@ import OverviewMenu from 'Shared/OverviewMenu'; import FFlagsList from 'Components/FFlags'; import NewFFlag from 'Components/FFlags/NewFFlag'; import { Switch, Route } from 'react-router'; -import { sessions, fflags, withSiteId, newFFlag, fflag, notes } from 'App/routes'; +import { sessions, fflags, withSiteId, newFFlag, fflag, notes, bookmarks } from 'App/routes'; import { withRouter, RouteComponentProps } from 'react-router-dom'; // @ts-ignore @@ -32,7 +32,7 @@ function Overview({ match: { params } }: IProps) {
- +
diff --git a/frontend/app/components/shared/OverviewMenu/OverviewMenu.tsx b/frontend/app/components/shared/OverviewMenu/OverviewMenu.tsx index 04ae307cd..e6b6b8335 100644 --- a/frontend/app/components/shared/OverviewMenu/OverviewMenu.tsx +++ b/frontend/app/components/shared/OverviewMenu/OverviewMenu.tsx @@ -3,7 +3,7 @@ import { SideMenuitem } from 'UI'; import { connect } from 'react-redux'; import { setActiveTab } from 'Duck/search'; import { withRouter, RouteComponentProps } from 'react-router-dom'; -import { sessions, fflags, withSiteId, notes } from "App/routes"; +import { sessions, fflags, withSiteId, notes, bookmarks } from 'App/routes'; interface Props { setActiveTab: (tab: any) => void; @@ -13,10 +13,10 @@ interface Props { const TabToUrlMap = { all: sessions() as '/sessions', - bookmark: sessions() as '/sessions', + bookmark: bookmarks() as '/bookmarks', notes: notes() as '/notes', - flags: fflags() as '/feature-flags', -} + flags: fflags() as '/feature-flags' +}; function OverviewMenu(props: Props & RouteComponentProps) { // @ts-ignore @@ -26,56 +26,57 @@ function OverviewMenu(props: Props & RouteComponentProps) { const currentLocation = location.pathname; const tab = Object.keys(TabToUrlMap).find((tab: keyof typeof TabToUrlMap) => currentLocation.includes(TabToUrlMap[tab])); if (tab && tab !== activeTab) { - props.setActiveTab({ type: tab }) + props.setActiveTab({ type: tab }); } - }, [location.pathname]) + }, [location.pathname]); + return ( -
-
+
+
{ - props.setActiveTab({ type: 'all' }) - !location.pathname.includes(sessions()) && history.push(withSiteId(sessions(), siteId)) + props.setActiveTab({ type: 'all' }); + !location.pathname.includes(sessions()) && history.push(withSiteId(sessions(), siteId)); }} />
-
+
{ - props.setActiveTab({ type: 'bookmark' }) - !location.pathname.includes(sessions()) && history.push(withSiteId(sessions(), siteId)) + // props.setActiveTab({ type: 'bookmark' }); + !location.pathname.includes(bookmarks()) && history.push(withSiteId(bookmarks(), siteId)); }} />
-
+
{ - props.setActiveTab({ type: 'notes' }) - !location.pathname.includes(notes()) && history.push(withSiteId(notes(), siteId)) + props.setActiveTab({ type: 'notes' }); + !location.pathname.includes(notes()) && history.push(withSiteId(notes(), siteId)); }} />
-
+
{ - props.setActiveTab({ type: 'flags' }) - !location.pathname.includes(fflags()) && history.push(withSiteId(fflags(), siteId)) + props.setActiveTab({ type: 'flags' }); + !location.pathname.includes(fflags()) && history.push(withSiteId(fflags(), siteId)); }} />
@@ -84,6 +85,6 @@ function OverviewMenu(props: Props & RouteComponentProps) { } export default connect((state: any) => ({ - activeTab: state.getIn(['search', 'activeTab', 'type']), - isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee', + activeTab: state.getIn(['search', 'activeTab', 'type']), + isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee' }), { setActiveTab })(withRouter(OverviewMenu)); diff --git a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx index 2f1030bb7..7fc253666 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx @@ -98,12 +98,13 @@ function SessionList(props: Props) { // handle scroll position const { scrollY } = props; window.scrollTo(0, scrollY); - if (total === 0) { - setTimeout(() => { - props.fetchSessions(null, true); - }, 300); - } - props.fetchMetadata(); + + // if (total === 0) { + // setTimeout(() => { + // props.fetchSessions(null, true); + // }, 300); + // } + // props.fetchMetadata(); return () => { props.setScrollPosition(window.scrollY); diff --git a/frontend/app/routes.js b/frontend/app/routes.js index 1e030f208..0337820e8 100644 --- a/frontend/app/routes.js +++ b/frontend/app/routes.js @@ -87,6 +87,7 @@ export const fflags = params => queried('/feature-flags', params); export const newFFlag = () => '/feature-flags/create'; export const fflag = (id = ':fflagId', hash) => hashed(`/feature-flags/${ id }`, hash); export const notes = params => queried('/notes', params); +export const bookmarks = params => queried('/bookmarks', params); export const assist = params => queried('/assist', params); export const recordings = params => queried("/recordings", params); export const multiviewIndex = params => queried('/multiview', params); @@ -124,6 +125,7 @@ const REQUIRED_SITE_ID_ROUTES = [ newFFlag(), fflag(), notes(), + bookmarks(), fflags(), assist(), recordings(), @@ -177,6 +179,7 @@ export function isRoute(route, path){ const SITE_CHANGE_AVALIABLE_ROUTES = [ sessions(), notes(), + bookmarks(), fflags(), funnels(), assist(),