Skip to content

Commit

Permalink
Remove Workato related API calls (#437)
Browse files Browse the repository at this point in the history
* Remove workato related API calls

* comment resolved and bug fix

* resolved comments

* remove workato related code

* minor debugs

* removed debug

* sync button disable before configuration save
  • Loading branch information
Ashutosh619-sudo authored Jan 16, 2024
1 parent a25c816 commit 98f46b6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 47 deletions.
3 changes: 1 addition & 2 deletions src/app/integrations/bamboo-hr/bamboo-hr.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
[isLoading]="isLoading"
[hideRefreshIcon]="hideRefreshIcon"
[showErrorScreen]="showErrorScreen"
[isRecipeRunning]="bambooHrConfiguration?.recipe_status ? true : false"
[isIntegrationSetupInProgress]="isBambooSetupInProgress"
[isIntegrationConnected]="isBambooConnected"
(connectIntegration)="openDialog()"
Expand Down Expand Up @@ -87,4 +86,4 @@
<p-skeleton shape="rectangle"></p-skeleton>
</div>
</div>
</div>
</div>
46 changes: 5 additions & 41 deletions src/app/integrations/bamboo-hr/bamboo-hr.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class BambooHrComponent implements OnInit {

isLoading: boolean = true;

hideRefreshIcon: boolean;
hideRefreshIcon: boolean = true;

isConfigurationSaveInProgress: boolean;

Expand Down Expand Up @@ -98,6 +98,7 @@ export class BambooHrComponent implements OnInit {
this.isConfigurationSaveInProgress = true;
this.bambooHrService.postConfigurations(payload).subscribe((updatedConfiguration: BambooHRConfiguration) => {
this.bambooHrConfiguration = updatedConfiguration;
this.hideRefreshIcon = false;
this.isConfigurationSaveInProgress = false;
this.displayToastMessage(ToastSeverity.SUCCESS, 'Configuration saved successfully');
this.trackingService.trackTimeSpent(Page.CONFIGURE_BAMBOO_HR, this.sessionStartTime);
Expand All @@ -123,45 +124,6 @@ export class BambooHrComponent implements OnInit {
});
}

private setupBambooHr(): void {
const syncData = [];

if (!this.org.managed_user_id) {
syncData.push(this.orgService.createWorkatoWorkspace());
}

if (!this.bambooHrData || !this.bambooHrData.folder_id) {
syncData.push(this.bambooHrService.createFolder());
}

if (!this.bambooHrData || !this.bambooHrData.package_id) {
syncData.push(this.bambooHrService.uploadPackage());
}

if (!this.org.is_fyle_connected) {
syncData.push(this.orgService.connectFyle());
}

if (!this.org.is_sendgrid_connected) {
syncData.push(this.orgService.connectSendgrid());
}

if (syncData.length) {
this.isBambooSetupInProgress = true;
concat(...syncData).pipe(
toArray()
).subscribe(() => {
this.isLoading = false;
this.isBambooSetupInProgress = false;
}, () => {
this.isLoading = false;
this.isBambooSetupInProgress = false;
this.showErrorScreen = true;
});
} else {
this.isLoading = false;
}
}

private getBambooHrConfiguration(): void {
const data = merge(
Expand All @@ -175,9 +137,11 @@ export class BambooHrComponent implements OnInit {
this.additionalEmails = response;
} else if (response?.hasOwnProperty('additional_email_options')) {
this.bambooHrConfiguration = response;
this.hideRefreshIcon = false;
}
});
this.setupBambooHr();
this.isLoading = false;

});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="tw-pl-16-px tw-flex tw-flex-col">
<div class="tw-flex tw-pt-6-px">
<p class="tw-text-20-px tw-font-500 tw-text-normal-text-color">{{ appName }}</p>
<svg-icon-sprite *ngIf="isIntegrationConnected && !isLoading && isRecipeRunning && !hideRefreshIcon" pTooltip="Sync Data" tooltipPosition="right" src="sync" width="18px" height="14px" class="tw-cursor-pointer tw-ml-10-px tw-pt-6-px tw-text-faded-text-color" (click)="syncData()"></svg-icon-sprite>
<svg-icon-sprite *ngIf="isIntegrationConnected && !isLoading && !hideRefreshIcon" pTooltip="Sync Data" tooltipPosition="right" src="sync" width="18px" height="14px" class="tw-cursor-pointer tw-ml-10-px tw-pt-6-px tw-text-faded-text-color" (click)="syncData()"></svg-icon-sprite>
</div>
<p *ngIf="!isIntegrationSetupInProgress" class="tw-text-slightly-normal-text-color tw-pt-2-px tw-text-14-px tw-font-400 tw-flex">{{ appDescription }}
<span *ngIf="redirectLink" class="tw-text-hyperlink-color tw-flex tw-pl-4-px tw-cursor-pointer" (click)="windowService.openInNewTab(redirectLink)">
Expand All @@ -30,7 +30,7 @@
<i *ngIf="!isConnectionInProgress" class="tw-pl-10-px tw-pt-2-px !tw-text-12-px pi pi-arrow-right"></i>
<app-loader class="tw-ml-10-px" *ngIf="isConnectionInProgress" [styleClass]="'spinner-16-white tw-top-2-px'"></app-loader>
</button>
<button *ngIf="isIntegrationConnected && isRecipeRunning && appName !== AppName.GUSTO" pButton type="button" class="!tw-text-alert-toast remove-bg disconnect !tw-bg-white" (click)="disconnect()">
<button *ngIf="isIntegrationConnected && appName !== AppName.GUSTO" pButton type="button" class="!tw-text-alert-toast remove-bg disconnect !tw-bg-white" (click)="disconnect()">
{{ isConnectionInProgress ? 'Disconnecting' : 'Disconnect' }}
</button>
<button *ngIf="(appName === AppName.QBD || appName === AppName.INTACCT || appName === AppName.SAGE300 || appName === AppName.BUSINESS_CENTRAL)" pButton type="button" class="p-button-raised" (click)="connect()">
Expand All @@ -49,4 +49,4 @@
</div>
</div>

<p class="tw-h-1-px tw-w-[100%] tw-bg-separator"></p>
<p class="tw-h-1-px tw-w-[100%] tw-bg-separator"></p>
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class AppLandingPageHeaderComponent implements OnInit {

connect(): void {

if (this.appName === this.AppName.TRAVELPERK) {
if (this.appName === this.AppName.TRAVELPERK || this.appName === this.AppName.BAMBOO_HR) {
this.initiateOAuth();
return;
} else if (this.postConnectionRoute === 'qbd/onboarding/export_settings') {
Expand Down

0 comments on commit 98f46b6

Please sign in to comment.