-
Notifications
You must be signed in to change notification settings - Fork 0
DESK-1692: Admin pages #1013
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
Open
evanrbowers
wants to merge
24
commits into
main
Choose a base branch
from
admin-pages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DESK-1692: Admin pages #1013
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
cac1cbd
feat: add device product page
evanrbowers 83c1770
feat: add cloud sync for products
evanrbowers bfd5928
feat: match scripting and device page layout
evanrbowers 5152e4e
feat: updated product list page
evanrbowers 5d6c96a
fix: fix lock
evanrbowers 008419d
feat: support multiple accounts for products
evanrbowers 4f6ae7f
feat: remove attributes hidden and scope
evanrbowers 4642f6d
feat: show icons for platform types and limit what platform types sho…
evanrbowers e23b7cd
feat: update for create product slide out instead of new page
evanrbowers 7403454
feat: update product details to look like device details
evanrbowers 77a7e09
feat: add back button
evanrbowers 4941235
feat: add multi panel design
evanrbowers cb68cd5
fix: fix thresholds
evanrbowers e42d51a
feat: adjust sizing, add memory to orgs for selection/not selected, a…
evanrbowers c3353ff
feat: auto refresh and add refresh button
evanrbowers 9ffab95
feat: DESK-1692 Add admin pages
evanrbowers ad9c8e9
Merge branch 'main' into admin-pages
evanrbowers 3f7a481
incorporate pr changes and add updates for partner entity
evanrbowers 9fcad8e
Merge branch 'main' into admin-pages
evanrbowers a63cb9b
feat: updates to admin pages for use and caching
evanrbowers 5993725
feat: clean issues with partner entities
evanrbowers cf3eec3
fix: fixes for product creation and transfer
evanrbowers 962ef97
fix: fix for registration command and spacing for lock layout
evanrbowers 262ae8d
feat: remove link to registrations
evanrbowers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,68 @@ | ||
| import React from 'react' | ||
| import { useHistory } from 'react-router-dom' | ||
| import { useSelector } from 'react-redux' | ||
| import { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material' | ||
| import { Icon } from './Icon' | ||
| import { State } from '../store' | ||
|
|
||
| export const AdminSidebarNav: React.FC = () => { | ||
| const history = useHistory() | ||
| const defaultSelection = useSelector((state: State) => state.ui.defaultSelection) | ||
| const currentPath = history.location.pathname | ||
|
|
||
| const handleNavClick = (baseRoute: string) => { | ||
| const adminSelection = defaultSelection['admin'] | ||
| const savedRoute = adminSelection?.[baseRoute] | ||
| history.push(savedRoute || baseRoute) | ||
| } | ||
|
|
||
| return ( | ||
| <List | ||
| sx={{ | ||
| position: 'static', | ||
| '& .MuiListItemIcon-root': { | ||
| color: 'grayDark.main' | ||
| }, | ||
| '& .MuiListItemText-primary': { | ||
| color: 'grayDarkest.main' | ||
| }, | ||
| '& .MuiListItemButton-root:hover .MuiListItemText-primary': { | ||
| color: 'black.main' | ||
| }, | ||
| '& .Mui-selected, & .Mui-selected:hover': { | ||
| backgroundColor: 'primaryLighter.main', | ||
| '& .MuiListItemIcon-root': { | ||
| color: 'grayDarker.main' | ||
| }, | ||
| '& .MuiListItemText-primary': { | ||
| color: 'black.main', | ||
| fontWeight: 500 | ||
| }, | ||
| }, | ||
| }} | ||
| > | ||
| <ListItemButton | ||
| dense | ||
| selected={currentPath.includes('/admin/users')} | ||
| onClick={() => handleNavClick('/admin/users')} | ||
| > | ||
| <ListItemIcon> | ||
| <Icon name="users" size="md" /> | ||
| </ListItemIcon> | ||
| <ListItemText primary="Users" /> | ||
| </ListItemButton> | ||
|
|
||
| <ListItemButton | ||
| dense | ||
| selected={currentPath.includes('/admin/partners')} | ||
| onClick={() => handleNavClick('/admin/partners')} | ||
| > | ||
| <ListItemIcon> | ||
| <Icon name="handshake" size="md" /> | ||
| </ListItemIcon> | ||
| <ListItemText primary="Partners" /> | ||
| </ListItemButton> | ||
| </List> | ||
| ) | ||
| } | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,30 @@ | ||
| import { useRef, useState, useEffect } from 'react' | ||
|
|
||
| /** | ||
| * Hook to track the width of a container element using ResizeObserver | ||
| * @returns containerRef - ref to attach to the container element | ||
| * @returns containerWidth - current width of the container | ||
| */ | ||
| export function useContainerWidth() { | ||
| const containerRef = useRef<HTMLDivElement>(null) | ||
| const [containerWidth, setContainerWidth] = useState<number>(1000) | ||
|
|
||
| useEffect(() => { | ||
| const updateWidth = () => { | ||
| if (containerRef.current) { | ||
| setContainerWidth(containerRef.current.offsetWidth) | ||
| } | ||
| } | ||
|
|
||
| updateWidth() | ||
|
|
||
| const resizeObserver = new ResizeObserver(updateWidth) | ||
| if (containerRef.current) { | ||
| resizeObserver.observe(containerRef.current) | ||
| } | ||
|
|
||
| return () => resizeObserver.disconnect() | ||
| }, []) | ||
|
|
||
| return { containerRef, containerWidth } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need a new boolean to track admin mode since we already have TestUI mode. We could rename testUI mode to admin mode and trigger that menu's visibility from the admin attribute on the user. And then just always show the admin menu items... maybe under the "more" menu? Having it integrated instead of separated? Maybe there is a reason to do it how you have it. This just seems simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd pref to keep it as its own pages and not nested. It also does not fit well into the multi account of the main page.