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

fix: update login error flow and fix redirect url #1117

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div *ngIf="!isIncorrectQBOConnectedDialogVisible">
<div *ngIf="!isIncorrectBCConnectedDialogVisible">
<div>
<app-landing-page-header [logoWidth]="'65px'" [logoStyleClasses]="'tw-p-0'" [logoSectionStyleClasses]="''" [iconPath]="'assets/logos/BusinessCentral-logo.svg'" [appName]="'Dynamics 365 Business Central'" [appDescription]="'Import data from Dynamics 365 Business Central to ' + brandingConfig.brandName + ' and Export expenses from ' + brandingConfig.brandName + ' to Dynamics 365 Business Central. '" [isLoading]="false" [isIntegrationSetupInProgress]="businessCentralConnectionInProgress" [isIntegrationConnected]="isIntegrationConnected" [redirectLink]="redirectLink" [buttonText]="'Connect'" [postConnectionRoute]="'business_central/onboarding/connector'" (connectIntegration)="connectBusinessCentral()"></app-landing-page-header>
</div>
<div>
<app-landing-page-body [headlineText]="'Guide to setup your Integrations'" [headerText]="'A quick guide to help you set up the integration quick and easy.'" [svgPath]="'assets/flow-charts/ms-dynamics-flow-chart.svg'" [appName]="appName"></app-landing-page-body>
</div>
</div>
<app-configuration-confirmation-dialog *ngIf="isIncorrectQBOConnectedDialogVisible"
<app-configuration-confirmation-dialog *ngIf="isIncorrectBCConnectedDialogVisible"
(warningAccepted)="acceptWarning($event)"
[isWarningVisible]="isIncorrectQBOConnectedDialogVisible"
[isWarningVisible]="isIncorrectBCConnectedDialogVisible"
[headerText]="'Incorrect account selected'"
[contextText]="'You had previously set up the integration with a different Dynamic 365 Business Central account. Please choose the same to restore the settings'"
[confirmBtnText]="'Re connect'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class BusinessCentralOnboardingLandingComponent implements OnInit, OnDest

private oauthCallbackSubscription: Subscription;

isIncorrectQBOConnectedDialogVisible: boolean;
isIncorrectBCConnectedDialogVisible: boolean;

constructor(
private helperService: HelperService,
Expand All @@ -45,9 +45,9 @@ export class BusinessCentralOnboardingLandingComponent implements OnInit, OnDest
) { }

acceptWarning(data: ConfigurationWarningOut): void {
this.isIncorrectQBOConnectedDialogVisible = false;
this.isIncorrectBCConnectedDialogVisible = false;
if (data.hasAccepted) {
this.router.navigate([`/integrations/qbo/onboarding/landing`]);
this.router.navigate([`/integrations/business_central/onboarding/landing`]);
}
}

Expand All @@ -72,7 +72,7 @@ export class BusinessCentralOnboardingLandingComponent implements OnInit, OnDest
}, (error) => {
const errorMessage = 'message' in error.error ? error.error.message : 'Failed to connect to Dynamic 365 Business Central. Please try again';
if (errorMessage === 'Please choose the correct Dynamic 365 Business Central account') {
this.isIncorrectQBOConnectedDialogVisible = false;
this.isIncorrectBCConnectedDialogVisible = true;
} else {
this.toastService.displayToastMessage(ToastSeverity.ERROR, errorMessage);
this.router.navigate([`/integrations/business_central/onboarding/landing`]);
Expand Down
Loading