Skip to content

Commit

Permalink
feat: added tooltips for facing issue btn
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarRajput-7 committed May 1, 2024
1 parent 241edcb commit 5f75293
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
21 changes: 13 additions & 8 deletions frontend/src/components/facingIssueBtn/FacingIssueBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './FacingIssueBtn.style.scss';

import { Button } from 'antd';
import { Button, Tooltip } from 'antd';
import logEvent from 'api/common/logEvent';
import cx from 'classnames';
import { FeatureKeys } from 'constants/features';
Expand All @@ -15,6 +15,7 @@ export interface FacingIssueBtnProps {
message?: string;
buttonText?: string;
className?: string;
onHoverText?: string;
}

function FacingIssueBtn({
Expand All @@ -23,6 +24,7 @@ function FacingIssueBtn({
message = '',
buttonText = '',
className = '',
onHoverText = '',
}: FacingIssueBtnProps): JSX.Element | null {
const handleFacingIssuesClick = (): void => {
logEvent(eventName, attributes);
Expand All @@ -37,13 +39,15 @@ function FacingIssueBtn({

return isCloudUserVal && isChatSupportEnabled ? ( // Note: we would need to move this condition to license based in future
<div className="facing-issue-button">
<Button
className={cx('periscope-btn', 'facing-issue-button', className)}
onClick={handleFacingIssuesClick}
icon={<HelpCircle size={14} />}
>
{buttonText || 'Facing issues?'}
</Button>
<Tooltip title={onHoverText} autoAdjustOverflow>
<Button
className={cx('periscope-btn', 'facing-issue-button', className)}
onClick={handleFacingIssuesClick}
icon={<HelpCircle size={14} />}
>
{buttonText || 'Facing issues?'}
</Button>
</Tooltip>
</div>
) : null;
}
Expand All @@ -52,6 +56,7 @@ FacingIssueBtn.defaultProps = {
message: '',
buttonText: '',
className: '',
onHoverText: '',
};

export default FacingIssueBtn;
2 changes: 1 addition & 1 deletion frontend/src/container/FormAlertRules/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ function FormAlertRules({
eventName="Alert: Facing Issues in alert"
buttonText="Need help with this alert?"
message={alertHelpMessage(alertDef, ruleId)}
// onHover: Click here to get help with this alert
onHoverText="Click here to get help with this alert"
/>
</Col>
</PanelContainer>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/GridCardLayout/GridCardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ function GraphLayout({ onAddPanelHandler }: GraphLayoutProps): JSX.Element {
eventName="Dashboard: Facing Issues in dashboard"
buttonText="Need help with this dashboard?"
message={dashboardHelpMessage(data, selectedDashboard)}
// onHover: Click here to get help for this dashboard
onHoverText="Click here to get help for this dashboard"
/>
<ButtonContainer>
<Tooltip title="Open in Full Screen">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/ListAlertRules/ListAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
eventName: 'Alert: Facing Issues in alert',
buttonText: 'Facing issues with alerts?',
message: listAlertMessage,
onHoverText: 'Click here to get help with alerts',
}}
// onHover: Click here to get help with alerts
/>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/ListOfDashboard/DashboardsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function DashboardsList(): JSX.Element {
eventName: 'Dashboard: Facing Issues in dashboard',
buttonText: 'Facing issues with dashboards?',
message: dashboardListMessage,
// onHover: Click here to get help with dashboards
onHoverText: 'Click here to get help with dashboards',
}}
/>
</TableContainer>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/NewWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
eventName="Dashboard: Facing Issues in dashboard"
buttonText="Need help with this chart?"
message={chartHelpMessage(selectedDashboard, graphType)}
// onHover: Click here to get help in creating chart
onHoverText="Click here to get help in creating chart"
/>
<ButtonContainer>
{isSaveDisabled && (
Expand Down

0 comments on commit 5f75293

Please sign in to comment.