-
Notifications
You must be signed in to change notification settings - Fork 89
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
added button to reset the form #1178
added button to reset the form #1178
Conversation
@AllienWorks I have added the button which clear the form tho if you can have a look and feel free to do css changes if required :) Thanks |
@@ -218,6 +218,13 @@ export class CheckoutProcessComponent implements OnInit, OnDestroy { | |||
this.getCache(); | |||
} | |||
|
|||
clearForm(): void { | |||
if (Object.keys(this.selectedAddress).length > 0) { | |||
this.selectedCountry = undefined; |
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.
Does this need to be explicitly cleared? Is it not cleared as part of clearing the form?
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.
no it requires explicitly clearing
@@ -138,6 +138,10 @@ | |||
|
|||
<!-- =========== SHIPPING DETAILS =========== --> | |||
<mat-step [completed]="cache.selectedIndex >=2" [stepControl]="shippingFormGroup"> | |||
<button mat-raised-button color="primary" [disabled]="!profile?.shippingAddresses || profile?.shippingAddresses.length === 0" (click)="clearForm()"> |
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.
I think the button should probably be disabled if no saved profile shipping profile has been selected. In other words, If a saved profile has not been selected, then this button should be disabled.
Alternatively, change the button text to read something similar to 'Clear Shipping Address form', as that is essentially its purpose. In which case it would make sense to disable the button if the entire form is empty, and it would be better then to move the button to the form that it clears.
This comment has been minimized.
This comment has been minimized.
@AllienWorks can you provide the steps that you are doing see this ? THanks |
@vikas-cis nevermind, probably something in db changed. I saved this profile a while ago, every branch is doing it as well. But when I create a new Shipping profile, it's all OK. Forget about it :) |
https://particl.atlassian.net/browse/PD-424