diff --git a/api/routers/core.py b/api/routers/core.py
index 076ca81f4..8aacdb99b 100644
--- a/api/routers/core.py
+++ b/api/routers/core.py
@@ -36,8 +36,7 @@ def get_session2(projectId: int, sessionId: Union[int, str], context: schemas.Cu
include_fav_viewed=True, group_metadata=True)
if data is None:
return {"errors": ["session not found"]}
- if not data.get("live"):
- sessions_favorite_viewed.view_session(project_id=projectId, user_id=context.user_id, session_id=sessionId)
+ sessions_favorite_viewed.view_session(project_id=projectId, user_id=context.user_id, session_id=sessionId)
return {
'data': data
}
diff --git a/backend/pkg/db/postgres/connector.go b/backend/pkg/db/postgres/connector.go
index 9e4e82633..1eb29e04c 100644
--- a/backend/pkg/db/postgres/connector.go
+++ b/backend/pkg/db/postgres/connector.go
@@ -10,7 +10,7 @@ import (
)
func getTimeoutContext() context.Context {
- ctx, _ := context.WithTimeout(context.Background(), time.Duration(time.Second*10))
+ ctx, _ := context.WithTimeout(context.Background(), time.Duration(time.Second*30))
return ctx
}
diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py
index c8c1c7669..9ca77c1ea 100644
--- a/ee/api/chalicelib/core/users.py
+++ b/ee/api/chalicelib/core/users.py
@@ -156,7 +156,7 @@ def update(tenant_id, user_id, changes):
(SELECT role_id FROM roles WHERE tenant_id = %(tenant_id)s AND name != 'Owner' LIMIT 1)))""")
else:
sub_query_users.append(f"{helper.key_to_snake_case(key)} = %({key})s")
-
+ changes["role_id"] = changes.get("roleId", changes.get("role_id"))
with pg_client.PostgresClient() as cur:
if len(sub_query_users) > 0:
cur.execute(
diff --git a/frontend/app/Router.js b/frontend/app/Router.js
index 86f07c4f6..782f47e74 100644
--- a/frontend/app/Router.js
+++ b/frontend/app/Router.js
@@ -21,6 +21,10 @@ import Header from 'Components/Header/Header';
import FunnelDetails from 'Components/Funnels/FunnelDetails';
import FunnelIssueDetails from 'Components/Funnels/FunnelIssueDetails';
import { fetchList as fetchIntegrationVariables } from 'Duck/customField';
+import { fetchList as fetchSiteList } from 'Duck/site';
+import { fetchList as fetchAnnouncements } from 'Duck/announcements';
+import { fetchList as fetchAlerts } from 'Duck/alerts';
+import { fetchWatchdogStatus } from 'Duck/watchdogs';
import APIClient from './api_client';
import * as routes from './routes';
@@ -80,7 +84,14 @@ const ONBOARDING_REDIRECT_PATH = routes.onboarding(OB_DEFAULT_TAB);
onboarding: state.getIn([ 'user', 'onboarding' ])
};
}, {
- fetchUserInfo, fetchTenants, setSessionPath, fetchIntegrationVariables
+ fetchUserInfo,
+ fetchTenants,
+ setSessionPath,
+ fetchIntegrationVariables,
+ fetchSiteList,
+ fetchAnnouncements,
+ fetchAlerts,
+ fetchWatchdogStatus,
})
class Router extends React.Component {
state = {
@@ -93,6 +104,14 @@ class Router extends React.Component {
props.fetchUserInfo().then(() => {
props.fetchIntegrationVariables()
}),
+ props.fetchSiteList().then(() => {
+ setTimeout(() => {
+ props.fetchAnnouncements();
+ props.fetchAlerts();
+ props.fetchWatchdogStatus();
+ }, 100);
+ }),
+ // props.fetchAnnouncements(),
])
// .then(() => this.onLoginLogout());
}
diff --git a/frontend/app/components/Alerts/Notifications/Notifications.js b/frontend/app/components/Alerts/Notifications/Notifications.js
index deb14b640..a30ad824f 100644
--- a/frontend/app/components/Alerts/Notifications/Notifications.js
+++ b/frontend/app/components/Alerts/Notifications/Notifications.js
@@ -18,9 +18,9 @@ class Notifications extends React.Component {
constructor(props) {
super(props);
- setTimeout(() => {
- props.fetchList();
- }, 1000);
+ // setTimeout(() => {
+ // props.fetchList();
+ // }, 1000);
setInterval(() => {
props.fetchList();
diff --git a/frontend/app/components/Announcements/Announcements.js b/frontend/app/components/Announcements/Announcements.js
index ff392e2e7..733b4ce37 100644
--- a/frontend/app/components/Announcements/Announcements.js
+++ b/frontend/app/components/Announcements/Announcements.js
@@ -10,11 +10,7 @@ import { withRouter } from 'react-router-dom';
@withToggle('visible', 'toggleVisisble')
@withRouter
class Announcements extends React.Component {
- constructor(props) {
- super(props);
- props.fetchList();
- }
-
+
navigateToUrl = url => {
if (url) {
if (url.startsWith(window.ENV.ORIGIN)) {
diff --git a/frontend/app/components/BugFinder/BugFinder.js b/frontend/app/components/BugFinder/BugFinder.js
index f0024c20a..6d30359f1 100644
--- a/frontend/app/components/BugFinder/BugFinder.js
+++ b/frontend/app/components/BugFinder/BugFinder.js
@@ -4,14 +4,11 @@ import withPageTitle from 'HOCs/withPageTitle';
import {
fetchFavoriteList as fetchFavoriteSessionList
} from 'Duck/sessions';
-import { countries } from 'App/constants';
import { applyFilter, clearEvents, addAttribute } from 'Duck/filters';
import { fetchList as fetchFunnelsList } from 'Duck/funnels';
-import { defaultFilters, preloadedFilters } from 'Types/filter';
import { KEYS } from 'Types/filter/customFilter';
import SessionList from './SessionList';
import stl from './bugFinder.css';
-import { fetchList as fetchSiteList } from 'Duck/site';
import withLocationHandlers from "HOCs/withLocationHandlers";
import { fetch as fetchFilterVariables } from 'Duck/sources';
import { fetchSources } from 'Duck/customField';
@@ -68,7 +65,6 @@ const allowedQueryKeys = [
fetchSources,
clearEvents,
setActiveTab,
- fetchSiteList,
fetchFunnelsList,
resetFunnel,
resetFunnelFilters,
@@ -81,7 +77,6 @@ export default class BugFinder extends React.PureComponent {
state = {showRehydratePanel: false}
constructor(props) {
super(props);
- // props.fetchFavoriteSessionList();
// TODO should cache the response
// props.fetchSources().then(() => {
@@ -115,29 +110,6 @@ export default class BugFinder extends React.PureComponent {
this.setState({ showRehydratePanel: !this.state.showRehydratePanel })
}
- // fetchPreloadedFilters = () => {
- // this.props.fetchFilterVariables('filterValues').then(function() {
- // const { filterValues } = this.props;
- // const keys = [
- // {key: KEYS.USER_OS, label: 'OS'},
- // {key: KEYS.USER_BROWSER, label: 'Browser'},
- // {key: KEYS.USER_DEVICE, label: 'Device'},
- // {key: KEYS.REFERRER, label: 'Referrer'},
- // {key: KEYS.USER_COUNTRY, label: 'Country'},
- // ]
- // if (filterValues && filterValues.size != 0) {
- // keys.forEach(({key, label}) => {
- // const _keyFilters = filterValues.get(key)
- // if (key === KEYS.USER_COUNTRY) {
- // preloadedFilters.push(_keyFilters.map(item => ({label, type: key, key, value: item, actualValue: countries[item], isFilter: true})));
- // } else {
- // preloadedFilters.push(_keyFilters.map(item => ({label, type: key, key, value: item, isFilter: true})));
- // }
- // })
- // }
- // }.bind(this));
- // }
-
setActiveTab = tab => {
this.props.setActiveTab(tab);
}
diff --git a/frontend/app/components/BugFinder/DateRange.js b/frontend/app/components/BugFinder/DateRange.js
index ed8c76c98..c0758b426 100644
--- a/frontend/app/components/BugFinder/DateRange.js
+++ b/frontend/app/components/BugFinder/DateRange.js
@@ -10,7 +10,7 @@ import DateRangeDropdown from 'Shared/DateRangeDropdown';
})
export default class DateRange extends React.PureComponent {
onDateChange = (e) => {
- this.props.fetchFunnelsList(e.rangeValue)
+ // this.props.fetchFunnelsList(e.rangeValue)
this.props.applyFilter(e)
}
render() {
diff --git a/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js b/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js
index 2436d4be6..be98a28cd 100644
--- a/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js
+++ b/frontend/app/components/BugFinder/SessionsMenu/SessionsMenu.js
@@ -22,9 +22,9 @@ function SessionsMenu(props) {
}
}
- useEffect(() => {
- fetchWatchdogStatus()
- }, [])
+ // useEffect(() => {
+ // fetchWatchdogStatus()
+ // }, [])
const capturingAll = props.captureRate && props.captureRate.get('captureAll');
diff --git a/frontend/app/components/Client/Client.js b/frontend/app/components/Client/Client.js
index 6cae36710..cb55d933d 100644
--- a/frontend/app/components/Client/Client.js
+++ b/frontend/app/components/Client/Client.js
@@ -3,7 +3,6 @@ import { withRouter } from 'react-router-dom';
import { Switch, Route, Redirect } from 'react-router';
import { CLIENT_TABS, client as clientRoute } from 'App/routes';
import { fetchList as fetchMemberList } from 'Duck/member';
-import { fetchList as fetchSiteList } from 'Duck/site';
import ProfileSettings from './ProfileSettings';
import Integrations from './Integrations';
@@ -21,7 +20,6 @@ import Roles from './Roles';
appearance: state.getIn([ 'user', 'account', 'appearance' ]),
}), {
fetchMemberList,
- fetchSiteList,
})
@withRouter
export default class Client extends React.PureComponent {
diff --git a/frontend/app/components/Dashboard/Dashboard.js b/frontend/app/components/Dashboard/Dashboard.js
index aacda8b07..8ad8ecdf8 100644
--- a/frontend/app/components/Dashboard/Dashboard.js
+++ b/frontend/app/components/Dashboard/Dashboard.js
@@ -240,7 +240,6 @@ export default class Dashboard extends React.PureComponent {
Custom Metrics are not supported for comparison.
)}
- {/*
diff --git a/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx b/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx index 7700a7a29..ea923a6e1 100644 --- a/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx +++ b/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Form, SegmentSelection, Button, IconButton } from 'UI'; +import { Form, Button, IconButton } from 'UI'; import FilterSeries from '../FilterSeries'; import { connect } from 'react-redux'; import { edit as editMetric, save, addSeries, removeSeries, remove } from 'Duck/customMetrics'; @@ -7,7 +7,8 @@ import CustomMetricWidgetPreview from 'App/components/Dashboard/Widgets/CustomMe import { confirm } from 'UI/Confirmation'; import { toast } from 'react-toastify'; import cn from 'classnames'; - +import DropdownPlain from '../../DropdownPlain'; +import { metricTypes, metricOf, issueOptions } from 'App/constants/filterOptions'; interface Props { metric: any; editMetric: (metric, shouldFetch?) => void; @@ -21,6 +22,13 @@ interface Props { function CustomMetricForm(props: Props) { const { metric, loading } = props; + // const metricOfOptions = metricOf.filter(i => i.key === metric.metricType); + const timeseriesOptions = metricOf.filter(i => i.key === 'timeseries'); + const tableOptions = metricOf.filter(i => i.key === 'table'); + const isTable = metric.metricType === 'table'; + const isTimeSeries = metric.metricType === 'timeseries'; + const _issueOptions = [{ text: 'All', value: '' }].concat(issueOptions); + const addSeries = () => { props.addSeries(); @@ -30,12 +38,33 @@ function CustomMetricForm(props: Props) { props.removeSeries(index); } - const write = ({ target: { value, name } }) => props.editMetric({ ...metric, [ name ]: value }, false); + const write = ({ target: { value, name } }) => props.editMetric({ [ name ]: value }, false); + const writeOption = (e, { value, name }) => { + props.editMetric({ [ name ]: value }, false); - const changeConditionTab = (e, { name, value }) => { - props.editMetric({[ 'viewType' ]: value }); + if (name === 'metricValue') { + props.editMetric({ metricValue: [value] }, false); + } + + if (name === 'metricOf') { + if (value === 'ISSUES') { + props.editMetric({ metricValue: [''] }, false); + } + } + + if (name === 'metricType') { + if (value === 'timeseries') { + props.editMetric({ metricOf: timeseriesOptions[0].value, viewType: 'lineChart' }, false); + } else if (value === 'table') { + props.editMetric({ metricOf: tableOptions[0].value, viewType: 'table' }, false); + } + } }; + // const changeConditionTab = (e, { name, value }) => { + // props.editMetric({[ 'viewType' ]: value }); + // }; + const save = () => { props.save(metric).then(() => { toast.success(metric.exists() ? 'Updated succesfully.' : 'Created succesfully.'); @@ -79,30 +108,71 @@ function CustomMetricForm(props: Props) {