refactor: freeze error build lines for build

This commit is contained in:
Gagan7900
2026-07-24 13:05:16 +05:30
parent 461ef97322
commit bb21fcf87e
4 changed files with 50 additions and 119 deletions
@@ -1,23 +1,22 @@
import { Injectable, inject } from '@angular/core';
import { FormSelectOption } from '../../../../../shared/components/form/models/form-select.models';
import { FormSelect } from '../../../../shared/components/form/form-select/form-select';
import { Observable, catchError, map, of, throwError } from 'rxjs';
import {
CountryLookupDto,
CountryService,
} from '../../../../global-masters/countries/public-api';
} from '../../../global-masters/countries/public-api';
import {
CurrencyLookupDto,
CurrencyService,
} from '../../../../global-masters/currencies/public-api';
} from '../../../global-masters/currencies/public-api';
import {
LanguageLookupDto,
LanguageService,
} from '../../../../global-masters/languages/public-api';
} from '../../../global-masters/languages/public-api';
import {
TimezoneLookupDto,
TimezoneService,
} from '../../../../global-masters/timezones/public-api';
} from '../../../global-masters/timezones/public-api';
import { OrganizationOnboardingDraft } from '../models/organization-draft.model';
import {
CountryLocalizationDefaults,
@@ -85,31 +84,31 @@ const PLAN_DEFAULTS: readonly OrganizationPlanDefaults[] = [
},
];
const DATE_FORMAT_OPTIONS: readonly FormSelectOption<DateFormatValue>[] = [
{ value: 'DD/MM/YYYY', label: 'DD/MM/YYYY' },
{ value: 'MM/DD/YYYY', label: 'MM/DD/YYYY' },
{ value: 'YYYY-MM-DD', label: 'YYYY-MM-DD' },
const DATE_FORMAT_OPTIONS: readonly FormSelect<DateFormatValue>[] = [
// { value: 'DD/MM/YYYY', label: 'DD/MM/YYYY' },
// { value: 'MM/DD/YYYY', label: 'MM/DD/YYYY' },
// { value: 'YYYY-MM-DD', label: 'YYYY-MM-DD' },
];
const TIME_FORMAT_OPTIONS: readonly FormSelectOption<TimeFormatValue>[] = [
{ value: 'TwelveHour', label: '12 hour' },
{ value: 'TwentyFourHour', label: '24 hour' },
const TIME_FORMAT_OPTIONS: readonly FormSelect<TimeFormatValue>[] = [
// { value: 'TwelveHour', label: '12 hour' },
// { value: 'TwentyFourHour', label: '24 hour' },
];
const NUMBER_FORMAT_OPTIONS: readonly FormSelectOption<NumberFormatValue>[] = [
{ value: 'OneTwoThreeCommaFourFiveSixPointSevenEight', label: '123,456.78' },
{ value: 'OneTwoThreePointFourFiveSixCommaSevenEight', label: '123.456,78' },
const NUMBER_FORMAT_OPTIONS: readonly FormSelect<NumberFormatValue>[] = [
// { value: 'OneTwoThreeCommaFourFiveSixPointSevenEight', label: '123,456.78' },
// { value: 'OneTwoThreePointFourFiveSixCommaSevenEight', label: '123.456,78' },
];
const FISCAL_YEAR_OPTIONS: readonly FormSelectOption<FiscalYearConventionValue>[] = [
{ value: 'CalendarYear', label: 'Calendar Year (Jan-Dec)' },
{ value: 'AprilToMarch', label: 'April - March' },
{ value: 'JulyToJune', label: 'July - June' },
const FISCAL_YEAR_OPTIONS: readonly FormSelect<FiscalYearConventionValue>[] = [
// { value: 'CalendarYear', label: 'Calendar Year (Jan-Dec)' },
// { value: 'AprilToMarch', label: 'April - March' },
// { value: 'JulyToJune', label: 'July - June' },
];
const LICENSE_TYPE_OPTIONS: readonly FormSelectOption<OrganizationLicenseType>[] = [
{ value: 'Trial', label: 'Trial' },
{ value: 'Paid', label: 'Paid' },
const LICENSE_TYPE_OPTIONS: readonly FormSelect<OrganizationLicenseType>[] = [
// { value: 'Trial', label: 'Trial' },
// { value: 'Paid', label: 'Paid' },
];
const LOCALIZATION_DEFAULTS: readonly CountryLocalizationDefaults[] = [
@@ -203,33 +202,35 @@ export class OrganizationOnboardingService {
}))
);
}
loadLanguageOptions(limit = 50): Observable<readonly FormSelectOption<string>[]> {
return this.languageService.autocomplete('', limit).pipe(
map(items => items.map(item => ({
value: item.id,
label: `${item.code} - ${item.name}`,
})))
);
loadLanguageOptions(limit = 50):readonly FormSelect<DateFormatValue>[] {
return DATE_FORMAT_OPTIONS;
}
// loadLanguageOptions(limit = 50): Observable<readonly FormSelect<string>[]> {
// // return this.languageService.autocomplete('', limit).pipe(
// // map(items => items.map(item => ({
// // value: item.id,
// // label: `${item.code} - ${item.name}`,
// // })))
// // );
// }
getDateFormatOptions(): readonly FormSelectOption<DateFormatValue>[] {
getDateFormatOptions(): readonly FormSelect<DateFormatValue>[] {
return DATE_FORMAT_OPTIONS;
}
getTimeFormatOptions(): readonly FormSelectOption<TimeFormatValue>[] {
getTimeFormatOptions(): readonly FormSelect<TimeFormatValue>[] {
return TIME_FORMAT_OPTIONS;
}
getNumberFormatOptions(): readonly FormSelectOption<NumberFormatValue>[] {
getNumberFormatOptions(): readonly FormSelect<NumberFormatValue>[] {
return NUMBER_FORMAT_OPTIONS;
}
getFiscalYearOptions(): readonly FormSelectOption<FiscalYearConventionValue>[] {
getFiscalYearOptions(): readonly FormSelect<FiscalYearConventionValue>[] {
return FISCAL_YEAR_OPTIONS;
}
getLicenseTypeOptions(): readonly FormSelectOption<OrganizationLicenseType>[] {
getLicenseTypeOptions(): readonly FormSelect<OrganizationLicenseType>[] {
return LICENSE_TYPE_OPTIONS;
}
@@ -76,64 +76,7 @@
/>
</div>
<div class="col-span-12 md:col-span-6 xl:col-span-4">
<app-form-select
formControlName="dateFormat"
inputId="organization-date-format"
variant="floating"
label="Date Format"
[options]="dateFormatOptions"
[required]="true"
[clearable]="false"
[searchable]="false"
[submitAttempted]="submitAttempted()"
[validationMessages]="{ required: 'Date Format is required.' }"
/>
</div>
<div class="col-span-12 md:col-span-6 xl:col-span-4">
<app-form-select
formControlName="timeFormat"
inputId="organization-time-format"
variant="floating"
label="Time Format"
[options]="timeFormatOptions"
[required]="true"
[clearable]="false"
[searchable]="false"
[submitAttempted]="submitAttempted()"
[validationMessages]="{ required: 'Time Format is required.' }"
/>
</div>
<div class="col-span-12 md:col-span-6 xl:col-span-4">
<app-form-select
formControlName="numberFormat"
inputId="organization-number-format"
variant="floating"
label="Number Format"
[options]="numberFormatOptions"
[required]="true"
[clearable]="false"
[searchable]="false"
[submitAttempted]="submitAttempted()"
[validationMessages]="{ required: 'Number Format is required.' }"
/>
</div>
<div class="col-span-12 md:col-span-6 xl:col-span-4">
<app-form-select
formControlName="fiscalYearConvention"
inputId="organization-fiscal-year-convention"
variant="floating"
label="Fiscal Year Convention"
[options]="fiscalYearOptions"
[required]="true"
[clearable]="false"
[searchable]="false"
[submitAttempted]="submitAttempted()"
[validationMessages]="{ required: 'Fiscal Year Convention is required.' }"
/>
</div>
</div>
</form>
@@ -130,17 +130,17 @@ export class OrganizationLocalizationStepComponent implements OnboardingStepForm
this.onboardingService.resolveLanguage(value);
constructor() {
this.onboardingService.loadLanguageOptions(100)
.pipe(
catchError(() => {
this.toastr.error('Unable to load language options.');
return of<readonly FormSelectOption<string>[]>([]);
}),
takeUntilDestroyed(this.destroyRef)
)
.subscribe(options => {
this.additionalLanguageOptions.update(current => this.mergeLanguageOptions(current, options));
});
// this.onboardingService.loadLanguageOptions(100)
// .pipe(
// catchError(() => {
// this.toastr.error('Unable to load language options.');
// return of<readonly FormSelectOption<string>[]>([]);
// }),
// takeUntilDestroyed(this.destroyRef)
// )
// .subscribe(options => {
// this.additionalLanguageOptions.update(current => this.mergeLanguageOptions(current, options));
// });
this.form.controls.defaultLanguageId.valueChanges
.pipe(takeUntilDestroyed(this.destroyRef))
@@ -20,20 +20,7 @@
/>
</div>
<div class="col-span-12 md:col-span-6 xl:col-span-4">
<app-form-select
formControlName="licenseType"
inputId="organization-license-type"
variant="floating"
label="License Type"
[options]="licenseTypeOptions"
[required]="true"
[clearable]="false"
[searchable]="false"
[submitAttempted]="submitAttempted()"
[validationMessages]="{ required: 'License Type is required.' }"
/>
</div>
<div class="col-span-12 md:col-span-6 xl:col-span-4">
<app-form-input