Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions database/database-generated.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,39 @@ export type Database = {
}
Relationships: []
}
portal_preset: {
Row: {
created_at: string
id: string
is_primary: boolean
name: string
portal_login_page: Json
project_id: number
updated_at: string
verification_email_template: Json
}
Insert: {
created_at?: string
id?: string
is_primary?: boolean
name: string
portal_login_page?: Json
project_id: number
updated_at?: string
verification_email_template?: Json
}
Update: {
created_at?: string
id?: string
is_primary?: boolean
name?: string
portal_login_page?: Json
project_id?: number
updated_at?: string
verification_email_template?: Json
}
Relationships: []
}
}
Views: {
[_ in never]: never
Expand Down Expand Up @@ -295,6 +328,39 @@ export type Database = {
}
Relationships: []
}
portal_preset: {
Row: {
created_at: string | null
id: string | null
is_primary: boolean | null
name: string | null
portal_login_page: Json | null
project_id: number | null
updated_at: string | null
verification_email_template: Json | null
}
Insert: {
created_at?: string | null
id?: string | null
is_primary?: boolean | null
name?: string | null
portal_login_page?: Json | null
project_id?: number | null
updated_at?: string | null
verification_email_template?: Json | null
}
Update: {
created_at?: string | null
id?: string | null
is_primary?: boolean | null
name?: string | null
portal_login_page?: Json | null
project_id?: number | null
updated_at?: string | null
verification_email_template?: Json | null
}
Relationships: []
}
}
Functions: {
create_customer_otp_challenge: {
Expand Down Expand Up @@ -337,6 +403,10 @@ export type Database = {
Args: { p_customer_uid: string; p_project_id: number }
Returns: undefined
}
set_primary_portal_preset: {
Args: { p_preset_id: string; p_project_id: number }
Returns: undefined
}
touch_customer_portal_session: {
Args: { p_min_seconds_between_touches?: number; p_token: string }
Returns: {
Expand Down
50 changes: 50 additions & 0 deletions database/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,40 @@ export type FormNotificationRespondentEmailConfig = {
reply_to?: string | null;
};

/**
* `grida_ciam.portal_preset.verification_email_template`
*
* DB-enforced JSON schema (same shape as FormNotificationRespondentEmailConfig).
*/
export type PortalPresetVerificationEmailTemplate = {
enabled?: boolean;
from_name?: string | null;
subject_template?: string | null;
body_html_template?: string | null;
reply_to?: string | null;
};

/**
* `grida_ciam.portal_preset.portal_login_page`
*
* DB-enforced JSON schema for login page text overrides.
*
* The required `template_id` discriminator allows future schema revisions:
* introduce a new template_id value (e.g. "202607-v2") with its own shape,
* add it to the union, and the old DB constraint will reject stale rows,
* forcing an explicit data migration.
*/
export type PortalPresetLoginPage = PortalPresetLoginPage_202602Default;

export type PortalPresetLoginPage_202602Default = {
template_id: "202602-default";
email_step_title?: string | null;
email_step_description?: string | null;
email_step_button_label?: string | null;
otp_step_title?: string | null;
otp_step_description?: string | null;
};

// Override the type for a specific column in a view:
export type Database = MergeDeep<
DatabaseGenerated,
Expand All @@ -74,6 +108,22 @@ export type Database = MergeDeep<
tags?: string[] | null;
};
};
portal_preset: {
// View mirrors the table 1:1; reference the table type and only
// narrow the two JSONB columns from Json to their enforced shapes.
Row: Omit<DatabaseGenerated["grida_ciam"]["Tables"]["portal_preset"]["Row"], "verification_email_template" | "portal_login_page"> & {
verification_email_template: PortalPresetVerificationEmailTemplate;
portal_login_page: PortalPresetLoginPage;
};
Insert: Omit<DatabaseGenerated["grida_ciam"]["Tables"]["portal_preset"]["Insert"], "verification_email_template" | "portal_login_page"> & {
verification_email_template?: PortalPresetVerificationEmailTemplate;
portal_login_page?: PortalPresetLoginPage;
};
Update: Omit<DatabaseGenerated["grida_ciam"]["Tables"]["portal_preset"]["Update"], "verification_email_template" | "portal_login_page"> & {
verification_email_template?: PortalPresetVerificationEmailTemplate;
portal_login_page?: PortalPresetLoginPage;
};
};
};
};
grida_library: {
Expand Down
77 changes: 40 additions & 37 deletions editor/app/(dev)/dev/frames/mail/page.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
import MailAppFrame from "@/components/frames/mail-app-frame";
import {
EmailFrame,
EmailFrameSubject,
EmailFrameSender,
EmailFrameBody,
} from "@/components/frames/email-frame";

export default function MailFramePage() {
return (
<MailAppFrame
sidebarHidden
message={{
at: "2021-10-06T14:00:00Z",
from: {
name: "Grida Forms",
email: "notifications@forms.grida.co",
avatar: "GR",
},
title: "New Feature Update",
}}
messages={[]}
>
<p>Dear team,</p>
<p>
Im excited to announce the release of our latest feature update. This
release includes several new capabilities that will help you work more
efficiently and effectively.
</p>
<p>Some of the key highlights include:</p>
<ul>
<li>Improved email search and filtering</li>
<li>Enhanced email templates and signatures</li>
<li>Seamless integration with our project management tools</li>
</ul>
<p>
Weve been working hard to deliver these improvements, and were confident
they will have a positive impact on your daily workflow. Please let me
know if you have any questions or feedback.
</p>
<p>
Best regards,
<br />
Jared
</p>
</MailAppFrame>
<main className="container max-w-2xl mx-auto py-10">
<EmailFrame className="flex flex-col">
<EmailFrameSubject>New Feature Update</EmailFrameSubject>
<EmailFrameSender
name="Grida Forms"
email="notifications@forms.grida.co"
date="2021-10-06T14:00:00Z"
/>
<EmailFrameBody className="prose prose-stone dark:prose-invert max-w-none">
<p>Dear team,</p>
<p>
Im excited to announce the release of our latest feature update. This
release includes several new capabilities that will help you work
more efficiently and effectively.
</p>
<p>Some of the key highlights include:</p>
<ul>
<li>Improved email search and filtering</li>
<li>Enhanced email templates and signatures</li>
<li>Seamless integration with our project management tools</li>
</ul>
<p>
Weve been working hard to deliver these improvements, and were
confident they will have a positive impact on your daily workflow.
Comment on lines +21 to +33
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor typos in demo text: missing apostrophes.

Lines 21, 32: "Im" → "I'm", "Weve" → "We've", "were" → "we're".

🤖 Prompt for AI Agents
In `@editor/app/`(dev)/dev/frames/mail/page.tsx around lines 21 - 33, Update the
demo JSX text to fix missing apostrophes: replace "Im" with "I'm", "Weve" with
"We've", and "were" with "we're" in the paragraph strings shown (the paragraph
containing "Im excited..." and the subsequent paragraph with "Weve been
working... were confident..."); ensure the JSX text nodes are updated exactly to
the corrected contractions so rendering shows proper punctuation.

Please let me know if you have any questions or feedback.
</p>
<p>
Best regards,
<br />
Jared
</p>
</EmailFrameBody>
</EmailFrame>
</main>
);
}
Loading