Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPDX-8358 Use API translations for Task Activity and Display Result #1192

Merged
merged 7 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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 @@ -72,7 +72,7 @@ describe('LevelOfEffort', () => {

const initiationSocialMediaRow = rows[6];
expect(initiationSocialMediaRow.children[0]).toHaveTextContent(
'Social Media',
'Social Media Message',
);
expect(initiationSocialMediaRow.children[1]).toHaveTextContent('34');
expect(initiationSocialMediaRow.children[2]).toHaveTextContent('14');
Expand All @@ -96,7 +96,7 @@ describe('LevelOfEffort', () => {
expect(followUpTextRow.children[5]).toHaveTextContent('18');

const thankRow = rows[21];
expect(thankRow.children[0]).toHaveTextContent('Thank You Note');
expect(thankRow.children[0]).toHaveTextContent('Thank');
expect(thankRow.children[1]).toHaveTextContent('33');
expect(thankRow.children[2]).toHaveTextContent('13');
expect(thankRow.children[3]).toHaveTextContent('3');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { PhaseEnum } from 'src/graphql/types.generated';
import { useLocale } from 'src/hooks/useLocale';
import { usePhaseData } from 'src/hooks/usePhaseData';
import { snakeToCamel } from 'src/lib/snakeToCamel';
import { getLocalizedTaskType } from 'src/utils/functions/getLocalizedTaskType';
import { MultilineSkeleton } from '../../../Shared/MultilineSkeleton';
import { CoachingPeriodEnum } from '../CoachingDetail';
import { AlignedTableCell, DividerRow, HeaderRow } from '../StyledComponents';
Expand All @@ -40,7 +39,7 @@ export const LevelOfEffort: React.FC<LevelOfEffortProps> = ({
}) => {
const { t } = useTranslation();
const locale = useLocale();
const { activitiesByPhase } = usePhaseData();
const { activitiesByPhase, activityTypes } = usePhaseData();

const { data, loading } = useLevelOfEffortQuery({
variables: {
Expand Down Expand Up @@ -181,7 +180,7 @@ export const LevelOfEffort: React.FC<LevelOfEffortProps> = ({
'number' ? (
<TableRow>
<AlignedTableCell>
{getLocalizedTaskType(t, activity)}
{activityTypes.get(activity)?.translatedShortName}
</AlignedTableCell>
{periods.map((period) => (
<AlignedTableCell key={period?.startDate}>
Expand Down Expand Up @@ -220,7 +219,7 @@ export const LevelOfEffort: React.FC<LevelOfEffortProps> = ({
'number' ? (
<TableRow>
<AlignedTableCell>
{getLocalizedTaskType(t, activity)}
{activityTypes.get(activity)?.translatedShortName}
</AlignedTableCell>
{periods.map((period) => (
<AlignedTableCell key={period?.startDate}>
Expand Down Expand Up @@ -254,7 +253,7 @@ export const LevelOfEffort: React.FC<LevelOfEffortProps> = ({
return typeof averages[activityVariableName] === 'number' ? (
<TableRow>
<AlignedTableCell>
{getLocalizedTaskType(t, activity)}
{activityTypes.get(activity)?.translatedShortName}
</AlignedTableCell>
{periods.map((period) => (
<AlignedTableCell key={period?.startDate}>
Expand Down Expand Up @@ -293,7 +292,7 @@ export const LevelOfEffort: React.FC<LevelOfEffortProps> = ({
'number' ? (
<TableRow>
<AlignedTableCell>
{getLocalizedTaskType(t, activity)}
{activityTypes.get(activity)?.translatedShortName}
</AlignedTableCell>
{periods.map((period) => (
<AlignedTableCell key={period?.startDate}>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Constants/LoadConstants.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ query LoadConstants {
id
value
name
action
}
displayResults {
id
value
}
languages {
id
Expand Down Expand Up @@ -73,6 +78,7 @@ query LoadConstants {
result
}
name
value
suggestedContactStatus
suggestedNextActions
}
Expand Down
Loading
Loading