Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1384 from USDAForestService/staging
Browse files Browse the repository at this point in the history
Production Release 07-02-2020
  • Loading branch information
abdul-fs committed Jul 2, 2020
2 parents 92f3be2 + 6c3b474 commit bdb094a
Show file tree
Hide file tree
Showing 28 changed files with 302 additions and 210 deletions.
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ post{
env.BLUE_OCEAN_URL_SQ_XLSX="${env.BUILD_URL}artifact/sonarqubereports/sonarqubeissuesreport.xlsx"
env.LSONARQUBE_URL="${env.SONAR_URL_OPENFORESTPLATFORM}"
emailext attachLog: false, attachmentsPattern: '', body: '''${SCRIPT, template="openforest_simple2.template"}''', mimeType: 'text/html', replyTo: '[email protected]', subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: "${MAILING_LIST_OPENFOREST}"
deleteDir() /* clean up our workspace */
}
}

Expand Down Expand Up @@ -501,7 +502,9 @@ post{
env.BLUE_OCEAN_URL_SQ_XLSX="${env.BUILD_URL}artifact/sonarqubereports/sonarqubeissuesreport.xlsx"
env.LSONARQUBE_URL="${env.SONAR_URL_OPENFORESTPLATFORM}"
emailext attachLog: false, attachmentsPattern: '', body: '''${SCRIPT, template="openforest_simple2.template"}''', mimeType: 'text/html', replyTo: '[email protected]', subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: "${MAILING_LIST_OPENFOREST}"
deleteDir() /* clean up our workspace */
}
}
}

}
}
14 changes: 7 additions & 7 deletions frontend/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<a tabindex="0" class="usa-skipnav" href="#skip-nav-target" (click)="util.gotoHashtag('skip-nav-target', $event)">Skip to main content</a>
<header id="header" role="banner" class="usa-header usa-header-extended">
<app-usa-banner></app-usa-banner>
<div class="usa-alert usa-alert-warning application-deadline-warning application-browser-alert" aria-role="dialog" aria-label="warning" *ngIf="getBrowserName() !== 'Chrome'">
<div class="usa-alert-body">
<h3 class="usa-alert-heading">Warning</h3>
<p class="usa-alert-text">The browser your are currently using is not compatible with the Open Forest website. For a better experience, please switch to Google Chrome.</p>
</div>
</div>
<div class="usa-navbar">
<div class="usa-alert usa-alert-warning application-deadline-warning application-browser-alert" aria-role="dialog" aria-label="warning" *ngIf="getBrowserName() !== 'Chrome'">
<div class="usa-alert-body">
<h3 class="usa-alert-heading">Warning</h3>
<p class="usa-alert-text">The browser you are currently using is not compatible with the Open Forest website. For a better experience please switch to Google Chrome.</p>
</div>
</div>
<app-page-header></app-page-header>
</div>
</header>
<main id="main-content">
<main id="main-content" [ngClass]="{'browser-validation-main-content':getBrowserName() !== 'Chrome'}">
<app-alert [message]="status.message" [heading]="status.heading"></app-alert>
<router-outlet></router-outlet>
</main>
Expand Down
68 changes: 26 additions & 42 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class AppComponent implements OnInit {
currentUrl = '/';
user: any;
browserName: string;
warningMessage: string;
status = {
heading: '',
message: ''
Expand All @@ -28,7 +27,6 @@ export class AppComponent implements OnInit {
public authentication: AuthenticationService,
public util: UtilService,
private meta: Meta) {
this.warningMessage = '',
this.meta.addTag(
{ name: 'keywords',
content: 'Forest Service, permitting, permits, christmas trees, national forest, national forests'
Expand All @@ -43,6 +41,7 @@ export class AppComponent implements OnInit {
} else {
window.scrollTo(0, 0);
}

if (this.authentication.user && localStorage.getItem('showLoggedIn')) {
this.setLoggedInMessage(this.authentication.user);
} else {
Expand All @@ -53,45 +52,6 @@ export class AppComponent implements OnInit {
});
}

getBrowserName() {
const userAgent = navigator.userAgent;
let browserInfo = userAgent.match (/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
let parsedBrowserInfo;

if (/trident/i.test(browserInfo[1])) {

parsedBrowserInfo = /\brv[ :]+(\d+)/g.exec(userAgent) || [];

return { name: 'IE', version: (parsedBrowserInfo[1] || '') };

}

if (browserInfo[1] === 'Chrome') {

parsedBrowserInfo = userAgent.match (/\bOPR|Edge\/(\d+)/);

if (parsedBrowserInfo != null) {

return { name: 'Opera', version: parsedBrowserInfo[1] };

}

}

browserInfo = browserInfo[2] ? [browserInfo[1], browserInfo[2]] : [navigator.appName, navigator.appVersion, '-?'];

if (( parsedBrowserInfo = userAgent.match(/version\/(\d+)/i)) != null) {

browserInfo.splice(1, 1, parsedBrowserInfo[1]);

}

this.browserName = browserInfo[0];

return this.browserName;

}

/**
* Set status message
*/
Expand Down Expand Up @@ -131,5 +91,29 @@ export class AppComponent implements OnInit {
return hour < 12 ? 'AM' : 'PM';
}
});
}
}

getBrowserName() {
const userAgent = navigator.userAgent;
const browserInfo = userAgent.match (/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
const parsedBrowserInfo = userAgent.match (/(OPR|Edge)\/?\s*(\d+)/i);
this.browserName = browserInfo[1];
if (parsedBrowserInfo !== null) {
switch (parsedBrowserInfo[1]) {
case 'OPR': {
this.browserName = 'Opera';
break;
}
case 'Edge': {
this.browserName = 'Edge';
break;
}
default: {
this.browserName = 'notChrome';
break;
}
}
}
return this.browserName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<app-date-time-range [parentForm]="parentForm.controls.activityDescriptionFields" (updateDateStatus)="updateDateStatus($event)" dateOnly="true"></app-date-time-range>

<label id="number-of-trips-label" class="usa-input">The anticipated number of trips. <span class="required-fields-asterisk">*</span></label>
<span id="participants-hint-text" class="help-text usa-form-hint">Please provide the number of trips anticipated (Note: The use of a dash is permitted to supply a possible range).</span>
<input class ="number-input-sizing" id="number-of-trips" type="tel" pattern="[0-9\-]+" maxlength="7"formControlName="numberOfTrips" aria-required="true"
<span id="participants-hint-text" class="help-text usa-form-hint">Please provide the number of trips anticipated (Note: The use of a dash or a slash is permitted to supply a possible range).</span>
<input class ="number-input-sizing" id="number-of-trips" type="text" pattern="[0-9\-\/]+" maxlength="7" formControlName="numberOfTrips" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('activityDescriptionFields.numberOfTrips'), 'number-of-trips-label', 'number-of-trips-error')"
[attr.aria-invalid]="afs.hasError(parentForm.get('activityDescriptionFields.numberOfTrips'))"
/>
<app-error-message fieldId="number-of-trips-error" name="Number of trips" [control]="parentForm.get('activityDescriptionFields.numberOfTrips')"></app-error-message>

<label id="party-size-label" class="usa-input">The anticipated party size. <span class="required-fields-asterisk">*</span></label>
<p id="party-size-hint-text" class="help-text usa-form-hint">If you are planning multiple trips or are unsure of the exact number of attendees, please provide a range that covers the smallest party size to largest party size. For example, for an operation that could have as little as 5 attendees but as many as 25 attendees, you could enter 5-25.</p>
<input class="usa-input" id="party-size" type="text" formControlName="partySize" aria-required="true"
<input class="number-input-sizing" id="party-size" type="text" pattern="[0-9\-\/]+" maxlength="7" formControlName="partySize" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('activityDescriptionFields.partySize'), 'party-size-label party-size-hint-text', 'party-size-error')"
[attr.aria-invalid]="afs.hasError(parentForm.get('activityDescriptionFields.partySize'))"
/>
Expand All @@ -26,6 +26,7 @@
<app-error-message fieldId="services-provided-error" name="A list of services provided" [control]="parentForm.get('activityDescriptionFields.servicesProvided')"></app-error-message>

<label id="audience-description-label" class="usa-input" for="audience-description">Description of your client base or audience. <span class="required-fields-asterisk">*</span></label>
<p id="services-provided-hint-text" class="help-text usa-form-hint">Please provide an overview of your client base (1000 character limit).</p>
<textarea id="audience-description" type="text" formControlName="audienceDescription" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('activityDescriptionFields.audienceDescription'), 'audience-description-label', 'audience-description-error')"
[attr.aria-invalid]="afs.hasError(parentForm.get('activityDescriptionFields.audienceDescription'))"></textarea>
Expand Down Expand Up @@ -82,13 +83,14 @@
</ng-container>

<label id="description-of-cleanup-and-restoration-label" class="usa-input">Description of cleanup and restoration during and after the proposed operations. <span class="required-fields-asterisk">*</span></label>
<p id="services-provided-hint-text" class="help-text usa-form-hint">Please provide a brief description of your plan for cleanup and restoration after your event or trip is complete (1000 character limit).</p>
<textarea id="description-of-cleanup-and-restoration" type="text" formControlName="descriptionOfCleanupAndRestoration" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('activityDescriptionFields.descriptionOfCleanupAndRestoration'), 'description-of-cleanup-and-restoration-label', 'description-of-cleanup-and-restoration-error')"
[attr.aria-invalid]="afs.hasError(parentForm.get('activityDescriptionFields.descriptionOfCleanupAndRestoration'))"></textarea>
<app-error-message fieldId="description-of-cleanup-and-restoration-error" name="A description of cleanup and restoration" [control]="parentForm.get('activityDescriptionFields.descriptionOfCleanupAndRestoration')"></app-error-message>

<label id="location-description-label" class="usa-input">Location of routes and starting and ending points for the proposed operations. <span class="required-fields-asterisk">*</span></label>
<p id="location-description-hint-text" class="help-text usa-form-hint">Please include trailheads, specific routes, latitude, longitude, and/or any landmarks that accurately describe the specific areas you will be using within the forest.</p>
<p id="location-description-hint-text" class="help-text usa-form-hint">Please include trailheads, specific routes, latitude, longitude, and/or any landmarks that accurately describe the specific areas you will be using within the forest (1000 character limit).</p>
<textarea id="location-description" type="text" formControlName="locationDescription" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('activityDescriptionFields.locationDescription'), 'location-description-label location-description-hint-text', 'location-description-error')"
[attr.aria-invalid]="afs.hasError(parentForm.get('activityDescriptionFields.locationDescription'))"></textarea>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ApplicationFieldsService } from '../_services/application-fields.service';
import { alphanumericValidator } from '../validators/alphanumeric-validation';
import { numberValidator } from '../validators/number-validation';

@Component({
selector: 'app-activity-description',
Expand Down Expand Up @@ -43,8 +44,8 @@ export class ActivityDescriptionComponent implements OnInit {
ngOnInit() {
const activityDescription = this.formBuilder.group({
numberServiceDaysRequested: [this.dateStatus.dateTimeSpan, [alphanumericValidator(), Validators.maxLength(255)]],
numberOfTrips: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255)]],
partySize: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255)]],
numberOfTrips: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255), numberValidator(true)]],
partySize: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255), numberValidator(true)]],
locationDescription: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(1000)]],
servicesProvided: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(1000)]],
audienceDescription: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(1000)]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<label id="participants-label" class="usa-input">Estimated number of participants <span class="required-fields-asterisk">*</span></label>
<span id="participants-hint-text" class="help-text usa-form-hint">Please provide the number of event participants (Note: The use of a dash is permitted to supply a possible range).</span>
</div>
<input class ="number-input-sizing" id="participants" type="tel" pattern="[0-9\-]+" maxlength="7" (keypress)="numberOnly($event)" formControlName="numberParticipants" aria-required="true" min="1"
<input class ="number-input-sizing" id="participants" type="text" pattern="[0-9\-\/]+" maxlength="7" formControlName="numberParticipants" aria-required="true" min="1"
[attr.aria-labelledby]="afs.labelledBy(noncommercialFields.controls.numberParticipants, 'participants-label participants-hint-text', 'participants-error')"
[attr.aria-invalid]="afs.hasError(noncommercialFields.controls.numberParticipants)"
/>
Expand All @@ -25,7 +25,7 @@
<label id="spectators-label" class="usa-input">Estimated number of spectators <span class="required-fields-asterisk">*</span></label>
<span id="spectators-hint-text" class="help-text usa-form-hint">If your event will have spectators (such as a sporting event), please provide the number of spectators (Note: The use of a dash is permitted to supply a possible range).</span>
</div>
<input class ="number-input-sizing" id="spectators" type="tel" pattern="[0-9\-]+" maxlength="7" (keypress)="numberOnly($event)" formControlName="numberSpectators" aria-required="true"
<input class ="number-input-sizing" id="spectators" type="text" pattern="[0-9\-\/]+" maxlength="7" formControlName="numberSpectators" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(noncommercialFields.controls.numberSpectators, 'spectators-label spectators-hint-text', 'spectators-error')"
[attr.aria-invalid]="afs.hasError(noncommercialFields.controls.numberSpectators)"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class NoncommercialFieldsComponent implements OnInit {
this[this.formName] = this.formBuilder.group({
activityDescription: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(1000)]],
locationDescription: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255)]],
numberParticipants: ['', [Validators.required, alphanumericValidator(), Validators.minLength(1), Validators.maxLength(255), numberValidator()]],
numberSpectators: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255), numberValidator()]]
numberParticipants: ['', [Validators.required, alphanumericValidator(), Validators.minLength(1), Validators.maxLength(255), numberValidator(true)]],
numberSpectators: ['', [Validators.required, alphanumericValidator(), Validators.maxLength(255), numberValidator(true)]]
},
{
validator: this.validatePermitNeeded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<div class="fs-input-grid-wrapper phone-number-section">
<div class="usa-input-grid usa-input-grid-medium">
<label id="day-phone-label" class="usa-input">{{ name }}<span class="required-fields-asterisk">*</span></label>
<input id="day-phone" type="text" formControlName="tenDigit" aria-required="true"
<input id="day-phone" type="tel" pattern="[0-9]+" maxlength="10" formControlName="tenDigit" aria-required="true"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('dayPhone.tenDigit'), 'day-phone-label', 'day-phone-error')"
[attr.aria-invalid]="afs.hasError(parentForm.get('dayPhone.tenDigit'))" />
[attr.aria-invalid]="afs.hasError(parentForm.get('dayPhone.tenDigit'))"/>
<app-error-message fieldId="day-phone-error" name="Phone number" [control]="parentForm.get('dayPhone.tenDigit')"></app-error-message>
</div>
<div class="usa-input-grid usa-input-grid-small">
<div class="usa-input-grid usa-input-grid-small phone-extension-wrapper">
<label id="day-phone-ext-label" class="usa-input">Ext</label>
<input id="day-phone-ext" class="usa-input" type="text" minlength="1" maxlength="6" formControlName="extension"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('dayPhone.extension'), 'day-phone-ext-label', 'day-phone-ext-error')"
Expand All @@ -30,7 +30,7 @@
[attr.aria-invalid]="afs.hasError(parentForm.get('eveningPhone.tenDigit'))" />
<app-error-message fieldId="eveing-phone-error" name="Evening phone" [control]="parentForm.get('eveningPhone.tenDigit')"></app-error-message>
</div>
<div class="usa-input-grid usa-input-grid-small">
<div class="usa-input-grid usa-input-grid-small phone-extension-wrapper">
<label id="evening-phone-ext-label" class="usa-input">Ext</label>
<input id="evening-phone-ext" class="usa-input" type="text" minlength="1" maxlength="6" formControlName="extension"
[attr.aria-labelledby]="afs.labelledBy(parentForm.get('eveningPhone.extension'), 'evening-phone-ext-label', 'evening-phone-ext-error')"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ApplicationFieldsService } from '../_services/application-fields.service';
import { phoneNumberMinValidator } from '../validators/phone-number-min-length-validation';
import { phoneNumberMaxValidator } from '../validators/phone-number-max-length-validation';
import { phoneNumberMinMaxValidator } from '../validators/phone-number-min-max-validation';

@Component({
selector: 'app-phone-number',
Expand Down Expand Up @@ -34,7 +33,7 @@ export class PhoneNumberComponent implements OnInit {
extension: [, [Validators.minLength(1), Validators.maxLength(6)]],
number: [null, Validators.maxLength(4)],
prefix: [null, Validators.maxLength(3)],
tenDigit: ['', [Validators.required, phoneNumberMinValidator(), phoneNumberMaxValidator()]]
tenDigit: ['', [Validators.required, phoneNumberMinMaxValidator()]]
});
this.parentForm.addControl('dayPhone', dayPhone);

Expand All @@ -53,7 +52,7 @@ export class PhoneNumberComponent implements OnInit {
this.parentForm.get('eveningPhone.extension').setValidators([Validators.minLength(1), Validators.maxLength(6)]);
this.parentForm
.get('eveningPhone.tenDigit')
.setValidators([Validators.required, phoneNumberMinValidator(), phoneNumberMaxValidator()]);
.setValidators([Validators.required, phoneNumberMinMaxValidator()]);
} else {
this.parentForm.get('eveningPhone.extension').setValidators(null);
this.parentForm.get('eveningPhone.tenDigit').setValidators(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h2 class="usa-heading">Order summary</h2>
<div class="usa-width-one-third">
<dl>
<dt>Quantity</dt>
<dd><b>{{permit.quantity}}</b></dd>
<dd><strong>{{permit.quantity}}</strong></dd>
</dl>
</div>
<div class="usa-width-one-third">
Expand All @@ -59,6 +59,11 @@ <h2 class="usa-heading">Order summary</h2>
<h2 class="usa-heading">Order details</h2>
<hr class="header-divider">
<table class="tree-confirmation-table">
<caption>Permit Information</caption>
<tr style="display:none">
<th id="headings"></th>
<th id="info"></th>
</tr>
<caption>Tree Confirmation Table</caption>
<tr>
<td>Permit number</td>
Expand Down
Loading

0 comments on commit bdb094a

Please sign in to comment.