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:duplicate-detection-v2 settings cleanup #2796

Merged
merged 6 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 0 additions & 2 deletions src/app/core/models/org-settings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ export interface OrgSettingsResponse {
budget_settings?: CommonOrgSettings;
custom_category_settings?: CommonOrgSettings;
duplicate_detection_settings?: CommonOrgSettings;
duplicate_detection_v2_settings?: CommonOrgSettings;
dynamic_form_settings?: CommonOrgSettings;
hrms_integration_settings?: CommonOrgSettings;
multi_org_settings?: CommonOrgSettings;
Expand Down Expand Up @@ -521,7 +520,6 @@ export interface OrgSettings {
settlements_excel_settings?: SettlementsExcelSettings;
gmail_addon_settings?: CommonOrgSettings;
duplicate_detection_settings?: CommonOrgSettings;
duplicate_detection_v2_settings?: CommonOrgSettings;
custom_category_settings?: CommonOrgSettings;
bulk_fyle_settings?: CommonOrgSettings;
auto_reminder_settings?: CommonOrgSettings;
Expand Down
13 changes: 4 additions & 9 deletions src/app/core/services/org-settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export class OrgSettingsService {
incoming.mileage_details && incoming.mileage_details.enable_individual_mileage_rates,
},
commute_deduction_settings: {
allowed: incoming.commute_deduction_settings?.allowed,
enabled: incoming.commute_deduction_settings?.enabled,
allowed: incoming.commute_deduction_settings && incoming.commute_deduction_settings.allowed,
enabled: incoming.commute_deduction_settings && incoming.commute_deduction_settings.enabled,
},
advances: {
allowed: incoming.advances_settings && incoming.advances_settings.allowed,
Expand Down Expand Up @@ -291,10 +291,6 @@ export class OrgSettingsService {
allowed: incoming.duplicate_detection_settings && incoming.duplicate_detection_settings.allowed,
enabled: incoming.duplicate_detection_settings && incoming.duplicate_detection_settings.enabled,
},
duplicate_detection_v2_settings: {
allowed: incoming.duplicate_detection_v2_settings && incoming.duplicate_detection_v2_settings.allowed,
enabled: incoming.duplicate_detection_v2_settings && incoming.duplicate_detection_v2_settings.enabled,
},
custom_category_settings: {
allowed: incoming.custom_category_settings && incoming.custom_category_settings.allowed,
enabled: incoming.custom_category_settings && incoming.custom_category_settings.enabled,
Expand Down Expand Up @@ -462,8 +458,8 @@ export class OrgSettingsService {
mileage_location_enabled: outgoing.mileage.location_mandatory,
},
commute_deduction_settings: {
allowed: outgoing.commute_deduction_settings?.allowed,
enabled: outgoing.commute_deduction_settings?.enabled,
allowed: outgoing.commute_deduction_settings && outgoing.commute_deduction_settings.allowed,
enabled: outgoing.commute_deduction_settings && outgoing.commute_deduction_settings.enabled,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

threw errors in the tests if optional chaining is used

},
multi_org_settings: {
allowed: outgoing.org_creation.allowed,
Expand Down Expand Up @@ -540,7 +536,6 @@ export class OrgSettingsService {
transaction_field_configurations: outgoing.transaction_field_configurations,
gmail_addon_settings: outgoing.gmail_addon_settings,
duplicate_detection_settings: outgoing.duplicate_detection_settings,
duplicate_detection_v2_settings: outgoing.duplicate_detection_v2_settings,
custom_category_settings: outgoing.custom_category_settings,
org_bulk_fyle_settings: outgoing.bulk_fyle_settings,
auto_reminder_settings: outgoing.auto_reminder_settings,
Expand Down
8 changes: 0 additions & 8 deletions src/app/core/test-data/org-settings.service.spec.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ export const orgSettingsGetData: OrgSettings = {
allowed: true,
enabled: true,
},
duplicate_detection_v2_settings: {
allowed: true,
enabled: true,
},
custom_category_settings: {
allowed: true,
enabled: true,
Expand Down Expand Up @@ -736,10 +732,6 @@ export const orgSettingsPostData: OrgSettingsResponse = {
allowed: true,
enabled: true,
},
duplicate_detection_v2_settings: {
allowed: true,
enabled: true,
},
custom_category_settings: {
allowed: true,
enabled: true,
Expand Down
Loading