From 48c612461a704c3b92350917534e2c37c2dc8bda Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 5 Aug 2021 18:14:57 +0530 Subject: [PATCH] fix(ui) - review chanhes and fixes --- .../Client/ManageUsers/ManageUsers.js | 12 +++--------- .../components/OnboardingMenu/OnboardingMenu.js | 4 ++-- .../PageInsightsPanel/PageInsightsPanel.tsx | 17 +++++++++++------ .../components/Signup/SignupForm/SignupForm.js | 2 +- frontend/app/duck/sessions.js | 15 +++++++++------ frontend/app/duck/user.js | 4 ++-- frontend/app/types/session/event.js | 1 + 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/frontend/app/components/Client/ManageUsers/ManageUsers.js b/frontend/app/components/Client/ManageUsers/ManageUsers.js index 3e1182f41..b0dfd32e9 100644 --- a/frontend/app/components/Client/ManageUsers/ManageUsers.js +++ b/frontend/app/components/Client/ManageUsers/ManageUsers.js @@ -103,7 +103,7 @@ class ManageUsers extends React.PureComponent { { !account.smtp &&
- SMTP is not configured, setup SMTP + SMTP is not configured. Please follow these steps to set it up.
}
@@ -114,6 +114,7 @@ class ManageUsers extends React.PureComponent { value={ member.admin } checked={ !!member.admin } onChange={ this.onChangeCheckbox } + disabled={member.superAdmin} /> { 'Admin' } @@ -199,14 +200,7 @@ class ManageUsers extends React.PureComponent { inverted position="top left" /> -
-
- { !account.smtp && - - Inviting new users require email messaging. Please setup SMTP. - - } -
+ (
( { completed && } diff --git a/frontend/app/components/Session_/PageInsightsPanel/PageInsightsPanel.tsx b/frontend/app/components/Session_/PageInsightsPanel/PageInsightsPanel.tsx index dea0a6345..ed213d472 100644 --- a/frontend/app/components/Session_/PageInsightsPanel/PageInsightsPanel.tsx +++ b/frontend/app/components/Session_/PageInsightsPanel/PageInsightsPanel.tsx @@ -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 urlOptions: Array 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); \ No newline at end of file diff --git a/frontend/app/components/Signup/SignupForm/SignupForm.js b/frontend/app/components/Signup/SignupForm/SignupForm.js index 0a5de9507..7df2822ee 100644 --- a/frontend/app/components/Signup/SignupForm/SignupForm.js +++ b/frontend/app/components/Signup/SignupForm/SignupForm.js @@ -155,7 +155,7 @@ export default class SignupForm extends React.Component {
diff --git a/frontend/app/duck/sessions.js b/frontend/app/duck/sessions.js index 6fe968d47..d54506ddc 100644 --- a/frontend/app/duck/sessions.js +++ b/frontend/app/duck/sessions.js @@ -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)); diff --git a/frontend/app/duck/user.js b/frontend/app/duck/user.js index 5395792c3..fc9fdcabf 100644 --- a/frontend/app/duck/user.js +++ b/frontend/app/duck/user.js @@ -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({ diff --git a/frontend/app/types/session/event.js b/frontend/app/types/session/event.js index b64744bcb..537de1724 100644 --- a/frontend/app/types/session/event.js +++ b/frontend/app/types/session/event.js @@ -56,6 +56,7 @@ const View = Event.extend({ const Location = Event.extend({ type: LOCATION, url: '', + host: '', pageLoad: false, fcpTime: undefined, //fpTime: undefined,