Skip to content

Commit ce40c61

Browse files
Merge pull request #433 from communitybridge/terms-conditions
Added embargo checkbox
2 parents a144c9a + 40b70bc commit ce40c61

File tree

9 files changed

+86
-19
lines changed

9 files changed

+86
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Once the CLA is signed, the GitHub pull request status is updated.
2626

2727
## Documentation
2828

29-
Please see our [online product documentation](https://docs.linuxfoundation.org/lfx/v/v2/easycla) for a complete product
29+
Please see our [online product documentation](https://docs.linuxfoundation.org/lfx/easycla) for a complete product
3030
overview.
3131

3232
## License

src/app/app.component.html

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
<div class="fix-header-margin">
66
<app-alert></app-alert>
7-
<router-outlet></router-outlet>
7+
<div *ngIf="!showDashboard" class="wrapper vcenter-item">
8+
<div class="box">
9+
<app-checkbox [checked]="hasTermAccepted" text="I hereby certify that I am not, and/or the organization I am representing is not"
10+
(checkboxEmitter)="onClickTermAccepted($event)" fontSize="16px" topMargin="5px" bold="true">
11+
</app-checkbox>
12+
<ul class="mt-2" style="width: 800px;">
13+
<li>located in Cuba, Iran, North Korea, Syria, the Crimea Region of Ukraine, or the Russian-controlled areas of the Donetsk or Luhansk regions of Ukraine;
14+
</li>
15+
<li>owned or controlled by, acting for or on behalf of, or an individual or entity that has in the past acted for or on behalf of the Government of Cuba,
16+
Iran, North Korea, Syria, or Venezuela; or</li>
17+
<li>listed as a blocked person by the U.S. Department of the Treasury’s <a href="https://ofac.treasury.gov/sanctions-programs-and-country-information" target="_blank">Office of Foreign Assets Control (OFAC)</a>
18+
or directly or indirectly owned 50 percent or more by such a listed person
19+
</li>
20+
</ul>
21+
<div class="d-flex flex-column">
22+
<button type="button" class="button align-self-center" [ngClass]="{'gray': !hasTermAccepted}" (click)="onClickContinue()">Continue</button>
23+
</div>
24+
</div>
25+
</div>
26+
<div *ngIf="showDashboard">
27+
<router-outlet></router-outlet>
28+
</div>
829
</div>
930
<lfx-footer></lfx-footer>

src/app/app.component.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,30 @@
55
padding: 25px 0 0 0;
66
min-height: calc(100vh - 125px);
77
}
8+
9+
.vcenter-item{
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
}
14+
/* Some custom styles to beautify this example */
15+
.wrapper{
16+
font-size: 16px;
17+
min-height: calc(100vh - 250px);
18+
}
19+
20+
.button {
21+
width: 120px;
22+
padding: 5px;
23+
margin-top: 15px;
24+
border-radius: 25px;
25+
color: #fff;
26+
background-color: #0099cc;
27+
font-family: "SourceSansPro";
28+
font-weight: bold;
29+
border: none;
30+
31+
&.gray {
32+
background-color: gray !important;
33+
}
34+
}

src/app/app.component.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
// Copyright The Linux Foundation and each contributor to CommunityBridge.
22
// SPDX-License-Identifier: MIT
33

4+
5+
// To run this project you required node version 12.0.0 or higher, yarn 1.13.0 or higher.
6+
47
import { Component } from '@angular/core';
5-
import { LfxHeaderService } from './shared/services/lfx-header.service';
68
import { environment } from 'src/environments/environment';
9+
import { StorageService } from './shared/services/storage.service';
10+
import { AppSettings } from './config/app-settings';
711

812
@Component({
913
selector: 'app-root',
1014
templateUrl: './app.component.html',
1115
styleUrls: ['./app.component.scss'],
1216
})
1317
export class AppComponent {
14-
title = 'easycla-contributor-console';
15-
hasExpanded: boolean;
16-
links: any[];
18+
hasTermAccepted: boolean;
19+
showDashboard: boolean;
1720

18-
constructor(private lfxHeaderService: LfxHeaderService) {}
19-
20-
onToggled() {
21-
this.hasExpanded = !this.hasExpanded;
21+
constructor(private storageService: StorageService) {
22+
this.showDashboard = false;
23+
this.hasTermAccepted = false;
2224
}
2325

2426
ngOnInit() {
2527
this.mountHeader();
26-
this.hasExpanded = true;
28+
}
29+
30+
onClickTermAccepted(event:boolean) {
31+
this.hasTermAccepted = event
32+
this.storageService.setItem(AppSettings.ACCEPTED_TERMS, this.hasTermAccepted);
33+
}
34+
35+
onClickContinue() {
36+
if(this.hasTermAccepted) {
37+
this.storageService.setItem(AppSettings.ACCEPTED_TERMS, true);
38+
this.showDashboard = true;
39+
}
2740
}
2841

2942
private mountHeader(): void {

src/app/config/app-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ export class AppSettings {
4949
public static GITLAB_DOMAIN = "gitlab.com";
5050
public static GITLAB = "Gitlab";
5151
public static SUPPORT_TICKET_LINK = 'https://jira.linuxfoundation.org/plugins/servlet/theme/portal/4/create/143';
52+
public static ACCEPTED_TERMS = 'acceptedTerms';
5253
}

src/app/modules/individual-contributor/container/individual-dashboard/individual-dashboard.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class IndividualDashboardComponent implements OnInit {
3838
this.hasGerrit = JSON.parse(this.storageService.getItem(AppSettings.HAS_GERRIT));
3939
this.status = 'Pending';
4040
if (this.hasGerrit) {
41-
this.postIndivdualRequestSignature();
41+
this.postIndividualRequestSignature();
4242
} else {
4343
this.findActiveSignature();
4444
}
@@ -49,7 +49,7 @@ export class IndividualDashboardComponent implements OnInit {
4949
(response) => {
5050
if (response) {
5151
this.activeSignatureModel = response;
52-
this.postIndivdualRequestSignature();
52+
this.postIndividualRequestSignature();
5353
} else {
5454
this.status = 'Failed';
5555
const error = 'Whoops, It looks like you don\'t have any signatures in progress.' +
@@ -63,12 +63,13 @@ export class IndividualDashboardComponent implements OnInit {
6363
);
6464
}
6565

66-
postIndivdualRequestSignature() {
66+
postIndividualRequestSignature() {
67+
const redirectUrl = this.storageService.getItem(AppSettings.REDIRECT);
6768
const data = {
6869
project_id: this.projectId,
6970
user_id: this.userId,
7071
return_url_type: this.hasGerrit ? AppSettings.GERRIT :this.claContributorService.getTypeByUrl(),
71-
return_url: this.hasGerrit ? '' : this.activeSignatureModel.return_url
72+
return_url: this.hasGerrit ? redirectUrl || '' : this.activeSignatureModel.return_url
7273
};
7374
this.claContributorService.postIndividualSignatureRequest(data).subscribe(
7475
(response) => {

src/app/shared/components/checkbox/checkbox.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SPDX-License-Identifier: MIT -->
33

44
<label class="container">
5-
<span>{{text}}</span>
5+
<span [ngStyle]="{'font-size': fontSize, 'font-weight': bold ? 'bold' : 'normal'}">{{text}}</span>
66
<input type="checkbox" [checked]="checked" (click)="onCheckboxClick()">
7-
<span class="checkmark"></span>
8-
</label>
7+
<span class="checkmark" [ngStyle]="{'top': topMargin}"></span>
8+
</label>

src/app/shared/components/checkbox/checkbox.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import { Component, Input, EventEmitter, Output } from '@angular/core';
1111
export class CheckboxComponent {
1212
@Input() checked: boolean;
1313
@Input() text: string;
14+
@Input() fontSize: string;
15+
@Input() topMargin: string;
16+
@Input() bold: boolean;
1417
@Output() checkboxEmitter: EventEmitter<any> = new EventEmitter<any>();
1518

1619
constructor() {}

src/app/shared/shared.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { LfxHeaderService } from './services/lfx-header.service';
1717
import { InterceptorService } from './services/interceptor.service';
1818
import { AuthComponent } from './components/auth/auth.component';
1919
import { FooterComponent } from './components/footer/footer.component';
20+
import { CommonModule } from '@angular/common';
2021

2122
@NgModule({
2223
declarations: [
@@ -33,7 +34,7 @@ import { FooterComponent } from './components/footer/footer.component';
3334
FooterComponent
3435
],
3536
imports: [
36-
37+
CommonModule
3738
],
3839
exports: [
3940
HeaderComponent,

0 commit comments

Comments
 (0)