-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: As a customer, I want to request OTP and use it to register an account on B2C Composable Storefront #19828
Merged
Melody-zhou-512
merged 19 commits into
feature/register-otp-rate-limit
from
feature/CXSPA-3919
Jan 15, 2025
+2,241
−4
Merged
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ea1c9d4
Merge branch 'develop' into feature/CXSPA-3919
Melody-zhou-512 0adbc78
Add license header
github-actions[bot] bbb760a
adapt copyright
Melody-zhou-512 28a3773
add e2e test
Melody-zhou-512 412f4fc
fix code review comments
Melody-zhou-512 9be747f
fix code review comments
Melody-zhou-512 404a019
Merge branch 'develop' into feature/CXSPA-3919
Melody-zhou-512 044dca1
fix pipeline check issues
Melody-zhou-512 3d1ffb8
fix pr issue
Melody-zhou-512 920bb09
Merge branch 'develop' into feature/CXSPA-3919
Melody-zhou-512 d2fcee4
fix sonar issue
Melody-zhou-512 b29d93c
fix pr issue
Melody-zhou-512 7be8cca
fix sonar issue
Melody-zhou-512 b60b578
Merge branch 'develop' into feature/CXSPA-3919
Melody-zhou-512 8f10c35
fix code review comments
Melody-zhou-512 2ba85c7
fix code review comments
Melody-zhou-512 4cb6c1f
Merge branch 'develop' into feature/CXSPA-3919
Melody-zhou-512 dd732b7
fix code review comments
Melody-zhou-512 dddefa8
fix code review comments
Melody-zhou-512 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 8 additions & 0 deletions
8
feature-libs/user/profile/components/otp-login-register/index.ts
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,8 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './otp-login-register.component'; | ||
export * from './otp-login-register.module'; |
246 changes: 246 additions & 0 deletions
246
feature-libs/user/profile/components/otp-login-register/otp-login-register.component.html
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,246 @@ | ||
<section | ||
class="cx-page-section container" | ||
*ngIf="!(isLoading$ | async); else loading" | ||
> | ||
<div | ||
*cxFeature="'!a11yRemoveStatusLoadedRole'" | ||
role="status" | ||
[attr.aria-label]="'common.loaded' | cxTranslate" | ||
></div> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-6"> | ||
<div class="cx-section"> | ||
<form (ngSubmit)="submitForm()" [formGroup]="registerForm"> | ||
<div class="form-group"> | ||
<label> | ||
<span class="label-content">{{ | ||
'register.title' | cxTranslate | ||
}}</span> | ||
<ng-select | ||
[clearable]="false" | ||
[items]="titles$ | async" | ||
[placeholder]="'register.selectTitle' | cxTranslate" | ||
[searchable]="false" | ||
bindLabel="name" | ||
bindValue="code" | ||
formControlName="titleCode" | ||
id="title-select" | ||
[cxNgSelectA11y]="{}" | ||
> | ||
</ng-select> | ||
</label> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label> | ||
<span class="label-content" | ||
>{{ 'register.firstName.label' | cxTranslate }} | ||
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template | ||
></span> | ||
<input | ||
required="true" | ||
class="form-control" | ||
type="text" | ||
name="firstname" | ||
placeholder="{{ | ||
'register.firstName.placeholder' | cxTranslate | ||
}}" | ||
formControlName="firstName" | ||
/> | ||
|
||
<!-- TODO: (CXSPA-7315) Remove feature toggle in the next major --> | ||
<cx-form-errors | ||
*cxFeature="'formErrorsDescriptiveMessages'" | ||
[translationParams]="{ | ||
label: 'register.firstName.label' | cxTranslate, | ||
}" | ||
[control]="registerForm.get('firstName')" | ||
></cx-form-errors> | ||
|
||
<cx-form-errors | ||
*cxFeature="'!formErrorsDescriptiveMessages'" | ||
[control]="registerForm.get('firstName')" | ||
></cx-form-errors> | ||
</label> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label> | ||
<span class="label-content" | ||
>{{ 'register.lastName.label' | cxTranslate }} | ||
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template | ||
></span> | ||
<input | ||
required="true" | ||
class="form-control" | ||
type="text" | ||
name="lastname" | ||
placeholder="{{ | ||
'register.lastName.placeholder' | cxTranslate | ||
}}" | ||
formControlName="lastName" | ||
/> | ||
|
||
<!-- TODO: (CXSPA-7315) Remove feature toggle in the next major --> | ||
<cx-form-errors | ||
*cxFeature="'formErrorsDescriptiveMessages'" | ||
[translationParams]="{ | ||
label: 'register.lastName.label' | cxTranslate, | ||
}" | ||
[control]="registerForm.get('lastName')" | ||
></cx-form-errors> | ||
|
||
<cx-form-errors | ||
*cxFeature="'!formErrorsDescriptiveMessages'" | ||
[control]="registerForm.get('lastName')" | ||
></cx-form-errors> | ||
</label> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label> | ||
<span class="label-content" | ||
>{{ 'register.emailAddress.label' | cxTranslate }} | ||
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template | ||
></span> | ||
<input | ||
required="true" | ||
class="form-control" | ||
type="email" | ||
name="email" | ||
placeholder="{{ | ||
'register.emailAddress.placeholder' | cxTranslate | ||
}}" | ||
formControlName="email" | ||
/> | ||
|
||
<!-- TODO: (CXSPA-7315) Remove feature toggle in the next major --> | ||
<cx-form-errors | ||
*cxFeature="'formErrorsDescriptiveMessages'" | ||
[translationParams]="{ | ||
label: 'register.emailAddress.label' | cxTranslate, | ||
}" | ||
[control]="registerForm.get('email')" | ||
></cx-form-errors> | ||
|
||
<cx-form-errors | ||
*cxFeature="'!formErrorsDescriptiveMessages'" | ||
[control]="registerForm.get('email')" | ||
></cx-form-errors> | ||
</label> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="form-check"> | ||
<label *ngIf="anonymousConsent$ | async as anonymousConsent"> | ||
<input | ||
type="checkbox" | ||
name="newsletter" | ||
class="form-check-input" | ||
formControlName="newsletter" | ||
[checked]="isConsentGiven(anonymousConsent.consent)" | ||
/> | ||
<span class="form-check-label"> | ||
{{ anonymousConsent.template }} | ||
</span> | ||
</label> | ||
</div> | ||
</div> | ||
|
||
<div | ||
formArrayName="additionalConsents" | ||
class="form-group" | ||
*ngIf="additionalRegistrationConsents as consents" | ||
> | ||
<div | ||
class="form-check" | ||
*ngFor="let control of additionalConsents.controls; let i = index" | ||
> | ||
<div *ngIf="consents[i]?.template?.id as id"> | ||
<label> | ||
<input | ||
type="checkbox" | ||
[required]="consents[i].required" | ||
[name]="id" | ||
(change)="updateAdditionalConsents($any($event), i)" | ||
[formControlName]="i" | ||
/> | ||
<span class="form-check-label"> | ||
{{ consents[i].template.description }} | ||
</span> | ||
<cx-form-errors [control]="control"></cx-form-errors> | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="form-check"> | ||
<label> | ||
<input | ||
required="true" | ||
type="checkbox" | ||
name="termsandconditions" | ||
formControlName="termsandconditions" | ||
/> | ||
<span class="form-check-label"> | ||
{{ 'register.confirmThatRead' | cxTranslate }} | ||
<a | ||
[routerLink]="{ cxRoute: 'termsAndConditions' } | cxUrl" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{{ 'register.termsAndConditions' | cxTranslate }} | ||
</a> | ||
<ng-template | ||
[ngTemplateOutlet]="requiredAsterisk" | ||
></ng-template> | ||
</span> | ||
|
||
<!-- TODO: (CXSPA-7315) Remove feature toggle in the next major --> | ||
<cx-form-errors | ||
*cxFeature="'formErrorsDescriptiveMessages'" | ||
[translationParams]="{ | ||
label: 'register.termsAndConditions' | cxTranslate, | ||
}" | ||
[control]="registerForm.get('termsandconditions')" | ||
></cx-form-errors> | ||
|
||
<cx-form-errors | ||
*cxFeature="'!formErrorsDescriptiveMessages'" | ||
[control]="registerForm.get('termsandconditions')" | ||
></cx-form-errors> | ||
</label> | ||
</div> | ||
</div> | ||
<cx-captcha (confirmed)="captchaConfirmed()"></cx-captcha> | ||
<cx-form-errors | ||
[control]="registerForm.get('captcha')" | ||
></cx-form-errors> | ||
<button type="submit" class="btn btn-block btn-primary"> | ||
{{ 'register.furtherRegistration' | cxTranslate }} | ||
</button> | ||
<a | ||
class="cx-login-link btn-link" | ||
[routerLink]="{ cxRoute: 'login' } | cxUrl" | ||
>{{ 'register.signIn' | cxTranslate }}</a | ||
> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<ng-template #requiredAsterisk> | ||
<abbr | ||
*cxFeature="'a11yRequiredAsterisks'" | ||
aria-hidden="true" | ||
class="text-decoration-none required-asterisk" | ||
title="{{ 'common.required' | cxTranslate }}" | ||
>*</abbr | ||
> | ||
</ng-template> | ||
|
||
<ng-template #loading> | ||
<div class="cx-spinner"><cx-spinner></cx-spinner></div> | ||
</ng-template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not modify existing one, add a new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refer to mockup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what grace said is always use new entry when you want to update text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX inform me to modify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX does't know the detail of how to make code backward compatibility....
Any text change is not allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it!