Skip to content

Commit

Permalink
fix: missing page titles (#8477)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Oct 18, 2024
1 parent a9f9be1 commit 9b3529d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
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' />}
>
<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 @@ -397,9 +397,10 @@ export const StrategiesList = () => {
<PageContent
isLoading={loading}
header={
<PageHeader>
<PredefinedStrategyTitle />
</PageHeader>
<PageHeader
titleElement={<PredefinedStrategyTitle />}
title='Strategy types'
/>
}
>
<Box>
Expand Down

0 comments on commit 9b3529d

Please sign in to comment.