Skip to content

Commit

Permalink
#737 UI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiga115 committed Dec 18, 2023
1 parent 960a096 commit 8ab32ca
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ interface WorkspaceProps {
}

const SidebarBox = styled(Box)(({ theme }) => ({
borderRight: `0.085rem solid ${borderColor}`,
// borderRight: `0.085rem solid ${borderColor}`,
width: "100%",
}));

Expand All @@ -132,7 +132,7 @@ function TabPanel(props) {
{...other}
>
{value === index && (
<Box sx={{ maxHeight: 480, overflowY: "scroll" }}>{children}</Box>
<Box sx={{ maxHeight: 480 }}>{children}</Box>
)}
</div>
);
Expand All @@ -142,6 +142,9 @@ const SidebarIconButton = styled(IconButton)(({ theme }) => ({
padding: 0,
"& .MuiSvgIcon-root": {
color: paragraph,
width: '1rem',
height: '1rem',
marginLeft: '0.25rem'
},
"&:hover": {
background: "none",
Expand Down Expand Up @@ -198,39 +201,45 @@ export default (props: WorkspaceProps | any) => {
<>
{props.open ? (
<SidebarBox>
<Box sx={{ borderBottom: 1, borderColor: "divider" }}>
{!hideTabs && (
{!hideTabs && (
<Box sx={{ borderBottom: 1, borderColor: "divider" }}>
<Tabs
value={tabValue}
onChange={handleTabChange}
variant="fullWidth"
>
<Tab
label="Workspace"
sx={{ pl: "0.75rem", pr: "0.75rem", fontSize: "0.75rem" }}
/>
<Tab
label="My Assets"
sx={{ pl: "0.75rem", pr: "0.75rem", fontSize: "0.75rem" }}
/>
</Tabs>
)}
value={tabValue}
onChange={handleTabChange}
variant="fullWidth"
>
<Tab
label="Workspace"
sx={{ pl: "0.75rem", pr: "0.75rem", fontSize: "0.75rem" }}
/>
<Tab
label="My Assets"
sx={{ pl: "0.75rem", pr: "0.75rem", fontSize: "0.75rem" }}
/>
</Tabs>
</Box>
)}
<TabPanel value={tabValue} index={0}>
<ListItem
component="div"
className="workspace-tab-header"
disablePadding
sx={{
marginTop: '0.75rem',
marginBottom: '0.75rem'
}}
>
<ListItemButton>
<ListItemButton sx={{
padding: '0.25rem 0.75rem 0.25rem 1rem'
}}>
<ListItemText
primary="Workspace resources"
primaryTypographyProps={{
fontWeight: 600,
variant: "body2",
}}
/>
<Stack direction="row" spacing={1}>
<Stack direction="row">
<SidebarIconButton>
<Tooltip
sx={{ marginLeft: "0.3em" }}
Expand Down Expand Up @@ -270,7 +279,9 @@ export default (props: WorkspaceProps | any) => {
</>
) : (
<Tooltip title="You do not have permissions to modify this workspace. Either clone it or create a new one if you need edit access.">
<LockOutlinedIcon sx={{ color: paragraph }} />
<SidebarIconButton>
<LockOutlinedIcon sx={{ color: paragraph }} />
</SidebarIconButton>
</Tooltip>
)}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ import {
bgInputs,
} from "../../../theme";
import { ResourceType } from "../../../apiclient/workspaces";
import { Typography } from "@mui/material";



const SidebarIconButton = styled(IconButton)(({ theme }) => ({
padding: 0,
"& .MuiSvgIcon-root": {
color: paragraph,
width: '1rem',
height: '1rem'
},
"&:hover": {
background: "none",
Expand All @@ -57,9 +60,7 @@ const ResourceItem = styled(ListItem)(({ theme }) => ({
color: lightWhite,
},
"& .MuiListItemButton-root": {
paddingLeft: "2.571rem",
paddingTop: 0,
paddingBottom: 0,
padding: '0.25rem 1rem 0.25rem 2.25rem',
"&:hover": {
background: workspaceItemBg,
},
Expand All @@ -85,6 +86,10 @@ const ResourceItem = styled(ListItem)(({ theme }) => ({
"& .active .MuiTypography-root": {
color: orangeText,
},
"& .MuiListItemText-root": {
margin: 0,
maxWidth: '10rem'
}
}));

const OSBResourceItem = (props: {
Expand Down Expand Up @@ -218,7 +223,7 @@ const WorkspaceResourceBrowser = (props: WorkspaceProps) => {

return (
<>
<ListItemButton onClick={() => setOpen(!open)}>
<ListItemButton sx={{ pt: '4px', pb: '4px' }} onClick={() => setOpen(!open)}>
<SidebarIconButton>
{open ? (
<ExpandLess fontSize="small" />
Expand All @@ -234,8 +239,9 @@ const WorkspaceResourceBrowser = (props: WorkspaceProps) => {
pl: "0.286rem",
}}
/>
<Typography>{resources.length}</Typography>
</ListItemButton>
<Box className="scrollbar">
<Box className="scrollbar" sx={{ paddingRight: '0 !important' }}>
{open &&
resources.map((resource) => (
<OSBResourceItem
Expand All @@ -256,7 +262,7 @@ const WorkspaceResourceBrowser = (props: WorkspaceProps) => {
return (
<Box className="verticalFill">
<Box width="100%" className="verticalFill">
<List className="verticalFill">
<List className="verticalFill" sx={{ pt: 0, pb: 0 }}>
{experimentalResources.length > 0 && (
<ResourceTreeGroup
resources={experimentalResources}
Expand Down
6 changes: 3 additions & 3 deletions applications/osb-portal/src/pages/WorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const WorkspacePage = (props: any) => {
item
xs={12}
sm={3}
lg={2}
lg={2.5}
sx={{
borderRight: `1px solid ${bgLightest}`,
}}
Expand All @@ -251,7 +251,7 @@ export const WorkspacePage = (props: any) => {
justifyContent={workspace?.thumbnail ? "center" : "start"}
xs={12}
sm={6}
lg={8}
lg={6.5}
id="workspace-detail-content"
className="verticalFit"
>
Expand Down Expand Up @@ -298,7 +298,7 @@ export const WorkspacePage = (props: any) => {
</Stack>
</Box>
</Grid>
<Grid item xs={12} sm={3} lg={2}>
<Grid item xs={12} sm={3} lg={2.5}>
<WorkspaceDetailsInfo workspace={workspace} />
</Grid>
</Grid>
Expand Down

0 comments on commit 8ab32ca

Please sign in to comment.