Skip to content

Commit

Permalink
fix: update login error flow and fix redirect url (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent d45a9b5 commit 4973a8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 4973a8a

Please sign in to comment.