feat: map shapes, image persistence, grab tool, layer rename/delete, i18n, page metadata

This commit is contained in:
AlacrisDevs
2026-02-08 23:11:09 +02:00
parent 75a2aefadb
commit f2384bceb8
125 changed files with 22605 additions and 3902 deletions

View File

@@ -27,7 +27,7 @@ function loadEnv() {
const value = trimmed.slice(eqIdx + 1);
if (!process.env[key]) process.env[key] = value;
}
} catch { /* .env not found rely on process.env */ }
} catch { /* .env not found - rely on process.env */ }
}
loadEnv();
@@ -39,12 +39,14 @@ const DOC_PREFIXES = ['Test Folder', 'Test Doc', 'Test Board', 'Nav Folder', 'Re
const BOARD_PREFIXES = ['PW Board', 'PW Card Board', 'PW Detail Board', 'Board A', 'Board B'];
const ROLE_PREFIX = 'Tester';
const TAG_PREFIX = 'PW Tag';
const EVENT_PREFIXES = ['PW Event', 'PW Detail', 'PW Delete'];
const EVENT_PREFIXES = ['PW Event', 'PW Detail', 'PW Delete', 'PW Test Event', 'PW Finance'];
const SPONSOR_PREFIXES = ['PW Sponsor'];
const CONTACT_PREFIXES = ['PW Contact', 'PW Vendor'];
const INVITE_EMAIL_PATTERN = 'playwright-test-%@example.com';
export default async function globalTeardown() {
if (!SUPABASE_KEY) {
console.log('[cleanup] No SUPABASE_ANON_KEY skipping cleanup');
console.log('[cleanup] No SUPABASE_ANON_KEY - skipping cleanup');
return;
}
@@ -56,7 +58,7 @@ export default async function globalTeardown() {
});
if (authError) {
console.log('[cleanup] Auth failed skipping cleanup:', authError.message);
console.log('[cleanup] Auth failed - skipping cleanup:', authError.message);
return;
}
@@ -68,7 +70,7 @@ export default async function globalTeardown() {
.single();
if (!org) {
console.log('[cleanup] root-test org not found skipping cleanup');
console.log('[cleanup] root-test org not found - skipping cleanup');
return;
}
@@ -183,6 +185,51 @@ export default async function globalTeardown() {
}
}
// 7. Delete test sponsors (via name prefix)
for (const prefix of SPONSOR_PREFIXES) {
const { data: sponsors } = await (supabase as any)
.from('sponsors')
.select('id')
.ilike('name', `${prefix}%`);
if (sponsors && sponsors.length > 0) {
const ids = sponsors.map((s: any) => s.id);
const { error } = await (supabase as any)
.from('sponsors')
.delete()
.in('id', ids);
if (!error) {
totalDeleted += sponsors.length;
} else {
console.log(`[cleanup] Failed to delete sponsors with prefix "${prefix}":`, error.message);
}
}
}
// 8. Delete test org contacts (via name prefix)
for (const prefix of CONTACT_PREFIXES) {
const { data: contacts } = await (supabase as any)
.from('org_contacts')
.select('id')
.eq('org_id', orgId)
.ilike('name', `${prefix}%`);
if (contacts && contacts.length > 0) {
const ids = contacts.map((c: any) => c.id);
const { error } = await (supabase as any)
.from('org_contacts')
.delete()
.in('id', ids);
if (!error) {
totalDeleted += contacts.length;
} else {
console.log(`[cleanup] Failed to delete contacts with prefix "${prefix}":`, error.message);
}
}
}
if (totalDeleted > 0) {
console.log(`[cleanup] Deleted ${totalDeleted} test-created items from root-test org`);
} else {