Loading .yarnrc.yml +3 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,9 @@ packageExtensions: '@babel/core': 7.26.0 graphql: 16.10.0 graphql-tag: 2.12.6 '@react-pdf/pdfkit@*': dependencies: 'pako': '*' supportedArchitectures: cpu: Loading analyst/src/components/ActionLog/index.tsx +28 −18 Original line number Diff line number Diff line Loading @@ -38,18 +38,17 @@ const getIcon = (logType: ActionLogFragment['type']) => { case 'INJECT': case 'CUSTOM_INJECT': case 'TOOL': case 'FORM_SUBMISSION': case 'FORM': return ( <Icon icon='full-circle' color={actionTypeColor(logType.toString())} /> ) case 'EMAIL': return <Icon icon='envelope' /> default: throw new Error(`unknown actionLog type: ${logType}`) } } const getContent = (actionLog: ActionLogFragment) => { const getContent = (actionLog: ActionLogFragment): string => { switch (actionLog.details.__typename) { case 'InjectDetailsType': return textFromRenderedContent(actionLog.details.content.rendered) Loading @@ -67,8 +66,10 @@ const getContent = (actionLog: ActionLogFragment) => { .join(', ') return `${senderAddress} → ${recipients}: ${textFromRenderedContent(actionLog.details.content.rendered)}` } default: throw new Error(`unknown actionLog type`) case 'QuestionnaireSubmissionType': { const { teamQuestionnaireState } = actionLog.details return `${teamQuestionnaireState.questionnaire.displayName} submitted by ${teamQuestionnaireState.team.name}` } } } Loading @@ -78,6 +79,7 @@ type ActionLogItem = { text: string timestamp: string | null handleClick: () => void teamId: string } interface ActionLogProps { Loading @@ -98,11 +100,10 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { case 'CUSTOM_INJECT': case 'TOOL': case 'FORM': case 'FORM_SUBMISSION': return selectedDispatch({ type: 'selectActions', actionLog }) case 'EMAIL': return selectedDispatch({ type: 'selectEmails', actionLog }) default: throw new Error(`unknown actionLog type: ${actionLog.type}`) } }, [selectedDispatch] Loading @@ -124,6 +125,7 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { text: getContent(actionLog), timestamp: actionLog.timestamp, handleClick: getHandleClick(actionLog), teamId: actionLog.team.id, })) milestoneStates Loading @@ -132,8 +134,9 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { milestoneState.reached && milestoneState.timestampReached ) .forEach(milestoneState => milestoneState.teamIds.forEach(teamId => items.push({ id: `milestone:${milestoneState.id}`, id: `milestone:${milestoneState.id}-actionlog`, icon: <Icon icon='flag' />, text: `milestone "${milestoneState.milestone.displayName}" reached, ` + Loading @@ -141,8 +144,10 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { timestamp: milestoneState.timestampReached, handleClick: () => selectedDispatch({ type: 'selectMilestones', milestoneState }), teamId, }) ) ) return items.sort( (a, b) => Loading Loading @@ -184,7 +189,12 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { textAlign: 'center', }} > <StyledTag content={formatTimestamp(item.timestamp)} /> <StyledTag content={formatTimestamp({ timestamp: item.timestamp, teamId: item.teamId, })} /> </td> <td className={td}>{item.text}</td> </tr> Loading analyst/src/components/ExerciseSelector/index.tsx +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ export const ExerciseSelector: FC<ExerciseSelectorProps> = ({ title='Select an exercise' > <DialogBody className={dialogBody}> {/* TODO: add loading to the Select button when switching exercises */} <ExerciseList className={className} isSelected={isSelected} Loading analyst/src/components/MilestoneTable/index.tsx +2 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ export const MilestoneTable = () => { milestones.map((_milestone, i) => i < 5) ) const [isTimeRelative, setIsTimeRelative] = useState(false) const [isTimeRelative, setIsTimeRelative] = useState(true) const milestoneFirstReachedTime: { [milestoneId: string]: number } = {} Loading Loading @@ -76,7 +76,7 @@ export const MilestoneTable = () => { const value = state && state.reached ? state.timestampReached : null if (value === null) return 'not reached' return formatTimestamp(value) return formatTimestamp({ timestamp: value, teamId: team.id }) }, sortingFunction: (a: Team, b: Team) => { const stateA = milestoneStates Loading analyst/src/components/Milestones/MilestoneCard.tsx +6 −1 Original line number Diff line number Diff line Loading @@ -20,12 +20,14 @@ interface MilestoneCardProps { isSelected?: boolean milestoneState: MilestoneState selectedDispatch: Dispatch<selectedReducerActionProps> teamId: string } const MilestoneCard: FC<MilestoneCardProps> = ({ isSelected, milestoneState, selectedDispatch, teamId, }) => { const formatTimestamp = useFormatTimestamp() Loading Loading @@ -55,7 +57,10 @@ const MilestoneCard: FC<MilestoneCardProps> = ({ content={ milestoneState.reached ? milestoneState.timestampReached ? formatTimestamp(milestoneState.timestampReached) ? formatTimestamp({ timestamp: milestoneState.timestampReached, teamId, }) : 'Initial' : 'Not reached' } Loading Loading
.yarnrc.yml +3 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,9 @@ packageExtensions: '@babel/core': 7.26.0 graphql: 16.10.0 graphql-tag: 2.12.6 '@react-pdf/pdfkit@*': dependencies: 'pako': '*' supportedArchitectures: cpu: Loading
analyst/src/components/ActionLog/index.tsx +28 −18 Original line number Diff line number Diff line Loading @@ -38,18 +38,17 @@ const getIcon = (logType: ActionLogFragment['type']) => { case 'INJECT': case 'CUSTOM_INJECT': case 'TOOL': case 'FORM_SUBMISSION': case 'FORM': return ( <Icon icon='full-circle' color={actionTypeColor(logType.toString())} /> ) case 'EMAIL': return <Icon icon='envelope' /> default: throw new Error(`unknown actionLog type: ${logType}`) } } const getContent = (actionLog: ActionLogFragment) => { const getContent = (actionLog: ActionLogFragment): string => { switch (actionLog.details.__typename) { case 'InjectDetailsType': return textFromRenderedContent(actionLog.details.content.rendered) Loading @@ -67,8 +66,10 @@ const getContent = (actionLog: ActionLogFragment) => { .join(', ') return `${senderAddress} → ${recipients}: ${textFromRenderedContent(actionLog.details.content.rendered)}` } default: throw new Error(`unknown actionLog type`) case 'QuestionnaireSubmissionType': { const { teamQuestionnaireState } = actionLog.details return `${teamQuestionnaireState.questionnaire.displayName} submitted by ${teamQuestionnaireState.team.name}` } } } Loading @@ -78,6 +79,7 @@ type ActionLogItem = { text: string timestamp: string | null handleClick: () => void teamId: string } interface ActionLogProps { Loading @@ -98,11 +100,10 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { case 'CUSTOM_INJECT': case 'TOOL': case 'FORM': case 'FORM_SUBMISSION': return selectedDispatch({ type: 'selectActions', actionLog }) case 'EMAIL': return selectedDispatch({ type: 'selectEmails', actionLog }) default: throw new Error(`unknown actionLog type: ${actionLog.type}`) } }, [selectedDispatch] Loading @@ -124,6 +125,7 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { text: getContent(actionLog), timestamp: actionLog.timestamp, handleClick: getHandleClick(actionLog), teamId: actionLog.team.id, })) milestoneStates Loading @@ -132,8 +134,9 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { milestoneState.reached && milestoneState.timestampReached ) .forEach(milestoneState => milestoneState.teamIds.forEach(teamId => items.push({ id: `milestone:${milestoneState.id}`, id: `milestone:${milestoneState.id}-actionlog`, icon: <Icon icon='flag' />, text: `milestone "${milestoneState.milestone.displayName}" reached, ` + Loading @@ -141,8 +144,10 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { timestamp: milestoneState.timestampReached, handleClick: () => selectedDispatch({ type: 'selectMilestones', milestoneState }), teamId, }) ) ) return items.sort( (a, b) => Loading Loading @@ -184,7 +189,12 @@ export const ActionLog: FC<ActionLogProps> = ({ selectedDispatch }) => { textAlign: 'center', }} > <StyledTag content={formatTimestamp(item.timestamp)} /> <StyledTag content={formatTimestamp({ timestamp: item.timestamp, teamId: item.teamId, })} /> </td> <td className={td}>{item.text}</td> </tr> Loading
analyst/src/components/ExerciseSelector/index.tsx +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ export const ExerciseSelector: FC<ExerciseSelectorProps> = ({ title='Select an exercise' > <DialogBody className={dialogBody}> {/* TODO: add loading to the Select button when switching exercises */} <ExerciseList className={className} isSelected={isSelected} Loading
analyst/src/components/MilestoneTable/index.tsx +2 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ export const MilestoneTable = () => { milestones.map((_milestone, i) => i < 5) ) const [isTimeRelative, setIsTimeRelative] = useState(false) const [isTimeRelative, setIsTimeRelative] = useState(true) const milestoneFirstReachedTime: { [milestoneId: string]: number } = {} Loading Loading @@ -76,7 +76,7 @@ export const MilestoneTable = () => { const value = state && state.reached ? state.timestampReached : null if (value === null) return 'not reached' return formatTimestamp(value) return formatTimestamp({ timestamp: value, teamId: team.id }) }, sortingFunction: (a: Team, b: Team) => { const stateA = milestoneStates Loading
analyst/src/components/Milestones/MilestoneCard.tsx +6 −1 Original line number Diff line number Diff line Loading @@ -20,12 +20,14 @@ interface MilestoneCardProps { isSelected?: boolean milestoneState: MilestoneState selectedDispatch: Dispatch<selectedReducerActionProps> teamId: string } const MilestoneCard: FC<MilestoneCardProps> = ({ isSelected, milestoneState, selectedDispatch, teamId, }) => { const formatTimestamp = useFormatTimestamp() Loading Loading @@ -55,7 +57,10 @@ const MilestoneCard: FC<MilestoneCardProps> = ({ content={ milestoneState.reached ? milestoneState.timestampReached ? formatTimestamp(milestoneState.timestampReached) ? formatTimestamp({ timestamp: milestoneState.timestampReached, teamId, }) : 'Initial' : 'Not reached' } Loading