diff --git a/api/chalicelib/core/errors.py b/api/chalicelib/core/errors.py index 06162114f..642501246 100644 --- a/api/chalicelib/core/errors.py +++ b/api/chalicelib/core/errors.py @@ -1,7 +1,7 @@ import json -from chalicelib.utils import pg_client, helper, dev from chalicelib.core import sourcemaps, sessions +from chalicelib.utils import pg_client, helper, dev from chalicelib.utils.TimeUTC import TimeUTC from chalicelib.utils.metrics_helper import __get_step_size @@ -39,7 +39,10 @@ def get_batch(error_ids): FROM error_family;""", {"error_ids": tuple(error_ids)}) cur.execute(query=query) - return helper.list_to_camel_case(cur.fetchall()) + errors = cur.fetchall() + for e in errors: + e["stacktrace_parsed_at"] = TimeUTC.datetime_to_timestamp(e["stacktrace_parsed_at"]) + return helper.list_to_camel_case(errors) def __flatten_sort_key_count_version(data, merge_nested=False): diff --git a/ee/api/chalicelib/blueprints/bp_core_dynamic.py b/ee/api/chalicelib/blueprints/bp_core_dynamic.py index 019da951f..ab73733b6 100644 --- a/ee/api/chalicelib/blueprints/bp_core_dynamic.py +++ b/ee/api/chalicelib/blueprints/bp_core_dynamic.py @@ -47,7 +47,7 @@ def login(): stack_integrations=True, version=True) c["smtp"] = helper.has_smtp() c["iceServers"] = assist.get_ice_servers() - + c = {**c, **license.get_status(tenant_id)} return { 'jwt': r.pop('jwt'), 'data': { diff --git a/ee/api/chalicelib/core/errors.py b/ee/api/chalicelib/core/errors.py index 98b5620af..0519bb143 100644 --- a/ee/api/chalicelib/core/errors.py +++ b/ee/api/chalicelib/core/errors.py @@ -1,9 +1,9 @@ import json -from chalicelib.utils import pg_client, helper -from chalicelib.utils import ch_client -from chalicelib.core import sourcemaps, sessions from chalicelib.core import dashboard +from chalicelib.core import sourcemaps, sessions +from chalicelib.utils import ch_client +from chalicelib.utils import pg_client, helper from chalicelib.utils.TimeUTC import TimeUTC @@ -40,7 +40,10 @@ def get_batch(error_ids): FROM error_family;""", {"error_ids": tuple(error_ids)}) cur.execute(query=query) - return helper.list_to_camel_case(cur.fetchall()) + errors = cur.fetchall() + for e in errors: + e["stacktrace_parsed_at"] = TimeUTC.datetime_to_timestamp(e["stacktrace_parsed_at"]) + return helper.list_to_camel_case(errors) def __flatten_sort_key_count_version(data, merge_nested=False): diff --git a/frontend/app/Router.js b/frontend/app/Router.js index 643351d67..a4051502c 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -86,15 +86,11 @@ class Router extends React.Component { } componentDidUpdate(prevProps) { - if (prevProps.email !== this.props.email) { - this.onLoginLogout(); + if (prevProps.email !== this.props.email && !this.props.email) { + this.props.fetchTenants(); } } - onLoginLogout() { - const { email, account, organisation } = this.props; - } - render() { const { isLoggedIn, jwt, siteId, sites, loading, changePassword, location, existingTenant, onboarding } = this.props; const siteIdList = sites.map(({ id }) => id).toJS(); diff --git a/frontend/app/components/Client/Roles/Roles.tsx b/frontend/app/components/Client/Roles/Roles.tsx index 91ab2fda5..848e9fea0 100644 --- a/frontend/app/components/Client/Roles/Roles.tsx +++ b/frontend/app/components/Client/Roles/Roles.tsx @@ -31,6 +31,14 @@ function Roles(props: Props) { props.fetchList() }, []) + useEffect(() => { + if (removeErrors && removeErrors.size > 0) { + removeErrors.forEach(e => { + toast.error(e) + }) + } + }, [removeErrors]) + const closeModal = () => { setShowmModal(false) setTimeout(() => { @@ -48,13 +56,7 @@ function Roles(props: Props) { header: 'Roles', confirmation: `Are you sure you want to remove this role?` })) { - deleteRole(role.roleId).then(() => { - if (removeErrors && removeErrors.size > 0) { - removeErrors.forEach(e => { - toast.error(e) - }) - } - }) + deleteRole(role.roleId) } }