Skip to content

Commit

Permalink
refactor(ui): Remove unnecessary layout directory
Browse files Browse the repository at this point in the history
The layout directory wasn't used for anything, so removing it simplifies
the paths.

Signed-off-by: Mikko Murto <mikko.murto@doubleopen.org>
  • Loading branch information
mmurto committed Nov 21, 2024
1 parent 327e95b commit d0efc3e
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 62 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const Header = () => {
const runMatch = matches.find(
(match) =>
match.routeId ===
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex'
);

return (
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ConfigComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/config/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/config/'
)({
loader: async ({ context, params }) => {
await prefetchUseRepositoriesServiceGetOrtRunByIndex(context.queryClient, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DependenciesComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/dependencies/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/dependencies/'
)({
component: DependenciesComponent,
pendingComponent: LoadingIndicator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const RunComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/'
)({
loader: async ({ context, params }) => {
await prefetchUseRepositoriesServiceGetOrtRunByIndex(context.queryClient, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ const IssuesComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/issues/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/issues/'
)({
validateSearch: paginationSearchParameterSchema
.merge(severitySearchParameterSchema)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const LicenseFindingsComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/license-findings/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/license-findings/'
)({
component: LicenseFindingsComponent,
pendingComponent: LoadingIndicator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const ReportComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/logs/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/logs/'
)({
loader: async ({ context, params }) => {
await prefetchUseRepositoriesServiceGetOrtRunByIndex(context.queryClient, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ const PackagesComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/packages/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/packages/'
)({
validateSearch: paginationSearchParameterSchema,
loader: async ({ context, params }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const ReportComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/reports/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/reports/'
)({
loader: async ({ context, params }) => {
await prefetchUseRepositoriesServiceGetOrtRunByIndex(context.queryClient, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import {
Scale,
ShieldQuestion,
} from 'lucide-react';
import { Suspense } from 'react';

import { useRepositoriesServiceGetOrtRunByIndexKey } from '@/api/queries';
import { RepositoriesService } from '@/api/requests';
import { PageLayout } from '@/components/page-layout';
import { SidebarNavProps } from '@/components/sidebar';

Expand Down Expand Up @@ -119,12 +122,29 @@ const Layout = () => {

return (
<PageLayout sections={sections}>
<Outlet />
<Suspense fallback={<div>Loading...</div>}>
<Outlet />
</Suspense>
</PageLayout>
);
};
export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex'
)({
loader: async ({ context, params }) => {
const run = await context.queryClient.ensureQueryData({
queryKey: [
useRepositoriesServiceGetOrtRunByIndexKey,
params.repoId,
params.runIndex,
],
queryFn: () =>
RepositoriesService.getOrtRunByIndex({
repositoryId: Number.parseInt(params.repoId),
ortRunIndex: Number.parseInt(params.runIndex),
}),
});
context.breadcrumbs.run = run.index.toString();
},
component: Layout,
});
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const RuleViolationsComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/rule-violations/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/rule-violations/'
)({
validateSearch: paginationSearchParameterSchema
.merge(severitySearchParameterSchema)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ const VulnerabilitiesComponent = () => {
};

export const Route = createFileRoute(
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/_layout/runs/$runIndex/vulnerabilities/'
'/_layout/organizations/$orgId/products/$productId/repositories/$repoId/runs/$runIndex/vulnerabilities/'
)({
validateSearch: paginationSearchParameterSchema.merge(
sortingSearchParameterSchema
Expand Down

0 comments on commit d0efc3e

Please sign in to comment.