Accounts sign-in looks like the church's site; Events sends its logo and colours
- @crosscode/ui: Shell with the church's colour wash, logo (or its initial) and name, footer; Card edged in the church's colour; Heading with an icon tile. Icons on every sign-in step. - contracts 1.9.0: churchLookSchema (logo, accent colour) in import.begin; church.branding request. Accounts fills (move) or replaces (button) the church profile's name, logo and colours. - Events 3.1.0: src/accounts/look.ts (logo as a full address), sent with a move; Settings -> Sign-in "Use this site's logo and colours". Tests: Accounts 55, contracts 218, Events 774, test:accounts 16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,29 @@
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"accentColour": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^#[0-9a-fA-F]{6}$"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"logoUrl": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"maxLength": 2048,
|
||||
"format": "uri"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1096,6 +1119,102 @@
|
||||
"actor",
|
||||
"type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"const": "crosscode.identity-request/1"
|
||||
},
|
||||
"requestId": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
||||
},
|
||||
"actor": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "church.branding"
|
||||
},
|
||||
"church": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 200
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"primaryColour": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^#[0-9a-fA-F]{6}$"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"accentColour": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^#[0-9a-fA-F]{6}$"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"logoUrl": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"maxLength": 2048,
|
||||
"format": "uri"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"primaryColour"
|
||||
]
|
||||
},
|
||||
"overwrite": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"requestId",
|
||||
"actor",
|
||||
"type",
|
||||
"church",
|
||||
"overwrite"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -43,6 +43,18 @@ const base = z.object({
|
||||
|
||||
// ─── import.* ────────────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* The church's look as a product has it, for Accounts' sign-in pages: its name, logo (an https
|
||||
* address) and colours. 1.9.0 adds the logo and accent colour (optional, so 1.8.0 senders still fit).
|
||||
*/
|
||||
export const churchLookSchema = z.object({
|
||||
name: z.string().trim().min(1).max(200).nullable(),
|
||||
primaryColour: z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable(),
|
||||
accentColour: z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),
|
||||
logoUrl: z.url({ protocol: /^https?$/ }).max(2048).nullable().optional(),
|
||||
});
|
||||
export type ChurchLook = z.infer<typeof churchLookSchema>;
|
||||
|
||||
/** A privacy notice version, numbers kept (EVENTS-3.0-PLAN decision 5). */
|
||||
export const importNoticeSchema = z.object({
|
||||
version: z.int().positive(),
|
||||
@@ -90,7 +102,7 @@ export const importBeginSchema = base.extend({
|
||||
/** The product's privacy notice versions. Taken only when Accounts has published none of its own. */
|
||||
notices: z.array(importNoticeSchema).max(100),
|
||||
/** Fills the church profile's empty fields, so the sign-in page looks like the church at once. */
|
||||
church: z.object({ name: z.string().trim().min(1).max(200).nullable(), primaryColour: z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable() }),
|
||||
church: churchLookSchema,
|
||||
});
|
||||
|
||||
export const importBatchSchema = base.extend({
|
||||
@@ -179,10 +191,16 @@ export const messagingTestSchema = base.extend({
|
||||
/** Tests the settings given as messaging.test does, and saves each part only if its test worked. */
|
||||
export const messagingSetSchema = messagingTestSchema.extend({ type: z.literal("messaging.set") });
|
||||
|
||||
/**
|
||||
* 1.9.0: use the product's look (name, logo, colours) on Accounts' pages. `overwrite: false` only
|
||||
* fills what Accounts doesn't have yet; `true` replaces it (an admin pressing the button).
|
||||
*/
|
||||
export const churchBrandingSchema = base.extend({ type: z.literal("church.branding"), church: churchLookSchema, overwrite: z.boolean() });
|
||||
|
||||
export const identityRequestSchema = z.discriminatedUnion("type", [
|
||||
importBeginSchema, importBatchSchema, importFinishSchema, importAbortSchema,
|
||||
peopleEnsureSchema, peopleUpdateSchema, peopleResetTwoFactorSchema, peopleUnlockSchema, peopleSetActiveSchema, peopleNewsOffSchema,
|
||||
messagingStatusSchema, messagingTestSchema, messagingSetSchema,
|
||||
messagingStatusSchema, messagingTestSchema, messagingSetSchema, churchBrandingSchema,
|
||||
]);
|
||||
export type IdentityRequest = z.infer<typeof identityRequestSchema>;
|
||||
export type IdentityRequestType = IdentityRequest["type"];
|
||||
|
||||
Reference in New Issue
Block a user