Skip to content

Commit

Permalink
v3 - remove redirect support (#773)
Browse files Browse the repository at this point in the history
* feat: remove redirect middleware

* refactor: remove redirect utils

* feat: remove redirects/broken links schema
  • Loading branch information
mathiazom authored Oct 14, 2024
1 parent 9b4b6a0 commit 0b17c16
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 212 deletions.
5 changes: 0 additions & 5 deletions src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { NextRequest } from "next/server";

import { languageMiddleware } from "./middlewares/languageMiddleware";
import { redirectMiddleware } from "./middlewares/redirectMiddleware";

export async function middleware(request: NextRequest) {
const response = await redirectMiddleware(request);
if (response !== undefined) {
return response;
}
return languageMiddleware(request);
}

Expand Down
46 changes: 0 additions & 46 deletions src/middlewares/redirectMiddleware.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/utils/http.ts

This file was deleted.

6 changes: 0 additions & 6 deletions studio/deskStructure.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
CaseIcon,
CogIcon,
DoubleChevronRightIcon,
EarthGlobeIcon,
HeartIcon,
ImagesIcon,
Expand All @@ -24,7 +23,6 @@ import { compensationsId } from "./schemas/documents/compensations";
import { languageSettingsID } from "./schemas/documents/languageSettings";
import { pageBuilderID } from "./schemas/documents/pageBuilder";
import { brandAssetsID } from "./schemas/documents/siteSettings/brandAssets";
import { brokenLinkID } from "./schemas/documents/siteSettings/brokenLink";
import { localeID } from "./schemas/documents/siteSettings/locale";
import { soMeLinksID } from "./schemas/documents/siteSettings/socialMediaProfiles";
import { customerCasesPageID } from "./schemas/documents/specialPages/customerCasesPage";
Expand Down Expand Up @@ -122,10 +120,6 @@ const siteSettingSection = (S: StructureBuilder) =>
.documentId(defaultSeoID)
.title("Default SEO"),
),
S.listItem()
.title("Broken Links")
.icon(DoubleChevronRightIcon)
.child(S.documentTypeList(brokenLinkID).title("Redirects")),
]),
);

Expand Down
3 changes: 0 additions & 3 deletions studio/lib/interfaces/redirect.ts

This file was deleted.

10 changes: 0 additions & 10 deletions studio/lib/queries/redirects.ts

This file was deleted.

2 changes: 0 additions & 2 deletions studio/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import compensations from "./schemas/documents/compensations";
import languageSettings from "./schemas/documents/languageSettings";
import pageBuilder from "./schemas/documents/pageBuilder";
import brandAssets from "./schemas/documents/siteSettings/brandAssets";
import brokenLink from "./schemas/documents/siteSettings/brokenLink";
import locale from "./schemas/documents/siteSettings/locale";
import navigationManager from "./schemas/documents/siteSettings/navigationManager";
import socialMediaLinks from "./schemas/documents/siteSettings/socialMediaProfiles";
Expand All @@ -34,7 +33,6 @@ export const schema: { types: SchemaTypeDefinition[] } = {
legalDocument,
compensations,
customerCasesPage,
brokenLink,
benefitsByLocation,
companyLocation,
defaultSeo,
Expand Down
135 changes: 0 additions & 135 deletions studio/schemas/documents/siteSettings/brokenLink.ts

This file was deleted.

3 changes: 1 addition & 2 deletions studio/schemas/schemaTypes/slug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ function createSlugField(source: string) {
description:
"Enter a unique URL path for the page. This path will be used in the website's address bar. " +
"A URL path, also known as a slug, is a URL-friendly version of the page title, used to create " +
"a human-readable and search engine optimized URL for the content. " +
"Note that the slug can not be changed after publication, but alternative slugs can be defined via Redirects.",
"a human-readable and search engine optimized URL for the content. ",
options: {
source,
maxLength: SLUG_MAX_LENGTH,
Expand Down

0 comments on commit 0b17c16

Please sign in to comment.