Skip to content

Commit

Permalink
Merge branch 'f/sideBar-privacy'
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesabarnes committed Dec 18, 2019
2 parents bf50f88 + 392665f commit 93132de
Show file tree
Hide file tree
Showing 21 changed files with 209 additions and 34 deletions.
23 changes: 16 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"src/assets",
"src/favicon.ico",
"src/static/custom.css",
"src/static/privacy-policy.html",
"src/app.json",
"src/version.txt",
{
Expand All @@ -36,7 +37,7 @@
"styles": [
"src/styles.scss",
"node_modules/bullhorn-icons/fonts/Bullhorn-Glyphicons.css",
"node_modules/roboto-fontface/css/roboto/roboto-fontface.css"
"node_modules/roboto-fontface/css/roboto/sass/roboto-fontface.scss"
],
"scripts": []
},
Expand All @@ -46,37 +47,45 @@
},
"static": {
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"outputHashing": "none",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": true,
"baseHref": ".",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.static.ts"
},
{
"replace": "src/app.json",
"with": "src/app.json.template"
}
]
},
"dynamic": {
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"outputHashing": "none",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": true,
"baseHref": "/",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.dynamic.ts"
},
{
"replace": "src/app.json",
"with": "src/app.json.template"
}
]
}
Expand Down
1 change: 0 additions & 1 deletion docs/portal-configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ The portal is configurable without modifying code. The options are found in the
| veteran | Adds the prompt to ask for veteran status on the apply popup. |
| disability | Adds the prompt to ask about disability on the apply popup. |
| consentCheckbox | Enables whether or not a checkbox that states consent of the privacy policy restricts applying to the career portal or not |
| privacyStatementParagraphs | An array where you separate the paragraphs in the consent tooltip. |
| privacyPolicyUrl | Url for the privacy policy link. |
| usePrivacyPolicyUrl | Enables or disables use of the privacy policy url when the linked is clicked. When disabled and the consent checkbox is enabled, when the link is clicked a tooltip opens |
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions src/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"maxUploadSize": 5242880,
"service": {
"batchSize": 500,
"corpToken": "[ CORP TOKEN HERE ]",
"corpToken": "1VCNF4",
"port": null,
"swimlane": "[ SWIMLANE HERE ]",
"swimlane": "91",
"fields": [
"id",
"title",
Expand Down Expand Up @@ -77,11 +77,7 @@
},
"privacyConsent": {
"consentCheckbox": false,
"privacyStatementParagraphs": [
"[FIRST PARAGRAPH]",
"[SECOND PARAGRAPH]"
],
"privacyPolicyUrl": "",
"usePrivacyPolicyUrl": false
"sidebarLink": true,
"privacyPolicyUrl": "/privacy"
}
}
83 changes: 83 additions & 0 deletions src/app.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"acceptedResumeTypes": [
"html",
"text",
"txt",
"pdf",
"doc",
"docx",
"rtf",
"odt"
],
"companyName": "[ COMPANY NAME HERE ]",
"companyLogoPath": "",
"companyUrl": "",
"careersUrl": "",
"defaultLocale": "en-US",
"supportedLocales": [
"en-US",
"en-GB",
"fr-FR"
],
"minUploadSize": 4096,
"maxRelatedJobs": 5,
"maxUploadSize": 5242880,
"service": {
"batchSize": 500,
"corpToken": "[ CORP TOKEN HERE ]",
"port": null,
"swimlane": "[ SWIMLANE HERE ]",
"fields": [
"id",
"title",
"publishedCategory(id,name)",
"address(city,state,countryName)",
"employmentType",
"dateLastPublished",
"publicDescription",
"isOpen",
"isPublic",
"isDeleted",
"publishedZip",
"salary",
"salaryUnit"
],
"jobInfoChips": [
"employmentType",
{
"type": "mediumDate",
"field": "dateLastPublished"
}
],
"showCategory": true,
"keywordSearchFields": [
"publicDescription",
"title"
]
},
"additionalJobCriteria": {
"field": "[ FILTER FIELD HERE ]",
"values": [
"[ FILTER VALUE HERE ]"
],
"sort": "-dateLastPublished"
},
"integrations": {
"googleAnalytics": {
"trackingId": ""
},
"googleSiteVerification": {
"verificationCode": ""
}
},
"eeoc": {
"genderRaceEthnicity": false,
"veteran": false,
"disability": false
},
"privacyConsent": {
"consentCheckbox": false,
"sidebarLink": false,
"privacyPolicyUrl": "/privacy"
}
}
3 changes: 3 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ import { DatePipe } from '@angular/common';
import { JobResolver } from './job.resolver';
import { ServerResponseService } from './services/server-response/server-response.service';
import { environment } from '../environments/environment';
import { PrivacyPolicyComponent } from './privacy-policy/privacy-policy.component';

const appRoutes: Routes = [
{ path: '', component: MainPageComponent },
{ path: 'jobs/:id', component: JobDetailsComponent, resolve: { message: JobResolver } },
{ path: 'jobs', component: MainPageComponent },
{ path: 'privacy', component: PrivacyPolicyComponent },
];

export function initSettings(settings: SettingsService): any {
Expand All @@ -50,6 +52,7 @@ export function initSettings(settings: SettingsService): any {
StripHtmlPipe,
SidebarFilterComponent,
StructuredSeoComponent,
PrivacyPolicyComponent,
],
entryComponents: [
ApplyModalComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
</div>
<div *ngIf="consentCheckbox" class="consent-form novo-form-row">
<novo-control [form]="form" [control]="consentControl"></novo-control>
<label *ngIf="usePrivacyPolicyUrl" class="consent-checkbox-label">{{ 'BY_CHECKING_THIS_BOX' | translate}} <a (click)="viewPrivacyPolicy()">{{ 'PRIVACY_POLICY' | translate}}</a></label>
<label *ngIf="!usePrivacyPolicyUrl" class="consent-checkbox-label">{{ 'BY_CHECKING_THIS_BOX' | translate}}<span class="hover" *ngIf="!usePrivacyPolicyUrl"
[popover]="privacyStatementParagraphs" popoverPlacement="top-left" [popoverOnHover]="true"> {{ 'PRIVACY_POLICY' | translate}}</span></label>
<label class="consent-checkbox-label">{{ 'BY_CHECKING_THIS_BOX' | translate}} <a (click)="viewPrivacyPolicy()">{{ 'PRIVACY_POLICY' | translate}}</a></label>
</div>
</novo-form>
<span *ngIf="hasError" class="error">{{ 'ERROR_WHILE_APPLYING' | translate}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { TranslateService } from 'chomsky';
import { SettingsService } from '../../../services/settings/settings.service';
import { AnalyticsService } from '../../../services/analytics/analytics.service';
import { ApplyService } from '../../../services/apply/apply.service';
import { Router } from '@angular/router';

@Component({
selector: 'app-apply-modal',
Expand All @@ -41,10 +42,7 @@ export class ApplyModalComponent implements OnInit {
public eeocControls: any = [];
public consentControl: any;
public applying: boolean = false;
public privacyPolicyURL: string = SettingsService.settings.privacyConsent.privacyPolicyUrl;
public consentCheckbox: boolean = SettingsService.settings.privacyConsent.consentCheckbox;
public usePrivacyPolicyUrl: boolean = SettingsService.settings.privacyConsent.usePrivacyPolicyUrl;
public privacyStatementParagraphs: string = SettingsService.settings.privacyConsent.privacyStatementParagraphs.join('\r\n');
public showCategory: boolean = SettingsService.settings.service.showCategory;
private APPLIED_JOBS_KEY: string = 'APPLIED_JOBS_KEY';

Expand All @@ -53,7 +51,8 @@ export class ApplyModalComponent implements OnInit {
private modalRef: NovoModalRef,
private applyService: ApplyService,
private analytics: AnalyticsService,
private toaster: NovoToastService ) { this.toaster.parentViewContainer = this.params['viewContainer']; }
private toaster: NovoToastService,
private router: Router ) { this.toaster.parentViewContainer = this.params['viewContainer']; }

public ngOnInit(): void {
this.job = this.params['job'];
Expand Down Expand Up @@ -231,8 +230,12 @@ export class ApplyModalComponent implements OnInit {
}

public viewPrivacyPolicy(): void {
window.open(this.privacyPolicyURL);
}
const url: string = SettingsService.settings.privacyConsent.privacyPolicyUrl;
if (url === '/privacy') {
this.router.navigate([url]);
} else {
window.open(url);
} }

private applyOnSuccess(res: any): void {
let toastOptions: any = {
Expand Down
4 changes: 2 additions & 2 deletions src/app/job-list/job-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<item-title><a [href]="'jobs/' + job.id" [routerLink]="'jobs/' + job.id">{{ job.title }}</a></item-title>
</item-header>
<item-header-end>
<span class="mid-card" *ngIf="job.address.city || job.address.state">
<span class="mid-card" *ngIf="job?.address?.city || job?.address?.state">
<i class="bhi-location"></i>
{{ job.address.city }} <span *ngIf="job.address?.city && job.address?.state">,&nbsp;</span> {{ job.address.state }}
{{ job?.address?.city }} <span *ngIf="job.address?.city && job.address?.state">,&nbsp;</span> {{ job?.address?.state }}
</span>
<ng-container *ngFor="let chip of jobInfoChips" [ngSwitch]="chip.type || 'string'">
<span class="mid-card" *ngIf="job[chip] || job[chip?.field]">
Expand Down
1 change: 1 addition & 0 deletions src/app/job-list/job-list.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ novo-list {
margin: 12px 35px;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .1);
padding-bottom: 10px;
cursor: pointer;
.description {
display: inline-block;
word-wrap: break-word;
Expand Down
2 changes: 1 addition & 1 deletion src/app/main-page/main-page.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../styles.scss";
@import "~novo-elements/styles/global/variables";

.frame {
display: flex;
Expand Down
4 changes: 4 additions & 0 deletions src/app/privacy-policy/privacy-policy.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div *ngIf="!loading" [innerHTML]="data">

</div>
<novo-loading *ngIf="loading"></novo-loading>
10 changes: 10 additions & 0 deletions src/app/privacy-policy/privacy-policy.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
novo-loading {
padding: 20px;
font-size: 13px;
display: flex;
height: 100%;
position: absolute;
align-items: center;
width: 100%;
justify-content: center;
}
28 changes: 28 additions & 0 deletions src/app/privacy-policy/privacy-policy.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';

import { PrivacyPolicyComponent } from './privacy-policy.component';

describe('PrivacyPolicyComponent', () => {
let component: PrivacyPolicyComponent;
let fixture: ComponentFixture<PrivacyPolicyComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PrivacyPolicyComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(PrivacyPolicyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
26 changes: 26 additions & 0 deletions src/app/privacy-policy/privacy-policy.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { DomSanitizer } from '@angular/platform-browser';

@Component({
selector: 'app-privacy-policy',
templateUrl: './privacy-policy.component.html',
styleUrls: ['./privacy-policy.component.scss'],
})
export class PrivacyPolicyComponent implements OnInit {

public loading: boolean = true;
public data: any;

constructor(private http: HttpClient, private domSanitize: DomSanitizer) { }

public ngOnInit(): void {
this.http.get('./static/privacy-policy.html', {responseType: 'text'}).subscribe(this.handlePolicyOnSuccess.bind(this));
}

private handlePolicyOnSuccess(data: any): void {
this.data = this.domSanitize.bypassSecurityTrustHtml(data);
this.loading = false;
}

}
2 changes: 2 additions & 0 deletions src/app/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
</div>
</ng-container>

<a *ngIf="showPrivacyPolicy" (click)="viewPrivacyPolicy()" class="privacy-policy-link">{{ 'PRIVACY_POLICY' | translate}}</a>

<section class="credits">
<span class="powered-by">Powered By</span>
<a target="_blank" href="http://www.bullhorn.com/">
Expand Down
3 changes: 3 additions & 0 deletions src/app/sidebar/sidebar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@
flex-direction: row-reverse;
display: flex;
}
a.privacy-policy-link {
padding: 0px 20px;
}
}
Loading

0 comments on commit 93132de

Please sign in to comment.