Commit 0b7006a1caf9cf26c46b841bad35d0b42b68cd51
1 parent
1eaabc5a2d
Exists in
master
and in
2 other branches
solved bug regarding routing in CourseDetails.vue
Showing
3 changed files
with
7 additions
and
5 deletions
Show diff stats
src/App.vue
1 | <template> | 1 | <template> |
2 | <div id="appRoot"> | 2 | <div id="appRoot"> |
3 | <template v-if="!$route.meta.public"> | 3 | <template v-if="!$route.meta.public"> |
4 | <!-- Go to top --> | 4 | <!-- Go to top --> |
5 | <v-app id="inspire" class="app"> | 5 | <v-app id="inspire" class="app"> |
6 | <app-drawer class="app--drawer"></app-drawer> | 6 | <app-drawer class="app--drawer"></app-drawer> |
7 | <v-content> | 7 | <v-content> |
8 | <div class="page-wrapper"> | 8 | <div class="page-wrapper"> |
9 | <!-- Header toolbar with Seacrh --> | 9 | <!-- Header toolbar with Seacrh --> |
10 | <app-toolbar class="app--toolbar"></app-toolbar> | 10 | <app-toolbar class="app--toolbar"></app-toolbar> |
11 | <router-view></router-view> | 11 | <router-view :key="$route.fullPath"></router-view> |
12 | </div> | 12 | </div> |
13 | <!-- App Footer --> | 13 | <!-- App Footer --> |
14 | </v-content> | 14 | </v-content> |
15 | <!-- theme setting --> | 15 | <!-- theme setting --> |
16 | <!-- <v-btn small fab dark falt fixed top="top" right="right" class="setting-fab" color="red" @click="openThemeSettings"> | 16 | <!-- <v-btn small fab dark falt fixed top="top" right="right" class="setting-fab" color="red" @click="openThemeSettings"> |
17 | <v-icon>settings</v-icon> | 17 | <v-icon>settings</v-icon> |
18 | </v-btn> | 18 | </v-btn> |
19 | <v-navigation-drawer | 19 | <v-navigation-drawer |
20 | class="setting-drawer" | 20 | class="setting-drawer" |
21 | temporary | 21 | temporary |
22 | right | 22 | right |
23 | v-model="rightDrawer" | 23 | v-model="rightDrawer" |
24 | hide-overlay | 24 | hide-overlay |
25 | fixed | 25 | fixed |
26 | > | 26 | > |
27 | <theme-settings></theme-settings> | 27 | <theme-settings></theme-settings> |
28 | </v-navigation-drawer>--> | 28 | </v-navigation-drawer>--> |
29 | </v-app> | 29 | </v-app> |
30 | </template> | 30 | </template> |
31 | <template v-else> | 31 | <template v-else> |
32 | <transition> | 32 | <transition> |
33 | <keep-alive> | 33 | <keep-alive> |
34 | <router-view></router-view> | 34 | <router-view></router-view> |
35 | </keep-alive> | 35 | </keep-alive> |
36 | </transition> | 36 | </transition> |
37 | </template> | 37 | </template> |
38 | <v-snackbar :timeout="3000" bottom right :color="snackbar.color" v-model="snackbar.show"> | 38 | <v-snackbar :timeout="3000" bottom right :color="snackbar.color" v-model="snackbar.show"> |
39 | {{ snackbar.text }} | 39 | {{ snackbar.text }} |
40 | <v-btn dark flat @click.native="snackbar.show = false" icon> | 40 | <v-btn dark flat @click.native="snackbar.show = false" icon> |
41 | <v-icon>close</v-icon> | 41 | <v-icon>close</v-icon> |
42 | </v-btn> | 42 | </v-btn> |
43 | </v-snackbar> | 43 | </v-snackbar> |
44 | </div> | 44 | </div> |
45 | </template> | 45 | </template> |
46 | <script> | 46 | <script> |
47 | import AppDrawer from "@/components/pageHeader/AppDrawer"; | 47 | import AppDrawer from "@/components/pageHeader/AppDrawer"; |
48 | import AppToolbar from "@/components/pageHeader/AppToolbar"; | 48 | import AppToolbar from "@/components/pageHeader/AppToolbar"; |
49 | import menu from "@/api/menu"; | 49 | import menu from "@/api/menu"; |
50 | import AppEvents from "./event"; | 50 | import AppEvents from "./event"; |
51 | import ThemeSettings from "@/components/ThemeSettings"; | 51 | import ThemeSettings from "@/components/ThemeSettings"; |
52 | // import { FunctionalCalendar } from "vue-functional-calendar"; | 52 | // import { FunctionalCalendar } from "vue-functional-calendar"; |
53 | 53 | ||
54 | export default { | 54 | export default { |
55 | components: { | 55 | components: { |
56 | AppDrawer, | 56 | AppDrawer, |
57 | AppToolbar, | 57 | AppToolbar, |
58 | ThemeSettings | 58 | ThemeSettings |
59 | // FunctionalCalendar | 59 | // FunctionalCalendar |
60 | }, | 60 | }, |
61 | data: () => ({ | 61 | data: () => ({ |
62 | expanded: true, | 62 | expanded: true, |
63 | rightDrawer: false, | 63 | rightDrawer: false, |
64 | snackbar: { | 64 | snackbar: { |
65 | show: false, | 65 | show: false, |
66 | text: "", | 66 | text: "", |
67 | color: "" | 67 | color: "" |
68 | } | 68 | } |
69 | }), | 69 | }), |
70 | 70 | ||
71 | computed: {}, | 71 | computed: {}, |
72 | 72 | ||
73 | created() { | 73 | created() { |
74 | AppEvents.forEach(item => { | 74 | AppEvents.forEach(item => { |
75 | this.$on(item.name, item.callback); | 75 | this.$on(item.name, item.callback); |
76 | }); | 76 | }); |
77 | window.getApp = this; | 77 | window.getApp = this; |
78 | }, | 78 | }, |
79 | methods: { | 79 | methods: { |
80 | openThemeSettings() { | 80 | openThemeSettings() { |
81 | this.$vuetify.goTo(0); | 81 | this.$vuetify.goTo(0); |
82 | this.rightDrawer = !this.rightDrawer; | 82 | this.rightDrawer = !this.rightDrawer; |
83 | } | 83 | } |
84 | } | 84 | } |
85 | }; | 85 | }; |
86 | </script> | 86 | </script> |
87 | 87 | ||
88 | 88 | ||
89 | <style lang="stylus" scoped> | 89 | <style lang="stylus" scoped> |
90 | .setting-fab { | 90 | .setting-fab { |
91 | top: 50% !important; | 91 | top: 50% !important; |
92 | right: 0; | 92 | right: 0; |
93 | border-radius: 0; | 93 | border-radius: 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | .page-wrapper { | 96 | .page-wrapper { |
97 | min-height: calc(1200px - 64px - 50px - 81px); | 97 | min-height: calc(1200px - 64px - 50px - 81px); |
98 | } | 98 | } |
99 | </style> | 99 | </style> |
100 | <style> | 100 | <style> |
101 | .application { | 101 | .application { |
102 | background-color: white !important; | 102 | background-color: white !important; |
103 | font-family: "Poppins", sans-serif; | 103 | font-family: "Poppins", sans-serif; |
104 | -webkit-font-smoothing: antialiased; | 104 | -webkit-font-smoothing: antialiased; |
105 | -moz-osx-font-smoothing: grayscale; | 105 | -moz-osx-font-smoothing: grayscale; |
106 | scroll-behavior: smooth; | 106 | scroll-behavior: smooth; |
107 | } | 107 | } |
108 | </style> | 108 | </style> |
109 | 109 |
src/Services/GetApis.js
1 | import ApiCalls from "@/Services/ApiCalls.js"; | 1 | import ApiCalls from "@/Services/ApiCalls.js"; |
2 | export default { | 2 | export default { |
3 | mixins: [ApiCalls], | 3 | mixins: [ApiCalls], |
4 | data() { | 4 | data() { |
5 | return { | 5 | return { |
6 | courseData: [], | 6 | courseData: [], |
7 | 7 | ||
8 | // dashboard.vue data properties | 8 | // dashboard.vue data properties |
9 | particularEvent: {}, | 9 | particularEvent: {}, |
10 | 10 | ||
11 | 11 | ||
12 | } | 12 | } |
13 | }, | 13 | }, |
14 | methods: { | 14 | methods: { |
15 | /* getParticularCourseDetail */ | 15 | /* getParticularCourseDetail */ |
16 | async getParticularCourseDetail(courseId) { | 16 | async getParticularCourseDetail(courseId) { |
17 | 17 | ||
18 | try { | 18 | try { |
19 | let response = await this.getMethod("/getParticularCourseDetail", { | 19 | let response = await this.getMethod("/getParticularCourseDetail", { |
20 | courseId: courseId | 20 | courseId: courseId |
21 | }) | 21 | }) |
22 | return response | 22 | return response |
23 | } catch (error) { | 23 | } catch (error) { |
24 | console.log("error in getParticularCourseDetail - ", error.message) | 24 | console.log("error in getParticularCourseDetail - ", error.message) |
25 | } | 25 | } |
26 | }, | 26 | }, |
27 | 27 | ||
28 | /* getStudentCourses - to get courseData */ | 28 | /* getStudentCourses - to get courseData */ |
29 | async getStudentCourses(params) { | 29 | async getStudentCourses(params) { |
30 | try { | 30 | try { |
31 | let response = await this.getMethod("/getStudentCourses", { | 31 | let response = await this.getMethod("/getStudentCourses", { |
32 | classId: params.classId, | 32 | classId: params.classId, |
33 | studentId: params.studentId | 33 | studentId: params.studentId |
34 | }) | 34 | }) |
35 | this.courseData = response.data.data; | 35 | this.courseData = response.data.data; |
36 | console.log("coursesData - ", this.courseData) | ||
37 | } catch (error) { | 36 | } catch (error) { |
38 | console.log("error in getStudentCourses - ", error.message) | 37 | console.log("error in getStudentCourses - ", error.message) |
39 | } | 38 | } |
40 | }, | 39 | }, |
41 | 40 | ||
42 | /* getCourseDiscussionesList - used in courseDiscussionForum.vue */ | 41 | /* getCourseDiscussionesList - used in courseDiscussionForum.vue */ |
43 | async getCourseDiscussionesList(params) { | 42 | async getCourseDiscussionesList(params) { |
44 | try { | 43 | try { |
45 | let response = await this.getMethod("/getCourseDiscussionesList", { | 44 | let response = await this.getMethod("/getCourseDiscussionesList", { |
46 | courseId: params.courseId, | 45 | courseId: params.courseId, |
47 | classId: params.classId, | 46 | classId: params.classId, |
48 | }) | 47 | }) |
49 | this.courseDiscussionItems = response.data.data | 48 | this.courseDiscussionItems = response.data.data |
50 | // return response | 49 | // return response |
51 | console.log("response of getCourseDiscussionesList - ", response) | 50 | console.log("response of getCourseDiscussionesList - ", response) |
52 | } catch (error) { | 51 | } catch (error) { |
53 | console.log("error in getCourseDiscussionesList - ", error.message) | 52 | console.log("error in getCourseDiscussionesList - ", error.message) |
54 | } | 53 | } |
55 | }, | 54 | }, |
56 | 55 | ||
57 | /***************************************************************************************************************************** */ | 56 | /***************************************************************************************************************************** */ |
58 | 57 | ||
59 | // APIS USED IN dashboard.vue | 58 | // APIS USED IN dashboard.vue |
60 | /* studentMeetingEvents required in dashboard to display list of latest events */ | 59 | /* studentMeetingEvents required in dashboard to display list of latest events */ |
61 | async studentMeetingEvents(params) { | 60 | async studentMeetingEvents(params) { |
62 | try { | 61 | try { |
63 | let response = await this.getMethod("/studentMeetingEvents", { | 62 | let response = await this.getMethod("/studentMeetingEvents", { |
64 | studentId: params.studentId | 63 | studentId: params.studentId |
65 | }) | 64 | }) |
66 | console.log("response of studentMeetingEvents - ", response); | 65 | console.log("response of studentMeetingEvents - ", response); |
67 | return response | 66 | return response |
68 | } catch (error) { | 67 | } catch (error) { |
69 | console.log("error in studentMeetingEvents - ", error.message) | 68 | console.log("error in studentMeetingEvents - ", error.message) |
70 | } | 69 | } |
71 | 70 | ||
72 | }, | 71 | }, |
73 | 72 | ||
74 | async getParticularMeetingEvent(params) { | 73 | async getParticularMeetingEvent(params) { |
75 | try { | 74 | try { |
76 | let response = await this.getMethod("/getParticularMeetingEvent", { | 75 | let response = await this.getMethod("/getParticularMeetingEvent", { |
77 | meetingEventId: params.meetingEventId | 76 | meetingEventId: params.meetingEventId |
78 | }) | 77 | }) |
79 | this.particularEvent = response.data.data | 78 | this.particularEvent = response.data.data |
80 | } catch (error) { | 79 | } catch (error) { |
81 | console.log("Error in getParticularMeetingEvent - ", error.message) | 80 | console.log("Error in getParticularMeetingEvent - ", error.message) |
82 | } | 81 | } |
83 | }, | 82 | }, |
84 | 83 | ||
85 | /************************************************************************************************************************ */ | 84 | /************************************************************************************************************************ */ |
86 | 85 | ||
87 | 86 | ||
88 | /* APIS USED IN announcement.vue */ | 87 | /* APIS USED IN announcement.vue */ |
89 | async getAnnoucementesList(params) { | 88 | async getAnnoucementesList(params) { |
90 | try { | 89 | try { |
91 | let response = await this.getMethod("/getAnnoucementesList", { | 90 | let response = await this.getMethod("/getAnnoucementesList", { |
92 | courseId: params.courseId | 91 | courseId: params.courseId |
93 | }) | 92 | }) |
94 | return response; | 93 | return response; |
95 | } catch (error) { | 94 | } catch (error) { |
96 | console.log("Error in getAnnoucementesList - ", error.message) | 95 | console.log("Error in getAnnoucementesList - ", error.message) |
97 | } | 96 | } |
98 | } | 97 | } |
99 | 98 | ||
100 | }, | 99 | }, |
101 | } | 100 | } |
src/pages/Dashboard/CourseDetails.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | <!-- LOADER --> | 3 | <!-- LOADER --> |
4 | <div class="loader" v-if="showLoader"> | 4 | <div class="loader" v-if="showLoader"> |
5 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 5 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
6 | </div> | 6 | </div> |
7 | 7 | ||
8 | <!-- SNACKBAR --> | 8 | <!-- SNACKBAR --> |
9 | <v-snackbar | 9 | <v-snackbar |
10 | :timeout="timeout" | 10 | :timeout="timeout" |
11 | :top="y === 'top'" | 11 | :top="y === 'top'" |
12 | :right="x === 'right'" | 12 | :right="x === 'right'" |
13 | :vertical="mode === 'vertical'" | 13 | :vertical="mode === 'vertical'" |
14 | v-model="snackbar" | 14 | v-model="snackbar" |
15 | :color="snackbarColor" | 15 | :color="snackbarColor" |
16 | > | 16 | > |
17 | {{ text }} | 17 | {{ text }} |
18 | <v-spacer></v-spacer> | 18 | <v-spacer></v-spacer> |
19 | <v-btn flat text @click="snackbar = false">X</v-btn> | 19 | <v-btn flat text @click="snackbar = false">X</v-btn> |
20 | </v-snackbar> | 20 | </v-snackbar> |
21 | 21 | ||
22 | <v-container class="pt-0"> | 22 | <v-container class="pt-0"> |
23 | <v-layout row wrap class="mt-1"> | 23 | <v-layout row wrap class="mt-1"> |
24 | <v-flex xs12 md8> | 24 | <v-flex xs12 md8> |
25 | <div | 25 | <div |
26 | class="title side-bar-color font-weight-bold" | 26 | class="title side-bar-color font-weight-bold" |
27 | >Welcome to the {{courseDetails[0].courseId.courseName}} Course for {{courseDetails[0].classId.classNum}} class</div> | 27 | >Welcome to the {{courseDetails[0].courseId.courseName}} Course for {{courseDetails[0].classId.classNum}} class</div> |
28 | <v-flex xs12 class="subheading mt-2"> | 28 | <v-flex xs12 class="subheading mt-2"> |
29 | Lorem Ipsum sdjjkhsdf sdklfjs dkfjskdjfk fjsdklf sdjfksljf sdfkls fljlkj kl | 29 | Lorem Ipsum sdjjkhsdf sdklfjs dkfjskdjfk fjsdklf sdjfksljf sdfkls fljlkj kl |
30 | jkhjkfhjksd sdfjkhsdjk fsdjkl sfkljkl ldkfjkl kjlfs dlkjlskd fljsldk fklj | 30 | jkhjkfhjksd sdfjkhsdjk fsdjkl sfkljkl ldkfjkl kjlfs dlkjlskd fljsldk fklj |
31 | lksjdfljklsdj flkjs dflkjsd flkjsd lfkjsd lfjsdjf lkj kl | 31 | lksjdfljklsdj flkjs dflkjsd flkjsd lfkjsd lfjsdjf lkj kl |
32 | </v-flex> | 32 | </v-flex> |
33 | 33 | ||
34 | <div class="mt-5"> | 34 | <div class="mt-5"> |
35 | <span | 35 | <span |
36 | style="cursor: pointer;" | 36 | style="cursor: pointer;" |
37 | class="grey--text lighten-1" | 37 | class="grey--text lighten-1" |
38 | @click="$router.push({name: 'Announcement', query:{courseId: $route.query.courseId}})" | 38 | @click="$router.push({name: 'Announcement', query:{courseId: $route.query.courseId}})" |
39 | > | 39 | > |
40 | <v-icon>question_answer</v-icon> | 40 | <v-icon>question_answer</v-icon> |
41 | <span class="ml-2">Announcement</span> | 41 | <span class="ml-2">Announcement</span> |
42 | </span> | 42 | </span> |
43 | </div> | 43 | </div> |
44 | <div> | 44 | <div> |
45 | <span | 45 | <span |
46 | style="cursor: pointer;" | 46 | style="cursor: pointer;" |
47 | @click="$router.push({name: 'Course Discussion Forum', query:{courseId: $route.query.courseId}})" | 47 | @click="$router.push({name: 'Course Discussion Forum', query:{courseId: $route.query.courseId}})" |
48 | class="grey--text lighten-1" | 48 | class="grey--text lighten-1" |
49 | > | 49 | > |
50 | <v-icon>question_answer</v-icon> | 50 | <v-icon>question_answer</v-icon> |
51 | <span class="ml-2">Course discussion forum</span> | 51 | <span class="ml-2">Course discussion forum</span> |
52 | </span> | 52 | </span> |
53 | </div> | 53 | </div> |
54 | <!-- CHAPTERS --> | 54 | <!-- CHAPTERS --> |
55 | <v-layout column class="mt-5"> | 55 | <v-layout column class="mt-5"> |
56 | <v-flex | 56 | <v-flex |
57 | v-for="(chapter,index) in courseDetails[0].chapters" | 57 | v-for="(chapter,index) in courseDetails[0].chapters" |
58 | :key="index" | 58 | :key="index" |
59 | style="cursor: pointer;" | 59 | style="cursor: pointer;" |
60 | @click="routeToChapterInfo(chapter._id)" | 60 | @click="routeToChapterInfo(chapter._id)" |
61 | > | 61 | > |
62 | <v-card class="mt-2 elevation-0 card-border"> | 62 | <v-card class="mt-2 elevation-0 card-border"> |
63 | <v-container class="pt-0"> | 63 | <v-container class="pt-0"> |
64 | <div class="title side-bar-color font-weight-bold">{{chapter.chapterName}}</div> | 64 | <div class="title side-bar-color font-weight-bold">{{chapter.chapterName}}</div> |
65 | <div class="grey--text lighten-1 subheading">{{chapter.description}}</div> | 65 | <div class="grey--text lighten-1 subheading">{{chapter.description}}</div> |
66 | <div | 66 | <div |
67 | v-for="(point,index) in chapter.chapterPoints" | 67 | v-for="(point,index) in chapter.chapterPoints" |
68 | :key="index" | 68 | :key="index" |
69 | class="ml-2 mt-2" | 69 | class="ml-2 mt-2" |
70 | > | 70 | > |
71 | <span class="grey--text lighten-1 subheading">{{index +1}}. {{point}}</span> | 71 | <span class="grey--text lighten-1 subheading">{{index +1}}. {{point}}</span> |
72 | </div> | 72 | </div> |
73 | </v-container> | 73 | </v-container> |
74 | </v-card> | 74 | </v-card> |
75 | </v-flex> | 75 | </v-flex> |
76 | </v-layout> | 76 | </v-layout> |
77 | </v-flex> | 77 | </v-flex> |
78 | <v-spacer></v-spacer> | 78 | <v-spacer></v-spacer> |
79 | 79 | ||
80 | <!-- COURSES --> | 80 | <!-- COURSES --> |
81 | <v-flex xs12 md3> | 81 | <v-flex xs12 md3> |
82 | <v-card class="elevation-0 card-border" height="100%"> | 82 | <v-card class="elevation-0 card-border" height="100%"> |
83 | <v-container class="pt-0"> | 83 | <v-container class="pt-0"> |
84 | <div class="side-bar-color font-weight-bold title">Courses</div> | 84 | <div class="side-bar-color font-weight-bold title">Courses</div> |
85 | 85 | ||
86 | <div v-for="(course,index) in courseData"> | 86 | <div v-for="(course,index) in courseData"> |
87 | <v-btn | 87 | <v-btn |
88 | flat | 88 | flat |
89 | class="subheading text-xs-start justify-left" | 89 | class="subheading text-xs-start justify-left" |
90 | style="cursor: pointer;" | 90 | style="cursor: pointer;" |
91 | block | 91 | block |
92 | @click="routeToCourseDetails(course._id)" | 92 | @click="routeToCourseDetails(course._id)" |
93 | > | 93 | > |
94 | <div style="width: 100%;text-align: left;"> | 94 | <div style="width: 100%;text-align: left;"> |
95 | <v-icon style="color: red;padding-bottom: 3px;" size="15">play_arrow</v-icon> | 95 | <v-icon style="color: red;padding-bottom: 3px;" size="15">play_arrow</v-icon> |
96 | {{course.courseName}} | 96 | {{course.courseName}} |
97 | </div> | 97 | </div> |
98 | </v-btn> | 98 | </v-btn> |
99 | </div> | 99 | </div> |
100 | <!-- <v-expansion-panel focusable class="elevation-0"> | 100 | <!-- <v-expansion-panel focusable class="elevation-0"> |
101 | <v-expansion-panel-content v-for="(item,i) in courseData" :key="i"> | 101 | <v-expansion-panel-content v-for="(item,i) in courseData" :key="i"> |
102 | <template v-slot:header> | 102 | <template v-slot:header> |
103 | <div class="subheading">{{item.courseName}}</div> | 103 | <div class="subheading">{{item.courseName}}</div> |
104 | </template> | 104 | </template> |
105 | </v-expansion-panel-content> | 105 | </v-expansion-panel-content> |
106 | </v-expansion-panel>--> | 106 | </v-expansion-panel>--> |
107 | </v-container> | 107 | </v-container> |
108 | </v-card> | 108 | </v-card> |
109 | </v-flex> | 109 | </v-flex> |
110 | </v-layout> | 110 | </v-layout> |
111 | </v-container> | 111 | </v-container> |
112 | </div> | 112 | </div> |
113 | </template> | 113 | </template> |
114 | <script> | 114 | <script> |
115 | import AllApiCalls from "@/Services/AllApiCalls.js"; | 115 | import AllApiCalls from "@/Services/AllApiCalls.js"; |
116 | import http from "@/Services/http.js"; | 116 | import http from "@/Services/http.js"; |
117 | import moment from "moment"; | 117 | import moment from "moment"; |
118 | export default { | 118 | export default { |
119 | mixins: [AllApiCalls], | 119 | mixins: [AllApiCalls], |
120 | data() { | 120 | data() { |
121 | return { | 121 | return { |
122 | showLoader: false, | 122 | showLoader: false, |
123 | courseDetails: [{ courseId: {}, classId: {} }], | 123 | courseDetails: [{ courseId: {}, classId: {} }], |
124 | chapterIds: [], | 124 | chapterIds: [], |
125 | // courseData: [], | 125 | // courseData: [], |
126 | courseDataTree: [] | 126 | courseDataTree: [] |
127 | }; | 127 | }; |
128 | }, | 128 | }, |
129 | methods: { | 129 | methods: { |
130 | routeToChapterInfo(chapterId) { | 130 | routeToChapterInfo(chapterId) { |
131 | /* set value of present chapter selected, and other chapters ids in the obj */ | 131 | /* set value of present chapter selected, and other chapters ids in the obj */ |
132 | let obj = {}; | 132 | let obj = {}; |
133 | for (var i = 0; i < this.courseDetails[0].chapters.length; i++) { | 133 | for (var i = 0; i < this.courseDetails[0].chapters.length; i++) { |
134 | obj[ | 134 | obj[ |
135 | this.courseDetails[0].chapters[i].chapterName | 135 | this.courseDetails[0].chapters[i].chapterName |
136 | ] = this.courseDetails[0].chapters[i]._id; | 136 | ] = this.courseDetails[0].chapters[i]._id; |
137 | } | 137 | } |
138 | obj.chapterId = chapterId; | 138 | obj.chapterId = chapterId; |
139 | obj.courseDetailId = this.courseDetails[0]._id; | 139 | obj.courseDetailId = this.courseDetails[0]._id; |
140 | this.$router.push({ | 140 | this.$router.push({ |
141 | name: "Chapter Info", | 141 | name: "Chapter Info", |
142 | query: obj | 142 | query: obj |
143 | }); | 143 | }); |
144 | }, | 144 | }, |
145 | async routeToCourseDetails(courseId) { | 145 | async routeToCourseDetails(courseId) { |
146 | /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ | 146 | /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ |
147 | let response = await this.getParticularCourseDetail(courseId); | 147 | let response = await this.getParticularCourseDetail(courseId); |
148 | 148 | ||
149 | /* If the response is null then dont route */ | 149 | /* If the response is null then dont route */ |
150 | if (response.data.data.length > 0) { | 150 | if (response.data.data.length > 0) { |
151 | this.$router.push({ | 151 | // REQUIRED TO WAIT FOR UPDATE CYCLE |
152 | name: "Course Details", | 152 | this.$nextTick(() => { |
153 | query: { courseId: courseId } | 153 | // this.filters.locEmitted = "emitted"; |
154 | this.$router.push({ query: { courseId: courseId } }); | ||
154 | }); | 155 | }); |
155 | } else { | 156 | } else { |
156 | this.seeSnackbar("No Data Available", "warning"); | 157 | this.seeSnackbar("No Data Available", "warning"); |
157 | } | 158 | } |
158 | } | 159 | } |
159 | }, | 160 | }, |
160 | async created() { | 161 | async created() { |
162 | console.log("its working"); | ||
161 | /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ | 163 | /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ |
162 | let response = await this.getParticularCourseDetail( | 164 | let response = await this.getParticularCourseDetail( |
163 | this.$route.query.courseId | 165 | this.$route.query.courseId |
164 | ); | 166 | ); |
165 | this.courseDetails = response.data.data; | 167 | this.courseDetails = response.data.data; |
168 | console.log("its working courseDetails - ", this.courseDetails); | ||
166 | 169 | ||
167 | /* getStudentCourses - to get courseData - defined in GetApis.js*/ | 170 | /* getStudentCourses - to get courseData - defined in GetApis.js*/ |
168 | await this.getStudentCourses({ | 171 | await this.getStudentCourses({ |
169 | classId: localStorage.getItem("parentClassId"), | 172 | classId: localStorage.getItem("parentClassId"), |
170 | studentId: localStorage.getItem("parentStudentId") | 173 | studentId: localStorage.getItem("parentStudentId") |
171 | }); | 174 | }); |
172 | } | 175 | } |
173 | }; | 176 | }; |
174 | </script> | 177 | </script> |
175 | <style scoped> | 178 | <style scoped> |
176 | .side-bar-color { | 179 | .side-bar-color { |
177 | color: #827bfa !important; | 180 | color: #827bfa !important; |
178 | /* border-top-right-radius: 74px !important; */ | 181 | /* border-top-right-radius: 74px !important; */ |
179 | } | 182 | } |
180 | .card-border { | 183 | .card-border { |
181 | border: 1px #bdbdbd solid; | 184 | border: 1px #bdbdbd solid; |
182 | border-radius: 3px; | 185 | border-radius: 3px; |
183 | } | 186 | } |
184 | /* .v-treeview-node__toggle { | 187 | /* .v-treeview-node__toggle { |
185 | color: red !important; | 188 | color: red !important; |
186 | } */ | 189 | } */ |
187 | </style> | 190 | </style> |