From fee99d3bf18896a0df5967ba4e64d2180bbf3a3f Mon Sep 17 00:00:00 2001 From: sylenien Date: Fri, 10 Jun 2022 15:50:08 +0200 Subject: [PATCH] fix(ui): bugfixes --- frontend/app/components/Session/RightBlock.tsx | 4 +++- frontend/app/components/Session/WebPlayer.js | 9 ++++----- .../app/components/Session_/Network/NetworkContent.js | 7 ++++--- .../app/components/Session_/Player/Controls/Controls.js | 2 +- .../app/components/Session_/Player/Controls/Timeline.js | 8 +++++--- .../Session_/Player/Controls/controls.module.css | 6 ------ frontend/app/components/Session_/Subheader.js | 3 +-- frontend/app/components/Session_/TimeTable/BarRow.js | 3 ++- frontend/app/components/shared/SharePopup/SharePopup.js | 4 ++++ 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/frontend/app/components/Session/RightBlock.tsx b/frontend/app/components/Session/RightBlock.tsx index d549e905d..8ae42b622 100644 --- a/frontend/app/components/Session/RightBlock.tsx +++ b/frontend/app/components/Session/RightBlock.tsx @@ -11,7 +11,7 @@ const EventsBlockConnected = connectPlayer(state => ({ playing: state.playing, }))(EventsBlock) -export default function RightBlock(props) { +function RightBlock(props) { const { activeTab } = props; const renderActiveTab = (tab) => { @@ -28,3 +28,5 @@ export default function RightBlock(props) { ) } + +export default React.memo(RightBlock) diff --git a/frontend/app/components/Session/WebPlayer.js b/frontend/app/components/Session/WebPlayer.js index 30a0926c0..c0a8442be 100644 --- a/frontend/app/components/Session/WebPlayer.js +++ b/frontend/app/components/Session/WebPlayer.js @@ -35,11 +35,9 @@ function PlayerContent({ live, fullscreen, activeTab }) { ) } -function RightMenu({ showEvents, live, tabs, activeTab, setActiveTab, fullscreen }) { - return showEvents && !live && !fullscreen && +function RightMenu({ live, tabs, activeTab, setActiveTab, fullscreen }) { + return !live && !fullscreen && } -const ConnectedMenu = connectPlayer(state => ({ - showEvents: state.showEvents}), { toggleEvents })(RightMenu) function WebPlayer (props) { const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt, config } = props; @@ -68,13 +66,14 @@ function WebPlayer (props) { closeBottomBlock(); }, []) + return (
- {activeTab !== '' && } + {activeTab !== '' && }
diff --git a/frontend/app/components/Session_/Network/NetworkContent.js b/frontend/app/components/Session_/Network/NetworkContent.js index 751bea726..5501ae438 100644 --- a/frontend/app/components/Session_/Network/NetworkContent.js +++ b/frontend/app/components/Session_/Network/NetworkContent.js @@ -38,7 +38,7 @@ const LOAD_TIME_COLOR = "red"; export function renderType(r) { return ( - { r.type } } > + { r.type } } >
{ r.type }
); @@ -46,7 +46,7 @@ export function renderType(r) { export function renderName(r) { return ( - { r.url } } > + { r.url } } >
{ r.name }
); @@ -94,7 +94,7 @@ function renderSize(r) { } return ( - +
{ triggerText }
); @@ -118,6 +118,7 @@ export function renderDuration(r) { return (
{ text }
diff --git a/frontend/app/components/Session_/Player/Controls/Controls.js b/frontend/app/components/Session_/Player/Controls/Controls.js index 303d35b99..48f738247 100644 --- a/frontend/app/components/Session_/Player/Controls/Controls.js +++ b/frontend/app/components/Session_/Player/Controls/Controls.js @@ -347,7 +347,7 @@ export default class Controls extends React.Component { onClick={ this.props.toggleSkip } data-disabled={ disabled } > - + {skip && } { 'Skip Inactivity' } diff --git a/frontend/app/components/Session_/Player/Controls/Timeline.js b/frontend/app/components/Session_/Player/Controls/Timeline.js index c6562f49e..1dffbee1b 100644 --- a/frontend/app/components/Session_/Player/Controls/Timeline.js +++ b/frontend/app/components/Session_/Player/Controls/Timeline.js @@ -13,6 +13,8 @@ import CustomDragLayer from './CustomDragLayer'; import { debounce } from 'App/utils'; import { Tooltip } from 'react-tippy'; +const BOUNDRY = 15 + const getPointerIcon = (type) => { // exception, switch(type) { @@ -116,7 +118,7 @@ export default class Timeline extends React.PureComponent { onDrag = (offset) => { const { endTime } = this.props; - const p = (offset.x - 60) / this.progressRef.current.offsetWidth; + const p = (offset.x - BOUNDRY) / this.progressRef.current.offsetWidth; const time = Math.max(Math.round(p * endTime), 0); deboucneJump(time); if (this.props.playing) { @@ -147,7 +149,7 @@ export default class Timeline extends React.PureComponent { return (
- + { skip && skipIntervals.map(interval => (
({ currentLocation: state.location, time: state.time }))(SubHeader) +const SubH = connectPlayer(state => ({ currentLocation: state.location }))(SubHeader) export default React.memo(SubH) diff --git a/frontend/app/components/Session_/TimeTable/BarRow.js b/frontend/app/components/Session_/TimeTable/BarRow.js index fcadc8961..b53661403 100644 --- a/frontend/app/components/Session_/TimeTable/BarRow.js +++ b/frontend/app/components/Session_/TimeTable/BarRow.js @@ -39,6 +39,7 @@ const BarRow = ({ resource: { time, ttfb = 0, duration, key }, popup=false, time
@@ -81,4 +82,4 @@ const BarRow = ({ resource: { time, ttfb = 0, duration, key }, popup=false, time BarRow.displayName = "BarRow"; -export default BarRow; \ No newline at end of file +export default BarRow; diff --git a/frontend/app/components/shared/SharePopup/SharePopup.js b/frontend/app/components/shared/SharePopup/SharePopup.js index e72a87056..a1dd59a4f 100644 --- a/frontend/app/components/shared/SharePopup/SharePopup.js +++ b/frontend/app/components/shared/SharePopup/SharePopup.js @@ -1,6 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { toast } from 'react-toastify'; +import { connectPlayer } from 'Player' import withRequest from 'HOCs/withRequest'; import { Popup, Dropdown, Icon, Button } from 'UI'; import styles from './sharePopup.module.css'; @@ -9,6 +10,9 @@ import SessionCopyLink from './SessionCopyLink'; import Select from 'Shared/Select'; import { Tooltip } from 'react-tippy'; +@connectPlayer(state => ({ + time: state.time, +})) @connect(state => ({ channels: state.getIn([ 'slack', 'list' ]), tenantId: state.getIn([ 'user', 'account', 'tenantId' ]),