Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwinds ManageUsers.tsx #5664

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/user_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe("User management", () => {
.wait("@getFacilities");
cy.get("li[role='option']").contains("cypress facility").click();
cy.intercept(/\/api\/v1\/users\/\w+\/add_facility\//).as("addFacility");
cy.get("button > span").contains("Add").click();
cy.get("button[id='link-facility']").click();
cy.wait("@addFacility")
// .its("response.statusCode")
// .should("eq", 201)
Expand Down
29 changes: 13 additions & 16 deletions src/Components/Users/ManageUsers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import * as Notification from "../../Utils/Notifications.js";

import { Button, CircularProgress } from "@material-ui/core";
import {
addUserFacility,
clearHomeFacility,
Expand Down Expand Up @@ -37,9 +35,10 @@ import moment from "moment";
import { navigate } from "raviger";
import useFilters from "../../Common/hooks/useFilters";
import useWindowDimensions from "../../Common/hooks/useWindowDimensions";
import CircularProgress from "../Common/components/CircularProgress.js";
import Page from "../Common/components/Page.js";

const Loading = loadable(() => import("../Common/Loading"));
const PageTitle = loadable(() => import("../Common/PageTitle"));

export default function ManageUsers() {
const { width } = useWindowDimensions();
Expand Down Expand Up @@ -422,20 +421,19 @@ export default function ManageUsers() {
}

return (
<div>
<Page
title="User Management"
hideBack={true}
className="mx-5 px-2"
breadcrumbs={false}
>
{expandSkillList && (
<SkillsSlideOver
show={expandSkillList}
setShow={setExpandSkillList}
username={selectedUser}
/>
)}
<PageTitle
title="User Management"
hideBack={true}
className="mx-5 px-2"
breadcrumbs={false}
/>
<SlideOverCustom
open={expandFacilityList}
setOpen={setExpandFacilityList}
Expand Down Expand Up @@ -500,7 +498,7 @@ export default function ManageUsers() {
handleOk={handleSubmit}
/>
)}
</div>
</Page>
);
}

Expand Down Expand Up @@ -644,19 +642,18 @@ function UserFacilities(props: { user: any }) {
errors=""
className="z-40"
/>
<Button
color="primary"
<ButtonV2
id="link-facility"
disabled={!facility}
className="mt-1"
onClick={() => addFacility(username, facility)}
autoFocus
>
Add
</Button>
</ButtonV2>
</div>
{isLoading ? (
<div className="flex justify-center items-center">
<CircularProgress className="text-primary-500" />
<CircularProgress />
</div>
) : (
<div className="flex flex-col">
Expand Down