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

OH2-237 | OH2-235 | OH2-236 | OH2-234 #522

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 @@ -99,7 +99,7 @@ const PatientAdmissionTable: FunctionComponent<IOwnProps> = ({

return (
<div className="patientAdmissionTable">
<h5>{t("common.previousentries")}</h5>
<h5>{t("admission.previousentries")}</h5>
{(() => {
switch (status) {
case "FAIL":
Expand Down
9 changes: 5 additions & 4 deletions src/components/accessories/laboratory/table/ExamTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ import { LabelBadge } from "../../labelBadge/LabelBadge";
import { TActions } from "../../table/types";

export const statusLabel = (status: LaboratoryDTOStatusEnum) => {
status = status.toUpperCase() as LaboratoryDTOStatusEnum;
switch (status) {
case LaboratoryDTOStatusEnum.Deleted:
case LaboratoryDTOStatusEnum.Deleted.toUpperCase():
return <LabelBadge color="danger" label={status} />;
case LaboratoryDTOStatusEnum.Invalid:
case LaboratoryDTOStatusEnum.Invalid.toUpperCase():
return <LabelBadge color="warning" label={status} />;

case LaboratoryDTOStatusEnum.Open:
case LaboratoryDTOStatusEnum.Open.toUpperCase():
return <LabelBadge color="info" label={status} />;

case LaboratoryDTOStatusEnum.Done:
case LaboratoryDTOStatusEnum.Done.toUpperCase():
return <LabelBadge color="success" label={status} />;

default:
Expand Down
33 changes: 16 additions & 17 deletions src/components/accessories/langSwitcher/LangSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,33 @@ import { useTranslation } from "react-i18next";
import availableLanguages from "../../../customization/available-languages.json";
import { isEmpty } from "lodash";

const fallbackLanguages = [
"en",
"it",
"de",
"fr",
"es",
"pt",
"ar",
"sw",
"am",
"cs",
"sq",
"zh",
];
const fallbackLanguages: Record<string, string> = {
en: "English",
it: "Italiano",
de: "Deutsch",
fr: "Français",
es: "Español",
pt: "Português",
ar: "عرب",
sw: "Svenska",
am: "አማርኛ",
cs: "čeština",
sq: "Shqiptar",
zh: "中国人",
};

const LangSwitcher: FunctionComponent = () => {
const currentLang = i18n.language;
const { changeLang } = useContext(LangContext);
const { t } = useTranslation();

const languages = isEmpty(availableLanguages.availableLanguages)
? fallbackLanguages
? Object.keys(fallbackLanguages)
: availableLanguages.availableLanguages;

const renderOptions = (): JSX.Element[] => {
return languages.map((code: string) => (
<option key={code} value={code}>
{t(`languages.${code}`)}
{fallbackLanguages[code]}
</option>
));
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const PatientExamsTable: FunctionComponent<IOwnProps> = ({

return (
<div className="patientExamsTable">
<h5>{t("common.previousentries")}</h5>
<h5>{t("lab.previousentries")}</h5>
{labStatus === "SUCCESS" && (
<Table
rowData={formatDataToDisplay(data)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const PatientOPDTable: FunctionComponent<IOwnProps> = ({

return (
<div className="patientOpdTable">
<h5>{t("common.previousentries")}</h5>
<h5>{t("opd.previousentries")}</h5>
{opdStatus === "SUCCESS" ? (
<Table
rowData={formatDataToDisplay(data)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const PatientOperationRowTable: FunctionComponent<IOwnProps> = ({

return (
<div className="patientOperationTable">
<h5>{t("common.previousentries")}</h5>
<h5>{t("operation.previousentries")}</h5>
{(() => {
switch (status) {
case "FAIL":
Expand Down
Loading
Loading