Skip to content

Commit

Permalink
Merge branch 'filter_modal' of github.com:khushiagl/Markus into filte…
Browse files Browse the repository at this point in the history
…r_modal
  • Loading branch information
khushiagl committed Jul 18, 2023
2 parents ebb00fa + 26a133e commit 4a7a3b6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/Components/Helpers/range_filter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class RangeFilter extends React.Component {
max={max}
onChange={() => {}}
/>
<span>to</span>
<span>{I18n.t("results.filters.range_value_separator")}</span>
<input
className={"input-max"}
type="number"
Expand Down
17 changes: 10 additions & 7 deletions app/assets/javascripts/Components/Modals/filter_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {SingleSelectDropDown} from "../../DropDownMenu/SingleSelectDropDown";
import {RangeFilter} from "../Helpers/range_filter";

const INITIAL_MODAL_STATE = {
currentOrderBy: "Group Name",
currentOrderBy: I18n.t("results.filters.ordering.group_name"),
currentAscBool: true,
currentAnnotationValue: "",
currentSectionValue: "",
Expand Down Expand Up @@ -208,12 +208,15 @@ export class FilterModal extends React.Component {
<div className={"filter"} data-testid={"order-by"}>
<p>{I18n.t("results.filters.order_by")} </p>
<SingleSelectDropDown
options={["Group Name", "Submission Date"]}
options={[
I18n.t("results.filters.ordering.group_name"),
I18n.t("submissions.commit_date"),
]}
selected={this.state.currentOrderBy}
select={selection => {
this.setState({currentOrderBy: selection});
}}
defaultValue={"Group Name"}
defaultValue={I18n.t("results.filters.ordering.group_name")}
/>
<div
className={"order"}
Expand All @@ -230,7 +233,7 @@ export class FilterModal extends React.Component {
onChange={() => {}}
data-testid={"ascending"}
/>
<label htmlFor="Asc">Ascending</label>
<label htmlFor="Asc">{I18n.t("results.filters.ordering.ascending")}</label>
<input
type="radio"
checked={!this.state.currentAscBool}
Expand All @@ -239,11 +242,11 @@ export class FilterModal extends React.Component {
onChange={() => {}}
data-testid={"descending"}
/>
<label htmlFor="Desc">Descending</label>
<label htmlFor="Desc">{I18n.t("results.filters.ordering.descending")}</label>
</div>
</div>
<div className={"filter"} data-testid={"marking-state"}>
<p>Marking State</p>
<p>{I18n.t("results.filters.marking_state")}</p>
<SingleSelectDropDown
options={[
I18n.t("submissions.state.in_progress"),
Expand All @@ -264,7 +267,7 @@ export class FilterModal extends React.Component {
{this.renderTagsDropdown()}
</div>
<div className={"filter"} data-testid={"section"}>
<p>Section</p>
<p>{I18n.t("results.filters.section")}</p>
<SingleSelectDropDown
options={this.props.sections}
selected={this.state.currentSectionValue}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/Components/Result/result.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const INITIAL_ANNOTATION_MODAL_STATE = {

const INITIAL_FILTER_MODAL_STATE = {
ascBool: true,
orderBy: "Group Name",
orderBy: I18n.t("results.filters.ordering.group_name"),
annotationValue: "",
tas: [],
tags: [],
Expand Down
37 changes: 21 additions & 16 deletions config/locales/views/results/en.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
---
en:
results:
filter_modal: Filter Submissions
filters:
clear_all: Clear All
save: Save
filter_by: 'Filter By:'
text_box_placeholder: Type here
annotation: Annotation
tas: TAs
tags: Tags
marking_state: Marking State
sections: Sections
order_by: Order By
total_mark: Total Mark
total_extra_mark: Total Extra Mark
no_options: No options available
invalid_range: Invalid Range
annotation:
across_all_submission_files: Click on the filename to jump to the annotation.
common: Common Annotations
Expand Down Expand Up @@ -45,6 +29,27 @@ en:
delete_extra_mark_confirm: Are you sure you want to remove this extra mark?
expand_all: Expand All
expand_unmarked: Expand Unmarked
filter_modal: Filter Submissions
filters:
annotation: Annotation
clear_all: Clear All
filter_by: 'Filter By:'
invalid_range: Invalid Range
marking_state: Marking State
no_options: No options available
order_by: Order By
ordering:
ascending: Ascending
descending: Descending
group_name: Group Name
range_value_separator: to
save: Save
section: Section
tags: Tags
tas: TAs
text_box_placeholder: Type here
total_extra_mark: Total Extra Mark
total_mark: Total Mark
fullscreen_enter: Fullscreen
fullscreen_exit: Leave fullscreen
keybinding:
Expand Down

0 comments on commit 4a7a3b6

Please sign in to comment.