Skip to content

AppSettings

reference
5 min readUpdated

Kind: Class

Source: Frontend/src/app/settings/app/app.settings.ts (line 241)

Part of: Frontend

AppSettings groups application settings helpers for origin URL access, forbidden-character validation, and date handling. It is used by frontend code that needs consistent date values for data-grid filters and time-zone adjustments.

Methods

MethodSignatureReturns
getOriginUrlgetOriginUrl()void
ifForbiddenCharactersifForbiddenCharacters(filterObject: any)boolean
checkingForForbiddenCharacterscheckingForForbiddenCharacters(filterObject: any)boolean
adjustDateForDataGridFilterIsDateColumnadjustDateForDataGridFilterIsDateColumn(date: Date)void
checkIfDataGridFilterIsDateColumncheckIfDataGridFilterIsDateColumn(filterObject: any, gridInstance: any)any
normalizeDatenormalizeDate(dateString: string)Date
addTimeZoneToDateaddTimeZoneToDate(date: Date)void
addTimeZoneToDateEnhancedaddTimeZoneToDateEnhanced(date: Date)string
subtractTimeZoneToDatesubtractTimeZoneToDate(date: Date)void
subtractTimeZoneToDateEnhancedsubtractTimeZoneToDateEnhanced(date: Date)void
isMeDeveloperisMeDeveloper()boolean
ifShotecCompanyifShotecCompany()void
if_ShotecSAE_ServiceCenter_Branchesif_ShotecSAE_ServiceCenter_Branches(BranchId: undefined)boolean
leavePageleavePage()void
CalculateSizeCalculateSize(offset: number)void
setYearsColorForDashboardsetYearsColorForDashboard(year: number)string
GetPrecentageGetPrecentage(val: undefined, total_val: undefined)void
getUserSignaturegetUserSignature(BranchLogo: undefined)string
checkEqualitycheckEquality(source: any, target: any, pro: string, CalculatedFields: any[])boolean
DataChangedDataChanged(source: any, target: any, CalculatedFields: any[])boolean
calculateMonthsBeforeTodaycalculateMonthsBeforeToday(year: number, monthIndex: number)number
formatDateformatDate(e: Date)void
formatDateTimeformatDateTime(e: Date)void
ConvertDateToStringConvertDateToString(dateX: Date)string
ConvertDateToStringEUConvertDateToStringEU(dateX: Date)string
ConvertStringToDateConvertStringToDate(data: string)Date
ConvertStringToDateEUConvertStringToDateEU(data: string)Date
NumeralConversionDefaultNumeralConversionDefault(data: undefined, format: undefined)string
NumeralConversionForRateNumeralConversionForRate(data: undefined, format: undefined)string
NumeralConversionNumeralConversion(data: undefined, format: undefined, currency: undefined)string
NumeralUnConversionNumeralUnConversion(data: undefined)number
returnDecimalDigitsreturnDecimalDigits(numOfDigits: number)string
getDecimalDigitsgetDecimalDigits(value: number)string
convertHtmlToTextconvertHtmlToText(html: string)string
ParseErrorParseError(error: any)string
UlitizeTimeUlitizeTime(i: number, Sperator: string, title: string)void
calculateTimePeriodcalculateTimePeriod(periodId: number)number
returnTimePeriodForMomentreturnTimePeriodForMoment(periodId: number)string
setCookiesetCookie(cName: undefined, cValue: undefined, expDays: undefined)void
getCookiegetCookie(cName: undefined)void
deleteCookiedeleteCookie(cName: string)void
saveLocalStoragesaveLocalStorage()void
ifSavePamsStorageifSavePamsStorage()boolean
ifSaveUserLoggedInStorageifSaveUserLoggedInStorage()boolean
readPamsLocalStoragereadPamsLocalStorage()void
readUserLoggedInLocalStoragereadUserLoggedInLocalStorage()void
clearLocalStorageclearLocalStorage()void
ifStorageUpdatedifStorageUpdated()boolean
initializeGridDefaultsinitializeGridDefaults()void
save2WayAuthenticationLocalStoragesave2WayAuthenticationLocalStorage()void

Properties

PropertyType
APIUrlany
APIOneDriveUrlany
OriginFrontURLany
sendMailMSALDirectionany
AppVersionNumberany
AppVersionany
BuildHashany
AppNameany
PoweredByCompanyany
bottomActionBarany
ImgPathany
MainPageRouteany
API_ProjectProcessWorkflowTypeControllerany
API_CategoryControllerany
API_ProductControllerany
API_ProductVariantControllerany
API_ProductSubSupplierControllerany
API_AuthControllerany
API_UnitControllerany
API_CountryControllerany
API_Activitiesany
API_ActivitiesLookupsany
API_CompanyCurrencyControllerany
API_OfferControllerany
API_OfferItemControllerany
API_ItemControllerany
API_TimePeriodControllerany
API_NewTimePeriodany
API_OfferMileStoneControllerany
API_OfferItemVersionControllerany
API_InquiryControllerany
API_GuaranteeTypeControllerany
API_JobGuaranteeControllerany
API_CurrencyControllerany
API_ContactInfoTypesControllerany
API_ContactInfoRelatedTypeControllerany
API_JobProcessControllerany
API_JobItemControllerany
API_JobVersionControllerany
API_CityControllerany
API_GovernateControllerany
API_SerialStatusControllerany
API_SerialCombinationsControllerany
API_SerialComponentsControllerany
API_SerialTypeControllerany
API_PaymentMethodControllerany
API_DeliveryTermControllerany
API_ClientsControllerany
API_PersonControllerany
API_ClientTypesControllerany

Where it refuses work

  • AppSettings stops the work with an early return when !filterObject, in 2 places.
  • AppSettings stops the work with an early return when AppSettings.checkingForForbiddenCharacters(item).
  • AppSettings stops the work with an early return when this.checkingForForbiddenCharacters(filterObject).
  • AppSettings stops the work with an early return when filterObjectAsString.includes(char).
  • AppSettings stops the work with an early return when Array.isArray(filterObject).
  • AppSettings stops the work with an early return when item.columnIndex !== undefined && gridInstance.

When something fails

  • AppSettings handles failure in 3 places: it logs it and continues in all 3.

Diagram

mermaid
graph LR
  AppSettings --> Origin[getOriginUrl]
  AppSettings --> Validation[ifForbiddenCharacters]
  AppSettings --> ValidationCheck[checkingForForbiddenCharacters]
  AppSettings --> GridDate[adjustDateForDataGridFilterIsDateColumn]
  GridDate --> DateColumn[checkIfDataGridFilterIsDateColumn]
  AppSettings --> DateNormalization[normalizeDate]
  AppSettings --> TimeZone[addTimeZoneToDate]
  TimeZone --> EnhancedAdd[addTimeZoneToDateEnhanced]
  AppSettings --> TimeZoneSubtract[subtractTimeZoneToDate]
  TimeZoneSubtract --> EnhancedSubtract[subtractTimeZoneToDateEnhanced]

Usage

ts
import { AppSettings } from './app.settings';

const appSettings = new AppSettings();

const originUrl = appSettings.getOriginUrl();
const hasForbiddenCharacters = appSettings.ifForbiddenCharacters();

const normalizedDate: Date = appSettings.normalizeDate();
const dateWithTimeZone = appSettings.addTimeZoneToDateEnhanced();

if (!hasForbiddenCharacters) {
  appSettings.adjustDateForDataGridFilterIsDateColumn();
}

console.log({ originUrl, normalizedDate, dateWithTimeZone });

AI Coding Instructions

  • Keep date conversion logic inside AppSettings so data-grid filters use the same date handling path.
  • Check forbidden-character methods before sending user-entered values to API or filter code.
  • Use normalizeDate() when a caller requires a Date value.
  • Use the enhanced time-zone methods when the caller requires a string result.
  • Verify date-column detection through checkIfDataGridFilterIsDateColumn() before applying data-grid date adjustments.

Relationships

  • CALLS → FilesController
  • CALLS → MarketSegmentController
  • CALLS → CategoryController
  • CALLS → ProductController
  • CALLS → ProductVariantController
  • CALLS → ProductSupplierController
  • CALLS → UnitController
  • CALLS → CountryController
  • CALLS → ActivitiesController
  • CALLS → VisitPurposeController
  • CALLS → CompanyCurrencyController
  • CALLS → OfferController
  • CALLS → ItemController
  • CALLS → TimePeriodController
  • CALLS → SalesJobController
  • CALLS → OfferMileStoneController
  • CALLS → InquiryController
  • CALLS → GuaranteeTypesController
  • CALLS → JobGuaranteesController
  • CALLS → CurrencyController
  • CALLS → ContactInfoTypeController
  • CALLS → ContactInfoRelatedTypeController
  • CALLS → JobProcessController
  • CALLS → JobItemController
  • CALLS → JobVersionController
  • CALLS → CityController
  • CALLS → GovernateController
  • CALLS → SerialStatusController
  • CALLS → SerialCombinationsController
  • CALLS → SerialComponentsController
  • CALLS → SerialTypeController
  • CALLS → PaymentMethodController
  • CALLS → DeliveryTermController
  • CALLS → PersonController
  • CALLS → ClientTypeController
  • CALLS → SupplierTypeController
  • CALLS → PersonEmailController
  • CALLS → PersonPhoneController
  • CALLS → CompanyBranchContactInfoController
  • CALLS → ContactInfoController
  • CALLS → CompanyBranchController
  • CALLS → StoreController
  • CALLS → StoreAreaController
  • CALLS → WarehouseModelController
  • CALLS → ReceivingShipmentController
  • CALLS → InspectionSheetController
  • CALLS → InspectionBaseController
  • CALLS → TransferOrderReasonController
  • CALLS → ExternalServiceTypeController
  • CALLS → ProductWithdrawalController
  • CALLS → BookingProductController
  • CALLS → StoreProductController
  • CALLS → ShippingOrderController
  • CALLS → ProductionOrderController
  • CALLS → IssuingGoodsController
  • CALLS → ReturnNoteController
  • CALLS → DeliveryNoteController
  • CALLS → ExternalServiceController
  • CALLS → TransferOrderController
  • CALLS → BankController
  • CALLS → BankAccountController
  • CALLS → CompanyController
  • CALLS → AddressController
  • CALLS → AddressTypeController
  • CALLS → CompanyBranchSettingController
  • CALLS → ProcessReasonController
  • CALLS → InquiryTypesController
  • CALLS → OfferStatusController
  • CALLS → OrderChanceController
  • CALLS → OrderStatusController
  • CALLS → JobListLayoutController
  • CALLS → DefaultJobListLayoutController
  • CALLS → ProductTypeController
  • CALLS → MRQProductTypeController
  • CALLS → BookingTargetController
  • CALLS → ForecastedBookingController
  • CALLS → TeamTargetController
  • CALLS → PrincipalTargetController
  • CALLS → AccountManagerTargetController
  • CALLS → ProductTypeTargetController
  • CALLS → FinanceBudgetController
  • CALLS → ProductTypeGroupController
  • CALLS → NationalityController
  • CALLS → EmployeeTypesController
  • CALLS → MaritalStatusController
  • CALLS → CompanyBranchDepartmentController
  • CALLS → ProjectCommentController
  • CALLS → ProjectRegisteredController
  • CALLS → ShareholdersController
  • CALLS → ContactPersonController
  • CALLS → ContactPersonReferenceController
  • CALLS → ContactPersonRelatedTypeController
  • CALLS → RegistrationStatusController
  • CALLS → DataSourceController
  • CALLS → DashboardController
  • CALLS → DashboardDataController
  • CALLS → OrderActivationConditionController
  • CALLS → MyDeskController
  • CALLS → ReactivationReasonsController
  • CALLS → DefaultSerialStatusController
  • CALLS → ConnectionTypeController
  • CALLS → MailToController
  • CALLS → NotificationController
  • CALLS → NotificationTypeController
  • CALLS → ReminderController
  • CALLS → SytemNotificationController
  • CALLS → SentEmailsController
  • CALLS → TimeUnitTypeController
  • CALLS → UserEmailSettingController
  • CALLS → AssigneeController
  • CALLS → AssigneeAccessTypeController
  • CALLS → PriorityController
  • CALLS → StatusController
  • CALLS → TaskController
  • CALLS → CommentsController
  • CALLS → FileCategoryController
  • CALLS → RelatedToTypesController
  • CALLS → TagsController
  • CALLS → ClientDelayController
  • CALLS → DashboardWidgetController
  • CALLS → AccountsController
  • CALLS → ProductCategoryController
  • CALLS → PersonUserController
  • CALLS → RoleController
  • CALLS → PersonTypeController
  • CALLS → PermissionController
  • CALLS → RolePermissionsController
  • CALLS → JobVersionStatusLogController
  • CALLS → JobItemStatusController
  • CALLS → JobItemStatusDataController
  • CALLS → ProjectController
  • CALLS → ProjectStatusController
  • CALLS → JobDocumentController
  • CALLS → InvoiceController
  • CALLS → UpcomingInvoiceController
  • CALLS → PaymentController
  • CALLS → ImportController
  • CALLS → LetterOfGuaranteeController
  • CALLS → PmSerialCombinationController
  • CALLS → BillOfMaterialController
  • CALLS → MaterialsRequisitionController
  • CALLS → MRQJobController
  • CALLS → MRQJobInquiryController
  • CALLS → MRQJobOfferController
  • CALLS → MRQJobOrderController
  • CALLS → MRQJobProductController
  • CALLS → SalesPotentialController
  • CALLS → SalesFollowerController
  • CALLS → SalesPotentialStatusController
  • CALLS → SalesOfferController
  • CALLS → SalesOrderController
  • CALLS → SalesItemController
  • CALLS → CustomFieldController
  • CALLS → PrincipalInvoicePaymentController
  • CALLS → PrincipalPaymentController
  • CALLS → PrincipalDeductionController
  • CALLS → UpcomingPrincipalInvoiceController
  • CALLS → PurchasingJobController
  • CALLS → purchasingInquiryController
  • CALLS → PurchasingOfferController
  • CALLS → PurchasingOrderController
  • CALLS → PurchasingItemController
  • CALLS → PurchasePaymentMilestoneController
  • CALLS → PmPaymentMilestoneController
  • CALLS → WordTemplateController
  • CALLS → AuditController
  • CALLS → ColorMarkerController
  • CALLS → ClientProfileController
  • CALLS → CustomerSurveyController
  • CALLS → ReferenceListController
  • CALLS → CostCalculationController
  • CALLS → SalesJobCostController

Used by

554 references from 554 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (554)

  • AppRoutingModuleFrontend/src/app/app-routing.module.ts:1
  • AppComponentFrontend/src/app/app.component.ts:1
  • TranslateHandlerFrontend/src/app/app.module.ts:1
  • MrqDetailsComponentFrontend/src/app/components/MRQ/mrq-details/mrq-details.component.ts:1
  • MrqInquiryComponentFrontend/src/app/components/MRQ/mrq-details/mrq-inquiry/mrq-inquiry.component.ts:1
  • MrqListComponentFrontend/src/app/components/MRQ/mrq-list/mrq-list.component.ts:1
  • MrqServiceFrontend/src/app/components/MRQ/mrq.service.ts:1
  • BillOfMaterialsDetailsComponentFrontend/src/app/components/bill-of-materials/bill-of-materials-details/bill-of-materials-details.component.ts:1

…and 546 more.

Was this page helpful?

Download as PDF