Skip to content

Commit a32b5f7

Browse files
committed
Revert "feat: memo structure in xero app (#1094)"
This reverts commit 521d287.
1 parent 521d287 commit a32b5f7

File tree

5 files changed

+4
-88
lines changed

5 files changed

+4
-88
lines changed

src/app/branding/c1-contents-config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,6 @@ export const c1Contents = {
214214
cccExpenseBankAccountLabel: 'Which bank account should the bank transactions post to?',
215215
cccExpenseStateSubLabel: 'You can choose to only export expenses when they\'ve been labeled approved or closed. '
216216
},
217-
memoStructureLabel: 'Set the line-item description field in Xero',
218-
memoStructureSubLabel: 'Choose from a list of available data points that you\'d like to export to the description field in Xero. ',
219217
stepSubLabel: 'Configure how and when expenses from Expense Management can be exported to Xero.',
220218
cccExpenseStateLabel: 'How should expenses be labeled before exporting from Expense Management?'
221219
},

src/app/branding/fyle-contents-config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,6 @@ export const fyleContents = {
246246
billPaymentAccountSubLabel: ', the payment entries will be posted to the selected Payment account in ',
247247
postEntriesCurrentPeriod: 'Post entries in the current accounting period',
248248
contentText: 'In this section, you can customize the integration based on your accounting requirements. ',
249-
topLevelMemoStructureLabel: 'Customize the Top-Level Memo Field',
250-
topLevelMemoStructureSubLabel: 'Select the datapoints you\'d like to export to Xero’s top-level memo field when exporting expenses from Fyle.',
251-
memoStructureLabel: 'Customize the Line-Item Level Memo Field',
252-
memoStructureSubLabel: 'Select the datapoints you\'d like to export to Xero\’s line-item level memo field when exporting expenses from Fyle.',
253249
frequencySubLabel: 'Set a frequency based on how often you want your expenses in Fyle to be exported to Xero.',
254250
customPreferencesLabel: 'Other Preferences',
255251
customPreferencesSubLabel: 'Based on your preference, you can choose whether you want to create any new records in Xero from ' + brandingConfig.brandName + '. (when there is no employee record found, or when the accounting period is closed)',

src/app/core/models/xero/xero-configuration/xero-advanced-settings.model.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ export type XeroAdvancedSettingWorkspaceGeneralSetting = {
1212
sync_xero_to_fyle_payments: boolean,
1313
auto_create_destination_entity: boolean,
1414
change_accounting_period: boolean,
15-
auto_create_merchant_destination_entity: boolean,
16-
memo_structure: string[]
15+
auto_create_merchant_destination_entity: boolean
1716
}
1817

1918
export type XeroAdvancedSettingGeneralMapping = {
@@ -112,7 +111,6 @@ export class XeroAdvancedSettingModel extends HelperUtility{
112111
exportSchedule: new FormControl(advancedSettings.workspace_schedules?.enabled ? true : false),
113112
exportScheduleFrequency: new FormControl(advancedSettings.workspace_schedules?.enabled ? advancedSettings.workspace_schedules.interval_hours : 1),
114113
autoCreateMerchantDestinationEntity: new FormControl(advancedSettings.workspace_general_settings.auto_create_merchant_destination_entity ? advancedSettings.workspace_general_settings.auto_create_merchant_destination_entity : false),
115-
memoStructure: new FormControl(advancedSettings.workspace_general_settings.memo_structure),
116114
search: new FormControl(),
117115
searchOption: new FormControl(),
118116
email: new FormControl(advancedSettings?.workspace_schedules?.emails_selected && advancedSettings?.workspace_schedules?.emails_selected?.length > 0 ? AdvancedSettingsModel.filterAdminEmails(advancedSettings?.workspace_schedules?.emails_selected, adminEmails) : []),
@@ -128,8 +126,7 @@ export class XeroAdvancedSettingModel extends HelperUtility{
128126
sync_xero_to_fyle_payments: advancedSettingsForm.get('paymentSync')?.value && advancedSettingsForm.get('paymentSync')?.value === PaymentSyncDirection.XERO_TO_FYLE ? true : false,
129127
auto_create_destination_entity: advancedSettingsForm.get('autoCreateVendors')?.value,
130128
change_accounting_period: advancedSettingsForm.get('changeAccountingPeriod')?.value,
131-
auto_create_merchant_destination_entity: advancedSettingsForm.get('autoCreateMerchantDestinationEntity')?.value,
132-
memo_structure: advancedSettingsForm.get('memoStructure')?.value
129+
auto_create_merchant_destination_entity: advancedSettingsForm.get('autoCreateMerchantDestinationEntity')?.value
133130
},
134131
general_mappings: {
135132
payment_account: advancedSettingsForm.get('billPaymentAccount')?.value ? ExportSettingModel.formatGeneralMappingPayload(advancedSettingsForm.get('billPaymentAccount')?.value) : emptyDestinationAttribute

src/app/integrations/xero/xero-shared/xero-advanced-settings/xero-advanced-settings.component.html

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -100,32 +100,6 @@
100100
[formControllerName]="'autoCreateMerchantDestinationEntity'">
101101
</app-configuration-toggle-field>
102102
</div>
103-
<div class="tw-mb-16-px">
104-
<app-configuration-step-sub-header
105-
[label]="'Customization'"
106-
[subLabel]="'In this section, you can customize the data that you\'d like to export from ' + brandingConfig.brandName + ' to Xero. You can choose what data points need to be exported and what shouldn\'t be.'">
107-
</app-configuration-step-sub-header>
108-
</div>
109-
<div class="tw-rounded-12-px tw-border-separator tw-border tw-bg-white tw-mb-16-px">
110-
<app-configuration-multi-select
111-
[form]="advancedSettingForm"
112-
[isFieldMandatory]="false"
113-
[mandatoryErrorListName]="'Item level description'"
114-
[label]="'Set the line item-level Description Field in Xero'"
115-
[subLabel]="'You can choose from a list of available data points that you\'d like to export to the description field in Xero.'"
116-
[options]="defaultMemoFields"
117-
[iconPath]="'list'"
118-
[placeholder]="'Set description'"
119-
[formControllerName]="'memoStructure'"
120-
(changeInMultiSelect)="onMultiSelectChange()">
121-
</app-configuration-multi-select>
122-
<div class="preview-text">
123-
<h4 class="tw-text-form-label-text-color tw-mb-12-px">Preview of the Description Field</h4>
124-
<div class="preview-box">
125-
{{memoPreviewText}}
126-
</div>
127-
</div>
128-
</div>
129103
</div>
130104
<app-configuration-step-footer
131105
[ctaText] = "!isSaveInProgress ? (isOnboarding ? ConfigurationCtaText.SAVE_AND_CONTINUE : ConfigurationCtaText.SAVE) : ConfigurationCtaText.SAVING"

src/app/integrations/xero/xero-shared/xero-advanced-settings/xero-advanced-settings.component.ts

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FormGroup } from '@angular/forms';
33
import { Router } from '@angular/router';
44
import { forkJoin } from 'rxjs';
55
import { brandingConfig, brandingContent, brandingFeatureConfig, brandingKbArticles } from 'src/app/branding/branding-config';
6-
import { environment } from 'src/environments/environment';
6+
import { ConditionField, ExpenseFilterResponse } from 'src/app/core/models/common/advanced-settings.model';
77
import { EmailOption, SelectFormOption } from 'src/app/core/models/common/select-form-option.model';
88
import { DestinationAttribute } from 'src/app/core/models/db/destination-attribute.model';
99
import { AppName, ConfigurationCta, ToastSeverity, XeroFyleField, XeroOnboardingState } from 'src/app/core/models/enum/enum.model';
@@ -17,7 +17,6 @@ import { WorkspaceService } from 'src/app/core/services/common/workspace.service
1717
import { OrgService } from 'src/app/core/services/org/org.service';
1818
import { XeroAdvancedSettingsService } from 'src/app/core/services/xero/xero-configuration/xero-advanced-settings.service';
1919
import { XeroHelperService } from 'src/app/core/services/xero/xero-core/xero-helper.service';
20-
import { AdvancedSettingsModel } from 'src/app/core/models/common/advanced-settings.model';
2120

2221
@Component({
2322
selector: 'app-xero-advanced-settings',
@@ -36,10 +35,6 @@ export class XeroAdvancedSettingsComponent implements OnInit {
3635

3736
advancedSettings: XeroAdvancedSettingGet;
3837

39-
memoPreviewText: string;
40-
41-
defaultMemoFields: string[] = ['employee_email', 'merchant', 'purpose', 'category', 'spent_on', 'report_number', 'expense_link'];
42-
4338
workspaceGeneralSettings: XeroWorkspaceGeneralSetting;
4439

4540
billPaymentAccounts: DestinationAttribute[];
@@ -87,12 +82,6 @@ export class XeroAdvancedSettingsComponent implements OnInit {
8782
this.router.navigate([`/integrations/xero/onboarding/import_settings`]);
8883
}
8984

90-
onMultiSelectChange() {
91-
const memo = this.advancedSettingForm.controls.memoStructure.value;
92-
const changedMemo = AdvancedSettingsModel.formatMemoPreview(memo, this.defaultMemoFields)[1];
93-
this.advancedSettingForm.controls.memoStructure.patchValue(changedMemo);
94-
}
95-
9685
save(): void {
9786
const advancedSettingPayload = XeroAdvancedSettingModel.constructPayload(this.advancedSettingForm);
9887
this.isSaveInProgress = true;
@@ -119,44 +108,6 @@ export class XeroAdvancedSettingsComponent implements OnInit {
119108
XeroAdvancedSettingModel.setConfigurationSettingValidatorsAndWatchers(this.advancedSettingForm);
120109
}
121110

122-
private formatMemoPreview(): void {
123-
const time = Date.now();
124-
const today = new Date(time);
125-
126-
const previewValues: { [key: string]: string } = {
127-
employee_email: '[email protected]',
128-
category: 'Meals and Entertainment',
129-
purpose: 'Client Meeting',
130-
merchant: 'Pizza Hut',
131-
report_number: 'C/2021/12/R/1',
132-
spent_on: today.toLocaleDateString(),
133-
expense_link: `${environment.fyle_app_url}/app/main/#/enterprise/view_expense/`
134-
};
135-
136-
this.memoPreviewText = '';
137-
const memo: string[] = [];
138-
this.memoStructure.forEach((field, index) => {
139-
if (field in previewValues) {
140-
const defaultIndex = this.defaultMemoFields.indexOf(this.memoStructure[index]);
141-
memo[defaultIndex] = previewValues[field];
142-
}
143-
});
144-
memo.forEach((field, index) => {
145-
this.memoPreviewText += field;
146-
if (index + 1 !== memo.length) {
147-
this.memoPreviewText = this.memoPreviewText + ' - ';
148-
}
149-
});
150-
}
151-
152-
private createMemoStructureWatcher(): void {
153-
this.memoStructure = this.advancedSettingForm.get('memoStructure')?.value;
154-
this.formatMemoPreview();
155-
this.advancedSettingForm.controls.memoStructure.valueChanges.subscribe((memoChanges) => {
156-
this.memoStructure = memoChanges;
157-
this.formatMemoPreview();
158-
});
159-
}
160111

161112
private setupPage() {
162113
this.isOnboarding = this.router.url.includes('onboarding');
@@ -171,8 +122,8 @@ export class XeroAdvancedSettingsComponent implements OnInit {
171122
this.workspaceGeneralSettings = response[2];
172123
this.adminEmails = this.advancedSettings.workspace_schedules?.additional_email_options ? this.advancedSettings.workspace_schedules?.additional_email_options.concat(response[3]).flat() : response[3];
173124
this.advancedSettingForm = XeroAdvancedSettingModel.mapAPIResponseToFormGroup(this.advancedSettings, this.adminEmails, this.billPaymentAccounts, this.helperService.shouldAutoEnableAccountingPeriod(this.org.created_at));
125+
174126
this.setupFormWatchers();
175-
this.createMemoStructureWatcher();
176127
this.isLoading = false;
177128
});
178129
}

0 commit comments

Comments
 (0)