diff --git a/frontend/app/Router.tsx b/frontend/app/Router.tsx index b728dbc2b..be3e753ce 100644 --- a/frontend/app/Router.tsx +++ b/frontend/app/Router.tsx @@ -66,6 +66,7 @@ const Router: React.FC = (props) => { scopeSetup, localSpotJwt, } = props; + const params = new URLSearchParams(location.search) const spotCb = params.get('spotCallback'); const spotReqSent = React.useRef(false) @@ -162,7 +163,6 @@ const Router: React.FC = (props) => { }, []); useEffect(() => { - // handleJwtFromUrl(); handleDestinationPath(); setSessionPath(previousLocation ? previousLocation : location); @@ -227,7 +227,7 @@ const Router: React.FC = (props) => { - + @@ -249,7 +249,7 @@ const mapStateToProps = (state: Map) => { ]); const sitesLoading = state.getIn(['site', 'fetchListRequest', 'loading']); const scopeSetup = state.getIn(['user', 'scopeSetup']) - const loading = Boolean(userInfoLoading) || Boolean(sitesLoading) + const loading = Boolean(userInfoLoading) || Boolean(sitesLoading) || (!scopeSetup && !siteId); return { siteId, changePassword, diff --git a/frontend/app/components/Login/Login.tsx b/frontend/app/components/Login/Login.tsx index 7a9a1ee36..bd8052b32 100644 --- a/frontend/app/components/Login/Login.tsx +++ b/frontend/app/components/Login/Login.tsx @@ -150,6 +150,7 @@ const Login: React.FC = ({ ? `${window.location.origin}/api/sso/saml2?iFrame=true&spot=true` : `${window.location.origin}/api/sso/saml2?spot=true`; + console.log(authDetails.enforceSSO) return (
@@ -160,7 +161,7 @@ const Login: React.FC = ({

Login to your account

-
+
= ({
diff --git a/frontend/app/dateRange.js b/frontend/app/dateRange.js index 15b952ca5..518c75982 100644 --- a/frontend/app/dateRange.js +++ b/frontend/app/dateRange.js @@ -58,11 +58,6 @@ export function getDateRangeFromValue(value) { case DATE_RANGE_VALUES.LAST_24_HOURS: return Interval.fromDateTimes(now.minus({ hours: 24 }), now); case DATE_RANGE_VALUES.LAST_7_DAYS: - const range = Interval.fromDateTimes( - now.minus({ days: 7 }).startOf('day'), - now.endOf('day') - ); - console.log(range, now.minus({ days: 7})) return Interval.fromDateTimes( now.minus({ days: 7 }).startOf('day'), now.endOf('day') diff --git a/frontend/app/layout/SideMenu.tsx b/frontend/app/layout/SideMenu.tsx index b5cde21f1..258b96771 100644 --- a/frontend/app/layout/SideMenu.tsx +++ b/frontend/app/layout/SideMenu.tsx @@ -210,6 +210,10 @@ function SideMenu(props: Props) { props.history.push(path); }; + const RenderDivider = (props: {index: number}) => { + if (props.index === 0) return null; + return ; + } return ( <> {!category.hidden && ( <> - {index > 0 && } + {category.items .filter((item: any) => !item.hidden) diff --git a/frontend/app/mstore/types/filter.ts b/frontend/app/mstore/types/filter.ts index f4cbbd707..6a5dfc7dd 100644 --- a/frontend/app/mstore/types/filter.ts +++ b/frontend/app/mstore/types/filter.ts @@ -71,10 +71,10 @@ export default class Filter { this.filters.splice(index, 1) } - fromJson(json: any) { + fromJson(json: any, isHeatmap?: boolean) { this.name = json.name this.filters = json.filters.map((i: Record) => - new FilterItem(undefined, this.isConditional, this.isMobile).fromJson(i) + new FilterItem(undefined, this.isConditional, this.isMobile).fromJson(i, undefined, isHeatmap) ); this.eventsOrder = json.eventsOrder return this diff --git a/frontend/app/mstore/types/filterItem.ts b/frontend/app/mstore/types/filterItem.ts index 23353f2a9..8ff3f0583 100644 --- a/frontend/app/mstore/types/filterItem.ts +++ b/frontend/app/mstore/types/filterItem.ts @@ -1,6 +1,12 @@ -import { makeAutoObservable, observable, action } from 'mobx'; -import { FilterKey, FilterType, FilterCategory } from 'Types/filter/filterType'; -import { filtersMap, conditionalFiltersMap, mobileConditionalFiltersMap } from 'Types/filter/newFilter'; +import { FilterCategory, FilterKey, FilterType } from 'Types/filter/filterType'; +import { + conditionalFiltersMap, + filtersMap, + mobileConditionalFiltersMap, +} from 'Types/filter/newFilter'; +import { action, makeAutoObservable, observable } from 'mobx'; + +import { pageUrlOperators } from '../../constants/filterOptions'; export default class FilterItem { type: string = ''; @@ -25,7 +31,7 @@ export default class FilterItem { data: any = {}, private readonly isConditional?: boolean, private readonly isMobile?: boolean -) { + ) { makeAutoObservable(this, { type: observable, key: observable, @@ -62,35 +68,41 @@ export default class FilterItem { } fromData(data: any) { - Object.assign(this, data) - this.type = data.type - this.key = data.key - this.label = data.label - this.operatorOptions = data.operatorOptions - this.hasSource = data.hasSource - this.category = data.category - this.sourceOperatorOptions = data.sourceOperatorOptions - this.value = data.value - this.isEvent = Boolean(data.isEvent) - this.operator = data.operator - this.source = data.source - this.sourceOperator = data.sourceOperator - this.filters = data.filters - this.isActive = Boolean(data.isActive) - this.completed = data.completed - this.dropped = data.dropped - this.options = data.options - return this + Object.assign(this, data); + this.type = data.type; + this.key = data.key; + this.label = data.label; + this.operatorOptions = data.operatorOptions; + this.hasSource = data.hasSource; + this.category = data.category; + this.sourceOperatorOptions = data.sourceOperatorOptions; + this.value = data.value; + this.isEvent = Boolean(data.isEvent); + this.operator = data.operator; + this.source = data.source; + this.sourceOperator = data.sourceOperator; + this.filters = data.filters; + this.isActive = Boolean(data.isActive); + this.completed = data.completed; + this.dropped = data.dropped; + this.options = data.options; + return this; } - fromJson(json: any, mainFilterKey = '') { + fromJson(json: any, mainFilterKey = '', isHeatmap?: boolean) { const isMetadata = json.type === FilterKey.METADATA; - let _filter: any = (isMetadata ? filtersMap['_' + json.source] : filtersMap[json.type]) || {}; + let _filter: any = + (isMetadata ? filtersMap['_' + json.source] : filtersMap[json.type]) || + {}; if (this.isConditional) { if (this.isMobile) { - _filter = mobileConditionalFiltersMap[json.type] || mobileConditionalFiltersMap[json.source]; + _filter = + mobileConditionalFiltersMap[json.type] || + mobileConditionalFiltersMap[json.source]; } else { - _filter = conditionalFiltersMap[json.type] || conditionalFiltersMap[json.source]; + _filter = + conditionalFiltersMap[json.type] || + conditionalFiltersMap[json.source]; } } if (mainFilterKey) { @@ -110,6 +122,9 @@ export default class FilterItem { this.hasSource = _filter.hasSource; this.category = _filter.category; this.sourceOperatorOptions = _filter.sourceOperatorOptions; + if (isHeatmap && this.type === FilterKey.LOCATION) { + this.sourceOperatorOptions = pageUrlOperators; + } this.options = _filter.options; this.isEvent = Boolean(_filter.isEvent); @@ -138,7 +153,9 @@ export default class FilterItem { operator: this.operator, source: isMetadata ? this.key.replace(/^_/, '') : this.source, sourceOperator: this.sourceOperator, - filters: Array.isArray(this.filters) ? this.filters.map((i) => i.toJson()) : [], + filters: Array.isArray(this.filters) + ? this.filters.map((i) => i.toJson()) + : [], }; if (this.type === FilterKey.DURATION) { json.value = this.value.map((i: any) => (!i ? 0 : i)); diff --git a/frontend/app/mstore/types/filterSeries.ts b/frontend/app/mstore/types/filterSeries.ts index 6a42d10b9..9554a9849 100644 --- a/frontend/app/mstore/types/filterSeries.ts +++ b/frontend/app/mstore/types/filterSeries.ts @@ -21,10 +21,10 @@ export default class FilterSeries { this[key] = value } - fromJson(json) { + fromJson(json, isHeatmap = false) { this.seriesId = json.seriesId this.name = json.name - this.filter = new Filter().fromJson(json.filter || { filters: [] }) + this.filter = new Filter().fromJson(json.filter || { filters: [] }, isHeatmap) return this } diff --git a/frontend/app/mstore/types/widget.ts b/frontend/app/mstore/types/widget.ts index 1d0583c4b..f067a4e6d 100644 --- a/frontend/app/mstore/types/widget.ts +++ b/frontend/app/mstore/types/widget.ts @@ -8,7 +8,7 @@ import {FilterKey} from 'Types/filter/filterType'; import Period, {LAST_24_HOURS} from 'Types/app/period'; import Funnel from '../types/funnel'; import {metricService} from 'App/services'; -import {FUNNEL, INSIGHTS, TABLE, USER_PATH, WEB_VITALS} from 'App/constants/card'; +import { FUNNEL, HEATMAP, INSIGHTS, TABLE, USER_PATH, WEB_VITALS } from "App/constants/card"; import Error from '../types/error'; import {getChartFormatter} from 'Types/dashboard/helper'; import FilterItem from './filterItem'; @@ -153,7 +153,7 @@ export default class Widget { this.name = json.name; this.series = json.series && json.series.length > 0 - ? json.series.map((series: any) => new FilterSeries().fromJson(series)) + ? json.series.map((series: any) => new FilterSeries().fromJson(series, this.metricType === HEATMAP)) : [new FilterSeries()]; this.dashboards = json.dashboards || []; this.owner = json.ownerName; diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 8ea8be8c7..4347780a5 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -9,8 +9,6 @@ "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "esModuleInterop": true, -// "module": "es6", -// "module": "es2020", "target": "es6", "allowJs": true, "isolatedModules": true,