Skip to content

Commit e6e6a10

Browse files
committed
[skip ui] Merge branch 'staging' into prettier-changes
2 parents f085aba + 74cc915 commit e6e6a10

File tree

13 files changed

+104
-48
lines changed

13 files changed

+104
-48
lines changed

apps/src/sites/studio/pages/teacher_dashboard/show.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ $(document).ready(function() {
105105
{...props}
106106
studioUrlPrefix={scriptData.studioUrlPrefix}
107107
pegasusUrlPrefix={scriptData.pegasusUrlPrefix}
108+
sectionName={section.name}
108109
/>
109110
)}
110111
/>

apps/src/templates/NavigationBarLink.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ export default class NavigationBarLink extends React.Component {
3030
const {label, url} = this.props;
3131

3232
return (
33-
<NavLink
34-
to={`/${url}`}
35-
style={styles.link}
36-
activeStyle={styles.activeLink}
37-
>
33+
<NavLink to={url} style={styles.link} activeStyle={styles.activeLink}>
3834
<span>{label}</span>
3935
</NavLink>
4036
);

apps/src/templates/SmallChevronLink.jsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
22
import React, {Component} from 'react';
33
import FontAwesome from './FontAwesome';
44
import color from '../util/color';
5+
import {makeEnum} from '@cdo/apps/utils';
56

67
const styles = {
78
link: {
@@ -32,26 +33,38 @@ const styles = {
3233
}
3334
};
3435

36+
const ChevronSide = makeEnum('left', 'right');
37+
3538
export default class SmallChevronLink extends Component {
3639
static propTypes = {
3740
linkText: PropTypes.string.isRequired,
3841
link: PropTypes.string.isRequired,
39-
isRtl: PropTypes.bool.isRequired
42+
isRtl: PropTypes.bool.isRequired,
43+
chevronSide: PropTypes.oneOf(Object.values(ChevronSide))
4044
};
4145

42-
render() {
43-
const {link, linkText, isRtl} = this.props;
44-
46+
renderChevron = () => {
47+
const {isRtl} = this.props;
4548
const icon = isRtl ? 'chevron-left' : 'chevron-right';
4649

50+
return (
51+
<FontAwesome
52+
icon={icon}
53+
style={isRtl ? styles.chevronRtl : styles.chevron}
54+
/>
55+
);
56+
};
57+
58+
render() {
59+
const {link, linkText, chevronSide} = this.props;
60+
4761
return (
4862
<div style={styles.linkBox}>
4963
<a href={link} style={styles.link}>
64+
{chevronSide === ChevronSide.left && this.renderChevron()}
5065
<h3 style={styles.link}>{linkText}</h3>
51-
<FontAwesome
52-
icon={icon}
53-
style={isRtl ? styles.chevronRtl : styles.chevron}
54-
/>
66+
{(!chevronSide || chevronSide === ChevronSide.right) &&
67+
this.renderChevron()}
5568
</a>
5669
</div>
5770
);

apps/src/templates/manageStudents/ManageStudentsAgeCell.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ class ManageStudentAgeCell extends Component {
3030
<div>
3131
{!this.props.isEditing && <div>{age}</div>}
3232
{this.props.isEditing && (
33-
<select name="age" value={editedValue} onChange={this.onChangeAge}>
33+
<select
34+
style={{width: 50}}
35+
name="age"
36+
value={editedValue}
37+
onChange={this.onChangeAge}
38+
>
3439
{ages.map(age => (
3540
<option key={age} value={age}>
3641
{age}

apps/src/templates/manageStudents/ManageStudentsTable.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const styles = {
4848
},
4949
buttonWithMargin: {
5050
marginRight: 5
51+
},
52+
verticalAlign: {
53+
display: 'flex',
54+
alignItems: 'center'
5155
}
5256
};
5357

@@ -288,7 +292,7 @@ class ManageStudentsTable extends Component {
288292
/>
289293
)}
290294
{numberOfEditingRows <= 1 && (
291-
<span>
295+
<span style={styles.verticalAlign}>
292296
<div style={styles.headerName}>{i18n.actions()}</div>
293297
<div style={styles.headerIcon}>
294298
<ManageStudentsActionsHeaderCell
@@ -304,7 +308,7 @@ class ManageStudentsTable extends Component {
304308

305309
projectSharingHeaderFormatter = () => {
306310
return (
307-
<span>
311+
<span style={styles.verticalAlign}>
308312
<div style={styles.headerName} data-for="explain-sharing" data-tip="">
309313
{i18n.projectSharingColumnHeader()}
310314
</div>

apps/src/templates/projects/SectionProjectsList.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const styles = {
99
float: 'right'
1010
},
1111
filterRow: {
12-
backgroundColor: 'transparent',
13-
padding: 10
12+
paddingBottom: 10
1413
},
1514
clearDiv: {
1615
clear: 'both'

apps/src/templates/sectionAssessments/SectionAssessments.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class SectionAssessments extends Component {
200200
</div>
201201
)}
202202
{totalStudentSubmissions <= 0 && (
203-
<h3>{i18n.emptyAssessmentSubmissions()}</h3>
203+
<div>{i18n.emptyAssessmentSubmissions()}</div>
204204
)}
205205
<SubmissionStatusAssessmentsContainer />
206206
{totalStudentSubmissions > 0 && (
@@ -237,7 +237,7 @@ class SectionAssessments extends Component {
237237
</div>
238238
)}
239239
{totalStudentSubmissions <= 0 && (
240-
<h3>{i18n.emptySurveyOverviewTable()}</h3>
240+
<div>{i18n.emptySurveyOverviewTable()}</div>
241241
)}
242242
</div>
243243
)}
@@ -257,9 +257,7 @@ class SectionAssessments extends Component {
257257
</div>
258258
)}
259259
{!isLoading && assessmentList.length === 0 && (
260-
<div style={styles.empty}>
261-
<h3>{i18n.noAssessments()}</h3>
262-
</div>
260+
<div style={styles.empty}>{i18n.noAssessments()}</div>
263261
)}
264262
</div>
265263
);

apps/src/templates/teacherDashboard/SelectSectionDropdown.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import {navigateToHref} from '@cdo/apps/utils';
77
const styles = {
88
container: {
99
display: 'flex',
10-
alignItems: 'center',
11-
justifyContent: 'flex-end',
12-
marginBottom: 10
10+
alignItems: 'center'
1311
},
1412
dropdown: {
1513
marginLeft: 10,

apps/src/templates/teacherDashboard/TeacherDashboard.jsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
33
import {Route, Switch} from 'react-router-dom';
4-
import SelectSectionDropdown from './SelectSectionDropdown';
5-
import TeacherDashboardNavigation from './TeacherDashboardNavigation';
4+
import TeacherDashboardHeader from './TeacherDashboardHeader';
65
import StatsTableWithData from './StatsTableWithData';
76
import SectionProgress from '@cdo/apps/templates/sectionProgress/SectionProgress';
87
import ManageStudents from '@cdo/apps/templates/manageStudents/ManageStudents';
@@ -15,24 +14,26 @@ export default class TeacherDashboard extends Component {
1514
static propTypes = {
1615
studioUrlPrefix: PropTypes.string.isRequired,
1716
pegasusUrlPrefix: PropTypes.string.isRequired,
17+
sectionName: PropTypes.string.isRequired,
1818

1919
// Provided by React router in parent.
2020
location: PropTypes.object.isRequired
2121
};
2222

2323
render() {
24-
const {location, studioUrlPrefix, pegasusUrlPrefix} = this.props;
24+
const {
25+
location,
26+
studioUrlPrefix,
27+
pegasusUrlPrefix,
28+
sectionName
29+
} = this.props;
30+
2531
// Include header components unless we are on the /print_login_cards page.
2632
const includeHeader = location.pathname !== '/print_login_cards';
2733

2834
return (
2935
<div>
30-
{includeHeader && (
31-
<div>
32-
<SelectSectionDropdown />
33-
<TeacherDashboardNavigation />
34-
</div>
35-
)}
36+
{includeHeader && <TeacherDashboardHeader sectionName={sectionName} />}
3637
<Switch>
3738
<Route path="/stats" component={props => <StatsTableWithData />} />
3839
<Route path="/progress" component={props => <SectionProgress />} />
@@ -65,8 +66,12 @@ export default class TeacherDashboard extends Component {
6566
/>
6667
)}
6768
/>
68-
{/* Render <SectionProgress/> by default */}
69-
<Route component={props => <SectionProgress />} />
69+
{/* Render <ManageStudents/> by default */}
70+
<Route
71+
component={props => (
72+
<ManageStudents studioUrlPrefix={studioUrlPrefix} />
73+
)}
74+
/>
7075
</Switch>
7176
</div>
7277
);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import i18n from '@cdo/locale';
4+
import SmallChevronLink from '../SmallChevronLink';
5+
import SelectSectionDropdown from './SelectSectionDropdown';
6+
import TeacherDashboardNavigation from './TeacherDashboardNavigation';
7+
8+
const styles = {
9+
headerContainer: {
10+
display: 'flex',
11+
justifyContent: 'space-between'
12+
}
13+
};
14+
15+
export default class TeacherDashboardHeader extends React.Component {
16+
static propTypes = {
17+
sectionName: PropTypes.string.isRequired
18+
};
19+
20+
render() {
21+
return (
22+
<div>
23+
<SmallChevronLink
24+
link="/home#classroom-sections"
25+
linkText={i18n.viewAllSections()}
26+
isRtl={true}
27+
chevronSide="left"
28+
/>
29+
<div style={styles.headerContainer}>
30+
<h1>{this.props.sectionName}</h1>
31+
<SelectSectionDropdown />
32+
</div>
33+
<TeacherDashboardNavigation />
34+
</div>
35+
);
36+
}
37+
}

apps/src/templates/teacherDashboard/TeacherDashboardNavigation.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ import i18n from '@cdo/locale';
55
const teacherDashboardLinks = [
66
{
77
label: i18n.teacherTabManageStudents(),
8-
url: 'manage_students'
8+
url: '/manage_students'
99
},
1010
{
1111
label: i18n.teacherTabProjects(),
12-
url: 'projects'
12+
url: '/projects'
1313
},
1414
{
1515
label: i18n.teacherTabStats(),
16-
url: 'stats'
16+
url: '/stats'
1717
},
1818
{
1919
label: i18n.teacherTabStatsTextResponses(),
20-
url: 'text_responses'
20+
url: '/text_responses'
2121
},
2222
{
2323
label: i18n.teacherTabProgress(),
24-
url: 'progress'
24+
url: '/progress'
2525
},
2626
{
2727
label: i18n.teacherTabAssessments(),
28-
url: 'assessments'
28+
url: '/assessments'
2929
}
3030
];
3131

dashboard/test/ui/features/teacher_dashboard.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Feature: Using the teacher dashboard
3535
# Assessments and surveys tab
3636
When I click selector "#learn-tabs a:contains('Assessments/Surveys')" once I see it
3737
And I wait until element "#uitest-course-dropdown" is visible
38-
And I wait until element "h3:contains(no submissions for this assessment)" is visible
39-
And I wait until element "h3:contains(this survey is anonymous)" is not visible
38+
And I wait until element "div:contains(no submissions for this assessment)" is visible
39+
And I wait until element "div:contains(this survey is anonymous)" is not visible
4040
And I select the "Lesson 30: Anonymous student survey" option in dropdown "assessment-selector"
41-
And I wait until element "h3:contains(this survey is anonymous)" is visible
42-
And I wait until element "h3:contains(no submissions for this assessment)" is not visible
41+
And I wait until element "div:contains(this survey is anonymous)" is visible
42+
And I wait until element "div:contains(no submissions for this assessment)" is not visible
4343

4444
Scenario: Loading section projects
4545
Given I create a teacher-associated student named "Sally"

dashboard/test/ui/features/teacher_dashboard_assessments1.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ Feature: Using the assessments tab in the teacher dashboard
2929
# Assessments tab
3030
When I click selector "#learn-tabs a:contains('Assessments/Surveys')" once I see it
3131
And I wait until element "#uitest-course-dropdown" is visible
32-
Then I wait until element "h3:contains(this survey is anonymous)" is visible
32+
Then I wait until element "div:contains(this survey is anonymous)" is visible

0 commit comments

Comments
 (0)