Skip to content
Merged
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 @@ -40,14 +40,15 @@ type Props = OwnProps & WithStyles<typeof styles>;

const WithoutOrgUnitSelectedMessagePlain = ({ programId, setShowAccessible, classes }: Props) => {
const { program, programType } = useProgramInfo(programId);
const programName = program?.name;
const IncompleteSelectionMessage = useMemo(() => (programType === programTypes.TRACKER_PROGRAM ? (
i18n.t('Or see all records accessible to you in {{program}} ', {
program: program?.name,
program: programName,
interpolation: { escapeValue: false },
})
) : i18n.t('Or see all events accessible to you in {{program}}',
{ program: program?.name, interpolation: { escapeValue: false } })),
[program?.name, programType]);
{ program: programName, interpolation: { escapeValue: false } })),
[programName, programType]);

return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const EventDetailsSectionPlain = (props: PlainProps & { classes: any }) => {
const { isWithinValidPeriod } = isValidPeriod(occurredAtClient, expiryPeriod ?? null);
const isDisabled = !eventAccess.write || !isWithinValidPeriod;

const occurredAtValue = eventData?.dataEntryValues?.occurredAt;
const tooltipContent = useMemo(() => {
if (!eventAccess.write) {
return i18n.t("You don't have access to edit this event");
Expand All @@ -102,7 +103,7 @@ const EventDetailsSectionPlain = (props: PlainProps & { classes: any }) => {
return i18n.t(
'{{occurredAt}} belongs to an expired period. Event cannot be edited',
{
occurredAt: eventData?.dataEntryValues?.occurredAt,
occurredAt: occurredAtValue,
interpolation: { escapeValue: false },
},
);
Expand All @@ -111,7 +112,7 @@ const EventDetailsSectionPlain = (props: PlainProps & { classes: any }) => {
}, [
eventAccess.write,
isWithinValidPeriod,
eventData?.dataEntryValues?.occurredAt,
occurredAtValue,
]);

if (error) {
Expand Down
Loading