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: Expose iif and beta QBD #1131

Merged
merged 1 commit into from
Dec 17, 2024
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
91 changes: 43 additions & 48 deletions src/app/integrations/landing/landing.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,61 @@
Integrate your Expense Management account with the following accounting software.
</p>

<div class="tw-flex">
<div class="tw-flex tw-flex-wrap tw-gap-5">
<div *ngIf="exposeApps.NETSUITE">
<div class="landing--accounting-app tw-mr-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.NETSUITE)">
<img src="assets/logos/netsuite-logo.png" width="120px" height="60px" />
<span class="landing--accounting-app-name">
<div class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.NETSUITE)">
<img src="assets/logos/netsuite-logo.png" class="tw-mt-[-16px]" width="120px" height="60px" />
<span class="landing--accounting-app-name !tw-pt-18-px">
NetSuite
</span>
</div>
<!-- IIF -->
<div *ngIf="!(exposeApps.QBD_DIRECT && org.allow_qbd_direct_integration) && exposeApps.QBD" class="landing--accounting-app tw-mr-20-px tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.QBD)">
<img src="assets/logos/quickbooks-logo.png" class="tw-mt-[-20px]" width="120px" height="60px" />
<span class="landing--accounting-app-name">
QuickBooks Desktop
</span>
</div>
<!-- Direct -->
<div *ngIf="exposeApps.QBD_DIRECT && org.allow_qbd_direct_integration" class="landing--accounting-app tw-mr-20-px tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.QBD_DIRECT)">
<img src="assets/logos/quickbooks-logo.png" class="tw-mt-[-20px]" width="120px" height="60px" />
<span class="landing--accounting-app-name tw-gap-2 tw-px-4 tw-flex tw-items-center">
QuickBooks Desktop
<app-badge [theme]="ThemeOption.DARK" text="Beta"></app-badge>
</span>
</div>
</div>
<div>
<div *ngIf="exposeApps.INTACCT" class="landing--accounting-app tw-mr-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.SAGE_INTACCT)">
<img src="assets/logos/intacct-logo.png" width="120px" height="60px" />
<span class="landing--accounting-app-name">
Sage Intacct
</span>
</div>
<div *ngIf="exposeApps.SAGE300" class="landing--accounting-app tw-mr-20-px tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.SAGE300)">
<img src="assets/logos/sage300-logo.svg" width="110px" height="60px" />
<span class="landing--accounting-app-name tw-gap-2">
Sage 300 CRE
<app-badge *ngIf="!orgsToHideSage300BetaBadge.includes(org.fyle_org_id)" [theme]="ThemeOption.DARK" text="Beta"></app-badge>
</span>
</div>
<div *ngIf="exposeApps.INTACCT" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.SAGE_INTACCT)">
<img src="assets/logos/intacct-logo.png" class="tw-mt-[-16px]" width="120px" height="60px" />
<span class="landing--accounting-app-name !tw-pt-8-px">
Sage Intacct
</span>
</div>
<div>
<div *ngIf="exposeApps.QBO" class="landing--accounting-app tw-mr-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.QBO)">
<img class="tw-mt-10-px" src="assets/logos/quickbooks-logo.png" width="120px" />
<span class="landing--accounting-app-name !tw-pt-30-px">
QuickBooks Online
</span>
</div>
<div *ngIf="exposeApps.BUSINESS_CENTRAL && org.allow_dynamics" class="landing--accounting-app tw-mr-20-px tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.BUSINESS_CENTRAL)">
<img src="assets/logos/BusinessCentral-logo.svg" class="tw-mt-[-20px]" width="50px" height="60px" />
<span class="landing--accounting-app-name tw-gap-2 tw-px-4 tw-flex tw-items-center">
Dynamics 365 Business Central
<app-badge *ngIf="!orgsToHideBusinessCentralBetaBadge.includes(org.fyle_org_id)" [theme]="ThemeOption.DARK" text="Beta"></app-badge>
</span>
</div>
<div *ngIf="exposeApps.QBO" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.QBO)">
<img class="tw-mt-10-px" src="assets/logos/quickbooks-logo.png" width="120px" />
<span class="landing--accounting-app-name">
QuickBooks Online
</span>
</div>
<div *ngIf="exposeApps.XERO" class="landing--accounting-app" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.XERO)">
<div *ngIf="exposeApps.XERO" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openAccountingIntegrationApp(AccountingIntegrationApp.XERO)">
<img src="assets/logos/xero-logo.png" class="tw-mt-[-20px]" width="65px" height="60px" />
<span class="landing--accounting-app-name">
Xero
</span>
</div>
<div *ngIf="exposeApps.QBD" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.QBD)">
<img src="assets/logos/quickbooks-logo.png" width="120px" height="60px" />
<span class="landing--accounting-app-name">
QuickBooks Desktop (IIF)
</span>
</div>
<!-- Direct -->
<div *ngIf="exposeApps.QBD_DIRECT && org.allow_qbd_direct_integration" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.QBD_DIRECT)">
<img src="assets/logos/quickbooks-logo.png" width="120px" height="60px" />
<span class="landing--accounting-app-name tw-gap-2 tw-px-4 tw-flex tw-items-center">
QuickBooks Desktop (Web Connector)
<app-badge [theme]="ThemeOption.DARK" text="Beta"></app-badge>
</span>
</div>
<div *ngIf="exposeApps.SAGE300" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.SAGE300)">
<img src="assets/logos/sage300-logo.svg" width="110px" height="60px" />
<span class="landing--accounting-app-name tw-gap-2">
Sage 300 CRE
<app-badge *ngIf="!orgsToHideSage300BetaBadge.includes(org.fyle_org_id)" [theme]="ThemeOption.DARK" text="Beta"></app-badge>
</span>
</div>
<div *ngIf="exposeApps.BUSINESS_CENTRAL && org.allow_dynamics" class="landing--accounting-app tw-mt-20-px" [ngClass]="{'tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}" (click)="openInAppIntegration(InAppIntegration.BUSINESS_CENTRAL)">
<img src="assets/logos/BusinessCentral-logo.svg" class="tw-mt-[-20px]" width="50px" height="60px" />
<span class="landing--accounting-app-name tw-gap-2 tw-px-4 tw-flex tw-items-center">
Dynamics 365 Business Central
<app-badge *ngIf="!orgsToHideBusinessCentralBetaBadge.includes(org.fyle_org_id)" [theme]="ThemeOption.DARK" text="Beta"></app-badge>
</span>
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/app/integrations/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class LandingComponent implements OnInit {

readonly brandingConfig = brandingConfig;

readonly isINCluster = this.storageService.get('cluster-domain').includes('in1');
readonly isINCluster = this.storageService.get('cluster-domain')?.includes('in1');
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent null-checking patterns found for 'cluster-domain' access

The codebase shows inconsistent handling of potential null/undefined values when accessing 'cluster-domain':

  • helper.service.ts: Uses fallback with || operator
  • login.component.ts: Uses optional chaining for reading (similar to the reviewed change)
  • auth.service.ts: Direct removal without checks (safe operation)
  • login.component.ts: Direct setting without checks (safe operation)

Consider standardizing the null-checking approach across the codebase:

  • src/app/core/services/common/helper.service.ts: Consider using optional chaining for consistency
🔗 Analysis chain

LGTM! Defensive programming improvement.

The addition of optional chaining operator prevents potential runtime errors when accessing the cluster domain.

Let's verify the cluster-domain storage key usage:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other usages of cluster-domain to ensure consistent null checking

# Search for cluster-domain usage
rg "cluster-domain" --type ts

Length of output: 647


readonly exposeApps = !this.isINCluster ? exposeAppConfig[brandingConfig.brandId][brandingConfig.envId] : exposeAppConfig[brandingConfig.brandId]['production-1-in'];

Expand Down
Loading