diff --git a/src/Components/Shifting/CommentsSection.tsx b/src/Components/Shifting/CommentsSection.tsx index 767ab402265..1fb3976a0a7 100644 --- a/src/Components/Shifting/CommentsSection.tsx +++ b/src/Components/Shifting/CommentsSection.tsx @@ -89,13 +89,35 @@ export const Comment = ({ modified_date, }: IComment) => { const { t } = useTranslation(); + const [expanded, setExpanded] = useState(false); + const toggleExpanded = () => { + setExpanded(!expanded); + }; + const truncatedComment = comment.split(" ").slice(0, 20).join(" "); + const remainingComment = comment.split(" ").slice(20).join(" "); + return (
-

{comment}

+

+ {expanded ? comment : truncatedComment} + {!expanded && remainingComment && ( + + )} + {expanded && remainingComment && ( + + )} +

diff --git a/src/Components/Shifting/ShiftDetails.tsx b/src/Components/Shifting/ShiftDetails.tsx index acc3565487a..981d96d6fd3 100644 --- a/src/Components/Shifting/ShiftDetails.tsx +++ b/src/Components/Shifting/ShiftDetails.tsx @@ -281,7 +281,7 @@ export default function ShiftDetails(props: { id: string }) { const showFacilityCard = (facilityData: any) => { return ( -
+
{t("name")}:{" "} @@ -796,10 +796,6 @@ export default function ShiftDetails(props: { id: string }) { {showPatientCard(data?.patient_object)}
-
-

{t("comments")}

- -
@@ -838,12 +834,12 @@ export default function ShiftDetails(props: { id: string }) { {showFacilityCard(data?.origin_facility_object)}
- {!data?.assigned_facility_external && ( + {/* {!data?.assigned_facility_external && (

{t("details_of_assigned_facility")}

{showFacilityCard(data?.assigned_facility_object)}
- )} + )} */} {wartime_shifting && (

@@ -853,6 +849,28 @@ export default function ShiftDetails(props: { id: string }) {

)}
+
+
+ {!data?.assigned_facility_external && ( +
+

+ {t("details_of_assigned_facility")} +

+ {showFacilityCard(data?.assigned_facility_object)} +
+ )} +
+
+
+
+
+

{t("comments")}

+ +
)} diff --git a/src/Components/Users/models.tsx b/src/Components/Users/models.tsx index c31901b74ad..6908671edbe 100644 --- a/src/Components/Users/models.tsx +++ b/src/Components/Users/models.tsx @@ -45,7 +45,6 @@ export type UserModel = UserBareMinimum & { doctor_medical_council_registration?: string; weekly_working_hours?: string | null; }; - export interface SkillObjectModel { id: string; name: string; diff --git a/src/Locale/en/Shifting.json b/src/Locale/en/Shifting.json index 0fc177281d5..e8204f9e5f3 100644 --- a/src/Locale/en/Shifting.json +++ b/src/Locale/en/Shifting.json @@ -82,5 +82,7 @@ "transfer_in_progress": "TRANSFER IN PROGRESS", "patient_state": "Patient State", "yet_to_be_decided": "Yet to be decided", - "awaiting_destination_approval": "AWAITING DESTINATION APPROVAL" + "awaiting_destination_approval": "AWAITING DESTINATION APPROVAL", + "read_more": "Read More", + "read_less": "Read Less" } diff --git a/src/Locale/kn/Shifting.json b/src/Locale/kn/Shifting.json new file mode 100644 index 00000000000..c64b6c8d48b --- /dev/null +++ b/src/Locale/kn/Shifting.json @@ -0,0 +1,4 @@ +{ + "read_more": "ಇನ್ನಷ್ಟು ಓದಿ", + "read_less": "ಇನ್ನಷ್ಟು ಓದಬೇಕಿಲ್ಲ" +} diff --git a/src/Locale/kn/index.js b/src/Locale/kn/index.js index cbf1d10c3b9..33233506284 100644 --- a/src/Locale/kn/index.js +++ b/src/Locale/kn/index.js @@ -2,10 +2,12 @@ import Auth from "./Auth.json"; import Common from "./Common.json"; import Entities from "./Entities.json"; import Facility from "./Facility.json"; +import Shifting from "./Shifting.json"; export default { ...Auth, ...Common, ...Entities, ...Facility, + ...Shifting, }; diff --git a/src/Locale/ml/Shifing.json b/src/Locale/ml/Shifing.json new file mode 100644 index 00000000000..4783b471e62 --- /dev/null +++ b/src/Locale/ml/Shifing.json @@ -0,0 +1,4 @@ +{ + "read_more": "കൂടുതൽ വായിക്കുക", + "read_less": "കുറഞ്ഞത് വായിക്കുക" +} diff --git a/src/Locale/ml/index.js b/src/Locale/ml/index.js index cbf1d10c3b9..44103bab5fa 100644 --- a/src/Locale/ml/index.js +++ b/src/Locale/ml/index.js @@ -2,10 +2,12 @@ import Auth from "./Auth.json"; import Common from "./Common.json"; import Entities from "./Entities.json"; import Facility from "./Facility.json"; +import Shifting from "./Shifing.json"; export default { ...Auth, ...Common, ...Entities, ...Facility, + ...Shifting, }; diff --git a/src/Locale/mr/Shifting.json b/src/Locale/mr/Shifting.json new file mode 100644 index 00000000000..ef9054de254 --- /dev/null +++ b/src/Locale/mr/Shifting.json @@ -0,0 +1,4 @@ +{ + "read_more": "अधिक वाचा", + "read_less": "कमी वाचा" +} diff --git a/src/Locale/mr/index.js b/src/Locale/mr/index.js index cbf1d10c3b9..33233506284 100644 --- a/src/Locale/mr/index.js +++ b/src/Locale/mr/index.js @@ -2,10 +2,12 @@ import Auth from "./Auth.json"; import Common from "./Common.json"; import Entities from "./Entities.json"; import Facility from "./Facility.json"; +import Shifting from "./Shifting.json"; export default { ...Auth, ...Common, ...Entities, ...Facility, + ...Shifting, }; diff --git a/src/Locale/ta/Shifting.json b/src/Locale/ta/Shifting.json new file mode 100644 index 00000000000..90a80c8705d --- /dev/null +++ b/src/Locale/ta/Shifting.json @@ -0,0 +1,4 @@ +{ + "read_more": "மேலும் படிக்க", + "read_less": "குறைந்தது படிக்க" +} diff --git a/src/Locale/ta/index.js b/src/Locale/ta/index.js index cbf1d10c3b9..33233506284 100644 --- a/src/Locale/ta/index.js +++ b/src/Locale/ta/index.js @@ -2,10 +2,12 @@ import Auth from "./Auth.json"; import Common from "./Common.json"; import Entities from "./Entities.json"; import Facility from "./Facility.json"; +import Shifting from "./Shifting.json"; export default { ...Auth, ...Common, ...Entities, ...Facility, + ...Shifting, };