Commit 0a52566000dfa5c12fc7984880eaa33dd73665f1
1 parent
47a8dcd387
Exists in
master
and in
2 other branches
added events
Showing
13 changed files
with
166 additions
and
69 deletions
Show diff stats
src/Services/ApiCalls.js
... | ... | @@ -109,10 +109,10 @@ export default { |
109 | 109 | // console.log("error in getMethod = ", error.response) |
110 | 110 | const message = this.generateError(error) |
111 | 111 | if (message == "Session expired") { |
112 | - this.$store.dispatch("setToken", null); | |
113 | - this.$router.push({ | |
114 | - name: 'Login' | |
115 | - }); | |
112 | + // this.$store.dispatch("setToken", null); | |
113 | + // this.$router.push({ | |
114 | + // name: 'Login' | |
115 | + // }); | |
116 | 116 | } else { |
117 | 117 | throw new Error(message); |
118 | 118 | } | ... | ... |
src/Services/GetApis.js
... | ... | @@ -34,7 +34,36 @@ export default { |
34 | 34 | } catch (error) { |
35 | 35 | console.log("error in getStudentCourses - ", error.message) |
36 | 36 | } |
37 | - } | |
37 | + }, | |
38 | + | |
39 | + /* getCourseDiscussionesList - used in courseDiscussionForum.vue */ | |
40 | + async getCourseDiscussionesList(params) { | |
41 | + try { | |
42 | + let response = await this.getMethod("/getCourseDiscussionesList", { | |
43 | + courseId: params.courseId, | |
44 | + classId: params.classId, | |
45 | + }) | |
46 | + this.courseDiscussionItems = response.data.data | |
47 | + // return response | |
48 | + console.log("response of getCourseDiscussionesList - ", response) | |
49 | + } catch (error) { | |
50 | + console.log("error in getCourseDiscussionesList - ", error.message) | |
51 | + } | |
52 | + }, | |
53 | + | |
54 | + /* studentMeetingEvents required in dashboard to display list of latest events */ | |
55 | + async studentMeetingEvents(params) { | |
56 | + try { | |
57 | + let response = await this.getMethod("/studentMeetingEvents", { | |
58 | + studentId: params.studentId | |
59 | + }) | |
60 | + console.log("response of studentMeetingEvents - ", response); | |
61 | + return response | |
62 | + } catch (error) { | |
63 | + console.log("error in studentMeetingEvents - ", error.message) | |
64 | + } | |
65 | + | |
66 | + }, | |
38 | 67 | |
39 | 68 | }, |
40 | 69 | } |
41 | 70 | \ No newline at end of file | ... | ... |
src/pages/Annoucement/annoucement.vue
... | ... | @@ -64,9 +64,9 @@ |
64 | 64 | <v-flex xs8 sm7 class="ml-3"> |
65 | 65 | <v-select |
66 | 66 | :items="courseData" |
67 | - item-text="coursrName" | |
67 | + item-text="courseName" | |
68 | 68 | item-value="_id" |
69 | - v-model="editedItem.coursrName" | |
69 | + v-model="editedItem.courseName" | |
70 | 70 | placeholder="fill your Course name" |
71 | 71 | type="text" |
72 | 72 | :rules="courseRules" |
... | ... | @@ -196,7 +196,7 @@ |
196 | 196 | :items="courseData" |
197 | 197 | label="Select Course" |
198 | 198 | v-model="selectAnnoucement.courseId" |
199 | - item-text="coursrName" | |
199 | + item-text="courseName" | |
200 | 200 | item-value="_id" |
201 | 201 | :rules="courseRules" |
202 | 202 | required |
... | ... | @@ -388,9 +388,9 @@ |
388 | 388 | <v-flex xs8 sm8 class="ml-3"> |
389 | 389 | <v-select |
390 | 390 | :items="courseData" |
391 | - item-text="coursrName" | |
391 | + item-text="courseName" | |
392 | 392 | item-value="_id" |
393 | - v-model="addAnnoucement.coursrName" | |
393 | + v-model="addAnnoucement.courseName" | |
394 | 394 | placeholder="fill your Course name" |
395 | 395 | type="text" |
396 | 396 | :rules="courseRules" |
... | ... | @@ -685,7 +685,7 @@ export default { |
685 | 685 | classId: this.addAnnoucement.select, |
686 | 686 | sectionId: this.addAnnoucement.selectSection, |
687 | 687 | discussionType: this.addAnnoucement.discussionType, |
688 | - courseId: this.addAnnoucement.coursrName | |
688 | + courseId: this.addAnnoucement.courseName | |
689 | 689 | }; |
690 | 690 | if (this.imageUrl) { |
691 | 691 | var str = this.imageUrl; |
... | ... | @@ -720,7 +720,7 @@ export default { |
720 | 720 | annoucementId: this.editedItem._id, |
721 | 721 | discussionType: this.editedItem.discussionType, |
722 | 722 | classId: this.editedItem.select, |
723 | - courseId: this.editedItem.coursrName | |
723 | + courseId: this.editedItem.courseName | |
724 | 724 | }; |
725 | 725 | if (this.editImageUrl) { |
726 | 726 | var str = this.editImageUrl; | ... | ... |
src/pages/Course/course.vue
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | </v-flex> |
64 | 64 | <v-flex xs8 sm7 class="ml-3"> |
65 | 65 | <v-text-field |
66 | - v-model="editedItem.coursrName" | |
66 | + v-model="editedItem.courseName" | |
67 | 67 | placeholder="fill your Course Name" |
68 | 68 | type="text" |
69 | 69 | required |
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | </h5> |
127 | 127 | </v-flex> |
128 | 128 | <v-flex sm6 xs6> |
129 | - <h5 class="my-1 left">{{ editedItem.coursrName }}</h5> | |
129 | + <h5 class="my-1 left">{{ editedItem.courseName }}</h5> | |
130 | 130 | </v-flex> |
131 | 131 | </v-layout> |
132 | 132 | </v-flex> |
... | ... | @@ -236,7 +236,7 @@ |
236 | 236 | <img src="/static/icon/user.png" v-else-if="!props.item.courseImageUrl" /> |
237 | 237 | </v-avatar> |
238 | 238 | </td> |
239 | - <td class="text-xs-center td td-row">{{ props.item.coursrName}}</td> | |
239 | + <td class="text-xs-center td td-row">{{ props.item.courseName}}</td> | |
240 | 240 | <td class="text-xs-center td td-row"> |
241 | 241 | <span> |
242 | 242 | <v-tooltip top> |
... | ... | @@ -349,7 +349,7 @@ |
349 | 349 | </v-flex> |
350 | 350 | <v-flex xs8 sm8 class="ml-3"> |
351 | 351 | <v-text-field |
352 | - v-model="addCourses.coursrName" | |
352 | + v-model="addCourses.courseName" | |
353 | 353 | placeholder="fill your Course name" |
354 | 354 | type="text" |
355 | 355 | :rules="courseRules" |
... | ... | @@ -607,7 +607,7 @@ export default { |
607 | 607 | let addCourse = { |
608 | 608 | classId: this.addCourses.select, |
609 | 609 | sectionId: this.addCourses.selectSection, |
610 | - coursrName: this.addCourses.coursrName | |
610 | + courseName: this.addCourses.courseName | |
611 | 611 | }; |
612 | 612 | if (this.imageUrl) { |
613 | 613 | var str = this.imageUrl; |
... | ... | @@ -640,7 +640,7 @@ export default { |
640 | 640 | save() { |
641 | 641 | let editCourse = { |
642 | 642 | courseId: this.editedItem._id, |
643 | - coursrName: this.editedItem.coursrName, | |
643 | + courseName: this.editedItem.courseName, | |
644 | 644 | classId: this.editedItem.select |
645 | 645 | }; |
646 | 646 | if (this.editImageUrl) { | ... | ... |
src/pages/Course/courseDetail.vue
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | :items="courseData" |
43 | 43 | label="Select Course" |
44 | 44 | v-model="editedCourse.courseId" |
45 | - item-text="coursrName" | |
45 | + item-text="courseName" | |
46 | 46 | item-value="_id" |
47 | 47 | required |
48 | 48 | class="ml-2" |
... | ... | @@ -362,7 +362,7 @@ |
362 | 362 | :items="courseData" |
363 | 363 | label="Select Course" |
364 | 364 | v-model="getCourse.courseId" |
365 | - item-text="coursrName" | |
365 | + item-text="courseName" | |
366 | 366 | item-value="_id" |
367 | 367 | required |
368 | 368 | class="ml-2" |
... | ... | @@ -395,7 +395,7 @@ |
395 | 395 | <tr class="tr" @click="courseTableRow(props.item._id)"> |
396 | 396 | <td class="td td-row">{{ props.index + 1}}</td> |
397 | 397 | <td class="td td-row text-xs-center">{{ props.item.classId.classNum }}</td> |
398 | - <td class="td td-row text-xs-center">{{ props.item.courseId.coursrName }}</td> | |
398 | + <td class="td td-row text-xs-center">{{ props.item.courseId.courseName }}</td> | |
399 | 399 | <td class="td td-row text-xs-center"> |
400 | 400 | <span> |
401 | 401 | <v-tooltip top> |
... | ... | @@ -535,7 +535,7 @@ |
535 | 535 | :items="courseData" |
536 | 536 | label="Select Course" |
537 | 537 | v-model="addCourseDetail.courseId" |
538 | - item-text="coursrName" | |
538 | + item-text="courseName" | |
539 | 539 | item-value="_id" |
540 | 540 | :rules="courseRules" |
541 | 541 | required | ... | ... |
src/pages/Course/enrollStudents.vue
src/pages/Dashboard/Announcement.vue
src/pages/Dashboard/ChapterInfo.vue
src/pages/Dashboard/CourseDetails.vue
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | <v-flex xs8> |
25 | 25 | <div |
26 | 26 | class="title side-bar-color font-weight-bold" |
27 | - >Welcome to the {{courseDetails[0].courseId.coursrName}} 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 | 28 | <v-flex xs12 class="subheading mt-2"> |
29 | 29 | Lorem Ipsum sdjjkhsdf sdklfjs dkfjskdjfk fjsdklf sdjfksljf sdfkls fljlkj kl |
30 | 30 | jkhjkfhjksd sdfjkhsdjk fsdjkl sfkljkl ldkfjkl kjlfs dlkjlskd fljsldk fklj |
... | ... | @@ -32,7 +32,10 @@ |
32 | 32 | </v-flex> |
33 | 33 | |
34 | 34 | <div class="mt-5"> |
35 | - <span class="grey--text lighten-1"> | |
35 | + <span | |
36 | + class="grey--text lighten-1" | |
37 | + @click="$router.push({name: 'Announcement', query:{courseId: $route.query.courseId}})" | |
38 | + > | |
36 | 39 | <v-icon>question_answer</v-icon> |
37 | 40 | <span class="ml-2">Announcement</span> |
38 | 41 | </span> |
... | ... | @@ -88,14 +91,14 @@ |
88 | 91 | > |
89 | 92 | <div style="width: 100%;text-align: left;"> |
90 | 93 | <v-icon style="color: red;padding-bottom: 3px;" size="15">play_arrow</v-icon> |
91 | - {{course.coursrName}} | |
94 | + {{course.courseName}} | |
92 | 95 | </div> |
93 | 96 | </v-btn> |
94 | 97 | </div> |
95 | 98 | <!-- <v-expansion-panel focusable class="elevation-0"> |
96 | 99 | <v-expansion-panel-content v-for="(item,i) in courseData" :key="i"> |
97 | 100 | <template v-slot:header> |
98 | - <div class="subheading">{{item.coursrName}}</div> | |
101 | + <div class="subheading">{{item.courseName}}</div> | |
99 | 102 | </template> |
100 | 103 | </v-expansion-panel-content> |
101 | 104 | </v-expansion-panel>--> | ... | ... |
src/pages/Dashboard/CourseDiscussionForum.vue
... | ... | @@ -164,7 +164,29 @@ |
164 | 164 | </v-flex> |
165 | 165 | |
166 | 166 | <!-- DATA TABLE --> |
167 | - <v-flex></v-flex> | |
167 | + <v-flex> | |
168 | + <v-data-table | |
169 | + :headers="courseDiscussionHeaders" | |
170 | + :items="courseDiscussionItems" | |
171 | + :pagination.sync="pagination" | |
172 | + :search="search" | |
173 | + > | |
174 | + <template slot="items" slot-scope="props"> | |
175 | + <tr class="tr"> | |
176 | + <td class="td td-row text-xs-center">{{ props.item.courseId.courseName}}</td> | |
177 | + <td class="td td-row text-xs-center">{{ props.item.studentId.name }}</td> | |
178 | + <td class="td td-row text-xs-center">{{ props.item.courseId.courseName}}</td> | |
179 | + <td class="td td-row text-xs-center">{{ props.item.studentId.name }}</td> | |
180 | + </tr> | |
181 | + </template> | |
182 | + <v-alert | |
183 | + slot="no-results" | |
184 | + :value="true" | |
185 | + color="error" | |
186 | + icon="warning" | |
187 | + >Your search for "{{ search }}" found no results.</v-alert> | |
188 | + </v-data-table> | |
189 | + </v-flex> | |
168 | 190 | </v-layout> |
169 | 191 | |
170 | 192 | <!-- NEXT CHAPTER --> |
... | ... | @@ -201,7 +223,7 @@ |
201 | 223 | > |
202 | 224 | <div style="width: 100%;text-align: left;"> |
203 | 225 | <v-icon style="color: red;padding-bottom: 3px;" size="15">play_arrow</v-icon> |
204 | - {{course.coursrName}} | |
226 | + {{course.courseName}} | |
205 | 227 | </div> |
206 | 228 | </v-btn> |
207 | 229 | </div> |
... | ... | @@ -226,7 +248,30 @@ export default { |
226 | 248 | imageName: "", |
227 | 249 | imageUrl: "", |
228 | 250 | imageFile: "", |
229 | - imageData: {} | |
251 | + imageData: {}, | |
252 | + | |
253 | + // DATA TABLE | |
254 | + search: "", | |
255 | + pagination: { | |
256 | + rowsPerPage: 10 | |
257 | + }, | |
258 | + courseDiscussionHeaders: [ | |
259 | + { | |
260 | + text: "Discussion", | |
261 | + align: "", | |
262 | + sortable: false, | |
263 | + value: "" | |
264 | + }, | |
265 | + { | |
266 | + text: "Started", | |
267 | + value: "", | |
268 | + sortable: false, | |
269 | + align: "center" | |
270 | + }, | |
271 | + { text: "Last Pot", value: "", sortable: false, align: "center" }, | |
272 | + { text: "Replies", value: "", sortable: false, align: "center" } | |
273 | + ], | |
274 | + courseDiscussionItems: [] | |
230 | 275 | }; |
231 | 276 | }, |
232 | 277 | methods: { |
... | ... | @@ -313,6 +358,12 @@ export default { |
313 | 358 | classId: localStorage.getItem("parentClassId"), |
314 | 359 | studentId: localStorage.getItem("parentStudentId") |
315 | 360 | }); |
361 | + | |
362 | + /* getCourseDiscussionesList - to populate the data table */ | |
363 | + await this.getCourseDiscussionesList({ | |
364 | + courseId: this.$route.query.courseId, | |
365 | + classId: localStorage.getItem("parentClassId") | |
366 | + }); | |
316 | 367 | } |
317 | 368 | }; |
318 | 369 | </script> | ... | ... |
src/pages/Dashboard/dashboard.vue
... | ... | @@ -260,7 +260,7 @@ |
260 | 260 | <v-list-tile-title |
261 | 261 | style="cursor: pointer;" |
262 | 262 | @click="routeToCourseDetails(course._id)" |
263 | - >{{ course.coursrName }}</v-list-tile-title> | |
263 | + >{{ course.courseName }}</v-list-tile-title> | |
264 | 264 | </v-list-tile-content> |
265 | 265 | </v-list-tile> |
266 | 266 | </template> |
... | ... | @@ -388,15 +388,22 @@ |
388 | 388 | </v-flex> |
389 | 389 | <hr /> |
390 | 390 | <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div> |
391 | - <vue-event-calendar :events="demoEvents"></vue-event-calendar> | |
391 | + <vue-event-calendar :events="activityEvents"></vue-event-calendar> | |
392 | 392 | <!-- LATEST ACTIVITY --> |
393 | 393 | <v-card class="my-3 elevation-0"> |
394 | 394 | <v-card-text> |
395 | - <div class="text-xs-center subheading font-weight-bold">Latest Activity</div> | |
396 | - <div> | |
395 | + <v-card-title class="justify-center subheading font-weight-bold">Latest Activity</v-card-title> | |
396 | + <div v-for="(activity,index) in activityList" :key="index" class="mt-2"> | |
397 | 397 | <span |
398 | - style="background-color:yellow ;height: 12px;width: 12px;border-radius: 50%;display: inline-block;" | |
398 | + :style="{ 'background-color': colorsArray[index%colorsArray.length] }" | |
399 | + style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" | |
399 | 400 | ></span> |
401 | + <div style="display: inline-block;" class="ml-2"> | |
402 | + <div | |
403 | + class="grey--text lighten-1 caption" | |
404 | + >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> | |
405 | + <div class="body-2">{{activity.meetingEvent.title}}</div> | |
406 | + </div> | |
400 | 407 | </div> |
401 | 408 | </v-card-text> |
402 | 409 | </v-card> |
... | ... | @@ -457,19 +464,9 @@ export default { |
457 | 464 | // calendarData: {}, |
458 | 465 | // calendar: {}, |
459 | 466 | |
460 | - colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"], | |
461 | - demoEvents: [ | |
462 | - { | |
463 | - date: "2020/01/10", // Required | |
464 | - title: "Foo" // Required | |
465 | - }, | |
466 | - { | |
467 | - date: "2020/01/12", | |
468 | - title: "Bar", | |
469 | - desc: "description", | |
470 | - customClass: "disabled highlight" // Custom classes to an calendar cell | |
471 | - } | |
472 | - ], | |
467 | + // CALENDER | |
468 | + moment: moment, | |
469 | + activityEvents: [], | |
473 | 470 | onlineUser: [ |
474 | 471 | { |
475 | 472 | user: "Student Demo" |
... | ... | @@ -609,7 +606,11 @@ export default { |
609 | 606 | } |
610 | 607 | } |
611 | 608 | } |
612 | - } | |
609 | + }, | |
610 | + | |
611 | + // LATEST ACTIVITY | |
612 | + colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"], | |
613 | + activityList: [] | |
613 | 614 | }; |
614 | 615 | }, |
615 | 616 | mounted() { |
... | ... | @@ -657,22 +658,7 @@ export default { |
657 | 658 | this.seeSnackbar("No Data Available", "warning"); |
658 | 659 | } |
659 | 660 | }, |
660 | - studentMeetingEvents() { | |
661 | - http() | |
662 | - .get("/studentMeetingEvents", { | |
663 | - params: { | |
664 | - studentId: localStorage.getItem("parentStudentId") | |
665 | - } | |
666 | - }) | |
667 | - .then(response => { | |
668 | - console.log("response of studentMeetingEvents - ", response); | |
669 | - this.showLoader = false; | |
670 | - }) | |
671 | - .catch(err => { | |
672 | - console.log("err====>", err); | |
673 | - this.showLoader = false; | |
674 | - }); | |
675 | - }, | |
661 | + | |
676 | 662 | closeNotice() { |
677 | 663 | this.dialogNotice = false; |
678 | 664 | }, |
... | ... | @@ -685,6 +671,9 @@ export default { |
685 | 671 | date: function(date) { |
686 | 672 | return moment(date).format("MMMM DD, YYYY HH:mm"); |
687 | 673 | }, |
674 | + activityDate(date) { | |
675 | + return moment(date).format("MMMM DD, YYYY"); | |
676 | + }, | |
688 | 677 | refreshEvents() { |
689 | 678 | this.$refs.calendar.$emit("refetch-events"); |
690 | 679 | }, |
... | ... | @@ -922,9 +911,20 @@ export default { |
922 | 911 | }); |
923 | 912 | } |
924 | 913 | }, |
925 | - created() { | |
914 | + async created() { | |
926 | 915 | /* get Latest events list */ |
927 | - this.studentMeetingEvents(); | |
916 | + let response = await this.studentMeetingEvents({ | |
917 | + studentId: localStorage.getItem("parentStudentId") | |
918 | + }); | |
919 | + this.activityList = response.data.data; | |
920 | + | |
921 | + /* set activityEvents array to highlight event dates in calender */ | |
922 | + for (var i = 0; i < this.activityList.length; i++) { | |
923 | + let obj = {}; | |
924 | + obj.date = moment(this.activityList[i].meetingEvent.dateOfEvent).format("YYYY/MM/DD");; | |
925 | + obj.title = this.activityList[i].meetingEvent.title; | |
926 | + this.activityEvents.push(obj); | |
927 | + } | |
928 | 928 | } |
929 | 929 | }; |
930 | 930 | </script> | ... | ... |
src/pages/meetingEvent/meetingEvent.vue
src/router/paths.js
... | ... | @@ -292,6 +292,20 @@ export default [{ |
292 | 292 | ) |
293 | 293 | }, |
294 | 294 | { |
295 | + path: '/Announcement', | |
296 | + meta: {}, | |
297 | + name: 'Announcement', | |
298 | + props: (route) => ({ | |
299 | + type: route.query.type | |
300 | + }), | |
301 | + component: () => | |
302 | + import( | |
303 | + /* webpackChunkName: "routes" */ | |
304 | + /* webpackMode: "lazy-once" */ | |
305 | + `@/pages/Dashboard/Announcement.vue` | |
306 | + ) | |
307 | + }, | |
308 | + { | |
295 | 309 | path: '/socialMedia', |
296 | 310 | meta: {}, |
297 | 311 | name: 'Social Media', | ... | ... |