diff --git a/frontend/app/components/Dashboard/Widgets/OverviewWidgets/OverviewWidgets.js b/frontend/app/components/Dashboard/Widgets/OverviewWidgets/OverviewWidgets.js deleted file mode 100644 index e42e643a0..000000000 --- a/frontend/app/components/Dashboard/Widgets/OverviewWidgets/OverviewWidgets.js +++ /dev/null @@ -1,106 +0,0 @@ -import React from 'react'; -import { widgetHOC } from '../common'; -import { TrendChart } from '../TrendChart'; -import { OVERVIEW_WIDGET_MAP } from 'Types/dashboard'; -import { camelCased } from 'App/utils'; -import { connect } from 'react-redux'; -import { updateAppearance } from 'Duck/user'; -import { LAST_24_HOURS, LAST_30_MINUTES, YESTERDAY, LAST_7_DAYS } from 'Types/app/period'; -import cn from 'classnames'; -import stl from './overviewWidgets.module.css'; - -const customParams = rangeName => { - const params = { density: 16 } - - if (rangeName === LAST_24_HOURS) params.density = 16 - if (rangeName === LAST_30_MINUTES) params.density = 16 - if (rangeName === YESTERDAY) params.density = 16 - if (rangeName === LAST_7_DAYS) params.density = 16 - - return params -} - -@connect(state => ({ - dashboardAppearance: state.getIn([ 'user', 'account', 'appearance', 'dashboard' ]), - appearance: state.getIn([ 'user', 'account', 'appearance' ]), - comparing: state.getIn([ 'dashboard', 'comparing' ]), -}), { updateAppearance }) -@widgetHOC('overview', { customParams }, false) -export default class OverviewWidgets extends React.PureComponent { - handleRemove = widgetKey => { - const { appearance } = this.props; - this.props.updateAppearance(appearance.setIn([ 'dashboard', widgetKey ], false)); - } - render() { - const { data, dataCompare, loading, loadingCompare, dashboardAppearance, comparing } = this.props; - - const widgets = {} - const widgetsCompare = {} - data - .filter(item => dashboardAppearance[camelCased(item.key)]) // TODO should come filtered from API - .forEach(item => { - widgets[item.key] = item; - }) - - if (comparing) { - dataCompare - .filter(item => dashboardAppearance[camelCased(item.key)]) // TODO should come filtered from API - .forEach(item => { - widgetsCompare[item.key] = item; - }) - } - - return ( - - {Object.values(OVERVIEW_WIDGET_MAP).map(item => { - const widget = widgets[item.key] || {}; - item.data = widget ? widget.chart : {}; - - const widgetCompare = widgetsCompare[item.key] || {}; - if (comparing) { - item.dataCompare = widgetCompare ? widgetCompare.chart : {}; - } - if (!dashboardAppearance[item.key]) return; - - return ( -
- this.handleRemove(item.key)} - comparing={comparing} - /> - {comparing && ( - -
- this.handleRemove(item.key)} - comparing={comparing} - /> - - )} -
- ) - })} -
- ); - } -} diff --git a/frontend/app/components/Dashboard/Widgets/OverviewWidgets/overviewWidgets.module.css b/frontend/app/components/Dashboard/Widgets/OverviewWidgets/overviewWidgets.module.css deleted file mode 100644 index c4f9d132c..000000000 --- a/frontend/app/components/Dashboard/Widgets/OverviewWidgets/overviewWidgets.module.css +++ /dev/null @@ -1,12 +0,0 @@ -.wrapper { - border: dotted 2px transparent; - border-radius: 3px; - margin: -5px; - padding: 5px; - transition: all 0.3s; - - &:hover { - transition: all 0.2s; - border: dotted 2px $gray-medium; - } -} \ No newline at end of file diff --git a/frontend/app/components/Dashboard/Widgets/common/widgetHOC.js b/frontend/app/components/Dashboard/Widgets/common/widgetHOC.js index 88c0c3115..5f91413f1 100644 --- a/frontend/app/components/Dashboard/Widgets/common/widgetHOC.js +++ b/frontend/app/components/Dashboard/Widgets/common/widgetHOC.js @@ -3,7 +3,7 @@ import { connect } from 'react-redux'; import cn from 'classnames'; import { CloseButton } from 'UI'; import { fetchWidget } from 'Duck/dashboard'; -import { updateAppearance } from 'Duck/user'; +// import { updateAppearance } from 'Duck/user'; import { WIDGET_MAP } from 'Types/dashboard'; import Title from './Title'; import stl from './widgetHOC.module.css'; @@ -26,7 +26,7 @@ export default ( filters: state.getIn([ 'dashboard', compare ? 'filtersCompare' : 'filters' ]), period: state.getIn([ 'dashboard', compare ? 'periodCompare' : 'period' ]), //TODO: filters platform: state.getIn([ 'dashboard', 'platform' ]), - appearance: state.getIn([ 'user', 'account', 'appearance' ]), + // appearance: state.getIn([ 'user', 'account', 'appearance' ]), dataCompare: state.getIn([ 'dashboard', '_' + widgetKey ]), // only for overview loadingCompare: state.getIn([ 'dashboard', 'fetchWidget', '_' + widgetKey, 'loading' ]), @@ -35,7 +35,7 @@ export default ( } }, { fetchWidget, - updateAppearance, + // updateAppearance, }) class WidgetWrapper extends React.PureComponent { constructor(props) { @@ -74,8 +74,8 @@ export default ( } handleRemove = () => { - const { appearance } = this.props; - this.props.updateAppearance(appearance.setIn([ 'dashboard', widgetKey ], false)); + // const { appearance } = this.props; + // this.props.updateAppearance(appearance.setIn([ 'dashboard', widgetKey ], false)); } render() { diff --git a/frontend/app/components/Header/Header.js b/frontend/app/components/Header/Header.js index 61b3bf39f..5b4c14b27 100644 --- a/frontend/app/components/Header/Header.js +++ b/frontend/app/components/Header/Header.js @@ -150,7 +150,6 @@ const Header = (props) => { export default withRouter(connect( state => ({ account: state.getIn([ 'user', 'account' ]), - appearance: state.getIn([ 'user', 'account', 'appearance' ]), siteId: state.getIn([ 'site', 'siteId' ]), sites: state.getIn([ 'site', 'list' ]), showAlerts: state.getIn([ 'dashboard', 'showAlerts' ]), diff --git a/frontend/app/components/Session/WebPlayer.js b/frontend/app/components/Session/WebPlayer.js index 27f6385ce..a4e6a67d2 100644 --- a/frontend/app/components/Session/WebPlayer.js +++ b/frontend/app/components/Session/WebPlayer.js @@ -39,10 +39,10 @@ function PlayerContent({ live, fullscreen, showEvents }) { } function WebPlayer (props) { - const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt, config } = props; + const { session, toggleFullscreen, closeBottomBlock, live, fullscreen, jwt} = props; useEffect(() => { - initPlayer(session, jwt, config); + initPlayer(session, jwt); const jumptTime = props.query.get('jumpto'); if (jumptTime) { @@ -70,7 +70,7 @@ function WebPlayer (props) { export default connect(state => ({ session: state.getIn([ 'sessions', 'current' ]), jwt: state.get('jwt'), - config: state.getIn([ 'user', 'account', 'iceServers' ]), + // config: state.getIn([ 'user', 'account', 'iceServers' ]), fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]), }), { toggleFullscreen, diff --git a/frontend/app/duck/user.js b/frontend/app/duck/user.js index 9a6ddb628..e99f16f0f 100644 --- a/frontend/app/duck/user.js +++ b/frontend/app/duck/user.js @@ -12,7 +12,6 @@ const FETCH_ACCOUNT = new RequestTypes('user/FETCH_ACCOUNT'); const FETCH_TENANTS = new RequestTypes('user/FETCH_TENANTS'); const UPDATE_ACCOUNT = new RequestTypes('user/UPDATE_ACCOUNT'); const RESEND_EMAIL_VERIFICATION = new RequestTypes('user/RESEND_EMAIL_VERIFICATION'); -const UPDATE_APPEARANCE = new RequestTypes('user/UPDATE_APPEARANCE'); const FETCH_CLIENT = new RequestTypes('user/FETCH_CLIENT'); export const UPDATE_PASSWORD = new RequestTypes('user/UPDATE_PASSWORD'); const PUT_CLIENT = new RequestTypes('user/PUT_CLIENT'); @@ -53,8 +52,6 @@ const reducer = (state = initialState, action = {}) => { ).set('onboarding', true); case REQUEST_RESET_PASSWORD.SUCCESS: break; - case UPDATE_APPEARANCE.REQUEST: //TODO: failure handling - return state.mergeIn([ 'account', 'appearance' ], action.appearance) case UPDATE_ACCOUNT.SUCCESS: case FETCH_ACCOUNT.SUCCESS: return state.set('account', Account(action.data)).set('passwordErrors', List()); @@ -87,7 +84,6 @@ export default withRequestState({ fetchUserInfoRequest: [ FETCH_ACCOUNT, FETCH_CLIENT, FETCH_TENANTS ], putClientRequest: PUT_CLIENT, updateAccountRequest: UPDATE_ACCOUNT, - updateAppearance: UPDATE_APPEARANCE, }, reducer); export const login = params => dispatch => dispatch({ @@ -161,16 +157,6 @@ export function resendEmailVerification(email) { } } -export function updateAppearance(appearance) { - return { - types: UPDATE_APPEARANCE.toArray(), - call: client => client.post('/account/appearance', { - appearance: Record.isRecord(appearance) ? appearance.toData() : appearance - }), - appearance, - }; -} - export function pushNewSite(newSite) { return { type: PUSH_NEW_SITE, diff --git a/frontend/app/player/MessageDistributor/MessageDistributor.ts b/frontend/app/player/MessageDistributor/MessageDistributor.ts index 7e9825ce4..582cd7211 100644 --- a/frontend/app/player/MessageDistributor/MessageDistributor.ts +++ b/frontend/app/player/MessageDistributor/MessageDistributor.ts @@ -92,7 +92,7 @@ export default class MessageDistributor extends StatedScreen { private navigationStartOffset: number = 0; private lastMessageTime: number = 0; - constructor(private readonly session: any /*Session*/, jwt: string, config, live: boolean) { + constructor(private readonly session: any /*Session*/, config: any, live: boolean) { super(); this.pagesManager = new PagesManager(this, this.session.isMobile) this.mouseMoveManager = new MouseMoveManager(this); @@ -101,8 +101,6 @@ export default class MessageDistributor extends StatedScreen { this.sessionStart = this.session.startedAt; if (live) { - // const sockUrl = `wss://live.openreplay.com/1/${ this.session.siteId }/${ this.session.sessionId }/${ jwt }`; - // this.subscribeOnMessages(sockUrl); initListsDepr({}) this.assistManager.connect(); } else { diff --git a/frontend/app/player/MessageDistributor/managers/AssistManager.ts b/frontend/app/player/MessageDistributor/managers/AssistManager.ts index f28c54617..3bc741e5d 100644 --- a/frontend/app/player/MessageDistributor/managers/AssistManager.ts +++ b/frontend/app/player/MessageDistributor/managers/AssistManager.ts @@ -73,7 +73,7 @@ const MAX_RECONNECTION_COUNT = 4; export default class AssistManager { - constructor(private session, private md: MessageDistributor, private config) {} + constructor(private session: any, private md: MessageDistributor, private config: any) {} private setStatus(status: ConnectionStatus) { if (getState().peerConnectionStatus === ConnectionStatus.Disconnected && @@ -306,7 +306,7 @@ export default class AssistManager { const urlObject = new URL(window.env.API_EDP) return import('peerjs').then(({ default: Peer }) => { if (this.cleaned) {return Promise.reject("Already cleaned")} - const peerOpts = { + const peerOpts: any = { host: urlObject.hostname, path: '/assist', port: urlObject.port === "" ? (location.protocol === 'https:' ? 443 : 80 ): parseInt(urlObject.port), diff --git a/frontend/app/types/account/account.js b/frontend/app/types/account/account.js index 2683795b4..22477f7da 100644 --- a/frontend/app/types/account/account.js +++ b/frontend/app/types/account/account.js @@ -1,11 +1,9 @@ import Member from 'Types/member'; -import Appearance from './appearance'; import Limit from './limit'; import { DateTime } from 'luxon'; export default Member.extend({ changePassword: undefined, - appearance: Appearance(), limits: Limit(), banner: undefined, email: '', @@ -18,10 +16,8 @@ export default Member.extend({ iceServers: undefined, hasPassword: false, // to check if it's SSO }, { - fromJS: ({ current = {}, ...account})=> ({ + fromJS: ({ ...account})=> ({ ...account, - license: current.license, - expirationDate: current.expirationDate > 0 && DateTime.fromMillis(current.expirationDate || 0), - appearance: Appearance(account.appearance), + expirationDate: account.expirationDate > 0 && DateTime.fromMillis(account.expirationDate || 0), }) }); \ No newline at end of file diff --git a/frontend/app/types/account/appearance.js b/frontend/app/types/account/appearance.js deleted file mode 100644 index 2c401de99..000000000 --- a/frontend/app/types/account/appearance.js +++ /dev/null @@ -1,86 +0,0 @@ -import Record from 'Types/Record'; -import { WIDGET_KEYS } from 'Types/dashboard'; - -export const OWNER = 'po'; -export const QANALYST = 'qa'; -export const DEVELOPER = 'dev'; -export const CAGENT = 'agent'; -export const CUSTOM ='CUSTOM'; -export const NOT_SET = 'NOT_SET'; - -export const ROLE_NAMES = { - [ OWNER ]: "Product Owner", - [ QANALYST ]: "Quality Assurance", - [ DEVELOPER ]: "Developer", - [ CAGENT ]: "Customer Success", - [ CUSTOM ]: "Custom Role", -}; - -const dashboardAllTrueValues = WIDGET_KEYS.reduce((values, key) => ({ - ...values, - [ key ]: true, -}), {}); -const dashboardAllFalseValues = WIDGET_KEYS.reduce((values, key) => ({ - ...values, - [ key ]: false, -}), {}); - -const Dashboard = Record(dashboardAllTrueValues); - -const Appearance = Record({ - role: DEVELOPER, - sessionsLive: false, - sessionsDevtools: true, - tests: false, - runs: false, - dashboard: Dashboard().set("userActivity",false), -}, { - fromJS: appearance => ({ - ...appearance, - dashboard: Dashboard(appearance.dashboard), - }), - methods: { - dashboardSome: function() { - return WIDGET_KEYS.some(key => this.dashboard[ key ]); - } - } -}); - -export const PREDEFINED_VALUES = { - [ OWNER ]: Appearance({ - role: OWNER, - sessionsLive: false, - sessionsDevtools: false, - tests: false, - runs: false, - dashboard: Dashboard({ - slowestImages: false, - errorsTrend: false, - }), - }), - [ QANALYST ]: Appearance({ - role: QANALYST, - sessionsLive: false, - dashboard: Dashboard(dashboardAllFalseValues), - }), - [ DEVELOPER ]: Appearance({ - role: DEVELOPER, - sessionsLive: false, - dashboard: Dashboard() - .set('userActivity', false) - .set('sessionsFrustration', false) - .set('sessionsFeedback', false), - }), - [ CAGENT ]: Appearance({ - role: CAGENT, - sessionsDevtools: false, - tests: false, - runs: false, - dashboard: Dashboard(dashboardAllFalseValues), - }), - [ CUSTOM ]: Appearance({ - role: CUSTOM, - }), -} - -export default Appearance; \ No newline at end of file