Merge pull request #89 from MycroftAI/feature/remove-open-dataset
removed the open dataset agreement from the on-boarding processpull/90/head^2
commit
0c7f1b6a86
|
@ -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<boolean>();
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<mat-card class="mat-elevation-z0">
|
||||
<mat-card-title>Join Mycroft's Open Dataset</mat-card-title>
|
||||
<mat-card-content>
|
||||
<p *ngFor="let paragraph of openDatasetDescription" class="mat-body">
|
||||
{{paragraph}}
|
||||
</p>
|
||||
<mat-button-toggle-group>
|
||||
<mat-button-toggle (click)="onOptIn()">OPT IN</mat-button-toggle>
|
||||
<mat-button-toggle (click)="onOptOut()">MAYBE LATER</mat-button-toggle>
|
||||
</mat-button-toggle-group>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
|
@ -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
|
||||
}
|
|
@ -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});
|
||||
}
|
||||
}
|
|
@ -6,10 +6,6 @@
|
|||
[membershipTypes]="membershipTypes"
|
||||
>
|
||||
</account-membership-edit>
|
||||
<account-agreements-edit
|
||||
[account]="account"
|
||||
(openDatasetOptIn)="updateOpenDataset($event)"
|
||||
>
|
||||
</account-agreements-edit>
|
||||
<account-agreements-edit [account]="account"></account-agreements-edit>
|
||||
<account-delete></account-delete>
|
||||
</div>
|
||||
|
|
|
@ -23,16 +23,7 @@
|
|||
<mat-step label="Membership" [stepControl]="membershipControl">
|
||||
<account-membership-step [membershipTypes]="membershipTypes" [newAcctForm]="newAcctForm"></account-membership-step>
|
||||
<div fxLayout="row" fxLayoutAlign="end">
|
||||
<button mat-button matStepperNext type="button" [disabled]="!membershipControl.valid">
|
||||
NEXT
|
||||
</button>
|
||||
</div>
|
||||
</mat-step>
|
||||
|
||||
<mat-step label="Open Dataset" [stepControl]="openDatasetControl">
|
||||
<account-open-dataset-step [newAcctForm]="newAcctForm"></account-open-dataset-step>
|
||||
<div fxLayout="row" fxLayoutAlign="end">
|
||||
<button mat-button type="submit" [disabled]="!openDatasetControl.valid">
|
||||
<button mat-button type="submit" [disabled]="!membershipControl.valid">
|
||||
FINISHED
|
||||
</button>
|
||||
</div>
|
||||
|
@ -61,16 +52,7 @@
|
|||
<mat-step label="Membership" [stepControl]="membershipControl">
|
||||
<account-membership-step [membershipTypes]="membershipTypes" [newAcctForm]="newAcctForm"></account-membership-step>
|
||||
<div fxLayout="row" fxLayoutAlign="end">
|
||||
<button mat-button matStepperNext type="button" [disabled]="!membershipControl.valid">
|
||||
NEXT
|
||||
</button>
|
||||
</div>
|
||||
</mat-step>
|
||||
|
||||
<mat-step label="Open Dataset" [stepControl]="openDatasetControl">
|
||||
<account-open-dataset-step [newAcctForm]="newAcctForm"></account-open-dataset-step>
|
||||
<div fxLayout="row" fxLayoutAlign="end">
|
||||
<button mat-button type="submit" [disabled]="!openDatasetControl.valid">
|
||||
<button mat-button type="submit" [disabled]="!membershipControl.valid">
|
||||
FINISHED
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -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(['/']); }
|
||||
);
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue