events 3.9.0, website 1.9.0, accounts 1.10.0: the church's details from Accounts everywhere
- Events: the Accounts profile's name, logo, icon, colours and contact details win over Events' own settings while Accounts is connected (pages, emails, WhatsApp, PDFs); Settings shows them read-only with a link to Accounts. The Accounts logo is copied for PDFs (PNG and JPEG). Fixes Events keeping its old church after a demo scenario load. - Website: a background per homepage section in the church's colours; "More info" instead of "Register" for events without registration; the shared colour field. - Accounts: the shared colour field in Church profile. - @crosscode/ui 0.4.0: ColourField and isHexColour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,7 +114,7 @@ describe('showing events from Cross Events (Show events from)', () => {
|
||||
if (c.mode === 'published') {
|
||||
assert.equal(c.events[0]!.title, 'Youth camp');
|
||||
assert.equal(c.events[0]!.url, 'https://events.hope.test/events/6c7d');
|
||||
assert.deepEqual(c.events[0]!.registration, { status: 'open', priceFromCents: 45000 });
|
||||
assert.deepEqual(c.events[0]!.registration, { mode: 'origin', status: 'open', priceFromCents: 45000 });
|
||||
}
|
||||
assert.match(String((await db.productLink.findUnique({ where: { installId: EVENTS_ID } }))!.lastSyncError), /1 event\(s\) skipped/);
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
SECTION_TYPES, SECTION_VARIANTS, TEMPLATE_HEADERS, TEMPLATE_HOME_ORDER, TEMPLATE_STYLE, TEMPLATE_VARIANTS,
|
||||
defaultDesign, defaultVariant, headerIsTransparent, isRecommended, isVariant, switchTemplate,
|
||||
} from '../src/site/variants.js';
|
||||
import { cleanDesign } from '../src/site/snapshot.js';
|
||||
|
||||
describe('section variants (WEBSITE-1.0-PLAN §3, decision 16)', () => {
|
||||
it('has the 26 confirmed variant ids', () => {
|
||||
@@ -101,3 +102,20 @@ describe('switching template', () => {
|
||||
assert.deepEqual(switchTemplate(there, 'heritage').design, defaultDesign('heritage'));
|
||||
});
|
||||
});
|
||||
|
||||
describe("a section's own background", () => {
|
||||
it('stays with its section through a template switch, whether the order moves or not', () => {
|
||||
const start = defaultDesign('heritage');
|
||||
start.home = start.home.map((e) => (e.section === 'events' ? { ...e, background: 'brand' as const } : e));
|
||||
const moved = switchTemplate(start, 'bold').design;
|
||||
assert.equal(moved.home.find((e) => e.section === 'events')?.background, 'brand');
|
||||
assert.deepEqual(moved.home.map((e) => e.section), defaultDesign('bold').home.map((e) => e.section));
|
||||
assert.equal(moved.home.filter((e) => e.background).length, 1);
|
||||
});
|
||||
|
||||
it('is kept by cleanDesign only when it is one of the church-colour choices', () => {
|
||||
const d = cleanDesign({ template: 'clean', variants: {}, home: [{ section: 'welcome', hidden: false, background: 'tint' }, { section: 'events', hidden: false, background: 'hot-pink' }], style: {} });
|
||||
assert.equal(d.home.find((e) => e.section === 'welcome')?.background, 'tint');
|
||||
assert.equal('background' in d.home.find((e) => e.section === 'events')!, false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user