fix(ui): bugfixes

This commit is contained in:
sylenien 2022-06-10 15:50:08 +02:00 committed by Delirium
parent 43f52a9dcd
commit fee99d3bf1
9 changed files with 24 additions and 22 deletions

View file

@ -11,7 +11,7 @@ const EventsBlockConnected = connectPlayer(state => ({
playing: state.playing, playing: state.playing,
}))(EventsBlock) }))(EventsBlock)
export default function RightBlock(props) { function RightBlock(props) {
const { activeTab } = props; const { activeTab } = props;
const renderActiveTab = (tab) => { const renderActiveTab = (tab) => {
@ -28,3 +28,5 @@ export default function RightBlock(props) {
</div> </div>
) )
} }
export default React.memo(RightBlock)

View file

@ -35,11 +35,9 @@ function PlayerContent({ live, fullscreen, activeTab }) {
) )
} }
function RightMenu({ showEvents, live, tabs, activeTab, setActiveTab, fullscreen }) { function RightMenu({ live, tabs, activeTab, setActiveTab, fullscreen }) {
return showEvents && !live && !fullscreen && <RightBlock tabs={tabs} setActiveTab={setActiveTab} activeTab={activeTab} /> return !live && !fullscreen && <RightBlock tabs={tabs} setActiveTab={setActiveTab} activeTab={activeTab} />
} }
const ConnectedMenu = connectPlayer(state => ({
showEvents: state.showEvents}), { toggleEvents })(RightMenu)
function WebPlayer (props) { function WebPlayer (props) {
const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt, config } = props; const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt, config } = props;
@ -68,13 +66,14 @@ function WebPlayer (props) {
closeBottomBlock(); closeBottomBlock();
}, []) }, [])
return ( return (
<PlayerProvider> <PlayerProvider>
<InitLoader className="flex-1"> <InitLoader className="flex-1">
<PlayerBlockHeader activeTab={activeTab} setActiveTab={setActiveTab} tabs={TABS} fullscreen={fullscreen}/> <PlayerBlockHeader activeTab={activeTab} setActiveTab={setActiveTab} tabs={TABS} fullscreen={fullscreen}/>
<div className="flex"> <div className="flex">
<div className="w-full"><PlayerContentConnected activeTab={activeTab} fullscreen={fullscreen} live={live} /></div> <div className="w-full"><PlayerContentConnected activeTab={activeTab} fullscreen={fullscreen} live={live} /></div>
{activeTab !== '' && <ConnectedMenu activeTab={activeTab} setActiveTab={setActiveTab} fullscreen={fullscreen} tabs={TABS} live={live} />} {activeTab !== '' && <RightMenu activeTab={activeTab} setActiveTab={setActiveTab} fullscreen={fullscreen} tabs={TABS} live={live} />}
</div> </div>
</InitLoader> </InitLoader>
</PlayerProvider> </PlayerProvider>

View file

@ -38,7 +38,7 @@ const LOAD_TIME_COLOR = "red";
export function renderType(r) { export function renderType(r) {
return ( return (
<Popup content={ <div className={ stl.popupNameContent }>{ r.type }</div> } > <Popup style={{width: '100%'}} content={ <div className={ stl.popupNameContent }>{ r.type }</div> } >
<div className={ stl.popupNameTrigger }>{ r.type }</div> <div className={ stl.popupNameTrigger }>{ r.type }</div>
</Popup> </Popup>
); );
@ -46,7 +46,7 @@ export function renderType(r) {
export function renderName(r) { export function renderName(r) {
return ( return (
<Popup content={ <div className={ stl.popupNameContent }>{ r.url }</div> } > <Popup style={{width: '100%'}} content={ <div className={ stl.popupNameContent }>{ r.url }</div> } >
<div className={ stl.popupNameTrigger }>{ r.name }</div> <div className={ stl.popupNameTrigger }>{ r.name }</div>
</Popup> </Popup>
); );
@ -94,7 +94,7 @@ function renderSize(r) {
} }
return ( return (
<Popup content={ content } > <Popup style={{width: '100%'}} content={ content } >
<div>{ triggerText }</div> <div>{ triggerText }</div>
</Popup> </Popup>
); );
@ -118,6 +118,7 @@ export function renderDuration(r) {
return ( return (
<Popup <Popup
style={{width: '100%'}}
content={ tooltipText } content={ tooltipText }
> >
<div className={ cn(className, stl.duration) } > { text } </div> <div className={ cn(className, stl.duration) } > { text } </div>

View file

@ -347,7 +347,7 @@ export default class Controls extends React.Component {
onClick={ this.props.toggleSkip } onClick={ this.props.toggleSkip }
data-disabled={ disabled } data-disabled={ disabled }
> >
<span className={ styles.checkIcon } /> {skip && <Icon name="check" size="24" className="mr-1" />}
{ 'Skip Inactivity' } { 'Skip Inactivity' }
</button> </button>
</div> </div>

View file

@ -13,6 +13,8 @@ import CustomDragLayer from './CustomDragLayer';
import { debounce } from 'App/utils'; import { debounce } from 'App/utils';
import { Tooltip } from 'react-tippy'; import { Tooltip } from 'react-tippy';
const BOUNDRY = 15
const getPointerIcon = (type) => { const getPointerIcon = (type) => {
// exception, // exception,
switch(type) { switch(type) {
@ -116,7 +118,7 @@ export default class Timeline extends React.PureComponent {
onDrag = (offset) => { onDrag = (offset) => {
const { endTime } = this.props; 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); const time = Math.max(Math.round(p * endTime), 0);
deboucneJump(time); deboucneJump(time);
if (this.props.playing) { if (this.props.playing) {
@ -147,7 +149,7 @@ export default class Timeline extends React.PureComponent {
return ( return (
<div <div
className="flex items-center absolute w-full" className="flex items-center absolute w-full"
style={{ top: '-5px', zIndex: 100, padding: '0 15px'}} style={{ top: '-5px', zIndex: 100, padding: `0 ${BOUNDRY}px`}}
> >
<div <div
className={ stl.progress } className={ stl.progress }
@ -155,7 +157,7 @@ export default class Timeline extends React.PureComponent {
ref={ this.progressRef } ref={ this.progressRef }
> >
<DraggableCircle left={this.props.time * scale} onDrop={this.onDragEnd} /> <DraggableCircle left={this.props.time * scale} onDrop={this.onDragEnd} />
<CustomDragLayer onDrag={this.onDrag} minX={70} maxX={this.progressRef.current && this.progressRef.current.offsetWidth + 70} /> <CustomDragLayer onDrag={this.onDrag} minX={BOUNDRY} maxX={this.progressRef.current && this.progressRef.current.offsetWidth + BOUNDRY} />
<TimeTracker scale={ scale } /> <TimeTracker scale={ scale } />
{ skip && skipIntervals.map(interval => { skip && skipIntervals.map(interval =>
(<div (<div

View file

@ -85,12 +85,6 @@
} }
} }
.checkIcon {
@mixin icon check, $gray-dark, 24px;
margin-right: 2px;
display: none;
}
.liveTag { .liveTag {
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;

View file

@ -48,7 +48,6 @@ function SubHeader(props) {
entity="sessions" entity="sessions"
id={ props.sessionId } id={ props.sessionId }
showCopyLink={true} showCopyLink={true}
time={props.time}
trigger={ trigger={
<div className="flex items-center hover:bg-gray-light-shade rounded-md p-1"> <div className="flex items-center hover:bg-gray-light-shade rounded-md p-1">
<Icon <Icon
@ -75,6 +74,6 @@ function SubHeader(props) {
) )
} }
const SubH = connectPlayer(state => ({ currentLocation: state.location, time: state.time }))(SubHeader) const SubH = connectPlayer(state => ({ currentLocation: state.location }))(SubHeader)
export default React.memo(SubH) export default React.memo(SubH)

View file

@ -39,6 +39,7 @@ const BarRow = ({ resource: { time, ttfb = 0, duration, key }, popup=false, time
<div key={ key } className={ tableStyles.row } > <div key={ key } className={ tableStyles.row } >
<Popup <Popup
basic basic
style={{ width: '100%' }}
unmountHTMLWhenHide unmountHTMLWhenHide
content={ content={
<React.Fragment> <React.Fragment>
@ -81,4 +82,4 @@ const BarRow = ({ resource: { time, ttfb = 0, duration, key }, popup=false, time
BarRow.displayName = "BarRow"; BarRow.displayName = "BarRow";
export default BarRow; export default BarRow;

View file

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { toast } from 'react-toastify'; import { toast } from 'react-toastify';
import { connectPlayer } from 'Player'
import withRequest from 'HOCs/withRequest'; import withRequest from 'HOCs/withRequest';
import { Popup, Dropdown, Icon, Button } from 'UI'; import { Popup, Dropdown, Icon, Button } from 'UI';
import styles from './sharePopup.module.css'; import styles from './sharePopup.module.css';
@ -9,6 +10,9 @@ import SessionCopyLink from './SessionCopyLink';
import Select from 'Shared/Select'; import Select from 'Shared/Select';
import { Tooltip } from 'react-tippy'; import { Tooltip } from 'react-tippy';
@connectPlayer(state => ({
time: state.time,
}))
@connect(state => ({ @connect(state => ({
channels: state.getIn([ 'slack', 'list' ]), channels: state.getIn([ 'slack', 'list' ]),
tenantId: state.getIn([ 'user', 'account', 'tenantId' ]), tenantId: state.getIn([ 'user', 'account', 'tenantId' ]),