Skip to content

Commit

Permalink
Merge pull request #362 from raccoongang/fix/fix-responsive-issues
Browse files Browse the repository at this point in the history
fix: fix sidebar scrolling and adaptation for mobile
  • Loading branch information
arbrandes authored Apr 3, 2024
2 parents 66bae17 + 8a1ccc7 commit 789e1db
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 13 deletions.
20 changes: 15 additions & 5 deletions src/components/GradebookHeader/__snapshots__/test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ exports[`GradebookHeader component snapshots default values (grades frozen, cann
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
fakeID
</h2>
</div>
Expand Down Expand Up @@ -75,7 +77,9 @@ exports[`GradebookHeader component snapshots grades frozen, can view. grades fro
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
fakeID
</h2>
</div>
Expand Down Expand Up @@ -121,7 +125,9 @@ exports[`GradebookHeader component snapshots grades frozen, cannot view unauthor
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
fakeID
</h2>
</div>
Expand Down Expand Up @@ -177,7 +183,9 @@ exports[`GradebookHeader component snapshots show bulk management, active view i
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
fakeID
</h2>
<Button
Expand Down Expand Up @@ -233,7 +241,9 @@ exports[`GradebookHeader component snapshots show bulk management, active view i
<div
className="subtitle-row d-flex justify-content-between align-items-center"
>
<h2>
<h2
className="text-break"
>
fakeID
</h2>
<Button
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 @@ -47,7 +47,7 @@ export class GradebookHeader extends React.Component {
<FormattedMessage {...messages.gradebook} />
</h1>
<div className="subtitle-row d-flex justify-content-between align-items-center">
<h2>{this.props.courseId}</h2>
<h2 className="text-break">{this.props.courseId}</h2>
{ this.props.showBulkManagement && (
<Button
variant="tertiary"
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradesView/FilterMenuToggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const FilterMenuToggle = ({ toggleFilterDrawer }) => (
className="btn-primary align-self-start"
onClick={toggleFilterDrawer}
>
<Icon className="fa fa-filter" /> <FormattedMessage {...messages.editFilters} />
<Icon className="fa fa-filter mr-1" /> <FormattedMessage {...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;
}
}
2 changes: 1 addition & 1 deletion src/components/GradesView/SearchControls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class SearchControls extends React.Component {

render() {
return (
<div>
<div className="search-container">
<SearchField
onSubmit={this.onSubmit}
inputLabel={<FormattedMessage {...messages.label} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`FilterMenuToggle component snapshots basic snapshot 1`] = `
onClick={[MockFunction this.props.toggleFilterDrawer]}
>
<Icon
className="fa fa-filter"
className="fa fa-filter mr-1"
/>
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SearchControls Component Snapshots basic snapshot 1`] = `
<div>
<div
className="search-container"
>
<SearchField
inputLabel={
<FormattedMessage
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradesView/__snapshots__/test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`GradesView Component snapshots basic snapshot 1`] = `
/>
</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 @@ -50,7 +50,7 @@ export class GradesView extends React.Component {
<FormattedMessage {...messages.filterStepHeading} />
</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 789e1db

Please sign in to comment.