Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
Browse files Browse the repository at this point in the history
…medicine-administration-ui
  • Loading branch information
amjithtitus09 committed Jan 30, 2025
2 parents 5b662e0 + 50cb157 commit 866b730
Show file tree
Hide file tree
Showing 42 changed files with 1,535 additions and 245 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/label-merge-conflict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe'
runs-on: ubuntu-24.04-arm
steps:
- uses: prince-chrismc/label-merge-conflicts-action@v2
- uses: prince-chrismc/label-merge-conflicts-action@v3
with:
conflict_label_name: "merge conflict"
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
release:
name: Release on Push
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 20 additions & 17 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,8 @@
"enter_year_of_birth_to_verify": "Enter year of birth to verify",
"entered_in_error": "Entered in Error",
"entered_in_error_warning": "This action cannot be undone. The appointment will be marked as entered in error and removed from the system.",
"entity_count_one": "{{count}} {{entity}}",
"entity_count_other": "{{count}} {{entity}}s",
"environment": "Environment",
"error_404": "Error 404",
"error_deleting_shifting": "Error while deleting Shifting record",
Expand Down Expand Up @@ -949,8 +951,11 @@
"external_identifier": "External Identifier",
"facilities": "Facilities",
"facility": "Facility",
"facility_actions_menu": "Facility action menu",
"facility_added_successfully": "Facility created successfully",
"facility_consent_requests_page_title": "Patient Consent List",
"facility_count_one": "{{count}} Facility",
"facility_count_other": "{{count}} Facilities ",
"facility_district_name": "Facility/District Name",
"facility_district_pincode": "Facility/District/Pincode",
"facility_for_care_support": "Facility for Care Support",
Expand Down Expand Up @@ -1291,8 +1296,7 @@
"never_logged_in": "Never Logged In",
"new_password": "New Password",
"new_password_confirmation": "Confirm New Password",
"new_password_different_from_old": "Your new password is different from the old password.",
"new_password_same_as_old": "Your new password must not match the old password.",
"new_password_same_as_old": "Your new password <strong>must not match the old password </strong> ",
"new_password_validation": "New password is not valid.",
"new_session": "New Session",
"next_month": "Next month",
Expand All @@ -1309,6 +1313,7 @@
"no_beds_available": "No beds available",
"no_changes": "No changes",
"no_changes_made": "No changes made",
"no_comments_available": "No comments available",
"no_consultation_filed": "No consultation filed",
"no_consultation_history": "No consultation history available",
"no_consultation_updates": "No consultation updates",
Expand Down Expand Up @@ -1371,6 +1376,7 @@
"no_tests_taken": "No tests taken",
"no_treating_physicians_available": "This facility does not have any home facility doctors. Please contact your admin.",
"no_update_available": "No update available",
"no_updates_found": "No updates found",
"no_user_assigned": "No User Assigned to this patient",
"no_users_found": "No Users Found",
"no_vitals_present": "No Vitals Monitor present in this location or facility",
Expand Down Expand Up @@ -1438,21 +1444,18 @@
"pain_chart_description": "Mark region and intensity of pain",
"passport_number": "Passport Number",
"password": "Password",
"password_length_met": "It's at least 8 characters long",
"password_length_validation": "Use at least 8 characters",
"password_lowercase_met": "It includes at least one lowercase letter",
"password_lowercase_validation": "Include at least one lowercase letter",
"password_length_validation": "Use at least <strong>8 characters</strong>",
"password_lowercase_validation": "Include at least <strong>one lowercase letter</strong> (a-z)",
"password_mismatch": "Passwords do not match",
"password_number_met": "It includes at least one number.",
"password_number_validation": "Include at least one number.",
"password_number_validation": "Include at least <strong>one number</strong> (0-9)",
"password_required": "Password is required",
"password_reset_failure": "Password Reset Failed",
"password_reset_success": "Password Reset successfully",
"password_sent": "Password Reset Email Sent",
"password_success_message": "All set! Your password is strong",
"password_update_error": "Error while updating password. Try again later.",
"password_updated": "Password updated successfully",
"password_uppercase_met": "It includes at least one uppercase letter.",
"password_uppercase_validation": "Include at least one uppercase letter.",
"password_uppercase_validation": "Include at least <strong>one uppercase letter</strong> (A-Z).",
"passwords_match": "Passwords match.",
"patient": "Patient",
"patient-notes": "Notes",
Expand Down Expand Up @@ -2120,8 +2123,6 @@
"use_phone_number_for_emergency": "Use this phone number for emergency contact",
"user_add_error": "Error while adding User",
"user_added_successfully": "User added successfully",
"user_count_one": "{{count}} user",
"user_count_other": "{{count}} users",
"user_delete_error": "Error while deleting User",
"user_deleted_successfully": "User Deleted Successfully",
"user_deleted_successfuly": "User Deleted Successfully",
Expand All @@ -2139,12 +2140,14 @@
"username": "Username",
"username_already_exists": "This username already exists",
"username_available": "Username is available",
"username_characters_validation": "Only lowercase letters, numbers, and . _ - are allowed",
"username_consecutive_validation": "Cannot contain consecutive special characters",
"username_max_length_validation": "Use at most 16 characters",
"username_min_length_validation": "Use at least 4 characters",
"username_characters_validation": "Only <strong>lowercase letters, numbers, and . _ - </strong>are allowed",
"username_consecutive_validation": "Cannot contain <strong>consecutive special characters</strong>",
"username_max_length_validation": "Use at most <strong>16 characters</strong>",
"username_min_length_validation": "Use at least <strong>4 characters</strong>",
"username_not_available": "Username is not available",
"username_start_end_validation": "Must start and end with a letter or number",
"username_not_valid": "username is not valid",
"username_start_end_validation": "Must start and end with a <strong>letter</strong> or <strong>number</strong>",
"username_success_message": "All set! Your username is strong",
"username_userdetails_not_found": "Unable to fetch details as username or user details not found",
"username_valid": "Username is valid",
"users": "Users",
Expand Down
2 changes: 2 additions & 0 deletions src/Routers/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { PlugConfigEdit } from "@/pages/Apps/PlugConfigEdit";
import { PlugConfigList } from "@/pages/Apps/PlugConfigList";
import UserDashboard from "@/pages/UserDashboard";

import LocationRoutes from "./routes/LocationRoutes";
import OrganizationRoutes from "./routes/OrganizationRoutes";
import QuestionnaireRoutes from "./routes/questionnaireRoutes";

Expand Down Expand Up @@ -56,6 +57,7 @@ const Routes: AppRoutes = {
...UserRoutes,
...OrganizationRoutes,
...QuestionnaireRoutes,
...LocationRoutes,

"/session-expired": () => <SessionExpired />,
"/not-found": () => <ErrorPage />,
Expand Down
4 changes: 4 additions & 0 deletions src/Routers/routes/FacilityRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import FacilityUsers from "@/components/Facility/FacilityUsers";
import ResourceCreate from "@/components/Resource/ResourceCreate";

import { AppRoutes } from "@/Routers/AppRouter";
import { SettingsLayout } from "@/pages/Facility/settings/layout";
import FacilityOrganizationIndex from "@/pages/FacilityOrganization/FacilityOrganizationIndex";
import FacilityOrganizationUsers from "@/pages/FacilityOrganization/FacilityOrganizationUsers";
import FacilityOrganizationView from "@/pages/FacilityOrganization/FacilityOrganizationView";
Expand All @@ -30,6 +31,9 @@ const FacilityRoutes: AppRoutes = {
"/facility/:facilityId/organization/:id/users": ({ facilityId, id }) => (
<FacilityOrganizationUsers facilityId={facilityId} id={id} />
),
"/facility/:facilityId/settings/*": ({ facilityId }) => (
<SettingsLayout facilityId={facilityId} />
),
};

export default FacilityRoutes;
14 changes: 14 additions & 0 deletions src/Routers/routes/LocationRoutes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AppRoutes } from "@/Routers/AppRouter";
import LocationList from "@/pages/Location/LocationList";
import LocationView from "@/pages/Location/LocationView";

const LocationRoutes: AppRoutes = {
"/facility/:facilityId/location": ({ facilityId }) => (
<LocationList facilityId={facilityId} />
),
"/facility/:facilityId/location/:id": ({ facilityId, id }) => (
<LocationView facilityId={facilityId} id={id} />
),
};

export default LocationRoutes;
14 changes: 12 additions & 2 deletions src/Routers/routes/PatientRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import FileUploadPage from "@/components/Patient/FileUploadPage";
import { patientTabs } from "@/components/Patient/PatientDetailsTab";
import {
facilityPatientTabs,
patientTabs,
} from "@/components/Patient/PatientDetailsTab";
import { PatientHome } from "@/components/Patient/PatientHome";
import PatientIndex from "@/components/Patient/PatientIndex";
import PatientRegistration from "@/components/Patient/PatientRegistration";
Expand All @@ -19,13 +22,20 @@ const PatientRoutes: AppRoutes = {
<VerifyPatient facilityId={facilityId} />
),
"/patient/:id": ({ id }) => <PatientHome id={id} page="demography" />,
"/patient/:id/update": ({ id }) => <PatientRegistration patientId={id} />,
...patientTabs.reduce((acc: AppRoutes, tab) => {
acc["/patient/:id/" + tab.route] = ({ id }) => (
<PatientHome id={id} page={tab.route} />
);
return acc;
}, {}),
"/facility/:facilityId/patient/create": ({ facilityId }) => (
<PatientRegistration facilityId={facilityId} />
),
"/facility/:facilityId/patient/:id": ({ facilityId, id }) => (
<PatientHome facilityId={facilityId} id={id} page="demography" />
),
...patientTabs.reduce((acc: AppRoutes, tab) => {
...facilityPatientTabs.reduce((acc: AppRoutes, tab) => {
acc["/facility/:facilityId/patient/:id/" + tab.route] = ({
facilityId,
id,
Expand Down
74 changes: 31 additions & 43 deletions src/components/Auth/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { PasswordInput } from "@/components/ui/input-password";

import { validateRule } from "@/components/Users/UserFormValidations";
import { ValidationHelper } from "@/components/Users/UserFormValidations";

import { LocalStorageKeys } from "@/common/constants";
import { validatePassword } from "@/common/validation";
Expand All @@ -27,9 +27,7 @@ const ResetPassword = (props: ResetPasswordProps) => {
const initErr: any = {};
const [form, setForm] = useState(initForm);
const [errors, setErrors] = useState(initErr);
const [passwordInputInFocus, setPasswordInputInFocus] = useState(false);
const [confirmPasswordInputInFocus, setConfirmPasswordInputInFocus] =
useState(false);
const [isPasswordFieldFocused, setIsPasswordFieldFocused] = useState(false);

const { t } = useTranslation();
const handleChange = (e: any) => {
Expand Down Expand Up @@ -124,40 +122,41 @@ const ResetPassword = (props: ResetPasswordProps) => {
name="password"
placeholder={t("new_password")}
onChange={handleChange}
onFocus={() => setPasswordInputInFocus(true)}
onBlur={() => setPasswordInputInFocus(false)}
onFocus={() => setIsPasswordFieldFocused(true)}
onBlur={() => setIsPasswordFieldFocused(false)}
/>
{errors.password && (
<div className="mt-1 text-red-500 text-xs" data-input-error>
{errors.password}
</div>
)}
{passwordInputInFocus && (
<div className="text-sm mt-2 pl-2 text-secondary-500">
{validateRule(
form.password?.length >= 8,
t("password_length_validation"),
!form.password,
t("password_length_met"),
)}
{validateRule(
form.password !== form.password.toUpperCase(),
t("password_lowercase_validation"),
!form.password,
t("password_lowercase_met"),
)}
{validateRule(
form.password !== form.password.toLowerCase(),
t("password_uppercase_validation"),
!form.password,
t("password_uppercase_met"),
)}
{validateRule(
/\d/.test(form.password),
t("password_number_validation"),
!form.password,
t("password_number_met"),
)}
{isPasswordFieldFocused && (
<div
className="text-small mt-2 pl-2 text-secondary-500"
aria-live="polite"
>
<ValidationHelper
isInputEmpty={!form.password}
successMessage={t("password_success_message")}
validations={[
{
description: "password_length_validation",
fulfilled: form.password?.length >= 8,
},
{
description: "password_lowercase_validation",
fulfilled: /[a-z]/.test(form.password),
},
{
description: "password_uppercase_validation",
fulfilled: /[A-Z]/.test(form.password),
},
{
description: "password_number_validation",
fulfilled: /\d/.test(form.password),
},
]}
/>
</div>
)}
</div>
Expand All @@ -167,23 +166,12 @@ const ResetPassword = (props: ResetPasswordProps) => {
name="confirm"
placeholder={t("confirm_password")}
onChange={handleChange}
onFocus={() => setConfirmPasswordInputInFocus(true)}
onBlur={() => setConfirmPasswordInputInFocus(false)}
/>
{errors.confirm && (
<div className="mt-1 text-red-500 text-xs" data-input-error>
{errors.confirm}
</div>
)}
{confirmPasswordInputInFocus &&
form.confirm.length > 0 &&
form.password.length > 0 &&
validateRule(
form.confirm === form.password,
t("password_mismatch"),
!form.password && form.password.length > 0,
t("password_match"),
)}
</div>
</div>

Expand Down
Loading

0 comments on commit 866b730

Please sign in to comment.