diff --git a/frontend/src/component/executiveDashboard/DashboardHeader/DashboardHeader.tsx b/frontend/src/component/executiveDashboard/DashboardHeader/DashboardHeader.tsx new file mode 100644 index 0000000000..ed8336664b --- /dev/null +++ b/frontend/src/component/executiveDashboard/DashboardHeader/DashboardHeader.tsx @@ -0,0 +1,52 @@ +import { VFC } from 'react'; +import { useUiFlag } from 'hooks/useUiFlag'; +import { useFeedback } from 'component/feedbackNew/useFeedback'; +import { ReviewsOutlined } from '@mui/icons-material'; +import { Badge, Button, Typography } from '@mui/material'; +import { PageHeader } from 'component/common/PageHeader/PageHeader'; + +export const DashboardHeader: VFC = () => { + const showInactiveUsers = useUiFlag('showInactiveUsers'); + + const { openFeedback } = useFeedback( + 'insights', + 'automatic', + showInactiveUsers ? 'withInactiveUsers' : 'withoutInactiveUsers', + ); + + const createFeedbackContext = () => { + openFeedback({ + title: 'How easy was it to use insights?', + positiveLabel: 'What do you like most about insights?', + areasForImprovementsLabel: 'What should be improved in insights?', + }); + }; + + return ( + ({ + display: 'flex', + alignItems: 'center', + gap: theme.spacing(1), + })} + > + Insights Beta + + } + actions={ + + } + /> + ); +}; diff --git a/frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx b/frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx index c946a45c93..51dcdf63ff 100644 --- a/frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx +++ b/frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx @@ -25,6 +25,7 @@ import { } from 'openapi'; import { HealthStats } from './HealthStats/HealthStats'; import { Badge } from 'component/common/Badge/Badge'; +import { DashboardHeader } from './DashboardHeader/DashboardHeader'; const StyledGrid = styled(Box)(({ theme }) => ({ display: 'grid', @@ -127,22 +128,7 @@ export const ExecutiveDashboard: VFC = () => { return ( <> ({ paddingBottom: theme.spacing(4) })}> - ({ - display: 'flex', - alignItems: 'center', - gap: theme.spacing(1), - })} - > - Insights{' '} - Beta - - } - /> + diff --git a/frontend/src/hooks/useSubmittedFeedback.ts b/frontend/src/hooks/useSubmittedFeedback.ts index 8f562444f0..d1a7268f1e 100644 --- a/frontend/src/hooks/useSubmittedFeedback.ts +++ b/frontend/src/hooks/useSubmittedFeedback.ts @@ -1,6 +1,6 @@ import { createLocalStorage } from '../utils/createLocalStorage'; -export type IFeedbackCategory = 'search' | 'newStrategyForm'; +export type IFeedbackCategory = 'search' | 'newStrategyForm' | 'insights'; export const useUserSubmittedFeedback = (category: IFeedbackCategory) => { const key = `unleash-userSubmittedFeedback:${category}`;