Skip to content

Commit 1ea4bb8

Browse files
authored
Switched to consistent Font Awesome chevrons for expander icons (#7713)
1 parent 00f1c58 commit 1ea4bb8

File tree

14 files changed

+102
-71
lines changed

14 files changed

+102
-71
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Added datetime-based visibility scheduling for assessments with `visible_on` and `visible_until` columns (#7697)
99
- Added new loading spinner icon for tables (#7602)
1010
- Added functionality to apply bonuses and penalties as a percentage of the student's earned marks to ExtraMark model (#7702)
11+
- Switched to consistent Font Awesome chevrons for expander icons (#7713)
1112

1213
### 🐛 Bug fixes
1314
- Fix name column search in graders table (#7693)

app/assets/stylesheets/common/_markus.scss

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,24 +1008,12 @@ nav {
10081008
}
10091009

10101010
/** Dropdown menu */
1011-
.arrow-down {
1012-
border-left: 7.5px solid transparent;
1013-
border-right: 7.5px solid transparent;
1014-
border-top: 7.5px solid $primary-one;
1015-
float: right;
1016-
height: 0;
1017-
margin-top: 4px;
1018-
width: 0;
1019-
}
1020-
1011+
.arrow-down,
10211012
.arrow-up {
1022-
border-bottom: 7.5px solid $primary-one;
1023-
border-left: 7.5px solid transparent;
1024-
border-right: 7.5px solid transparent;
1013+
color: $primary-one;
10251014
float: right;
1026-
height: 0;
1027-
margin-top: 4px;
1028-
width: 0;
1015+
margin-left: 5px;
1016+
margin-top: 1px;
10291017
}
10301018

10311019
.dropdown {
@@ -1100,11 +1088,6 @@ nav {
11001088
text-transform: uppercase;
11011089
}
11021090
}
1103-
1104-
.arrow-down,
1105-
.arrow-up {
1106-
margin-left: 5px;
1107-
}
11081091
}
11091092

11101093
.nested-submenu {

app/assets/stylesheets/common/_table.scss

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -237,30 +237,14 @@
237237
padding-right: 22px;
238238
}
239239

240+
.rt-expandable {
241+
text-align: center;
242+
}
243+
240244
.rt-expander {
241245
display: inline-block;
242246
position: relative;
243247
margin: 0 10px;
244-
color: transparent;
245-
246-
&::after {
247-
content: '';
248-
position: absolute;
249-
width: 0;
250-
height: 0;
251-
top: 50%;
252-
left: 50%;
253-
transform: translate(-50%, -50%) rotate(-90deg);
254-
border-left: 5.04px solid transparent;
255-
border-right: 5.04px solid transparent;
256-
border-top: 7px solid $sharp-line;
257-
transition: all 0.3s var(--easeOutBack);
258-
cursor: pointer;
259-
}
260-
261-
&.-open::after {
262-
transform: translate(-50%, -50%) rotate(0deg);
263-
}
264248
}
265249

266250
.rt-resizer {
@@ -453,7 +437,8 @@
453437
cursor: default;
454438
}
455439

456-
.rt-expander {
440+
.rt-expander,
441+
.rt-expander-custom {
457442
display: none;
458443
}
459444
}
@@ -520,21 +505,22 @@
520505
color: $sharp-line;
521506
}
522507

523-
.rt-expandable:empty {
524-
cursor: default;
525-
}
508+
.rt-tbody {
509+
.rt-td.rt-expandable {
510+
text-align: center;
526511

527-
.rt-expander::after {
528-
border-top-color: $sharp-line;
529-
}
512+
&:empty {
513+
cursor: default;
514+
}
530515

531-
.hide-rt-expander {
532-
&.rt-expandable {
533-
cursor: default;
534-
}
516+
&.hide-rt-expander {
517+
cursor: default;
535518

536-
.rt-expander {
537-
display: none;
519+
.rt-expander,
520+
.rt-expander-custom {
521+
display: none;
522+
}
523+
}
538524
}
539525
}
540526

app/assets/stylesheets/grader.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@
133133
font-weight: bold;
134134
padding-bottom: 5px;
135135

136-
.arrow-down,
137-
.arrow-up {
136+
.chevron-expandable {
137+
float: left;
138138
margin-right: 5px;
139+
margin-top: 2px;
139140
}
140141
}
141142

app/javascript/Components/DropDown/MultiSelectDropDown.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ export class MultiSelectDropdown extends React.Component {
6464
let expanded = this.state.expanded;
6565
let arrow;
6666
if (expanded !== false) {
67-
arrow = <span className="arrow-up" />;
67+
arrow = <FontAwesomeIcon className="arrow-up" icon="fa-chevron-up" />;
6868
} else {
69-
arrow = <span className="arrow-down" />;
69+
arrow = <FontAwesomeIcon className="arrow-down" icon="fa-chevron-down" />;
7070
}
7171

7272
return (

app/javascript/Components/DropDown/SingleSelectDropDown.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ export class SingleSelectDropDown extends React.Component {
5757

5858
renderArrow = () => {
5959
if (this.state.expanded !== false) {
60-
return <span className="arrow-up" data-testid={"arrow-up"} />;
60+
return <FontAwesomeIcon className="arrow-up" icon="fa-chevron-up" data-testid={"arrow-up"} />;
6161
} else {
62-
return <span className="arrow-down" data-testid={"arrow-down"} />;
62+
return (
63+
<FontAwesomeIcon className="arrow-down" icon="fa-chevron-down" data-testid={"arrow-down"} />
64+
);
6365
}
6466
};
6567

app/javascript/Components/Result/checkbox_criterion_input.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import PropTypes from "prop-types";
3+
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
34

45
import safe_marked from "../../common/safe_marked";
56

@@ -28,7 +29,10 @@ export default function CheckboxCriterionInput({
2829
>
2930
<div>
3031
<div className="criterion-name" onClick={toggleExpanded}>
31-
<div className={expanded ? "arrow-up" : "arrow-down"} style={{float: "left"}} />
32+
<FontAwesomeIcon
33+
className="chevron-expandable"
34+
icon={expanded ? "fa-chevron-up" : "fa-chevron-down"}
35+
/>
3236
{name}
3337
{bonus && ` (${I18n.t("activerecord.attributes.criterion.bonus")})`}
3438
{!released_to_students && !unassigned && mark !== null && (

app/javascript/Components/Result/flexible_criterion_input.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, {useState, useEffect, useRef} from "react";
22
import PropTypes from "prop-types";
3+
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
34

45
import safe_marked from "../../common/safe_marked";
56

@@ -163,7 +164,10 @@ export default function FlexibleCriterionInput({
163164
>
164165
<div data-testid={id}>
165166
<div className="criterion-name" onClick={toggleExpanded}>
166-
<div className={expanded ? "arrow-up" : "arrow-down"} style={{float: "left"}} />
167+
<FontAwesomeIcon
168+
className="chevron-expandable"
169+
icon={expanded ? "fa-chevron-up" : "fa-chevron-down"}
170+
/>
167171
{name}
168172
{bonus && ` (${I18n.t("activerecord.attributes.criterion.bonus")})`}
169173
{deleteManualMarkLink()}

app/javascript/Components/Result/rubric_criterion_input.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import PropTypes from "prop-types";
3+
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
34

45
import safe_marked from "../../common/safe_marked";
56

@@ -69,7 +70,10 @@ export default function RubricCriterionInput({
6970
>
7071
<div data-testid={id}>
7172
<div className="criterion-name" onClick={toggleExpanded}>
72-
<div className={expanded ? "arrow-up" : "arrow-down"} style={{float: "left"}} />
73+
<FontAwesomeIcon
74+
className="chevron-expandable"
75+
icon={expanded ? "fa-chevron-up" : "fa-chevron-down"}
76+
/>
7377
{name}
7478
{bonus && ` (${I18n.t("activerecord.attributes.criterion.bonus")})`}
7579
{!released_to_students && !unassigned && mark !== null && (

app/javascript/Components/Result/submission_file_panel.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
33

4+
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
5+
46
import {AnnotationManager} from "./annotation_manager";
57
import {FileViewer} from "./file_viewer";
68
import {DownloadSubmissionModal} from "./download_submission_modal";
@@ -321,10 +323,10 @@ export class FileSelector extends React.Component {
321323
const fileSelector = this.hashToHTMLList(this.props.fileData, this.state.expanded);
322324
let arrow, expand;
323325
if (this.state.expanded !== null) {
324-
arrow = <span className="arrow-up" />;
326+
arrow = <FontAwesomeIcon className="arrow-up" icon="fa-chevron-up" />;
325327
expand = null;
326328
} else {
327-
arrow = <span className="arrow-down" />;
329+
arrow = <FontAwesomeIcon className="arrow-down" icon="fa-chevron-down" />;
328330
expand = [];
329331
}
330332
let selectorLabel;

0 commit comments

Comments
 (0)