[O] Remove unnecessary courses prop

This commit is contained in:
Hykilpikonna
2020-04-03 17:05:41 -04:00
parent e3b011003d
commit e643b65d98
3 changed files with 6 additions and 13 deletions
+3 -9
View File
@@ -3,19 +3,13 @@
<div id="app-inner" v-if="staticPage === ''" :class="{dark: darkMode}">
<login v-if="showLogin" v-on:login:user="onLogin"/>
<navigation v-if="user != null"
:courses="gradedCourses"
:user="user"
:nav="nav"
:app="this" :user="user" :nav="nav"
@sign-out="signOut" @select-time="selectTime">
</navigation>
<div id="app-content" v-if="assignmentsReady && loading === ''">
<overall v-if="nav.id === 'overall'"
:courses="gradedCourses">
</overall>
<course-page v-if="nav.id === 'course'"
:course="gradedCourses.find(c => +c.id === +nav.info.id)">
</course-page>
<overall v-if="nav.id === 'overall'" :courses="gradedCourses"></overall>
<course-page v-if="nav.id === 'course'" :course="gradedCourses.find(c => +c.id === +nav.info.id)"></course-page>
</div>
<loading v-if="loading !== ''" :text="loading" :error="loadingError"/>
+2 -3
View File
@@ -13,7 +13,6 @@ export default class Navigation extends Vue
{
@Prop({required: true}) app: App;
@Prop({required: true}) nav: NavController;
@Prop({required: true}) courses: Course[];
@Prop({required: true}) user: LoginUser;
private gradingPeriod: string = 'All Year';
@@ -93,10 +92,10 @@ export default class Navigation extends Vue
findCourse(courseId: string, indexOffset: number)
{
// Find current course index
let courseIndex = this.courses.findIndex(c => c.id == +courseId);
let courseIndex = this.app.gradedCourses.findIndex(c => c.id == +courseId);
// Find next course
return this.courses[courseIndex + indexOffset];
return this.app.gradedCourses[courseIndex + indexOffset];
}
/**
+1 -1
View File
@@ -13,7 +13,7 @@
<el-submenu index="">
<template slot="title">Courses</template>
<el-menu-item v-for="course in courses"
<el-menu-item v-for="course in app.gradedCourses"
:index="JSON.stringify(course.urlIndex)"
:key="course.id">{{course.name}}</el-menu-item>
</el-submenu>