-
Notifications
You must be signed in to change notification settings - Fork 0
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: branding based conditions to feature flag #1179
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,25 @@ export const c1FeatureConfig: FeatureConfiguration[string] = { | |
isBackgroundColorAllowed: true, | ||
isAsterikAllowed: false, | ||
allowIntacctHelperDoc: false, | ||
loginRedirectUri: true, | ||
featureFlags: { | ||
cloneSettings: false, | ||
mapEmployees: false, | ||
c1Icon: true, | ||
c1Options: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not used |
||
allowForC1: true, | ||
exportSettings: { | ||
reimbursableExpenses: false, | ||
nameInJournalEntry: false, | ||
useMerchantInJournalLine: false, | ||
splitExpenseGrouping: false | ||
splitExpenseGrouping: false, | ||
cccDateConfiguration: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not used, pls search and remove new unused keys in the PR |
||
isEmployeeMappingIsEmployee: false, | ||
sentenseCaseConversion: true, | ||
cccExportGroupConfiguration: true, | ||
lowerCaseConversion: true, | ||
allowAccountsPayableInCoCCC: true, | ||
allowBankAccountInCoCCC: true | ||
}, | ||
importSettings: { | ||
tax: false, | ||
|
@@ -31,7 +42,10 @@ export const c1FeatureConfig: FeatureConfiguration[string] = { | |
importProjects: true, | ||
allowCustomSegment: false, | ||
dependentField: true, | ||
allowImportCode: false | ||
allowImportCode: false, | ||
categoryImportEnabled: false, | ||
intacctC1ImportSettings: true, | ||
disableCustomerSourceField: true | ||
}, | ||
advancedSettings: { | ||
autoCreateVendors: false, | ||
|
@@ -42,7 +56,8 @@ export const c1FeatureConfig: FeatureConfiguration[string] = { | |
skipExport: false, | ||
autoCreateContacts: false, | ||
useEmployeeAttributes: true, | ||
autoCreateMerchants: true | ||
autoCreateMerchants: true, | ||
excludeCardNumberAndEmployeeNameInMemo: true | ||
}, | ||
exportLog: { | ||
expenseType: false | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,14 +7,25 @@ export type FeatureConfiguration = { | |||||
isBackgroundColorAllowed: boolean; | ||||||
isAsterikAllowed: boolean; | ||||||
allowIntacctHelperDoc: boolean; | ||||||
loginRedirectUri: boolean; | ||||||
featureFlags: { | ||||||
cloneSettings: boolean; | ||||||
mapEmployees: boolean; | ||||||
c1Icon: boolean; | ||||||
c1Options: boolean; | ||||||
allowForC1: boolean; | ||||||
exportSettings: { | ||||||
reimbursableExpenses: boolean; | ||||||
nameInJournalEntry: boolean; | ||||||
useMerchantInJournalLine: boolean; | ||||||
splitExpenseGrouping: boolean; | ||||||
cccDateConfiguration: boolean; | ||||||
cccExportGroupConfiguration: boolean; | ||||||
isEmployeeMappingIsEmployee: boolean; | ||||||
sentenseCaseConversion: boolean; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in property name. The property name - sentenseCaseConversion: boolean;
+ sentenceCaseConversion: boolean; 📝 Committable suggestion
Suggested change
|
||||||
lowerCaseConversion: boolean; | ||||||
allowAccountsPayableInCoCCC: boolean; | ||||||
allowBankAccountInCoCCC: boolean; | ||||||
}, | ||||||
importSettings: { | ||||||
tax: boolean; | ||||||
|
@@ -25,6 +36,9 @@ export type FeatureConfiguration = { | |||||
allowCustomSegment: boolean; | ||||||
dependentField: boolean; | ||||||
allowImportCode: boolean; | ||||||
categoryImportEnabled: boolean; | ||||||
intacctC1ImportSettings: boolean; | ||||||
disableCustomerSourceField: boolean; | ||||||
}, | ||||||
advancedSettings: { | ||||||
autoCreateVendors: boolean; | ||||||
|
@@ -36,6 +50,7 @@ export type FeatureConfiguration = { | |||||
autoCreateContacts: boolean; | ||||||
useEmployeeAttributes: boolean; | ||||||
autoCreateMerchants: boolean; | ||||||
excludeCardNumberAndEmployeeNameInMemo: boolean; | ||||||
}, | ||||||
exportLog: { | ||||||
expenseType: boolean; | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { FormGroup } from "@angular/forms"; | ||
import { DefaultDestinationAttribute } from "../../db/destination-attribute.model"; | ||
import { FyleField } from "../../enum/enum.model"; | ||
import { brandingConfig } from "src/app/branding/branding-config"; | ||
import { brandingConfig, brandingFeatureConfig } from "src/app/branding/branding-config"; | ||
import { ImportSettingsCustomFieldRow } from "../../common/import-settings.model"; | ||
|
||
const emptyDestinationAttribute = { id: null, name: null }; | ||
|
@@ -88,7 +88,7 @@ export class ImportSettings { | |
|
||
let isCategoryImportEnabled = false; | ||
|
||
if (brandingConfig.brandId === 'fyle') { | ||
if (brandingFeatureConfig.featureFlags.importSettings.categoryImportEnabled) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. name it |
||
isCategoryImportEnabled = importSettingsForm.get('importCategories')?.value ? importSettingsForm.get('importCategories')?.value : false; | ||
} else { | ||
isCategoryImportEnabled = filteredExpenseFieldArray.filter((field: MappingSetting) => field.source_field === 'CATEGORY' && field.import_to_fyle).length > 0 ? true : false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -264,7 +264,7 @@ export class NetSuiteExportSettingModel extends ExportSettingModel { | |
} | ||
|
||
static getEmployeeFieldMapping(employeeFieldMapping: string): string { | ||
return brandingConfig.brandId === 'co' ? EmployeeFieldMapping.VENDOR : employeeFieldMapping; | ||
return !brandingFeatureConfig.featureFlags.exportSettings.isEmployeeMappingIsEmployee ? EmployeeFieldMapping.VENDOR : employeeFieldMapping; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. call is, |
||
} | ||
|
||
static mapAPIResponseToFormGroup(exportSettings: NetSuiteExportSettingGet | null): FormGroup { | ||
|
@@ -295,7 +295,7 @@ export class NetSuiteExportSettingModel extends ExportSettingModel { | |
const emptyDestinationAttribute: DefaultDestinationAttribute = {id: null, name: null}; | ||
const nameInJournalEntry = exportSettingsForm.get('nameInJournalEntry')?.value ? exportSettingsForm.get('nameInJournalEntry')?.value : NameInJournalEntry.EMPLOYEE; | ||
|
||
if (brandingConfig.brandId === 'co') { | ||
if (!brandingFeatureConfig.featureFlags.exportSettings.isEmployeeMappingIsEmployee) { | ||
exportSettingsForm.controls.creditCardExpense.patchValue(true); | ||
exportSettingsForm.controls.employeeFieldMapping.patchValue(FyleField.VENDOR); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import { ExportModuleRule, ExportSettingValidatorRule } from '../../models/sage3 | |
import { SnakeCaseToSpaceCasePipe } from 'src/app/shared/pipes/snake-case-to-space-case.pipe'; | ||
import { SkipExportValidatorRule, skipExportValidator } from '../../models/common/advanced-settings.model'; | ||
import { StorageService } from './storage.service'; | ||
import { brandingConfig } from 'src/app/branding/branding-config'; | ||
import { brandingConfig, brandingFeatureConfig } from 'src/app/branding/branding-config'; | ||
import { SentenceCasePipe } from 'src/app/shared/pipes/sentence-case.pipe'; | ||
import { TitleCasePipe } from '@angular/common'; | ||
import { DefaultDestinationAttribute, DestinationAttribute } from '../../models/db/destination-attribute.model'; | ||
|
@@ -260,7 +260,7 @@ export class HelperService { | |
|
||
sentenseCaseConversion(content: string) { | ||
content = new SnakeCaseToSpaceCasePipe().transform(content); | ||
return brandingConfig.brandId === 'co' ? new SentenceCasePipe().transform(content) : content; | ||
return brandingFeatureConfig.featureFlags.exportSettings.sentenseCaseConversion ? new SentenceCasePipe().transform(content) : content; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { IntacctConfigurationComponent } from './intacct-configuration.component | |
import { IntacctExportSettingsComponent } from '../../intacct-shared/intacct-export-settings/intacct-export-settings.component'; | ||
import { IntacctImportSettingsComponent } from '../../intacct-shared/intacct-import-settings/intacct-import-settings.component'; | ||
import { IntacctAdvancedSettingsComponent } from '../../intacct-shared/intacct-advanced-settings/intacct-advanced-settings.component'; | ||
import { brandingConfig } from 'src/app/branding/branding-config'; | ||
import { brandingConfig, brandingFeatureConfig } from 'src/app/branding/branding-config'; | ||
import { IntacctC1ImportSettingsComponent } from '../../intacct-shared/intacct-c1-import-settings/intacct-c1-import-settings.component'; | ||
import { IntacctConnectorComponent } from 'src/app/shared/components/si/core/intacct-connector/intacct-connector.component'; | ||
|
||
|
@@ -23,7 +23,7 @@ const routes: Routes = [ | |
}, | ||
{ | ||
path: 'import_settings', | ||
component: brandingConfig.brandId === 'fyle' ? IntacctImportSettingsComponent : IntacctC1ImportSettingsComponent | ||
component: !brandingFeatureConfig.featureFlags.importSettings.intacctC1ImportSettings ? IntacctImportSettingsComponent : IntacctC1ImportSettingsComponent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the same |
||
}, | ||
{ | ||
path: 'advanced_settings', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ export class IntacctMappingComponent implements OnInit { | |
if (item.source_field !== FyleField.EMPLOYEE && item.source_field !== FyleField.CATEGORY) { | ||
const mappingPage = new SnakeCaseToSpaceCasePipe().transform(item.source_field); | ||
this.mappingPages.push({ | ||
label: brandingConfig.brandId === 'co' ? new SentenceCasePipe().transform(mappingPage) : new TitleCasePipe().transform(mappingPage), | ||
label: brandingFeatureConfig.featureFlags.exportSettings.sentenseCaseConversion ? new SentenceCasePipe().transform(mappingPage) : new TitleCasePipe().transform(mappingPage), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
routerLink: `/integrations/intacct/main/mapping/${encodeURIComponent(item.source_field.toLowerCase())}` | ||
}); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
</div> | ||
<form [formGroup]="exportSettingsForm"> | ||
<div class="tw-p-24-px" [ngClass]="{'tw-pt-0': !brandingFeatureConfig.featureFlags.exportSettings.reimbursableExpenses}"> | ||
<div *ngIf="brandingConfig.brandId === 'fyle'" class="tw-mb-16-px"> | ||
<div *ngIf="!brandingFeatureConfig.featureFlags.allowForC1" class="tw-mb-16-px"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be a key inside export setting, |
||
<div *ngIf="brandingFeatureConfig.featureFlags.exportSettings.reimbursableExpenses" class="tw-rounded-lg tw-border-separator tw-border tw-bg-configuration-bg"> | ||
<app-configuration-toggle-field | ||
[form]="exportSettingsForm" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -392,7 +392,7 @@ export class IntacctExportSettingsComponent implements OnInit { | |
} | ||
|
||
private setupCCCGroupingWatcher(): void { | ||
if (brandingConfig.brandId === 'co') { | ||
if (brandingFeatureConfig.featureFlags.exportSettings.cccExportGroupConfiguration) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's not introduce a new key for this - along with date standardization we'll remove this condition. For now let it be === 'co' |
||
this.updateCCCGroupingDateOptions(this.exportSettingsForm.get('cccExportGroup')?.value); | ||
this.exportSettingsForm.controls.cccExportGroup.valueChanges.subscribe((cccExportGroup) => { | ||
this.updateCCCGroupingDateOptions(cccExportGroup); | ||
|
@@ -484,7 +484,7 @@ export class IntacctExportSettingsComponent implements OnInit { | |
splitExpenseGrouping: new FormControl(this.exportSettings?.expense_group_settings?.split_expense_grouping) | ||
}); | ||
|
||
if (brandingConfig.brandId === 'co') { | ||
if (!brandingFeatureConfig.featureFlags.exportSettings.isEmployeeMappingIsEmployee) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
this.exportSettingsForm.controls.creditCardExpense.patchValue(true); | ||
this.exportSettingsForm.controls.employeeFieldMapping.patchValue(FyleField.VENDOR); | ||
} | ||
|
@@ -525,7 +525,7 @@ export class IntacctExportSettingsComponent implements OnInit { | |
}); | ||
|
||
this.exportSettingsForm.controls.cccExportGroup?.valueChanges.subscribe((cccExportGroup) => { | ||
if (brandingConfig.brandId==='fyle') { | ||
if (brandingFeatureConfig.featureFlags.exportSettings.cccDateConfiguration) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's not introduce a new key for this - along with date standardization we'll remove this condition. For now let it be === 'fyle' |
||
this.cccExpenseGroupingDateOptions = IntacctExportSettingModel.getExpenseGroupingDateOptions(); | ||
this.cccExpenseGroupingDateOptions = ExportSettingModel.constructGroupingDateOptions(cccExportGroup, this.cccExpenseGroupingDateOptions); | ||
if (this.exportSettingsForm?.value.cccExportType === IntacctCorporateCreditCardExpensesObject.CHARGE_CARD_TRANSACTION) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed