WEB-639: Refactor redundant boolean comparisons (#3063)

improve

improve

improve

improve
This commit is contained in:
Shubham Kumar
2026-01-31 07:07:59 -06:00
committed by GitHub
parent 41a71cd269
commit fbee49b464
55 changed files with 190 additions and 193 deletions
@@ -146,13 +146,13 @@ export class CurrenciesComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showCurrencyPage === true) {
if (this.configurationWizardService.showCurrencyPage) {
setTimeout(() => {
this.showPopover(this.templateButtonAddEdit, this.buttonAddEdit.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showCurrencyList === true) {
if (this.configurationWizardService.showCurrencyList) {
setTimeout(() => {
this.showPopover(this.templateTableCurrencies, this.tableCurrencies.nativeElement, 'top', true);
});
@@ -166,7 +166,7 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
this.organizationservice.updateCurrencies(selectedCurrencyCodes).subscribe((response: any) => {
this.selectedCurrencies.push(newCurrency);
this.formRef.resetForm();
if (this.configurationWizardService.showCurrencyForm === true) {
if (this.configurationWizardService.showCurrencyForm) {
this.configurationWizardService.showCurrencyForm = false;
this.openDialog();
}
@@ -205,7 +205,7 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
}
ngAfterViewInit() {
if (this.configurationWizardService.showCurrencyForm === true) {
if (this.configurationWizardService.showCurrencyForm) {
setTimeout(() => {
this.showPopover(this.templateCurrencyFormRef, this.currencyFormRef.nativeElement, 'bottom', true);
});
@@ -142,7 +142,7 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit {
locale
};
this.organizationService.createEmployee(data).subscribe((response: any) => {
if (this.configurationWizardService.showEmployeeForm === true) {
if (this.configurationWizardService.showEmployeeForm) {
this.configurationWizardService.showEmployeeForm = false;
this.openDialog();
} else {
@@ -171,7 +171,7 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showEmployeeForm === true) {
if (this.configurationWizardService.showEmployeeForm) {
setTimeout(() => {
this.showPopover(this.templateCreateEmployeeForm, this.createEmployeeFormRef.nativeElement, 'right', true);
});
@@ -151,12 +151,12 @@ export class EmployeesComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showEmployeeList === true) {
if (this.configurationWizardService.showEmployeeList) {
setTimeout(() => {
this.showPopover(this.templateButtonImportEmployees, this.buttonImportEmployees.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showEmployeeTable === true) {
if (this.configurationWizardService.showEmployeeTable) {
setTimeout(() => {
this.showPopover(this.templateTableEmployees, this.tableEmployees.nativeElement, 'top', true);
});
@@ -173,13 +173,13 @@ export class HolidaysComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showHolidayPage === true) {
if (this.configurationWizardService.showHolidayPage) {
setTimeout(() => {
this.showPopover(this.templateButtonCreateHoliday, this.buttonCreateHoliday.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showHolidayFilter === true) {
if (this.configurationWizardService.showHolidayFilter) {
setTimeout(() => {
this.showPopover(this.templateFilterRef, this.filterRef.nativeElement, 'bottom', true);
});
@@ -157,7 +157,7 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
name: newFund.name
});
this.formRef.resetForm();
if (this.configurationWizardService.showManageFunds === true) {
if (this.configurationWizardService.showManageFunds) {
this.configurationWizardService.showManageFunds = false;
this.openDialog();
}
@@ -215,7 +215,7 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showManageFunds === true) {
if (this.configurationWizardService.showManageFunds) {
setTimeout(() => {
this.showPopover(this.templateFundFormRef, this.fundFormRef.nativeElement, 'bottom', true);
});
@@ -121,7 +121,7 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit {
locale
};
this.organizationService.createOffice(data).subscribe((response) => {
if (this.configurationWizardService.showOfficeForm === true) {
if (this.configurationWizardService.showOfficeForm) {
this.configurationWizardService.showOfficeForm = false;
this.openDialog();
} else {
@@ -176,7 +176,7 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showOfficeForm === true) {
if (this.configurationWizardService.showOfficeForm) {
setTimeout(() => {
this.showPopover(this.templateCreateOfficeForm, this.createOfficeFormRef.nativeElement, 'right', true);
});
@@ -240,12 +240,12 @@ export class OfficesComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showOfficeList === true) {
if (this.configurationWizardService.showOfficeList) {
setTimeout(() => {
this.showPopover(this.templateButtonTreeView, this.buttonTreeView.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showOfficeTable === true) {
if (this.configurationWizardService.showOfficeTable) {
setTimeout(() => {
this.showPopover(this.templateTableOffices, this.tableOffices.nativeElement, 'top', true);
});
@@ -90,32 +90,32 @@ export class OrganizationComponent implements AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showCreateOffice === true) {
if (this.configurationWizardService.showCreateOffice) {
setTimeout(() => {
this.showPopover(this.templateOffice, this.office.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showAddEditCurrency === true) {
if (this.configurationWizardService.showAddEditCurrency) {
setTimeout(() => {
this.showPopover(this.templateAddEditCurrency, this.addEditCurrency.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showCreateHoliday === true) {
if (this.configurationWizardService.showCreateHoliday) {
setTimeout(() => {
this.showPopover(this.templateHolidays, this.holidays.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showCreateEmployee === true) {
if (this.configurationWizardService.showCreateEmployee) {
setTimeout(() => {
this.showPopover(this.templateEmployee, this.employee.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showDefineWorkingDays === true) {
if (this.configurationWizardService.showDefineWorkingDays) {
setTimeout(() => {
this.showPopover(this.templateWorkingDays, this.workingDays.nativeElement, 'bottom', true);
});
}
if (this.configurationWizardService.showManageFunds === true) {
if (this.configurationWizardService.showManageFunds) {
setTimeout(() => {
this.showPopover(this.templateManageFunds, this.manageFunds.nativeElement, 'bottom', true);
});
@@ -75,7 +75,7 @@ export class PasswordPreferencesComponent implements OnInit {
*/
setPasswordPreferencesForm() {
for (const passwordPreference of this.passwordPreferencesData) {
if (passwordPreference.active === true) {
if (passwordPreference.active) {
this.passwordPreferencesForm.get('validationPolicyId').setValue(passwordPreference.id);
}
}
@@ -153,7 +153,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
}
workingDays.recurrence = recurrence;
this.organizationService.updateWorkingDays(workingDays).subscribe((response) => {
if (this.configurationWizardService.showDefineWorkingDays === true) {
if (this.configurationWizardService.showDefineWorkingDays) {
this.configurationWizardService.showDefineWorkingDays = false;
this.openNextStepDialog();
} else {
@@ -182,7 +182,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit {
* To show popover.
*/
ngAfterViewInit() {
if (this.configurationWizardService.showDefineWorkingDays === true) {
if (this.configurationWizardService.showDefineWorkingDays) {
setTimeout(() => {
this.showPopover(this.templateWorkingDaysFormRef, this.workingDaysFormRef.nativeElement, 'right', true);
});