-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/oh2 286 filters to tables (#604)
* feat(oh2-286): add filters to exams & users * chore: reorder components
- Loading branch information
Showing
11 changed files
with
159 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import React from "react"; | ||
import React, { useState } from "react"; | ||
import { Tabs, Tab } from "@material-ui/core"; | ||
|
||
import UsersTable from "./usersTable"; | ||
import UserGroupsTable from "./userGroupsTable"; | ||
|
||
export const Users = () => { | ||
return <UsersTable />; | ||
const [tab, setTab] = useState<"users" | "groups">("users"); | ||
return ( | ||
<> | ||
<Tabs | ||
value={tab} | ||
onChange={(_, value) => setTab(value)} | ||
aria-label="switch between users and groups" | ||
> | ||
<Tab label="Users" value="users" /> | ||
<Tab label="Groups" value="groups" /> | ||
</Tabs> | ||
{tab === "users" ? <UsersTable /> : <UserGroupsTable />} | ||
</> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
src/components/accessories/admin/users/userGroupsTable/UserGroupsTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import React from "react"; | ||
|
||
export const UserGroupsTable = () => <>UserGroupsTable, coming soon</>; |
3 changes: 3 additions & 0 deletions
3
src/components/accessories/admin/users/userGroupsTable/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { UserGroupsTable } from "./UserGroupsTable"; | ||
|
||
export default UserGroupsTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ExamTypeDTO } from "../../generated"; | ||
|
||
export const examTypesDTO: ExamTypeDTO[] = [ | ||
{ | ||
code: "HB", | ||
description: "1.Haematology", | ||
}, | ||
{ | ||
code: "OT", | ||
description: "2.Some other exam type", | ||
}, | ||
]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { ExamDTO } from "../../generated"; | ||
|
||
export const examsDTO: ExamDTO[] = [ | ||
{ | ||
code: "01.01", | ||
description: "1.1 HB", | ||
procedure: 2, | ||
defaultResult: "POSTIVE", | ||
examtype: { | ||
code: "HB", | ||
description: "1.Haematology", | ||
}, | ||
lock: 1, | ||
}, | ||
{ | ||
code: "01.02", | ||
description: "1.2 WBC Count", | ||
procedure: 1, | ||
defaultResult: "POSTIVE", | ||
examtype: { | ||
code: "HB", | ||
description: "1.Haematology", | ||
}, | ||
lock: 1, | ||
}, | ||
{ | ||
code: "01.03", | ||
description: "1.3 Differential", | ||
procedure: 1, | ||
defaultResult: "", | ||
examtype: { | ||
code: "HB", | ||
description: "1.Haematology", | ||
}, | ||
lock: 0, | ||
}, | ||
{ | ||
code: "01.04", | ||
description: "1.4 Film Comment", | ||
procedure: 1, | ||
defaultResult: "", | ||
examtype: { | ||
code: "HB", | ||
description: "1.Haematology", | ||
}, | ||
lock: 0, | ||
}, | ||
{ | ||
code: "02.01", | ||
description: "2.1 Some other Exam", | ||
procedure: 1, | ||
defaultResult: "", | ||
examtype: { | ||
code: "OT", | ||
description: "2.Some other exam type", | ||
}, | ||
lock: 0, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { examTypesDTO } from "../fixtures/examTypesDTO"; | ||
|
||
export const examTypesRoutes = (server) => { | ||
server.namespace("/examtypes", () => { | ||
server.get("/").intercept((_req, res) => { | ||
res.status(200).json(examTypesDTO); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters