Skip to content

Commit

Permalink
fix: fix sidebar scrolling and adaptation for mobile
Browse files Browse the repository at this point in the history
- fix text overload in heading
- fix appearance for sidebar with a short main content
- fix transformation of search and filter button on mobile
- fix extra empty space below main content table
- fix adaptation modal content to mobile view
  • Loading branch information
ihor-romaniuk committed Oct 27, 2023
1 parent b536180 commit f303712
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 11 deletions.
16 changes: 12 additions & 4 deletions src/components/GradebookHeader/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ exports[`GradebookHeader component render default view shapshot 1`] = `
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
test-course-id
</h2>
</div>
Expand Down Expand Up @@ -49,7 +51,9 @@ exports[`GradebookHeader component render frozen grades snapshot: show frozen wa
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
test-course-id
</h2>
</div>
Expand Down Expand Up @@ -83,7 +87,9 @@ exports[`GradebookHeader component render show bulk management snapshot: show to
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
test-course-id
</h2>
<Button
Expand Down Expand Up @@ -117,7 +123,9 @@ exports[`GradebookHeader component render user cannot view gradebook snapshot: s
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
test-course-id
</h2>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradebookHeader/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const GradebookHeader = () => {
</a>
<h1>{formatMessage(messages.gradebook)}</h1>
<div className="subtitle-row d-flex justify-content-between align-items-center">
<h2>{courseId}</h2>
<h2 className="text-break">{courseId}</h2>
{showBulkManagement && (
<Button variant="tertiary" onClick={handleToggleViewClick}>
{formatMessage(toggleViewMessage)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`FilterMenuToggle component render snapshot 1`] = `
onClick={[MockFunction hooks.toggleFilterMenu]}
>
<Icon
className="mr-1"
src="FilterAlt"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradesView/FilterMenuToggle/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const FilterMenuToggle = () => {
className="btn-primary align-self-start"
onClick={toggleFilterMenu}
>
<Icon src={FilterAlt} /> {formatMessage(messages.editFilters)}
<Icon src={FilterAlt} className="mr-1" /> {formatMessage(messages.editFilters)}
</Button>
);
};
Expand Down
34 changes: 33 additions & 1 deletion src/components/GradesView/GradesView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
}
.grade-history-header{
float: left;
min-width: 170px;
}

.grade-history-assignment{
Expand All @@ -65,7 +66,7 @@
.gradebook-container {
width: 100%;
overflow-x: auto;
height: 600px;
max-height: 600px;
overflow-y: auto;
position: relative;
}
Expand Down Expand Up @@ -122,3 +123,34 @@ select#ScoreView.form-control {
border-right-color: $black;
}
}

#edit-filters-btn {
@include media-breakpoint-down(xs) {
width: 100%;
margin-bottom: 1rem;
}
}

.search-container {
@include media-breakpoint-down(xs) {
width: 100%;
}
}

.pgn__modal-body-content .pgn__data-table-layout-wrapper {
@include media-breakpoint-down(sm) {
clear: both;
padding: 1rem 0;
}
}

.page-gradebook {
position: relative;

.sidebar-container {
position: relative;
}
aside.sidebar {
overflow: auto;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SearchControls component render snapshot 1`] = `
<div>
<div
className="search-container"
>
<SearchField
inputLabel="test-input-label"
onBlur={[MockFunction hooks.onBlur]}
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradesView/SearchControls/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SearchControls = () => {
} = useSearchControlsData();

return (
<div>
<div className="search-container">
<SearchField
onSubmit={onSubmit}
inputLabel={inputLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`GradesView component render snapshot 1`] = `
filter-step-heading
</h3>
<div
className="d-flex justify-content-between"
className="d-flex justify-content-between flex-wrap"
>
<FilterMenuToggle />
<SearchControls />
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradesView/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const GradesView = ({ updateQueryParams }) => {
{stepHeadings.filter}
</h3>

<div className="d-flex justify-content-between">
<div className="d-flex justify-content-between flex-wrap">
<FilterMenuToggle />
<SearchControls />
</div>
Expand Down

0 comments on commit f303712

Please sign in to comment.