Skip to content

Commit

Permalink
Rename all instances of orgin_facility to origin_facility
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Jun 20, 2023
1 parent 66a14c0 commit 6e01288
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/resource_spec/filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Resource filter", () => {

it("filter by origin facility", () => {
cy.intercept(/\/api\/v1\/getallfacilities/).as("facilities_filter");
cy.get("[name='orgin_facility']")
cy.get("[name='origin_facility']")
.type("Dummy Facility 1")
.wait("@facilities_filter");
cy.get("[role='option']").first().click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/shifting_spec/filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Shifting section filter", () => {

it("filter by origin facility", () => {
cy.intercept(/\/api\/v1\/getallfacilities/).as("facilities_filter");
cy.get("[name='orgin_facility']")
cy.get("[name='origin_facility']")
.type("Dummy Facility 1")
.wait("@facilities_filter");
cy.get("[role='option']").first().click();
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ export const PatientHome = (props: any) => {
>
<CareIcon className="care-l-plane-fly mr-2 text-lg" />
<dd className="font-bold text-sm leading-5 text-gray-900">
{(shift.orgin_facility_object || {})?.name}
{(shift.origin_facility_object || {})?.name}
</dd>
</dt>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/ShiftCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const ShiftCreate = (props: patientShiftProps) => {

const data = {
status: wartime_shifting ? "PENDING" : "APPROVED",
orgin_facility: props.facilityId,
origin_facility: props.facilityId,
shifting_approving_facility: (
state.form.shifting_approving_facility || {}
).id,
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Resource/BadgesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default function BadgesList(props: any) {

useEffect(() => {
async function fetchData() {
if (!appliedFilters.orgin_facility) return setOrginFacilityName("");
if (!appliedFilters.origin_facility) return setOrginFacilityName("");
const res = await dispatch(
getAnyFacility(appliedFilters.orgin_facility, "orgin_facility")
getAnyFacility(appliedFilters.origin_facility, "origin_facility")
);
setOrginFacilityName(res?.data?.name);
}
fetchData();
}, [dispatch, appliedFilters.orgin_facility]);
}, [dispatch, appliedFilters.origin_facility]);

useEffect(() => {
async function fetchData() {
Expand Down Expand Up @@ -69,7 +69,7 @@ export default function BadgesList(props: any) {
}),
...dateRange("Modified", "modified_date"),
...dateRange("Created", "created_date"),
value("Origin facility", "orgin_facility", orginFacilityName),
value("Origin facility", "origin_facility", orginFacilityName),
value(
"Approving facility",
"approving_facility",
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Resource/Commons.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const initialFilterData = {
status: "--",
facility: "",
orgin_facility: "",
origin_facility: "",
approving_facility: "",
assigned_facility: "",
emergency: "--",
Expand All @@ -19,7 +19,7 @@ export const formatFilter = (params: any) => {
return {
status: filter.status === "--" ? null : filter.status,
facility: "",
orgin_facility: filter.orgin_facility || undefined,
origin_facility: filter.origin_facility || undefined,
approving_facility: filter.approving_facility || undefined,
assigned_facility: filter.assigned_facility || undefined,
emergency:
Expand Down
24 changes: 12 additions & 12 deletions src/Components/Resource/ListFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { FieldLabel } from "../Form/FormFields/FormField";
const resourceStatusOptions = RESOURCE_CHOICES.map((obj) => obj.text);

const clearFilterState = {
orgin_facility: "",
orgin_facility_ref: "",
origin_facility: "",
origin_facility_ref: "",
approving_facility: "",
approving_facility_ref: "",
assigned_facility: "",
Expand All @@ -36,8 +36,8 @@ export default function ListFilter(props: any) {
const [isResourceLoading, setResourceLoading] = useState(false);
const [isAssignedLoading, setAssignedLoading] = useState(false);
const [filterState, setFilterState] = useMergeState({
orgin_facility: filter.orgin_facility || "",
orgin_facility_ref: null,
origin_facility: filter.origin_facility || "",
origin_facility_ref: null,
approving_facility: filter.approving_facility || "",
approving_facility_ref: null,
assigned_facility: filter.assigned_facility || "",
Expand All @@ -54,13 +54,13 @@ export default function ListFilter(props: any) {

useEffect(() => {
async function fetchData() {
if (filter.orgin_facility) {
if (filter.origin_facility) {
setOriginLoading(true);
const res = await dispatch(
getAnyFacility(filter.orgin_facility, "orgin_facility")
getAnyFacility(filter.origin_facility, "origin_facility")
);
if (res && res.data) {
setFilterState({ orgin_facility_ref: res.data });
setFilterState({ origin_facility_ref: res.data });
}
setOriginLoading(false);
}
Expand Down Expand Up @@ -115,7 +115,7 @@ export default function ListFilter(props: any) {

const applyFilter = () => {
const {
orgin_facility,
origin_facility,
approving_facility,
assigned_facility,
emergency,
Expand All @@ -127,7 +127,7 @@ export default function ListFilter(props: any) {
status,
} = filterState;
const data = {
orgin_facility: orgin_facility || "",
origin_facility: origin_facility || "",
approving_facility: approving_facility || "",
assigned_facility: assigned_facility || "",
emergency: emergency || "",
Expand Down Expand Up @@ -197,9 +197,9 @@ export default function ListFilter(props: any) {
) : (
<FacilitySelect
multiple={false}
name="orgin_facility"
selected={filterState.orgin_facility_ref}
setSelected={(obj) => setFacility(obj, "orgin_facility")}
name="origin_facility"
selected={filterState.origin_facility_ref}
setSelected={(obj) => setFacility(obj, "origin_facility")}
className="resource-page-filter-dropdown"
errors={""}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Resource/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function ListView() {
}, [
qParams.status,
qParams.facility,
qParams.orgin_facility,
qParams.origin_facility,
qParams.approving_facility,
qParams.assigned_facility,
qParams.emergency,
Expand Down Expand Up @@ -122,7 +122,7 @@ export default function ListView() {
>
<i className="fas fa-plane-departure mr-2"></i>
<dd className="font-bold text-sm leading-5 text-gray-900">
{(resource.orgin_facility_object || {}).name}
{(resource.origin_facility_object || {}).name}
</dd>
</dt>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Resource/ResourceBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ResourceCard = ({ resource }: any) => {
>
<i className="fas fa-plane-departure mr-2"></i>
<dd className="font-bold text-sm leading-5 text-gray-900">
{(resource.orgin_facility_object || {}).name}
{(resource.origin_facility_object || {}).name}
</dd>
</dt>
</div>
Expand Down Expand Up @@ -194,7 +194,7 @@ export default function ResourceBoard({
board,
dispatch,
filterProp.facility,
filterProp.orgin_facility,
filterProp.origin_facility,
filterProp.approving_facility,
filterProp.assigned_facility,
filterProp.emergency,
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Resource/ResourceCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default function ResourceCreate(props: resourceProps) {
status: "PENDING",
category: state.form.category,
sub_category: state.form.sub_category,
orgin_facility: props.facilityId,
origin_facility: props.facilityId,
approving_facility: (state.form.approving_facility || {}).id,
assigned_facility: (state.form.assigned_facility || {}).id,
emergency: state.form.emergency === "true",
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Resource/ResourceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ export default function ResourceDetails(props: { id: string }) {
</div>
<div className="mt-2">
<div className="p-4 pt-0">
<div>{data.orgin_facility_object?.name || "--"}</div>
<div>{data.origin_facility_object?.name || "--"}</div>
<div>
{data.orgin_facility_object?.facility_type?.name || "--"}
{data.origin_facility_object?.facility_type?.name || "--"}
</div>
<div>
{data.orgin_facility_object?.district_object?.name || "--"}
{data.origin_facility_object?.district_object?.name || "--"}
</div>
<div>
{data.orgin_facility_object?.local_body_object?.name || "--"}
{data.origin_facility_object?.local_body_object?.name || "--"}
</div>
<div>
{data.orgin_facility_object?.state_object?.name || "--"}
{data.origin_facility_object?.state_object?.name || "--"}
</div>
</div>
{data.status === "REJECTED" ||
Expand Down Expand Up @@ -456,7 +456,7 @@ export default function ResourceDetails(props: { id: string }) {
<div>
<h4>Origin Facility</h4>

{showFacilityCard(data.orgin_facility_object)}
{showFacilityCard(data.origin_facility_object)}
</div>
<div>
<h4>Resource Approving Facility</h4>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Resource/ResourceDetailsUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const ResourceDetailsUpdate = (props: resourceProps) => {
const data = {
category: "OXYGEN",
status: state.form.status,
orgin_facility: state.form.orgin_facility_object?.id,
origin_facility: state.form.origin_facility_object?.id,
approving_facility: state.form?.approving_facility_object?.id,
assigned_facility: state.form?.assigned_facility_object?.id,
emergency: [true, "true"].includes(state.form.emergency),
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Shifting/BadgesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export default function BadgesList(props: any) {

useEffect(() => {
async function fetchData() {
if (!qParams.orgin_facility) return setOriginFacilityName("");
if (!qParams.origin_facility) return setOriginFacilityName("");
const res = await dispatch(
getAnyFacility(qParams.orgin_facility, "orgin_facility")
getAnyFacility(qParams.origin_facility, "origin_facility")
);
setOriginFacilityName(res?.data?.name);
}
fetchData();
}, [dispatch, qParams.orgin_facility]);
}, [dispatch, qParams.origin_facility]);

useEffect(() => {
async function fetchData() {
Expand Down Expand Up @@ -102,7 +102,7 @@ export default function BadgesList(props: any) {
"assigned_facility",
assignedFacilityName
),
value(t("origin_facility"), "orgin_facility", originFacilityName),
value(t("origin_facility"), "origin_facility", originFacilityName),
value(
t("shifting_approval_facility"),
"shifting_approving_facility",
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Shifting/Commons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const limit = 14;
export const initialFilterData = {
status: "--",
facility: "",
orgin_facility: "",
origin_facility: "",
shifting_approving_facility: "",
assigned_facility: "",
emergency: "--",
Expand All @@ -29,7 +29,7 @@ export const formatFilter = (params: any) => {
return {
status: filter.status === "--" ? null : filter.status,
facility: "",
orgin_facility: filter.orgin_facility || undefined,
origin_facility: filter.origin_facility || undefined,
shifting_approving_facility:
filter.shifting_approving_facility || undefined,
assigned_facility: filter.assigned_facility || undefined,
Expand Down
24 changes: 12 additions & 12 deletions src/Components/Shifting/ListFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { useTranslation } from "react-i18next";
import UserAutocompleteFormField from "../Common/UserAutocompleteFormField";

const clearFilterState = {
orgin_facility: "",
orgin_facility_ref: "",
origin_facility: "",
origin_facility_ref: "",
shifting_approving_facility: "",
shifting_approving_facility_ref: "",
assigned_facility: "",
Expand Down Expand Up @@ -64,8 +64,8 @@ export default function ListFilter(props: any) {
).map((option) => option.text);

const [filterState, setFilterState] = useMergeState({
orgin_facility: filter.orgin_facility || "",
orgin_facility_ref: null,
origin_facility: filter.origin_facility || "",
origin_facility_ref: null,
shifting_approving_facility: filter.shifting_approving_facility || "",
shifting_approving_facility_ref: null,
assigned_facility: filter.assigned_facility || "",
Expand All @@ -90,13 +90,13 @@ export default function ListFilter(props: any) {

useEffect(() => {
async function fetchData() {
if (filter.orgin_facility) {
if (filter.origin_facility) {
setOriginLoading(true);
const res = await dispatch(
getAnyFacility(filter.orgin_facility, "orgin_facility")
getAnyFacility(filter.origin_facility, "origin_facility")
);
if (res && res.data) {
setFilterState({ orgin_facility_ref: res.data });
setFilterState({ origin_facility_ref: res.data });
}
setOriginLoading(false);
}
Expand Down Expand Up @@ -192,7 +192,7 @@ export default function ListFilter(props: any) {

const applyFilter = () => {
const {
orgin_facility,
origin_facility,
shifting_approving_facility,
assigned_facility,
emergency,
Expand All @@ -211,7 +211,7 @@ export default function ListFilter(props: any) {
breathlessness_level,
} = filterState;
const data = {
orgin_facility: orgin_facility || "",
origin_facility: origin_facility || "",
shifting_approving_facility: shifting_approving_facility || "",
assigned_facility: assigned_facility || "",
emergency: emergency || "",
Expand Down Expand Up @@ -291,9 +291,9 @@ export default function ListFilter(props: any) {
) : (
<FacilitySelect
multiple={false}
name="orgin_facility"
selected={filterState.orgin_facility_ref}
setSelected={(obj) => setFacility(obj, "orgin_facility")}
name="origin_facility"
selected={filterState.origin_facility_ref}
setSelected={(obj) => setFacility(obj, "origin_facility")}
className="shifting-page-filter-dropdown"
errors={""}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Shifting/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function ListView() {
}, [
qParams.status,
qParams.facility,
qParams.orgin_facility,
qParams.origin_facility,
qParams.shifting_approving_facility,
qParams.assigned_facility,
qParams.emergency,
Expand Down Expand Up @@ -170,7 +170,7 @@ export default function ListView() {
>
<i className="fas fa-plane-departure mr-2"></i>
<dd className="font-bold text-sm leading-5 text-gray-900">
{(shift.orgin_facility_object || {}).name}
{(shift.origin_facility_object || {}).name}
</dd>
</dt>
</div>
Expand Down
Loading

0 comments on commit 6e01288

Please sign in to comment.