Skip to content

Commit

Permalink
c1: Expose Intacct (#596)
Browse files Browse the repository at this point in the history
* c1: Expose Intacct

* update callback url

* add loggers

* rm log
  • Loading branch information
ashwin1111 authored Feb 23, 2024
1 parent 7216c31 commit 791b0c7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 31 deletions.
1 change: 0 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ do
sed -i $SED_EXTRA_ARGS "s?{{SEGMENT_ID}}?${SEGMENT_ID}?g" $f;
sed -i $SED_EXTRA_ARGS "s?{{QBO_CALLBACK_URL}}?${QBO_CALLBACK_URL}?g" $f;
sed -i $SED_EXTRA_ARGS "s?{{NS_CALLBACK_URL}}?${NS_CALLBACK_URL}?g" $f;
sed -i $SED_EXTRA_ARGS "s?{{SI_CALLBACK_URL}}?${SI_CALLBACK_URL}?g" $f;
sed -i $SED_EXTRA_ARGS "s?{{XERO_CALLBACK_URL}}?${XERO_CALLBACK_URL}?g" $f;
sed -i $SED_EXTRA_ARGS "s?{{QBO_CLIENT_ID}}?${QBO_CLIENT_ID}?g" $f;
sed -i $SED_EXTRA_ARGS "s?{{NS_CLIENT_ID}}?${NS_CLIENT_ID}?g" $f;
Expand Down
1 change: 0 additions & 1 deletion scripts/setup_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const environment = {
sentry_env: `${process.env.SENTRY_ENV ? process.env.SENTRY_ENV : '{{SENTRY_ENV}}'}`,
qbo_callback_url: `${process.env.QBO_CALLBACK_URL ? process.env.QBO_CALLBACK_URL : '{{QBO_CALLBACK_URL}}'}`,
ns_callback_url: `${process.env.NS_CALLBACK_URL ? process.env.NS_CALLBACK_URL : '{{NS_CALLBACK_URL}}'}`,
si_callback_url: `${process.env.SI_CALLBACK_URL ? process.env.SI_CALLBACK_URL : '{{SI_CALLBACK_URL}}'}`,
xero_callback_url: `${process.env.XERO_CALLBACK_URL ? process.env.XERO_CALLBACK_URL : '{{XERO_CALLBACK_URL}}'}`,
qbo_client_id: `${process.env.QBO_CLIENT_ID ? process.env.QBO_CLIENT_ID : '{{QBO_CLIENT_ID}}'}`,
ns_client_id: `${process.env.NS_CLIENT_ID ? process.env.NS_CLIENT_ID : '{{NS_CLIENT_ID}}'}`,
Expand Down
4 changes: 2 additions & 2 deletions src/app/branding/branding-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const featureConfigs: FeatureConfiguration = {
illustrationsAllowed: true,
isGradientAllowed: true,
isIconsInsideButtonAllowed: true,
exposeOnlyQBOApp: false,
exposeC1Apps: false,
isBackgroundColorAllowed: false,
isAsterikAllowed: true,
featureFlags: {
Expand Down Expand Up @@ -45,7 +45,7 @@ const featureConfigs: FeatureConfiguration = {
illustrationsAllowed: false,
isGradientAllowed: false,
isIconsInsideButtonAllowed: false,
exposeOnlyQBOApp: true,
exposeC1Apps: true,
isBackgroundColorAllowed: true,
isAsterikAllowed: false,
featureFlags: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type FeatureConfiguration = {
illustrationsAllowed: boolean;
isGradientAllowed: boolean;
isIconsInsideButtonAllowed: boolean;
exposeOnlyQBOApp: boolean;
exposeC1Apps: boolean;
isBackgroundColorAllowed: boolean;
isAsterikAllowed: boolean;
featureFlags: {
Expand Down
8 changes: 2 additions & 6 deletions src/app/core/services/common/events.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { WorkatoConnectionStatus } from '../../models/travelperk/travelperk.mode
import { WindowService } from './window.service';
import { NavigationStart, Router } from '@angular/router';
import { Location } from '@angular/common';
import { brandingFeatureConfig } from 'src/app/branding/branding-config';

export const EXPOSE_INTACCT_NEW_APP = true;

const MODULE_PATHS = ['mapping', 'export_log', 'configuration', 'intacct', 'qbd'];

@Injectable({
Expand All @@ -18,8 +17,6 @@ export class EventsService {

@Output() sageIntacctLogin: EventEmitter<string> = new EventEmitter();

@Output() redirectToOldIntacctApp: EventEmitter<string> = new EventEmitter();

@Output() qboLogin: EventEmitter<string> = new EventEmitter();

history: string[] = [];
Expand Down Expand Up @@ -52,9 +49,8 @@ export class EventsService {
receiveEvent(): void {
this.windowService.nativeWindow.addEventListener('message', (message) => {
if (message.data && message.data.redirectUri && message.origin === environment.fyle_app_url) {
if (EXPOSE_INTACCT_NEW_APP && message.data.redirectUri.includes('sage-intacct')) {
if (message.data.redirectUri.includes('sage-intacct')) {
this.sageIntacctLogin.emit(message.data.redirectUri);
this.redirectToOldIntacctApp.emit(message.data.redirectUri);
} else if (message.data.redirectUri.includes('quickbooks')) {
this.qboLogin.emit(message.data.redirectUri);
} else {
Expand Down
23 changes: 10 additions & 13 deletions src/app/integrations/landing/landing.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="tw-text-slightly-normal-text-color">
<div *ngIf="!exposeOnlyQBOApp" class="tw-flex tw-text-14-px tw-h-56-px">
<div *ngIf="!exposeC1Apps" class="tw-flex tw-text-14-px tw-h-56-px">
<div class="tw-pl-24-px tw-pr-48-px landing--tab" (click)="switchView(IntegrationsView.ALL)">
All
<p *ngIf="integrationTabs.ALL" class="landing--active-tag"></p>
Expand All @@ -18,7 +18,7 @@
</div>
</div>

<p *ngIf="!exposeOnlyQBOApp" class="tw-mt-1-px landing--divider"></p>
<p *ngIf="!exposeC1Apps" class="tw-mt-1-px landing--divider"></p>

<div class="tw-pt-40-px" [ngClass]="{'tw-mx-120-px': brandingConfig.brandId === 'fyle', 'tw-mx-60-px': brandingConfig.brandId === 'co'}">
<div *ngIf="integrationTabs.ALL || integrationTabs.ACCOUNTING">
Expand All @@ -30,7 +30,7 @@
</p>

<div class="tw-flex">
<div *ngIf="!exposeOnlyQBOApp">
<div *ngIf="!exposeC1Apps">
<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">
Expand All @@ -47,14 +47,11 @@
</span>
</div>
</div>
<div *ngIf="!exposeOnlyQBOApp">
<div>
<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.SAGE_INTACCT)">
<img src="assets/logos/intacct-logo.png" width="120px" height="60px" />
<span class="landing--accounting-app-name">
Sage Intacct
<div class="landing--accounting-app-open">
<app-svg-icon *ngIf="!exposeIntacctNewApp" [svgSource]="'open-in-new-tab'" [width]="'16px'" [height]="'16px'"></app-svg-icon>
</div>
</span>
</div>
<!-- <div *ngIf="!isINCluster" 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)">
Expand All @@ -66,8 +63,8 @@
</div>
<div>
<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.QBO)">
<img src="assets/logos/quickbooks-logo.png" width="120px" />
<span class="landing--accounting-app-name">
<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>
Expand All @@ -78,7 +75,7 @@
</span>
</div> -->
</div>
<div *ngIf="!exposeOnlyQBOApp" 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="!exposeC1Apps" class="landing--accounting-app" [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
Expand All @@ -90,7 +87,7 @@
</div>
</div>

<div *ngIf="(integrationTabs.ALL || integrationTabs.HRMS) && !exposeOnlyQBOApp">
<div *ngIf="(integrationTabs.ALL || integrationTabs.HRMS) && !exposeC1Apps">
<p *ngIf="integrationTabs.ALL" class="tw-mt-1-px landing--section-divider"></p>
<p class="landing--section-heading">
HRMS
Expand All @@ -109,7 +106,7 @@
</div>
</div>

<div *ngIf="isTravelperkAllowed && !exposeOnlyQBOApp">
<div *ngIf="isTravelperkAllowed && !exposeC1Apps">
<p *ngIf="integrationTabs.ALL" class="tw-mt-1-px landing--section-divider"></p>
<p class="landing--section-heading">
Travel
Expand All @@ -128,7 +125,7 @@
</div>
</div>

<div *ngIf="integrationTabs.ALL && !exposeOnlyQBOApp" class="tw-pb-100-px">
<div *ngIf="integrationTabs.ALL && !exposeC1Apps" class="tw-pb-100-px">
<p class="tw-my-40-px landing--divider"></p>

<p class="landing--section-heading">
Expand Down
8 changes: 3 additions & 5 deletions src/app/integrations/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AccountingIntegrationApp, ClickEvent, InAppIntegration, IntegrationView, Page } from 'src/app/core/models/enum/enum.model';
import { AccountingIntegrationEvent, InAppIntegrationUrlMap, IntegrationCallbackUrl, IntegrationsView } from 'src/app/core/models/integrations/integrations.model';
import { EXPOSE_INTACCT_NEW_APP, EventsService } from 'src/app/core/services/common/events.service';
import { EventsService } from 'src/app/core/services/common/events.service';
import { TrackingService } from 'src/app/core/services/integration/tracking.service';
import { OrgService } from 'src/app/core/services/org/org.service';
import { environment } from 'src/environments/environment';
Expand Down Expand Up @@ -31,9 +31,7 @@ export class LandingComponent implements OnInit {

isTravelperkAllowed: boolean = this.org.allow_travelperk;

exposeIntacctNewApp: boolean = EXPOSE_INTACCT_NEW_APP;

readonly exposeOnlyQBOApp = brandingFeatureConfig.exposeOnlyQBOApp;
readonly exposeC1Apps = brandingFeatureConfig.exposeC1Apps;

private readonly integrationTabsInitialState: IntegrationsView = {
[IntegrationView.ACCOUNTING]: false,
Expand All @@ -52,7 +50,7 @@ export class LandingComponent implements OnInit {
private readonly integrationCallbackUrlMap: IntegrationCallbackUrl = {
[AccountingIntegrationApp.NETSUITE]: [environment.ns_callback_url, environment.ns_client_id],
[AccountingIntegrationApp.QBO]: [`${environment.fyle_app_url}/quickbooks`, environment.qbo_client_id],
[AccountingIntegrationApp.SAGE_INTACCT]: [environment.si_callback_url, environment.si_client_id],
[AccountingIntegrationApp.SAGE_INTACCT]: [`${environment.fyle_app_url}/sage-intacct`, environment.si_client_id],
[AccountingIntegrationApp.XERO]: [environment.xero_callback_url, environment.xero_client_id]
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ <h5 class="tw-text-text-muted tw-text-14-px tw-pt-8-px !tw-font-400 tw-text-pret
Sync
</span>
</button>
<div>
<span (click)="refreshDimensions()" class="p-button primary-outline tw-mr-12-px" *ngIf="showSyncButton && !brandingFeatureConfig.isIconsInsideButtonAllowed" [pTooltip]="'The integration will import all the newly updated '+ appName +' dimensions and ' + brandingConfig.brandName + ' expenses in the configured state of export'">
<div *ngIf="showSyncButton && !brandingFeatureConfig.isIconsInsideButtonAllowed">
<span (click)="refreshDimensions()" class="p-button primary-outline tw-mr-12-px" [pTooltip]="'The integration will import all the newly updated '+ appName +' dimensions and ' + brandingConfig.brandName + ' expenses in the configured state of export'">
Sync
</span>
</div>
Expand Down

0 comments on commit 791b0c7

Please sign in to comment.