From 4ec2867b30d585abbc10a82d74a01895c207f74e Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 26 Jan 2023 10:52:05 +0100 Subject: [PATCH 01/10] fix(build): crons image tag Signed-off-by: rjshrjndrn --- ee/api/build_crons.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/api/build_crons.sh b/ee/api/build_crons.sh index 4d246265a..701c960fb 100644 --- a/ee/api/build_crons.sh +++ b/ee/api/build_crons.sh @@ -37,7 +37,7 @@ function build_crons(){ docker push ${DOCKER_REPO:-'local'}/crons:${tag}latest } [[ $SIGN_IMAGE -eq 1 ]] && { - cosign sign --key $SIGN_KEY ${DOCKER_REPO:-'local'}/crons:${image_tag} + cosign sign --key $SIGN_KEY ${DOCKER_REPO:-'local'}/crons:${git_sha1} } echo "completed crons build" } From 9743d9bb7bbed92d22dcc3984e22e3de04fc8fa3 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Thu, 26 Jan 2023 14:35:03 +0100 Subject: [PATCH 02/10] fix(ui): add warning for localhost, fix geturl method for tracker --- .../Assist/RecordingsList/RecordingsList.tsx | 2 +- frontend/app/components/Session_/Subheader.js | 147 +++++++++++------- frontend/app/components/ui/SVG.tsx | 3 +- frontend/app/svg/ca-no-recordings.svg | 2 +- frontend/app/svg/icons/cross.svg | 3 + tracker/tracker/src/main/app/index.ts | 4 +- 6 files changed, 99 insertions(+), 62 deletions(-) create mode 100644 frontend/app/svg/icons/cross.svg diff --git a/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx b/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx index 0e8d1afd5..18cbc3478 100644 --- a/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx +++ b/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx @@ -29,7 +29,7 @@ function RecordingsList() { show={length === 0} title={
- +
{recordsSearch !== '' ? 'No matching results' diff --git a/frontend/app/components/Session_/Subheader.js b/frontend/app/components/Session_/Subheader.js index 680278113..b39a48182 100644 --- a/frontend/app/components/Session_/Subheader.js +++ b/frontend/app/components/Session_/Subheader.js @@ -14,7 +14,8 @@ import { observer } from 'mobx-react-lite'; import AutoplayToggle from 'Shared/AutoplayToggle'; function SubHeader(props) { - const { player, store } = React.useContext(PlayerContext) + const [showWarningModal, setWarning] = React.useState(true); + const { player, store } = React.useContext(PlayerContext); const { width, height, @@ -25,19 +26,19 @@ function SubHeader(props) { exceptionsList, eventList: eventsList, endTime, - } = store.get() + } = store.get(); const mappedResourceList = resourceList .filter((r) => r.isRed || r.isYellow) .concat(fetchList.filter((i) => parseInt(i.status) >= 400)) - .concat(graphqlList.filter((i) => parseInt(i.status) >= 400)) + .concat(graphqlList.filter((i) => parseInt(i.status) >= 400)); const [isCopied, setCopied] = React.useState(false); const { showModal, hideModal } = useModal(); const location = - currentLocation && currentLocation.length > 60 - ? `${currentLocation.slice(0, 60)}...` + currentLocation && currentLocation.length > 70 + ? `${currentLocation.slice(0, 25)}...${currentLocation.slice(-40)}` : currentLocation; const showReportModal = () => { @@ -48,66 +49,98 @@ function SubHeader(props) { exceptionsList: exceptionsList, eventsList: eventsList, endTime: endTime, - } - showModal(, { right: true, width: 620 }); + }; + showModal( + , + { right: true, width: 620 } + ); }; + const showWarning = + location && /(localhost)|(127.0.0.1)|(0.0.0.0)/.test(location) && showWarningModal; return ( -
- - {location && ( +
+ {showWarning ? (
{ - copy(currentLocation); - setCopied(true); - setTimeout(() => setCopied(false), 5000); + className="px-3 py-1 border border-gray-light drop-shadow-md rounded bg-active-blue flex items-center justify-between" + style={{ + zIndex: 999, + position: 'absolute', + left: '50%', + bottom: '-24px', + transform: 'translate(-50%, 0)', + fontWeight: 500, }} > - - - {location} - -
- )} -
- - - - - -
- } - /> - , - }, - { - key: 2, - component: , - }, - ]} - /> - -
- + Some assets may load incorrectly on localhost. + + Learn More + +
setWarning(false)}> +
+ ) : null} + {location && ( + <> +
{ + copy(currentLocation); + setCopied(true); + setTimeout(() => setCopied(false), 5000); + }} + > + + + {location} + +
+ + )} +
+ + + + + +
+ } + /> + , + }, + { + key: 2, + component: , + }, + ]} + /> + +
+ +
+
); } diff --git a/frontend/app/components/ui/SVG.tsx b/frontend/app/components/ui/SVG.tsx index a416581a6..66af7be76 100644 --- a/frontend/app/components/ui/SVG.tsx +++ b/frontend/app/components/ui/SVG.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export type IconNames = 'activity' | 'alarm-clock' | 'alarm-plus' | 'all-sessions' | 'analytics' | 'anchor' | 'arrow-alt-square-right' | 'arrow-bar-left' | 'arrow-clockwise' | 'arrow-counterclockwise' | 'arrow-down-short' | 'arrow-down' | 'arrow-repeat' | 'arrow-right-short' | 'arrow-square-left' | 'arrow-square-right' | 'arrow-up-short' | 'arrow-up' | 'arrows-angle-extend' | 'avatar/icn_bear' | 'avatar/icn_beaver' | 'avatar/icn_bird' | 'avatar/icn_bison' | 'avatar/icn_camel' | 'avatar/icn_chameleon' | 'avatar/icn_deer' | 'avatar/icn_dog' | 'avatar/icn_dolphin' | 'avatar/icn_elephant' | 'avatar/icn_fish' | 'avatar/icn_fox' | 'avatar/icn_gorilla' | 'avatar/icn_hippo' | 'avatar/icn_horse' | 'avatar/icn_hyena' | 'avatar/icn_kangaroo' | 'avatar/icn_lemur' | 'avatar/icn_mammel' | 'avatar/icn_monkey' | 'avatar/icn_moose' | 'avatar/icn_panda' | 'avatar/icn_penguin' | 'avatar/icn_porcupine' | 'avatar/icn_quail' | 'avatar/icn_rabbit' | 'avatar/icn_rhino' | 'avatar/icn_sea_horse' | 'avatar/icn_sheep' | 'avatar/icn_snake' | 'avatar/icn_squirrel' | 'avatar/icn_tapir' | 'avatar/icn_turtle' | 'avatar/icn_vulture' | 'avatar/icn_wild1' | 'avatar/icn_wild_bore' | 'ban' | 'bar-chart-line' | 'bar-pencil' | 'bell-fill' | 'bell-plus' | 'bell-slash' | 'bell' | 'binoculars' | 'book' | 'browser/browser' | 'browser/chrome' | 'browser/edge' | 'browser/electron' | 'browser/facebook' | 'browser/firefox' | 'browser/ie' | 'browser/opera' | 'browser/safari' | 'bullhorn' | 'business-time' | 'calendar-alt' | 'calendar-check' | 'calendar-day' | 'calendar' | 'call' | 'camera-alt' | 'camera-video-off' | 'camera-video' | 'camera' | 'card-checklist' | 'card-text' | 'caret-down-fill' | 'caret-left-fill' | 'caret-right-fill' | 'caret-up-fill' | 'chat-dots' | 'chat-right-text' | 'chat-square-quote' | 'check-circle-fill' | 'check-circle' | 'check' | 'chevron-double-left' | 'chevron-double-right' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-fill' | 'circle' | 'clipboard-list-check' | 'clock' | 'close' | 'cloud-fog2-fill' | 'code' | 'cog' | 'cogs' | 'collection' | 'columns-gap-filled' | 'columns-gap' | 'console/error' | 'console/exception' | 'console/info' | 'console/warning' | 'console' | 'controller' | 'cookies' | 'copy' | 'credit-card-front' | 'cubes' | 'dash' | 'dashboard-icn' | 'desktop' | 'device' | 'diagram-3' | 'dizzy' | 'door-closed' | 'doublecheck' | 'download' | 'drag' | 'edit' | 'ellipsis-v' | 'enter' | 'envelope' | 'errors-icon' | 'event/click' | 'event/clickrage' | 'event/code' | 'event/i-cursor' | 'event/input' | 'event/link' | 'event/location' | 'event/resize' | 'event/view' | 'exclamation-circle' | 'expand-wide' | 'explosion' | 'external-link-alt' | 'eye-slash-fill' | 'eye-slash' | 'eye' | 'fetch' | 'file-code' | 'file-medical-alt' | 'file-pdf' | 'file' | 'files' | 'filter' | 'filters/arrow-return-right' | 'filters/browser' | 'filters/click' | 'filters/clickrage' | 'filters/code' | 'filters/console' | 'filters/country' | 'filters/cpu-load' | 'filters/custom' | 'filters/device' | 'filters/dom-complete' | 'filters/duration' | 'filters/error' | 'filters/fetch-failed' | 'filters/fetch' | 'filters/file-code' | 'filters/graphql' | 'filters/i-cursor' | 'filters/input' | 'filters/lcpt' | 'filters/link' | 'filters/location' | 'filters/memory-load' | 'filters/metadata' | 'filters/os' | 'filters/perfromance-network-request' | 'filters/platform' | 'filters/referrer' | 'filters/resize' | 'filters/rev-id' | 'filters/state-action' | 'filters/ttfb' | 'filters/user-alt' | 'filters/userid' | 'filters/view' | 'flag-na' | 'folder-plus' | 'folder2' | 'fullscreen' | 'funnel/cpu-fill' | 'funnel/cpu' | 'funnel/dizzy' | 'funnel/emoji-angry-fill' | 'funnel/emoji-angry' | 'funnel/emoji-dizzy-fill' | 'funnel/exclamation-circle-fill' | 'funnel/exclamation-circle' | 'funnel/file-earmark-break-fill' | 'funnel/file-earmark-break' | 'funnel/file-earmark-minus-fill' | 'funnel/file-earmark-minus' | 'funnel/file-medical-alt' | 'funnel/file-x' | 'funnel/hdd-fill' | 'funnel/hourglass-top' | 'funnel/image-fill' | 'funnel/image' | 'funnel/microchip' | 'funnel/mouse' | 'funnel/patch-exclamation-fill' | 'funnel/sd-card' | 'funnel-fill' | 'funnel-new' | 'funnel' | 'gear-fill' | 'gear' | 'geo-alt-fill-custom' | 'github' | 'graph-up-arrow' | 'graph-up' | 'grid-1x2' | 'grid-3x3' | 'grid-check' | 'grid-horizontal' | 'grid' | 'grip-horizontal' | 'hash' | 'hdd-stack' | 'headset' | 'heart-rate' | 'high-engagement' | 'history' | 'hourglass-start' | 'ic-errors' | 'ic-network' | 'ic-rage' | 'ic-resources' | 'id-card' | 'image' | 'info-circle-fill' | 'info-circle' | 'info-square' | 'info' | 'inspect' | 'integrations/assist' | 'integrations/bugsnag-text' | 'integrations/bugsnag' | 'integrations/cloudwatch-text' | 'integrations/cloudwatch' | 'integrations/datadog' | 'integrations/elasticsearch-text' | 'integrations/elasticsearch' | 'integrations/github' | 'integrations/graphql' | 'integrations/jira-text' | 'integrations/jira' | 'integrations/mobx' | 'integrations/newrelic-text' | 'integrations/newrelic' | 'integrations/ngrx' | 'integrations/openreplay-text' | 'integrations/openreplay' | 'integrations/redux' | 'integrations/rollbar-text' | 'integrations/rollbar' | 'integrations/segment' | 'integrations/sentry-text' | 'integrations/sentry' | 'integrations/slack-bw' | 'integrations/slack' | 'integrations/stackdriver' | 'integrations/sumologic-text' | 'integrations/sumologic' | 'integrations/teams-white' | 'integrations/teams' | 'integrations/vuejs' | 'journal-code' | 'layer-group' | 'lightbulb-on' | 'lightbulb' | 'link-45deg' | 'list-alt' | 'list-arrow' | 'list-ul' | 'list' | 'lock-alt' | 'magic' | 'map-marker-alt' | 'memory' | 'mic-mute' | 'mic' | 'minus' | 'mobile' | 'mouse-alt' | 'network' | 'next1' | 'no-dashboard' | 'no-metrics-chart' | 'no-metrics' | 'no-recordings' | 'os/android' | 'os/chrome_os' | 'os/fedora' | 'os/ios' | 'os/linux' | 'os/mac_os_x' | 'os/other' | 'os/ubuntu' | 'os/windows' | 'os' | 'pause-fill' | 'pause' | 'pdf-download' | 'pencil-stop' | 'pencil' | 'percent' | 'performance-icon' | 'person-fill' | 'person' | 'pie-chart-fill' | 'pin-fill' | 'play-circle-bold' | 'play-circle-light' | 'play-circle' | 'play-fill-new' | 'play-fill' | 'play-hover' | 'play' | 'plus-circle' | 'plus-lg' | 'plus' | 'pointer-sessions-search' | 'prev1' | 'puzzle-piece' | 'puzzle' | 'question-circle' | 'question-lg' | 'quote-left' | 'quote-right' | 'quotes' | 'record-circle' | 'redo-back' | 'redo' | 'remote-control' | 'replay-10' | 'resources-icon' | 'safe-fill' | 'safe' | 'sandglass' | 'search' | 'search_notification' | 'server' | 'share-alt' | 'shield-lock' | 'signpost-split' | 'signup' | 'skip-forward-fill' | 'skip-forward' | 'slack' | 'slash-circle' | 'sliders' | 'social/slack' | 'social/trello' | 'speedometer2' | 'spinner' | 'star-solid' | 'star' | 'step-forward' | 'stop-record-circle' | 'stopwatch' | 'store' | 'sync-alt' | 'table-new' | 'table' | 'tablet-android' | 'tachometer-slow' | 'tachometer-slowest' | 'tags' | 'team-funnel' | 'telephone-fill' | 'telephone' | 'text-paragraph' | 'tools' | 'trash' | 'turtle' | 'user-alt' | 'user-circle' | 'user-friends' | 'users' | 'vendors/graphql' | 'vendors/mobx' | 'vendors/ngrx' | 'vendors/redux' | 'vendors/vuex' | 'web-vitals' | 'wifi' | 'window-alt' | 'window-restore' | 'window-x' | 'window' | 'zoom-in'; +export type IconNames = 'activity' | 'alarm-clock' | 'alarm-plus' | 'all-sessions' | 'analytics' | 'anchor' | 'arrow-alt-square-right' | 'arrow-bar-left' | 'arrow-clockwise' | 'arrow-counterclockwise' | 'arrow-down-short' | 'arrow-down' | 'arrow-repeat' | 'arrow-right-short' | 'arrow-square-left' | 'arrow-square-right' | 'arrow-up-short' | 'arrow-up' | 'arrows-angle-extend' | 'avatar/icn_bear' | 'avatar/icn_beaver' | 'avatar/icn_bird' | 'avatar/icn_bison' | 'avatar/icn_camel' | 'avatar/icn_chameleon' | 'avatar/icn_deer' | 'avatar/icn_dog' | 'avatar/icn_dolphin' | 'avatar/icn_elephant' | 'avatar/icn_fish' | 'avatar/icn_fox' | 'avatar/icn_gorilla' | 'avatar/icn_hippo' | 'avatar/icn_horse' | 'avatar/icn_hyena' | 'avatar/icn_kangaroo' | 'avatar/icn_lemur' | 'avatar/icn_mammel' | 'avatar/icn_monkey' | 'avatar/icn_moose' | 'avatar/icn_panda' | 'avatar/icn_penguin' | 'avatar/icn_porcupine' | 'avatar/icn_quail' | 'avatar/icn_rabbit' | 'avatar/icn_rhino' | 'avatar/icn_sea_horse' | 'avatar/icn_sheep' | 'avatar/icn_snake' | 'avatar/icn_squirrel' | 'avatar/icn_tapir' | 'avatar/icn_turtle' | 'avatar/icn_vulture' | 'avatar/icn_wild1' | 'avatar/icn_wild_bore' | 'ban' | 'bar-chart-line' | 'bar-pencil' | 'bell-fill' | 'bell-plus' | 'bell-slash' | 'bell' | 'binoculars' | 'book' | 'browser/browser' | 'browser/chrome' | 'browser/edge' | 'browser/electron' | 'browser/facebook' | 'browser/firefox' | 'browser/ie' | 'browser/opera' | 'browser/safari' | 'bullhorn' | 'business-time' | 'calendar-alt' | 'calendar-check' | 'calendar-day' | 'calendar' | 'call' | 'camera-alt' | 'camera-video-off' | 'camera-video' | 'camera' | 'card-checklist' | 'card-text' | 'caret-down-fill' | 'caret-left-fill' | 'caret-right-fill' | 'caret-up-fill' | 'chat-dots' | 'chat-right-text' | 'chat-square-quote' | 'check-circle-fill' | 'check-circle' | 'check' | 'chevron-double-left' | 'chevron-double-right' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-fill' | 'circle' | 'clipboard-list-check' | 'clock' | 'close' | 'cloud-fog2-fill' | 'code' | 'cog' | 'cogs' | 'collection' | 'columns-gap-filled' | 'columns-gap' | 'console/error' | 'console/exception' | 'console/info' | 'console/warning' | 'console' | 'controller' | 'cookies' | 'copy' | 'credit-card-front' | 'cross' | 'cubes' | 'dash' | 'dashboard-icn' | 'desktop' | 'device' | 'diagram-3' | 'dizzy' | 'door-closed' | 'doublecheck' | 'download' | 'drag' | 'edit' | 'ellipsis-v' | 'enter' | 'envelope' | 'errors-icon' | 'event/click' | 'event/clickrage' | 'event/code' | 'event/i-cursor' | 'event/input' | 'event/link' | 'event/location' | 'event/resize' | 'event/view' | 'exclamation-circle' | 'expand-wide' | 'explosion' | 'external-link-alt' | 'eye-slash-fill' | 'eye-slash' | 'eye' | 'fetch' | 'file-code' | 'file-medical-alt' | 'file-pdf' | 'file' | 'files' | 'filter' | 'filters/arrow-return-right' | 'filters/browser' | 'filters/click' | 'filters/clickrage' | 'filters/code' | 'filters/console' | 'filters/country' | 'filters/cpu-load' | 'filters/custom' | 'filters/device' | 'filters/dom-complete' | 'filters/duration' | 'filters/error' | 'filters/fetch-failed' | 'filters/fetch' | 'filters/file-code' | 'filters/graphql' | 'filters/i-cursor' | 'filters/input' | 'filters/lcpt' | 'filters/link' | 'filters/location' | 'filters/memory-load' | 'filters/metadata' | 'filters/os' | 'filters/perfromance-network-request' | 'filters/platform' | 'filters/referrer' | 'filters/resize' | 'filters/rev-id' | 'filters/state-action' | 'filters/ttfb' | 'filters/user-alt' | 'filters/userid' | 'filters/view' | 'flag-na' | 'folder-plus' | 'folder2' | 'fullscreen' | 'funnel/cpu-fill' | 'funnel/cpu' | 'funnel/dizzy' | 'funnel/emoji-angry-fill' | 'funnel/emoji-angry' | 'funnel/emoji-dizzy-fill' | 'funnel/exclamation-circle-fill' | 'funnel/exclamation-circle' | 'funnel/file-earmark-break-fill' | 'funnel/file-earmark-break' | 'funnel/file-earmark-minus-fill' | 'funnel/file-earmark-minus' | 'funnel/file-medical-alt' | 'funnel/file-x' | 'funnel/hdd-fill' | 'funnel/hourglass-top' | 'funnel/image-fill' | 'funnel/image' | 'funnel/microchip' | 'funnel/mouse' | 'funnel/patch-exclamation-fill' | 'funnel/sd-card' | 'funnel-fill' | 'funnel-new' | 'funnel' | 'gear-fill' | 'gear' | 'geo-alt-fill-custom' | 'github' | 'graph-up-arrow' | 'graph-up' | 'grid-1x2' | 'grid-3x3' | 'grid-check' | 'grid-horizontal' | 'grid' | 'grip-horizontal' | 'hash' | 'hdd-stack' | 'headset' | 'heart-rate' | 'high-engagement' | 'history' | 'hourglass-start' | 'ic-errors' | 'ic-network' | 'ic-rage' | 'ic-resources' | 'id-card' | 'image' | 'info-circle-fill' | 'info-circle' | 'info-square' | 'info' | 'inspect' | 'integrations/assist' | 'integrations/bugsnag-text' | 'integrations/bugsnag' | 'integrations/cloudwatch-text' | 'integrations/cloudwatch' | 'integrations/datadog' | 'integrations/elasticsearch-text' | 'integrations/elasticsearch' | 'integrations/github' | 'integrations/graphql' | 'integrations/jira-text' | 'integrations/jira' | 'integrations/mobx' | 'integrations/newrelic-text' | 'integrations/newrelic' | 'integrations/ngrx' | 'integrations/openreplay-text' | 'integrations/openreplay' | 'integrations/redux' | 'integrations/rollbar-text' | 'integrations/rollbar' | 'integrations/segment' | 'integrations/sentry-text' | 'integrations/sentry' | 'integrations/slack-bw' | 'integrations/slack' | 'integrations/stackdriver' | 'integrations/sumologic-text' | 'integrations/sumologic' | 'integrations/teams-white' | 'integrations/teams' | 'integrations/vuejs' | 'journal-code' | 'layer-group' | 'lightbulb-on' | 'lightbulb' | 'link-45deg' | 'list-alt' | 'list-arrow' | 'list-ul' | 'list' | 'lock-alt' | 'magic' | 'map-marker-alt' | 'memory' | 'mic-mute' | 'mic' | 'minus' | 'mobile' | 'mouse-alt' | 'network' | 'next1' | 'no-dashboard' | 'no-metrics-chart' | 'no-metrics' | 'no-recordings' | 'os/android' | 'os/chrome_os' | 'os/fedora' | 'os/ios' | 'os/linux' | 'os/mac_os_x' | 'os/other' | 'os/ubuntu' | 'os/windows' | 'os' | 'pause-fill' | 'pause' | 'pdf-download' | 'pencil-stop' | 'pencil' | 'percent' | 'performance-icon' | 'person-fill' | 'person' | 'pie-chart-fill' | 'pin-fill' | 'play-circle-bold' | 'play-circle-light' | 'play-circle' | 'play-fill-new' | 'play-fill' | 'play-hover' | 'play' | 'plus-circle' | 'plus-lg' | 'plus' | 'pointer-sessions-search' | 'prev1' | 'puzzle-piece' | 'puzzle' | 'question-circle' | 'question-lg' | 'quote-left' | 'quote-right' | 'quotes' | 'record-circle' | 'redo-back' | 'redo' | 'remote-control' | 'replay-10' | 'resources-icon' | 'safe-fill' | 'safe' | 'sandglass' | 'search' | 'search_notification' | 'server' | 'share-alt' | 'shield-lock' | 'signpost-split' | 'signup' | 'skip-forward-fill' | 'skip-forward' | 'slack' | 'slash-circle' | 'sliders' | 'social/slack' | 'social/trello' | 'speedometer2' | 'spinner' | 'star-solid' | 'star' | 'step-forward' | 'stop-record-circle' | 'stopwatch' | 'store' | 'sync-alt' | 'table-new' | 'table' | 'tablet-android' | 'tachometer-slow' | 'tachometer-slowest' | 'tags' | 'team-funnel' | 'telephone-fill' | 'telephone' | 'text-paragraph' | 'tools' | 'trash' | 'turtle' | 'user-alt' | 'user-circle' | 'user-friends' | 'users' | 'vendors/graphql' | 'vendors/mobx' | 'vendors/ngrx' | 'vendors/redux' | 'vendors/vuex' | 'web-vitals' | 'wifi' | 'window-alt' | 'window-restore' | 'window-x' | 'window' | 'zoom-in'; interface Props { name: IconNames; @@ -138,6 +138,7 @@ const SVG = (props: Props) => { case 'cookies': return ; case 'copy': return ; case 'credit-card-front': return ; + case 'cross': return ; case 'cubes': return ; case 'dash': return ; case 'dashboard-icn': return ; diff --git a/frontend/app/svg/ca-no-recordings.svg b/frontend/app/svg/ca-no-recordings.svg index e98a56acf..4c5c3b173 100644 --- a/frontend/app/svg/ca-no-recordings.svg +++ b/frontend/app/svg/ca-no-recordings.svg @@ -1,4 +1,4 @@ - + diff --git a/frontend/app/svg/icons/cross.svg b/frontend/app/svg/icons/cross.svg new file mode 100644 index 000000000..9948ce547 --- /dev/null +++ b/frontend/app/svg/icons/cross.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tracker/tracker/src/main/app/index.ts b/tracker/tracker/src/main/app/index.ts index 7103518d5..c3f008215 100644 --- a/tracker/tracker/src/main/app/index.ts +++ b/tracker/tracker/src/main/app/index.ts @@ -333,9 +333,9 @@ export default class App { return undefined } const ingest = this.options.ingestPoint - const isSaas = ingest === DEFAULT_INGEST_POINT + const isSaas = /api.openreplay.com/.test(ingest) - const projectPath = isSaas ? ingest.replace('api', 'app') : ingest + const projectPath = isSaas ? 'https://openreplay.com/ingest' : ingest const url = projectPath.replace(/ingest$/, `${projectID}/session/${sessionID}`) From fb167d09c0868d79b703f56e025daf808d0663c4 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 26 Jan 2023 14:59:11 +0100 Subject: [PATCH 03/10] feat(chalice): fixed card cast --- api/chalicelib/core/custom_metrics.py | 10 +++++----- ee/api/chalicelib/core/custom_metrics.py | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index bb46a54aa..944bebc4f 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -170,7 +170,7 @@ def make_chart(project_id, user_id, metric_id, data: schemas.CardChartSchema, def get_sessions(project_id, user_id, metric_id, data: schemas.CardSessionsSchema): # raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False, include_data=True) - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) if raw_metric is None: return None metric: schemas.CreateCardSchema = schemas.CreateCardSchema(**raw_metric) @@ -197,7 +197,7 @@ def get_sessions(project_id, user_id, metric_id, data: schemas.CardSessionsSchem def get_funnel_issues(project_id, user_id, metric_id, data: schemas.CardSessionsSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) if raw_metric is None: return None metric: schemas.CreateCardSchema = schemas.CreateCardSchema(**raw_metric) @@ -214,7 +214,7 @@ def get_funnel_issues(project_id, user_id, metric_id, data: schemas.CardSessions def get_errors_list(project_id, user_id, metric_id, data: schemas.CardSessionsSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) if raw_metric is None: return None metric: schemas.CreateCardSchema = schemas.CreateCardSchema(**raw_metric) @@ -569,13 +569,13 @@ def get_funnel_sessions_by_issue(user_id, project_id, metric_id, issue_id, def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChartSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) if raw_metric is None: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="card not found") metric: schemas.CreateCardSchema = schemas.CreateCardSchema(**raw_metric) if metric.is_template: return get_predefined_metric(key=metric.metric_of, project_id=project_id, data=data.dict()) - elif __is_click_map(raw_metric) and raw_metric["data"]: + elif __is_click_map(metric) and raw_metric["data"]: keys = sessions_mobs. \ __get_mob_keys(project_id=project_id, session_id=raw_metric["data"]["sessionId"]) mob_exists = False diff --git a/ee/api/chalicelib/core/custom_metrics.py b/ee/api/chalicelib/core/custom_metrics.py index d3aff6822..eb47a767c 100644 --- a/ee/api/chalicelib/core/custom_metrics.py +++ b/ee/api/chalicelib/core/custom_metrics.py @@ -198,7 +198,8 @@ def make_chart(project_id, user_id, metric_id, data: schemas.CardChartSchema, def get_sessions(project_id, user_id, metric_id, data: schemas.CardSessionsSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False, include_data=True) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False, + include_data=True) if raw_metric is None: return None metric: schemas_ee.CreateCardSchema = schemas_ee.CreateCardSchema(**raw_metric) @@ -225,7 +226,7 @@ def get_sessions(project_id, user_id, metric_id, data: schemas.CardSessionsSchem def get_funnel_issues(project_id, user_id, metric_id, data: schemas.CardSessionsSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) if raw_metric is None: return None metric: schemas_ee.CreateCardSchema = schemas_ee.CreateCardSchema(**raw_metric) @@ -242,7 +243,7 @@ def get_funnel_issues(project_id, user_id, metric_id, data: schemas.CardSessions def get_errors_list(project_id, user_id, metric_id, data: schemas.CardSessionsSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, flatten=False) if raw_metric is None: return None metric: schemas_ee.CreateCardSchema = schemas_ee.CreateCardSchema(**raw_metric) @@ -622,13 +623,13 @@ def get_funnel_sessions_by_issue(user_id, project_id, metric_id, issue_id, def make_chart_from_card(project_id, user_id, metric_id, data: schemas.CardChartSchema): - raw_metric = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) + raw_metric: dict = get_card(metric_id=metric_id, project_id=project_id, user_id=user_id, include_data=True) if raw_metric is None: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="card not found") metric: schemas_ee.CreateCardSchema = schemas_ee.CreateCardSchema(**raw_metric) if metric.is_template: return get_predefined_metric(key=metric.metric_of, project_id=project_id, data=data.dict()) - elif __is_click_map(raw_metric) and raw_metric["data"]: + elif __is_click_map(metric) and raw_metric["data"]: keys = sessions_mobs. \ __get_mob_keys(project_id=project_id, session_id=raw_metric["data"]["sessionId"]) mob_exists = False From bb72d091065287d049ba66455746ff64a76d588f Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Tue, 24 Jan 2023 19:51:23 +0100 Subject: [PATCH 04/10] fix(helm): Select cron api based on kube api Signed-off-by: rjshrjndrn From bf47073407e0bfe022f08ff64e208f7f564a3508 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Thu, 26 Jan 2023 16:38:21 +0100 Subject: [PATCH 05/10] fix(ui): remember dismissed warning --- frontend/app/components/Session_/Subheader.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/Session_/Subheader.js b/frontend/app/components/Session_/Subheader.js index b39a48182..8a8d4d2f6 100644 --- a/frontend/app/components/Session_/Subheader.js +++ b/frontend/app/components/Session_/Subheader.js @@ -12,9 +12,14 @@ import BugReportModal from './BugReport/BugReportModal'; import { PlayerContext } from 'App/components/Session/playerContext'; import { observer } from 'mobx-react-lite'; import AutoplayToggle from 'Shared/AutoplayToggle'; +import { connect } from 'react-redux' + +const localhostWarn = (project) => project + '_localhost_warn' function SubHeader(props) { - const [showWarningModal, setWarning] = React.useState(true); + const localhostWarnKey = localhostWarn(props.siteId) + const defaultLocalhostWarn = localStorage.getItem(localhostWarnKey) !== '1' + const [showWarningModal, setWarning] = React.useState(defaultLocalhostWarn); const { player, store } = React.useContext(PlayerContext); const { width, @@ -58,6 +63,10 @@ function SubHeader(props) { const showWarning = location && /(localhost)|(127.0.0.1)|(0.0.0.0)/.test(location) && showWarningModal; + const closeWarning = () => { + localStorage.setItem(localhostWarnKey, '1') + setWarning(false) + } return (
{showWarning ? ( @@ -81,7 +90,7 @@ function SubHeader(props) { > Learn More -
setWarning(false)}> +
@@ -145,4 +154,4 @@ function SubHeader(props) { ); } -export default observer(SubHeader); +export default connect((state) => ({ siteId: state.getIn(['site', 'siteId']) }))(observer(SubHeader)); From ebbc45232635f9c49f29bb06f663a8a3b0f68045 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Thu, 26 Jan 2023 17:20:07 +0100 Subject: [PATCH 06/10] fix(ui): case insensitive match for search --- .../app/components/Assist/RecordingsList/RecordingsList.tsx | 2 +- .../components/SavedSearchModal/SavedSearchModal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx b/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx index 18cbc3478..0e8d1afd5 100644 --- a/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx +++ b/frontend/app/components/Assist/RecordingsList/RecordingsList.tsx @@ -29,7 +29,7 @@ function RecordingsList() { show={length === 0} title={
- +
{recordsSearch !== '' ? 'No matching results' diff --git a/frontend/app/components/shared/SavedSearch/components/SavedSearchModal/SavedSearchModal.tsx b/frontend/app/components/shared/SavedSearch/components/SavedSearchModal/SavedSearchModal.tsx index 0e1cccedd..fe8ac1ade 100644 --- a/frontend/app/components/shared/SavedSearch/components/SavedSearchModal/SavedSearchModal.tsx +++ b/frontend/app/components/shared/SavedSearch/components/SavedSearchModal/SavedSearchModal.tsx @@ -59,7 +59,7 @@ function SavedSearchModal(props: Props) { setTimeout(() => setshowModal(true), 0); }; - const shownItems = props.list.filter((item) => item.name.includes(filterQuery)); + const shownItems = props.list.filter((item) => item.name.toLocaleLowerCase().includes(filterQuery.toLocaleLowerCase())); return (
From d2c505738f2f9c5e795732e2df37c8b033909dea Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 26 Jan 2023 17:24:38 +0100 Subject: [PATCH 07/10] chore(helm): Kyverno permissive mode Ref: https://github.com/kyverno/kyverno/issues/6123 Signed-off-by: rjshrjndrn --- scripts/helmcharts/toolings/templates/kyverno.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/helmcharts/toolings/templates/kyverno.yaml b/scripts/helmcharts/toolings/templates/kyverno.yaml index 2f045abf0..c17ff8df8 100644 --- a/scripts/helmcharts/toolings/templates/kyverno.yaml +++ b/scripts/helmcharts/toolings/templates/kyverno.yaml @@ -7,10 +7,12 @@ metadata: "helm.sh/hook": post-install, post-upgrade "helm.sh/hook-weight": "4" # Higher precidence, so the first the config map will get created. spec: - validationFailureAction: enforce + # validationFailureAction: enforce + validationFailureAction: audit background: false webhookTimeoutSeconds: 30 - failurePolicy: Fail + # failurePolicy: Fail + failurePolicy: Ignore rules: - name: openreplay-image-signature match: From c7074d36ac75654b97105a53a8e01317cd74c278 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 26 Jan 2023 17:42:22 +0100 Subject: [PATCH 08/10] chore(helm): Upgrading non existing installations Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay-cli | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/helmcharts/openreplay-cli b/scripts/helmcharts/openreplay-cli index 218106636..e5bdc126e 100755 --- a/scripts/helmcharts/openreplay-cli +++ b/scripts/helmcharts/openreplay-cli @@ -108,6 +108,7 @@ log info ' Usage: openreplay [ -h | --help ] [ -s | --status ] [ -u | --upgrade ] + [ -U | --deprecated-upgrade /path/to/old_vars.yaml] [ -r | --restart ] [ -R | --Reload ] [ -p | --install-packages ] @@ -157,6 +158,12 @@ function or_helm_upgrade() { } +function upgrade_old() { + old_vars_path="$1" + sudo cp -b "${old_vars_path}" "${OR_DIR}/vars.yaml" || log err "Not able to copy old vars.yaml" + upgrade +} + function upgrade() { # TODO: # 1. store vars.yaml in central place. @@ -188,7 +195,8 @@ function upgrade() { sudo mv ./openreplay-cli /bin/ sudo mv ./vars.yaml "$OR_DIR" sudo cp -rf ../../../openreplay $OR_DIR/ - log info All the configuration has been stored to $OR_DIR/vars.yaml file + log info "Configuration file is saved in /var/lib/openreplay/vars.yaml" + log info "Run ${BWHITE}openreplay -h${GREEN} to see the cli information to manage OpenReplay." err_cd - return @@ -210,7 +218,7 @@ function clean_tmp_dir() { install_packages } -PARSED_ARGUMENTS=$(busybox getopt -a -n openreplay -o Rrvpiuhsl: --long reload,restart,verbose,install-packages,install,upgrade,help,status,logs: -- "$@") +PARSED_ARGUMENTS=$(busybox getopt -a -n openreplay -o Rrvpiuhsl:U: --long reload,restart,verbose,install-packages,install,upgrade,help,status,logs,deprecated-upgrade: -- "$@") VALID_ARGUMENTS=$? if [[ "$VALID_ARGUMENTS" != "0" ]]; then help @@ -233,6 +241,12 @@ do clean_tmp_dir exit 0 ;; + -U | --deprecated-upgrade) + log title "[Deprected] Upgrading OpenReplay" + upgrade_old "$2" + clean_tmp_dir + exit 0 + ;; -r | --restart) log title "Restarting OpenReplay Components" kubectl rollout restart deployment -n "${APP_NS}" From bd3d21ea1850a13e68e6db2cc0669001198cf324 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 26 Jan 2023 18:14:15 +0100 Subject: [PATCH 09/10] feat(chalice): changed projects response --- api/chalicelib/core/projects.py | 9 ++++++--- ee/api/chalicelib/core/projects.py | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/api/chalicelib/core/projects.py b/api/chalicelib/core/projects.py index ef4218a49..5e0c2ec07 100644 --- a/api/chalicelib/core/projects.py +++ b/api/chalicelib/core/projects.py @@ -66,8 +66,8 @@ def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, st LIMIT 1) AS stack_integrations ON TRUE""" query = cur.mogrify(f"""{"SELECT *, first_recorded IS NOT NULL AS recorded FROM (" if recorded else ""} - SELECT s.project_id, s.name, s.project_key, s.save_request_payloads, s.first_recorded_session_at - {extra_projection} + SELECT s.project_id, s.name, s.project_key, s.save_request_payloads, s.first_recorded_session_at, + created_at {extra_projection} FROM public.projects AS s {extra_join} WHERE s.deleted_at IS NULL @@ -79,6 +79,7 @@ def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, st u_values = [] params = {} for i, r in enumerate(rows): + r["created_at"] = TimeUTC.datetime_to_timestamp(r["created_at"]) if r["first_recorded_session_at"] is None: u_values.append(f"(%(project_id_{i})s,to_timestamp(%(first_recorded_{i})s/1000))") params[f"project_id_{i}"] = r["project_id"] @@ -91,7 +92,9 @@ def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, st FROM (VALUES {",".join(u_values)}) AS u(project_id,first_recorded) WHERE projects.project_id=u.project_id;""", params) cur.execute(query) - + else: + for r in rows: + r["created_at"] = TimeUTC.datetime_to_timestamp(r["created_at"]) if recording_state and len(rows) > 0: project_ids = [f'({r["project_id"]})' for r in rows] query = cur.mogrify(f"""SELECT projects.project_id, COALESCE(MAX(start_ts), 0) AS last diff --git a/ee/api/chalicelib/core/projects.py b/ee/api/chalicelib/core/projects.py index 18d71914b..ee5fe9916 100644 --- a/ee/api/chalicelib/core/projects.py +++ b/ee/api/chalicelib/core/projects.py @@ -76,8 +76,8 @@ def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, st LIMIT 1) AS stack_integrations ON TRUE""" query = cur.mogrify(f"""{"SELECT *, first_recorded IS NOT NULL AS recorded FROM (" if recorded else ""} - SELECT s.project_id, s.name, s.project_key, s.save_request_payloads, s.first_recorded_session_at - {extra_projection} + SELECT s.project_id, s.name, s.project_key, s.save_request_payloads, s.first_recorded_session_at, + created_at {extra_projection} FROM public.projects AS s {extra_join} {role_query if user_id is not None else ""} @@ -92,6 +92,7 @@ def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, st u_values = [] params = {} for i, r in enumerate(rows): + r["created_at"] = TimeUTC.datetime_to_timestamp(r["created_at"]) if r["first_recorded_session_at"] is None: u_values.append(f"(%(project_id_{i})s,to_timestamp(%(first_recorded_{i})s/1000))") params[f"project_id_{i}"] = r["project_id"] @@ -104,7 +105,9 @@ def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, st FROM (VALUES {",".join(u_values)}) AS u(project_id,first_recorded) WHERE projects.project_id=u.project_id;""", params) cur.execute(query) - + else: + for r in rows: + r["created_at"] = TimeUTC.datetime_to_timestamp(r["created_at"]) if recording_state and len(rows) > 0: project_ids = [f'({r["project_id"]})' for r in rows] query = cur.mogrify(f"""SELECT projects.project_id, COALESCE(MAX(start_ts), 0) AS last From 914c733df9dfcda8872e6496f4fec4b4151aeda3 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 26 Jan 2023 18:17:13 +0100 Subject: [PATCH 10/10] chore(helm): Backing up old vars.yaml Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay-cli | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/helmcharts/openreplay-cli b/scripts/helmcharts/openreplay-cli index e5bdc126e..5411a5630 100755 --- a/scripts/helmcharts/openreplay-cli +++ b/scripts/helmcharts/openreplay-cli @@ -160,7 +160,9 @@ function or_helm_upgrade() { function upgrade_old() { old_vars_path="$1" - sudo cp -b "${old_vars_path}" "${OR_DIR}/vars.yaml" || log err "Not able to copy old vars.yaml" + or_version=$(busybox awk '/fromVersion/{print $2}' < "${old_vars_path}") + sudo cp "${old_vars_path}" ${OR_DIR}/vars.yaml.backup."${or_version//\"}"_"$(date +%Y%m%d-%H%M%S)" || log err "Not able to copy old vars.yaml" + sudo cp "${old_vars_path}" ${OR_DIR}/vars.yaml || log err "Not able to copy old vars.yaml" upgrade } @@ -173,10 +175,10 @@ function upgrade() { exists git || log err "Git not found. Please install" log info "Working directory $tmp_dir" err_cd "$tmp_dir" - or_version=$(awk '/fromVersion/{print $2}' < "${OR_DIR}/vars.yaml") + or_version=$(busybox awk '/fromVersion/{print $2}' < "${OR_DIR}/vars.yaml") # Creating backup dir of current installation - [[ -d "$OR_DIR/openreplay" ]] && sudo cp -b "$OR_DIR/openreplay" "$OR_DIR/openreplay_${or_version//\"}" && sudo rm -rf ${OR_DIR}/openreplay + [[ -d "$OR_DIR/openreplay" ]] && sudo cp -rfb "$OR_DIR/openreplay" "$OR_DIR/openreplay_${or_version//\"}" && sudo rm -rf ${OR_DIR}/openreplay git clone "${OR_REPO}" --depth 1 err_cd openreplay/scripts/helmcharts