diff --git a/frontend/app/components/Client/Integrations/SlackForm.tsx b/frontend/app/components/Client/Integrations/SlackForm.tsx index 819284a77..018dbe885 100644 --- a/frontend/app/components/Client/Integrations/SlackForm.tsx +++ b/frontend/app/components/Client/Integrations/SlackForm.tsx @@ -37,7 +37,7 @@ const SlackForm = (props: Props) => {

Slack

-
diff --git a/frontend/app/components/Client/Integrations/Teams/TeamsAddForm.tsx b/frontend/app/components/Client/Integrations/Teams/TeamsAddForm.tsx index 04b8e9451..c99ed38f2 100644 --- a/frontend/app/components/Client/Integrations/Teams/TeamsAddForm.tsx +++ b/frontend/app/components/Client/Integrations/Teams/TeamsAddForm.tsx @@ -65,7 +65,7 @@ class TeamsAddForm extends React.PureComponent { name="endpoint" value={instance.endpoint} onChange={this.write} - placeholder="Slack webhook URL" + placeholder="Teams webhook URL" type="text" /> diff --git a/frontend/app/components/Client/Integrations/Teams/TeamsChannelList.tsx b/frontend/app/components/Client/Integrations/Teams/TeamsChannelList.tsx index 9c5189705..6b9533ca5 100644 --- a/frontend/app/components/Client/Integrations/Teams/TeamsChannelList.tsx +++ b/frontend/app/components/Client/Integrations/Teams/TeamsChannelList.tsx @@ -20,7 +20,7 @@ function TeamsChannelList(props: { list: any, edit: (inst: any) => any, onEdit:
Integrate MS Teams with OpenReplay and share insights with the rest of the team, directly from the recording page.
- + } size="small" diff --git a/frontend/app/components/Client/Integrations/Teams/index.tsx b/frontend/app/components/Client/Integrations/Teams/index.tsx index 4814697b8..e51bd64b1 100644 --- a/frontend/app/components/Client/Integrations/Teams/index.tsx +++ b/frontend/app/components/Client/Integrations/Teams/index.tsx @@ -37,7 +37,7 @@ const MSTeams = (props: Props) => {

Microsoft Teams

-
diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx index ffb489b11..0f0f3aafa 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricTableSessions/CustomMetricTableSessions.tsx @@ -1,83 +1,74 @@ -import { useObserver } from "mobx-react-lite"; -import React from "react"; -import SessionItem from "Shared/SessionItem"; -import { Pagination, NoContent } from "UI"; -import { useStore } from "App/mstore"; +import { observer, useObserver } from 'mobx-react-lite'; +import React, { useMemo } from 'react'; +import SessionItem from 'Shared/SessionItem'; +import { Pagination, NoContent } from 'UI'; +import { useStore } from 'App/mstore'; import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; +import Session from 'App/mstore/types/session'; interface Props { - metric: any; - isTemplate?: boolean; - isEdit?: boolean; - data: any; + metric: any; + isTemplate?: boolean; + isEdit?: boolean; + data: any; } function CustomMetricTableSessions(props: Props) { - const { isEdit = false, metric, data } = props; - const { dashboardStore } = useStore(); - const period = dashboardStore.period; + const { isEdit = false, metric, data } = props; - return useObserver(() => ( - - -
-
No relevant sessions found for the selected time period.
-
- } - > -
- {data.sessions && - data.sessions.map((session: any, index: any) => ( -
- -
- ))} + const sessions = useMemo(() => { + return data && data.sessions ? data.sessions.map((session: any) => new Session().fromJson(session)) : []; + }, []); - {isEdit && ( -
- - metric.updateKey("page", page) - } - limit={data.total} - debounceRequest={500} - /> -
- )} - - {!isEdit && ( - - )} + return useObserver(() => ( + + +
+
+ No relevant sessions found for the selected time period. +
+
+ } + > +
+ {sessions && + sessions.map((session: any, index: any) => ( +
+
- - )); + ))} + + {isEdit && ( +
+ metric.updateKey('page', page)} + limit={data.total} + debounceRequest={500} + /> +
+ )} + + {!isEdit && } +
+
+ )); } -export default CustomMetricTableSessions; +export default observer(CustomMetricTableSessions); const ViewMore = ({ total, limit }: any) => - total > limit && ( -
-
-
- All {total} sessions -
-
+ total > limit ? ( +
+
+
+ All {total} sessions
- ); +
+
+ ) : null; diff --git a/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx b/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx index 25ff80e81..90ecd4761 100644 --- a/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx +++ b/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx @@ -86,6 +86,7 @@ function DashboardHeader(props: Props) { showModal(, { right: true }) } icon="plus" + iconSize={24} > Add Card diff --git a/frontend/app/components/Dashboard/components/MetricListItem/MetricListItem.tsx b/frontend/app/components/Dashboard/components/MetricListItem/MetricListItem.tsx index b741dbb8d..795337cb9 100644 --- a/frontend/app/components/Dashboard/components/MetricListItem/MetricListItem.tsx +++ b/frontend/app/components/Dashboard/components/MetricListItem/MetricListItem.tsx @@ -11,27 +11,34 @@ interface Props extends RouteComponentProps { siteId: string; selected?: boolean; toggleSelection?: any; - disableSelection?: boolean + disableSelection?: boolean; } function MetricTypeIcon({ type }: any) { const [card, setCard] = useState(''); useEffect(() => { - const t = TYPES.find(i => i.slug === type); - setCard(t) - }, [type]) + const t = TYPES.find((i) => i.slug === type); + setCard(t); + }, [type]); return ( - {card.title}
} > + {card.title}
}>
- { card.icon && } + {card.icon && }
); } function MetricListItem(props: Props) { - const { metric, history, siteId, selected, toggleSelection = () => {}, disableSelection = false } = props; + const { + metric, + history, + siteId, + selected, + toggleSelection = () => {}, + disableSelection = false, + } = props; const onItemClick = (e: React.MouseEvent) => { if (!disableSelection) { @@ -40,7 +47,7 @@ function MetricListItem(props: Props) { const path = withSiteId(`/metrics/${metric.metricId}`, siteId); history.push(path); }; - + return (
)} - +
-
{metric.name}
+
{metric.name}
{metric.owner}
diff --git a/frontend/app/components/Dashboard/components/MetricTypeItem/MetricTypeItem.tsx b/frontend/app/components/Dashboard/components/MetricTypeItem/MetricTypeItem.tsx index 6a0b8152f..0d5fc4c89 100644 --- a/frontend/app/components/Dashboard/components/MetricTypeItem/MetricTypeItem.tsx +++ b/frontend/app/components/Dashboard/components/MetricTypeItem/MetricTypeItem.tsx @@ -26,7 +26,7 @@ function MetricTypeItem(props: Props) {
void; } function GridView(props: Props) { - const { siteId, list, selectedList, toggleSelection } = props; + const { siteId, list, selectedList, history } = props; + + const onItemClick = (metricId: number) => { + const path = withSiteId(`/metrics/${metricId}`, siteId); + history.push(path); + }; return (
{list.map((metric: any) => ( @@ -17,9 +22,9 @@ function GridView(props: Props) { key={metric.metricId} widget={metric} active={selectedList.includes(metric.metricId)} - // isTemplate={true} + isTemplate={true} isWidget={metric.metricType === 'predefined'} - // onClick={() => toggleSelection(parseInt(metric.metricId))} + onClick={() => onItemClick(parseInt(metric.metricId))} /> ))} @@ -27,4 +32,4 @@ function GridView(props: Props) { ); } -export default GridView; +export default withRouter(GridView); diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx index 29e1785e8..59a1b619a 100644 --- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx +++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx @@ -148,7 +148,7 @@ function WidgetForm(props: Props) { {metric.metricType === INSIGHTS && ( <> - issue category + of