Skip to content

Commit

Permalink
basic .value to get().value 5
Browse files Browse the repository at this point in the history
  • Loading branch information
DhaaraniCIT committed Sep 24, 2024
1 parent 77bca4e commit 6398467
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</app-configuration-toggle-field>
</div>

<div *ngIf="exportSettingForm.value?.reimbursableExpense">
<div *ngIf="exportSettingForm.get('reimbursableExpense')?.value">
<div
class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
Expand All @@ -44,7 +44,7 @@
</app-configuration-select-field>


<div *ngIf="exportSettingForm.value.reimbursableExportType && helperService.isFieldRequired(exportSettingForm, 'bankAccount')">
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value && helperService.isFieldRequired(exportSettingForm, 'bankAccount')">
<app-configuration-select-field
[form]="exportSettingForm"
[destinationAttributes]="bankAccounts"
Expand All @@ -63,7 +63,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.reimbursableExportType && helperService.isFieldRequired(exportSettingForm, 'accountsPayable')">
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value && helperService.isFieldRequired(exportSettingForm, 'accountsPayable')">
<app-configuration-select-field
[form]="exportSettingForm"
[destinationAttributes]="accountsPayables"
Expand All @@ -83,15 +83,15 @@
</div>
</div>

<div *ngIf="exportSettingForm.value.reimbursableExportType" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-separator tw-rounded-12-px">
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-separator tw-rounded-12-px">
<ng-container *ngTemplateOutlet="employeeFieldMapping"></ng-container>
<div *ngIf="exportSettingForm.value.reimbursableExportType">
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="false"
[showClearIcon]="true"
[mandatoryErrorListName]="'employee mapping'"
[label]="'How should Employees in ' + brandingConfig.brandName + ' be mapped to ' + getEmployeeFieldMapping(exportSettingForm.value.employeeFieldMapping, exportSettingForm.value.reimbursableExportType) + ' in NetSuite?'"
[label]="'How should Employees in ' + brandingConfig.brandName + ' be mapped to ' + getEmployeeFieldMapping(exportSettingForm.get('employeeFieldMapping')?.value, exportSettingForm.get('reimbursableExportType')?.value) + ' in NetSuite?'"
[subLabel]="'Automatically map the employees in ' + brandingConfig.brandName + ' to their corresponding records in NetSuite based on a unique parameter.'"
[options]="autoMapEmployeeOptions"
[iconPath]="'question-square-outline'"
Expand All @@ -100,7 +100,7 @@
</div>
</div>

<div *ngIf="exportSettingForm.value.reimbursableExportType"
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value"
class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
Expand All @@ -115,7 +115,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.reimbursableExportType"
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value"
class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
Expand All @@ -130,17 +130,17 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.reimbursableExportType"
<div *ngIf="exportSettingForm.get('reimbursableExportType')?.value"
class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="true"
[mandatoryErrorListName]="'export date'"
[label]="'Set the ' + (exportSettingForm.value.reimbursableExportType | snakeCaseToSpaceCase | titlecase) + ' date as'"
[label]="'Set the ' + (exportSettingForm.get('reimbursableExportType')?.value | snakeCaseToSpaceCase | titlecase) + ' date as'"
[subLabel]="'The selected type of date will reflect in the expenses exported from ' + brandingConfig.brandName + ' to NetSuite.'"
[options]="reimbursableExpenseGroupingDateOptions"
[iconPath]="'calendar'"
[placeholder]="'Select the date of the ' + (exportSettingForm.value.reimbursableExportType | snakeCaseToSpaceCase | titlecase)"
[placeholder]="'Select the date of the ' + (exportSettingForm.get('reimbursableExportType')?.value | snakeCaseToSpaceCase | titlecase)"
[formControllerName]="'reimbursableExportDate'">
</app-configuration-select-field>
</div>
Expand All @@ -159,7 +159,7 @@
</div>


<div *ngIf="exportSettingForm.value?.creditCardExpense">
<div *ngIf="exportSettingForm.get('creditCardExpense')?.value">
<div class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
Expand All @@ -176,7 +176,7 @@
[exportTypeIconPathArray]="previewImagePaths">
</app-configuration-select-field>

<div *ngIf="exportSettingForm.value.creditCardExportType && helperService.isFieldRequired(exportSettingForm, 'nameInJournalEntry')">
<div *ngIf="exportSettingForm.get('creditCardExportType')?.value && helperService.isFieldRequired(exportSettingForm, 'nameInJournalEntry')">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="true"
Expand All @@ -190,7 +190,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="(!exportSettingForm.value.reimbursableExportType || brandingConfig.brandId === 'co') && helperService.isFieldRequired(exportSettingForm, 'accountsPayable')">
<div *ngIf="(!exportSettingForm.get('reimbursableExportType')?.value || brandingConfig.brandId === 'co') && helperService.isFieldRequired(exportSettingForm, 'accountsPayable')">
<app-configuration-select-field
[form]="exportSettingForm"
[destinationAttributes]="accountsPayables"
Expand All @@ -209,7 +209,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="(!exportSettingForm.value.reimbursableExportType || brandingConfig.brandId === 'co') && helperService.isFieldRequired(exportSettingForm, 'bankAccount')">
<div *ngIf="(!exportSettingForm.get('reimbursableExportType')?.value || brandingConfig.brandId === 'co') && helperService.isFieldRequired(exportSettingForm, 'bankAccount')">
<app-configuration-select-field
[form]="exportSettingForm"
[destinationAttributes]="bankAccounts"
Expand All @@ -228,7 +228,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.creditCardExportType && helperService.isFieldRequired(exportSettingForm, 'creditCardAccount')">
<div *ngIf="exportSettingForm.get('creditCardExportType')?.value && helperService.isFieldRequired(exportSettingForm, 'creditCardAccount')">
<app-configuration-select-field
[form]="exportSettingForm"
[destinationAttributes]="cccAccounts"
Expand All @@ -247,7 +247,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.creditCardExportType && helperService.isFieldRequired(exportSettingForm, 'defaultCreditCardVendor')">
<div *ngIf="exportSettingForm.get('creditCardExportType')?.value && helperService.isFieldRequired(exportSettingForm, 'defaultCreditCardVendor')">
<app-configuration-select-field
[form]="exportSettingForm"
[destinationAttributes]="creditCardVendors"
Expand All @@ -268,11 +268,11 @@

</div>

<div *ngIf="!exportSettingForm.value.reimbursableExportType && exportSettingForm.value.creditCardExportType === NetSuiteReimbursableExpensesObject.JOURNAL_ENTRY" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<div *ngIf="!exportSettingForm.get('reimbursableExportType')?.value && exportSettingForm.get('creditCardExportType')?.value === NetSuiteReimbursableExpensesObject.JOURNAL_ENTRY" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<ng-container *ngTemplateOutlet="employeeFieldMapping"></ng-container>
</div>

<div *ngIf="exportSettingForm.value.creditCardExportType" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<div *ngIf="exportSettingForm.get('creditCardExportType')?.value" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="true"
Expand All @@ -286,7 +286,7 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.creditCardExportType" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<div *ngIf="exportSettingForm.get('creditCardExportType')?.value" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="true"
Expand All @@ -301,16 +301,16 @@
</app-configuration-select-field>
</div>

<div *ngIf="exportSettingForm.value.creditCardExportType" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<div *ngIf="exportSettingForm.get('creditCardExportType')?.value" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="true"
[mandatoryErrorListName]="'export date'"
[label]=" 'Set the ' + (brandingConfig.brandId === 'fyle' ? (exportSettingForm.value.creditCardExportType | snakeCaseToSpaceCase | titlecase) : (exportSettingForm.value.creditCardExportType | lowercase)) + ' date as'"
[label]=" 'Set the ' + (brandingConfig.brandId === 'fyle' ? (exportSettingForm.get('creditCardExportType')?.value | snakeCaseToSpaceCase | titlecase) : (exportSettingForm.get('creditCardExportType')?.value | lowercase)) + ' date as'"
[subLabel]="'The selected date will reflect in the corporate card expenses exported to NetSuite.'"
[options]="cccExpenseGroupingDateOptions"
[iconPath]="'calendar'"
[placeholder]="'Select the date of the ' + (brandingConfig.brandId === 'fyle' ? (exportSettingForm.value.creditCardExportType | snakeCaseToSpaceCase | titlecase) : (exportSettingForm.value.creditCardExportType | snakeCaseToSpaceCase | lowercase))"
[placeholder]="'Select the date of the ' + (brandingConfig.brandId === 'fyle' ? (exportSettingForm.get('creditCardExportType')?.value | snakeCaseToSpaceCase | titlecase) : (exportSettingForm.get('creditCardExportType')?.value | snakeCaseToSpaceCase | lowercase))"
[formControllerName]="'creditCardExportDate'">
</app-configuration-select-field>
</div>
Expand Down Expand Up @@ -365,7 +365,7 @@ <h5 class="!tw-text-faded-text-color !tw-font-400 !tw-text-14-px tw-pt-6-px !tw-
</div>
</div>
<div class="tw-h-40-px tw-w-300-px tw-bg-disabled-bg-color tw-border radius">
<div class="tw-text-14-px tw-text-slightly-normal-text-color tw-my-10-px tw-mx-14-px">{{getEmployeeFieldMapping(exportSettingForm.value.employeeFieldMapping, exportSettingForm.value.reimbursableExportType)}}</div>
<div class="tw-text-14-px tw-text-slightly-normal-text-color tw-my-10-px tw-mx-14-px">{{getEmployeeFieldMapping(exportSettingForm.get('employeeFieldMapping')?.value, exportSettingForm.get('reimbursableExportType')?.value)}}</div>
<span class="tw-text-text-muted tw-pt-3-px tw-text-12-px">Auto-selected based on your export module</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ export class NetsuiteExportSettingsComponent implements OnInit {
this.exportSettingForm.controls.creditCardExportGroup.setValue(ExpenseGroupingFieldOption.EXPENSE_ID);
this.exportSettingForm.controls.creditCardExportGroup.disable();
} else {
this.cccExpenseGroupingDateOptions = ExportSettingModel.constructGroupingDateOptions(this.exportSettingForm.value.creditCardExportGroup, NetSuiteExportSettingModel.getReimbursableExpenseGroupingDateOptions());
this.cccExpenseGroupingDateOptions = ExportSettingModel.constructGroupingDateOptions(this.exportSettingForm.get('creditCardExportGroup')?.value, NetSuiteExportSettingModel.getReimbursableExpenseGroupingDateOptions());
}
}

private setupCustomWatchers(): void {
if (this.exportSettingForm.value.creditCardExportType && (this.exportSettingForm.value.creditCardExportType === NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE)) {
this.updateCCCExpenseGroupingDateOptions(this.exportSettingForm.value.creditCardExportType);
if (this.exportSettingForm.get('creditCardExportType')?.value && (this.exportSettingForm.get('creditCardExportType')?.value === NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE)) {
this.updateCCCExpenseGroupingDateOptions(this.exportSettingForm.get('creditCardExportType')?.value);
}

this.exportSettingService.creditCardExportTypeChange.subscribe((selectedValue: NetSuiteCorporateCreditCardExpensesObject) => {
Expand All @@ -246,7 +246,7 @@ export class NetsuiteExportSettingsComponent implements OnInit {
private setupCustomDateOptionWatchers(): void {
if (brandingConfig.brandId === 'fyle') {
this.reimbursableExpenseGroupingDateOptions = this.reimbursableExpenseGroupingDate(this.exportSettingForm.controls.reimbursableExportGroup?.value, NetSuiteExportSettingModel.getReimbursableExpenseGroupingDateOptions());
if (this.exportSettingForm.value.creditCardExportType && this.exportSettingForm.value.creditCardExportType !== NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE) {
if (this.exportSettingForm.get('creditCardExportType')?.value && this.exportSettingForm.get('creditCardExportType')?.value !== NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE) {
this.cccExpenseGroupingDateOptions = this.reimbursableExpenseGroupingDate(this.exportSettingForm.controls.creditCardExportGroup?.value, NetSuiteExportSettingModel.getReimbursableExpenseGroupingDateOptions());
}
}
Expand All @@ -259,11 +259,11 @@ export class NetsuiteExportSettingsComponent implements OnInit {
});

this.exportSettingForm.controls.creditCardExportType.valueChanges.subscribe(creditCardExportType => {
this.updateCCCExpenseGroupingDateOptions(this.exportSettingForm.value.creditCardExportType);
this.updateCCCExpenseGroupingDateOptions(this.exportSettingForm.get('creditCardExportType')?.value);
});

this.exportSettingForm.controls.creditCardExportGroup?.valueChanges.subscribe((creditCardExportGroup) => {
if (brandingConfig.brandId==='fyle' && this.exportSettingForm.value.creditCardExportType && this.exportSettingForm.value.creditCardExportType !== NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE) {
if (brandingConfig.brandId==='fyle' && this.exportSettingForm.get('creditCardExportType')?.value && this.exportSettingForm.get('creditCardExportType')?.value !== NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE) {
const cccExpenseGroupingDateOptions = NetSuiteExportSettingModel.getReimbursableExpenseGroupingDateOptions();
this.cccExpenseGroupingDateOptions = this.reimbursableExpenseGroupingDate(creditCardExportGroup, cccExpenseGroupingDateOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export class NetsuiteImportSettingsComponent implements OnInit {

saveFyleExpenseField(): void {
this.customField = {
attribute_type: this.customFieldForm.value.attribute_type.split(' ').join('_').toUpperCase(),
display_name: this.customFieldForm.value.attribute_type,
source_placeholder: this.customFieldForm.value.source_placeholder,
attribute_type: this.customFieldForm.get('attribute_type')?.value.split(' ').join('_').toUpperCase(),
display_name: this.customFieldForm.get('attribute_type')?.value,
source_placeholder: this.customFieldForm.get('source_placeholder')?.value,
is_dependent: false
};

Expand Down
Loading

0 comments on commit 6398467

Please sign in to comment.