feat(ui): extracts relationship input for external use (#12339)

This commit is contained in:
Jarrod Flesch
2025-05-15 14:54:26 -04:00
committed by GitHub
parent bd6ee317c1
commit 88769c8244
15 changed files with 1203 additions and 855 deletions

View File

@@ -88,6 +88,7 @@ export interface Config {
'base-list-filters': BaseListFilter;
with300documents: With300Document;
'with-list-drawer': WithListDrawer;
placeholder: Placeholder;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
@@ -115,6 +116,7 @@ export interface Config {
'base-list-filters': BaseListFiltersSelect<false> | BaseListFiltersSelect<true>;
with300documents: With300DocumentsSelect<false> | With300DocumentsSelect<true>;
'with-list-drawer': WithListDrawerSelect<false> | WithListDrawerSelect<true>;
placeholder: PlaceholderSelect<false> | PlaceholderSelect<true>;
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
@@ -484,6 +486,19 @@ export interface WithListDrawer {
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "placeholder".
*/
export interface Placeholder {
id: string;
defaultSelect?: 'option1' | null;
placeholderSelect?: 'option1' | null;
defaultRelationship?: (string | null) | Post;
placeholderRelationship?: (string | null) | Post;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-locked-documents".
@@ -574,6 +589,10 @@ export interface PayloadLockedDocument {
| ({
relationTo: 'with-list-drawer';
value: string | WithListDrawer;
} | null)
| ({
relationTo: 'placeholder';
value: string | Placeholder;
} | null);
globalSlug?: string | null;
user: {
@@ -901,6 +920,18 @@ export interface WithListDrawerSelect<T extends boolean = true> {
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "placeholder_select".
*/
export interface PlaceholderSelect<T extends boolean = true> {
defaultSelect?: T;
placeholderSelect?: T;
defaultRelationship?: T;
placeholderRelationship?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-locked-documents_select".

View File

@@ -185,10 +185,21 @@ export async function login(args: LoginArgs): Promise<void> {
const { customAdminRoutes, customRoutes, data = devUser, page, serverURL } = args
const {
admin: { routes: { createFirstUser, login: incomingLoginRoute } = {} },
admin: {
routes: { createFirstUser, login: incomingLoginRoute, logout: incomingLogoutRoute } = {},
},
routes: { admin: incomingAdminRoute } = {},
} = getRoutes({ customAdminRoutes, customRoutes })
const logoutRoute = formatAdminURL({
serverURL,
adminRoute: incomingAdminRoute,
path: incomingLogoutRoute,
})
await page.goto(logoutRoute)
await wait(500)
const adminRoute = formatAdminURL({ serverURL, adminRoute: incomingAdminRoute, path: '' })
const loginRoute = formatAdminURL({
serverURL,