-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Gino Miceli <[email protected]>
- Loading branch information
Showing
15 changed files
with
281 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright 2024 The Ground Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the 'License'); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an 'AS IS' BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@use 'sass:map'; | ||
@use '@angular/material' as mat; | ||
|
||
@mixin color($theme) { | ||
.terms-text-container { | ||
background-color: mat.get-theme-color($theme, surface-container-low); | ||
border: 1px solid mat.get-theme-color($theme, outline-variant); | ||
} | ||
|
||
.page ::-webkit-scrollbar-thumb { | ||
background: mat.get-theme-color($theme, surface-dim); | ||
} | ||
} | ||
|
||
@mixin typography($theme) { | ||
.terms-text-container { | ||
font: mat.get-theme-typography($theme, title-medium, font); | ||
} | ||
} | ||
|
||
@mixin theme($theme) { | ||
@include color($theme); | ||
@include typography($theme); | ||
} |
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,49 @@ | ||
<!-- | ||
Copyright 2024 The Ground Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
<div class="page"> | ||
<ground-header></ground-header> | ||
<div class="page-content"> | ||
<h1 class="page-title">Terms Of Service</h1> | ||
<div class="terms-text-container"> | ||
{{termsOfServiceText}} | ||
</div> | ||
<div class="action-buttons"> | ||
@if(!hasAcceptedTos) { | ||
<mat-checkbox [(ngModel)]="isTermsOfServiceChecked"> | ||
I have read and agree with terms of service. | ||
</mat-checkbox> | ||
<button | ||
mat-flat-button | ||
(click)="onContinueButtonClick()" | ||
[disabled]="!isTermsOfServiceChecked" | ||
> | ||
Continue | ||
</button> | ||
} | ||
@else { | ||
<button | ||
mat-button | ||
color="primary" | ||
(click)="onBackButtonClick()" | ||
> | ||
<mat-icon>arrow_back</mat-icon> | ||
<span>Back</span> | ||
</button> | ||
} | ||
</div> | ||
</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,49 @@ | ||
/** | ||
* Copyright 2024 The Ground Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the 'License'); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an 'AS IS' BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
.page { | ||
min-height: 100%; | ||
padding-bottom: 40px; | ||
|
||
.page-content { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 30px 160px 24px 160px; | ||
height: calc(100vh - 220px); | ||
} | ||
|
||
.terms-text-container { | ||
padding: 24px; | ||
overflow-y: scroll; | ||
} | ||
|
||
.action-buttons { | ||
display: flex; | ||
justify-content: space-between; | ||
padding-top: 24px; | ||
} | ||
|
||
::-webkit-scrollbar { | ||
width: 8px; | ||
background: transparent; | ||
border-radius: 10px; | ||
} | ||
|
||
::-webkit-scrollbar-thumb { | ||
border-radius: 10px; | ||
width: 8px; | ||
} | ||
} |
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,55 @@ | ||
/** | ||
* Copyright 2024 The Ground Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the 'License'); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an 'AS IS' BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import {Location} from '@angular/common'; | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
import {AuthService} from 'app/services/auth/auth.service'; | ||
import {DataStoreService} from 'app/services/data-store/data-store.service'; | ||
import {NavigationService} from 'app/services/navigation/navigation.service'; | ||
|
||
@Component({ | ||
selector: 'ground-terms-page', | ||
templateUrl: './terms.component.html', | ||
styleUrls: ['./terms.component.scss'], | ||
}) | ||
export class TermsComponent implements OnInit { | ||
hasAcceptedTos: boolean; | ||
isTermsOfServiceChecked = false; | ||
termsOfServiceText = ''; | ||
|
||
constructor( | ||
private authService: AuthService, | ||
private dataStore: DataStoreService, | ||
private navigationService: NavigationService, | ||
private location: Location | ||
) { | ||
this.hasAcceptedTos = this.authService.getHasAcceptedTos(); | ||
} | ||
|
||
async ngOnInit() { | ||
this.termsOfServiceText = await this.dataStore.getTermsOfService(); | ||
} | ||
|
||
onContinueButtonClick() { | ||
this.authService.approveTos(); | ||
this.navigationService.navigateToSurveyList(); | ||
} | ||
|
||
onBackButtonClick() { | ||
this.location.back(); | ||
} | ||
} |
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,41 @@ | ||
/** | ||
* Copyright 2024 The Ground Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the 'License'); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an 'AS IS' BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {FormsModule} from '@angular/forms'; | ||
import {MatButton} from '@angular/material/button'; | ||
import {MatCheckboxModule} from '@angular/material/checkbox'; | ||
import {MatIcon} from '@angular/material/icon'; | ||
import {RouterModule} from '@angular/router'; | ||
|
||
import {HeaderModule} from 'app/components/header/header.module'; | ||
import {TermsComponent} from 'app/pages/terms/terms.component'; | ||
|
||
@NgModule({ | ||
declarations: [TermsComponent], | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
HeaderModule, | ||
RouterModule, | ||
MatButton, | ||
MatCheckboxModule, | ||
MatIcon, | ||
], | ||
exports: [TermsComponent], | ||
}) | ||
export class TermsModule {} |
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
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