chore(style): codebase em-dash sweep + minor layout polish
Replaces every em-dash and en-dash with regular ASCII hyphens across comments, JSX strings, and dev-facing logs. Mostly cosmetic but stops the inconsistent mix that crept in over the last few months (some files used em-dashes in comments, others didn't, some used both). Bundles two small dashboard-layout tweaks that touch a couple of already-modified files: - (dashboard)/layout.tsx main padding goes from p-6 to pt-3 px-6 pb-6 so page content sits closer to the topbar. - Sidebar now receives the ports list it needs for the footer port switcher. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,18 +13,12 @@ export const createFieldSchema = z
|
||||
.regex(/^[a-z_][a-z0-9_]*$/, 'Must be snake_case'),
|
||||
fieldLabel: z.string().min(1).max(100),
|
||||
fieldType: z.enum(CUSTOM_FIELD_TYPES),
|
||||
selectOptions: z
|
||||
.array(z.string().min(1).max(100))
|
||||
.min(1)
|
||||
.max(50)
|
||||
.optional(),
|
||||
selectOptions: z.array(z.string().min(1).max(100)).min(1).max(50).optional(),
|
||||
isRequired: z.boolean().default(false),
|
||||
sortOrder: z.number().int().min(0).default(0),
|
||||
})
|
||||
.refine(
|
||||
(data) =>
|
||||
data.fieldType !== 'select' ||
|
||||
(data.selectOptions && data.selectOptions.length > 0),
|
||||
(data) => data.fieldType !== 'select' || (data.selectOptions && data.selectOptions.length > 0),
|
||||
{
|
||||
message: 'Select fields must have at least one option',
|
||||
path: ['selectOptions'],
|
||||
@@ -36,7 +30,7 @@ export const updateFieldSchema = z.object({
|
||||
selectOptions: z.array(z.string().min(1).max(100)).optional(),
|
||||
isRequired: z.boolean().optional(),
|
||||
sortOrder: z.number().int().min(0).optional(),
|
||||
// fieldType intentionally omitted — cannot be changed after creation
|
||||
// fieldType intentionally omitted - cannot be changed after creation
|
||||
});
|
||||
|
||||
export const setValuesSchema = z.object({
|
||||
|
||||
@@ -82,7 +82,7 @@ export type GenerateAndSendInput = z.infer<typeof generateAndSendSchema>;
|
||||
export type GenerateAndSignInput = z.infer<typeof generateAndSignSchema>;
|
||||
|
||||
// ─── TipTap-based Admin Template Schemas ─────────────────────────────────────
|
||||
// Used by /api/v1/admin/templates — the TipTap JSON document store.
|
||||
// Used by /api/v1/admin/templates - the TipTap JSON document store.
|
||||
|
||||
export const tiptapDocumentTypes = [
|
||||
'eoi',
|
||||
|
||||
@@ -84,7 +84,7 @@ export const listDocumentsSchema = baseListQuerySchema.extend({
|
||||
clientId: z.string().optional(),
|
||||
documentType: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
/** Hub tab filter — applies tab-specific status / signer-membership constraints. */
|
||||
/** Hub tab filter - applies tab-specific status / signer-membership constraints. */
|
||||
tab: z.enum(documentsHubTabs).optional(),
|
||||
/** Restrict to docs being watched by this user id. */
|
||||
watcherUserId: z.string().optional(),
|
||||
|
||||
@@ -58,7 +58,7 @@ export const subdivisionIsoSchema = z
|
||||
.refine((code) => isValidSubdivisionCode(code), 'Unknown subdivision code');
|
||||
|
||||
// ─── Optional variants ────────────────────────────────────────────────────────
|
||||
// Inline forms most callers will use — empty strings normalize to null
|
||||
// Inline forms most callers will use - empty strings normalize to null
|
||||
// so the user clearing a field doesn't fail validation.
|
||||
|
||||
export const optionalCountryIsoSchema = z
|
||||
|
||||
@@ -162,7 +162,7 @@ export const publicInterestSchema = z
|
||||
// NEW: required structured yacht block. Public submissions after the
|
||||
// data-model refactor MUST include yacht data.
|
||||
yacht: publicYachtSchema,
|
||||
// NEW: optional company block — creates/upserts a company and adds a
|
||||
// NEW: optional company block - creates/upserts a company and adds a
|
||||
// membership linking the submitting client to it.
|
||||
company: publicCompanySchema.optional(),
|
||||
source: z.literal('website').default('website'),
|
||||
|
||||
@@ -81,7 +81,7 @@ export const listResidentialInterestsSchema = baseListQuerySchema.extend({
|
||||
* Shape posted by the public website's residential interest form. Coerces
|
||||
* to internal create-shapes inside the public route.
|
||||
*
|
||||
* The legacy `phone` field stays free-text — older website builds may post
|
||||
* The legacy `phone` field stays free-text - older website builds may post
|
||||
* raw international strings ('+44 7700 900123'). The route handler parses
|
||||
* it server-side into `phoneE164` + `phoneCountry`. Newer website builds
|
||||
* can post normalized values directly.
|
||||
|
||||
@@ -51,7 +51,7 @@ function isBlockedIpv6(host: string): boolean {
|
||||
if (h.startsWith('fe80:') || h.startsWith('fe80::')) return true; // link-local
|
||||
if (/^f[cd][0-9a-f]{2}:/.test(h)) return true; // fc00::/7 unique-local
|
||||
if (h.startsWith('::ffff:')) {
|
||||
// IPv4-mapped — unwrap and check
|
||||
// IPv4-mapped - unwrap and check
|
||||
const ipv4 = h.slice(7);
|
||||
return isBlockedIpv4(ipv4);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ function isBlockedIpv6(host: string): boolean {
|
||||
* Reject webhook URLs whose hostname targets a private/internal/loopback/
|
||||
* link-local destination. The webhook worker `fetch`es the URL and writes
|
||||
* a slice of the response body into `webhook_deliveries.response_body`,
|
||||
* which is later returned by the deliveries listing endpoint — making any
|
||||
* which is later returned by the deliveries listing endpoint - making any
|
||||
* SSRF here an information-disclosure read primitive against any internal
|
||||
* service the worker can reach. Does NOT defend against DNS rebinding;
|
||||
* the worker performs its own re-resolution at dispatch time.
|
||||
|
||||
Reference in New Issue
Block a user