Skip to content

Commit

Permalink
button text
Browse files Browse the repository at this point in the history
  • Loading branch information
bkawk committed Nov 21, 2018
1 parent 712b72f commit e2f4b99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/routes/dashboard/profile-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ class ProfileRoute extends PolymerElement {
</div>
<div class="footer">
<button type="button" on-click="_saveProfile">Save Application Form</button>
<button type="button" on-click="_saveProfile">[[btnText]]</button>
</div>
<!-- </template> -->
</div>
Expand Down Expand Up @@ -867,6 +867,10 @@ class ProfileRoute extends PolymerElement {
showIframe: {
type: Boolean,
value: false,
},
btnText:{
type: Text,
value: 'Save Application Form',
}
};
}
Expand Down Expand Up @@ -938,6 +942,7 @@ class ProfileRoute extends PolymerElement {
}

_saveProfile(){
this.btnText = 'Saving..';
let check = true
const name_first = this.nameFirst;
const name_middle = this.nameMiddle;
Expand Down Expand Up @@ -1042,7 +1047,8 @@ _save(data){
if(response.data === true){
const token = response.newjwt;
localStorage.setItem("token", token);
this.set('route.path', '/dashboard/review/')
this.set('route.path', '/dashboard/review/');
this.btnText = 'Save Application Form';
} else {
console.log(error)
}
Expand Down
10 changes: 9 additions & 1 deletion src/routes/dashboard/review-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class ReviewRoute extends PolymerElement {
</div>
</div>
<div class="footer">
<button type="button" on-click="_submitApplication">Submit Application</button>
<button type="button" on-click="_submitApplication">[[btnText]]</button>
</div>
</div>
Expand Down Expand Up @@ -350,11 +350,16 @@ class ReviewRoute extends PolymerElement {
route: {
type: Object,
observer: '_routeChanged'
},
btnText: {
type: Text,
value: 'Submit Application'
}
};
}

_submitApplication(){
this.btnText = "Submitting...";
if(this.documentCount >= 2){
const token = localStorage.getItem("token");
const url = `${this.apiPath}/kyc/check/`;
Expand All @@ -368,6 +373,7 @@ class ReviewRoute extends PolymerElement {
const token = response.token;
localStorage.setItem("token", token);
this.set('route.path', '/dashboard/status');
this.btnText = 'Submit Application'
}
})
} else {
Expand Down Expand Up @@ -396,13 +402,15 @@ class ReviewRoute extends PolymerElement {
this.nameFirst = response.profile.name_first || "";
this.nameMiddle = response.profile.name_middle || "";
this.nameLast = response.profile.name_last || "";

this.addressNumber = response.profile.address_number || "";
this.addressOne = response.profile.address_one || "";
this.addressTwo = response.profile.address_two || "";
this.addressCity = response.profile.address_city || "";
this.addressRegion = response.profile.address_region || "";
this.addressZip = response.profile.address_zip || "";
this.addressCountry = response.profile.address_country || "";

this.phoneCode = response.profile.phone_code || "";
this.phoneMobile = response.profile.phone_mobile || "";
this.dobYear = response.profile.date_birth_year || "";
Expand Down
4 changes: 2 additions & 2 deletions src/routes/dashboard/status-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class StatusRoute extends PolymerElement {
<div class="input-area">
<div class="section-name">Document Report</div>
<div class="form-inputs">
<p class="label">Verified</p>
<p class="label">Reviewing</p>
</div>
</div>
Expand All @@ -275,7 +275,7 @@ class StatusRoute extends PolymerElement {
<div class="input-area">
<div class="section-name">Facial Similarity Report</div>
<div class="form-inputs">
<p class="label">Failed</p>
<p class="label">Reviewing</p>
</div>
</div>
Expand Down

0 comments on commit e2f4b99

Please sign in to comment.