Commit e5699315cd8e31dbf038aa32a45b1804e079ba9e

Authored by Shikha Mishra
1 parent d23a27a41e

Show latest event in dashboard while admin login

Showing 1 changed file with 47 additions and 20 deletions   Show diff stats
src/pages/Dashboard/dashboard.vue
... ... @@ -530,7 +530,7 @@
530 530  
531 531 <!-- LATEST EVENTS -->
532 532 <v-card class="my-3 elevation-0" v-if="role != 'TEACHER'">
533   - <v-card-text>
  533 + <v-card-text v-if="$store.state.role === 'ADMIN' ">
534 534 <v-card-title class="justify-center subheading font-weight-bold">Latest Events</v-card-title>
535 535 <div
536 536 v-for="(activity,index) in activityList"
... ... @@ -544,20 +544,7 @@
544 544 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
545 545 ></span>
546 546 <div style="display: inline-block;" class="ml-2">
547   - <!-- LATEST EVENTS FOR PARENT -->
548   - <div v-if="$store.state.role === 'PARENT' ">
549   - <div
550   - class="grey--text lighten-1 caption"
551   - v-if="activity.meetingEvent"
552   - >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
553   - <div
554   - class="body-2"
555   - v-if="activity.meetingEvent"
556   - >{{activity.meetingEvent.title}}</div>
557   - </div>
558   -
559   - <!-- LATEST EVENTS FOR TEACHER -->
560   - <div v-if="role == 'TEACHER'">
  547 + <div>
561 548 <div
562 549 class="grey--text lighten-1 caption"
563 550 v-if="activity.dateOfEvent"
... ... @@ -570,6 +557,43 @@
570 557 <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
571 558 </div>
572 559 </v-card-text>
  560 + <v-card-text>
  561 + <!-- <v-card-title class="justify-center subheading font-weight-bold">Latest Events</v-card-title> -->
  562 + <!-- <div
  563 + v-for="(activity,index) in activityList"
  564 + :key="index"
  565 + class="mt-2"
  566 + style="cursor: pointer;"
  567 + @click="seeEventDetails(activity)"
  568 + >
  569 + <span
  570 + :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
  571 + style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
  572 + ></span>-->
  573 + <div style="display: inline-block;" class="ml-2">
  574 + <!-- LATEST EVENTS FOR PARENT -->
  575 + <div v-if="$store.state.role === 'PARENT' ">
  576 + <div
  577 + class="grey--text lighten-1 caption"
  578 + v-if="activity.meetingEvent"
  579 + >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
  580 + <div class="body-2" v-if="activity.meetingEvent">{{activity.meetingEvent.title}}</div>
  581 + </div>
  582 +
  583 + <!-- LATEST EVENTS FOR TEACHER -->
  584 + <div v-if="role === 'TEACHER'">
  585 + <div
  586 + class="grey--text lighten-1 caption"
  587 + v-if="activity.dateOfEvent"
  588 + >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
  589 + <div class="body-2" v-if="activity.title">{{activity.title}}</div>
  590 + </div>
  591 + </div>
  592 + <div v-if="activityList.length == 0">
  593 + <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
  594 + </div>
  595 + <!-- </div> -->
  596 + </v-card-text>
573 597 </v-card>
574 598 </v-card-text>
575 599 </v-card>
... ... @@ -801,6 +825,12 @@ export default {
801 825 });
802 826 this.viewEventDetails = true;
803 827 }
  828 + if (this.$store.state.role === "ADMIN") {
  829 + await this.getParticularMeetingEvent({
  830 + meetingEventId: activity._id,
  831 + });
  832 + this.viewEventDetails = true;
  833 + }
804 834 },
805 835 async routeToCourseDetails(courseId) {
806 836 /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/
... ... @@ -1017,7 +1047,7 @@ export default {
1017 1047 });
1018 1048 },
1019 1049 async getMeetingEventes() {
1020   - if (this.role == "TEACHER") {
  1050 + if (this.role == "TEACHER" || this.role === "ADMIN") {
1021 1051 this.showLoader = true;
1022 1052 await http()
1023 1053 .get("/getMeetingEventesList")
... ... @@ -1102,7 +1132,7 @@ export default {
1102 1132 }
1103 1133  
1104 1134 /* get Latest events list for teacher login*/
1105   - if (this.role == "TEACHER") {
  1135 + if (this.role == "TEACHER" || this.role == "ADMIN") {
1106 1136 await this.getMeetingEventes();
1107 1137 }
1108 1138 },
... ... @@ -1115,7 +1145,4 @@ export default {
1115 1145 a {
1116 1146 color: white;
1117 1147 }
1118   -
1119   -#pages-dasboard {
1120   -}
1121 1148 </style>
1122 1149 \ No newline at end of file
... ...