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

update classes to prevent cutoff of left side of project table #1934

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
343cee9
removed width:100% from contentContainer class when no sidebar
roslynwythe Nov 4, 2024
da38f7b
Merge branch 'develop' of https://github.com/hackforla/tdm-calculator…
roslynwythe Nov 13, 2024
d5a526e
remove `overflow-y: scroll from body tag
roslynwythe Nov 14, 2024
a5af5f2
add max-width and wrapper div to div.tableContainer
roslynwythe Nov 14, 2024
0670b5d
remove vertical scrollbar from body
roslynwythe Nov 17, 2024
96f7356
modify styles on thead and popover, so heading is sticky and popover …
roslynwythe Nov 17, 2024
b8b92c6
restore 100% width on contentContainer
roslynwythe Nov 17, 2024
512a826
tableContainer height must be calculated based on em
roslynwythe Nov 20, 2024
5b26664
Remove scrolling from body
roslynwythe Nov 20, 2024
c44e6f4
reduce minHeight of ContentContainer
roslynwythe Nov 20, 2024
25536fa
correct minHeight of contentContainer to allow for changes in font size
roslynwythe Nov 20, 2024
36e3f77
Merge branch 'develop' of https://github.com/hackforla/tdm-calculator…
roslynwythe Nov 20, 2024
1bb8cd1
restore vertical scrolling on body tag so other scrolling works on ot…
roslynwythe Nov 21, 2024
4b0e6b7
make room for inner scroll bar
roslynwythe Nov 22, 2024
12383ac
set maxWIdth on the multi project toolbar
roslynwythe Nov 22, 2024
b5062c1
slight adjustment to height of contentContainer
roslynwythe Nov 22, 2024
c64647e
use js to change the body style in the ProjectsPage component
roslynwythe Nov 22, 2024
8284c54
Merge branch 'develop' of https://github.com/hackforla/tdm-calculator…
roslynwythe Nov 22, 2024
fb8a38a
set width of the Multi Project Toolbar
roslynwythe Nov 22, 2024
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
2 changes: 1 addition & 1 deletion client/src/components/Layout/ContentContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useStyles = createUseStyles({
flex: "1",
display: "flex",
flexDirection: "row",
minHeight: "calc(100vh - 103px - 48px)"
minHeight: "calc(100vh - 71px - 5em)"
},
content: {
boxSizing: "border-box",
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Layout/ContentContainerNoSidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useStyles = createUseStyles({
flexDirection: "column",
justifyContent: "flex-start",
alignItems: "center",
minHeight: "calc(100vh - 103px - 48px)",
minHeight: "calc(100vh - 71px - 5em)",
margin: "auto",
width: "100%"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const ProjectTableColumnHeader = ({
<div style={{ width: "100%", height: "100%" }}>
{header.id !== "checkAllProjects" && header.id !== "contextMenu" ? (
<Popover
containerStyle={{ zIndex: 2 }}
isOpen={isPopoverOpen}
positions={["bottom", "left", "right", "top"]} // preferred positions by priority
align="start"
Expand Down
145 changes: 81 additions & 64 deletions client/src/components/Projects/ProjectsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ const useStyles = createUseStyles({
textAlign: "left"
},
thead: {
position: "sticky",
top: 0,
zIndex: 1,
fontWeight: "bold",
backgroundColor: "#002E6D",
color: "white",
Expand Down Expand Up @@ -121,9 +124,14 @@ const useStyles = createUseStyles({
textAlign: "center"
},
tableContainer: {
overflow: "visible", // changed to allow Universal Select to show above the page container when expanded
width: "100%",
margin: "20px 0px"
overflow: "auto", // changed to allow Universal Select to show above the page container when expanded
width: "calc(100vw - 20px)",
margin: "20px 0px",
height: "calc(100vh - 275px - 11.34em)"
},
fixTableHead: {
overflowY: "auto",
height: "4em"
},
pageContainer: {
display: "flex",
Expand Down Expand Up @@ -871,6 +879,8 @@ const ProjectsPage = ({ contentContainerRef }) => {
indexOfLastPost
);

document.body.style.overflowX = "hidden"; // prevent page level scrolling, becauase the table is scrollable

return (
<ContentContainerNoSidebar contentContainerRef={contentContainerRef}>
<div className={classes.outerDiv}>
Expand Down Expand Up @@ -907,7 +917,8 @@ const ProjectsPage = ({ contentContainerRef }) => {
style={{
display: "flex",
flexDirection: "row",
justifyContent: "flex-start"
justifyContent: "flex-start",
width: "100vw"
}}
>
<MemoizedMultiProjectToolbar
Expand Down Expand Up @@ -961,67 +972,73 @@ const ProjectsPage = ({ contentContainerRef }) => {
</div>
</div>
</div>
<div className={classes.tableContainer}>
<table className={classes.table}>
<thead className={classes.thead}>
<tr className={classes.tr}>
{headerData.map(header => {
return (
<td key={header.id}>
<ProjectTableColumnHeader
projects={projects}
filter={filter}
header={header}
criteria={criteria}
setCriteria={setCriteria}
setSort={setSort}
order={order}
orderBy={orderBy}
setCheckedProjectIds={setCheckedProjectIds}
setSelectAllChecked={setSelectAllChecked}
/>
</td>
);
})}
</tr>
</thead>
<tbody className={classes.tbody}>
{projects.length ? (
currentProjects.map(project => (
<ProjectTableRow
key={project.id}
project={project}
handleCsvModalOpen={handleCsvModalOpen}
handleCopyModalOpen={handleCopyModalOpen}
handleDeleteModalOpen={handleDeleteModalOpen}
handleSnapshotModalOpen={handleSnapshotModalOpen}
handleRenameSnapshotModalOpen={
handleRenameSnapshotModalOpen
}
handleShareSnapshotModalOpen={
handleShareSnapshotModalOpen
}
handleHide={handleHide}
handleCheckboxChange={handleCheckboxChange}
checkedProjectIds={checkedProjectIds}
isAdmin={isAdmin}
droOptions={droOptions}
onDroChange={handleDroChange} // Pass the DRO change handler
onAdminNoteUpdate={handleAdminNoteUpdate} // Pass the admin note update handler
droName={
isAdmin ? null : droNameMap[project.droId] || "N/A"
} // Pass the droName
/>
))
) : (
<tr>
<td colSpan={9} className={classes.tdNoSavedProjects}>
No Saved Projects
</td>
<div>
<div className={classes.tableContainer}>
<table className={classes.table}>
<thead className={classes.thead}>
<tr className={classes.tr}>
{headerData.map(header => {
return (
<td key={header.id}>
<th className={classes.stickyTh}>
<ProjectTableColumnHeader
projects={projects}
filter={filter}
header={header}
criteria={criteria}
setCriteria={setCriteria}
setSort={setSort}
order={order}
orderBy={orderBy}
setCheckedProjectIds={setCheckedProjectIds}
setSelectAllChecked={setSelectAllChecked}
/>
</th>
</td>
);
})}
</tr>
)}
</tbody>
</table>
</thead>
<tbody className={classes.tbody}>
{projects.length ? (
currentProjects.map(project => (
<ProjectTableRow
key={project.id}
project={project}
handleCsvModalOpen={handleCsvModalOpen}
handleCopyModalOpen={handleCopyModalOpen}
handleDeleteModalOpen={handleDeleteModalOpen}
handleSnapshotModalOpen={handleSnapshotModalOpen}
handleRenameSnapshotModalOpen={
handleRenameSnapshotModalOpen
}
handleShareSnapshotModalOpen={
handleShareSnapshotModalOpen
}
handleHide={handleHide}
handleCheckboxChange={handleCheckboxChange}
checkedProjectIds={checkedProjectIds}
isAdmin={isAdmin}
droOptions={droOptions}
onDroChange={handleDroChange} // Pass the DRO change handler
onAdminNoteUpdate={handleAdminNoteUpdate} // Pass the admin note update handler
droName={
isAdmin
? null
: droNameMap[project.droId] || "N/A"
} // Pass the droName
/>
))
) : (
<tr>
<td colSpan={9} className={classes.tdNoSavedProjects}>
No Saved Projects
</td>
</tr>
)}
</tbody>
</table>
</div>
</div>
<div className={classes.pageContainer}>
<Pagination
Expand Down
Loading