Skip to content

Commit

Permalink
Change AccountID->ParticipantID, StudyProtocol->Protocol version, Inf…
Browse files Browse the repository at this point in the history
…ormedConsent->ConsentDocument
  • Loading branch information
jakdan99 committed Nov 27, 2024
1 parent 6c4096e commit 750c6d3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source.fixAll.eslint": "explicit"
},
"i18n-ally.localesPaths": [
"src/locales"
"src/public/locales",
],
"i18n-ally.keystyle": "nested",
}
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ i18n
supportedLngs: ["en", "da"],
lng: "en",
fallbackLng: "en",
ns: ["common", "error", "deployment"],
ns: ["common", "error", "deployment", "participant"],
backend: {
loadPath: "/locales/{{lng}}/{{ns}}.json",
},
Expand Down
18 changes: 13 additions & 5 deletions src/pages/Participant/BasicInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import NotificationsIcon from "@mui/icons-material/NotificationsSharp";

import { getUser } from "@carp-dk/authentication-react";
import { useStudyDetails } from "@Utils/queries/studies";
import { useTranslation } from "react-i18next";
import {
AccountIcon,
Email,
Expand All @@ -26,6 +27,7 @@ import {
import LoadingSkeleton from "../LoadingSkeleton";

const BasicInfo = () => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const { participantId, deploymentId, id: studyId } = useParams();

Expand Down Expand Up @@ -109,13 +111,19 @@ const BasicInfo = () => {
{name}
<Email variant="h6">{participant.email}</Email>
<StyledDivider />
{!isGeneratedAccount && <RemindersContainer onClick={() => setOpen(true)}>
<ReminderText variant="h6">Send a reminder</ReminderText>
<NotificationsIcon fontSize="small" color="primary" />
</RemindersContainer>}
{!isGeneratedAccount && (
<RemindersContainer onClick={() => setOpen(true)}>
<ReminderText variant="h6">
{t("participant:basic_info.send_reminder")}
</ReminderText>
<NotificationsIcon fontSize="small" color="primary" />
</RemindersContainer>
)}
</Left>
<Right>
<SecondaryText variant="h5">Account ID: {participantId}</SecondaryText>
<SecondaryText variant="h5">
{t("common:participant_id", { participantId })}
</SecondaryText>
<CopyButton textToCopy={participantId} idType="Account" />
</Right>
<SendReminderModal
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Protocol/ProtocolInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ProtocolInfo = () => {
</AddVersionButton>
<VersionContainer>
<ProtocolVersion variant="h4">
Study protocol v{protocol.versionTag}
Current version: {protocol.versionTag}
</ProtocolVersion>
<Typography variant="h6">
Update the Protocol data by adding a new version
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Resources/AddResourceModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {
}

const resourceTypes = {
"Informed Consent": "informed_consent",
"Consent Document": "informed_consent",
};

const validationSchema = yup.object({
Expand Down
3 changes: 2 additions & 1 deletion src/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"deploy": "Deploy",
"last_data_zero": "Last data: Today",
"last_data_one": "Last data: {{count}} day ago",
"last_data_other": "Last data: {{count}} days ago"
"last_data_other": "Last data: {{count}} days ago",
"participant_id": "Participant ID: {{participantId}}"
}
5 changes: 5 additions & 0 deletions src/public/locales/en/participant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"basic_info": {
"send_reminder": "Send a reminder"
}
}

0 comments on commit 750c6d3

Please sign in to comment.