Skip to content

Commit

Permalink
[front]add missing breadcrumbs + fix(#8274)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelineSebe committed Sep 19, 2024
1 parent d6c9835 commit 5a1b9eb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import CustomizationMenu from '../CustomizationMenu';
import { DecayRule_decayRule$key } from './__generated__/DecayRule_decayRule.graphql';
import useQueryLoading from '../../../../utils/hooks/useQueryLoading';
import Loader, { LoaderVariant } from '../../../../components/Loader';
import Breadcrumbs from '../../../../components/Breadcrumbs';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
Expand Down Expand Up @@ -108,6 +109,11 @@ const DecayRuleComponent = ({ queryRef }: DecayRuleComponentProps) => {

return (
<div className={classes.container}>
<Breadcrumbs variant="list" elements={[{ label: t_i18n('Settings') }, { label: t_i18n('Customization') }, {
label: t_i18n('Decay rules'),
link: '/dashboard/settings/customization/decay',
}, { label: decayRule.name, current: true }]}
/>
<CustomizationMenu />
{!decayRule.built_in && (
<DecayRuleEdition decayRule={decayRule} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const RootGroupComponent: FunctionComponent<RootGroupComponentProps> = ({ queryR
return (
<Security needs={[SETTINGS_SETACCESSES]}>
{group ? (
<div style={{ paddingRight: 200 }}>
<>
<AccessesMenu/>
<Breadcrumbs variant="object" elements={[
{ label: t_i18n('Settings') },
Expand All @@ -80,7 +80,7 @@ const RootGroupComponent: FunctionComponent<RootGroupComponentProps> = ({ queryR
}
/>
</Routes>
</div>
</>
) : (
<ErrorNotFound />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const RootSettingsOrganizationComponent: FunctionComponent<RootSettingsOrganizat
return (
<Security needs={[SETTINGS_SETACCESSES, VIRTUAL_ORGANIZATION_ADMIN]}>
{organization ? (
<div style={{ paddingRight: 200 }}>
<>
<AccessesMenu/>
<Breadcrumbs variant="object" elements={[
{ label: t_i18n('Settings') },
Expand All @@ -75,7 +75,7 @@ const RootSettingsOrganizationComponent: FunctionComponent<RootSettingsOrganizat
}
/>
</Routes>
</div>
</>
) : (
<ErrorNotFound />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RootRoleComponent: FunctionComponent<RootRoleComponentProps> = ({ queryRef
return (
<Security needs={[SETTINGS_SETACCESSES]}>
{role ? (
<div style={{ paddingRight: 200 }}>
<>
<AccessesMenu/>
<Breadcrumbs variant="object" elements={[
{ label: t_i18n('Settings') },
Expand All @@ -73,7 +73,7 @@ const RootRoleComponent: FunctionComponent<RootRoleComponentProps> = ({ queryRef
)
}
</>
</div>
</>
) : (
<ErrorNotFound />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { RootSubTypeQuery } from '@components/settings/sub_types/__generated__/R
import Loader from '../../../../components/Loader';
import ErrorNotFound from '../../../../components/ErrorNotFound';
import SubType from './SubType';
import Breadcrumbs from '../../../../components/Breadcrumbs';
import { useFormatter } from '../../../../components/i18n';

export const subTypeQuery = graphql`
query RootSubTypeQuery($id: String!) {
Expand All @@ -16,13 +18,22 @@ export const subTypeQuery = graphql`

const RootSubType = () => {
const { subTypeId } = useParams() as { subTypeId: string };

const { t_i18n } = useFormatter();
const data = useLazyLoadQuery<RootSubTypeQuery>(subTypeQuery, { id: subTypeId });

return (
<Suspense fallback={<Loader />}>
{
data.subType ? <SubType data={data.subType} /> : <ErrorNotFound />
data.subType ? (
<>
<Breadcrumbs variant="list" elements={[{ label: t_i18n('Settings') }, { label: t_i18n('Customization') }, {
label: t_i18n('Entity types'),
link: '/dashboard/settings/customization/entity_types',
}]}
/>
<SubType data={data.subType}/>
</>
) : <ErrorNotFound/>
}
</Suspense>
);
Expand Down

0 comments on commit 5a1b9eb

Please sign in to comment.