Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Fixed missing radio buttons on Employee Productivity Measure.
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferey committed Dec 1, 2016
1 parent 9864fb0 commit bdb2828
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ module.exports = function(ngModule) {
return undefined;
}

this.workerProductivityChanged = function(study) {
if (!study && vm.activeWorker) {
vm.activeWorker.productivityMeasure = undefined;
}
}


// convenience methods to avoid lenghty template statements
this.validateActiveWorksiteProperty = function(prop) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,19 @@ <h4>Number of Employees: <strong>{{ vm.activeWorksite.numEmployees ? vm.activeWo
<td>
<div ng-class="vm.validateActiveWorkerProperty('productivityMeasure') ? 'usa-input-error' : ''">
<span class="usa-input-error-message" role="alert" ng-show="vm.validateActiveWorkerProperty('productivityMeasure')">{{ vm.validateActiveWorkerProperty('productivityMeasure') }}</span>
<input id="workerProductivity" name="workerProductivity" type="number" class="wage-rate" min="0" step="0.1" ng-model="vm.activeWorker.productivityMeasure">

<ul class="usa-unstyled-list">
<li>
<input id="workerProductivityNA" type="radio" name="workerProductivityToggle" ng-value="undefined" ng-model="vm.activeWorker.hasProductivityMeasure" ng-change="vm.workerProductivityChanged()">
<label for="workerProductivityNA">n/a - piece rate</label>
</li>
<li>
<input id="workerProductivityStudy" type="radio" name="workerProductivityToggle" ng-value="true" ng-model="vm.activeWorker.hasProductivityMeasure" ng-change="vm.workerProductivityChanged(true)">
<label for="workerProductivityStudy">Time Study,</label>
</li>
</ul>

<input id="workerProductivity" name="workerProductivity" type="number" class="wage-rate" min="0" step="0.1" ng-model="vm.activeWorker.productivityMeasure" ng-disabled="!vm.activeWorker.hasProductivityMeasure">
</div>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ module.exports = function(ngModule) {
}

this.checkRequiredMultipleChoice("employer.pca", "Please indicate if the employer manufactures items under the PCA");

let sca = this.checkRequiredMultipleChoice("employer.scaId", "Please indicate if the employer holds any SCA-covered contracts");
if (sca === _constants.responses.sca.yes) {
let scaCount = this.checkRequiredNumber("employer.scaCount", "Please provide the total number of workers employed under SCA-covered contracts", 0);
Expand Down Expand Up @@ -461,7 +461,11 @@ module.exports = function(ngModule) {
this.checkRequiredNumber(subprefix + ".avgWeeklyHours", "Please provide the average number of hours per week the employee worked on all jobs", 0);
this.checkRequiredNumber(subprefix + ".avgHourlyEarnings", "Please provide the average earings per hour for this employee", 0);
this.checkRequiredNumber(subprefix + ".prevailingWage", "Please provide the prevailing wage rate for the job identified", 0);
this.checkRequiredNumber(subprefix + ".productivityMeasure", "Please provide the productivity measure for the job identified", 0);

if (this.getFormValue(subprefix + ".hasProductivityMeasure")) {
this.checkRequiredNumber(subprefix + ".productivityMeasure", "Please provide the productivity measure for the job identified", 0);
}

this.checkRequiredNumber(subprefix + ".commensurateWageRate", "Please provide the commensurage wage rate for the job identified", 0);
this.checkRequiredNumber(subprefix + ".totalHours", "Please provide the employee's total hours worked on the job identified", 0);
this.checkRequiredMultipleChoice(subprefix + ".workAtOtherSite", "Please indicate if the employee also performed work at another site included with this application");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ describe('validationService', function() {
"avgWeeklyHours": 40,
"avgHourlyEarnings": 5,
"prevailingWage": 5,
"hasProductivityMeasure": true,
"productivityMeasure": 50,
"commensurateWageRate": 102.1,
"totalHours": 40,
Expand Down Expand Up @@ -85,6 +86,7 @@ describe('validationService', function() {
"avgWeeklyHours": 40,
"avgHourlyEarnings": 5,
"prevailingWage": 5,
"hasProductivityMeasure": true,
"productivityMeasure": 50,
"commensurateWageRate": 102.1,
"totalHours": 40,
Expand Down
18 changes: 11 additions & 7 deletions DOL.WHD.Section14c.Web/src/styles/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
}
}

// Form input sizing
// Form input sizing
input.phoneno {
max-width: 18.2rem;
}

input.ein,
input.ein,
input.certificateno {
max-width: 15.4rem;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ span.example {
max-width: 10rem;
}

// Styling for upload button/input combos
// Styling for upload button/input combos
.upload-label {
margin-right: 0px;
border-top-right-radius: 0px;
Expand Down Expand Up @@ -366,6 +366,10 @@ span.example {
font-weight: 400;
}
}

.wage-data-table li > input[type="radio"] {
width: auto;
}
}

table {
Expand Down Expand Up @@ -482,7 +486,7 @@ span.example {
}
}

// Custom form tabs (as seen in Wage Data section)
// Custom form tabs (as seen in Wage Data section)
.form-tabbed-section {
@include clearfix;

Expand All @@ -497,7 +501,7 @@ span.example {
font-weight: 700;
cursor: pointer;
margin-right: 0px;


&:not(:first-of-type) {
border-left: 1px solid #aeb0b5;
Expand Down Expand Up @@ -619,7 +623,7 @@ span.example {
@media (min-width: 37.5em) {
.form-tabbed-section {
.form-tab {
font-size: 2.4rem;
font-size: 2.4rem;

.circle {
font-size: 1.7rem;
Expand Down Expand Up @@ -682,4 +686,4 @@ span.example {
display: block;
}
}
}
}

0 comments on commit bdb2828

Please sign in to comment.