forked from eclipse-edc/DataDashboard
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic EULA/TOS confirmation
- Loading branch information
Showing
7 changed files
with
142 additions
and
31 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
33 changes: 33 additions & 0 deletions
33
...brary/initiate-transfer-confirm-tos-dialog/initiate-transfer-confirm-tos-dialog.module.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,33 @@ | ||
import {ClipboardModule} from '@angular/cdk/clipboard'; | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {MatButtonModule} from '@angular/material/button'; | ||
import {MatCheckboxModule} from '@angular/material/checkbox'; | ||
import {MatDialogModule} from '@angular/material/dialog'; | ||
import {MatIconModule} from '@angular/material/icon'; | ||
import {MatTooltipModule} from '@angular/material/tooltip'; | ||
import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; | ||
import {InitiateTransferConfirmTosDialogComponent} from './initiate-transfer-confirm-tos-dialog/initiate-transfer-confirm-tos-dialog.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
// Angular | ||
CommonModule, | ||
|
||
// Angular CDK | ||
ClipboardModule, | ||
|
||
// Angular Material | ||
MatButtonModule, | ||
MatCheckboxModule, | ||
MatDialogModule, | ||
MatIconModule, | ||
MatTooltipModule, | ||
|
||
// EDC UI Feature Modules | ||
PipesAndDirectivesModule, | ||
], | ||
declarations: [InitiateTransferConfirmTosDialogComponent], | ||
exports: [InitiateTransferConfirmTosDialogComponent], | ||
}) | ||
export class InitiateTransferConfirmTosDialogModule {} |
26 changes: 26 additions & 0 deletions
26
.../initiate-transfer-confirm-tos-dialog/initiate-transfer-confirm-tos-dialog.component.html
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,26 @@ | ||
<h1 mat-dialog-title>EULA/TOS Confirmation</h1> | ||
|
||
<div mat-dialog-content> | ||
<p> | ||
Hereby I agree that by pressing the 'Confirm' button, I legally accept the | ||
license terms, policies, and additional conditions for use, including any | ||
copyright notices, associated with the provider's offer. | ||
</p> | ||
</div> | ||
|
||
<div class="w-full flex flex-col justify-center"> | ||
<mat-checkbox [checked]="checkboxChecked" (change)="onCheckboxChange($event)"> | ||
I agree to the EULA/TOS | ||
</mat-checkbox> | ||
|
||
<div class="w-full flex flex-row justify-end" mat-dialog-actions> | ||
<button mat-button color="accent" (click)="onCancel()">Cancel</button> | ||
<button | ||
mat-raised-button | ||
color="primary" | ||
[disabled]="!checkboxChecked" | ||
(click)="onConfirm()"> | ||
Confirm | ||
</button> | ||
</div> | ||
</div> |
Empty file.
32 changes: 32 additions & 0 deletions
32
...og/initiate-transfer-confirm-tos-dialog/initiate-transfer-confirm-tos-dialog.component.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,32 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
import {MatCheckboxChange} from '@angular/material/checkbox'; | ||
import {MatDialogRef} from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-initiate-transfer-confirm-tos-dialog', | ||
templateUrl: './initiate-transfer-confirm-tos-dialog.component.html', | ||
styleUrls: ['./initiate-transfer-confirm-tos-dialog.component.scss'], | ||
}) | ||
export class InitiateTransferConfirmTosDialogComponent implements OnInit { | ||
checkboxChecked = false; | ||
|
||
constructor( | ||
public dialogRef: MatDialogRef<InitiateTransferConfirmTosDialogComponent>, | ||
) {} | ||
|
||
ngOnInit(): void {} | ||
|
||
public onCheckboxChange($event: MatCheckboxChange) { | ||
this.checkboxChecked = $event.checked; | ||
} | ||
|
||
onCancel() { | ||
this.dialogRef.close(false); | ||
} | ||
|
||
onConfirm() { | ||
if (this.checkboxChecked) { | ||
this.dialogRef.close(true); | ||
} | ||
} | ||
} |
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