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

feat: popover confirmation once commute is updated from form #2820

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2986,6 +2986,30 @@ export class AddEditMileagePage implements OnInit {
this.onPageExit$.complete();
}

getCommuteUpdatedTextBody(): string {
return `<div>
<p>Your Commute Details have been successfully added to your Profile
Settings.</p>
<p>You can now easily deduct commute from your Mileage expenses.<p>
</div>`;
}

async showCommuteUpdatedPopover(): Promise<void> {
const sizeLimitExceededPopover = await this.popoverController.create({
component: PopupAlertComponent,
componentProps: {
title: 'Commute Updated!',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid the !
Check content with Kamalini

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this for now! will add if product confirms that it should remain here.

message: this.getCommuteUpdatedTextBody(),
primaryCta: {
text: 'Proceed',
},
},
cssClass: 'pop-up-in-center',
});

await sizeLimitExceededPopover.present();
}

async openCommuteDetailsModal(): Promise<Subscription> {
const commuteDetailsModal = await this.modalController.create({
component: FySelectCommuteDetailsComponent,
Expand All @@ -3008,6 +3032,7 @@ export class AddEditMileagePage implements OnInit {
this.commuteDeductionOptions = this.getCommuteDeductionOptions(this.commuteDetails?.distance);
// If the user has saved the commute details, update the commute deduction field to no deduction
this.fg.patchValue({ commuteDeduction: 'NO_DEDUCTION' });
this.showCommuteUpdatedPopover();
});
}
}
Expand Down
Loading