From 53e58f7d5d3a9f6671027070a23e7076270815c9 Mon Sep 17 00:00:00 2001 From: Mehdi Osman Date: Wed, 9 Mar 2022 23:31:21 +0100 Subject: [PATCH 1/6] Update license to ELv2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd248aea5..b943773e6 100644 --- a/README.md +++ b/README.md @@ -88,4 +88,4 @@ Check out our [roadmap](https://www.notion.so/openreplay/Roadmap-889d2c3d968b478 ## License -This repo is entirely MIT licensed, with the exception of the `ee` directory. +This repo is under the Elastic License 2.0 (ELv2), with the exception of the `ee` directory. From 0c3e2cb68df875656c8b08ae0943605291c6aba6 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 10 Mar 2022 11:15:25 +0100 Subject: [PATCH 2/6] feat(api): changed live check --- api/chalicelib/core/assist.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/api/chalicelib/core/assist.py b/api/chalicelib/core/assist.py index aee8a97f5..70f563ec8 100644 --- a/api/chalicelib/core/assist.py +++ b/api/chalicelib/core/assist.py @@ -71,7 +71,18 @@ def get_live_sessions_ws(project_id): print("!! issue with the peer-server") print(connected_peers.text) return [] - live_peers = connected_peers.json().get("data", []) + try: + live_peers = connected_peers.json().get("data", []) + except Exception as e: + print("issue getting Live-Assist response") + print(str(e)) + print("expected JSON, received:") + try: + print(connected_peers.text) + except: + print("couldn't get response") + live_peers = [] + for s in live_peers: s["live"] = True s["projectId"] = project_id @@ -95,7 +106,17 @@ def is_live(project_id, session_id, project_key=None): print("!! issue with the peer-server") print(connected_peers.text) return False - connected_peers = connected_peers.json().get("data", []) + try: + connected_peers = connected_peers.json().get("data", []) + except Exception as e: + print("issue getting Assist response") + print(str(e)) + print("expected JSON, received:") + try: + print(connected_peers.text) + except: + print("couldn't get response") + return False return str(session_id) in connected_peers From 83bcf97312662732c8ba1e8ff2d4ea270a60753b Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 10 Mar 2022 17:20:37 +0100 Subject: [PATCH 3/6] fix(ui) - funnels issues, and saved search with metadata --- .../Funnels/FunnelGraph/FunnelGraph.js | 6 +++--- .../FilterAutoComplete/FilterAutoComplete.tsx | 2 +- frontend/app/types/filter/newFilter.js | 4 ++-- frontend/app/types/funnel.js | 16 ++++++++++------ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/frontend/app/components/Funnels/FunnelGraph/FunnelGraph.js b/frontend/app/components/Funnels/FunnelGraph/FunnelGraph.js index ec94451d7..906843394 100644 --- a/frontend/app/components/Funnels/FunnelGraph/FunnelGraph.js +++ b/frontend/app/components/Funnels/FunnelGraph/FunnelGraph.js @@ -211,9 +211,9 @@ function FunnelGraph(props) { strokeWidth={0} interval={0} tick ={{ fill: '#666', fontSize: 12 }} - xAxisId={0} + xAxisId={0} /> - '"' + val + '"'} - /> + /> */} Styles.tickFormatter(val)} /> diff --git a/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx b/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx index 92baa3d51..62ec51c9d 100644 --- a/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx +++ b/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx @@ -60,7 +60,7 @@ function FilterAutoComplete(props: Props) { .finally(() => setLoading(false)); } - const debouncedRequestValues = React.useCallback(debounce(requestValues, 300), []); + const debouncedRequestValues = React.useCallback(debounce(requestValues, 1000), []); const onInputChange = ({ target: { value } }) => { setQuery(value); diff --git a/frontend/app/types/filter/newFilter.js b/frontend/app/types/filter/newFilter.js index 29cb324b1..ced303078 100644 --- a/frontend/app/types/filter/newFilter.js +++ b/frontend/app/types/filter/newFilter.js @@ -6,6 +6,7 @@ import { capitalize } from 'App/utils'; const countryOptions = Object.keys(countries).map(i => ({ text: countries[i], value: i })); const containsFilters = [{ key: 'contains', text: 'contains', value: 'contains' }] +export const metaFilter = { key: FilterKey.METADATA, type: FilterType.MULTIPLE, category: FilterCategory.METADATA, label: 'Metadata', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/metadata', isEvent: true }; export const filtersMap = { // EVENTS [FilterKey.CLICK]: { key: FilterKey.CLICK, type: FilterType.MULTIPLE, category: FilterCategory.INTERACTIONS, label: 'Click', operator: 'on', operatorOptions: filterOptions.targetOperators, icon: 'filters/click', isEvent: true }, @@ -31,7 +32,6 @@ export const filtersMap = { [FilterKey.ERROR]: { key: FilterKey.ERROR, type: FilterType.MULTIPLE, category: FilterCategory.JAVASCRIPT, label: 'Error', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/error', isEvent: true }, // [FilterKey.METADATA]: { key: FilterKey.METADATA, type: FilterType.MULTIPLE, category: FilterCategory.METADATA, label: 'Metadata', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/metadata', isEvent: true }, - // FILTERS [FilterKey.USER_OS]: { key: FilterKey.USER_OS, type: FilterType.MULTIPLE, category: FilterCategory.GEAR, label: 'User OS', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/os' }, [FilterKey.USER_BROWSER]: { key: FilterKey.USER_BROWSER, type: FilterType.MULTIPLE, category: FilterCategory.GEAR, label: 'User Browser', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/browser' }, @@ -133,7 +133,7 @@ export default Record({ }) _filter = subFilterMap[type] } else { - _filter = filtersMap[type]; + _filter = (type === FilterKey.METADATA) ? metaFilter : filtersMap[type]; } return { ...filter, diff --git a/frontend/app/types/funnel.js b/frontend/app/types/funnel.js index 0a97cf944..d9a27e44d 100644 --- a/frontend/app/types/funnel.js +++ b/frontend/app/types/funnel.js @@ -51,8 +51,9 @@ export default Record({ } }, fromJS: ({ stages = [], filter, activeStages = null, ...rest }) => { - let _stages = stages.map(stage => { - stage.label = getRedableName(stage.type, stage.value); + let _stages = stages.map((stage, index) => { + // stage.label = getRedableName(stage.type, stage.value); + stage.label = `Step ${index + 1}`; return stage; }); @@ -70,16 +71,19 @@ export default Record({ return { ...rest, - stages: _stages.length > 0 ? _stages.map(stage => { + stages: _stages.length > 0 ? _stages.map((stage, index) => { if (!stage) return; - stage.label = getRedableName(stage); + // stage.label = getRedableName(stage); + stage.label = `Step ${index + 1}`; return stage; }) : [], affectedUsers, lostConversions, conversionImpact, - firstStage: firstStage && firstStage.label + ' ' + truncate(firstStage.value || '', 10) || '', - lastStage: lastStage && lastStage.label + ' ' + truncate(lastStage.value || '', 10) || '', + // firstStage: firstStage && firstStage.label + ' ' + truncate(firstStage.value || '', 10) || '', + // lastStage: lastStage && lastStage.label + ' ' + truncate(lastStage.value || '', 10) || '', + firstStage: firstStage && firstStage.label || '', + lastStage: lastStage && lastStage.label || '', filter: Filter(filter), sessionsCount: lastStage && lastStage.sessionsCount, stepsCount: stages ? stages.length : 0, From 2f54c76d35f80def4a49d143ff76a564fc458028 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 10 Mar 2022 19:56:29 +0100 Subject: [PATCH 4/6] fix(ui) - filters meta --- .../app/components/shared/MainSearchBar/MainSearchBar.tsx | 6 ++++-- frontend/app/duck/customField.js | 4 +++- frontend/app/types/filter/newFilter.js | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/shared/MainSearchBar/MainSearchBar.tsx b/frontend/app/components/shared/MainSearchBar/MainSearchBar.tsx index 0ed764339..e6cdbd00c 100644 --- a/frontend/app/components/shared/MainSearchBar/MainSearchBar.tsx +++ b/frontend/app/components/shared/MainSearchBar/MainSearchBar.tsx @@ -8,15 +8,16 @@ import { connect } from 'react-redux'; interface Props { clearSearch: () => void; appliedFilter: any; + optionsReady: boolean; } const MainSearchBar = (props: Props) => { - const { appliedFilter } = props; + const { appliedFilter, optionsReady } = props; const hasFilters = appliedFilter && appliedFilter.filters && appliedFilter.filters.size > 0; return (
- + {optionsReady && } { } export default connect(state => ({ appliedFilter: state.getIn(['search', 'instance']), + optionsReady: state.getIn(['customFields', 'optionsReady']) }), { clearSearch })(MainSearchBar); \ No newline at end of file diff --git a/frontend/app/duck/customField.js b/frontend/app/duck/customField.js index ad93c21c6..9a8fdcc0e 100644 --- a/frontend/app/duck/customField.js +++ b/frontend/app/duck/customField.js @@ -31,6 +31,7 @@ const initialState = Map({ list: List(), instance: CustomField(), sources: List(), + optionsReady: false }); const reducer = (state = initialState, action = {}) => { @@ -40,7 +41,8 @@ const reducer = (state = initialState, action = {}) => { addElementToFiltersMap(FilterCategory.METADATA, item.key); addElementToLiveFiltersMap(FilterCategory.METADATA, item.key); }); - return state.set('list', List(action.data).map(CustomField)) //.concat(defaultMeta)) + return state.set('list', List(action.data).map(CustomField)) + .set('optionsReady', true) //.concat(defaultMeta)) case FETCH_SOURCES_SUCCESS: return state.set('sources', List(action.data.map(({ value, ...item}) => ({label: value, key: value, ...item}))).map(CustomField)) case SAVE_SUCCESS: diff --git a/frontend/app/types/filter/newFilter.js b/frontend/app/types/filter/newFilter.js index ced303078..6963643f7 100644 --- a/frontend/app/types/filter/newFilter.js +++ b/frontend/app/types/filter/newFilter.js @@ -6,7 +6,7 @@ import { capitalize } from 'App/utils'; const countryOptions = Object.keys(countries).map(i => ({ text: countries[i], value: i })); const containsFilters = [{ key: 'contains', text: 'contains', value: 'contains' }] -export const metaFilter = { key: FilterKey.METADATA, type: FilterType.MULTIPLE, category: FilterCategory.METADATA, label: 'Metadata', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/metadata', isEvent: true }; +export const metaFilter = { key: FilterKey.METADATA, type: FilterType.MULTIPLE, category: FilterCategory.METADATA, label: 'Metadata', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/metadata' }; export const filtersMap = { // EVENTS [FilterKey.CLICK]: { key: FilterKey.CLICK, type: FilterType.MULTIPLE, category: FilterCategory.INTERACTIONS, label: 'Click', operator: 'on', operatorOptions: filterOptions.targetOperators, icon: 'filters/click', isEvent: true }, @@ -133,7 +133,11 @@ export default Record({ }) _filter = subFilterMap[type] } else { - _filter = (type === FilterKey.METADATA) ? metaFilter : filtersMap[type]; + if (type === FilterKey.METADATA) { + _filter = filtersMap[filter.source]; + } else { + _filter = filtersMap[type]; + } } return { ...filter, From 22a5fd1fbfae4b499c083f76c17e0d0ff2d55b51 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 10 Mar 2022 22:32:02 +0100 Subject: [PATCH 5/6] feat(utilities): EE-WS fixed missing sessions --- ee/utilities/servers/websocket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/utilities/servers/websocket.js b/ee/utilities/servers/websocket.js index 34f045a51..e087dba31 100644 --- a/ee/utilities/servers/websocket.js +++ b/ee/utilities/servers/websocket.js @@ -55,7 +55,7 @@ const socketsListByProject = function (req, res) { if (process.env.uws !== "true") { res.statusCode = 200; res.setHeader('Content-Type', 'application/json'); - res.end(JSON.stringify()); + res.end(JSON.stringify(result)); } else { res.writeStatus('200 OK').writeHeader('Content-Type', 'application/json').end(JSON.stringify(result)); } From 341954c9d9851da682433579d459a2b484667d50 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 14 Mar 2022 13:28:30 +0100 Subject: [PATCH 6/6] fix(actions): get worker images Signed-off-by: rjshrjndrn --- .github/workflows/workers-ee.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workers-ee.yaml b/.github/workflows/workers-ee.yaml index 4588ccb09..a61d75160 100644 --- a/.github/workflows/workers-ee.yaml +++ b/.github/workflows/workers-ee.yaml @@ -47,7 +47,7 @@ jobs: # # Getting the images to build # - git diff --name-only HEAD HEAD~1 | grep backend/services | grep -vE ^ee/ | cut -d '/' -f3 | uniq > backend/images_to_build.txt + git diff --name-only HEAD HEAD~1 | grep backend/services | cut -d '/' -f3 | uniq > backend/images_to_build.txt [[ $(cat backend/images_to_build.txt) != "" ]] || (echo "Nothing to build here"; exit 0) # # Pushing image to registry