Skip to content
Draft
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
1 change: 1 addition & 0 deletions apps/api/src/db/schemas/applicationContents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const applicationContents = pgTable(
project_title: text(),
project_website: text(),
project_background: text(),
project_country: varchar({ length: 255 }),
project_methodology: text(),
project_aims: text(),
project_summary: text(),
Expand Down
6 changes: 6 additions & 0 deletions apps/api/src/docs/schemas/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ components:
projectBackground:
type: string
description: Brief description of project
projectCountry:
type: string
description: The country that the project's data resides in
projectMethodology:
type: string
description: Description of scientific approach used in the project
Expand Down Expand Up @@ -488,6 +491,9 @@ components:
projectBackground:
type: string
description: Brief description of project
projectCountry:
type: string
description: The country that the project's data resides in
projectMethodology:
type: string
description: Description of scientific approach used in the project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const ProjectInformation = ({
projectTitle,
projectWebsite,
projectBackground,
projectCountry,
projectAims,
projectMethodology,
projectSummary,
Expand All @@ -54,6 +55,9 @@ const ProjectInformation = ({
<DataItem item={t.project.PROJECT_BACKGROUND_LABEL} layout="stacked">
{projectBackground}
</DataItem>
<DataItem item={t.project.PROJECT_COUNTRY_LABEL} layout="stacked">
{projectCountry}
</DataItem>
<DataItem item={t.project.USE_OF_DATA_METHODOLOGY_LABEL} layout="stacked">
{projectMethodology}
</DataItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const PROJECT_INFORMATION: ProjectInformationTranslation = {
RESEARCH_SUMMARY_DESCRIPTION:
'This section should describe the background, aims, and methodology of your research project, as well as plans for how you will use the PCGL Controlled Data.',
PROJECT_BACKGROUND_LABEL: 'Project Background',
PROJECT_COUNTRY_LABEL: 'Which country will the data reside in?',
USE_OF_DATA_METHODOLOGY_LABEL: 'Use of Data and Methodology',
AIMS_LABEL: 'Aims',
LAY_SUMMARY_TITLE: 'Project Lay Summary',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const FR_PROJECT_INFORMATION: ProjectInformationTranslation = {
RESEARCH_SUMMARY_DESCRIPTION:
"Cette section doit décrire le contexte, les objectifs et la méthodologie de votre projet de recherche, ainsi que les plans d'utilisation des données contrôlées de la BGP.",
PROJECT_BACKGROUND_LABEL: 'Contexte',
PROJECT_COUNTRY_LABEL: 'Dans quel pays les données seront-elles hébergées ?',
USE_OF_DATA_METHODOLOGY_LABEL: 'Utilisation des données et méthodologie',
AIMS_LABEL: 'Objectifs',
LAY_SUMMARY_TITLE: 'Résumé vulgarisé du projet',
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/service/pdf/components/translations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export type ProjectInformationTranslation = {
RESEARCH_SUMMARY_TITLE: string;
RESEARCH_SUMMARY_DESCRIPTION: string;
PROJECT_BACKGROUND_LABEL: string;
PROJECT_COUNTRY_LABEL: string;
USE_OF_DATA_METHODOLOGY_LABEL: string;
AIMS_LABEL: string;
LAY_SUMMARY_TITLE: string;
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/service/pdf/documents/PCGLApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const PCGLApplication = ({ applicationContents, signature, collaborators, docCre
projectTitle={contents?.projectTitle}
projectWebsite={contents?.projectWebsite}
projectBackground={contents?.projectBackground}
projectCountry={contents?.projectCountry}
projectAims={contents?.projectAims}
projectSummary={contents?.projectSummary}
projectMethodology={contents?.projectMethodology}
Expand Down Expand Up @@ -245,6 +246,7 @@ const PCGLApplication = ({ applicationContents, signature, collaborators, docCre
projectTitle={contents?.projectTitle}
projectWebsite={contents?.projectWebsite}
projectBackground={contents?.projectBackground}
projectCountry={contents?.projectCountry}
projectAims={contents?.projectAims}
projectSummary={contents?.projectSummary}
projectMethodology={contents?.projectMethodology}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const ValidatorProject = (fields: ApplicationContentsResponse): boolean =
projectTitle: fields.projectTitle,
projectWebsite: fields.projectWebsite,
projectBackground: fields.projectBackground, // Abstract
projectCountry: fields.projectCountry,
projectAims: fields.projectAims,
projectMethodology: fields.projectMethodology,
projectSummary: fields.projectSummary,
Expand Down
3 changes: 3 additions & 0 deletions apps/ui/src/i18n/locale/en/enSection.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
"exemplar2": "If possible, include any previous research in this area that you have completed that is relevant."
}
},
"country": {
"title": "Which country will the data reside in?"
},
"methodology": {
"title": "Use of Data and Methodology:",
"example": {
Expand Down
3 changes: 3 additions & 0 deletions apps/ui/src/i18n/locale/fr/frSection.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
"exemplar2": "Si possible, incluez toute recherche antérieure pertinente que vous avez effectuée dans ce domaine."
}
},
"country": {
"title": "Dans quel pays les données seront-elles hébergées ?"
},
"methodology": {
"title": "Utilisation des données et méthodologie :",
"example": {
Expand Down
20 changes: 20 additions & 0 deletions apps/ui/src/pages/applications/sections/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { zodResolver } from '@hookform/resolvers/zod';
import { GC_STANDARD_GEOGRAPHIC_AREAS } from '@pcgl-daco/data-model';
import { projectInformationSchema, type ProjectInformationSchemaType } from '@pcgl-daco/validation';
import { Col, Form, Row } from 'antd';
import { createSchemaFieldRule } from 'antd-zod';
Expand All @@ -29,6 +30,7 @@ import SectionWrapper from '@/components/layouts/SectionWrapper';
import DacComments from '@/components/pages/application/collapse/DacComments';
import InputBox from '@/components/pages/application/form-components/InputBox';
import LabelWithExample from '@/components/pages/application/form-components/labels/LabelWithExample';
import SelectBox from '@/components/pages/application/form-components/SelectBox';
import TextAreaBox from '@/components/pages/application/form-components/TextAreaBox';
import SectionContent from '@/components/pages/application/SectionContent';
import SectionFooter from '@/components/pages/application/SectionFooter';
Expand Down Expand Up @@ -59,6 +61,7 @@ const Project = () => {
projectTitle: state.fields.projectTitle,
projectWebsite: state.fields.projectWebsite,
projectBackground: state.fields.projectBackground,
projectCountry: state.fields.projectCountry,
projectAims: state.fields.projectAims,
projectMethodology: state.fields.projectMethodology,
projectSummary: state.fields.projectSummary,
Expand Down Expand Up @@ -94,6 +97,7 @@ const Project = () => {
projectWebsite: data.projectWebsite,
projectAims: data.projectAims,
projectBackground: data.projectBackground,
projectCountry: data.projectCountry,
projectMethodology: data.projectMethodology,
projectSummary: data.projectSummary,
projectPublicationUrls,
Expand Down Expand Up @@ -176,6 +180,22 @@ const Project = () => {
/>
</Col>
</Row>
<Row>
<Col xs={{ flex: '100%' }} md={{ flex: '100%' }} lg={{ flex: '100%' }}>
<SelectBox
label={translate('project-section.section1.form.country.title')}
name="projectCountry"
control={control}
options={GC_STANDARD_GEOGRAPHIC_AREAS.map((areas) => {
return { value: areas.iso, label: areas.en };
})}
initialValue={'CAN'}
rule={rule}
required
disabled={!canEdit}
/>
</Col>
</Row>
<Row>
<Col xs={{ flex: '100%' }} md={{ flex: '100%' }} lg={{ flex: '100%' }}>
<TextAreaBox
Expand Down
1 change: 1 addition & 0 deletions docs/model/data-model.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ table application_contents {
project_title text
project_website text
project_background text
project_country varchar(255)
project_methodology text
project_aims text
project_summary text
Expand Down
1 change: 1 addition & 0 deletions packages/data-model/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export type ProjectDTO = {
projectTitle?: string | null;
projectWebsite?: string | null;
projectBackground?: string | null;
projectCountry?: string | null;
projectAims?: string | null;
projectMethodology?: string | null;
projectSummary?: string | null;
Expand Down
1 change: 1 addition & 0 deletions packages/validation/src/routes/applicationRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const applicationContentsSchema = z
projectAims: z.string().nullable(),
projectMethodology: z.string().nullable(),
projectBackground: z.string().nullable(),
projectCountry: z.string().nullable(),
projectSummary: z.string().nullable(),
projectPublicationUrls: z.array(z.string()).nullable(),
ethicsReviewRequired: z.boolean().nullable(),
Expand Down
1 change: 1 addition & 0 deletions packages/validation/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const projectInformationSchema = z.object({
projectTitle: NonEmptyString,
projectWebsite: OptionalURLString,
projectBackground: Concise200WordCountString,
projectCountry: NonEmptyString,
projectAims: Concise200WordCountString,
projectMethodology: Concise200WordCountString,
projectSummary: Concise250WordCountString,
Expand Down