From daa88cd3f952513a935b8e39c9640b6b7a3836b9 Mon Sep 17 00:00:00 2001 From: Pranshu Aggarwal Date: Sat, 9 Sep 2023 14:05:08 +0530 Subject: [PATCH 1/4] only show unlinked facilties --- src/Components/Common/FacilitySelect.tsx | 3 +++ src/Components/Users/ManageUsers.tsx | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx index 400ce115bc5..6b6f5261504 100644 --- a/src/Components/Common/FacilitySelect.tsx +++ b/src/Components/Common/FacilitySelect.tsx @@ -6,6 +6,7 @@ import { FacilityModel } from "../Facility/models"; interface FacilitySelectProps { name: string; + username: string; errors?: string | undefined; className?: string; searchAll?: boolean; @@ -22,6 +23,7 @@ interface FacilitySelectProps { export const FacilitySelect = (props: FacilitySelectProps) => { const { name, + username, multiple, selected, setSelected, @@ -45,6 +47,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => { search_text: text, all: searchAll, facility_type: facilityType, + username: username, district, }; diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index 99cb11e7e6f..929b569dde1 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -695,6 +695,7 @@ function UserFacilities(props: { user: any }) { Date: Sun, 10 Sep 2023 13:41:05 +0530 Subject: [PATCH 2/4] rename param --- src/Components/Common/FacilitySelect.tsx | 6 +++--- src/Components/Users/ManageUsers.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx index 6b6f5261504..19494081aa3 100644 --- a/src/Components/Common/FacilitySelect.tsx +++ b/src/Components/Common/FacilitySelect.tsx @@ -6,7 +6,7 @@ import { FacilityModel } from "../Facility/models"; interface FacilitySelectProps { name: string; - username: string; + exclude_user: string; errors?: string | undefined; className?: string; searchAll?: boolean; @@ -23,7 +23,7 @@ interface FacilitySelectProps { export const FacilitySelect = (props: FacilitySelectProps) => { const { name, - username, + exclude_user, multiple, selected, setSelected, @@ -47,7 +47,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => { search_text: text, all: searchAll, facility_type: facilityType, - username: username, + exclude_user: exclude_user, district, }; diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index bfbed09bbb0..d0f1b1e4c27 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -698,7 +698,7 @@ function UserFacilities(props: { user: any }) { Date: Mon, 16 Oct 2023 14:07:58 +0530 Subject: [PATCH 3/4] fix cypress for updated backend --- cypress/e2e/users_spec/user_crud.cy.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cypress/e2e/users_spec/user_crud.cy.ts b/cypress/e2e/users_spec/user_crud.cy.ts index 41a12a891a8..5bb2fc09818 100644 --- a/cypress/e2e/users_spec/user_crud.cy.ts +++ b/cypress/e2e/users_spec/user_crud.cy.ts @@ -104,14 +104,7 @@ describe("User management", () => { .click() .type("Dummy Facility 1") .wait("@getFacilities"); - cy.get("li[role='option']").first().click(); - cy.intercept(/\/api\/v1\/users\/\w+\/add_facility\//).as("addFacility"); - cy.get("button[id='link-facility']").click(); - cy.wait("@addFacility") - // .its("response.statusCode") - // .should("eq", 201) - .get("span") - .contains("Facility - User Already has permission to this facility"); + cy.get("li[role='option']").should("not.exist"); }); it("Next/Previous Page", () => { From 252188a3544feb833f417ac4e0607102ef4faa76 Mon Sep 17 00:00:00 2001 From: Pranshu Aggarwal Date: Mon, 30 Oct 2023 15:49:49 +0530 Subject: [PATCH 4/4] fix typo --- cypress/e2e/users_spec/user_creation.cy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts index 103908cf165..358a243efd8 100644 --- a/cypress/e2e/users_spec/user_creation.cy.ts +++ b/cypress/e2e/users_spec/user_creation.cy.ts @@ -121,6 +121,7 @@ describe("User Creation", () => { // .type("Dummy Facility 1") // .wait("@getFacilities"); // cy.get("li[role='option']").should("not.exist"); + // }); // describe("Edit User Profile & Error Validation", () => { // before(() => {