(
- {t("redirectSource")}
- ),
- cell: ({ row }) => {
- const redirect = row.original;
- // A domain-attached redirect may target a specific host
- // under the base domain, e.g. old.example.com.
- const domainHost = redirect.baseDomain
- ? [redirect.subdomain, redirect.baseDomain]
- .filter(Boolean)
- .join(".")
- : null;
- const host = redirect.resourceFullDomain ?? domainHost;
-
- return (
-
-
- {matchTypeLabel(redirect.pathMatchType)}
-
-
- {host ?? ""}
- {redirect.matchPath}
-
-
- );
- }
+ id: "niceId",
+ accessorKey: "niceId",
+ friendlyName: t("identifier"),
+ header: () => {t("identifier")},
+ cell: ({ row }) => (
+ {row.original.niceId}
+ )
},
{
id: "attachedTo",
@@ -234,28 +219,94 @@ export default function RedirectsTable({
if (redirect.resourceId && redirect.resourceNiceId) {
return (
-
- {redirect.resourceName}
-
+
+
+ {redirect.resourceName}
+
+
+
);
}
- if (redirect.baseDomain) {
+ console.log({
+ redirect
+ });
+
+ if (redirect.domainId) {
return (
-
- {[redirect.subdomain, redirect.baseDomain]
- .filter(Boolean)
- .join(".")}
-
+
);
}
return -;
}
},
+
+ {
+ id: "sourceDomain",
+ friendlyName: t("redirectSourceDomain"),
+ header: () => (
+ {t("redirectSourceDomain")}
+ ),
+ cell: ({ row }) => {
+ const redirect = row.original;
+ // A domain-attached redirect may target a specific host
+ // under the base domain, e.g. old.example.com.
+ const domainHost = redirect.baseDomain
+ ? [redirect.subdomain, redirect.baseDomain]
+ .filter(Boolean)
+ .join(".")
+ : null;
+ const host = redirect.resourceFullDomain ?? domainHost;
+
+ return host ? (
+ {host}
+ ) : (
+ -
+ );
+ }
+ },
+ {
+ id: "matchPath",
+ accessorKey: "matchPath",
+ friendlyName: t("matchPath"),
+ header: () => {t("matchPath")},
+ cell: ({ row }) => {
+ const redirect = row.original;
+ return (
+
+
+ {matchTypeLabel(redirect.pathMatchType)}
+
+
+ {redirect.matchPath}
+
+
+ );
+ }
+ },
+
{
accessorKey: "destinationDomain",
friendlyName: t("redirectDestinationDomain"),
@@ -417,7 +468,7 @@ export default function RedirectsTable({
rowCount={rowCount}
columnVisibility={{
attachedTo: false,
- rewritePath: false
+ niceId: false
}}
enableColumnVisibility
stickyLeftColumn="name"