Skip to content
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

Merged

Conversation

vikas-cis-zz
Copy link

@vikas-cis-zz
Copy link
Author

@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;
Copy link
Collaborator

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?

Copy link
Author

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()">
Copy link
Collaborator

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.

@AllienWorks

This comment has been minimized.

@vikas-cis-zz
Copy link
Author

@AllienWorks can you provide the steps that you are doing see this ?

THanks

@AllienWorks
Copy link
Member

@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 :)

@zaSmilingIdiot zaSmilingIdiot merged commit e61aabb into particl:market Oct 8, 2018
@AllienWorks AllienWorks deleted the shipping_detail_clear_Form branch October 8, 2018 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants