Merge pull request #350 from openreplay/dev

Chore(release): v1.5.2
This commit is contained in:
Mehdi Osman 2022-02-24 17:58:13 +00:00 committed by GitHub
commit e57836d9b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 87 additions and 36 deletions

View file

@ -197,8 +197,8 @@ def search2_pg(data: schemas.SessionsSearchPayloadSchema, project_id, user_id, f
MIN(full_sessions.start_ts) AS first_session_ts,
ROW_NUMBER() OVER (ORDER BY count(full_sessions) DESC) AS rn
FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY start_ts DESC) AS rn
FROM (SELECT DISTINCT ON(s.session_id) {SESSION_PROJECTION_COLS},
{",".join([f'metadata_{m["index"]}' for m in meta_keys])}
FROM (SELECT DISTINCT ON(s.session_id) {SESSION_PROJECTION_COLS}
{"," if len(meta_keys)>0 else ""}{",".join([f'metadata_{m["index"]}' for m in meta_keys])}
{query_part}
ORDER BY s.session_id desc) AS filtred_sessions
ORDER BY favorite DESC, issue_score DESC, {sort} {data.order}) AS full_sessions
@ -209,8 +209,8 @@ def search2_pg(data: schemas.SessionsSearchPayloadSchema, project_id, user_id, f
meta_keys = metadata.get(project_id=project_id)
main_query = cur.mogrify(f"""SELECT COUNT(full_sessions) AS count, COALESCE(JSONB_AGG(full_sessions) FILTER (WHERE rn <= 200), '[]'::JSONB) AS sessions
FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY favorite DESC, issue_score DESC, session_id desc, start_ts desc) AS rn
FROM (SELECT DISTINCT ON(s.session_id) {SESSION_PROJECTION_COLS},
{",".join([f'metadata_{m["index"]}' for m in meta_keys])}
FROM (SELECT DISTINCT ON(s.session_id) {SESSION_PROJECTION_COLS}
{"," if len(meta_keys)>0 else ""}{",".join([f'metadata_{m["index"]}' for m in meta_keys])}
{query_part}
ORDER BY s.session_id desc) AS filtred_sessions
ORDER BY favorite DESC, issue_score DESC, {sort} {data.order}) AS full_sessions;""",

View file

@ -0,0 +1,8 @@
BEGIN;
CREATE OR REPLACE FUNCTION openreplay_version()
RETURNS text AS
$$
SELECT 'v1.5.2-ee'
$$ LANGUAGE sql IMMUTABLE;
COMMIT;

View file

@ -7,7 +7,7 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE OR REPLACE FUNCTION openreplay_version()
RETURNS text AS
$$
SELECT 'v1.5.1-ee'
SELECT 'v1.5.2-ee'
$$ LANGUAGE sql IMMUTABLE;

View file

@ -91,12 +91,6 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
onClick={ requestReleaseRemoteControl }
role="button"
>
{/* <Icon
name="remote-control"
size="20"
color={ remoteControlStatus === RemoteControlStatus.Enabled ? "green" : "gray-darkest"}
/>
<span className={cn("ml-2", { 'color-green' : remoteControlStatus === RemoteControlStatus.Enabled })}>{ 'Remote Control' }</span> */}
<IconButton label={`${remoteActive ? 'Stop ' : ''} Remote Control`} icon="remote-control" primaryText redText={remoteActive} />
</div>
@ -112,12 +106,6 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
onClick={ onCall ? callObject?.end : confirmCall}
role="button"
>
{/* <Icon
name="headset"
size="20"
color={ onCall ? "red" : "gray-darkest" }
/>
<span className={cn("ml-2", { 'color-red' : onCall })}>{ onCall ? 'End Call' : 'Call' }</span> */}
<IconButton size="small" primary={!onCall} red={onCall} label={onCall ? 'End' : 'Call'} icon="headset" />
</div>
}

View file

@ -60,14 +60,14 @@ export default withRequest({
loadingName: 'loadingCredentials',
})(withPermissions(['ASSIST_LIVE'], '', true)(connect(
state => {
const isAssist = state.getIn(['sessions', 'activeTab']).type === 'live';
const hasSessioPath = state.getIn([ 'sessions', 'sessionPath' ]).includes('/sessions');
// const isAssist = state.getIn(['sessions', 'activeTab']).type === 'live';
// const hasSessioPath = state.getIn([ 'sessions', 'sessionPath' ]).includes('/sessions');
return {
session: state.getIn([ 'sessions', 'current' ]),
showAssist: state.getIn([ 'sessions', 'showChatWindow' ]),
jwt: state.get('jwt'),
fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]),
hasSessionsPath: hasSessioPath && !isAssist,
// hasSessionsPath: hasSessioPath && !isAssist,
isEnterprise: state.getIn([ 'user', 'client', 'edition' ]) === 'ee',
hasErrors: !!state.getIn([ 'sessions', 'errors' ]),
}

View file

@ -106,7 +106,7 @@ function getStorageName(type) {
bottomBlock: state.getIn([ 'components', 'player', 'bottomBlock' ]),
showStorage: props.showStorage || !state.getIn(['components', 'player', 'hiddenHints', 'storage']),
showStack: props.showStack || !state.getIn(['components', 'player', 'hiddenHints', 'stack']),
closedLive: !!state.getIn([ 'sessions', 'errors' ]),
closedLive: !!state.getIn([ 'sessions', 'errors' ]) || !state.getIn([ 'sessions', 'current', 'live' ]),
}
}, {
fullscreenOn,

View file

@ -13,11 +13,14 @@ import EventsToggleButton from '../../Session/EventsToggleButton';
@connectPlayer(state => ({
live: state.live,
}))
@connect(state => ({
fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]),
nextId: state.getIn([ 'sessions', 'nextId' ]),
closedLive: !!state.getIn([ 'sessions', 'errors' ]),
}), {
@connect(state => {
const isAssist = window.location.pathname.includes('/assist/');
return {
fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]),
nextId: state.getIn([ 'sessions', 'nextId' ]),
closedLive: !!state.getIn([ 'sessions', 'errors' ]) || (isAssist && !state.getIn([ 'sessions', 'current', 'live' ])),
}
}, {
hideTargetDefiner,
fullscreenOff,
})

View file

@ -33,7 +33,6 @@ import styles from './playerBlock.css';
@connect(state => ({
fullscreen: state.getIn([ 'components', 'player', 'fullscreen' ]),
bottomBlock: state.getIn([ 'components', 'player', 'bottomBlock' ]),
closedLive: !!state.getIn([ 'sessions', 'errors' ]),
}))
export default class PlayerBlock extends React.PureComponent {
componentDidUpdate(prevProps) {
@ -44,14 +43,13 @@ export default class PlayerBlock extends React.PureComponent {
}
render() {
const { fullscreen, bottomBlock, closedLive } = this.props;
const { fullscreen, bottomBlock } = this.props;
return (
<div className={ cn(styles.playerBlock, "flex flex-col") }>
<Player
className="flex-1"
bottomBlockIsActive={ !fullscreen && bottomBlock !== NONE }
closedLive={closedLive}
/>
{ !fullscreen && !!bottomBlock &&
<div className="">

View file

@ -29,10 +29,11 @@ const ASSIST_ROUTE = assistRoute();
loading: state.cssLoading || state.messagesLoading,
}))
@connect((state, props) => {
const isAssist = state.getIn(['sessions', 'activeTab']).type === 'live';
const isAssist = window.location.pathname.includes('/assist/');
const hasSessioPath = state.getIn([ 'sessions', 'sessionPath' ]).includes('/sessions');
const session = state.getIn([ 'sessions', 'current' ]);
return {
session: state.getIn([ 'sessions', 'current' ]),
session,
sessionPath: state.getIn([ 'sessions', 'sessionPath' ]),
loading: state.getIn([ 'sessions', 'toggleFavoriteRequest', 'loading' ]),
disabled: state.getIn([ 'components', 'targetDefiner', 'inspectorMode' ]) || props.loading,
@ -43,7 +44,7 @@ const ASSIST_ROUTE = assistRoute();
siteId: state.getIn([ 'user', 'siteId' ]),
hasSessionsPath: hasSessioPath && !isAssist,
metaList: state.getIn(['customFields', 'list']).map(i => i.key),
closedLive: !!state.getIn([ 'sessions', 'errors' ]),
closedLive: !!state.getIn([ 'sessions', 'errors' ]) || (isAssist && !session.live),
}
}, {
toggleFavorite, fetchListIntegration, setSessionPath

View file

@ -13,6 +13,7 @@ import DropdownPlain from 'Shared/DropdownPlain';
import SortOrderButton from 'Shared/SortOrderButton';
import { TimezoneDropdown } from 'UI';
import { capitalize } from 'App/utils';
import LiveSessionReloadButton from 'Shared/LiveSessionReloadButton';
const AUTOREFRESH_INTERVAL = .5 * 60 * 1000
const PER_PAGE = 20;
@ -107,8 +108,6 @@ function LiveSessionList(props: Props) {
}, AUTOREFRESH_INTERVAL);
}
console.log('srt', sort)
return (
<div>
<div className="flex mb-6 justify-between items-end">
@ -117,6 +116,8 @@ function LiveSessionList(props: Props) {
<span>Live Sessions</span>
<span className="ml-2 font-normal color-gray-medium">{sessions.size}</span>
</h3>
<LiveSessionReloadButton />
</div>
<div className="flex items-center">
<div className="flex items-center">

View file

@ -0,0 +1,19 @@
import React from 'react'
import ReloadButton from '../ReloadButton'
import { connect } from 'react-redux'
import { fetchLiveList } from 'Duck/sessions'
interface Props {
loading: boolean
fetchLiveList: typeof fetchLiveList
}
function LiveSessionReloadButton(props: Props) {
const { loading } = props
return (
<ReloadButton loading={loading} onClick={props.fetchLiveList} className="cursor-pointer" />
)
}
export default connect(state => ({
loading: state.getIn([ 'sessions', 'fetchLiveListRequest', 'loading' ]),
}), { fetchLiveList })(LiveSessionReloadButton)

View file

@ -0,0 +1 @@
export { default } from './LiveSessionReloadButton';

View file

@ -0,0 +1,22 @@
import React from 'react'
import { CircularLoader, Icon } from 'UI'
import cn from 'classnames'
interface Props {
loading?: boolean
onClick: () => void
iconSize?: number
iconName?: string
className?: string
}
export default function ReloadButton(props: Props) {
const { loading, onClick, iconSize = "14", iconName = "sync-alt", className = '' } = props
return (
<div
className={cn("ml-4 h-5 w-6 flex items-center justify-center", className)}
onClick={onClick}
>
{ loading ? <CircularLoader className="ml-1" /> : <Icon name={iconName} size={iconSize} />}
</div>
)
}

View file

@ -0,0 +1 @@
export { default } from './ReloadButton';

View file

@ -171,7 +171,8 @@ export default class AssistManager {
this.setStatus(ConnectionStatus.Disconnected)
}, 12000)
if (getState().remoteControl === RemoteControlStatus.Requesting) {
if (getState().remoteControl === RemoteControlStatus.Requesting ||
getState().remoteControl === RemoteControlStatus.Enabled) {
this.toggleRemoteControl(false)
}

View file

@ -0,0 +1,8 @@
BEGIN;
CREATE OR REPLACE FUNCTION openreplay_version()
RETURNS text AS
$$
SELECT 'v1.5.2'
$$ LANGUAGE sql IMMUTABLE;
COMMIT;

View file

@ -6,7 +6,7 @@ CREATE SCHEMA IF NOT EXISTS events;
CREATE OR REPLACE FUNCTION openreplay_version()
RETURNS text AS
$$
SELECT 'v1.5.1'
SELECT 'v1.5.2'
$$ LANGUAGE sql IMMUTABLE;
-- --- accounts.sql ---