diff --git a/public/locale/en.json b/public/locale/en.json index 173ccd84b65..592e70c64cc 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -912,6 +912,7 @@ "enter_phone_number_to_login_register": "Enter phone number to login/register", "enter_tag_name": "Enter tag name", "enter_tag_slug": "Enter tag slug", + "enter_the_file_name": "Enter the file name", "enter_the_verification_code": "Enter the verification code sent to your phone", "enter_valid_age": "Please Enter Valid Age", "enter_valid_dob": "Enter a valid date of birth", @@ -1557,7 +1558,9 @@ "please_assign_bed_to_patient": "Please assign a bed to this patient", "please_check_your_messages": "Please check your messages", "please_confirm_password": "Please confirm your new password.", + "please_enter_a_name": "Please enter a name!", "please_enter_a_reason_for_the_shift": "Please enter a reason for the shift.", + "please_enter_a_valid_reason": "Please enter a valid reason!", "please_enter_confirm_password": "Please confirm your new password", "please_enter_correct_birth_year": "Please enter the correct birth year to verify the patient details.", "please_enter_current_password": "Please enter your current password.", @@ -1696,6 +1699,7 @@ "remove_user_organization": "Remove User from Organization", "remove_user_warn": "Are you sure you want to remove {{firstName}} {{lastName}} from this organization? This action cannot be undone.", "rename": "Rename", + "rename_file": "Rename File", "replace_home_facility": "Replace Home Facility", "replace_home_facility_confirm": "Are you sure you want to replace", "replace_home_facility_confirm_as": "as home facility for user", @@ -2014,6 +2018,8 @@ "thank_you_for_choosing": "Thank you for choosing our care service", "the_request_for_resources_placed_by_yourself_is": "The request for resource (details below) placed by yourself is", "third_party_software_licenses": "Third Party Software Licenses", + "this_action_is_irreversible": "This action is irreversible. Once a file is archived it cannot be unarchived.", + "this_file_has_been_archived": "This file has been archived and cannot be unarchived.", "time": "Time", "time_slot": "Time Slot", "title": "Title", diff --git a/src/components/Files/FileUpload.tsx b/src/components/Files/FileUpload.tsx index 56017294f52..3a63a601543 100644 --- a/src/components/Files/FileUpload.tsx +++ b/src/components/Files/FileUpload.tsx @@ -5,11 +5,12 @@ import { useTranslation } from "react-i18next"; import CareIcon, { IconName } from "@/CAREUI/icons/CareIcon"; import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; import Pagination from "@/components/Common/Pagination"; import Tabs from "@/components/Common/Tabs"; import FileBlock from "@/components/Files/FileBlock"; -import TextFormField from "@/components/Form/FormFields/TextFormField"; import { FileUploadModel } from "@/components/Patient/models"; import useAuthUser from "@/hooks/useAuthUser"; @@ -276,17 +277,19 @@ export const FileUpload = (props: FileUploadProps) => { - {t("enter_file_name")} + fileUpload.setFileName(e.value)} - error={fileUpload.error || undefined} + onChange={(e) => fileUpload.setFileName(e.target.value)} /> + {fileUpload.error && ( +

{fileUpload.error}

+ )}
@@ -348,7 +347,7 @@ export default function useFileManager( >
- This file has been archived and cannot be unarchived. + {t("this_file_has_been_archived")}
{[ @@ -425,7 +424,7 @@ export default function useFileManager( />
-

Rename File

+

{t("rename_file")}

} @@ -440,16 +439,19 @@ export default function useFileManager( className="flex w-full flex-col" >
- {t("enter_the_file_name")} + { - setEditDialogueOpen({ ...editDialogueOpen, name: e.value }); + setEditDialogueOpen({ + ...editDialogueOpen, + name: e.target.value, + }); }} - error={editError} /> + {editError &&

{editError}

}