-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from communitybridge/feature/consent-ui
Added context UI
- Loading branch information
Showing
11 changed files
with
125 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
SPDX-License-Identifier: MIT --> | ||
|
||
<label class="container"> | ||
<span>{{text}}</span> | ||
<label class="container"> | ||
<span [ngStyle]="{'font-size': fontSize, 'font-weight': bold ? 'bold' : 'normal'}"> | ||
<span *ngIf="required" style="color: red;">*</span> | ||
{{text}} | ||
</span> | ||
<input type="checkbox" [checked]="checked" (click)="onCheckboxClick()"> | ||
<span class="checkmark"></span> | ||
<span class="checkmark" [ngStyle]="{'top': topMargin}"></span> | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
SPDX-License-Identifier: MIT --> | ||
|
||
<div class="wrapper"> | ||
<div class="box"> | ||
<div class="consent-title">Consent </div> | ||
<app-checkbox [checked]="hasTermAccepted" text="I hereby certify that I am not, and/or the organization I am representing is not" | ||
(checkboxEmitter)="onClickTermAccepted($event)" fontSize="16px" topMargin="5px" bold="true" [required]="true"> | ||
</app-checkbox> | ||
<ul class="mt-2"> | ||
<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; | ||
</li> | ||
<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, | ||
Iran, North Korea, Syria, or Venezuela; or</li> | ||
<li>listed as a blocked person by the U.S. Department of the Treasury’s | ||
<a style="color: #0099cc;" href="https://ofac.treasury.gov/sanctions-programs-and-country-information" target="_blank">Office of Foreign Assets Control (OFAC)</a> | ||
or directly or indirectly owned 50 percent or more by such a listed person | ||
</li> | ||
</ul> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
SPDX-License-Identifier: MIT */ | ||
|
||
.consent-title{ | ||
font-size: 24px; | ||
font-weight: bold; | ||
margin-bottom: 5px; | ||
text-align: center; | ||
} | ||
/* Some custom styles to beautify this example */ | ||
.wrapper{ | ||
font-size: 16px; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/app/shared/components/consent/consent.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
// SPDX-License-Identifier: MIT | ||
|
||
|
||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ConsentComponent } from './consent.component'; | ||
|
||
describe('ConsentComponent', () => { | ||
let component: ConsentComponent; | ||
let fixture: ComponentFixture<ConsentComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ConsentComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ConsentComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
// SPDX-License-Identifier: MIT | ||
|
||
|
||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-consent', | ||
templateUrl: './consent.component.html', | ||
styleUrls: ['./consent.component.scss'] | ||
}) | ||
export class ConsentComponent implements OnInit { | ||
|
||
@Input() hasTermAccepted = false; | ||
@Output() termAccepted: EventEmitter<boolean> = new EventEmitter<boolean>(); | ||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
onClickTermAccepted(event:boolean) { | ||
this.hasTermAccepted = event | ||
this.termAccepted.emit(event) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters