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

[front] add missing breadcrumbs in customization+ fix(#8274) #8420

Merged
merged 2 commits into from
Sep 19, 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
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 }]}
/>
CelineSebe marked this conversation as resolved.
Show resolved Hide resolved
<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'),
CelineSebe marked this conversation as resolved.
Show resolved Hide resolved
link: '/dashboard/settings/customization/entity_types',
}]}
/>
<SubType data={data.subType}/>
</>
) : <ErrorNotFound/>
}
</Suspense>
);
Expand Down