Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions my-app/src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ export const model = {
applyTranscriptFilter: true,
eligibility: "weak", //the possible values for the string are: "weak"/"moderate"/"strong"
applyLevelFilter: true,
level: [], //the possible values for the array are: "PREPARATORY", "BASIC", "ADVANCED", "RESEARCH"
level: ["PREPARATORY", "BASIC", "ADVANCED", "RESEARCH"], //the possible values for the array are: "PREPARATORY", "BASIC", "ADVANCED", "RESEARCH"
applyLanguageFilter: true,
language: "none", //the possible values for the string are: "none"/"english"/"swedish"/"both"
applyLocationFilter:true,
location: [], //the possible values for the array are: 'KTH Campus', 'KTH Kista', 'AlbaNova', 'KTH Flemingsberg', 'KTH Solna', 'KTH Södertälje', 'Handelshögskolan', 'KI Solna', 'Stockholms universitet', 'KONSTFACK'
applyCreditsFilter:true,
creditMin: 0,
creditMax: 45,
applyDepartmentFilter:false,
department: []
applyDepartmentFilter: true,
department: ["EECS/Computational Science and Technology", "EECS/Theoretical Computer Science", "EECS/Electric Power and Energy Systems", "EECS/Network and Systems Engineering",
"ITM/Learning in Engineering Sciences", "ITM/Industrial Economics and Management", "ITM/Energy Systems", "ITM/Integrated Product Development and Design", "ITM/SKD GRU",
"SCI/Mathematics", "SCI/Applied Physics", "SCI/Mechanics", "SCI/Aeronautical and Vehicle Engineering",
"ABE/Sustainability and Environmental Engineering", "ABE/Concrete Structures", "ABE/Structural Design & Bridges", "ABE/History of Science, Technology and Environment", ],
applyRemoveNullCourses: false
},

setUser(user) {
Expand Down Expand Up @@ -144,6 +148,11 @@ export const model = {
this.filterOptions.eligibility = eligibility;
},

updateDepartmentFilter(department) {
console.log(department);
this.filterOptions.department = department;
},

//setters for the filter options
setApplyTranscriptFilter(transcriptFilterState) {
this.filterOptions.applyTranscriptFilter = transcriptFilterState;
Expand All @@ -160,9 +169,9 @@ export const model = {
setApplyCreditsFilter(creditsFilterState) {
this.filterOptions.applyCreditsFilter = creditsFilterState;
},
// setApplyDepartmentFilter(departmentFilterState) {
// this.filterOptions.applyDepartmentFilter = departmentFilterState;
// },
setApplyDepartmentFilter(departmentFilterState) {
this.filterOptions.applyDepartmentFilter = departmentFilterState;
},

async getAverageRating(courseCode) {
const reviews = await getReviewsForCourse(courseCode);
Expand Down
2 changes: 1 addition & 1 deletion my-app/src/pages/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { model } from '/src/model.js';
function MainAppLayout({ model }) {
return (
<div className="flex h-screen w-screen overflow-hidden">
<FilterPresenter model={model} />
<div className="flex-auto w-40% h-full bg-gradient-to-t from-[#4f3646] to-[#6747c0]">
<SidebarPresenter model={model} />
</div>
Expand All @@ -21,6 +20,7 @@ function MainAppLayout({ model }) {
<div className="flex-auto border bg-[#121212] relative">
<ListViewPresenter model={model} />
</div>
<FilterPresenter model={model} />
</div>
</div>
);
Expand Down
Loading
Loading