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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class SfApiConMentoringSessionsService {
const cleanProps = pick(record.props, [
'Date__c',
'Durations_in_Minutes__c',
'Meeting_Notes__c',
'Mentor__c',
'Mentee__c',
'Mentorship_Match__c',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
&__row {
display: flex;
margin-bottom: 0.5rem;
overflow-wrap: anywhere;

&__label {
color: $grey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
width: 2.5rem;
height: 2.5rem;
padding: 0.5rem;
margin: 0 -0.5rem;
border-radius: 50%;
margin: 0 -0.2rem;

&:hover {
background-color: $redi-orange-extra-light;
border-radius: 50%;
}
}
}
31 changes: 30 additions & 1 deletion apps/redi-connect/src/components/organisms/modules/MSessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Button,
FormDatePicker,
FormSelect,
FormTextArea,
Icon,
Modal,
Module,
Expand All @@ -32,6 +33,9 @@ const formMentoringSessionDurationOptions = Object.values(
interface AddSessionProps {
onClickHandler: Function
}
interface ExpandSessionProps {
setShowText: Function
}

const AddSession = ({ onClickHandler }: AddSessionProps) => (
<Icon
Expand All @@ -44,11 +48,13 @@ const AddSession = ({ onClickHandler }: AddSessionProps) => (
interface FormValues {
date: Date
minuteDuration: MentoringSessionDuration
meetingNotes?: string
}

const initialFormValues: FormValues = {
date: new Date(),
minuteDuration: MentoringSessionDuration.Min60,
meetingNotes: '',
}

const validationSchema = Yup.object({
Expand All @@ -59,10 +65,14 @@ const validationSchema = Yup.object({
[...Object.values(MentoringSessionDuration)],
'Please select a duration'
),
meetingNotes: Yup.string().label('Please provide a meeting note.'),
})

interface MSessions {
sessions: Pick<ConMentoringSession, 'id' | 'date' | 'minuteDuration'>[]
sessions: Pick<
ConMentoringSession,
'id' | 'date' | 'minuteDuration' | 'meetingNotes'
>[]
menteeId: string
editable?: boolean
mentorshipMatchId: string
Expand All @@ -80,6 +90,15 @@ const MSessions = ({

const [showAddSession, setShowAddSession] = useState(false)

const [showText, setShowText] = useState(false)
const ExpandSessions = ({ setShowText }: ExpandSessionProps) => (
<Icon
icon="chevronDown"
className="m-sessions__add"
onClick={() => setShowText(!showText)}
/>
)

const submitForm = async (
values: FormValues,
actions: FormikHelpers<FormValues>
Expand Down Expand Up @@ -122,6 +141,7 @@ const MSessions = ({
<Module
title={`Sessions ${sessions.length ? `(${sessions.length})` : ''}`}
className="m-sessions"
toggles={<ExpandSessions setShowText={setShowText} />}
buttons={editable && <AddSession onClickHandler={setShowAddSession} />}
>
{sessions.length > 0 ? (
Expand All @@ -132,6 +152,8 @@ const MSessions = ({
<Element renderAs="span" textColor="grey">
{session.minuteDuration.replace('MIN', '')} min
</Element>
<br></br>
{showText && session.meetingNotes}
</li>
))}
</ul>
Expand Down Expand Up @@ -172,6 +194,13 @@ const MSessions = ({
items={formMentoringSessionDurationOptions}
formik={formik}
/>
<FormTextArea
label="Please provide a short overview of your mentoring session:"
name="meetingNotes"
rows={4}
placeholder="e.g. what you achieved, key takeaways, homework, goals for next time."
formik={formik}
/>
</form>
</Modal.Body>

Expand Down
14 changes: 7 additions & 7 deletions apps/redi-connect/src/pages/app/mentorship/Mentorship.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ function Mentorship() {
profile={viewProfile}
linkTo={`/app/mentorships/profile/${viewProfile.id}`}
/>
<MContacts profile={viewProfile} className="is-hidden-tablet" />
<MSessions
sessions={viewMatch.mentoringSessions}
menteeId={viewProfile.userId}
editable={currentUserIsMentor}
mentorshipMatchId={matchId}
/>
<ReportProblem
type={myProfile.userType}
redProfileId={viewProfile.id}
/>
</Columns.Column>
<Columns.Column size={8}>
<MContacts profile={viewProfile} className="is-hidden-mobile" />
<MContacts profile={viewProfile} className="is-hidden-tablet" />
<MSessions
sessions={viewMatch.mentoringSessions}
menteeId={viewProfile.userId}
editable={currentUserIsMentor}
mentorshipMatchId={matchId}
/>
</Columns.Column>
</Columns>
</LoggedIn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,83 +1,36 @@
// THIS FILE IS GENERATED, DO NOT EDIT!
import * as Types from '@talent-connect/data-access'
import * as Types from '@talent-connect/data-access';

import { fetcher } from '@talent-connect/data-access'
import { useQuery, UseQueryOptions } from 'react-query'
import { AllConProfileFieldsFragmentDoc } from '../../../../../../../libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.generated'
import { AllConProfileFieldsFragmentDoc } from '../../../../../../../libs/data-access/src/lib/connect/con-profiles/con-profile.fragment.generated';
import { useQuery, UseQueryOptions } from 'react-query';
import { fetcher } from '@talent-connect/data-access';
export type ProfilePageQueryQueryVariables = Types.Exact<{
id: Types.Scalars['ID']
}>
id: Types.Scalars['ID'];
}>;


export type ProfilePageQueryQuery = { __typename?: 'Query', conProfile: { __typename?: 'ConProfile', userId: string, age?: number | null, birthDate?: any | null, categories: Array<Types.MentoringTopic>, createdAt: any, doesNotHaveAvailableMentorshipSlot: boolean, email: string, expectations?: string | null, firstName: string, fullName: string, gender?: Types.Gender | null, githubProfileUrl?: string | null, id: string, languages?: Array<Types.Language> | 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, isSubscribedToCONMarketingEmails: boolean } };

export type ProfilePageQueryQuery = {
__typename?: 'Query'
conProfile: {
__typename?: 'ConProfile'
userId: string
age?: number | null
birthDate?: any | null
categories: Array<Types.MentoringTopic>
createdAt: any
doesNotHaveAvailableMentorshipSlot: boolean
email: string
expectations?: string | null
firstName: string
fullName: string
gender?: Types.Gender | null
githubProfileUrl?: string | null
id: string
languages?: Array<Types.Language> | 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
isSubscribedToCONMarketingEmails: boolean
}
}

export const ProfilePageQueryDocument = `
query ProfilePageQuery($id: ID!) {
conProfile(id: $id) {
...AllConProfileFields
}
}
${AllConProfileFieldsFragmentDoc}`
${AllConProfileFieldsFragmentDoc}`;
export const useProfilePageQueryQuery = <
TData = ProfilePageQueryQuery,
TError = unknown
>(
variables: ProfilePageQueryQueryVariables,
options?: UseQueryOptions<ProfilePageQueryQuery, TError, TData>
) =>
useQuery<ProfilePageQueryQuery, TError, TData>(
['ProfilePageQuery', variables],
fetcher<ProfilePageQueryQuery, ProfilePageQueryQueryVariables>(
ProfilePageQueryDocument,
variables
),
options
)
TData = ProfilePageQueryQuery,
TError = unknown
>(
variables: ProfilePageQueryQueryVariables,
options?: UseQueryOptions<ProfilePageQueryQuery, TError, TData>
) =>
useQuery<ProfilePageQueryQuery, TError, TData>(
['ProfilePageQuery', variables],
fetcher<ProfilePageQueryQuery, ProfilePageQueryQueryVariables>(ProfilePageQueryDocument, variables),
options
);

useProfilePageQueryQuery.getKey = (
variables: ProfilePageQueryQueryVariables
) => ['ProfilePageQuery', variables]
useProfilePageQueryQuery.getKey = (variables: ProfilePageQueryQueryVariables) => ['ProfilePageQuery', variables];
;
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class ConMentoringSessionEntityProps implements EntityProps {
date: Date
@Field((type) => MentoringSessionDuration)
minuteDuration: MentoringSessionDuration
meetingNotes?: string

@Field((type) => ID)
mentorId: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class ConMentoringSessionMapper
]
props.mentorId = raw.props.Mentor__c
props.menteeId = raw.props.Mentee__c
props.meetingNotes = raw.props.Meeting_Notes__c
props.mentorshipMatchId = raw.props.Mentorship_Match__c
props.createdAt = raw.props.CreatedDate
props.updatedAt = raw.props.LastModifiedDate
Expand All @@ -42,6 +43,7 @@ export class ConMentoringSessionMapper
props.Durations_in_Minutes__c = parseInt(
srcProps.minuteDuration.replace('MIN', '')
)
props.Meeting_Notes__c = srcProps.meetingNotes
props.Mentor__c = srcProps.mentorId
props.Mentee__c = srcProps.menteeId
props.Mentorship_Match__c = srcProps.mentorshipMatchId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class ConMentoringSessionRecord extends Record<ConMentoringSessionRecordP
'Id',
'Date__c',
'Durations_in_Minutes__c',
'Meeting_Notes__c',
'Mentee__c',
'Mentor__c',
'Mentorship_Match__c',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class ConMentoringSessionRecordProps implements RecordProps {
@Type(() => Date)
Date__c: Date
Durations_in_Minutes__c: number
Meeting_Notes__c?: string

Mentor__c: string
Mentee__c: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ class _ConMentoringSessionntityProps extends ConMentoringSessionEntityProps {}
@InputType('CreateConMentoringSessionInput')
export class CreateConMentoringSessionInput extends PickType(
_ConMentoringSessionntityProps,
['date', 'minuteDuration', 'menteeId', 'mentorshipMatchId'] as const
[
'date',
'minuteDuration',
'menteeId',
'mentorshipMatchId',
'meetingNotes',
] as const
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type FindMatchQueryVariables = Types.Exact<{
}>;


export type FindMatchQuery = { __typename?: 'Query', conMentorshipMatch: { __typename?: 'ConMentorshipMatch', id: string, applicationText?: string | null, expectationText?: string | null, status: Types.MentorshipMatchStatus, mentee: { __typename?: 'ConProfile', userId: string, id: string, fullName: string, firstName: string, lastName: string, email: string, languages?: Array<Types.Language> | null, categories: Array<Types.MentoringTopic>, rediLocation: Types.RediLocation, profileAvatarImageS3Key?: string | null, telephoneNumber?: string | null, linkedInProfileUrl?: string | null, slackUsername?: string | null }, mentor: { __typename?: 'ConProfile', userId: string, id: string, fullName: string, firstName: string, lastName: string, email: string, languages?: Array<Types.Language> | null, categories: Array<Types.MentoringTopic>, rediLocation: Types.RediLocation, profileAvatarImageS3Key?: string | null, telephoneNumber?: string | null, linkedInProfileUrl?: string | null, slackUsername?: string | null }, mentoringSessions: Array<{ __typename?: 'ConMentoringSession', id: string, date: any, minuteDuration: Types.MentoringSessionDuration }> } };
export type FindMatchQuery = { __typename?: 'Query', conMentorshipMatch: { __typename?: 'ConMentorshipMatch', id: string, applicationText?: string | null, expectationText?: string | null, status: Types.MentorshipMatchStatus, mentee: { __typename?: 'ConProfile', userId: string, id: string, fullName: string, firstName: string, lastName: string, email: string, languages?: Array<Types.Language> | null, categories: Array<Types.MentoringTopic>, rediLocation: Types.RediLocation, profileAvatarImageS3Key?: string | null, telephoneNumber?: string | null, linkedInProfileUrl?: string | null, slackUsername?: string | null }, mentor: { __typename?: 'ConProfile', userId: string, id: string, fullName: string, firstName: string, lastName: string, email: string, languages?: Array<Types.Language> | null, categories: Array<Types.MentoringTopic>, rediLocation: Types.RediLocation, profileAvatarImageS3Key?: string | null, telephoneNumber?: string | null, linkedInProfileUrl?: string | null, slackUsername?: string | null }, mentoringSessions: Array<{ __typename?: 'ConMentoringSession', id: string, date: any, minuteDuration: Types.MentoringSessionDuration, meetingNotes?: string | null }> } };

export type ConProfileFieldsFragment = { __typename?: 'ConProfile', userId: string, id: string, fullName: string, firstName: string, lastName: string, email: string, languages?: Array<Types.Language> | null, categories: Array<Types.MentoringTopic>, rediLocation: Types.RediLocation, profileAvatarImageS3Key?: string | null, telephoneNumber?: string | null, linkedInProfileUrl?: string | null, slackUsername?: string | null };

Expand Down Expand Up @@ -110,6 +110,7 @@ export const FindMatchDocument = `
id
date
minuteDuration
meetingNotes
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ query findMatch($id: ID!) {
id
date
minuteDuration
meetingNotes
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions libs/data-access/src/lib/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type ConMentoringSession = {
createdAt: Scalars['DateTime'];
date: Scalars['DateTime'];
id: Scalars['ID'];
meetingNotes?: Maybe<Scalars['String']>;
menteeId: Scalars['ID'];
mentorId: Scalars['ID'];
mentorshipMatchId: Scalars['ID'];
Expand Down Expand Up @@ -194,6 +195,7 @@ export enum ConnectProfileStatus {

export type CreateConMentoringSessionInput = {
date: Scalars['DateTime'];
meetingNotes?: InputMaybe<Scalars['String']>;
menteeId: Scalars['ID'];
mentorshipMatchId: Scalars['ID'];
minuteDuration: MentoringSessionDuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
}

&:not(:last-child) {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ import './Module.scss'
interface Props {
title: string
children: React.ReactNode
toggles?: React.ReactNode
buttons?: React.ReactNode
className?: string
}

function Module(props: Props) {
const { title, children, buttons, className } = props
const { title, children, toggles, buttons, className } = props

return (
<div className={classnames('module', { [`${className}`]: className })}>
<div className="module__header">
<Caption>{title}</Caption>
<div className="module__header__buttons"> {buttons && buttons}</div>
<div className="module__header__buttons">
<div title="Toggle meeting notes"> {toggles && toggles}</div>
<div title="Add new session"> {buttons && buttons}</div>
</div>
</div>
<div className="module__body">{children}</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions libs/shared-types/src/lib/RedMentoringSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export type RedMentoringSession = {
menteeId?: string
date: Date
minuteDuration: MentoringSessionDurationOption
meetingNotes?: string
}
Loading