From fdd2d93cc3845c597ef65a7b8682a483ec7feed9 Mon Sep 17 00:00:00 2001 From: sylenien Date: Mon, 31 Oct 2022 17:00:04 +0100 Subject: [PATCH 01/17] fix(ui): fix note url copy --- .../Session_/EventsBlock/NoteEvent.tsx | 2 +- .../components/Notes/NoteItem.tsx | 7 +- .../app/components/ui/ItemMenu/ItemMenu.tsx | 128 ++++++++++++++++++ 3 files changed, 131 insertions(+), 6 deletions(-) create mode 100644 frontend/app/components/ui/ItemMenu/ItemMenu.tsx diff --git a/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx b/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx index 622d13831..5544fa7cb 100644 --- a/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx +++ b/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx @@ -45,7 +45,7 @@ function NoteEvent(props: Props) { copy( `${window.location.origin}/${window.location.pathname.split('/')[1]}${session( props.note.sessionId - )}${props.note.timestamp > 0 ? '?jumpto=' + props.note.timestamp : ''}` + )}${props.note.timestamp > 0 ? `?jumpto=${props.note.timestamp}¬e=${props.note.noteId}` : `?note=${props.note.noteId}`}` ); toast.success('Note URL copied to clipboard'); }; diff --git a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx index 33108c0fe..4afda2e4f 100644 --- a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx +++ b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx @@ -24,7 +24,7 @@ function NoteItem(props: Props) { copy( `${window.location.origin}/${window.location.pathname.split('/')[1]}${session( props.note.sessionId - )}${props.note.timestamp > 0 ? '?jumpto=' + props.note.timestamp : ''}` + )}${props.note.timestamp > 0 ? `?jumpto=${props.note.timestamp}¬e=${props.note.noteId}` : `?note=${props.note.noteId}`}` ); toast.success('Note URL copied to clipboard'); }; @@ -49,7 +49,7 @@ function NoteItem(props: Props) { session(props.note.sessionId) + (props.note.timestamp > 0 ? `?jumpto=${props.note.timestamp}¬e=${props.note.noteId}` - : '') + : `?note=${props.note.noteId}`) } >
@@ -60,9 +60,6 @@ function NoteItem(props: Props) { style={{ // @ts-ignore background: tagProps[props.note.tag], - // userSelect: 'none', - // width: 'fit-content', - // fontSize: 11, padding: '1px 6px', }} className="rounded-full text-white text-xs select-none w-fit" diff --git a/frontend/app/components/ui/ItemMenu/ItemMenu.tsx b/frontend/app/components/ui/ItemMenu/ItemMenu.tsx new file mode 100644 index 000000000..ee9876503 --- /dev/null +++ b/frontend/app/components/ui/ItemMenu/ItemMenu.tsx @@ -0,0 +1,128 @@ +import React from 'react'; +import { Icon } from 'UI'; +import styles from './itemMenu.module.css'; +import OutsideClickDetectingDiv from 'Shared/OutsideClickDetectingDiv'; +import cn from 'classnames'; + +interface Item { + icon: string; + text: string; + onClick: (args: any) => void; + hidden?: boolean; + disabled?: boolean; +} + +interface Props { + bold?: boolean; + flat?: boolean; + items: Item[]; + label?: React.ReactNode; + onToggle?: (args: any) => void; +} + +export default class ItemMenu extends React.PureComponent { + menuBtnRef: HTMLDivElement = null; + + state = { + displayed: false, + }; + + handleEsc = (e: KeyboardEvent) => e.key === 'Escape' && this.closeMenu(); + + componentDidMount() { + document.addEventListener('keydown', this.handleEsc, false); + } + componentWillUnmount() { + document.removeEventListener('keydown', this.handleEsc, false); + } + + onClick = (callback: Function) => (e: React.MouseEvent) => { + e.stopPropagation(); + callback(e); + }; + + toggleMenu = () => { + const shouldDisplay = !this.state.displayed; + this.setState({ displayed: shouldDisplay }); + this.props.onToggle?.(shouldDisplay); + }; + + closeMenu = () => { + this.setState({ displayed: false }); + this.props.onToggle?.(false); + }; + + render() { + const { items, label = '', bold } = this.props; + const { displayed } = this.state; + const parentStyles = label ? 'rounded px-2 py-2 hover:bg-gray-light' : ''; + + return ( +
+ +
+ {label && ( + + {label} + + )} + {this.props.flat ? null : ( +
{ + this.menuBtnRef = ref; + }} + className={cn('rounded-full flex items-center justify-center', { + 'bg-gray-light': displayed, + 'w-10 h-10': !label, + })} + role="button" + > + +
+ )} +
+
+
+ {items + .filter(({ hidden }) => !hidden) + .map(({ onClick, text, icon, disabled = false }) => ( +
{}} + className={disabled ? 'cursor-not-allowed' : ''} + role="menuitem" + > +
+ {icon && ( +
+ {/* @ts-ignore */} + +
+ )} +
{text}
+
+
+ ))} +
+
+ ); + } +} From f829ef05c6018ca1045ba230c17ae1849ddfbd89 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 31 Oct 2022 20:57:04 +0100 Subject: [PATCH 02/17] chore(helm): disabling clickhouse installation to ee only Signed-off-by: rjshrjndrn --- scripts/helmcharts/vars.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helmcharts/vars.yaml b/scripts/helmcharts/vars.yaml index faa57c063..22e2b18d4 100644 --- a/scripts/helmcharts/vars.yaml +++ b/scripts/helmcharts/vars.yaml @@ -19,7 +19,7 @@ postgresql: &postgres clickhouse: # For enterpriseEdition - enabled: true + enabled: false quickwit: &quickwit # For enterpriseEdition From 0e153c7c0b5db946fbd203b03d8d605e2c616fc4 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 2 Nov 2022 09:29:02 +0100 Subject: [PATCH 03/17] fix(ui) - session settings dropdown --- .../app/components/Dashboard/components/Alerts/AlertsView.tsx | 2 +- .../Dashboard/components/DashboardList/DashboardsView.tsx | 2 +- .../components/Dashboard/components/MetricsView/MetricsView.tsx | 2 +- frontend/app/components/Header/UserMenu/UserMenu.tsx | 2 +- .../shared/SessionSettings/components/ListingVisibility.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/Dashboard/components/Alerts/AlertsView.tsx b/frontend/app/components/Dashboard/components/Alerts/AlertsView.tsx index 277f13ab8..07b77961a 100644 --- a/frontend/app/components/Dashboard/components/Alerts/AlertsView.tsx +++ b/frontend/app/components/Dashboard/components/Alerts/AlertsView.tsx @@ -21,7 +21,7 @@ function AlertsView({ siteId, init }: IAlertsView) {
- +
diff --git a/frontend/app/components/Dashboard/components/DashboardList/DashboardsView.tsx b/frontend/app/components/Dashboard/components/DashboardList/DashboardsView.tsx index 11634632f..5341c3487 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/DashboardsView.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/DashboardsView.tsx @@ -27,7 +27,7 @@ function DashboardsView({ history, siteId }: { history: any, siteId: string }) {
- +
diff --git a/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx b/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx index d5402fd2c..dd87b2fef 100644 --- a/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx +++ b/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx @@ -22,7 +22,7 @@ function MetricsView({ siteId }: Props) {
- +
diff --git a/frontend/app/components/Header/UserMenu/UserMenu.tsx b/frontend/app/components/Header/UserMenu/UserMenu.tsx index 3e74f63e9..d9940248b 100644 --- a/frontend/app/components/Header/UserMenu/UserMenu.tsx +++ b/frontend/app/components/Header/UserMenu/UserMenu.tsx @@ -26,7 +26,7 @@ function UserMenu(props: RouteComponentProps) { style={{ width: '250px' }} className={cn(className, 'absolute right-0 top-0 bg-white border mt-14')} > -
+
{getInitials(account.name)}
diff --git a/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx b/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx index 1151c0eed..c18629490 100644 --- a/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx +++ b/frontend/app/components/shared/SessionSettings/components/ListingVisibility.tsx @@ -38,7 +38,7 @@ function ListingVisibility() {