From 89c5917ed75c49df4a834b6dcebb1c1085a87d10 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 3 Aug 2022 14:13:40 -0500 Subject: [PATCH] removed the open dataset agreement from the on-boarding process --- .../cards/agreements/agreements.component.ts | 35 +----------- .../open-dataset-step.component.html | 12 ---- .../open-dataset-step.component.scss | 36 ------------ .../open-dataset-step.component.ts | 56 ------------------- .../profile/pages/edit/edit.component.html | 6 +- .../profile/pages/new/new.component.html | 22 +------- .../profile/pages/new/new.component.ts | 6 +- .../src/app/modules/profile/profile.module.ts | 2 - 8 files changed, 6 insertions(+), 169 deletions(-) delete mode 100644 projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.html delete mode 100644 projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.scss delete mode 100644 projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.ts diff --git a/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts index 4755834..435c742 100644 --- a/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts +++ b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts @@ -16,9 +16,9 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; -import { faFileAlt, faHandshake, faSignInAlt, faSignOutAlt, IconDefinition } from '@fortawesome/free-solid-svg-icons'; +import { faFileAlt, faHandshake, IconDefinition } from '@fortawesome/free-solid-svg-icons'; import { Account } from '@account/models/account.model'; @@ -29,29 +29,12 @@ import { Account } from '@account/models/account.model'; }) export class AgreementsComponent implements OnInit { @Input() account: Account; - @Output() openDatasetOptIn = new EventEmitter(); public agreementIcon: IconDefinition = faHandshake; public documentIcon = faFileAlt; - public optInOutIcon: IconDefinition; - public openDatasetOptInDate: string; - public openDatasetButtonText: string; constructor() { } ngOnInit() { - const openDatasetAgreement = this.account.agreements.find( - (agreement) => agreement.type === 'Open Dataset' - ); - - if (openDatasetAgreement) { - this.optInOutIcon = faSignOutAlt; - this.openDatasetButtonText = 'Opt Out'; - this.openDatasetOptInDate = 'Opted in ' + openDatasetAgreement.acceptDate; - } else { - this.optInOutIcon = faSignInAlt; - this.openDatasetButtonText = 'Opt In'; - this.openDatasetOptInDate = 'Opted out'; - } } buildAgreementUrl(agreementType: string): string { @@ -64,18 +47,4 @@ export class AgreementsComponent implements OnInit { return url; } - - onOptInOrOut() { - this.openDatasetOptIn.emit(this.openDatasetButtonText === 'Opt In'); - if (this.openDatasetButtonText === 'Opt In') { - this.optInOutIcon = faSignOutAlt; - this.openDatasetButtonText = 'Opt Out'; - this.openDatasetOptInDate = 'Opted in just now'; - } else { - this.optInOutIcon = faSignInAlt; - this.openDatasetButtonText = 'Opt In'; - this.openDatasetOptInDate = 'Opted out'; - } - } - } diff --git a/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.html b/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.html deleted file mode 100644 index 6f32828..0000000 --- a/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.html +++ /dev/null @@ -1,12 +0,0 @@ - - Join Mycroft's Open Dataset - -

- {{paragraph}} -

- - OPT IN - MAYBE LATER - -
-
diff --git a/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.scss b/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.scss deleted file mode 100644 index 08edcc8..0000000 --- a/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.scss +++ /dev/null @@ -1,36 +0,0 @@ -// ***************************************************************************** -// SPDX-License-Identifier: Apache-2.0 -// -// -// Copyright (c) Mycroft AI Inc. All rights reserved. -// 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 http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABLITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing permissions -// and limitations under the License. -// ***************************************************************************** - -@use "@angular/material" as mat; -@use "components/buttons" as buttons; -@use "mycroft-theme" as theme; - -mat-card { - margin-left: auto; - margin-right: auto; - max-width: 1000px; - - mat-card-title { - color: mat.get-color-from-palette(theme.$mycroft-primary, 500); - font-weight: bold; - } -} - -mat-button-toggle-group { - @include buttons.options-button-group -} diff --git a/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.ts b/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.ts deleted file mode 100644 index d82d320..0000000 --- a/projects/account/src/app/modules/profile/components/views/open-dataset-step/open-dataset-step.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -/*! ***************************************************************************** -SPDX-License-Identifier: Apache-2.0 - - -Copyright (c) Mycroft AI Inc. All rights reserved. -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 http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -import { Component, Input, OnInit } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; - -@Component({ - selector: 'account-open-dataset-step', - templateUrl: './open-dataset-step.component.html', - styleUrls: ['./open-dataset-step.component.scss'] -}) -export class OpenDatasetStepComponent implements OnInit { - @Input() newAcctForm: UntypedFormGroup; - public openDatasetDescription: string[]; - - constructor() { } - - ngOnInit(): void { - this.openDatasetDescription = [ - 'Mycroft\'s voices and services can only improve with your help. ' + - 'By joining our open dataset, you agree to allow Mycroft AI to collect data related ' + - 'to your interactions with devices running Mycroft\'s voice assistant software. ' + - 'We pledge to use this contribution in a responsible way.', - 'Your data will also be made available to other researchers in the ' + - 'voice AI space with values that align with our own, like Mozilla Common Voice. ' + - 'As part of their agreement with Mycroft AI to access this data, they will be ' + - 'required to honor your request to remove any trace of your contributions if you ' + - 'decide to opt out.', - 'You can opt in or out of the open dataset at any time on your account profile page.', - 'We thank you in advance for helping to improve Mycroft\'s services!' - ]; - } - - onOptIn(): void { - this.newAcctForm.patchValue({openDataset: true}); - } - - onOptOut(): void { - this.newAcctForm.patchValue({openDataset: false}); - } -} diff --git a/projects/account/src/app/modules/profile/pages/edit/edit.component.html b/projects/account/src/app/modules/profile/pages/edit/edit.component.html index 9fd805e..b420099 100644 --- a/projects/account/src/app/modules/profile/pages/edit/edit.component.html +++ b/projects/account/src/app/modules/profile/pages/edit/edit.component.html @@ -6,10 +6,6 @@ [membershipTypes]="membershipTypes" > - - + diff --git a/projects/account/src/app/modules/profile/pages/new/new.component.html b/projects/account/src/app/modules/profile/pages/new/new.component.html index f439f2b..f7bf433 100644 --- a/projects/account/src/app/modules/profile/pages/new/new.component.html +++ b/projects/account/src/app/modules/profile/pages/new/new.component.html @@ -23,16 +23,7 @@
- -
-
- - - -
-
@@ -61,16 +52,7 @@
- -
-
- - - -
-
diff --git a/projects/account/src/app/modules/profile/pages/new/new.component.ts b/projects/account/src/app/modules/profile/pages/new/new.component.ts index a6a6190..30ec938 100644 --- a/projects/account/src/app/modules/profile/pages/new/new.component.ts +++ b/projects/account/src/app/modules/profile/pages/new/new.component.ts @@ -86,7 +86,6 @@ export class NewComponent implements OnInit { public membershipControl: AbstractControl; public membershipTypes: MembershipType[]; public newAcctForm: UntypedFormGroup; - public openDatasetControl: AbstractControl; public stepDoneIcon = faCheck; public usernameControl: AbstractControl; @@ -130,15 +129,13 @@ export class NewComponent implements OnInit { this.newAcctForm = this.formBuilder.group({ username: ['', Validators.required], - membership: membershipGroup, - openDataset: [null, Validators.required], + membership: membershipGroup }); } private setControlFormAliases() { this.usernameControl = this.newAcctForm.controls['username']; this.membershipControl = this.newAcctForm.controls['membership']; - this.openDatasetControl = this.newAcctForm.controls['openDataset']; } onFormSubmit() { @@ -146,7 +143,6 @@ export class NewComponent implements OnInit { if (!newValues.membership.newMembership) { delete newValues.membership; } - console.log(newValues); this.profileService.updateAccount(newValues).subscribe( () => { this.router.navigate(['/']); } ); diff --git a/projects/account/src/app/modules/profile/profile.module.ts b/projects/account/src/app/modules/profile/profile.module.ts index a0fdb81..b08cab7 100644 --- a/projects/account/src/app/modules/profile/profile.module.ts +++ b/projects/account/src/app/modules/profile/profile.module.ts @@ -47,7 +47,6 @@ import { PaymentComponent } from './components/views/payment/payment.component'; import { ProfileService } from '@account/http/profile.service'; import { ProfileRoutingModule } from './profile-routing.module'; import { SharedModule } from 'shared'; -import { OpenDatasetStepComponent } from './components/views/open-dataset-step/open-dataset-step.component'; import { UsernameStepComponent } from './components/views/username-step/username-step.component'; import { VerifyCardDialogComponent } from './components/views/payment/verify-card-dialog.component'; import { DeleteConfirmComponent } from './components/modals/delete-confirm/delete-confirm.component'; @@ -64,7 +63,6 @@ import { MembershipStepComponent } from './components/views/membership-step/memb // Profile add (i.e. new account) MembershipStepComponent, NewComponent, - OpenDatasetStepComponent, UsernameStepComponent, // Stuff used in both edit and add components MembershipOptionsComponent,