diff --git a/frontend/app/components/Session/RightBlock.tsx b/frontend/app/components/Session/RightBlock.tsx index 3eb802f68..e82909301 100644 --- a/frontend/app/components/Session/RightBlock.tsx +++ b/frontend/app/components/Session/RightBlock.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react' import EventsBlock from '../Session_/EventsBlock'; import PageInsightsPanel from '../Session_/PageInsightsPanel/PageInsightsPanel' import { Controls as PlayerControls } from 'Player'; -import { Tabs } from 'UI'; +import Tabs from './Tabs'; import { connectPlayer } from 'Player'; import NewBadge from 'Shared/NewBadge'; @@ -29,7 +29,7 @@ export default function RightBlock() { } } return ( -
+
{ }
{ - renderActiveTab(activeTab) - } + renderActiveTab(activeTab) + }
- ) + ) } diff --git a/frontend/app/components/Session/Tabs/Tabs.tsx b/frontend/app/components/Session/Tabs/Tabs.tsx new file mode 100644 index 000000000..e59fc9733 --- /dev/null +++ b/frontend/app/components/Session/Tabs/Tabs.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import cn from 'classnames'; +import stl from './tabs.css'; + +interface Props { + tabs: Array; + active: string; + onClick: (key: any) => void; + border?: boolean; + className?: string; +} + +const Tabs = ({ tabs, active, onClick, border = true, className }: Props) => ( +
+ { tabs.map(({ key, text, hidden = false, disabled = false }) => ( + + ))} +
+); + +Tabs.displayName = 'Tabs'; + +export default Tabs; diff --git a/frontend/app/components/Session/Tabs/index.ts b/frontend/app/components/Session/Tabs/index.ts new file mode 100644 index 000000000..07f8cccfe --- /dev/null +++ b/frontend/app/components/Session/Tabs/index.ts @@ -0,0 +1 @@ +export { default } from './Tabs' diff --git a/frontend/app/components/Session/Tabs/tabs.css b/frontend/app/components/Session/Tabs/tabs.css new file mode 100644 index 000000000..0cf1cc320 --- /dev/null +++ b/frontend/app/components/Session/Tabs/tabs.css @@ -0,0 +1,32 @@ +.tabs { + display: flex; + justify-content: flex-start; + align-items: center; + &.bordered { + border-bottom: solid thin $gray-light; + } + } + + .tab { + padding: 14px 15px; + cursor: pointer; + transition: all 0.2s; + color: $gray-darkest; + border-bottom: solid thin transparent; + font-weight: 500; + white-space: nowrap; + + &:hover { + color: $teal; + } + + &.active { + color: $teal; + border-bottom: solid thin $teal; + } + } + + .disabled { + pointer-events: none; + opacity: 0.5; + } diff --git a/frontend/app/components/Session/WebPlayer.js b/frontend/app/components/Session/WebPlayer.js index a4e6a67d2..9e4ba75f5 100644 --- a/frontend/app/components/Session/WebPlayer.js +++ b/frontend/app/components/Session/WebPlayer.js @@ -3,7 +3,7 @@ import { useEffect } from 'react'; import { connect } from 'react-redux'; import { Loader } from 'UI'; import { toggleFullscreen, closeBottomBlock } from 'Duck/components/player'; -import { +import { PlayerProvider, connectPlayer, init as initPlayer, @@ -20,26 +20,33 @@ import PlayerBlock from '../Session_/PlayerBlock'; import styles from '../Session_/session.module.css'; -const InitLoader = connectPlayer(state => ({ +const InitLoader = connectPlayer(state => ({ loading: !state.initialized }))(Loader); -const PlayerContentConnected = connectPlayer(state => ({ +const PlayerContentConnected = connectPlayer(state => ({ showEvents: !state.showEvents }))(PlayerContent); -function PlayerContent({ live, fullscreen, showEvents }) { +function PlayerContent({ live, fullscreen }) { return (
- - { showEvents && !live && !fullscreen && } +
) } +function RightMenu({ showEvents, live, fullscreen }) { + console.log(!live, !fullscreen, showEvents) + return showEvents && !live && !fullscreen && +} + +const ConnectedMenu = connectPlayer(state => ({ + showEvents: !state.showEvents}))(RightMenu) + function WebPlayer (props) { - const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt} = props; + const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt, config, showEvents } = props; useEffect(() => { initPlayer(session, jwt); @@ -60,8 +67,13 @@ function WebPlayer (props) { return ( - - +
+
+ + +
+ +
); @@ -72,6 +84,7 @@ export default connect(state => ({ jwt: state.get('jwt'), // config: state.getIn([ 'user', 'account', 'iceServers' ]), fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]), + showEvents: state.get('showEvents'), }), { toggleFullscreen, closeBottomBlock, diff --git a/frontend/app/components/Session_/Autoplay/Autoplay.js b/frontend/app/components/Session_/Autoplay/Autoplay.js index 3b2b02e00..a9d827bfe 100644 --- a/frontend/app/components/Session_/Autoplay/Autoplay.js +++ b/frontend/app/components/Session_/Autoplay/Autoplay.js @@ -2,7 +2,7 @@ import React, { useEffect } from 'react' import { connect } from 'react-redux' import { setAutoplayValues } from 'Duck/sessions' import { session as sessionRoute } from 'App/routes'; -import { Link, Icon, Toggler, Popup } from 'UI'; +import { Link, Icon, Slider, Toggler } from 'UI'; import { connectPlayer } from 'Player/store'; import { Controls as PlayerControls } from 'Player'; @@ -15,20 +15,21 @@ function Autoplay(props) { return (
- - - - +
- - + Auto-Play +
+ + + + - +
) @@ -41,6 +42,6 @@ const connectAutoplay = connect(state => ({ export default connectAutoplay(connectPlayer(state => ({ autoplay: state.autoplay, -}), { - toggleAutoplay: PlayerControls.toggleAutoplay +}), { + toggleAutoplay: PlayerControls.toggleAutoplay })(Autoplay)) diff --git a/frontend/app/components/Session_/EventsBlock/EventSearch/EventSearch.js b/frontend/app/components/Session_/EventsBlock/EventSearch/EventSearch.js index 2840ef708..1cb1d7dca 100644 --- a/frontend/app/components/Session_/EventsBlock/EventSearch/EventSearch.js +++ b/frontend/app/components/Session_/EventsBlock/EventSearch/EventSearch.js @@ -5,48 +5,44 @@ export default function EventSearch(props) { const { onChange, clearSearch, value, header } = props; const [showSearch, setShowSearch] = useState(false) - useEffect(() => { + useEffect(() => { return () => { clearSearch() } }, []) + + const toggleSearch = () => { + setShowSearch(!showSearch) + clearSearch(); + } return ( -
-
- { showSearch ? -
+
+
+
+ {header} +
toggleSearch()} + className=" flex items-center justify-center bg-white cursor-pointer" + > + +
+
+ {showSearch && ( +
-
{ setShowSearch(!showSearch); clearSearch() }} - className="flex items-center justify-center cursor-pointer absolute right-0" - style={{ height: '30px', width: '32px' }} - > - -
- : - header - } + )}
- { !showSearch && -
setShowSearch(!showSearch)} - className="border rounded flex items-center justify-center bg-white cursor-pointer" - style={{ height: '32px', width: '32px' }} - > - -
- }
) } diff --git a/frontend/app/components/Session_/EventsBlock/EventsBlock.js b/frontend/app/components/Session_/EventsBlock/EventsBlock.js index 8e82ecdd6..9fdc6a4f8 100644 --- a/frontend/app/components/Session_/EventsBlock/EventsBlock.js +++ b/frontend/app/components/Session_/EventsBlock/EventsBlock.js @@ -190,20 +190,20 @@ export default class EventsBlock extends React.PureComponent { return ( <> -
+
{ `User Events (${ events.size })` }
+
User Events { events.size }
} />
({ metadata: state.getIn([ 'sessions', 'current', 'metadata' ]), }))(function Metadata ({ metadata }) { - const [ visible, setVisible ] = useState(false); + metadata = { + test: 'a', + dealership: 'very test wow', + "bklajsdlkas-123": 123123, + test: 'a', + dealership: 'very test wow', + "bklajsdlkas-123": 123123, + test: 'a', + dealership: 'very test wow', + "bklajsdlkas-123": 123123, + test: 'a', + dealership: 'very test wow', + "bklajsdlkas-123": 123123, + test: 'a', + dealership: 'very test wow', + "bklajsdlkas-123": 123123, + test: 'a', + dealership: 'very test wow', + "bklajsdlkas-123": 123123, + } + const metaLenth = Object.keys(metadata).length; - const toggle = useCallback(() => metaLenth > 0 && setVisible(v => !v), []); - + + if (metaLenth === 0) { + return ( + (Check how to use Metadata if you haven’t yet done so.) + ) + } return ( - <> - - Check how to use Metadata if you haven’t yet done so. -
- } - on="click" - disabled={metaLenth > 0} - size="tiny" - inverted - position="top center" - > - - - { visible && -
- - { Object.keys(metadata).map((key) => { - // const key = Object.keys(i)[0] - const value = metadata[key] - return - }) } - -
- } - +
+ { Object.keys(metadata).map((key) => { + // const key = Object.keys(i)[0] + const value = metadata[key] + return + }) } +
); }); diff --git a/frontend/app/components/Session_/EventsBlock/eventsBlock.module.css b/frontend/app/components/Session_/EventsBlock/eventsBlock.module.css index f88cad313..d0243c967 100644 --- a/frontend/app/components/Session_/EventsBlock/eventsBlock.module.css +++ b/frontend/app/components/Session_/EventsBlock/eventsBlock.module.css @@ -1,15 +1,11 @@ .eventsBlock { width: 270px; - /* padding: 0 10px; */ margin-bottom: 5px; } .header { - /* height: 40px; */ - /* margin-bottom: 15px; */ padding-left: 2px; - /* padding-right: 0px; */ - + & .hAndProgress { display:flex; justify-content: space-between; @@ -23,7 +19,7 @@ background: #ffcc99; } & :global(.progress) { - font-size: 9px; + font-size: 9px; } } } @@ -70,5 +66,3 @@ color: $gray-medium; justify-content: space-between; } - - diff --git a/frontend/app/components/Session_/Player/Player.js b/frontend/app/components/Session_/Player/Player.js index 8d2665645..f4f894b95 100644 --- a/frontend/app/components/Session_/Player/Player.js +++ b/frontend/app/components/Session_/Player/Player.js @@ -59,9 +59,9 @@ export default class Player extends React.PureComponent { {!live && !fullscreen && }
-
({ fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]), bottomBlock: state.getIn([ 'components', 'player', 'bottomBlock' ]), + sessionId: state.getIn([ 'sessions', 'current', 'sessionId' ]), + disabled: state.getIn([ 'components', 'targetDefiner', 'inspectorMode' ]), })) export default class PlayerBlock extends React.PureComponent { componentDidUpdate(prevProps) { - if ([ prevProps.bottomBlock, this.props.bottomBlock ].includes(NONE) || + if ([ prevProps.bottomBlock, this.props.bottomBlock ].includes(NONE) || prevProps.fullscreen !== this.props.fullscreen) { scalePlayerScreen(); } } render() { - const { fullscreen, bottomBlock } = this.props; + const { fullscreen, bottomBlock, sessionId, disabled } = this.props; return (
+ } - { bottomBlock === STACKEVENTS && + { bottomBlock === STACKEVENTS && } { bottomBlock === STORAGE && @@ -72,10 +78,10 @@ export default class PlayerBlock extends React.PureComponent { { bottomBlock === PERFORMANCE && } - { bottomBlock === GRAPHQL && + { bottomBlock === GRAPHQL && } - { bottomBlock === FETCH && + { bottomBlock === FETCH && } { bottomBlock === EXCEPTIONS && diff --git a/frontend/app/components/Session_/PlayerBlockHeader.js b/frontend/app/components/Session_/PlayerBlockHeader.js index eb656d50a..b84395a9a 100644 --- a/frontend/app/components/Session_/PlayerBlockHeader.js +++ b/frontend/app/components/Session_/PlayerBlockHeader.js @@ -124,33 +124,8 @@ export default class PlayerBlockHeader extends React.PureComponent { -
{ isAssist && } - { !isAssist && ( - <> - -
- -
- - } - /> - - )} - {/* { !isAssist && jiraConfig && jiraConfig.token && } */} - { } + { !isAssist && jiraConfig && jiraConfig.token && }
diff --git a/frontend/app/components/Session_/Subheader.tsx b/frontend/app/components/Session_/Subheader.tsx new file mode 100644 index 000000000..31ef51705 --- /dev/null +++ b/frontend/app/components/Session_/Subheader.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { Icon } from 'UI'; +import Autoplay from './Autoplay'; +import Bookmark from 'Shared/Bookmark' +import SharePopup from '../shared/SharePopup/SharePopup'; + +function SubHeader(props) { + const isAssist = window.location.pathname.includes('/assist/'); + + if (isAssist) return null; + return ( +
+
+
+ + + Share +
+ } + /> +
+
+ +
+
+ +
+
+
+
+
+ ) +} + +export default React.memo(SubHeader) diff --git a/frontend/app/components/shared/Bookmark/Bookmark.tsx b/frontend/app/components/shared/Bookmark/Bookmark.tsx index 6c9c5988a..89bcbbd72 100644 --- a/frontend/app/components/shared/Bookmark/Bookmark.tsx +++ b/frontend/app/components/shared/Bookmark/Bookmark.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react' -import { Popup, Button } from 'UI' +import { Popup, Button, Icon } from 'UI' import { toggleFavorite } from 'Duck/sessions' import { connect } from 'react-redux' import { toast } from 'react-toastify'; @@ -10,11 +10,11 @@ interface Props { sessionId: any, isEnterprise: Boolean } -function Bookmark(props : Props ) { +function Bookmark(props : Props ) { const { sessionId, favorite, isEnterprise } = props; const [isFavorite, setIsFavorite] = useState(favorite); const ADDED_MESSAGE = isEnterprise ? 'Session added to vault' : 'Session added to your favorites'; - const REMOVED_MESSAGE = isEnterprise ? 'Session removed from vault' : 'Session removed from your favorites'; + const REMOVED_MESSAGE = isEnterprise ? 'Session removed from vault' : 'Session removed from your favorites'; const TOOLTIP_TEXT_ADD = isEnterprise ? 'Add to vault' : 'Add to favorites'; const TOOLTIP_TEXT_REMOVE = isEnterprise ? 'Remove from vault' : 'Remove from favorites'; @@ -34,7 +34,7 @@ function Bookmark(props : Props ) { } return ( - ) } diff --git a/frontend/app/components/ui/Toggler/Toggler.js b/frontend/app/components/ui/Toggler/Toggler.js index e3abfe1f4..31799ee74 100644 --- a/frontend/app/components/ui/Toggler/Toggler.js +++ b/frontend/app/components/ui/Toggler/Toggler.js @@ -7,17 +7,18 @@ export default ({ className = '', checked, label = '', + plain, }) => (