@@ -216,8 +216,8 @@ h5 span {
216
216
<tbody >
217
217
<tr v-for =" eachRow in getSortedKYCCredits" v-bind:key =" eachRow._id" >
218
218
<td >
219
- {{ formatDate(eachRow.createdAt) }}
220
- </ td >
219
+
220
+ {{ formatDate(eachRow.createdAt) }}
221
221
222
222
<td >
223
223
{{ numberFormat(eachRow.totalCredits) }}
@@ -231,29 +231,34 @@ h5 span {
231
231
232
232
233
233
<td v-if =" eachRow.used >= eachRow.totalCredits" class =" greyFont" >
234
- Expired
234
+ Credit Limit Reached
235
+
235
236
</td >
236
- <td v-else-if =" ! eachRow.expiresAt" class =" greyFont" >
237
- Inactive
237
+ <td v-else-if =" Date.now() > new Date( eachRow.expiresAt) " class =" greyFont" >
238
+ Expired
238
239
</td >
239
240
<td v-else >
240
241
{{ formatTimeRemaining(eachRow.expiresAt) }}
241
242
</td >
243
+
242
244
243
245
244
246
<td :title =" `Credit left: ${eachRow.totalCredits - eachRow.used}`" >
245
- <b-progress :max =" eachRow.totalCredits" class =" mt-1" >
247
+ <b-progress :max =" eachRow.totalCredits" class =" mt-1" v-if =" Date.now() > new Date(eachRow.expiresAt)" >
248
+ <b-progress-bar :value =" eachRow.used" variant =" danger" ></b-progress-bar >
249
+ </b-progress >
250
+ <b-progress :max =" eachRow.totalCredits" class =" mt-1" v-else >
246
251
<b-progress-bar :value =" eachRow.used" variant =" danger" ></b-progress-bar >
247
252
</b-progress >
248
253
</td >
249
254
250
- <td v-if =" eachRow.status == 'Active'" >
255
+ <td v-if =" ( eachRow.status == 'Active' && !(Date.now() > new Date(eachRow.expiresAt)) ) " >
251
256
<hf-buttons iconClass =" circle-fill" :bIcon =" true" class =" ml-auto " style =" color :gray ; "
252
257
disabled animate =" throb" :name =" eachRow.status" >
253
258
</hf-buttons >
254
259
</td >
255
260
<td v-else >
256
- <hf-buttons v-if =" eachRow.used < eachRow.totalCredits" name =" Activate"
261
+ <hf-buttons v-if =" eachRow.used < eachRow.totalCredits && !(Date.now() > new Date(eachRow.expiresAt)) " name =" Activate"
257
262
iconClass =" play-circle" :bIcon =" true" class =" ml-auto "
258
263
@executeAction =" activateThisCredit(eachRow)" ></hf-buttons >
259
264
</td >
@@ -291,6 +296,7 @@ export default {
291
296
292
297
getSortedKYCCredits () {
293
298
const t = this .getKYCCredits
299
+
294
300
return t .sort ((a , b ) => new Date (b .expiresAt ) - new Date (a .expiresAt ))
295
301
},
296
302
myKYCCredits () {
@@ -431,6 +437,10 @@ export default {
431
437
clearInterval (this .timer ); // Stop the interval timer
432
438
},
433
439
renderChart () {
440
+ const expired = this .getKYCCredits .every (element => Date .now () > new Date (element .expiresAt ));
441
+
442
+
443
+ const color = expired? [' grey' ,' #d0d0d0' ]: [' grey' ,' green' ]
434
444
this .doughNutChart ? .destroy ()
435
445
const ctx = document .getElementById (' doughNutChat' );
436
446
this .doughNutChart = new Chart (ctx, {
@@ -441,11 +451,7 @@ export default {
441
451
{
442
452
label: ' Credit' ,
443
453
data: this .getKYCCredits .length == 0 ? [1 , 0 ] : [this .myKYCCredits .allUsedCredits , this .myKYCCredits .allRemainingCredits ],
444
- backgroundColor: [
445
- ' grey' ,
446
- ' green' ,
447
-
448
- ],
454
+ backgroundColor: color,
449
455
hoverOffset: 4 ,
450
456
cutout: ' 50%' ,
451
457
circumference: 180 ,
0 commit comments