Revert "Merge pull request 'Complete Housekeeping migration and /ase cutover' (#52) from codex/housekeeping-complete into main"
This reverts commit488b6e57c4, reversing changes made tob506b4499a.
This commit is contained in:
1 parent
488b6e57c4
commit
b1ddda66ff
802 files changed
+61370
-76659
No files matched your search
@@ -1,205 +0,0 @@
|
||||
import { PERMS } from "@/lib/permission-slugs";
|
||||
import {
|
||||
anyCapability,
|
||||
type CanonicalHousekeepingHref,
|
||||
type HousekeepingRouteDefinition,
|
||||
} from "../../foundation/contracts";
|
||||
|
||||
export const CONTENT_ROUTE_GROUPS = [
|
||||
"editorial",
|
||||
"media",
|
||||
"engagement",
|
||||
"help",
|
||||
"brand",
|
||||
"localization",
|
||||
] as const;
|
||||
|
||||
export type ContentRouteGroup = (typeof CONTENT_ROUTE_GROUPS)[number];
|
||||
|
||||
export const CONTENT_ROUTE_IDS = [
|
||||
"content.editorial.articles",
|
||||
"content.editorial.article-create",
|
||||
"content.editorial.article-detail",
|
||||
"content.media.photos",
|
||||
"content.media.library",
|
||||
"content.media.banners",
|
||||
"content.media.ads",
|
||||
"content.media.ad-create",
|
||||
"content.media.ad-detail",
|
||||
"content.engagement.events",
|
||||
"content.engagement.event-create",
|
||||
"content.engagement.event-types",
|
||||
"content.engagement.event-detail",
|
||||
"content.engagement.polls",
|
||||
"content.engagement.poll-create",
|
||||
"content.engagement.poll-detail",
|
||||
"content.help.questions",
|
||||
"content.help.question-create",
|
||||
"content.help.question-detail",
|
||||
"content.editorial.tags",
|
||||
"content.engagement.prefixes",
|
||||
"content.editorial.writeable-boxes",
|
||||
"content.help.email-templates",
|
||||
"content.brand.theme",
|
||||
"content.brand.favicon",
|
||||
"content.localization.overview",
|
||||
"content.localization.client",
|
||||
"content.localization.cms",
|
||||
"content.localization.emulator",
|
||||
] as const;
|
||||
|
||||
export type ContentRouteId = (typeof CONTENT_ROUTE_IDS)[number];
|
||||
|
||||
function contentRoute(
|
||||
id: ContentRouteId,
|
||||
href: CanonicalHousekeepingHref,
|
||||
capabilities: readonly string[],
|
||||
): HousekeepingRouteDefinition {
|
||||
return {
|
||||
id,
|
||||
labelKey: `pages.housekeeping.routes.${id}`,
|
||||
href,
|
||||
capability: anyCapability(...capabilities),
|
||||
};
|
||||
}
|
||||
|
||||
export const CONTENT_ROUTES = [
|
||||
contentRoute(
|
||||
"content.editorial.articles",
|
||||
"/ase/content/editorial/articles",
|
||||
[PERMS.NEWS_VIEW],
|
||||
),
|
||||
contentRoute(
|
||||
"content.editorial.article-create",
|
||||
"/ase/content/editorial/articles/new",
|
||||
[PERMS.NEWS_EDIT],
|
||||
),
|
||||
contentRoute(
|
||||
"content.editorial.article-detail",
|
||||
"/ase/content/editorial/articles/:id",
|
||||
[PERMS.NEWS_VIEW],
|
||||
),
|
||||
contentRoute("content.media.photos", "/ase/content/media/photos", [
|
||||
PERMS.PAGES_VIEW,
|
||||
]),
|
||||
contentRoute("content.media.library", "/ase/content/media/library", [
|
||||
PERMS.PAGES_VIEW,
|
||||
]),
|
||||
contentRoute("content.media.banners", "/ase/content/media/banners", [
|
||||
PERMS.BANNERS_VIEW,
|
||||
]),
|
||||
contentRoute("content.media.ads", "/ase/content/media/ads", [
|
||||
PERMS.PAGES_VIEW,
|
||||
]),
|
||||
contentRoute("content.media.ad-create", "/ase/content/media/ads/new", [
|
||||
PERMS.PAGES_EDIT,
|
||||
]),
|
||||
contentRoute("content.media.ad-detail", "/ase/content/media/ads/:id", [
|
||||
PERMS.PAGES_VIEW,
|
||||
]),
|
||||
contentRoute("content.engagement.events", "/ase/content/engagement/events", [
|
||||
PERMS.EVENTS_VIEW,
|
||||
]),
|
||||
contentRoute(
|
||||
"content.engagement.event-create",
|
||||
"/ase/content/engagement/events/create",
|
||||
[PERMS.EVENTS_EDIT],
|
||||
),
|
||||
contentRoute(
|
||||
"content.engagement.event-types",
|
||||
"/ase/content/engagement/events/types",
|
||||
[PERMS.EVENTS_EDIT],
|
||||
),
|
||||
contentRoute(
|
||||
"content.engagement.event-detail",
|
||||
"/ase/content/engagement/events/:id",
|
||||
[PERMS.EVENTS_EDIT],
|
||||
),
|
||||
contentRoute("content.engagement.polls", "/ase/content/engagement/polls", [
|
||||
PERMS.POLLS_VIEW,
|
||||
]),
|
||||
contentRoute(
|
||||
"content.engagement.poll-create",
|
||||
"/ase/content/engagement/polls/create",
|
||||
[PERMS.POLLS_EDIT],
|
||||
),
|
||||
contentRoute(
|
||||
"content.engagement.poll-detail",
|
||||
"/ase/content/engagement/polls/:id",
|
||||
[PERMS.POLLS_EDIT],
|
||||
),
|
||||
contentRoute("content.help.questions", "/ase/content/help/questions", [
|
||||
PERMS.PAGES_VIEW,
|
||||
]),
|
||||
contentRoute(
|
||||
"content.help.question-create",
|
||||
"/ase/content/help/questions/new",
|
||||
[PERMS.PAGES_EDIT],
|
||||
),
|
||||
contentRoute(
|
||||
"content.help.question-detail",
|
||||
"/ase/content/help/questions/:id",
|
||||
[PERMS.PAGES_VIEW],
|
||||
),
|
||||
contentRoute("content.editorial.tags", "/ase/content/editorial/tags", [
|
||||
PERMS.PAGES_VIEW,
|
||||
]),
|
||||
contentRoute(
|
||||
"content.engagement.prefixes",
|
||||
"/ase/content/engagement/prefixes",
|
||||
[PERMS.PREFIXES_VIEW],
|
||||
),
|
||||
contentRoute(
|
||||
"content.editorial.writeable-boxes",
|
||||
"/ase/content/editorial/writeable-boxes",
|
||||
[PERMS.PAGES_VIEW],
|
||||
),
|
||||
contentRoute(
|
||||
"content.help.email-templates",
|
||||
"/ase/content/help/email-templates",
|
||||
[PERMS.PAGES_VIEW],
|
||||
),
|
||||
contentRoute("content.brand.theme", "/ase/content/brand/theme", [
|
||||
PERMS.SETTINGS_VIEW,
|
||||
]),
|
||||
contentRoute("content.brand.favicon", "/ase/content/brand/favicon", [
|
||||
PERMS.SETTINGS_VIEW,
|
||||
]),
|
||||
contentRoute("content.localization.overview", "/ase/content/localization", [
|
||||
PERMS.SETTINGS_VIEW,
|
||||
]),
|
||||
contentRoute(
|
||||
"content.localization.client",
|
||||
"/ase/content/localization/client",
|
||||
[PERMS.SETTINGS_VIEW],
|
||||
),
|
||||
contentRoute("content.localization.cms", "/ase/content/localization/cms", [
|
||||
PERMS.SETTINGS_VIEW,
|
||||
]),
|
||||
contentRoute(
|
||||
"content.localization.emulator",
|
||||
"/ase/content/localization/emulator",
|
||||
[PERMS.SETTINGS_VIEW],
|
||||
),
|
||||
] as const satisfies readonly HousekeepingRouteDefinition[];
|
||||
|
||||
const routeGroups = new Map<ContentRouteId, ContentRouteGroup>(
|
||||
CONTENT_ROUTE_IDS.map((routeId) => [
|
||||
routeId,
|
||||
routeId.split(".")[1] as ContentRouteGroup,
|
||||
]),
|
||||
);
|
||||
|
||||
export function contentRouteGroup(routeId: ContentRouteId): ContentRouteGroup {
|
||||
const group = routeGroups.get(routeId);
|
||||
if (!group) throw new Error(`unknown Content route: ${routeId}`);
|
||||
return group;
|
||||
}
|
||||
|
||||
export function contentRouteById(
|
||||
routeId: ContentRouteId,
|
||||
): (typeof CONTENT_ROUTES)[number] {
|
||||
const route = CONTENT_ROUTES.find((candidate) => candidate.id === routeId);
|
||||
if (!route) throw new Error(`unknown Content route: ${routeId}`);
|
||||
return route;
|
||||
}
|
||||
Reference in new issue
Block a user