Skip to content

Commit

Permalink
Enable ccc toggle if reimbursable module is disabled (#472)
Browse files Browse the repository at this point in the history
* Enable ccc toggle if reimbursable module is disabled

* fix lint

* fix loader position
  • Loading branch information
ashwin1111 authored Jan 25, 2024
1 parent b90a12a commit cb44155
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@
[form]="exportSettingForm"
[label]="'Export Corporate Card Expenses'"
[subLabel]="'Enable this to export the Non-Reimbursable expenses from ' + brandingConfig.brandName + '. If not enabled, any <b>out-of-pocket</b> expenses will not be exported to QuickBooks Online'"
[formControllerName]="'creditCardExpense'" [isSectionHeader]="true">
[formControllerName]="'creditCardExpense'"
[isSectionHeader]="true"
[hideToggle]="!brandingFeatureConfig.featureFlags.exportSettings.reimbursableExpenses">
</app-configuration-toggle-field>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ export class QboExportSettingsComponent implements OnInit {
this.showNameInJournalOption = this.exportSettings.workspace_general_settings?.corporate_credit_card_expenses_object === QBOCorporateCreditCardExpensesObject.JOURNAL_ENTRY ? true : false;

this.exportSettingForm = QBOExportSettingModel.mapAPIResponseToFormGroup(this.exportSettings, this.employeeFieldMapping);

if (!this.brandingFeatureConfig.featureFlags.exportSettings.reimbursableExpenses) {
this.exportSettingForm.controls.creditCardExpense.patchValue(true);
}

this.helperService.addExportSettingFormValidator(this.exportSettingForm);

const [exportSettingValidatorRule, exportModuleRule] = QBOExportSettingModel.getValidators();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3 *ngIf="!accountingCompanyConnectionInProgress && accountingCompanyName" clas
</div>
</div>
</div>
<div *ngIf="accountingCompanyConnectionInProgress" class="tw-pb-8-px">
<div *ngIf="accountingCompanyConnectionInProgress" class="tw-pb-8-px tw-text-center">
<app-loader [styleClass]="'!tw-w-16-px !tw-h-16-px spinner-default'"></app-loader>
</div>
<div class="tw-text-14-px tw-font-500 tw-text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-6-px !tw-font-400 !tw-l
</div>
</div>
<div class="configuration--input-toggle-section">
<p-inputSwitch [formControlName]="formControllerName"></p-inputSwitch>
<p-inputSwitch *ngIf="!hideToggle" [formControlName]="formControllerName"></p-inputSwitch>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class ConfigurationToggleFieldComponent implements OnInit {

@Input() hasDependentFields: boolean;

@Input() hideToggle: boolean = false;

constructor(
public windowService: WindowService
) { }
Expand Down

0 comments on commit cb44155

Please sign in to comment.