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

fix: hide card number and employee name as options for memo field #1123

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Changes from 2 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
15 changes: 9 additions & 6 deletions src/app/core/models/common/advanced-settings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { QBOExportSettingGet } from "../qbo/qbo-configuration/qbo-export-setting.model";
import { NetSuiteExportSettingGet } from "../netsuite/netsuite-configuration/netsuite-export-setting.model";
import { IntacctConfiguration } from "../db/configuration.model";

import { brandingConfig } from 'src/app/branding/branding-config';
export type EmailOption = {
email: string;
name: string;
Expand Down Expand Up @@ -87,12 +87,15 @@
} else if ('workspace_general_settings' in exportSettings) {
cccExportType = exportSettings.workspace_general_settings?.corporate_credit_card_expenses_object ?? undefined;
}
// Filter out options based on cccExportType and appName
if (cccExportType && ['netsuite', 'quickbooks online', 'sage intacct'].includes(appName.toLowerCase())) {
return defaultOptions; // Allow all options including 'card_number'
}
return defaultOptions.filter(option => option !== 'card_number'); // Omit 'card_number' for other apps

if(brandingConfig.brandId === 'co') {

Check failure on line 91 in src/app/core/models/common/advanced-settings.model.ts

View workflow job for this annotation

GitHub Actions / lint

Expected space(s) after "if"
return defaultOptions.filter(option => option !== 'card_number' && option !== 'employee_name');
} else {

Check failure on line 93 in src/app/core/models/common/advanced-settings.model.ts

View workflow job for this annotation

GitHub Actions / lint

Unnecessary 'else' after 'return'
if (cccExportType && ['netsuite', 'quickbooks online', 'sage intacct'].includes(appName.toLowerCase()) && brandingConfig.brandId === 'fyle') {
return defaultOptions;
}
return defaultOptions.filter(option => option !== 'card_number');
}
}

static formatMemoPreview(memoStructure: string[], defaultMemoOptions: string[]): [string, string[]] {
Expand Down
Loading