Skip to content
Open
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
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.440.0",
"@aws-sdk/s3-request-presigner": "^3.440.0",
"@faire/mjml-react": "^3.5.0",
"@faker-js/faker": "^9.7.0",
"@fastify/compress": "^8.0.1",
"@fastify/cookie": "^11.0.1",
Expand All @@ -51,7 +52,7 @@
"@seedcompany/common": ">=0.19.1 <1",
"@seedcompany/data-loader": "^2.0.1",
"@seedcompany/nest": "^1.8.0",
"@seedcompany/nestjs-email": "^4.3.0",
"@seedcompany/nestjs-email": "^5.0.0-alpha.5",
"@seedcompany/scripture": ">=0.8.0",
"argon2": "^0.43.0",
"aws-xray-sdk-core": "^3.5.3",
Expand Down Expand Up @@ -91,13 +92,14 @@
"lru-cache": "^11.0.1",
"luxon": "^3.5.0",
"mime": "^4.0.7",
"mjml": "^4.15.3",
"nanoid": "^5.1.5",
"neo4j-driver": "^5.28.1",
"p-retry": "^6.2.1",
"plur": "^5.1.0",
"prismjs-terminal": "^1.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"read-package-up": "^11.0.0",
"reflect-metadata": "^0.2.2",
"rimraf": "^6.0.1",
Expand Down Expand Up @@ -129,7 +131,7 @@
"@types/luxon": "^3.6.2",
"@types/node": "^22.7.8",
"@types/prismjs": "^1.26.2",
"@types/react": "^18.2.33",
"@types/react": "^19.1.8",
"@types/stack-trace": "^0.0.33",
"@types/triple-beam": "^1.3.4",
"@types/validator": "^13.11.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,169 +1,176 @@
import { type NonEmptyArray } from '@seedcompany/common';
import {
Column,
Text as Head,
Section,
Text,
} from '@seedcompany/nestjs-email/templates';
import type { Verse } from '@seedcompany/scripture';
import type { Range } from '~/common';
import { EmailTemplate } from '~/core/email/templates/base';
import { useFrontendUrl } from '~/core/email/templates/frontend-url';
import { LanguageRef } from '~/core/email/templates/user-ref';
import { type Engagement } from '../../../components/engagement/dto';
import { type Language } from '../../../components/language/dto';
import { type Project } from '../../../components/project/dto';
import { type User } from '../../../components/user/dto';
import {
EmailTemplate,
Headers,
LanguageRef,
Mjml,
useConfig,
useFrontendUrl,
useResources,
} from '~/core/email';
import { type LanguageEngagement } from '../../engagement/dto';

interface Props {
recipient: User;
project: Pick<Project, 'id' | 'name'>;
engagement: Pick<Engagement, 'id'>;
language: Pick<Language, 'id' | 'name' | 'ethnologue'>;
engagement: LanguageEngagement;
completedBooks: NonEmptyArray<Range<Verse>>;
dblFormUrl: string;
}

export function DBLUpload(props: Props) {
const { language, project, completedBooks, engagement, dblFormUrl } = props;
export async function DBLUpload(props: Props) {
const { engagement, completedBooks } = props;

const resources = useResources();
const [language, project] = await Promise.all([
resources.load('Language', props.engagement.language.value!.id),
resources.load('Project', props.engagement.project.id),
]);

const config = useConfig().email.notifyDblUpload!;

const languageName = language.name.value;
return (
<EmailTemplate title={`${languageName || 'Language'} needs a DBL upload`}>
<Section>
<Column>
<Text>
{config.replyTo && <Headers replyTo={config.replyTo} />}
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
<LanguageRef {...language} /> has recently indicated reaching some
All Access goals via{' '}
<a href={useFrontendUrl(`/engagements/${engagement.id}`)}>
{project.name.value ?? 'Some Project'}
</a>
.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
Books:{' '}
{completedBooks.map((range) => range.start.book.name).join(', ')}
</Text>
</Column>
</Section>
<Section>
<Column>
<Text>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
Our records identify you as the Field Project Manager (FPM), and
we’d like to confirm the next steps for uploading the text to the
Digital Bible Library (DBL).
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
To move forward, we need a few details from you. Please have your
field partner complete this short form to provide the necessary
information indicated below:
</Text>
</Column>
</Section>
<Section>
<Column>
<Head>✅ First Step: Who will upload the Scripture to the DBL?</Head>
<Text>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
✅ First Step: Who will upload the Scripture to the DBL?
</Mjml.Text>
<Mjml.Text>
1. If someone is already responsible for uploading to the DBL,
please let us know on the form so we can update our records and
avoid unnecessary follow-ups.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
2. If you need Seed Company to upload it to the DBL, we will need
additional information.
</Text>
</Column>
</Section>
<Section>
<Column>
<Head>✅ If Seed Company uploads to the DBL, please provide:</Head>
<Text>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
✅ If Seed Company uploads to the DBL, please provide:
</Mjml.Text>
<Mjml.Text>
🔹 Copyright Holder & Licensing – Who will hold the copyright for
this text in DBL?
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
The copyright holder can be the field partner or Seed Company if
needed.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
We also need to confirm the licensing options you prefer for
distribution. More details on these options are included in the
attached information sheet.
</Text>
</Column>
</Section>
<Section>
<Column>
<Text>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
🔹 Error-Free Text in Paratext – The text must pass Basic Checks in
Paratext without errors.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
A quick way to verify is by printing the text to PDF format using
PTXPrint (
<a href="https://software.sil.org/ptxprint/">learn here</a>).
Besides, our Investors love to see your progress and this is a great
way to share it with them! 😊
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
If errors appear, they must be fixed before we can proceed.
</Text>
</Column>
</Section>
<Section>
<Column>
<Text>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
🔹 Paratext Project Access – We need access to the project in
Paratext.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
Please add SC DBL Admin to the project with the Consultant/Archivist
role.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
This permission level is required for us to complete the upload.
</Text>
</Column>
</Section>
<Section>
<Column>
<Text>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
🔹 Books Ready for Upload – Please confirm which books are ready for
DBL.
</Text>
<Text>
</Mjml.Text>
<Mjml.Text>
We can upload an entire testament or individual books that have
completed consultant checking.
</Text>
</Column>
</Section>
<Section>
<Column>
<Head>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
🔗{' '}
<a href={dblFormUrl} style={{ backgroundColor: 'yellow' }}>
<a href={config.formUrl} style={{ backgroundColor: 'yellow' }}>
Seed Company DBL Publication Request Form
</a>
</Head>
<Text>
</Mjml.Text>
<Mjml.Text>
All of this information can be entered in the form linked above
(with yellow highlight).
</Text>
</Column>
</Section>
<Section>
<Column>
<Head>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
<Mjml.Section>
<Mjml.Column>
<Mjml.Text>
🔗{' '}
<a href={useFrontendUrl('/pdfs/dbl-uploads.pdf')}>
Seed Company DBL Information Sheet
</a>
</Head>
<Text>
</Mjml.Text>
<Mjml.Text>
Please review the linked information sheet for additional details
about the DBL, the process, and licensing options.
</Text>
</Column>
</Section>
</Mjml.Text>
</Mjml.Column>
</Mjml.Section>
</EmailTemplate>
);
}
Loading