Switch create/update url segments to new/edit

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-04-04 13:46:02 +04:00
parent 6c1f10e831
commit 0736213ec1
9 changed files with 23 additions and 26 deletions

View File

@@ -160,7 +160,7 @@ export function OrganizationSwitcher({
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuItem asChild> <DropdownMenuItem asChild>
<Link <Link
to="/organizations/create" to="/organizations/new"
className="gap-2 p-2 cursor-pointer" className="gap-2 p-2 cursor-pointer"
> >
<div className="flex size-6 items-center justify-center rounded-md border bg-background"> <div className="flex size-6 items-center justify-center rounded-md border bg-background">

View File

@@ -64,7 +64,7 @@ export default function OrganizationSelectionPage() {
<CardFooter> <CardFooter>
<Button <Button
className="w-full" className="w-full"
onClick={() => navigate("/organizations/create")} onClick={() => navigate("/organizations/new")}
> >
<Plus className="mr-2 h-4 w-4" /> Create Organization <Plus className="mr-2 h-4 w-4" /> Create Organization
</Button> </Button>
@@ -116,7 +116,7 @@ export default function OrganizationSelectionPage() {
<Button <Button
variant="outline" variant="outline"
className="w-full" className="w-full"
onClick={() => navigate("/organizations/create")} onClick={() => navigate("/organizations/new")}
> >
<Plus className="mr-2 h-4 w-4" /> Create Organization <Plus className="mr-2 h-4 w-4" /> Create Organization
</Button> </Button>

View File

@@ -69,12 +69,12 @@ export default function NoOrganizationLayout() {
<Routes> <Routes>
<Route path="*" element={<BreadcrumbHome />}> <Route path="*" element={<BreadcrumbHome />}>
<Route <Route
path="create" path="new"
element={ element={
<> <>
<BreadcrumbSeparator /> <BreadcrumbSeparator />
<BreadcrumbItem> <BreadcrumbItem>
<BreadcrumbPage>Create Organization</BreadcrumbPage> <BreadcrumbPage>New Organization</BreadcrumbPage>
</BreadcrumbItem> </BreadcrumbItem>
</> </>
} }

View File

@@ -463,9 +463,9 @@ export function BreadCrumb() {
</Suspense> </Suspense>
} }
/> />
<Route path="update" element={<Edit />} /> <Route path="edit" element={<Edit />} />
</Route> </Route>
<Route path="create" element={<New />} /> <Route path="new" element={<New />} />
</Route> </Route>
<Route path="people" element={<BreadcrumbPeopleList />}> <Route path="people" element={<BreadcrumbPeopleList />}>
<Route <Route
@@ -476,7 +476,7 @@ export function BreadCrumb() {
</Suspense> </Suspense>
} }
/> />
<Route path="create" element={<New />} /> <Route path="new" element={<New />} />
</Route> </Route>
<Route path="vendors" element={<BreadcrumbVendorList />}> <Route path="vendors" element={<BreadcrumbVendorList />}>
<Route <Route
@@ -497,9 +497,9 @@ export function BreadCrumb() {
</Suspense> </Suspense>
} }
> >
<Route path="update" element={<Edit />} /> <Route path="edit" element={<Edit />} />
</Route> </Route>
<Route path="create" element={<New />} /> <Route path="new" element={<New />} />
</Route> </Route>
<Route <Route
path="settings" path="settings"
@@ -516,7 +516,7 @@ export function BreadCrumb() {
<Route path="*" element={<BreadcrumbHome />}> <Route path="*" element={<BreadcrumbHome />}>
<Route <Route
path="create" path="new"
element={ element={
<> <>
<BreadcrumbSeparator /> <BreadcrumbSeparator />

View File

@@ -34,17 +34,17 @@ export function OrganizationsRoutes() {
<Route path=":organizationId/*" element={<OrganizationLayout />}> <Route path=":organizationId/*" element={<OrganizationLayout />}>
<Route index element={<HomePage />} /> <Route index element={<HomePage />} />
<Route path="people" element={<PeopleListPage />} /> <Route path="people" element={<PeopleListPage />} />
<Route path="people/create" element={<CreatePeoplePage />} /> <Route path="people/new" element={<CreatePeoplePage />} />
<Route path="people/:peopleId" element={<PeoplePage />} /> <Route path="people/:peopleId" element={<PeoplePage />} />
<Route path="vendors" element={<VendorListPage />} /> <Route path="vendors" element={<VendorListPage />} />
<Route path="frameworks" element={<FrameworkListPage />} /> <Route path="frameworks" element={<FrameworkListPage />} />
<Route path="frameworks/create" element={<CreateFrameworkPage />} /> <Route path="frameworks/new" element={<CreateFrameworkPage />} />
<Route path="frameworks/:frameworkId/*"> <Route path="frameworks/:frameworkId/*">
<Route element={<FrameworkLayout />}> <Route element={<FrameworkLayout />}>
<Route index element={<FrameworkPage />} /> <Route index element={<FrameworkPage />} />
<Route path="controls/:controlId" element={<ControlPage />} /> <Route path="controls/:controlId" element={<ControlPage />} />
</Route> </Route>
<Route path="update" element={<UpdateFrameworkPage />} /> <Route path="edit" element={<UpdateFrameworkPage />} />
<Route path="*" element={<NotFoundPage />} /> <Route path="*" element={<NotFoundPage />} />
</Route> </Route>
<Route path="mitigations" element={<MitigationListPage />} /> <Route path="mitigations" element={<MitigationListPage />} />
@@ -56,12 +56,9 @@ export function OrganizationsRoutes() {
/> />
<Route path="vendors/:vendorId" element={<VendorPage />} /> <Route path="vendors/:vendorId" element={<VendorPage />} />
<Route path="policies" element={<PolicyListPage />} /> <Route path="policies" element={<PolicyListPage />} />
<Route path="policies/create" element={<CreatePolicyPage />} /> <Route path="policies/new" element={<CreatePolicyPage />} />
<Route path="policies/:policyId" element={<PolicyPage />} /> <Route path="policies/:policyId" element={<PolicyPage />} />
<Route <Route path="policies/:policyId/edit" element={<UpdatePolicyPage />} />
path="policies/:policyId/update"
element={<UpdatePolicyPage />}
/>
<Route path="risks" element={<RiskListPage />} /> <Route path="risks" element={<RiskListPage />} />
<Route path="risks/new" element={<NewRiskPage />} /> <Route path="risks/new" element={<NewRiskPage />} />
<Route path="risks/:riskId" element={<ShowRiskView />} /> <Route path="risks/:riskId" element={<ShowRiskView />} />
@@ -70,7 +67,7 @@ export function OrganizationsRoutes() {
</Route> </Route>
<Route path="*" element={<NoOrganizationLayout />}> <Route path="*" element={<NoOrganizationLayout />}>
<Route path="create" element={<CreateOrganizationPage />} /> <Route path="new" element={<CreateOrganizationPage />} />
</Route> </Route>
</Routes> </Routes>
); );

View File

@@ -147,7 +147,7 @@ function FrameworkListViewContent({
Import Framework Import Framework
</Button> </Button>
<Button asChild> <Button asChild>
<Link to={`/organizations/${organizationId}/frameworks/create`}> <Link to={`/organizations/${organizationId}/frameworks/new`}>
<Plus className="mr-2 h-4 w-4" /> <Plus className="mr-2 h-4 w-4" />
Create Framework Create Framework
</Link> </Link>

View File

@@ -185,7 +185,7 @@ function PeopleListContent({
style={{ borderRadius: "0.5rem" }} style={{ borderRadius: "0.5rem" }}
className="gap-2" className="gap-2"
> >
<Link to={`/organizations/${organizationId}/people/create`}> <Link to={`/organizations/${organizationId}/people/new`}>
<UserPlus className="h-4 w-4" /> <UserPlus className="h-4 w-4" />
Add a person Add a person
</Link> </Link>

View File

@@ -225,7 +225,7 @@ function PolicyListViewContent({
description="Manage your organization's policies" description="Manage your organization's policies"
actions={ actions={
<Button asChild> <Button asChild>
<Link to={`/organizations/${organizationId}/policies/create`}> <Link to={`/organizations/${organizationId}/policies/new`}>
<Plus className="mr-2 h-4 w-4" /> <Plus className="mr-2 h-4 w-4" />
Create Policy Create Policy
</Link> </Link>
@@ -335,7 +335,7 @@ function PolicyListViewContent({
</Button> </Button>
) : ( ) : (
<Button asChild> <Button asChild>
<Link to={`/organizations/${organizationId}/policies/create`}> <Link to={`/organizations/${organizationId}/policies/new`}>
<Plus className="mr-2 h-4 w-4" /> <Plus className="mr-2 h-4 w-4" />
Create Policy Create Policy
</Link> </Link>

View File

@@ -178,7 +178,7 @@ function PolicyViewContent({
<div className="flex gap-2"> <div className="flex gap-2">
<Button variant="outline" size="sm" asChild> <Button variant="outline" size="sm" asChild>
<Link <Link
to={`/organizations/${organizationId}/policies/${policy.id}/update`} to={`/organizations/${organizationId}/policies/${policy.id}/edit`}
> >
<Edit className="h-4 w-4 mr-2" /> <Edit className="h-4 w-4 mr-2" />
Edit Edit
@@ -357,7 +357,7 @@ function PolicyViewContent({
<Button asChild className="w-full"> <Button asChild className="w-full">
<Link <Link
to={`/organizations/${organizationId}/policies/${policy.id}/update`} to={`/organizations/${organizationId}/policies/${policy.id}/edit`}
> >
<Edit className="mr-2 h-4 w-4" /> <Edit className="mr-2 h-4 w-4" />
Edit Policy Edit Policy