diff --git a/frontend/app/components/Alerts/AlertFormModal/AlertFormModal.tsx b/frontend/app/components/Alerts/AlertFormModal/AlertFormModal.tsx index 5cf30c278..f6fd62ad5 100644 --- a/frontend/app/components/Alerts/AlertFormModal/AlertFormModal.tsx +++ b/frontend/app/components/Alerts/AlertFormModal/AlertFormModal.tsx @@ -57,14 +57,14 @@ function AlertFormModal(props) { title={
{ 'Create Alert' } - toggleForm({}, true) } - /> + /> */}
} isDisplayed={ showModal } diff --git a/frontend/app/components/Dashboard/Dashboard.js b/frontend/app/components/Dashboard/Dashboard.js index 718501081..dc1355c20 100644 --- a/frontend/app/components/Dashboard/Dashboard.js +++ b/frontend/app/components/Dashboard/Dashboard.js @@ -114,6 +114,7 @@ function isInViewport(el) { comparing: state.getIn([ 'dashboard', 'comparing' ]), platform: state.getIn([ 'dashboard', 'platform' ]), dashboardAppearance: state.getIn([ 'user', 'account', 'appearance', 'dashboard' ]), + activeWidget: state.getIn(['customMetrics', 'activeWidget']), }), { setPeriod, setPlatform, fetchMetadataOptions }) @withPageTitle('Metrics - OpenReplay') @withRouter @@ -168,7 +169,7 @@ export default class Dashboard extends React.PureComponent { } render() { - const { dashboardAppearance, comparing } = this.props; + const { dashboardAppearance, comparing, activeWidget } = this.props; const { pageSection } = this.state; const noWidgets = WIDGET_KEYS @@ -189,7 +190,7 @@ export default class Dashboard extends React.PureComponent {
- + { activeWidget && }
{list.map((item: any) => ( diff --git a/frontend/app/components/shared/CustomMetrics/CustomMetrics.tsx b/frontend/app/components/shared/CustomMetrics/CustomMetrics.tsx index 74a7099e1..55495fecc 100644 --- a/frontend/app/components/shared/CustomMetrics/CustomMetrics.tsx +++ b/frontend/app/components/shared/CustomMetrics/CustomMetrics.tsx @@ -1,4 +1,3 @@ -// import CustomMetricWidgetPreview from 'App/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricWidgetPreview'; import React, { useState } from 'react'; import { IconButton, SlideModal } from 'UI'; import CustomMetricForm from './CustomMetricForm'; @@ -13,7 +12,6 @@ interface Props { } function CustomMetrics(props: Props) { const { metric } = props; - // const [showModal, setShowModal] = useState(false); return (
@@ -27,7 +25,6 @@ function CustomMetrics(props: Props) { } isDisplayed={ !!metric } onClose={ () => props.init(null, false)} - // size="medium" content={ (!!metric) && (
props.init(null, false)} /> diff --git a/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.css b/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.css index 90ca94267..05f1ffb8a 100644 --- a/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.css +++ b/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.css @@ -2,4 +2,28 @@ padding: 20px; background-color: #f6f6f6; min-height: calc(100vh - 59px); + } + + .dropdown { + display: flex !important; + padding: 4px 6px; + border-radius: 3px; + color: $gray-darkest; + font-weight: 500; + &:hover { + background-color: $gray-light; + } + } + + .dropdownTrigger { + padding: 4px 8px; + border-radius: 3px; + &:hover { + background-color: $gray-light; + } + } + + .dropdownIcon { + margin-top: 2px; + margin-left: 3px; } \ No newline at end of file diff --git a/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx b/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx index 4ff591856..5a517679a 100644 --- a/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx +++ b/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx @@ -1,9 +1,10 @@ import React, { useEffect, useState } from 'react'; -import { SlideModal, NoContent, Dropdown } from 'UI'; +import { SlideModal, NoContent, Dropdown, Icon } from 'UI'; import SessionItem from 'Shared/SessionItem'; import stl from './SessionListModal.css'; import { connect } from 'react-redux'; import { fetchSessionList, setActiveWidget } from 'Duck/customMetrics'; +import { DateTime } from 'luxon'; interface Props { loading: boolean; @@ -42,36 +43,41 @@ function SessionListModal(props: Props) { const writeOption = (e, { name, value }) => setActiveSeries(value); const filteredSessions = activeSeries === 'all' ? list.reduce((a, b) => a.concat(b.sessions), []) : list.filter(item => item.seriesId === activeSeries).reduce((a, b) => a.concat(b.sessions), []); + const startTime = new DateTime(activeWidget.startTimestamp).toFormat('LLL dd, yyyy HH:mm a'); + const endTime = new DateTime(activeWidget.endTimestamp).toFormat('LLL dd, yyyy HH:mm a'); return (
{ 'Custom Metric: ' + activeWidget.widget.name }
-
- -
)} isDisplayed={ !!activeWidget } onClose={ () => props.setActiveWidget(null)} content={ activeWidget && ( -
+
+
+
Showing all sessions between {startTime} and {endTime}
+
+ Series: + } + /> +
+
-
- { filteredSessions.map(session => ) } -
+ { filteredSessions.map(session => ) }
)} @@ -82,5 +88,5 @@ function SessionListModal(props: Props) { export default connect(state => ({ loading: state.getIn(['customMetrics', 'sessionListRequest', 'loading']), list: state.getIn(['customMetrics', 'sessionList']), - activeWidget: state.getIn(['customMetrics', 'activeWidget']), + // activeWidget: state.getIn(['customMetrics', 'activeWidget']), }), { fetchSessionList, setActiveWidget })(SessionListModal);