Skip to content

Commit

Permalink
fix: billing link
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Aug 17, 2023
1 parent 85139ac commit 1be0351
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/component/admin/adminRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const adminRoutes: INavigationMenuItem[] = [
{
path: '/admin/admin-invoices',
title: 'Billing & invoices',
menu: { adminSettings: true, mode: ['pro'], billing: true },
menu: { adminSettings: true, billing: true },
group: 'instance',
},
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/component/admin/invoice/InvoiceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const InvoiceList = () => {
</div>
</PageContent>
}
elseShow={<div>{isLoaded && 'No invoices to show.'}</div>}
elseShow={<PageContent>{isLoaded && 'No invoices to show.'}</PageContent>}
/>
);
};
Expand Down
1 change: 0 additions & 1 deletion frontend/src/component/admin/menu/AdminTabsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const StyledBadgeContainer = styled('div')(({ theme }) => ({
export const AdminTabsMenu: VFC = () => {
const { uiConfig, isPro, isOss } = useUiConfig();
const { pathname } = useLocation();
const navigate = useNavigate();

const activeTab = pathname.split('/')[2];

Expand Down
13 changes: 12 additions & 1 deletion frontend/src/component/admin/useAdminRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@ export const useAdminRoutes = () => {
const showEnterpriseOptionsInPro = Boolean(
uiConfig?.flags?.frontendNavigationUpdate
);
const routes = [...adminRoutes];

return adminRoutes
if (uiConfig.flags.UNLEASH_CLOUD) {
const adminBillingMenuItem = adminRoutes.findIndex(
route => route.title === 'Billing & invoices'
);
routes[adminBillingMenuItem] = {
...routes[adminBillingMenuItem],
path: '/admin/billing',
};
}

return routes
.filter(filterByConfig(uiConfig))
.filter(route =>
filterAdminRoutes(
Expand Down

0 comments on commit 1be0351

Please sign in to comment.