Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing page titles #8477

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/src/component/admin/auth/AuthSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ADMIN } from '@server/types/permissions';
import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature';
import { useState } from 'react';
import { TabPanel } from 'component/common/TabNav/TabPanel/TabPanel';
import { usePageTitle } from 'hooks/usePageTitle';

export const AuthSettings = () => {
const { authenticationType } = useUiConfig().uiConfig;
Expand Down Expand Up @@ -46,6 +47,7 @@ export const AuthSettings = () => {
}

const [activeTab, setActiveTab] = useState(0);
usePageTitle(`Single sign-on: ${tabs[activeTab].label}`);

return (
<div>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/component/admin/roles/RolesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Add from '@mui/icons-material/Add';
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
import type { IRole } from 'interfaces/role';
import { TabLink } from 'component/common/TabNav/TabLink';
import { usePageTitle } from 'hooks/usePageTitle';

const StyledHeader = styled('div')(() => ({
display: 'flex',
Expand All @@ -31,6 +32,7 @@ const StyledActions = styled('div')({
});

export const RolesPage = () => {
usePageTitle('Roles');
const { pathname } = useLocation();

const { roles, projectRoles, loading } = useRoles();
Expand Down
15 changes: 2 additions & 13 deletions frontend/src/component/featureTypes/FeatureTypesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { sortTypes } from 'utils/sortTypes';
import { PageContent } from 'component/common/PageContent/PageContent';
import useFeatureTypes from 'hooks/api/getters/useFeatureTypes/useFeatureTypes';
import { PageHeader } from 'component/common/PageHeader/PageHeader';
import { Box, Typography } from '@mui/material';
import { Box } from '@mui/material';
import {
Table,
TableBody,
Expand Down Expand Up @@ -150,18 +150,7 @@ export const FeatureTypesList = () => {
return (
<PageContent
isLoading={loading}
header={
<PageHeader>
<Typography
component='h2'
sx={(theme) => ({
fontSize: theme.fontSizes.mainHeader,
})}
>
Feature flag types
</Typography>
</PageHeader>
}
header={<PageHeader title='Feature flag types' />}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header property automatically handles page title and typography

>
<Table {...getTableProps()}>
<SortableTableHeader headerGroups={headerGroups} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const InsightsHeader: VFC<DashboardHeaderProps> = ({ actions }) => {
return (
<>
<PageHeader
title='Insights'
titleElement={
<Typography
variant='h1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import useSplashApi from 'hooks/api/actions/useSplashApi/useSplashApi';
import { useAuthSplash } from 'hooks/api/getters/useAuth/useAuthSplash';
import { useDashboardState } from './useDashboardState';
import { MyFlags } from './MyFlags';
import { usePageTitle } from '../../hooks/usePageTitle';

const WelcomeSection = styled('div')(({ theme }) => ({
display: 'flex',
Expand Down Expand Up @@ -103,9 +104,10 @@ export const PersonalDashboard = () => {
const { trackEvent } = usePlausibleTracker();
const { setSplashSeen } = useSplashApi();
const { splash } = useAuthSplash();

const name = user?.name;

usePageTitle(`Dashboard: ${name}`);

const { personalDashboard, refetch: refetchDashboard } =
usePersonalDashboard();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { Badge } from 'component/common/Badge/Badge';
import { HelpIcon } from 'component/common/HelpIcon/HelpIcon';
import { CustomStrategyInfo } from '../CustomStrategyInfo/CustomStrategyInfo';
import { AddStrategyButton } from './AddStrategyButton/AddStrategyButton';
import { usePageTitle } from 'hooks/usePageTitle';

interface IDialogueMetaData {
show: boolean;
Expand Down Expand Up @@ -100,15 +101,19 @@ const CustomStrategyTitle: FC = () => (
</Box>
);

const PredefinedStrategyTitle = () => (
<Box>
<Subtitle
title='Predefined strategies'
description='Activation strategies let you enable a feature only for a specified audience. Different strategies use different parameters. Predefined strategies are bundled with Unleash.'
link='https://docs.getunleash.io/reference/activation-strategies'
/>
</Box>
);
const PredefinedStrategyTitle = () => {
usePageTitle('Strategy types');

return (
<Box>
<Subtitle
title='Predefined strategies'
description='Activation strategies let you enable a feature only for a specified audience. Different strategies use different parameters. Predefined strategies are bundled with Unleash.'
link='https://docs.getunleash.io/reference/activation-strategies'
/>
</Box>
);
};

const StrategyDeprecationWarning = () => (
<Alert severity='warning' sx={{ mb: 2 }}>
Expand Down
Loading