-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSidebarView.jsx
More file actions
141 lines (132 loc) · 7.49 KB
/
Copy pathSidebarView.jsx
File metadata and controls
141 lines (132 loc) · 7.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import React from 'react';
import ToggleField from "./Components/SideBarComponents/ToggleField.jsx";
import SliderField from "./Components/SideBarComponents/SliderField.jsx";
import DropDownField from "./Components/SideBarComponents/DropDownField.jsx";
import CollapsibleCheckboxes from './Components/SideBarComponents/CollapsibleCheckboxes.jsx';
import Tooltip from './Components/SideBarComponents/ToolTip.jsx';
import UploadField from './Components/SideBarComponents/UploadField';
import MultipleChoiceButtons from './Components/SideBarComponents/MultipleChoiceButtons.jsx';
/**
* Represents the sidebar and consists of an upload field, dropdown field, toggle fields, sliders, etc.
* It shows the filters and settings for the search. The view is invoked by the SidebarPresenter.
* @param {*} props
*/
function SidebarView(props) {
return (
<div className='object-center text-white p-3 pt-2 flex-col h-screen
overflow-y-scroll overflow-x-hidden'
style={{
scrollbarWidth: "thin",
scrollbarColor: "#888 #f1f1f1",
}}
>
<h6 className="m-2 text-lg font-medium text-white text-center">
Filters
</h6>
{/*<UploadTranscriptPresenter
HandleFilterChange={props.HandleFilterChange}
filterName="transcript"
HandleFilterEnable={props.HandleFilterEnable}
reApplyFilter={props.reApplyFilter}
filterEnable={props.initialApplyTranscriptFilter}
initialValue={props.initialTranscriptElegiblityValue}
/>*/}
<UploadField
errorMessage={props.PdfErrorMessage} //
errorVisibility={props.PdfErrorVisibility} //
handleFileChange={props.PdfHandleFileChange} //
fileInputValue={props.PdfFileInputValue} //
HandleFilterEnable={props.HandleFilterEnable}
HandleFilterChange={props.HandleFilterChange}
filterName="transcript"
reApplyFilter={props.reApplyFilter}
filterEnable={props.initialApplyTranscriptFilter}
initialValue={props.initialTranscriptElegiblityValue}
/>
<div className='flex-auto justify-center '>
<div className="z-10 w-100% rounded-lg justify-center pb-10" >
<DropDownField
options={["Preparatory", "Basic", "Advanced", "Research"]}
HandleFilterChange={props.HandleFilterChange}
filterName="level"
initialValues={props.initialLevelFilterOptions}
filterEnable = {props.initialLevelFilterEnable}
HandleFilterEnable={props.HandleFilterEnable}
description="Filter by the level of the courses. Basic courses correspond to bachelor courses, Advanced to master courses."
/>
<ToggleField
fields={["English", "Swedish"]}
HandleFilterChange={props.HandleFilterChange}
filterName="language"
initialValues={props.initialLanguageFilterOptions}
filterEnable = {props.initialLanguageFilterEnable}
HandleFilterEnable={props.HandleFilterEnable}
description="Filter language. If you select both, courses which are offered both in English and Swedish are going to be on the top."
/>
<MultipleChoiceButtons
items={["P1", "P2", "P3", "P4"]}
HandleFilterChange={props.HandleFilterChange}
filterName="period"
initialValues={props.initialPeriodFilterOptions}
filterEnable = {props.initialPeriodFilterEnable}
HandleFilterEnable={props.HandleFilterEnable}
description="Filter by the period a course is given, the autumn semester consists of P1 and P2, while the spring semester is P3 and P4.
Courses offered over multiple periods will also show up."
/>
<DropDownField
options={props.LocationFilterField}
HandleFilterChange={props.HandleFilterChange}
filterName="location"
initialValues={props.initialLocationFilterOptions}
filterEnable = {props.initialLocationFilterEnable}
HandleFilterEnable={props.HandleFilterEnable}
description="Filter the location a course is offered. Courses offered only online may get filtered out if this option is selected."
/>
<SliderField
HandleFilterChange={props.HandleFilterChange}
filterName="credits"
initialValues={props.initialCreditsFilterOptions}
filterEnable = {props.initialCreditsFilterEnable}
HandleFilterEnable={props.HandleFilterEnable}
description="Select a range of credits (hp.) the courses shown should fall into (inclusive)"
/>
<CollapsibleCheckboxes
HandleFilterChange={props.HandleFilterChange}
filterName="department"
initialValues={props.initialDepartmentFilterOptions}
filterEnable = {props.initialDepartmentFilterEnable}
HandleFilterEnable={props.HandleFilterEnable}
fields={
props.DepartmentFilterField
}
description="Filter for the departments the course is given by. Useful for finding courses in a variety of specifics topics."
/>
<div className='mr-3 flex justify-between'>
<input
id="excludeNullCheckbox"
type="checkbox"
defaultChecked = {props.initialApplyNullFilterEnable}
onChange={props.toggleRemoveNull}
className="mx-2 w-4 h-4 pt-4 text-purple-600 bg-gray-100 border-gray-300 rounded-sm accent-violet-600"
/>
<label
htmlFor="excludeNullCheckbox"
className="text-sm font-medium text-gray-300 cursor-pointer flex-auto"
>
Exclude unidentified field courses
</label>
<div className='flex-none'>
<Tooltip
text={"Removes courses which have not available data in the fields you have applied filters on. \
Recommended to increase the quality of the search, and to remove discontinued/badly maintained courses. \
"}
position={"left"}
/>
</div>
</div>
</div>
</div>
</div>
);
}
export default SidebarView;