Skip to content

Commit

Permalink
This commit alters the functions surrounding data-warning form-level …
Browse files Browse the repository at this point in the history
…errors,

adapting them to the newer back-end delivery of these errors.
  • Loading branch information
mistergone committed Aug 5, 2016
1 parent 89ce25b commit ee3b1bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
6 changes: 3 additions & 3 deletions paying_for_college/templates/worksheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1 class="hero_heading">
<section class="verify step content_wrapper">
<div class="content_main">
<div class="cf-notification cf-notification__error verify_content"
data-missing-data-error="school">
data-missing-data-error="noSchool">
<span class="cf-notification_icon cf-notification_icon__error cf-icon cf-icon-delete-round" role="alert"></span>
<div class="cf-notification_text">
<p>The information your school provided is missing the school ID, which is vital information for this tool to work. Please contact your school and ask them to ensure they are sending us the right school ID and it's in the correct format.</p>
Expand All @@ -54,7 +54,7 @@ <h1 class="hero_heading">
</div>
</div>
<div class="cf-notification cf-notification__error verify_content"
data-missing-data-error="program">
data-missing-data-error="noProgram">
<span class="cf-notification_icon cf-notification_icon__error cf-icon cf-icon-delete-round" role="alert"></span>
<div class="cf-notification_text">
<p>The information your school provided is missing the program ID, which is vital information for this tool to work. Please contact your school and ask them to ensure they are sending us the right program ID and it's in the correct format.</p>
Expand All @@ -63,7 +63,7 @@ <h1 class="hero_heading">
</div>
</div>
<div class="cf-notification cf-notification__error verify_content"
data-missing-data-error="offer">
data-missing-data-error="noOffer">
<span class="cf-notification_icon cf-notification_icon__error cf-icon cf-icon-delete-round" role="alert"></span>
<div class="cf-notification_text">
<p>The information your school provided is missing the offer ID, which is vital information for this tool to work. Please contact your school and ask them to ensure they are sending us the right offer ID and it's in the correct format.</p>
Expand Down
13 changes: 4 additions & 9 deletions src/disclosures/js/dispatchers/get-api-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,10 @@ var getApiValues = {

initialData: function() {
// If there's a [data-warning], display error
var warning = $( '[data-warning]' ).attr( 'data-warning' ),
warningType,
checks = [ 'school', 'program', 'offer' ];
for ( var x = 0; x < checks.length; x++ ) {
if ( warning.indexOf( checks[x] ) !== -1 ) {
warningType = checks[x];
financialView.missingData( warningType );
return $.Deferred;
}
var warning = $( '[data-warning]' ).attr( 'data-warning' );
if ( warning !== '' ) {
financialView.missingData( warning );
return $.Deferred;
}
return $.when( this.constants(), this.expenses() );
}
Expand Down

0 comments on commit ee3b1bd

Please sign in to comment.