File

app/shared/constants/constants.service.ts

Index

Properties
Methods

Methods

Public getCountry
getCountry(language)

Return default country publication for a given language.

Parameters :
Name Optional
language No
Returns : any
Public getTimezone
getTimezone(zone)
Parameters :
Name Optional
zone No
Returns : any

Properties

Public Readonly BOOTSTRAP_BREAKPOINTS
Type : object
Default value : { XS: 0, SM: 575, MD: 768, LG: 1024, XL: 1440, XXL: 1600 }
Public Readonly BOOTSTRAP_CLASSES_FOR_DXA_ENTITIES
Type : object
Default value : { MAIN: { BodyText: 'col-md-8', BodyTextIntro: 'col-md-12', RelatedLinksLightGreyMain: 'col-md-4', RelatedLinksSequenceMain: 'col-md-12', RelatedInfoMain: 'col-md-12', RelatedInfoLightGreyMain: 'col-md-12', ProductInfoMain: 'col-md-12', HighlightedContentLeftImageMain: 'col-md-12', HighlightedContentRightImageMain: 'col-md-12', HighlightedContentLeftImageFiftyFiftyMain: 'col-md-12', HighlightedContentRightImageFiftyFiftyMain: 'col-md-12', HighlightedContent25PercentWhiteMain: 'col-md-12', HighlightedContent25PercentLightGreyMain: 'col-md-12', HighlightedContentWithoutImage: 'col-md-4', ShortcutsMain: 'col-md-12', SearchBasedContent: 'col-md-12', NewsItem2Main: 'col-md-8', TopBannerMain: 'col-md-12', ProductSpecMain: 'col-md-12', BodyTextExpandable: 'col-md-8', SliderMain: 'col-md-12', HierarchyCardsHorizontal: 'col-md-12', HierarchyCardsVertical: 'col-md-4', DistOfficeSearchMain: 'col-md-12', DistributorSearchList: 'col-md-12', TabMain: 'col-md-12', NewsItemsSliderMain: 'col-md-12', ToolMain: 'col-md-12', MediaKitMain: 'col-md-12', MediaKitVerticalMain: 'col-md-4', SiteSearchResultsMain: 'col-md-12', ToolsCollectionMain: 'col-md-12', DistOfficeSearchWidgetWhiteMain: 'col-md-12', DistOfficeSearchWidgetLightGreyMain: 'col-md-12', ProductConfigMain: 'col-md-8', EmbeddedExternalVideoMain: 'col-md-8', MyProfileMain: 'col-md-12' }, TOP: { BodyText: 'col-md-8', PageDetails: this.PageDetailsClass, PageDetailsHorizontal: this.PageDetailsHorizontal, RelatedLinksTop: 'col-md-4', TopBannerTop: 'col-md-12', TopBannerWSearchTop: 'col-md-12', TopBannerWSearchLargeTop: 'col-md-12' }, HEADER: { PageDetails: this.PageDetailsClass, PageDetailsHorizontal: this.PageDetailsHorizontal, PageDetailsProfile: 'col-md-8' }, FOOTER: { RelatedLinksFooter: 'col-md-4', RelatedLinksFooterSide: 'col-md-4', RelatedLinksFooterSole: 'col-md-12', SocialMediaFooterSide: 'col-md-12' } }
Public Readonly CALCULATE_BEARING_URL
Type : string
Default value : 'https://skfbearingselect.com'
Public Readonly COMPONENT_ID_PREFIX
Type : string
Default value : 'cid'
Public Readonly CONTACT_US
Type : string
Default value : '/support/contact-us/index'
Public Readonly CONTENT_URL_PREFIX
Type : string
Default value : 'content'
Public Readonly DOWNLOAD_ZIPFILE_HANDLER
Type : string
Default value : 'downloadBinary'
Public Readonly FULL_WIDTH_COMPONENTS
Type : []
Default value : [ 'ShortcutsMain', 'ToolMain', 'TopBannerTop', 'TopBannerMain', 'TopBannerWSearchTop', 'TopBannerWSearchLargeTop', 'SliderMain', 'NewsItemsSliderMain', 'HighlightedContent25PercentWhiteMain', 'HighlightedContent25PercentLightGreyMain', 'MediaKitMain', 'RelatedLinksFooterSole', 'TabMain', 'SiteSearchResultsMain', 'PageDetailsProfile', 'ToolsCollectionMain', 'RelatedInfoMain', 'RelatedInfoLightGreyMain', 'MyProfileMain' ]
Private languageToCountry
Type : object
Default value : { 'en': '/beta-uk', // 'fr': '/fr', // 'es': '/es', // 'pt': '/br', // 'de': '/de', // 'cs': '/cz', // 'pl': '/pl', // 'ru': '/ru', // 'zh': '/cn' }

Language to country mapping, used for OPC shortlink. Add language when publication is rolled out.

Public Readonly MEASUREMENT_SYSTEM_CACHE_KEY
Type : string
Default value : 'MEASURE_SYSTEM'
Public Readonly MYSKF_PATH
Type : string
Default value : '/system-pages/myskf'
Public Readonly PageDetailsClass
Type : string
Default value : 'col-md-12'
Public Readonly PageDetailsHorizontal
Type : string
Default value : 'col-md-12'
Public Readonly SITE_SEARCH_URL
Type : string
Default value : '/search-results'
Private Readonly TIMEZONE_MAP
Type : object
Default value : { 'australian eastern standard time': 'AEST', 'argentina time': 'ART', 'atlantic standard time': 'AST', 'brasilia time': 'BRT', 'central africa time': 'CAT', 'central european summer time': 'CEST', 'central european time': 'CET', 'chile standard time': 'CST', 'colombia time': 'COT', 'central standard time': 'CST', 'china standard time': 'CST', 'eastern standard time': 'EST', 'greenwich mean time': 'GMT', 'india standard time': 'IST', 'japan standard time': 'JST', 'korea standard ime': 'KST', 'moscow standard time': 'MSK', 'mountain standard time': 'MST', 'newfoundland standard time': 'NST', 'new zealand standard ime': 'NZST', 'peru time': 'PET', 'pakistan standard time': 'PKT', 'pacific standard time': 'PST', 'south africa standard time': 'SAST', 'singapore time': 'SGT', 'uruguay time': 'UYT', 'venezuelan standard time': 'VET', 'west africa time': 'WAT', 'western european time': 'WET' }
Public Readonly VIDEO_PLAYER_PREVIEW_IMG
Type : string
Default value : 'v2/assets/img/default-amp-preview.png'
import { Injectable } from '@angular/core';
@Injectable()
export class ConstantsService {

	public readonly CONTENT_URL_PREFIX = 'content';
	public readonly DOWNLOAD_ZIPFILE_HANDLER = 'downloadBinary';
	public readonly COMPONENT_ID_PREFIX = 'cid';


	public readonly VIDEO_PLAYER_PREVIEW_IMG = 'v2/assets/img/default-amp-preview.png';
	public readonly MEASUREMENT_SYSTEM_CACHE_KEY = 'MEASURE_SYSTEM';

	public readonly SITE_SEARCH_URL = '/search-results';
	public readonly MYSKF_PATH = '/system-pages/myskf';

	public readonly CALCULATE_BEARING_URL = 'https://skfbearingselect.com';

	public readonly CONTACT_US = '/support/contact-us/index';


	// This is a special case for the page details if it is used within the top region
	public readonly PageDetailsClass = 'col-md-12';
	public readonly PageDetailsHorizontal = 'col-md-12';

	public readonly BOOTSTRAP_BREAKPOINTS = {
		XS: 0,
		SM: 575,
		MD: 768,
		LG: 1024,
		XL: 1440,
		XXL: 1600
	};

	public readonly BOOTSTRAP_CLASSES_FOR_DXA_ENTITIES = {
		MAIN: {
			BodyText: 'col-md-8',
			BodyTextIntro: 'col-md-12',
			RelatedLinksLightGreyMain: 'col-md-4',
			RelatedLinksSequenceMain: 'col-md-12',
			RelatedInfoMain: 'col-md-12',
			RelatedInfoLightGreyMain: 'col-md-12',
			ProductInfoMain: 'col-md-12',
			HighlightedContentLeftImageMain: 'col-md-12',
			HighlightedContentRightImageMain: 'col-md-12',
			HighlightedContentLeftImageFiftyFiftyMain: 'col-md-12',
			HighlightedContentRightImageFiftyFiftyMain: 'col-md-12',
			HighlightedContent25PercentWhiteMain: 'col-md-12',
			HighlightedContent25PercentLightGreyMain: 'col-md-12',
			HighlightedContentWithoutImage: 'col-md-4',
			ShortcutsMain: 'col-md-12',
			SearchBasedContent: 'col-md-12',
			NewsItem2Main: 'col-md-8',
			TopBannerMain: 'col-md-12',
			ProductSpecMain: 'col-md-12',
			BodyTextExpandable: 'col-md-8',
			SliderMain: 'col-md-12',
			HierarchyCardsHorizontal: 'col-md-12',
			HierarchyCardsVertical: 'col-md-4',
			DistOfficeSearchMain: 'col-md-12',
			DistributorSearchList: 'col-md-12',
			TabMain: 'col-md-12',
			NewsItemsSliderMain: 'col-md-12',
			ToolMain: 'col-md-12',
			MediaKitMain: 'col-md-12',
			MediaKitVerticalMain: 'col-md-4',
			SiteSearchResultsMain: 'col-md-12',
			ToolsCollectionMain: 'col-md-12',
			DistOfficeSearchWidgetWhiteMain: 'col-md-12',
			DistOfficeSearchWidgetLightGreyMain: 'col-md-12',
			ProductConfigMain: 'col-md-8',
			EmbeddedExternalVideoMain: 'col-md-8',
			MyProfileMain: 'col-md-12'
		},
		TOP: {
			BodyText: 'col-md-8',
			PageDetails: this.PageDetailsClass,
			PageDetailsHorizontal: this.PageDetailsHorizontal,
			RelatedLinksTop: 'col-md-4',
			TopBannerTop: 'col-md-12',
			TopBannerWSearchTop: 'col-md-12',
			TopBannerWSearchLargeTop: 'col-md-12'
		},
		HEADER: {
			PageDetails: this.PageDetailsClass,
			PageDetailsHorizontal: this.PageDetailsHorizontal,
			PageDetailsProfile: 'col-md-8'
		},
		FOOTER: {
			RelatedLinksFooter: 'col-md-4',
			RelatedLinksFooterSide: 'col-md-4',
			RelatedLinksFooterSole: 'col-md-12',
			SocialMediaFooterSide: 'col-md-12'
		}
	};

	public readonly FULL_WIDTH_COMPONENTS = [
		'ShortcutsMain',
		'ToolMain',
		'TopBannerTop',
		'TopBannerMain',
		'TopBannerWSearchTop',
		'TopBannerWSearchLargeTop',
		'SliderMain',
		'NewsItemsSliderMain',
		'HighlightedContent25PercentWhiteMain',
		'HighlightedContent25PercentLightGreyMain',
		'MediaKitMain',
		'RelatedLinksFooterSole',
		'TabMain',
		'SiteSearchResultsMain',
		'PageDetailsProfile',
		'ToolsCollectionMain',
		'RelatedInfoMain',
		'RelatedInfoLightGreyMain',
		'MyProfileMain'
	];

	private readonly TIMEZONE_MAP = {
		'australian eastern standard time': 'AEST',
		'argentina time': 'ART',
		'atlantic standard time': 'AST',
		'brasilia time': 'BRT',
		'central africa time': 'CAT',
		'central european summer time': 'CEST',
		'central european time': 'CET',
		'chile standard time': 'CST',
		'colombia time': 'COT',
		'central standard time': 'CST',
		'china standard time': 'CST',
		'eastern standard time': 'EST',
		'greenwich mean time': 'GMT',
		'india standard time': 'IST',
		'japan standard time': 'JST',
		'korea standard ime': 'KST',
		'moscow standard time': 'MSK',
		'mountain standard time': 'MST',
		'newfoundland standard time': 'NST',
		'new zealand standard ime': 'NZST',
		'peru time': 'PET',
		'pakistan standard time': 'PKT',
		'pacific standard time': 'PST',
		'south africa standard time': 'SAST',
		'singapore time': 'SGT',
		'uruguay time': 'UYT',
		'venezuelan standard time': 'VET',
		'west africa time': 'WAT',
		'western european time': 'WET'
	};

	/** Language to country mapping, used for OPC shortlink. Add language when publication is rolled out. */
	private languageToCountry = {
		'en': '/beta-uk',
		// 'fr': '/fr',
		// 'es': '/es',
		// 'pt': '/br',
		// 'de': '/de',
		// 'cs': '/cz',
		// 'pl': '/pl',
		// 'ru': '/ru',
		// 'zh': '/cn'
	};

	public getTimezone(zone) {
		const tz = zone.toLowerCase();
		return this.TIMEZONE_MAP[tz] || zone;
	}

	/** Return default country publication for a given language. */
	public getCountry(language) {
		const country = this.languageToCountry[language];
		// Default to english if language doesn't exist.
		if (!country) {
			return this.languageToCountry['en'];
		}

		return country;
	}
}

result-matching ""

    No results matching ""