|
1 | 1 | // Copyright The Linux Foundation and each contributor to CommunityBridge. |
2 | 2 | // SPDX-License-Identifier: MIT |
3 | 3 |
|
| 4 | + |
| 5 | +// To run this project you required node version 12.0.0 or higher, yarn 1.13.0 or higher. |
| 6 | + |
4 | 7 | import { Component } from '@angular/core'; |
5 | | -import { LfxHeaderService } from './shared/services/lfx-header.service'; |
6 | 8 | import { environment } from 'src/environments/environment'; |
| 9 | +import { StorageService } from './shared/services/storage.service'; |
| 10 | +import { AppSettings } from './config/app-settings'; |
7 | 11 |
|
8 | 12 | @Component({ |
9 | 13 | selector: 'app-root', |
10 | 14 | templateUrl: './app.component.html', |
11 | 15 | styleUrls: ['./app.component.scss'], |
12 | 16 | }) |
13 | 17 | export class AppComponent { |
14 | | - title = 'easycla-contributor-console'; |
15 | | - hasExpanded: boolean; |
16 | | - links: any[]; |
| 18 | + hasTermAccepted: boolean; |
| 19 | + showDashboard: boolean; |
17 | 20 |
|
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; |
22 | 24 | } |
23 | 25 |
|
24 | 26 | ngOnInit() { |
25 | 27 | 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 | + } |
27 | 40 | } |
28 | 41 |
|
29 | 42 | private mountHeader(): void { |
|
0 commit comments