Skip to content

Commit

Permalink
terms of use and captcha step part1
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Nov 14, 2023
1 parent a5ea8b3 commit 5ce0da8
Show file tree
Hide file tree
Showing 19 changed files with 176 additions and 222 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { FormAntiRobotsComponent } from './form-anti-robots.component'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { RegisterService } from '../../../core/register/register.service'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'
import { Overlay } from '@angular/cdk/overlay'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { RouterTestingModule } from '@angular/router/testing'
import { ErrorStateMatcher } from '@angular/material/core'
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { RouterTestingModule } from '@angular/router/testing'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { Register2Service } from '../../../core/register2/register2.service'
import { FormAntiRobotsComponent } from './form-anti-robots.component'

describe('FormAntiRobotsComponent', () => {
let component: FormAntiRobotsComponent
Expand All @@ -23,7 +23,7 @@ describe('FormAntiRobotsComponent', () => {
declarations: [FormAntiRobotsComponent],
providers: [
WINDOW_PROVIDERS,
RegisterService,
Register2Service,
ErrorStateMatcher,
PlatformInfoService,
ErrorHandlerService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Component, DoCheck, forwardRef, OnInit } from '@angular/core'
import {
UntypedFormControl,
UntypedFormGroup,
NG_ASYNC_VALIDATORS,
NG_VALUE_ACCESSOR,
UntypedFormControl,
UntypedFormGroup,
ValidatorFn,
Validators,
} from '@angular/forms'
import { ErrorStateMatcher } from '@angular/material/core'
import { merge, Subject } from 'rxjs'
import { RegisterService } from 'src/app/core/register/register.service'
import { Register2Service } from 'src/app/core/register2/register2.service'

import { BaseForm } from '../BaseForm'

Expand Down Expand Up @@ -48,7 +48,7 @@ export class FormAntiRobotsComponent
}

constructor(
private _register: RegisterService,
private _register: Register2Service,
private _errorStateMatcher: ErrorStateMatcher
) {
super()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
<h3 class="mat-subheading-2" i18n="@@register.notificationSettings">
Notification settings
</h3>

<p i18n="@@register.notificationsDescription1">
ORCID sends email notifications about items related to your account, security,
and privacy, including requests from ORCID member organizations for permission
to update your record, and changes made to your record by those organizations.
</p>

<p i18n="@@register.notificationsDescription2">
You can also choose to receive emails from us about new features and tips for
making the most of your ORCID record.
</p>

<ng-container [formGroup]="form">
<div [formGroup]="form">
<h3 class="orc-font-body" i18n="@@account.tipsFeaturesEmail">
Tips & features email
</h3>
<p i18n="@@account.weOccasionallySend">
We occasionally send out an email with information on new features and tips
for getting the best out of your ORCID record.
</p>
<mat-checkbox
color="primary"
formControlName="sendOrcidNews"
class="orcid-checkbox-baseline"
><ng-container i18n="@@register.quarterlyEmail"
>Please send me quarterly emails about new ORCID features and
tips.</ng-container
>
<i i18n="@@register.quarterlyEmailVerified"
>To receive these emails, you will also need to verify your primary email
address.</i
>
class="margin-bottom-16"
color="primary"
>
<!-- prettier-ignore -->
<div class="mat-checkbox-content" i18n="@@account.idLikeToReceiveTipsFeatures"
>I’d like to receive the ORCID tips & features email
</div>
</mat-checkbox>
</ng-container>

<p i18n="@@register.reviewAfterRegistered">
After you've registered, you can change your notification settings at any time
in the account settings section of your ORCID record.
</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { FormNotificationsComponent } from './form-notifications.component'
import { RegisterService } from '../../../core/register/register.service'
import { Overlay } from '@angular/cdk/overlay'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import {
MatLegacyDialog as MatDialog,
MatLegacyDialogModule as MatDialogModule,
MatLegacyDialog as MatDialog
} from '@angular/material/legacy-dialog'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { RouterTestingModule } from '@angular/router/testing'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { Overlay } from '@angular/cdk/overlay'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { Register2Service } from '../../../core/register2/register2.service'
import { FormNotificationsComponent } from './form-notifications.component'

describe('FormNotificationsComponent', () => {
let component: FormNotificationsComponent
Expand All @@ -25,7 +24,7 @@ describe('FormNotificationsComponent', () => {
declarations: [FormNotificationsComponent],
providers: [
WINDOW_PROVIDERS,
RegisterService,
Register2Service,
PlatformInfoService,
ErrorHandlerService,
SnackbarService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { Component, forwardRef, OnInit } from '@angular/core'
import {
UntypedFormControl,
UntypedFormGroup,
NG_ASYNC_VALIDATORS,
NG_VALUE_ACCESSOR,
UntypedFormControl,
UntypedFormGroup,
Validators,
} from '@angular/forms'
import { RegisterService } from 'src/app/core/register/register.service'

import { Register2Service } from 'src/app/core/register2/register2.service'
import { BaseForm } from '../BaseForm'

@Component({
selector: 'app-form-notifications',
templateUrl: './form-notifications.component.html',
styleUrls: ['./form-notifications.component.scss'],
styleUrls: [
'./form-notifications.component.scss',
'../register2.style.scss',
'../register2.scss-theme.scss',
],
providers: [
{
provide: NG_VALUE_ACCESSOR,
Expand All @@ -28,7 +32,7 @@ import { BaseForm } from '../BaseForm'
],
})
export class FormNotificationsComponent extends BaseForm implements OnInit {
constructor(private _register: RegisterService) {
constructor(private _register: Register2Service) {
super()
}
ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { FormPasswordComponent } from './form-password.component'
import { Overlay } from '@angular/cdk/overlay'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { RouterTestingModule } from '@angular/router/testing'
import {
MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA,
MatLegacyDialog as MatDialog,
MatLegacyDialogRef as MatDialogRef,
} from '@angular/material/legacy-dialog'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { Overlay } from '@angular/cdk/overlay'
import { RegisterService } from '../../../core/register/register.service'
import { RouterTestingModule } from '@angular/router/testing'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { MdePopoverModule } from '../../../cdk/popover'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { Register2Service } from '../../../core/register2/register2.service'
import { FormPasswordComponent } from './form-password.component'

describe('FormPasswordComponent', () => {
let component: FormPasswordComponent
Expand All @@ -29,7 +29,7 @@ describe('FormPasswordComponent', () => {
{ provide: MatDialogRef, useValue: {} },
{ provide: MAT_DIALOG_DATA, useValue: {} },
WINDOW_PROVIDERS,
RegisterService,
Register2Service,
PlatformInfoService,
ErrorHandlerService,
SnackbarService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Validators,
} from '@angular/forms'
import { HAS_LETTER_OR_SYMBOL, HAS_NUMBER } from 'src/app/constants'
import { RegisterService } from 'src/app/core/register/register.service'
import { Register2Service } from 'src/app/core/register2/register2.service'
import { RegisterForm } from 'src/app/types/register.endpoint'
import { OrcidValidators } from 'src/app/validators'

Expand Down Expand Up @@ -46,7 +46,7 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
hasNumberPattern = HAS_NUMBER
hasLetterOrSymbolPattern = HAS_LETTER_OR_SYMBOL
@Input() personalData: RegisterForm
constructor(private _register: RegisterService) {
constructor(private _register: Register2Service) {
super()
}
ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { FormPersonalComponent } from './form-personal.component'
import { Overlay } from '@angular/cdk/overlay'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { RouterTestingModule } from '@angular/router/testing'
import {
MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA,
MatLegacyDialog as MatDialog,
MatLegacyDialogRef as MatDialogRef,
MatLegacyDialog as MatDialog
} from '@angular/material/legacy-dialog'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { FormBuilder } from '@angular/forms'
import { RecordWorksService } from '../../../core/record-works/record-works.service'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { RouterTestingModule } from '@angular/router/testing'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { MdePopoverModule } from '../../../cdk/popover'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { Overlay } from '@angular/cdk/overlay'
import { RegisterService } from '../../../core/register/register.service'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { ReactivationService } from '../../../core/reactivation/reactivation.service'
import { MdePopoverModule } from '../../../cdk/popover'
import { Register2Service } from '../../../core/register2/register2.service'
import { FormPersonalComponent } from './form-personal.component'

describe('FormPersonalComponent', () => {
let component: FormPersonalComponent
Expand All @@ -31,7 +27,7 @@ describe('FormPersonalComponent', () => {
providers: [
WINDOW_PROVIDERS,
ReactivationService,
RegisterService,
Register2Service,
PlatformInfoService,
ErrorHandlerService,
SnackbarService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
ValidatorFn,
Validators,
} from '@angular/forms'
import { RegisterService } from 'src/app/core/register/register.service'
import { Register2Service } from 'src/app/core/register2/register2.service'
import { OrcidValidators } from 'src/app/validators'

import { first } from 'rxjs/operators'
Expand Down Expand Up @@ -51,7 +51,7 @@ export class FormPersonalComponent
labelConfirmEmail = $localize`:@@register.confirmEmail:Confirm primary email`
labelNameYouMostCommonly = $localize`:@@register.labelNameYouMostMost:The name you most commonly go by`
constructor(
private _register: RegisterService,
private _register: Register2Service,
private _reactivationService: ReactivationService
) {
super()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h3 class="mat-subheading-2" i18n="@@register.termsOfUse">Terms of Use</h3>
<h3 class="orc-font-body" i18n="@@register.termsOfUse">Terms of Use</h3>

<ng-container [formGroup]="form">
<mat-checkbox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { FormTermsComponent } from './form-terms.component'
import { Overlay } from '@angular/cdk/overlay'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { RouterTestingModule } from '@angular/router/testing'
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { RouterTestingModule } from '@angular/router/testing'
import { PlatformInfoService } from '../../../cdk/platform-info'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { SnackbarService } from '../../../cdk/snackbar/snackbar.service'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { Overlay } from '@angular/cdk/overlay'
import { RegisterService } from '../../../core/register/register.service'
import { WINDOW_PROVIDERS } from '../../../cdk/window'
import { ErrorHandlerService } from '../../../core/error-handler/error-handler.service'
import { Register2Service } from '../../../core/register2/register2.service'
import { FormTermsComponent } from './form-terms.component'

describe('FormTermsComponent', () => {
let component: FormTermsComponent
Expand All @@ -22,7 +22,7 @@ describe('FormTermsComponent', () => {
declarations: [FormTermsComponent],
providers: [
WINDOW_PROVIDERS,
RegisterService,
Register2Service,
PlatformInfoService,
ErrorHandlerService,
SnackbarService,
Expand Down
12 changes: 7 additions & 5 deletions src/app/register2/components/form-terms/form-terms.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import { Component, DoCheck, forwardRef, OnInit } from '@angular/core'
import {
UntypedFormControl,
UntypedFormGroup,
NG_ASYNC_VALIDATORS,
NG_VALUE_ACCESSOR,
UntypedFormControl,
UntypedFormGroup,
Validators,
} from '@angular/forms'
import { ErrorStateMatcher } from '@angular/material/core'
import { RegisterService } from 'src/app/core/register/register.service'
import { Register2Service } from 'src/app/core/register2/register2.service'
import { environment } from 'src/environments/environment'

import { BaseForm } from '../BaseForm'

@Component({
selector: 'app-form-terms',
templateUrl: './form-terms.component.html',
styleUrls: ['./form-terms.component.scss'],
styleUrls: ['./form-terms.component.scss',
'../register2.style.scss',
'../register2.scss-theme.scss',],
providers: [
{
provide: NG_VALUE_ACCESSOR,
Expand All @@ -34,7 +36,7 @@ import { BaseForm } from '../BaseForm'
export class FormTermsComponent extends BaseForm implements OnInit, DoCheck {
environment = environment
constructor(
private _register: RegisterService,
private _register: Register2Service,
private _errorStateMatcher: ErrorStateMatcher
) {
super()
Expand Down
Loading

0 comments on commit 5ce0da8

Please sign in to comment.