From ab4aa065fd9ccdeeb1150006f84a6c46b94c817e Mon Sep 17 00:00:00 2001 From: Dikshajain39511 <98263148+Dikshajain39511@users.noreply.github.com> Date: Tue, 1 Feb 2022 13:07:31 +0530 Subject: [PATCH 1/6] Feature/wms 41 (#38) * tileGrid page * Updated: Tile component props * TileBasic Component Changes * Basic Tile Changes * bug fix * location form changes * props pass to dropdown * list users page * user access changes * user and access * tabs changes * Removed: Duplicate import * Removed: extra tile component * Resolved: Linter errors * Undo: BasicTable conflict * Resolved: PropTypes error Co-authored-by: [Diksha] <[diksha39511@gmail.com]> Co-authored-by: Llewellyn D'souza --- src/components/BasicTable/index.js | 1 + src/components/Tabs/index.js | 12 ++ src/pages/useraccess/index.js | 210 +++++++++++++++++++++++++++++ src/routes/index.js | 21 ++- 4 files changed, 237 insertions(+), 7 deletions(-) create mode 100644 src/components/Tabs/index.js create mode 100644 src/pages/useraccess/index.js diff --git a/src/components/BasicTable/index.js b/src/components/BasicTable/index.js index f88cba6..1aeff11 100644 --- a/src/components/BasicTable/index.js +++ b/src/components/BasicTable/index.js @@ -28,6 +28,7 @@ const row = (x, i, header) => ( ))} ); + export default function BasicTable({ data, header, backgroundColor }) { const classes = useStyles(); const TableContainer = styled('div')( diff --git a/src/components/Tabs/index.js b/src/components/Tabs/index.js new file mode 100644 index 0000000..62c1c61 --- /dev/null +++ b/src/components/Tabs/index.js @@ -0,0 +1,12 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +export default function TabPanel({ children, value, index }) { + return
{value === index &&

{children}

}
; +} + +TabPanel.propTypes = { + children: PropTypes.node, + value: PropTypes.number, + index: PropTypes.number +}; diff --git a/src/pages/useraccess/index.js b/src/pages/useraccess/index.js new file mode 100644 index 0000000..0faaf7d --- /dev/null +++ b/src/pages/useraccess/index.js @@ -0,0 +1,210 @@ +import MDBox from 'components/MDBox'; +import DashboardNavbar from 'components/DashboardNavbar'; +import Footer from 'components/Footer'; +import DashboardLayout from 'layouts/DashboardLayout'; +import { makeStyles } from '@mui/styles'; +import BasicTable from 'components/BasicTable'; +import { Grid } from '@mui/material'; +import SearchBar from 'components/SearchBar'; +import MDButton from 'components/Button'; +import { useState } from 'react'; +import EditIcon from '@mui/icons-material/Edit'; +import { Tabs, Tab } from '@mui/material'; +import TabPanel from 'components/Tabs'; + +const useStyles = makeStyles({ + iconSize: { + width: '50%', + height: '50%', + marginBottom: '10px' + }, + margin: { + marginBottom: '20px' + }, + wrap: { + display: 'flex' + }, + marginTable: { + marginTop: '20px' + }, + tabs: { + '& .MuiButtonBase-root.MuiTab-root': { + padding: '12px 0px', + borderRadius: '0px' + }, + '& .Mui-selected': { + textDecoration: 'underline', + backgroundColor: '#017AFF' + } + } +}); + +function UserAccessScreen() { + const classes = useStyles(); + const [value, setValue] = useState(0); + + const handleTabs = (e, val) => { + setValue(val); + }; + + const header = [ + { + name: '', + prop: 'icon' + }, + { + name: 'User Name', + prop: 'username' + }, + { + name: 'Phone Number', + prop: 'phonenumber' + }, + { + name: 'Roles', + prop: 'roles' + }, + { + name: 'Last Updated by & Date', + prop: 'lastupdated' + }, + { + name: 'Created by & Date', + prop: 'Createdby' + }, + { + name: 'Last Login', + prop: 'lastlogin' + }, + { + name: 'Access', + prop: 'access' + } + ]; + const data = [ + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + }, + { + icon: , + username: 'Floyd Miles', + phonenumber: '(704)555-0127', + roles: 'Administrator', + lastupdated: 'System| 1/1/2022 11:23:00 AM', + Createdby: 'System| 1/1/2022 11:23:00 AM', + lastlogin: 'System| 1/1/2022 11:23:00 AM', + access: 'Active' + } + ]; + + return ( + + + + + + + + + + +
+ +
+
+ + Item2 Detail + +
+ + + + + + {'+ CREATE USER'} + + +
+
+