fix(ui) - review chanhes and fixes

This commit is contained in:
Shekar Siri 2021-08-05 18:14:57 +05:30
parent 79ce54863d
commit 48c612461a
7 changed files with 29 additions and 26 deletions

View file

@ -103,7 +103,7 @@ class ManageUsers extends React.PureComponent {
</div>
{ !account.smtp &&
<div className={cn("mb-4 p-2", styles.smtpMessage)}>
SMTP is not configured, <a className="link" href="https://docs.openreplay.com/configuration/configure-smtp" target="_blank">setup SMTP</a>
SMTP is not configured. Please follow <a className="link" href="https://docs.openreplay.com/configuration/configure-smtp" target="_blank">these steps</a> to set it up.
</div>
}
<div className={ styles.formGroup }>
@ -114,6 +114,7 @@ class ManageUsers extends React.PureComponent {
value={ member.admin }
checked={ !!member.admin }
onChange={ this.onChangeCheckbox }
disabled={member.superAdmin}
/>
<span>{ 'Admin' }</span>
</label>
@ -199,14 +200,7 @@ class ManageUsers extends React.PureComponent {
inverted
position="top left"
/>
</div>
<div>
{ !account.smtp &&
<BannerMessage>
Inviting new users require email messaging. Please <a className="link" href="https://docs.openreplay.com/configuration/configure-smtp" target="_blank">setup SMTP</a>.
</BannerMessage>
}
</div>
</div>
</div>
<NoContent

View file

@ -23,7 +23,7 @@ const Item = ({ icon, text, completed, active, onClick }) => (
<div className={cn('flex', stl.step)}>
<div className={
cn(
"h-6 w-6 mr-3 bg-white rounded-full flex items-center justify-center",
"h-6 w-6 mr-3 rounded-full flex items-center justify-center",
stl.iconWrapper,
{'bg-gray-light' : !active || !completed }
)}
@ -31,7 +31,7 @@ const Item = ({ icon, text, completed, active, onClick }) => (
{ completed &&
<Icon
name={icon}
color={completed? 'white' : 'gray-medium' }
color={active? 'white' : 'gray-medium' }
size="18"
/>
}

View file

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'
import { Dropdown, Loader } from 'UI'
import React, { useEffect, useState } from 'react';
import { Dropdown, Loader } from 'UI';
import DateRange from 'Shared/DateRange';
import { connect } from 'react-redux';
import { fetchInsights } from 'Duck/sessions';
@ -15,10 +15,14 @@ interface Props {
events: Array<any>
urlOptions: Array<any>
loading: boolean
host: string
}
function PageInsightsPanel({ filters, fetchInsights, events = [], insights, urlOptions, loading = true }: Props) {
function PageInsightsPanel({
filters, fetchInsights, events = [], insights, urlOptions, host, loading = true
}: Props) {
const [insightsFilters, setInsightsFilters] = useState(filters)
console.log('host', host)
const onDateChange = (e) => {
const { startDate, endDate, rangeValue } = e;
@ -33,7 +37,7 @@ function PageInsightsPanel({ filters, fetchInsights, events = [], insights, urlO
}, [insights])
useEffect(() => {
const url = insightsFilters.url ? insightsFilters.url : urlOptions[0].value;
const url = insightsFilters.url ? insightsFilters.url : host + '/' + urlOptions[0].value;
Player.pause();
fetchInsights({ ...insightsFilters, url })
}, [insightsFilters])
@ -41,7 +45,7 @@ function PageInsightsPanel({ filters, fetchInsights, events = [], insights, urlO
const onPageSelect = (e, { name, value }) => {
const event = events.find(item => item.url === value)
Player.jump(event.time + JUMP_OFFSET)
setInsightsFilters({ ...insightsFilters, url: value })
setInsightsFilters({ ...insightsFilters, url: host + '/' + value })
markTargets([])
};
@ -83,9 +87,10 @@ export default connect(state => {
const events = state.getIn([ 'sessions', 'visitedEvents' ])
return {
filters: state.getIn(['sessions', 'insightFilters']),
host: state.getIn([ 'sessions', 'host' ]),
insights: state.getIn([ 'sessions', 'insights' ]),
events: events,
urlOptions: events.map(({ url }) => ({ text: url, value: url})),
urlOptions: events.map(({ url, host }) => ({ text: url, value: url, host })),
loading: state.getIn([ 'sessions', 'fetchInsightsRequest', 'loading' ]),
}
}, { fetchInsights })(PageInsightsPanel);

View file

@ -155,7 +155,7 @@ export default class SignupForm extends React.Component {
<div className={ stl.formFooter }>
<Button type="submit" primary >
{ loading ?
<CircularLoader loading={true} /> :
<CircularLoader loading={true} className="flex" /> :
'Create account'
}
</Button>

View file

@ -53,7 +53,8 @@ const initialState = Map({
liveSessions: List(),
visitedEvents: List(),
insights: List(),
insightFilters: defaultDateFilters
insightFilters: defaultDateFilters,
host: ''
});
const reducer = (state = initialState, action = {}) => {
@ -146,7 +147,7 @@ const reducer = (state = initialState, action = {}) => {
// TODO: more common.. or TEMP
const events = action.filter.events;
// const filters = action.filter.filters;
const current = state.get('list').find(({ sessionId }) => sessionId === action.data.sessionId) || Session();
const current = state.get('list').find(({ sessionId }) => sessionId === action.data.sessionId) || Session();
const session = Session(action.data);
const matching = [];
@ -158,7 +159,7 @@ const reducer = (state = initialState, action = {}) => {
tmpMap[event.url] = event.url
visitedEvents.push(event)
}
})
})
events.forEach(({ key, operator, value }) => {
session.events.forEach((e, index) => {
@ -172,10 +173,12 @@ const reducer = (state = initialState, action = {}) => {
}
}
})
})
})
console.log('visitedEvents', visitedEvents)
return state.set('current', current.merge(session))
.set('eventsIndex', matching)
.set('visitedEvents', visitedEvents);
.set('visitedEvents', visitedEvents)
.set('host', visitedEvents[0].host);
}
case FETCH_FAVORITE_LIST.SUCCESS:
return state
@ -227,7 +230,7 @@ const reducer = (state = initialState, action = {}) => {
.set('sessionIds', allList.map(({ sessionId }) => sessionId ).toJS())
case SET_TIMEZONE:
return state.set('timezone', action.timezone)
case TOGGLE_CHAT_WINDOW:
case TOGGLE_CHAT_WINDOW:
return state.set('showChatWindow', action.state)
case FETCH_INSIGHTS.SUCCESS: 
return state.set('insights', List(action.data).sort((a, b) => b.count - a.count));

View file

@ -113,12 +113,12 @@ export const signup = params => dispatch => dispatch({
export const resetPassword = params => dispatch => dispatch({
types: RESET_PASSWORD.toArray(),
call: client => client.post('/password/reset/2', params),
call: client => client.post('/password/reset', params)
});
export const requestResetPassword = params => dispatch => dispatch({
types: REQUEST_RESET_PASSWORD.toArray(),
call: client => client.post('/password/reset/1', params),
call: client => client.post('/password/reset-link', params),
});
export const updatePassword = params => dispatch => dispatch({

View file

@ -56,6 +56,7 @@ const View = Event.extend({
const Location = Event.extend({
type: LOCATION,
url: '',
host: '',
pageLoad: false,
fcpTime: undefined,
//fpTime: undefined,