feat(website): church details, settings, audit log, search engine data, safer editing
Church details saved through Accounts' church.update (live at once). Settings: Search Console and Bing codes, Coming soon line, menu order. Audit log and recent edits. A made share image, Event / VideoObject / PodcastEpisode / BreadcrumbList structured data, permanent redirects from old page addresses. Saves refused when someone else saved in between; Ministry leaders' events; templates previewed with the church's own content before choosing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ export type FakeAccounts = {
|
||||
next: Partial<IdentityClaims> & { sub: string };
|
||||
started: { returnTo: string; requireTwoFactor: boolean }[];
|
||||
/** Requests to Accounts (people.ensure, …). */
|
||||
requests: { type: string; email?: string; actor?: string | null }[];
|
||||
requests: { type: string; email?: string; actor?: string | null; church?: Record<string, unknown> }[];
|
||||
};
|
||||
|
||||
export function claims(over: Partial<IdentityClaims> & { sub: string }): IdentityClaims {
|
||||
@@ -66,8 +66,13 @@ function fakeAuthClient(fake: FakeAccounts): AuthClientModule {
|
||||
}
|
||||
},
|
||||
/** people.ensure: the same sub for the same email; "new@…" is a new account. */
|
||||
request: async (input: { type: string; email?: string; actor?: string | null }) => {
|
||||
request: async (input: { type: string; email?: string; actor?: string | null; church?: Record<string, unknown>; ifUpdatedAt?: string }) => {
|
||||
fake.requests.push(input);
|
||||
if (input.type === 'church.update') {
|
||||
// An old ifUpdatedAt: someone saved in between.
|
||||
if (input.ifUpdatedAt === '2000-01-01T00:00:00.000Z') throw Object.assign(new Error('changed'), { code: 'PROFILE_CHANGED', status: 409 });
|
||||
return { schema: 'crosscode.identity-request/1', church: { name: 'Hope', ...input.church } };
|
||||
}
|
||||
if (input.type !== 'people.ensure') throw new Error(`not faked: ${input.type}`);
|
||||
const hex = Buffer.from(input.email ?? '').toString('hex').padEnd(12, '0').slice(0, 12);
|
||||
return { schema: 'crosscode.identity-request/1', sub: `22222222-2222-4222-8222-${hex}`, created: input.email?.startsWith('new@') ?? false, emailSent: true };
|
||||
|
||||
Reference in New Issue
Block a user