From b75e008471b8af2a8799b770bc787ba04d135522 Mon Sep 17 00:00:00 2001 From: Sudheer Salavadi Date: Tue, 2 Jul 2024 15:04:05 +0530 Subject: [PATCH] various ui improvements --- .../app/components/Session_/Issues/Issues.js | 6 +-- .../Controls/components/KeyboardHelp.tsx | 9 +++-- .../Player/Controls/components/ReadNote.tsx | 32 ++++++++++----- frontend/app/components/Session_/Subheader.js | 9 +++-- .../Session_/components/NotePopup.tsx | 6 +-- .../components/shared/Bookmark/Bookmark.tsx | 7 ++-- .../LiveSessionList/LiveSessionList.tsx | 4 +- .../shared/ReloadButton/ReloadButton.tsx | 8 ++-- .../components/Notes/NoteItem.tsx | 36 ++++++++++------- .../components/Notes/TeamBadge.tsx | 2 +- .../components/SessionList/SessionList.tsx | 2 +- .../SessionCopyLink/SessionCopyLink.tsx | 11 +++-- .../shared/SharePopup/SharePopup.tsx | 6 +-- .../SortOrderButton/SortOrderButton.tsx | 40 ++++++++----------- .../app/components/ui/ItemMenu/ItemMenu.tsx | 6 +-- frontend/app/components/ui/Link/Link.js | 2 +- frontend/app/services/NotesService.ts | 4 +- 17 files changed, 105 insertions(+), 85 deletions(-) diff --git a/frontend/app/components/Session_/Issues/Issues.js b/frontend/app/components/Session_/Issues/Issues.js index b1ef46f39..db5671454 100644 --- a/frontend/app/components/Session_/Issues/Issues.js +++ b/frontend/app/components/Session_/Issues/Issues.js @@ -3,7 +3,7 @@ import { connect } from 'react-redux'; import { Popover, Icon } from 'UI'; import IssuesModal from './IssuesModal'; import { fetchProjects, fetchMeta } from 'Duck/assignments'; -import { Popover as AntPopover, Button } from 'antd'; +import { Tooltip, Button } from 'antd'; @connect( (state) => ({ @@ -67,11 +67,11 @@ class Issues extends React.Component { )} >
- + - +
); diff --git a/frontend/app/components/Session_/Player/Controls/components/KeyboardHelp.tsx b/frontend/app/components/Session_/Player/Controls/components/KeyboardHelp.tsx index 0d15d581e..981616ba7 100644 --- a/frontend/app/components/Session_/Player/Controls/components/KeyboardHelp.tsx +++ b/frontend/app/components/Session_/Player/Controls/components/KeyboardHelp.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Icon } from 'UI'; -import { Popover, Button } from 'antd'; +import {Keyboard} from 'lucide-react' +import { Button, Tooltip } from 'antd'; import { useModal } from "../../../../Modal"; const Key = ({ label }: { label: string }) =>
{label}
; @@ -35,7 +36,7 @@ function ShortcutGrid() { return (
Keyboard Shortcuts
-
+
@@ -61,6 +62,7 @@ function ShortcutGrid() { function KeyboardHelp() { const { showModal } = useModal(); return ( + + ); } diff --git a/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx b/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx index 8b3ad1b15..af18b5962 100644 --- a/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx +++ b/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx @@ -1,11 +1,12 @@ import React from 'react'; import { Icon } from 'UI'; +import { Button, Tag } from 'antd'; +import { PlayCircleOutlined } from '@ant-design/icons'; import { tagProps, Note } from 'App/services/NotesService'; import { formatTimeOrDate } from 'App/date'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import { TeamBadge } from 'Shared/SessionsTabOverview/components/Notes'; -import { Tag } from 'antd' interface Props { note?: Note; @@ -21,7 +22,7 @@ function ReadNote(props: Props) { return (
@@ -50,8 +51,8 @@ function ReadNote(props: Props) { className="flex items-center justify-center" >
@@ -71,23 +72,32 @@ function ReadNote(props: Props) { {props.note.message}
-
+
+
{props.note.tag ? ( {props.note.tag} ) : null} + + {!props.note.isPublic ? null : } + -
- - Play Session
+ +
diff --git a/frontend/app/components/Session_/Subheader.js b/frontend/app/components/Session_/Subheader.js index 6e6f697f9..0ca04e1d8 100644 --- a/frontend/app/components/Session_/Subheader.js +++ b/frontend/app/components/Session_/Subheader.js @@ -1,7 +1,7 @@ import React, { useMemo } from 'react'; import { useStore } from 'App/mstore'; import KeyboardHelp from 'Components/Session_/Player/Controls/components/KeyboardHelp'; -import { Icon, Tooltip } from 'UI'; +import { Icon } from 'UI'; import QueueControls from './QueueControls'; import Bookmark from 'Shared/Bookmark'; import SharePopup from '../shared/SharePopup/SharePopup'; @@ -13,7 +13,7 @@ import { connect } from 'react-redux'; import SessionTabs from 'Components/Session/Player/SharedComponents/SessionTabs'; import { IFRAME } from 'App/constants/storageKeys'; import cn from 'classnames'; -import { Switch, Button as AntButton, Popover } from 'antd'; +import { Switch, Button as AntButton, Popover, Tooltip } from 'antd'; import { ShareAltOutlined } from '@ant-design/icons'; const localhostWarn = (project) => project + '_localhost_warn'; @@ -96,6 +96,7 @@ function SubHeader(props) { )} style={{ width: 'max-content' }} > + @@ -104,11 +105,11 @@ function SubHeader(props) { showCopyLink={true} trigger={
- + - +
} /> diff --git a/frontend/app/components/Session_/components/NotePopup.tsx b/frontend/app/components/Session_/components/NotePopup.tsx index ae45fc926..cedeec750 100644 --- a/frontend/app/components/Session_/components/NotePopup.tsx +++ b/frontend/app/components/Session_/components/NotePopup.tsx @@ -2,7 +2,7 @@ import CreateNote from 'Components/Session_/Player/Controls/components/CreateNot import React from 'react'; import { connect } from 'react-redux'; import { PlayerContext } from 'App/components/Session/playerContext'; -import { Button, Popover } from 'antd'; +import { Button, Tooltip } from 'antd'; import { MessageOutlined } from '@ant-design/icons'; import { useModal } from 'App/components/Modal'; @@ -22,7 +22,7 @@ function NotePopup({ tooltipActive }: { tooltipActive: boolean }) { }; return ( - + - + ); } diff --git a/frontend/app/components/shared/Bookmark/Bookmark.tsx b/frontend/app/components/shared/Bookmark/Bookmark.tsx index d7c549f88..225476b68 100644 --- a/frontend/app/components/shared/Bookmark/Bookmark.tsx +++ b/frontend/app/components/shared/Bookmark/Bookmark.tsx @@ -1,4 +1,4 @@ -import { Button, Popover } from 'antd'; +import { Button, Tooltip } from 'antd'; import { BookmarkCheck, Bookmark as BookmarkIcn, Vault } from 'lucide-react'; import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; @@ -13,6 +13,7 @@ interface Props { isEnterprise: boolean; noMargin?: boolean; } + function Bookmark(props: Props) { const { sessionId, favorite, isEnterprise, noMargin } = props; const [isFavorite, setIsFavorite] = useState(favorite); @@ -48,7 +49,7 @@ function Bookmark(props: Props) { return (
- + - +
); } diff --git a/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx b/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx index 5f67e292d..03ff62f8a 100644 --- a/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx +++ b/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx @@ -41,7 +41,7 @@ function LiveSessionList(props: Props) { var timeoutId: any; const { filters } = filter; const hasUserFilter = filters.map((i: any) => i.key).includes(KEYS.USERID); - const sortOptions = [{ label: 'Newest', value: 'timestamp' }].concat( + const sortOptions = [{ label: 'Freshness', value: 'timestamp' }].concat( metaList .map((i: any) => ({ label: capitalize(i), @@ -105,6 +105,7 @@ function LiveSessionList(props: Props) { onChange={onSortChange} value={sortOptions.find((i: any) => i.value === filter.sort) || sortOptions[0]} /> +
props.applyFilter({ order: state })} @@ -204,3 +205,4 @@ export default withPermissions(['ASSIST_LIVE'])( } )(LiveSessionList) ); + diff --git a/frontend/app/components/shared/ReloadButton/ReloadButton.tsx b/frontend/app/components/shared/ReloadButton/ReloadButton.tsx index 774d427fe..03285c749 100644 --- a/frontend/app/components/shared/ReloadButton/ReloadButton.tsx +++ b/frontend/app/components/shared/ReloadButton/ReloadButton.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { CircularLoader, Icon, Tooltip, Button } from 'UI'; +import {Button, Tooltip} from 'antd'; +import { ListRestart } from 'lucide-react'; import cn from 'classnames'; interface Props { @@ -12,8 +13,9 @@ interface Props { export default function ReloadButton(props: Props) { const { loading, onClick, iconSize = '20', iconName = 'arrow-repeat', className = '' } = props; return ( - - ); diff --git a/frontend/app/components/shared/SessionsTabOverview/components/Notes/NoteItem.tsx b/frontend/app/components/shared/SessionsTabOverview/components/Notes/NoteItem.tsx index af09b5928..723b7226f 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/Notes/NoteItem.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/Notes/NoteItem.tsx @@ -35,35 +35,43 @@ function NoteItem(props: Props) { }); }; const menuItems = [ - { icon: 'link-45deg', text: 'Copy Note URL', onClick: onCopy }, + { icon: 'link-45deg', text: 'Copy Link', onClick: onCopy }, { icon: 'trash', text: 'Delete', onClick: onDelete }, ]; const safeStrMessage = props.note.message.length > 150 ? props.note.message.slice(0, 150) + '...' : props.note.message; return ( -
+
0 - ? `?jumpto=${props.note.timestamp}¬e=${props.note.noteId}` - : `?note=${props.note.noteId}`) - } - > -
-
{safeStrMessage}
-
- {props.note.tag ? ( + session(props.note.sessionId) + + (props.note.timestamp > 0 + ? `?jumpto=${props.note.timestamp}¬e=${props.note.noteId}` + : `?note=${props.note.noteId}`) + } + > +
+
+ + {props.note.tag ? ( {props.note.tag} ) : null} -
- By + +
+ {safeStrMessage} +
+
+
+ +
+ By {props.note.userName},{' '} {formatTimeOrDate(props.note.createdAt as unknown as number, timezone)}
diff --git a/frontend/app/components/shared/SessionsTabOverview/components/Notes/TeamBadge.tsx b/frontend/app/components/shared/SessionsTabOverview/components/Notes/TeamBadge.tsx index 8f509b5eb..9affbc7e1 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/Notes/TeamBadge.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/Notes/TeamBadge.tsx @@ -5,7 +5,7 @@ export default function TeamBadge() { return (
- Team + Team
) } \ No newline at end of file diff --git a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx index 08549dba9..dfd2a8504 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx @@ -215,7 +215,7 @@ function SessionList(props: Props) {
-
+
{NO_CONTENT.message}
diff --git a/frontend/app/components/shared/SharePopup/SessionCopyLink/SessionCopyLink.tsx b/frontend/app/components/shared/SharePopup/SessionCopyLink/SessionCopyLink.tsx index e408d683d..e0cd8a82b 100644 --- a/frontend/app/components/shared/SharePopup/SessionCopyLink/SessionCopyLink.tsx +++ b/frontend/app/components/shared/SharePopup/SessionCopyLink/SessionCopyLink.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { Button, Icon } from 'UI'; +import { Button } from 'antd'; +import { LinkOutlined } from '@ant-design/icons'; + import copy from 'copy-to-clipboard'; function SessionCopyLink({ time }: { time: number }) { @@ -20,11 +22,8 @@ function SessionCopyLink({ time }: { time: number }) { return (
- {copied &&
Copied
}
diff --git a/frontend/app/components/shared/SharePopup/SharePopup.tsx b/frontend/app/components/shared/SharePopup/SharePopup.tsx index 896168c49..ce7955924 100644 --- a/frontend/app/components/shared/SharePopup/SharePopup.tsx +++ b/frontend/app/components/shared/SharePopup/SharePopup.tsx @@ -175,7 +175,7 @@ function ShareModalComp({
-
+
Share via
{hasBoth ? ( @@ -214,7 +214,7 @@ function ShareModalComp({
-
Select a channel or individual
+
Select a channel or individual
{shareTo === 'slack' ? (