Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwas1 committed Jun 22, 2024
1 parent f3d1a66 commit 1ace166
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
17 changes: 14 additions & 3 deletions src/mixins/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,26 @@ export default {
},
getStatus(sessionDetails) {
// Sucess, Expired, Pending
const { expiresAt, step_finish } = sessionDetails
const { expiresAt, step_finish, ocriddocsDetails, selfiDetails } = sessionDetails

if (step_finish == 1) {
return '<span class="badge badge-pill badge-success">Success</span>'
}


if (selfiDetails && Object.keys(selfiDetails).length > 0 && selfiDetails.serviceLivenessResult != 3) {
// Fall back for those record where expiry data not present
return '<span class="badge badge-pill badge-danger">Failed<span>'
}

if (ocriddocsDetails && Object.keys(ocriddocsDetails).length > 0 && ocriddocsDetails.serviceFacialAuthenticationResult != 3) {
// Fall back for those record where expiry data not present
return '<span class="badge badge-pill badge-danger">Failed<span>'
}

if (!expiresAt) {
// Fall back for those record where expiry data not present
return '<span class="badge badge-pill badge-danger">Expired<span>'
return '<span class="badge badge-pill badge-secondary">Expired<span>'
}

const now = Date.now()
Expand All @@ -135,7 +146,7 @@ export default {
}

if ((step_finish == 0) && hasExpired) {
return '<span class="badge badge-pill badge-danger">Expired<span>'
return '<span class="badge badge-pill badge-secondary">Expired<span>'
}

if ((step_finish == 0) && !hasExpired) {
Expand Down
32 changes: 26 additions & 6 deletions src/views/playground/SessionsDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ h3 {
</div>

<!-- Face Verification -->
<div class="card dataCard float-" style="border: 1px solid rgb(81, 137, 81);"
<div class="card dataCard float-" :style="{ 'border': getStatusColor }"
v-if="session.selfiDetails && Object.keys(session.selfiDetails).length > 0">
<div class="card-header" style="padding: 10px">
<h4><i class="fa fa-smile" aria-hidden="true"></i> Face Verification</h4>
Expand All @@ -356,14 +356,18 @@ h3 {
<span class=""><img style="height:100px;"
:src="session.selfiDetails.tokenSelfiImage" /></span>
</div>
<div class="col-md-2 centered-container" style="" v-if="selfiDataFound && idDocDataFound">
<div class="col-md-2 centered-container" style="" v-if="isFacialAuthenticationSuccess">
<span class="" style="font-size: 50px; color: green;"><i class="fa fa-check-circle"
aria-hidden="true"></i></span>
</div>
<div class="col-md-2 centered-container" style="" v-else>
<span class="" style="font-size: 50px; color: red;"><i class="fa fa-times-circle"
aria-hidden="true"></i></span>
</div>
<!-- <div class="col-md-2 centered-container" style="" v-else>
<span class="" style="font-size: 50px; color: orange;"><i
class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>
</div>
</div> -->

<div class="col-md-5 centered-container" style="">
<span class=""><img style="height:100px;"
Expand All @@ -372,9 +376,15 @@ h3 {
</div>
<div class="row">
<div class="col-md-12">
<div class="alert alert-success" role="alert">
<span><i class="fa fa-info-circle" aria-hidden="true"></i></span> Passive liveness
Success
<div class="alert alert-success" role="alert" v-if="isFacialAuthenticationSuccess">
<span><i class="fa fa-info-circle" aria-hidden="true"></i></span> Facial
Authentication
Passed
</div>
<div class="alert alert-danger" role="alert" v-else>
<span><i class="fa fa-info-circle" aria-hidden="true"></i></span> Facial
Authentication
Failed
</div>
</div>
</div>
Expand Down Expand Up @@ -534,6 +544,16 @@ export default {
sessionList: state => state.mainStore.sessionList,
containerShift: state => state.playgroundStore.containerShift,
}),
isFacialAuthenticationSuccess() {
return this.selfiDataFound && this.idDocDataFound && this.session.ocriddocsDetails.serviceFacialAuthenticationResult == 3
},
getStatusColor() {
if (this.isFacialAuthenticationSuccess) {
return '1px solid rgb(81, 137, 81)'
} else {
return '1px solid red'
}
},
isContainerShift() {
return this.containerShift
},
Expand Down

0 comments on commit 1ace166

Please sign in to comment.