Commit 8527136546cb772071058a2de88e2a1b05c9bf9f

Authored by Amber Dev
1 parent 01a388dfe9

added live class message

src/pages/Dashboard/LiveOnlineClass.vue
... ... @@ -29,16 +29,17 @@
29 29 <div
30 30 class="title side-bar-color font-weight-bold"
31 31 >Live Online Classes - {{$route.query.chapterName}}</div>
32   - <div class="subheading grey--text lighten-1">{{startLiveSession}}</div>
  32 + <!-- <div class="subheading grey--text lighten-1">{{startLiveSession}}</div>
33 33 <div
34 34 class="subheading grey--text lighten-1"
35   - >The session started at 1:00 there is 1 moderator</div>
  35 + >The session started at 1:00 there is 1 moderator</div>-->
36 36 </v-flex>
37 37  
38 38 <!-- JOIN OR END SESSION -->
39 39 <v-flex>
40 40 <div>
41   - <v-btn round class="open-dialog-button" dark>Join Session</v-btn>
  41 + <v-btn round class="open-dialog-button" dark v-if="studentBtn">{{studentBtn}}</v-btn>
  42 + <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span>
42 43 </div>
43 44 </v-flex>
44 45  
... ... @@ -81,10 +82,10 @@
81 82 <div
82 83 class="title side-bar-color font-weight-bold"
83 84 >Live Online Classes - {{$route.query.chapterName}}</div>
84   - <div class="subheading grey--text lighten-1">{{startLiveSession}}</div>
85   - <div
  85 + <!-- <div class="subheading grey--text lighten-1"></div> -->
  86 + <!-- <div
86 87 class="subheading grey--text lighten-1"
87   - >The session started at 1:00 there is 1 moderator</div>
  88 + >The session started at 1:00 there is 1 moderator</div>-->
88 89 </v-flex>
89 90  
90 91 <!-- JOIN OR END SESSION -->
... ... @@ -95,7 +96,7 @@
95 96 class="open-dialog-button"
96 97 dark
97 98 @click="createRoom($route.query.classId)"
98   - >Start Session</v-btn>
  99 + >{{startLiveSession}}</v-btn>
99 100 </div>
100 101 </v-flex>
101 102  
... ... @@ -160,6 +161,7 @@ export default {
160 161 data() {
161 162 return {
162 163 startLiveSession: "",
  164 + studentBtn: "",
163 165  
164 166 // DATA TABLE
165 167 search: "",
... ... @@ -326,8 +328,6 @@ export default {
326 328 this.token = this.$store.state.token;
327 329 },
328 330 async created() {
329   - console.log("local st - ",localStorage)
330   -
331 331 /* getLiveClassesesList - To up date line under heading*/
332 332 let response = await this.getLiveClassesesList({
333 333 classId: this.$route.query.classId,
... ... @@ -335,9 +335,20 @@ export default {
335 335 chapterId: this.$route.query.chapterId
336 336 });
337 337 console.log("response getLiveClassesesList- ", response);
  338 +
  339 + /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */
338 340 if (response.data.data.length == 0) {
339   - console.log("response of - ", response);
340   - this.startLiveSession = "Start live session";
  341 + this.startLiveSession = "Start Session";
  342 + this.studentBtn = "";
  343 + } else {
  344 + if (response.data.data[0].sessionStatus == "ENDED") {
  345 + this.startLiveSession = "Start Session";
  346 + this.studentBtn = "";
  347 + }
  348 + if (response.data.data[0].sessionStatus == "STARTED") {
  349 + this.startLiveSession = "Join Session";
  350 + this.studentBtn = "Join Session";
  351 + }
341 352 }
342 353  
343 354 /* getStudentCourses - to get courseData - defined in GetApis.js*/
... ...
src/pages/Dashboard/dashboard.vue
... ... @@ -415,6 +415,7 @@
415 415 </v-flex>
416 416 <hr />
417 417 <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div>
  418 +
418 419 <vue-event-calendar :events="activityEvents" @day-changed="handleDayChanged($event)"></vue-event-calendar>
419 420  
420 421 <!-- LATEST EVENTS -->
... ... @@ -669,6 +670,9 @@ export default {
669 670 };
670 671 },
671 672 methods: {
  673 + test(e) {
  674 + console.log(" test - ", e);
  675 + },
672 676 async handleDayChanged(e) {
673 677 await this.getParticularMeetingEvent({
674 678 meetingEventId: e.events[0]._id
... ...