diff --git a/apps/api/common/models/red-user.js b/apps/api/common/models/red-user.js index f7d688e02..12813a31d 100644 --- a/apps/api/common/models/red-user.js +++ b/apps/api/common/models/red-user.js @@ -271,6 +271,8 @@ function generateJwtToken(redUser) { operationType: redUser.operationType, productSignupSource: redUser.productSignupSource, tpSignupType: redUser.tpSignupType, + mentor_isPartnershipMentor: redUser.mentor_isPartnershipMentor, + mentor_workPlace: redUser.mentor_workPlace, }, process.env.NX_JWT_SECRET, { diff --git a/apps/nestjs-api/src/assets/email/templates/signup-complete-mentor-partnership.mjml b/apps/nestjs-api/src/assets/email/templates/signup-complete-mentor-partnership.mjml new file mode 100644 index 000000000..1ec86ed15 --- /dev/null +++ b/apps/nestjs-api/src/assets/email/templates/signup-complete-mentor-partnership.mjml @@ -0,0 +1,35 @@ + + + + + + + + Sign-up complete! + + + Hi ${firstName}, + Great news - you're officially signed up! + Please take a moment to log into your account and fill out your profile information. This step is super important because it helps students get to know you better and understand how you can support them. + You will receive an application from your assigned student before the mentorship kick off event, make sure you accept the application to continue your sessions online. + + All the best, + Your ReDI Career Support Team + + + + + + + diff --git a/apps/nestjs-api/src/con-profiles/con-profiles-salesforce-event-handler.service.ts b/apps/nestjs-api/src/con-profiles/con-profiles-salesforce-event-handler.service.ts index e27c7bb10..ba2f62a60 100644 --- a/apps/nestjs-api/src/con-profiles/con-profiles-salesforce-event-handler.service.ts +++ b/apps/nestjs-api/src/con-profiles/con-profiles-salesforce-event-handler.service.ts @@ -95,6 +95,7 @@ export class ConProfilesSalesforceEventHandlerService { this.emailService.sendMentorSignupCompleteEmail({ recipient: conProfile.props.email, firstName: conProfile.props.firstName, + isPartnershipMentor: conProfile.props.mentor_isPartnershipMentor, }) break } diff --git a/apps/nestjs-api/src/con-profiles/con-profiles.service.ts b/apps/nestjs-api/src/con-profiles/con-profiles.service.ts index 43ac5092d..a8fe4dfa8 100644 --- a/apps/nestjs-api/src/con-profiles/con-profiles.service.ts +++ b/apps/nestjs-api/src/con-profiles/con-profiles.service.ts @@ -1,8 +1,8 @@ import { Injectable, NotFoundException } from '@nestjs/common' import { + ConnectProfileStatus, ConProfileEntity, ConProfileMapper, - ConnectProfileStatus, UserType, } from '@talent-connect/common-types' import { deleteUndefinedProperties } from '@talent-connect/shared-utils' @@ -30,6 +30,8 @@ export class ConProfilesService { rediLocation: input.rediLocation, userType: input.userType, menteeCountCapacity: input.userType === UserType.MENTOR ? 1 : 0, + mentor_isPartnershipMentor: input.mentor_isPartnershipMentor, + mentor_workPlace: input.mentor_workPlace, }) } diff --git a/apps/nestjs-api/src/con-profiles/dtos/con-profile-sign-up.entityinput.ts b/apps/nestjs-api/src/con-profiles/dtos/con-profile-sign-up.entityinput.ts index a7812b0f4..9ef7ee2be 100644 --- a/apps/nestjs-api/src/con-profiles/dtos/con-profile-sign-up.entityinput.ts +++ b/apps/nestjs-api/src/con-profiles/dtos/con-profile-sign-up.entityinput.ts @@ -9,4 +9,6 @@ export class ConProfileSignUpInput extends PickType(_ConProfileEntityProps, [ 'email', 'userType', 'rediLocation', + 'mentor_workPlace', + 'mentor_isPartnershipMentor', ] as const) {} diff --git a/apps/nestjs-api/src/con-profiles/dtos/patch-con-profile.entityinput.ts b/apps/nestjs-api/src/con-profiles/dtos/patch-con-profile.entityinput.ts index 0ed106b38..1f02d762d 100644 --- a/apps/nestjs-api/src/con-profiles/dtos/patch-con-profile.entityinput.ts +++ b/apps/nestjs-api/src/con-profiles/dtos/patch-con-profile.entityinput.ts @@ -9,6 +9,7 @@ export class PatchConProfileInput extends PartialType( PickType(_ConProfileEntityProps, [ 'mentor_occupation', 'mentor_workPlace', + 'mentor_isPartnershipMentor', 'expectations', 'mentee_occupationCategoryId', 'mentee_occupationJob_placeOfEmployment', diff --git a/apps/nestjs-api/src/email/lib/email/email.js b/apps/nestjs-api/src/email/lib/email/email.js index 5f218e71d..5289b90fc 100644 --- a/apps/nestjs-api/src/email/lib/email/email.js +++ b/apps/nestjs-api/src/email/lib/email/email.js @@ -347,8 +347,13 @@ export const sendMenteeSignupCompleteEmail = ({ }) } -export const sendMentorSignupCompleteEmail = ({ recipient, firstName }) => { - const html = convertTemplateToHtml(null, 'signup-complete-mentor').replace( +export const sendMentorSignupCompleteEmail = ({ recipient, firstName, isPartnershipMentor }) => { + const templateFile = + isPartnershipMentor === true + ? 'signup-complete-mentor-partnership' + : 'signup-complete-mentor' + + const html = convertTemplateToHtml(null, templateFile).replace( /\${firstName}/g, firstName ) diff --git a/apps/nestjs-api/src/salesforce-api/sf-api-con-profiles.service.ts b/apps/nestjs-api/src/salesforce-api/sf-api-con-profiles.service.ts index 5b5490656..6366a2d16 100644 --- a/apps/nestjs-api/src/salesforce-api/sf-api-con-profiles.service.ts +++ b/apps/nestjs-api/src/salesforce-api/sf-api-con-profiles.service.ts @@ -32,6 +32,8 @@ export class SfApiConProfilesService { loopbackUserId: string userType: UserType menteeCountCapacity: number + mentor_isPartnershipMentor?: boolean + mentor_workPlace?: string }) { const recordTypeId = await this.repository.findRecordIdOfObject( ConProfileRecord.metadata.SALESFORCE_OBJECT_NAME, @@ -46,6 +48,8 @@ export class SfApiConProfilesService { ReDI_Location__c: data.rediLocation, RecordTypeId: recordTypeId, total_mentee_capacity__c: data.menteeCountCapacity, + Partnership_Mentor__c: data.mentor_isPartnershipMentor, + Work_Place__c: data.mentor_workPlace, } ) diff --git a/apps/redi-connect/src/components/molecules/ReadOccupation.generated.ts b/apps/redi-connect/src/components/molecules/ReadOccupation.generated.ts index 2cc5855fa..8ee9a4641 100644 --- a/apps/redi-connect/src/components/molecules/ReadOccupation.generated.ts +++ b/apps/redi-connect/src/components/molecules/ReadOccupation.generated.ts @@ -1,13 +1,14 @@ // THIS FILE IS GENERATED, DO NOT EDIT! import * as Types from '@talent-connect/data-access'; -export type ReadOccupationProfilePropFragment = { __typename?: 'ConProfile', userType: Types.UserType, mentor_occupation?: string | null, mentor_workPlace?: string | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null }; +export type ReadOccupationProfilePropFragment = { __typename?: 'ConProfile', userType: Types.UserType, mentor_occupation?: string | null, mentor_workPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null }; export const ReadOccupationProfilePropFragmentDoc = ` fragment ReadOccupationProfileProp on ConProfile { userType mentor_occupation mentor_workPlace + mentor_isPartnershipMentor mentee_occupationCategoryId mentee_occupationJob_placeOfEmployment mentee_occupationJob_position diff --git a/apps/redi-connect/src/components/molecules/ReadOccupation.graphql b/apps/redi-connect/src/components/molecules/ReadOccupation.graphql index a32741fcd..af200d527 100644 --- a/apps/redi-connect/src/components/molecules/ReadOccupation.graphql +++ b/apps/redi-connect/src/components/molecules/ReadOccupation.graphql @@ -2,6 +2,7 @@ fragment ReadOccupationProfileProp on ConProfile { userType mentor_occupation mentor_workPlace + mentor_isPartnershipMentor mentee_occupationCategoryId mentee_occupationJob_placeOfEmployment mentee_occupationJob_position diff --git a/apps/redi-connect/src/components/molecules/ReadOccupation.tsx b/apps/redi-connect/src/components/molecules/ReadOccupation.tsx index 4b0326bd9..52560c3e4 100644 --- a/apps/redi-connect/src/components/molecules/ReadOccupation.tsx +++ b/apps/redi-connect/src/components/molecules/ReadOccupation.tsx @@ -23,6 +23,7 @@ const ReadOccupation = ({ profile, shortInfo }: Props) => { userType, mentor_occupation, mentor_workPlace, + mentor_isPartnershipMentor, mentee_occupationCategoryId, mentee_occupationJob_placeOfEmployment, mentee_occupationJob_position, @@ -51,6 +52,9 @@ const ReadOccupation = ({ profile, shortInfo }: Props) => { <>

{mentor_occupation}

{mentor_workPlace}

+ {mentor_isPartnershipMentor && ( +

My employer is in a mentorship partnership with ReDI School

+ )} )} {isMentee && ( diff --git a/apps/redi-connect/src/components/organisms/EditableOccupation.tsx b/apps/redi-connect/src/components/organisms/EditableOccupation.tsx index 7758103f0..972447ed6 100644 --- a/apps/redi-connect/src/components/organisms/EditableOccupation.tsx +++ b/apps/redi-connect/src/components/organisms/EditableOccupation.tsx @@ -4,6 +4,7 @@ import { UserType, } from '@talent-connect/data-access' import { + Checkbox, Editable, FormInput, FormSelect, @@ -25,6 +26,7 @@ export interface OccupationFormValues { userType: UserType mentor_occupation: string mentor_workPlace: string + mentor_isPartnershipMentor?: boolean mentee_occupationCategoryId: string mentee_occupationJob_placeOfEmployment: string mentee_occupationJob_position: string @@ -43,9 +45,12 @@ const validationSchema = Yup.object({ }), mentor_workPlace: Yup.string() .nullable() - .when('userType', { - is: 'MENTOR', - then: (schema) => schema.max(255).label('Work place'), + .when(['userType', 'mentor_isPartnershipMentor'], { + is: (userType, mentor_isPartnershipMentor) => + userType === 'MENTOR' && mentor_isPartnershipMentor, + then: (schema) => + schema.required('Please enter the company name').max(255), + otherwise: (schema) => schema.max(255), }), mentee_occupationCategoryId: Yup.string() .nullable() @@ -112,6 +117,7 @@ function EditableOccupation() { const userType = profile?.userType const mentor_occupation = profile?.mentor_occupation const mentor_workPlace = profile?.mentor_workPlace + const mentor_isPartnershipMentor = profile?.mentor_isPartnershipMentor const mentee_occupationCategoryId = profile?.mentee_occupationCategoryId const mentee_occupationJob_placeOfEmployment = profile?.mentee_occupationJob_placeOfEmployment @@ -142,6 +148,7 @@ function EditableOccupation() { userType, mentor_occupation, mentor_workPlace, + mentor_isPartnershipMentor, mentee_occupationCategoryId, mentee_occupationJob_placeOfEmployment, mentee_occupationJob_position, @@ -184,6 +191,13 @@ function EditableOccupation() { placeholder="Company" {...formik} /> + + My employer is in a mentorship partnership with ReDI School + )} diff --git a/apps/redi-connect/src/pages/app/profile/Profile.generated.ts b/apps/redi-connect/src/pages/app/profile/Profile.generated.ts index a471a6c82..c7afc4496 100644 --- a/apps/redi-connect/src/pages/app/profile/Profile.generated.ts +++ b/apps/redi-connect/src/pages/app/profile/Profile.generated.ts @@ -9,7 +9,7 @@ export type ProfilePageQueryQueryVariables = Types.Exact<{ }>; -export type ProfilePageQueryQuery = { __typename?: 'Query', conProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType } }; +export type ProfilePageQueryQuery = { __typename?: 'Query', conProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType } }; export const ProfilePageQueryDocument = ` diff --git a/apps/redi-connect/src/pages/front/login/Login.tsx b/apps/redi-connect/src/pages/front/login/Login.tsx index cc8cc3333..ed7e1267d 100644 --- a/apps/redi-connect/src/pages/front/login/Login.tsx +++ b/apps/redi-connect/src/pages/front/login/Login.tsx @@ -170,14 +170,21 @@ export default function Login() { // in localStorage contains the data from RedUser which contains the data from the CON // sign-up page. We now want to use this to create a CON profile for them. const accessToken = getAccessTokenFromLocalStorage() - const { email, userType, rediLocation } = decodeJwt( - accessToken.jwtToken - ) as { [key: string]: string } + const { + email, + userType, + rediLocation, + mentor_isPartnershipMentor, + mentor_workPlace, + } = decodeJwt(accessToken.jwtToken) + await conProfileSignUpMutation.mutateAsync({ input: { - email: email, + email, userType: userType as UserType, rediLocation: rediLocation as RediLocation, + mentor_isPartnershipMentor: mentor_isPartnershipMentor as boolean, + mentor_workPlace, }, }) return history.push(`/front/signup-complete/${userType.toLowerCase()}`) diff --git a/apps/redi-connect/src/pages/front/signup/SignUp.tsx b/apps/redi-connect/src/pages/front/signup/SignUp.tsx index 017efc780..96edf3ee5 100644 --- a/apps/redi-connect/src/pages/front/signup/SignUp.tsx +++ b/apps/redi-connect/src/pages/front/signup/SignUp.tsx @@ -1,23 +1,18 @@ -import { useState } from 'react' -import { Link, useParams } from 'react-router-dom' -import AccountOperation from '../../../components/templates/AccountOperation' - -import * as Yup from 'yup' - +import { RediLocation, UserType } from '@talent-connect/data-access' import { Button, Checkbox, FormInput, Heading, } from '@talent-connect/shared-atomic-design-components' +import { toPascalCaseAndTrim } from '@talent-connect/shared-utils' import { FormikHelpers as FormikActions, FormikValues, useFormik } from 'formik' - -import Teaser from '../../../components/molecules/Teaser' - +import { useState } from 'react' import { Columns, Content, Form, Notification } from 'react-bulma-components' - -import { RediLocation, UserType } from '@talent-connect/data-access' -import { toPascalCaseAndTrim } from '@talent-connect/shared-utils' +import { Link, useParams } from 'react-router-dom' +import * as Yup from 'yup' +import Teaser from '../../../components/molecules/Teaser' +import AccountOperation from '../../../components/templates/AccountOperation' import { signUpLoopback } from '../../../services/api/api' import { history } from '../../../services/history/history' import { envRediLocation } from '../../../utils/env-redi-location' @@ -46,6 +41,11 @@ export const validationSchema = Yup.object({ .oneOf([Yup.ref('password')], 'Passwords do not match'), agreesWithCodeOfConduct: Yup.boolean().required().oneOf([true]), gaveGdprConsent: Yup.boolean().required().oneOf([true]), + mentor_isPartnershipMentor: Yup.boolean(), + mentor_workPlace: Yup.string().when('mentor_isPartnershipMentor', { + is: true, + then: (schema) => schema.required('Please enter the company name').max(255), + }), }) export interface SignUpFormValues { @@ -57,6 +57,8 @@ export interface SignUpFormValues { firstName: string lastName: string agreesWithCodeOfConduct: boolean + mentor_isPartnershipMentor?: boolean + mentor_workPlace?: string } export default function SignUp() { @@ -71,6 +73,7 @@ export default function SignUp() { firstName: '', lastName: '', agreesWithCodeOfConduct: false, + mentor_isPartnershipMentor: false, } const [loopbackSubmitError, setLoopbackSubmitError] = useState( @@ -88,6 +91,12 @@ export default function SignUp() { userType: type.toUpperCase() as UserType, rediLocation: envRediLocation() as RediLocation, productSignupSource: 'CON', + ...(type === 'mentor' + ? { + mentor_isPartnershipMentor: values.mentor_isPartnershipMentor, + mentor_workPlace: values.mentor_workPlace, + } + : {}), }) actions.setSubmitting(false) history.push(`/front/signup-email-verification`) @@ -112,6 +121,8 @@ export default function SignUp() { onSubmit: submitForm, }) + const isPartnershipMentor = formik.values.mentor_isPartnershipMentor === true + return ( @@ -171,10 +182,27 @@ export default function SignUp() { {...formik} /> + {type === 'mentor' && ( + + My employer is in a mentorship partnership with ReDI School + + )} + {type === 'mentor' && isPartnershipMentor && ( + + )} + I agree to the{' '} diff --git a/apps/redi-connect/src/pages/front/signup/SignUpComplete.tsx b/apps/redi-connect/src/pages/front/signup/SignUpComplete.tsx index c679122b4..4983c2d15 100644 --- a/apps/redi-connect/src/pages/front/signup/SignUpComplete.tsx +++ b/apps/redi-connect/src/pages/front/signup/SignUpComplete.tsx @@ -1,4 +1,7 @@ -import { RediLocation } from '@talent-connect/data-access' +import { + RediLocation, + useLoadMyProfileQuery, +} from '@talent-connect/data-access' import { Button, Heading, @@ -7,6 +10,7 @@ import { Columns, Content, Form } from 'react-bulma-components' import { useHistory, useParams } from 'react-router-dom' import { Teaser } from '../../../components/molecules' import AccountOperation from '../../../components/templates/AccountOperation' +import { getAccessTokenFromLocalStorage } from '../../../services/auth/auth' import { envRediLocation } from '../../../utils/env-redi-location' import { SignUpPageType, SignUpPageTypes } from './signup-page.type' @@ -15,6 +19,11 @@ export default function SignUpComplete() { const rediLocation = envRediLocation() as RediLocation const { userType } = useParams() as unknown as { userType: SignUpPageType } + const loopbackUserId = getAccessTokenFromLocalStorage().userId + const myProfileQuery = useLoadMyProfileQuery({ loopbackUserId }) + const isPartnershipMentor = + myProfileQuery.data?.conProfile.mentor_isPartnershipMentor === true + return ( @@ -27,7 +36,17 @@ export default function SignUpComplete() { Sign-up complete! - {userType === SignUpPageTypes.mentor && ( + {userType === SignUpPageTypes.mentor && isPartnershipMentor ? ( + <> +

+ Thank you for signing up!{' '} +

{' '} +

+ Please go to your account and{' '} + complete your profile information. +

+ + ) : ( <>

Now, we would like to get to know you better. @@ -52,6 +71,7 @@ export default function SignUpComplete() {

)} + {userType === SignUpPageTypes.mentee && ( <>

diff --git a/apps/redi-talent-pool/src/pages/front/signup/SignUp.tsx b/apps/redi-talent-pool/src/pages/front/signup/SignUp.tsx index fa7c375ea..068a5dba6 100644 --- a/apps/redi-talent-pool/src/pages/front/signup/SignUp.tsx +++ b/apps/redi-talent-pool/src/pages/front/signup/SignUp.tsx @@ -17,7 +17,6 @@ import { howDidHearAboutRediOptions } from '@talent-connect/talent-pool/config' import { objectEntries } from '@talent-connect/typescript-utilities' import { FormikHelpers as FormikActions, useFormik } from 'formik' import { useMemo, useState } from 'react' - import { Columns, Content, Form, Notification } from 'react-bulma-components' import { Link, useParams } from 'react-router-dom' import * as Yup from 'yup' diff --git a/libs/common-types/src/lib/con-profile/con-profile.entityprops.ts b/libs/common-types/src/lib/con-profile/con-profile.entityprops.ts index 75eebf4fb..cdd3ea4b2 100644 --- a/libs/common-types/src/lib/con-profile/con-profile.entityprops.ts +++ b/libs/common-types/src/lib/con-profile/con-profile.entityprops.ts @@ -18,6 +18,7 @@ export class ConProfileEntityProps implements EntityProps { rediLocation: RediLocation mentor_occupation?: string mentor_workPlace?: string + mentor_isPartnershipMentor?: boolean expectations?: string @Field((type) => OccupationCategory) mentee_occupationCategoryId?: OccupationCategory diff --git a/libs/common-types/src/lib/con-profile/con-profile.mapper.ts b/libs/common-types/src/lib/con-profile/con-profile.mapper.ts index 603e088e7..748cb923e 100644 --- a/libs/common-types/src/lib/con-profile/con-profile.mapper.ts +++ b/libs/common-types/src/lib/con-profile/con-profile.mapper.ts @@ -30,6 +30,7 @@ export class ConProfileMapper props.userType = raw.props.RecordType.DeveloperName as UserType props.loopbackUserId = raw.props.Contact__r.Loopback_User_ID__c props.rediLocation = raw.props.ReDI_Location__c as RediLocation + props.mentor_isPartnershipMentor = raw.props.Partnership_Mentor__c props.mentor_occupation = raw.props.Occupation__c props.mentor_workPlace = raw.props.Work_Place__c props.expectations = raw.props.Expectations__c @@ -113,6 +114,7 @@ export class ConProfileMapper props.Profile_Status__c = srcProps.profileStatus // props.RecordType.DeveloperName = srcProps.RecordType.userType props.ReDI_Location__c = srcProps.rediLocation + props.Partnership_Mentor__c = srcProps.mentor_isPartnershipMentor props.Occupation__c = srcProps.mentor_occupation props.Work_Place__c = srcProps.mentor_workPlace props.Expectations__c = srcProps.expectations diff --git a/libs/common-types/src/lib/con-profile/con-profile.record.ts b/libs/common-types/src/lib/con-profile/con-profile.record.ts index 3876cedc1..9ec756932 100644 --- a/libs/common-types/src/lib/con-profile/con-profile.record.ts +++ b/libs/common-types/src/lib/con-profile/con-profile.record.ts @@ -60,6 +60,7 @@ export class ConProfileRecord extends Record { 'Study_Place__c', 'Work_Place__c', 'total_mentee_capacity__c', + 'Partnership_Mentor__c', 'Active_Mentorship_Matches_Mentee__c', 'Active_Mentorship_Matches_Mentor__c', diff --git a/libs/common-types/src/lib/con-profile/con-profile.recordprops.ts b/libs/common-types/src/lib/con-profile/con-profile.recordprops.ts index 2ac9a8d33..3a608b749 100644 --- a/libs/common-types/src/lib/con-profile/con-profile.recordprops.ts +++ b/libs/common-types/src/lib/con-profile/con-profile.recordprops.ts @@ -36,6 +36,7 @@ export class ConProfileRecordProps implements RecordProps { Study_Place__c?: string Work_Place__c?: string total_mentee_capacity__c?: number + Partnership_Mentor__c?: boolean Active_Mentorship_Matches_Mentee__c: number Active_Mentorship_Matches_Mentor__c: number diff --git a/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.generated.ts b/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.generated.ts index b12bf5244..89e5452d7 100644 --- a/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.generated.ts +++ b/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.generated.ts @@ -1,7 +1,7 @@ // THIS FILE IS GENERATED, DO NOT EDIT! import * as Types from '@talent-connect/data-access'; -export type AllConProfileFieldsFragment = { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType }; +export type AllConProfileFieldsFragment = { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType }; export const AllConProfileFieldsFragmentDoc = ` fragment AllConProfileFields on ConProfile { @@ -31,6 +31,7 @@ export const AllConProfileFieldsFragmentDoc = ` mentee_occupationOther_description mentee_occupationStudent_studyName mentee_occupationStudent_studyPlace + mentor_isPartnershipMentor mentor_occupation mentor_workPlace optOutOfMenteesFromOtherRediLocation diff --git a/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.graphql b/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.graphql index a55a96887..81a7a1a1e 100644 --- a/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.graphql +++ b/libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.graphql @@ -25,6 +25,7 @@ fragment AllConProfileFields on ConProfile { mentee_occupationOther_description mentee_occupationStudent_studyName mentee_occupationStudent_studyPlace + mentor_isPartnershipMentor mentor_occupation mentor_workPlace optOutOfMenteesFromOtherRediLocation diff --git a/libs/data-access/src/lib/connect/my-con-profile/my-con-profile.generated.ts b/libs/data-access/src/lib/connect/my-con-profile/my-con-profile.generated.ts index 9485bc466..35d6e96d7 100644 --- a/libs/data-access/src/lib/connect/my-con-profile/my-con-profile.generated.ts +++ b/libs/data-access/src/lib/connect/my-con-profile/my-con-profile.generated.ts @@ -10,14 +10,14 @@ export type LoadMyProfileQueryVariables = Types.Exact<{ }>; -export type LoadMyProfileQuery = { __typename?: 'Query', conProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType, mentorshipMatches: Array<{ __typename?: 'ConMentorshipMatch', applicationText?: string | null, createdAt: any, expectationText?: string | null, hasMenteeDismissedMentorshipApplicationAcceptedNotification?: boolean | null, id: string, ifDeclinedByMentor_chosenReasonForDecline?: string | null, ifDeclinedByMentor_dateTime?: any | null, ifDeclinedByMentor_ifReasonIsOther_freeText?: string | null, ifDeclinedByMentor_optionalMessageToMentee?: string | null, matchMadeActiveOn?: any | null, menteeId: string, mentorId: string, mentorMessageOnComplete?: string | null, mentorReplyMessageOnAccept?: string | null, status: Types.MentorshipMatchStatus, updatedAt: any, mentor: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType }, mentee: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType } }> } }; +export type LoadMyProfileQuery = { __typename?: 'Query', conProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType, mentorshipMatches: Array<{ __typename?: 'ConMentorshipMatch', applicationText?: string | null, createdAt: any, expectationText?: string | null, hasMenteeDismissedMentorshipApplicationAcceptedNotification?: boolean | null, id: string, ifDeclinedByMentor_chosenReasonForDecline?: string | null, ifDeclinedByMentor_dateTime?: any | null, ifDeclinedByMentor_ifReasonIsOther_freeText?: string | null, ifDeclinedByMentor_optionalMessageToMentee?: string | null, matchMadeActiveOn?: any | null, menteeId: string, mentorId: string, mentorMessageOnComplete?: string | null, mentorReplyMessageOnAccept?: string | null, status: Types.MentorshipMatchStatus, updatedAt: any, mentor: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType }, mentee: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType } }> } }; export type PatchMyProfileMutationVariables = Types.Exact<{ input: Types.UpdateConProfileInput; }>; -export type PatchMyProfileMutation = { __typename?: 'Mutation', patchConProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType } }; +export type PatchMyProfileMutation = { __typename?: 'Mutation', patchConProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array | null, lastName: string, linkedInProfileUrl?: string | null, loopbackUserId: string, menteeCountCapacity?: number | null, mentee_highestEducationLevel?: Types.EducationLevel | null, mentee_occupationCategoryId?: Types.OccupationCategory | null, mentee_occupationJob_placeOfEmployment?: string | null, mentee_occupationJob_position?: string | null, mentee_occupationLookingForJob_what?: string | null, mentee_occupationOther_description?: string | null, mentee_occupationStudent_studyName?: string | null, mentee_occupationStudent_studyPlace?: string | null, mentor_isPartnershipMentor?: boolean | null, mentor_occupation?: string | null, mentor_workPlace?: string | null, optOutOfMenteesFromOtherRediLocation: boolean, personalDescription?: string | null, profileAvatarImageS3Key?: string | null, profileStatus: Types.ConnectProfileStatus, rediLocation: Types.RediLocation, slackUsername?: string | null, telephoneNumber?: string | null, updatedAt: any, userActivatedAt?: any | null, userType: Types.UserType } }; export const LoadMyProfileDocument = ` diff --git a/libs/data-access/src/lib/types/types.ts b/libs/data-access/src/lib/types/types.ts index 06901453f..c288ed639 100644 --- a/libs/data-access/src/lib/types/types.ts +++ b/libs/data-access/src/lib/types/types.ts @@ -156,6 +156,7 @@ export type ConProfile = { mentee_occupationOther_description?: Maybe; mentee_occupationStudent_studyName?: Maybe; mentee_occupationStudent_studyPlace?: Maybe; + mentor_isPartnershipMentor?: Maybe; mentor_occupation?: Maybe; mentor_workPlace?: Maybe; mentoringSessions: Array; @@ -175,6 +176,8 @@ export type ConProfile = { export type ConProfileSignUpInput = { email: Scalars['String']; + mentor_isPartnershipMentor?: InputMaybe; + mentor_workPlace?: InputMaybe; rediLocation: RediLocation; userType: UserType; }; @@ -1770,6 +1773,7 @@ export type UpdateConProfileInput = { mentee_occupationOther_description?: InputMaybe; mentee_occupationStudent_studyName?: InputMaybe; mentee_occupationStudent_studyPlace?: InputMaybe; + mentor_isPartnershipMentor?: InputMaybe; mentor_occupation?: InputMaybe; mentor_workPlace?: InputMaybe; optOutOfMenteesFromOtherRediLocation?: InputMaybe; diff --git a/libs/shared-types/src/lib/RedProfile.ts b/libs/shared-types/src/lib/RedProfile.ts index 8de8790d0..3ba301b0d 100644 --- a/libs/shared-types/src/lib/RedProfile.ts +++ b/libs/shared-types/src/lib/RedProfile.ts @@ -1,8 +1,3 @@ -import { RedMatch } from './RedMatch' -import { RedMentoringSession } from './RedMentoringSession' -import { UserType } from './UserType' -import { SignupSource } from './SignupSource' -import { RediLocation } from './RediLocation' import { CategoryKey, EducationLevelKey, @@ -10,6 +5,11 @@ import { LanguageKey, MenteeOccupationCategoryKey, } from '@talent-connect/shared-config' +import { RediLocation } from './RediLocation' +import { RedMatch } from './RedMatch' +import { RedMentoringSession } from './RedMentoringSession' +import { SignupSource } from './SignupSource' +import { UserType } from './UserType' export type RedProfile = { id: string @@ -18,6 +18,7 @@ export type RedProfile = { signupSource: SignupSource //! DEPRECATE mentor_occupation: string mentor_workPlace: string + mentor_isPartnershipMentor: boolean expectations: string mentor_ifTypeForm_submittedAt: Date //! DEPRECATE mentee_ifTypeForm_preferredMentorSex: 'male' | 'female' | 'none' //! DEPRECATE diff --git a/schema.graphql b/schema.graphql index bdda098eb..40b92e48f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -129,6 +129,7 @@ type ConProfile { mentee_occupationOther_description: String mentee_occupationStudent_studyName: String mentee_occupationStudent_studyPlace: String + mentor_isPartnershipMentor: Boolean mentor_occupation: String mentor_workPlace: String mentoringSessions: [ConMentoringSession!]! @@ -148,6 +149,8 @@ type ConProfile { input ConProfileSignUpInput { email: String! + mentor_isPartnershipMentor: Boolean + mentor_workPlace: String rediLocation: RediLocation! userType: UserType! } @@ -1428,6 +1431,7 @@ input UpdateConProfileInput { mentee_occupationOther_description: String mentee_occupationStudent_studyName: String mentee_occupationStudent_studyPlace: String + mentor_isPartnershipMentor: Boolean mentor_occupation: String mentor_workPlace: String optOutOfMenteesFromOtherRediLocation: Boolean