Skip to content

Commit 1fece3c

Browse files
Merge pull request #438 from communitybridge/feature/consent-ui
Added context UI
2 parents ed1cff4 + b83311c commit 1fece3c

File tree

11 files changed

+125
-12
lines changed

11 files changed

+125
-12
lines changed

src/app/modules/corporate-contributor/container/corporate-dashboard/corporate-dashboard.component.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@
103103
</div>
104104
</div>
105105

106+
<div class="row justify-content-center" style="margin: 30px 0 30px 0;">
107+
<div class="col-12">
108+
<app-consent (termAccepted)="hasTermAccepted = $event"></app-consent>
109+
</div>
110+
</div>
111+
106112
<div class="col-12 buttons" [ngClass]="{ 'mt-30': selectedCompany }">
107113
<div class="row justify-content-center align-items-center">
108114
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-3">
@@ -119,9 +125,9 @@
119125
<button
120126
tabindex="-1"
121127
type="button"
122-
[disabled]="selectedCompany === ''"
128+
[disabled]="selectedCompany === '' || !hasTermAccepted"
123129
class="btn inactive"
124-
[ngClass]="{ active: selectedCompany !== '' }"
130+
[ngClass]="{ active: selectedCompany !== '' && hasTermAccepted }"
125131
(click)="onClickProceed()"
126132
>
127133
Proceed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class CorporateDashboardComponent implements OnInit, OnDestroy {
5858
mySubscription: Subscription;
5959
proccedWithExistingOrganization: Subscription;
6060
attempt: boolean;
61+
hasTermAccepted = false;
6162

6263
constructor(
6364
private route: ActivatedRoute,
@@ -371,7 +372,7 @@ export class CorporateDashboardComponent implements OnInit, OnDestroy {
371372
}
372373
this.searchTimeout = setTimeout(() => {
373374
this.searchOrganization(encodeURIComponent(companyName));
374-
}, 400);
375+
}, 500);
375376
} else {
376377
this.selectedCompany = '';
377378
this.organizationList.list = [];

src/app/modules/individual-contributor/component/docusign-signature-model/docusign-signature-model.component.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,21 @@
3333
</div>
3434
</div>
3535

36+
<div class="row justify-content-center" style="margin: 30px 0 30px 0;">
37+
<div class="col-12">
38+
<app-consent (termAccepted)="hasTermAccepted = $event"></app-consent>
39+
</div>
40+
</div>
41+
3642
<div class="row buttons justify-content-center align-items-center">
3743
<div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">
3844
<button tabindex="-1" type="button" class="btn" (click)="onClickBack()">
3945
GO BACK
4046
</button>
4147
</div>
4248
<div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">
43-
<button tabindex="-1" type="button" [disabled]="status!=='Completed'"
44-
[ngClass]="{'blue':status==='Completed'}" class="btn gray" (click)="onClickSignCLA()">
49+
<button tabindex="-1" type="button" [disabled]="status!=='Completed' || !hasTermAccepted"
50+
[ngClass]="{'blue':status==='Completed' && hasTermAccepted}" class="btn gray" (click)="onClickSignCLA()">
4551
SIGN CLA</button>
4652
</div>
4753
</div>

src/app/modules/individual-contributor/component/docusign-signature-model/docusign-signature-model.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class DocusignSignatureModelComponent {
1919

2020
title: string;
2121
message: string;
22-
22+
hasTermAccepted = false;
23+
2324
constructor(
2425
private storageService: StorageService,
2526
private modalService: NgbModal
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
22
SPDX-License-Identifier: MIT -->
33

4-
<label class="container">
5-
<span>{{text}}</span>
4+
<label class="container">
5+
<span [ngStyle]="{'font-size': fontSize, 'font-weight': bold ? 'bold' : 'normal'}">
6+
<span *ngIf="required" style="color: red;">*</span>
7+
{{text}}
8+
</span>
69
<input type="checkbox" [checked]="checked" (click)="onCheckboxClick()">
7-
<span class="checkmark"></span>
10+
<span class="checkmark" [ngStyle]="{'top': topMargin}"></span>
811
</label>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ 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;
17+
@Input() required: boolean;
1418
@Output() checkboxEmitter: EventEmitter<any> = new EventEmitter<any>();
1519

1620
constructor() {}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
2+
SPDX-License-Identifier: MIT -->
3+
4+
<div class="wrapper">
5+
<div class="box">
6+
<div class="consent-title">Consent </div>
7+
<app-checkbox [checked]="hasTermAccepted" text="I hereby certify that I am not, and/or the organization I am representing is not"
8+
(checkboxEmitter)="onClickTermAccepted($event)" fontSize="16px" topMargin="5px" bold="true" [required]="true">
9+
</app-checkbox>
10+
<ul class="mt-2">
11+
<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;
12+
</li>
13+
<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,
14+
Iran, North Korea, Syria, or Venezuela; or</li>
15+
<li>listed as a blocked person by the U.S. Department of the Treasury’s
16+
<a style="color: #0099cc;" href="https://ofac.treasury.gov/sanctions-programs-and-country-information" target="_blank">Office of Foreign Assets Control (OFAC)</a>
17+
or directly or indirectly owned 50 percent or more by such a listed person
18+
</li>
19+
</ul>
20+
</div>
21+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* Copyright The Linux Foundation and each contributor to CommunityBridge.
2+
SPDX-License-Identifier: MIT */
3+
4+
.consent-title{
5+
font-size: 24px;
6+
font-weight: bold;
7+
margin-bottom: 5px;
8+
text-align: center;
9+
}
10+
/* Some custom styles to beautify this example */
11+
.wrapper{
12+
font-size: 16px;
13+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright The Linux Foundation and each contributor to CommunityBridge.
2+
// SPDX-License-Identifier: MIT
3+
4+
5+
import { ComponentFixture, TestBed } from '@angular/core/testing';
6+
7+
import { ConsentComponent } from './consent.component';
8+
9+
describe('ConsentComponent', () => {
10+
let component: ConsentComponent;
11+
let fixture: ComponentFixture<ConsentComponent>;
12+
13+
beforeEach(async () => {
14+
await TestBed.configureTestingModule({
15+
declarations: [ ConsentComponent ]
16+
})
17+
.compileComponents();
18+
});
19+
20+
beforeEach(() => {
21+
fixture = TestBed.createComponent(ConsentComponent);
22+
component = fixture.componentInstance;
23+
fixture.detectChanges();
24+
});
25+
26+
it('should create', () => {
27+
expect(component).toBeTruthy();
28+
});
29+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright The Linux Foundation and each contributor to CommunityBridge.
2+
// SPDX-License-Identifier: MIT
3+
4+
5+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
6+
7+
@Component({
8+
selector: 'app-consent',
9+
templateUrl: './consent.component.html',
10+
styleUrls: ['./consent.component.scss']
11+
})
12+
export class ConsentComponent implements OnInit {
13+
14+
@Input() hasTermAccepted = false;
15+
@Output() termAccepted: EventEmitter<boolean> = new EventEmitter<boolean>();
16+
constructor() { }
17+
18+
ngOnInit(): void {
19+
}
20+
21+
onClickTermAccepted(event:boolean) {
22+
this.hasTermAccepted = event
23+
this.termAccepted.emit(event)
24+
}
25+
}

0 commit comments

Comments
 (0)