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

Admin & User Settings UI Updates #158

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f08fe40
Update User Settings table to include refresh, add buttons and remove…
mwodahl Feb 11, 2025
4b32f11
Add additional table options to admin RSU table
mwodahl Feb 11, 2025
1310351
Remove header from admin page
mwodahl Feb 11, 2025
2cf5f66
Update admin tabs to have icons, additional css properties
mwodahl Feb 11, 2025
c8f3a6b
Remove header, update admin intersection table with additional icons
mwodahl Feb 11, 2025
7f0f958
Update admin user tab with icons, remove header
mwodahl Feb 11, 2025
7565d3f
Remove title, add new background color to admin organization tab
mwodahl Feb 12, 2025
705c2c2
Update admin tab content height
mwodahl Feb 12, 2025
d4d33e4
Remove unused css class
mwodahl Feb 12, 2025
a212fd1
Update admin organization page header display
mwodahl Feb 12, 2025
3b05c26
Update organization delete icon
mwodahl Feb 12, 2025
4ee0e0b
Update admin organization RSU tab table with additional actions, remo…
mwodahl Feb 12, 2025
e5c39e2
Add multiselect css overrides
mwodahl Feb 12, 2025
3beaa1b
Update intersection actions, remove table title
mwodahl Feb 12, 2025
0882865
Remove bottom margin from form-dropdown
mwodahl Feb 12, 2025
767fe63
Update intersection tab table field width
mwodahl Feb 12, 2025
1993473
Update table actions for organization user tab
mwodahl Feb 12, 2025
de69533
Remove className from role dropdown
mwodahl Feb 12, 2025
03897bf
Remove unused css org user class
mwodahl Feb 12, 2025
9f673cd
Update dropdown border override
mwodahl Feb 12, 2025
e717539
Update add form styling
mwodahl Feb 12, 2025
fd7b747
Update styling for user, intersection add forms
mwodahl Feb 12, 2025
0d9f0e8
Update add RSU form styling
mwodahl Feb 12, 2025
3f99d0d
Remove unused import
mwodahl Feb 12, 2025
3eb438c
Update add notification tab to use dialog, updated form UI
mwodahl Feb 18, 2025
8fb76e5
Update edit notification to use dialog, updated form UI
mwodahl Feb 18, 2025
d7dd2b6
Remove unused import statements
mwodahl Feb 18, 2025
2b29e0f
Add required navigation elements to add notification test
mwodahl Feb 18, 2025
884a2a9
Update testing snapshots
mwodahl Feb 18, 2025
1226766
Update add intersection form to use material UI select dropdown
mwodahl Feb 19, 2025
96c460f
Reorder RSU table row actions
mwodahl Feb 19, 2025
f67ab74
Update add RSU form to use react select components
mwodahl Feb 19, 2025
41d9b56
Update add user form to use react MUI select components
mwodahl Feb 19, 2025
128dfbb
Update org edit modal to use react MUI form components
mwodahl Feb 19, 2025
77e7502
Update form id
mwodahl Feb 19, 2025
9108daa
Update incorrect controlId values
mwodahl Feb 19, 2025
5dca80b
Update edit intersection to use react MUI form components
mwodahl Feb 19, 2025
4c0d8ca
Update edit RSU form to use React MUI form components
mwodahl Feb 19, 2025
f90dc5d
Update edit user form to use React MUI form components
mwodahl Feb 19, 2025
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
16 changes: 10 additions & 6 deletions webapp/src/components/AdminOrganizationDeleteMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ import { Options } from './AdminDeletionOptions'

import '../features/adminRsuTab/Admin.css'
import { ContainedIconButton } from '../styles/components/ContainedIconButton'
import { alpha, useTheme } from '@mui/material/styles'
import { DeleteOutline } from '@mui/icons-material'

interface AdminOrganizationDeleteMenuProps {
selectedOrganization: string
deleteOrganization: () => void
}

const AdminOrganizationDeleteMenu = (props: AdminOrganizationDeleteMenuProps) => {
const theme = useTheme()
const handleDelete = () => {
const buttons = [
{
Expand All @@ -36,14 +39,15 @@ const AdminOrganizationDeleteMenu = (props: AdminOrganizationDeleteMenuProps) =>
title="Delete Organization"
onClick={handleDelete}
sx={{
float: 'left',
margin: 2,
mt: 0.5,
mr: 0,
ml: 0.5,
backgroundColor: 'transparent',
color: theme.palette.text.primary,
borderRadius: '2px',
'&:hover': {
backgroundColor: alpha(theme.palette.text.primary, 0.1),
},
}}
>
<DeleteIcon component={undefined} size={20} />
<DeleteOutline component={undefined} size={20} />
</ContainedIconButton>
</div>
)
Expand Down
6 changes: 2 additions & 4 deletions webapp/src/components/AdminTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import MaterialTable, { Action, Column, MTableBodyRow, MTableCell } from '@material-table/core'
import MaterialTable, { Action, Column, MTableCell } from '@material-table/core'

import '../features/adminRsuTab/Admin.css'
import { alpha, Tooltip, useTheme } from '@mui/material'
Expand Down Expand Up @@ -33,9 +33,6 @@ const AdminTable = (props: AdminTableProps) => {
actions={props.actions}
columns={props.columns?.map((column) => ({
...column,
cellStyle: {
borderRight: `1px solid ${alpha(theme.palette.divider, 0.1)}`, // Add column lines
},
}))}
data={props.data}
title={props.title}
Expand All @@ -54,6 +51,7 @@ const AdminTable = (props: AdminTableProps) => {
},
pageSize: 5,
pageSizeOptions: props.pageSizeOptions === undefined ? [5, 10, 20] : props.pageSizeOptions,
searchFieldAlignment: 'left',
}}
components={{
Cell: (props) => {
Expand Down
51 changes: 31 additions & 20 deletions webapp/src/components/VerticalTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import { RootState } from '../store'
import { alpha, Box, Tab, Tabs, useTheme } from '@mui/material'
import { Link, Navigate, Route, Routes, useLocation } from 'react-router-dom'
import { evaluateFeatureFlags } from '../feature-flags'
import {
FiberManualRecordOutlined,
PersonOutlined,
SignalCellularAltOutlined,
TrafficOutlined,
} from '@mui/icons-material'

interface TabPanelProps {
children?: React.ReactNode
Expand Down Expand Up @@ -53,6 +59,19 @@ function VerticalTabs(props: VerticalTabProps) {
const filteredTabs = tabs.filter((tab) => evaluateFeatureFlags(tab.tag))
const defaultTabKey = filteredTabs[defaultTabIndex ?? 0]?.path

const getIcon = (tabName: string) => {
switch (tabName) {
case 'RSUs':
return <SignalCellularAltOutlined sx={{ marginRight: '40px' }} />
case 'Intersections':
return <TrafficOutlined sx={{ marginRight: '40px' }} />
case 'Users':
return <PersonOutlined sx={{ marginRight: '40px' }} />
case 'Organizations':
return <FiberManualRecordOutlined sx={{ marginRight: '40px' }} />
}
}

const getSelectedTab = () => location.pathname.split('/').at(-1) || defaultTabKey

const [value, setValue] = useState<string | number>(getSelectedTab())
Expand Down Expand Up @@ -92,14 +111,7 @@ function VerticalTabs(props: VerticalTabProps) {
indicatorColor="secondary"
textColor="inherit"
orientation="vertical"
sx={{ width: 170 }}
TabIndicatorProps={{
style: {
right: 'auto', // remove the default right positioning
left: 0, // add left positioning
width: 5, // width of the indicator
},
}}
sx={{ width: 250 }}
>
{filteredTabs.map((tab) => {
const index = filteredTabs.indexOf(tab)
Expand All @@ -110,22 +122,21 @@ function VerticalTabs(props: VerticalTabProps) {
value={tab.path}
component={Link}
to={tab.path}
icon={getIcon(tab.title)}
sx={{
backgroundColor: value === tab.path || value === index ? theme.palette.primary.main : 'transparent',
fontSize: 20,
height: '80px',
alignItems: 'flex-start',
height: '60px',
alignItems: 'center',
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start',
textTransform: 'none',
borderRadius: 1,
'&&': {
color:
value === tab.path || value === index
? theme.palette.primary.contrastText
: theme.palette.text.primary,
border:
value === tab.path || value === index
? 'none'
: `0.5px solid ${alpha(theme.palette.divider, 0.2)}`,
fontWeight: value === tab.path || value === index ? 'bold' : 'normal',
color: theme.palette.text.primary,
backgroundColor: 'transparent',
'&:hover': {
backgroundColor: alpha(theme.palette.primary.main, 0.2),
},
}}
/>
Expand Down
Loading
Loading