Skip to content

Commit

Permalink
Merge branch 'main' into fix/9072-sign-in-sign-in-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPalafox authored Feb 22, 2024
2 parents 9e51f43 + b0b378a commit 74dcb39
Show file tree
Hide file tree
Showing 13 changed files with 195 additions and 36 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## v2.58.0 - 2024-02-21

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.57.0...v2.58.0)

- [#2167](https://github.com/ORCID/orcid-angular/pull/2167): batch-feb-20

## v2.57.0 - 2024-02-21

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.56.2...v2.57.0)

- [#2164](https://github.com/ORCID/orcid-angular/pull/2164): feature: Add new authorize translations
- [#2166](https://github.com/ORCID/orcid-angular/pull/2166): batch-feb-20
- [#2165](https://github.com/ORCID/orcid-angular/pull/2165): batch-feb-20

### Feature

- Add new authorize translations

## v2.56.2 - 2024-02-21

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.56.1...v2.56.2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ <h3 i18n="@@register.yourPasswords" class="orc-font-body no-top-margin">
id="password-input"
/>
</mat-form-field>
<mat-error
*ngIf="passwordTouched && form.hasError('required', 'password')"
i18n="@@register.passwordRequired"
>
A password is required
<mat-error *ngIf="passwordTouched && form.hasError('required', 'password')">
{{ passwordIsRequired }}
</mat-error>
<mat-error
*ngIf="
Expand All @@ -47,12 +44,12 @@ <h3 i18n="@@register.yourPasswords" class="orc-font-body no-top-margin">
*ngIf="
passwordTouched &&
!form.hasError('required', 'password') &&
currentAccesibilityError &&
(form.hasError('minlength', 'password') ||
form.hasError('pattern', 'password'))
"
i18n="@@register.wrongPasswordPattern2"
>
Password must meet all requirements
{{ currentAccesibilityError }}
</mat-error>
<mat-error
*ngIf="passwordTouched && form.hasError('maxlength', 'password')"
Expand Down
127 changes: 103 additions & 24 deletions src/app/register2/components/form-password/form-password.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Component, forwardRef, Input, OnInit, ViewChild } from '@angular/core'
import {
ChangeDetectorRef,
Component,
forwardRef,
Input,
OnInit,
ViewChild,
} from '@angular/core'
import {
NG_ASYNC_VALIDATORS,
NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -43,6 +50,14 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
labelInfo = $localize`:@@register.ariaLabelInfoPassword:info about password`
labelClose = $localize`:@@register.ariaLabelClose:close`
labelConfirmPassword = $localize`:@@register.confirmYourPassword:Confirm your password`

accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet = $localize`:@@register.accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet:Your password must include at least 1 letter or symbol and 1 number`
accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet = $localize`:@@register.accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet:Your password must be 8 or more characters and include at least 1 number`
accesibiltiyOnlyTheNumberConstrainIsMet = $localize`:@@register.accesibiltiyOnlyTheNumberConstrainIsMet:Your password must be 8 or more characters and include at least 1 letter or symbol`
accesibilityOnlyTheNumberConstrainIsNotMet = $localize`:@@register.accesibilityOnlyTheNumberConstrainIsNotMet:Your password must include at least 1 number`
accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet = $localize`:@@register.accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet:Your password must include at least 1 letter or symbol`
accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet = $localize`:@@register.accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet:Your password must be 8 or more characters`
passwordIsRequired = $localize`:@@register.passwordRequired:A password is required`
@ViewChild(`#passwordPopover`) passwordPopover
@ViewChild(`#passwordPopoverTrigger`) passwordPopoverTrigger
hasNumberPattern = HAS_NUMBER
Expand All @@ -53,9 +68,11 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
ccurentValidateAtLeastALetterOrSymbolStatus: boolean
currentValidateAtLeastANumber: boolean
passwordsValidAreValidAlreadyChecked: any
_currentAccesibilityError: string
constructor(
private _register: Register2Service,
private _liveAnnouncer: LiveAnnouncer
private _liveAnnouncer: LiveAnnouncer,
private _changeDetectorRef: ChangeDetectorRef
) {
super()
}
Expand All @@ -80,6 +97,11 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
asyncValidators: this._register.backendPasswordValidate(),
}
)

this.form.controls['password'].valueChanges.subscribe(() => {
this._changeDetectorRef.detectChanges()
this.passwordAccesbiltyError()
})
}

passwordDoesNotContainUserEmails(): ValidatorFn {
Expand Down Expand Up @@ -123,6 +145,85 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
})
}

passwordAccesbiltyError() {
if (this.form.controls['password'].pristine) {
return
}
if (
!this.currentValidate8orMoreCharactersStatus &&
this.ccurentValidateAtLeastALetterOrSymbolStatus &&
this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError =
this.accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet
} else if (
this.currentValidate8orMoreCharactersStatus &&
!this.ccurentValidateAtLeastALetterOrSymbolStatus &&
this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError =
this.accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet
} else if (
this.currentValidate8orMoreCharactersStatus &&
this.ccurentValidateAtLeastALetterOrSymbolStatus &&
!this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError =
this.accesibiltiyOnlyTheNumberConstrainIsMet
} else if (
!this.currentValidate8orMoreCharactersStatus &&
this.ccurentValidateAtLeastALetterOrSymbolStatus &&
!this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError =
this.accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet
} else if (
!this.currentValidate8orMoreCharactersStatus &&
!this.ccurentValidateAtLeastALetterOrSymbolStatus &&
this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError =
this.accesibilityOnlyTheNumberConstrainIsNotMet
} else if (
this.currentValidate8orMoreCharactersStatus &&
!this.ccurentValidateAtLeastALetterOrSymbolStatus &&
!this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError =
this.accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet
} else if (
!this.currentValidate8orMoreCharactersStatus &&
!this.ccurentValidateAtLeastALetterOrSymbolStatus &&
!this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError = ''
} else if (
this.currentValidate8orMoreCharactersStatus &&
this.ccurentValidateAtLeastALetterOrSymbolStatus &&
this.currentValidateAtLeastANumber
) {
this.currentAccesibilityError = this.passwordIsRequired
}
}

set currentAccesibilityError(value: string) {
if (this._currentAccesibilityError === value) {
return
}
this._currentAccesibilityError = value
if (!value) {
this.announce(
$localize`:@@register.allPasswordContrainsArMet:All password constraints are met`
)
} else {
this.announce(value)
}
}

get currentAccesibilityError() {
return this._currentAccesibilityError
}

get confirmPasswordTouched() {
return (
this.form.controls['passwordConfirm'].touched || this.nextButtonWasClicked
Expand Down Expand Up @@ -161,13 +262,6 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
this.form.hasError('required', 'password') ||
this.form.hasError('minlength', 'password')

if (this.currentValidate8orMoreCharactersStatus !== status) {
this.announce(
status
? $localize`:@@register.passwordLengthError:Password must be 8 or more characters`
: $localize`:@@register.passwordLengthOk:Password is 8 or more characters`
)
}
this.currentValidate8orMoreCharactersStatus = status

return status
Expand All @@ -179,13 +273,6 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
this.form.getError('pattern', 'password')?.requiredPattern ==
this.hasLetterOrSymbolPattern

if (this.ccurentValidateAtLeastALetterOrSymbolStatus !== status) {
this.announce(
status
? $localize`:@@register.passwordLetterOrSymbolError:Password must contain at least a letter or symbol`
: $localize`:@@register.passwordLetterOrSymbolOk:Password contains at least a letter or symbol`
)
}
this.ccurentValidateAtLeastALetterOrSymbolStatus = status

return status
Expand All @@ -197,14 +284,6 @@ export class FormPasswordComponent extends BaseForm implements OnInit {
this.form.getError('pattern', 'password')?.requiredPattern ==
this.hasNumberPattern

if (this.currentValidateAtLeastANumber !== status) {
this.announce(
status
? $localize`:@@register.passwordNumberError:Password must contain at least a number`
: $localize`:@@register.passwordNumberOk:Password contains at least a number`
)
}

this.currentValidateAtLeastANumber = status

return status
Expand Down
3 changes: 3 additions & 0 deletions src/app/register2/components/register2.scss-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
'state-notice-dark'
) !important;
}
a {
color: mat.get-color-from-palette($primary, 700);
}
}

.announce {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 class="orc-font-body-small" i18n="@@register.step3.3">
mat-button
color="primary"
type="button"
id="step-c2-back-button"
id="step-c2-skip-button"
(click)="optionalNextStep()"
>
<a
Expand Down
8 changes: 8 additions & 0 deletions src/locale/properties/authorize/authorize.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ authorize.errorMissingScopes2=, missing scope parameter.
authorize.errorMissingResponseType=Error: Incorrect OAuth Link for client id
authorize.errorMissingResponseType2=, missing response type parameter.
authorize.error=You have reached this page due to an error with the application's integration. Please report this error to the organization that is requesting your ORCID iD.
authorize.showDetails=Show details
authorize.hideDetails=Hide details
authorize.organizationAskedFollowingAccess=This organization has asked for the following access to your ORCID record
authorize.readInfomationVisibilityTrustedParties=Read your information with visibility set to Trusted parties
authorize.addUpdateReseachActivities=Add/update your research activities (works, affiliations, etc.)
authorize.addUpdateInformation=Add/update information about your (country, keywords, etc.)
authorize.youHave=You have
authorize.trustedAccounts=trusted accounts.
15 changes: 13 additions & 2 deletions src/locale/properties/authorize/authorize.lr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ authorize.errorInvalidRedirect2=LR
authorize.errorInvalidClientID1=LR
authorize.errorInvalidClientID2=LR
authorize.errorMissingClientID1=LR
authorize.errorLockedClientID1=LR
authorize.errorLockedClientID2=LR
authorize.erroLRockedClientID1=LR
authorize.erroLRockedClientID2=LR
authorize.errorMissingScopes1=LR
authorize.errorMissingScopes2=LR
authorize.errorMissingResponseType=LR
authorize.errorMissingResponseType2=LR
authorize.error=LR
authorize.errorDeactivatedClientID1=LR
authorize.erroLRockedMemberID1=LR
authorize.showDetails=LR
authorize.hideDetails=LR
authorize.organizationAskedFollowingAccess=LR
authorize.readInfomationVisibilityTrustedParties=LR
authorize.addUpdateReseachActivities=LR
authorize.addUpdateInformation=LR
authorize.youHave=LR
authorize.trustedAccounts=LR
authorize.errorLockedClientID1=LR
authorize.errorLockedMemberID1=LR
authorize.errorLockedClientID2=LR
8 changes: 8 additions & 0 deletions src/locale/properties/authorize/authorize.rl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ authorize.errorMissingResponseType2=RL
authorize.error=RL
authorize.errorDeactivatedClientID1=RL
authorize.errorLockedMemberID1=RL
authorize.showDetails=RL
authorize.hideDetails=RL
authorize.organizationAskedFollowingAccess=RL
authorize.readInfomationVisibilityTrustedParties=RL
authorize.addUpdateReseachActivities=RL
authorize.addUpdateInformation=RL
authorize.youHave=RL
authorize.trustedAccounts=RL
10 changes: 9 additions & 1 deletion src/locale/properties/authorize/authorize.xx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,13 @@ authorize.errorMissingScopes2=X
authorize.errorMissingResponseType=X
authorize.errorMissingResponseType2=X
authorize.error=X
authorize.errorDeactivatedClientID1=X
authorize.errorDeactivatedClientID1=RL
authorize.errorLockedMemberID1=X
authorize.showDetails=X
authorize.hideDetails=X
authorize.organizationAskedFollowingAccess=X
authorize.readInfomationVisibilityTrustedParties=X
authorize.addUpdateReseachActivities=X
authorize.addUpdateInformation=X
authorize.youHave=X
authorize.trustedAccounts=X
8 changes: 7 additions & 1 deletion src/locale/properties/register/register.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ register.completeRegistration=Complete registration
register.passwordRequired2=Please enter a password
register.weOccasionallySend=We occasionally send out an email with information on new features and tips for getting the best out of your ORCID record.
register.yourPasswords=Your password
register.wrongPasswordPattern2=Password must meet all requirements
register.passwordIsToLongV22=Password must meet be between 8 and 256 characters
register.yourPasswordHas=Your password has:
register.passwordLengthError=Password must be 8 or more characters
Expand Down Expand Up @@ -219,3 +218,10 @@ register.affiliationFoud=Affiliation found
register.basedOnYourEmailWeThink=Based on your emails we think you are currently affiliated with
register.webePreselectedThisOrganizationForYouInTheFormBelow=We’ve pre-selected this organization for you in the form below.
register.whenYouCompleteRegistrationAnEmployment=When you complete registration an employment affiliation will be automatically added to your new ORCID record.
register.accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet=Your password must include at least 1 letter or symbol and 1 number
register.accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet=Your password must be 8 or more characters and include at least 1 number
register.accesibiltiyOnlyTheNumberConstrainIsMet=Your password must be 8 or more characters and include at least 1 letter or symbol
register.accesibilityOnlyTheNumberConstrainIsNotMet=Your password must include at least 1 number
register.accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet=Your password must include at least 1 letter or symbol
register.accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet=Your password must be 8 or more characters
register.allPasswordContrainsArMet=All password constraints are met
7 changes: 7 additions & 0 deletions src/locale/properties/register/register.lr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,10 @@ register.webePreselectedThisOrganizationForYouInTheFormBelow=LR
register.whenYouCompleteRegistrationAnEmployment=LR
register.step3.2=LR
register.step4.2=LR
register.accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet=LR
register.accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet=LR
register.accesibiltiyOnlyTheNumberConstrainIsMet=LR
register.accesibilityOnlyTheNumberConstrainIsNotMet=LR
register.accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet=LR
register.accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet=LR
register.allPasswordContrainsArMet=LR
7 changes: 7 additions & 0 deletions src/locale/properties/register/register.rl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,10 @@ register.webePreselectedThisOrganizationForYouInTheFormBelow=RL
register.whenYouCompleteRegistrationAnEmployment=RL
register.step3.2=RL
register.step4.2=RL
register.accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet=RL
register.accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet=RL
register.accesibiltiyOnlyTheNumberConstrainIsMet=RL
register.accesibilityOnlyTheNumberConstrainIsNotMet=RL
register.accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet=RL
register.accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet=RL
register.allPasswordContrainsArMet=RL
7 changes: 7 additions & 0 deletions src/locale/properties/register/register.xx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,10 @@ register.webePreselectedThisOrganizationForYouInTheFormBelow=X
register.whenYouCompleteRegistrationAnEmployment=X
register.step3.2=X
register.step4.2=X
register.accesibiltiyOnlyThe8OrMoreCharactersConstrainIsMet=X
register.accesibiltiyOnlyTheLetterOrSymbolConstrainIsMet=X
register.accesibiltiyOnlyTheNumberConstrainIsMet=X
register.accesibilityOnlyTheNumberConstrainIsNotMet=X
register.accesibilityOnlyTheLetterOrSymbolConstrainIsNotMet=X
register.accesibilityOnlyThe8OrMoreCharactersConstrainIsNotMet=X
register.allPasswordContrainsArMet=X

0 comments on commit 74dcb39

Please sign in to comment.