{"version":3,"sources":["./src/$_lazy_route_resource lazy namespace object","./src/app/adminTiles/AdminLandingService.ts","./src/app/adminTiles/adminTile.action.ts","./src/app/adminTiles/adminTile.action.types.ts","./src/app/adminTiles/adminTiles.reducer.ts","./src/app/banner/FxpMessageService.ts","./src/app/banner/banner.action.ts","./src/app/banner/banner.action.types.ts","./src/app/banner/banner.reducer.ts","./src/app/claims/claims.action.ts","./src/app/claims/claims.action.types.ts","./src/app/claims/claims.reducer.ts","./src/app/components/app-component/app.component.ts","./src/app/components/fxpbot/fxpbot.component.html","./src/app/components/fxpbot/fxpbot.component.ts","./src/app/components/fxpbot/fxpbot.module.ts","./src/app/components/pageTour-Component/pageTour.component.html","./src/app/components/pageTour-Component/pageTour.component.ts","./src/app/components/pageTour-Component/pageTour.module.ts","./src/app/components/partnerContainer-component/partnerContainer-component.html","./src/app/components/partnerContainer-component/partnerContainer-component.ts","./src/app/components/partnerContainer-component/partnerStateService.ts","./src/app/components/powerbi-component/powerbi-container-component.html","./src/app/components/powerbi-component/powerbi-container-component.ts","./src/app/components/reactContainer-component/reactpartner-component.html","./src/app/components/reactContainer-component/reactpartner-component.ts","./src/app/flighting/featureFlags.action.types.ts","./src/app/flighting/featureFlags.actions.ts","./src/app/flighting/flighting.reducer.ts","./src/app/fxplazyloader.ts","./src/app/init/app.status.action.types.ts","./src/app/init/app.status.reducer.ts","./src/app/leftNavigation/leftNavigation.action.ts","./src/app/leftNavigation/leftNavigation.action.types.ts","./src/app/leftNavigation/leftNavigation.reducer.ts","./src/app/loader/loader.actions.ts","./src/app/loader/loader.actions.types.ts","./src/app/loader/loader.reducer.ts","./src/app/loader/pageLoaderService.ts","./src/app/modules/angular.material.module.ts","./src/app/modules/app.module.ts","./src/app/modules/powerbi-module.ts","./src/app/modules/reactapp.module.ts","./src/app/notifications/notifications.action.type.ts","./src/app/notifications/notifications.reducer.ts","./src/app/obo/obo.action.ts","./src/app/obo/obo.action.types.ts","./src/app/obo/obo.reducer.ts","./src/app/profile/profile.action.ts","./src/app/profile/profile.action.types.ts","./src/app/profile/profile.reducer.ts","./src/app/services/FxpServices.ts","./src/app/store/action.logger.adaptor.ts","./src/app/store/platform.reducer.ts","./src/app/store/platform.store.factory.ts","./src/app/systemMessages/PlannedDownTimeService.ts","./src/app/systemMessages/SystemMessagesService.ts","./src/app/systemMessages/systemMessage.action.ts","./src/app/systemMessages/systemMessage.action.types.ts","./src/app/systemMessages/systemMessage.reducer.ts","./src/app/user/user.reducer.ts","./src/js/common/ApplicationConstants.ts","./src/js/common/PouchDBProvider.ts","./src/js/common/PouchDbConnection.ts","./src/js/common/PouchDbService.ts","./src/js/common/SettingsType.ts","./src/js/common/UserInfo.ts","./src/js/common/enum/ComponentFramework.ts","./src/js/common/enum/Feedback.enum.ts","./src/js/constants/errorCodes.ts","./src/js/context/FxpContext.ts","./src/js/factory/FxpUIDataFactory.ts","./src/js/provider/SettingsServiceProvider.ts","./src/js/resiliency/FxpResiliency.ts","./src/js/services/AdalLoginHelperService.ts","./src/js/services/BroadCastingService.ts","./src/js/services/DataService.ts","./src/js/services/FxpAuthorizationService.ts","./src/js/services/FxpBreadcrumbService.ts","./src/js/services/FxpBroadcastedEvents.ts","./src/js/services/FxpConfiguration.ts","./src/js/services/FxpFeedbackService.ts","./src/js/services/FxpHttpService.ts","./src/js/services/FxpIrisBotService.ts","./src/js/services/FxpOCVFeedbackService.ts","./src/js/services/FxpPartnerHttpInterceptorHooks.ts","./src/js/services/FxpRouteService.ts","./src/js/services/FxpSignalRClient.ts","./src/js/services/FxpStateTransitionService.ts","./src/js/services/FxpStorageService.ts","./src/js/services/HelpCentralService.ts","./src/js/services/MsalAuthenticationService.ts","./src/js/services/NotificationActionCenter.ts","./src/js/services/NotificationService.ts","./src/js/services/NotificationStore.ts","./src/js/services/OBOUserService.ts","./src/js/services/PartnerAppRegistrationService.ts","./src/js/services/PersonalizationService.ts","./src/js/services/TimeZoneHelper.ts","./src/js/services/UserClaimsService.ts","./src/js/services/UserInfoService.ts","./src/js/services/dashboardService.ts","./src/js/services/fxp.global.store.service.ts","./src/js/services/lazyLoaderService.ts","./src/js/services/pageTourEventService.ts","./src/js/services/userProfileService.ts","./src/js/telemetry/EnvironmentData.ts","./src/js/telemetry/ErrorSeverityLevel.ts","./src/js/telemetry/FeatureUsageEvent.ts","./src/js/telemetry/FxpLogHelper.ts","./src/js/telemetry/FxpLoggerServiceExtension.ts","./src/js/telemetry/GlobalExceptionHandler.ts","./src/js/telemetry/LogMetricBag.ts","./src/js/telemetry/LogPropertyBag.ts","./src/js/telemetry/SystemEvent.ts","./src/js/telemetry/TelemetryConst.ts","./src/js/telemetry/fxpLogger.ts","./src/js/telemetry/network-connection.ts","./src/js/telemetry/telemetrycontext.ts","./src/js/utils/CommonUtils.ts","./src/js/utils/devicefactoryService.ts","./src/js/utils/systemDownOverlay.ts","./src/main.ts","external \"angular\""],"names":["webpackEmptyAsyncContext","req","Promise","resolve","then","e","Error","code","keys","module","exports","id","$http","$q","$rootScope","$timeout","fxpConfiguration","loggerService","msalAuthenticationService","fxpMessage","userClaimsService","userInfoService","$base64","globalStoreService","iCount","iReqCount","iUCount","sourceForTelemetry","FXP_TELEMETRY_BASE_NAME","this","http","q","rootScope","timeout","sleepInterval","fxplogger","fxpServiceEndPoint","FxpAppSettings","FxpServiceEndPoint","fxpMessageSvc","GetAdminDataFromServer","source","deferred","defer","self","getUserRoles","response","userResouces","getUserAdminResources","toString","userRoles","encode","encodedUserResources","url","startTrackPerformance","accessTokenRequestInProgress","logError","fxpUIConstants","UIMessages","GetAdminDataFailureError","ErrorMessageTitle","OnGetAdminDataFromServerFailure","Medium","addMessage","GetAdminDataAuthFailureError","ErrorMessage","messageType","error","logTrace","requestHeaders","XUserClaimsToken","XTenantId","window","TenantId","XResources","method","headers","data","JSON","stringify","GetPlatformStore","dispatch","parse","sessionStorageKey","FxpAdminData","getCurrentUser","sessionStorage","reject","stopTrackPerformance","promise","GetAdminTileDetails","isRefresh","adminTilesData","Object","GetPlatformState","AdminTiles","length","GetAdminDataFromCache","adminData","getItem","setAdminTiles","payload","type","SET_ADMIN_TILES","removeOboContext","REMOVE_OBO_CONTEXT","Actions","defaultState","AdminTileReducer","state","action","$interval","fxpConfigurationService","fxpLoggerService","message","doNotAutoClose","trackingId","messageID","focusControlIdOnClose","controlIdToFocusOnClose","showBanner","msgTrackId","trackIdLabel","msgID","msgIDLabel","messages","some","item","MessageType","Message","trackId","uniqueTransactionId","msg","msgDate","Date","info","show","success","undefined","propbag","createPropertyBag","errorMessageWithTrackingId","addToBag","location","hash","logEvent","DispatchGlobalAction","messageClass","isAnyBlockingMessageVisible","$","activeElement","setTimeout","messagecontainers","msgContainer","className","first","focus","clearTimeout","monitorMessages","closeMessage","cancel","msgInterval","clearAndReload","clear","reload","msgTimeout","FxpMessageTimeout","isNaN","bind","FxpBaseConfiguration","FxpConfigurationStrings","UIStrings","MessageToasterTrackId","MessageID","CreateIfNotExist","SubscribeToPlatformState","platformState","updateBanners","Banners","push","i","indexOf","splice","dt","messageExists","toLowerCase","AddBanner","ADD_BANNER_MESSAGE","CloseBanner","CLOSE_BANNER_MESSAGE","BannerActionTypes","BannerReducer","index","slice","AddLoggedInUserClaims","userClaims","ADD_LOGGED_IN_USER_CLAIMS","logEnabled","AddCurrentUserClaims","ADD_CURRENT_USER_CLAIMS","ClaimsActionTypes","defaultClaims","ClaimsReducer","injector","sharedComponentLoaderControl","customElements","define","pageLoaderService","lazyLoadingService","fxpEventBroadCastService","stateService","showVirtualAssistant","renewCorrelationId","fnShowPageLoader","moduleBundle","IrisModuleBundle","bundle","IrisBundle","getInstance","load","serie","route","get","ngComponent","childComponent","ngModule","_ngModuleDefFactory","ngModuelRef","instantiateModule","loadComponent","compileAndLoadModule","ngModuleRef","catch","console","log","fnHidePageLoader","ngOnInit","On","OnLaunchIrisBot","moduleRef","component","componentFactory","componentFactoryResolver","resolveComponentFactory","entry","createComponent","showCountClass","initPageTourComponent","pageTourComponent","pageTourBundle","getBundlesForSharedComponent","getSharedComponentDetails","bindEventListeners","OnPageTourFlyoutOpened","setPageTourFlyoutState","OnPageTourFlyoutClosed","event","props","unViewedTourCount","isOpen","isPageTourFlyoutOpen","togglePageTour","hidePageTourFlyout","showPageTourFlyout","broadCast","ShowPageTour","HidePageTour","fxpLoaderService","fxpMessageService","fxpPartnerStateService","compilerFactory","setCompilerFactory","ngOnDestroy","componentRef","remove","currentStateName","currentState","$current","addEventListener","returnValue","path","forEach","name","partnerAppName","routeInfo","getRegisteredAppRoute","sticky","views","currentStateHandle","timerLabel","moduleType","parent","contains","addState","time","timeEnd","properties","logException","Critical","ModuleCompilationError","label","includeRootModule","instance","constructor","ErrorInstantiatingComponent","_currentStateName","stateName","filter","PowerBiFeatureName","preReportRender","embededReportId","params","reportId","embededDashboardId","dashboardId","powerBiBaseUrl","PowerBiReportBaseUrl","powerBiService","Service","hpmFactory","wpmpFactory","routerFactory","isNullOrEmpty","showError","showDashBoard","showReport","powerBiBaseURL","powerBiFeatureUsageEvent","User","PageLoad","Web","startFeatureUsageEvent","config","embedUrl","filters","settings","getReportSettings","getAccessToken","token","accessToken","reportContainer","nativeElement","reset","powerBiReport","embed","attachEventHandlers","finally","embededDashBoardId","dashBoardContainer","powerBiDashBoard","PowerBI_Invalid_Configuration","High","powerBiComponent","featureUsageEvent","handlePowerBiLoaded","handlePowerBiRendered","handlePowerBiError","off","on","getFilters","updatedFilters","getUpdatedFilters","setFilters","propForEvents","clone","propForFeature","ActionStatus","Succeeded","endFeatureUsageEvent","accessRequestUrl","detail","errorMessage","PowerBI_OnError","Failed","filterPaneEnabled","navContentPaneEnabled","existingFilters","newFilter","existingFilterIndex","findIndex","existingFilter","target","table","column","getNewFilters","profile","getCurrentUserProfile","newFilters","operator","values","displaySettings","value","getValueForFilter","$schema","PowerBiFilterSchemaUrl","displayName","filterType","FilterType","Basic","filterValueRegExp","RegExp","PowerBiFilterValueRegularExpression","test","exec","powerBITokenURL","PowerBiEndpoint","acquireTokenAsPromise","PowerBI_Token_Failure","globalStore","stateChangeUnsubscribeCaller","unloadComponent","ngAfterViewInit","SubscribeToPartnerState","routeState","ErrorLoadingReactComponent","ErrorUnloadingReactComponent","warning","FlightingActions","UpsertFeatureFlags","UPSERT_FEATURE_FLAG","FeatureFlagReducer","setRootModuleReference","parentModuleRef","_fxprootModule","_compilerFactory","_compiler","createCompiler","useJit","jitModuleRef","compileModuleAndAllComponentsAsync","factory","partnerModule","ngModuleFactory","create","aotModuleFactoryRef","AppStatusActionTypes","Initialization","Authentication","HitCounter","AppStatusReducer","START_APP_INITIALIZATION","COMPLETE_APP_INITIALIZATION","AUTHENTICATE_USER","FAIL_AUTHENTICATION","UPDATE_COUNTER","setLeftnav","SET_LEFTNAV","LeftNavigationReducer","ShowLoader","showLoader","timeoutCallback","SHOW_LOADER","HideLoader","HIDE_LOADER","ShowSpecificLoader","SHOW_SPECIFIC_LOADER","HideSpecificLoader","HIDE_SPECIFIC_LOADER","LoaderActionTypes","LoaderReducer","loader","defaultLoaderName","timeoutIntervalInMs","PageLoadTimeOut","pageLoadTimers","PageLoaderService","_instance","incomingLoaderState","Loader","showOrHideLoaders","currentLoaderState","loaderToShow","entries","fnChangeLoaderState","disablePageLoaderTimers","setPageLoadTimer","loaderToHide","currentLoader","incomingLoader","timeOutCallback","pageLoadTimer","loadingText","fnCreateLoaderData","fnShowPageLoaderStep","currentStepIndex","totalStepsCount","loadingTextWithStep","fnShowInlineLoader","loaderName","fnBroadcastInlineLoading","fnHideInlineLoader","fnShowFlyoutInlineLoader","loaderTooltip","fnCreateFlyoutLoaderData","fnHideFlyoutInlineLoader","fnShowSpecificPageLoader","fnHideSpecificPageLoader","angular","extend","flyout","loaderInstance","Spinner","lines","width","radius","scale","corners","color","opacity","rotate","direction","speed","trail","fps","spin","document","getElementById","$broadcast","OnShowHideInlineLoader","timer","NotificationActionTypes","UserNotifications","UnreadNotificationCount","NotificationReducer","Push_Notification","Dismiss_Notification","status","Mark_Notification","Reset_Notification_Collection","AddOBOEntity","ADD_OBO_ENTITY","RemoveOBOEntity","REMOVE_OBO_ENTITY","OBOActionTypes","defaultOBOEntity","OBOReducer","AddLoggedInUserProfile","userProfile","ADD_LOGGED_IN_USER_PROFILE","AddCurrentUserProfile","ADD_CURRENT_USER_PROFILE","ProfileActionTypes","defaultProfile","ProfileReducer","FxpConfigurationServiceFactory","FxpConfigurationServiceProvider","provide","useFactory","deps","FxpEventBroadCastServiceFactory","FxpEventBroadCastServiceProvider","FxpStateTransitionServiceFactory","FxpStateTransitionServiceProvider","FxpHttptServiceFactory","FxpHttpServiceProvider","FxpSignalRServiceFactory","FxpSignalRServiceProvider","MsalAuthenticationServiceFactory","MsalAuthenticationServiceProvider","AdalLoginHelperServiceFactory","AdalLoginHelperServiceProvider","AdminLandingServiceFactory","AdminLandingServiceProvider","DashboardServiceFactory","DashboardServiceProvider","DataServiceFactory","DataServiceProvider","FxpAuthorizationServiceFactory","FxpAuthorizationServiceProvider","FxpBreadcrumbServiceFactory","FxpBreadcrumbServiceProvider","FxpFeedbackServiceFactory","FxpFeedbackServiceProvider","FxpMessageServiceFactory","FxpMessageServiceProvider","FxpRouteServiceFactory","FxpRouteServiceProvider","FxpStorageServiceFactory","FxpStorageServiceProvider","HelpCentralServiceFactory","HelpCentralServiceProvider","NotificationActionCenterFactory","NotificationActionCenterProvider","NotificationServiceFactory","NotificationServiceProvider","NotificationStoreFactory","NotificationStoreProvider","OBOUserServiceFactory","OBOUserServiceProvider","PageLoaderServiceFactory","PageLoaderServiceProvider","pageTourEventServiceFactory","pageTourEventServiceProvider","PersonalizationServiceFactory","PersonalizationServiceProvider","PlannedDownTimeServiceFactory","PlannedDownTimeServiceProvider","SystemMessagesServiceFactory","SystemMessagesServiceProvider","TimeZoneHelperFactory","TimeZoneHelperProvider","UserInfoServiceFactory","UserInfoServiceProvider","UserClaimsServiceFactory","UserClaimsServiceProvider","UserProfileServiceFactory","UserProfileServiceProvider","FxpLoggerServiceFactory","FxpLoggerServiceProvider","FxpConfitServiceFactory","FxpConfitServiceProvider","FxpFeatureFlagServiceFactory","FxpFeatureFlagServiceProvider","FxpUIDataFactory","FxpUIDataProvider","DeviceFactoryFactory","DeviceFactoryProvider","SettingsServiceFactory","SettingsServiceProvider","FxpStateServiceFactory","FxpStateServiceProvider","FxpPartnerHttpInterceptorHooksFactory","FxpHttpInterceptorHooksProvider","FxpContextServiceFactory","FxpContextServiceProvider","LazyLoaderServiceFactory","LazyLoaderServiceProvider","FxpIrisBotServiceFactory","FxpIrisBotServiceProvider","FxpGlobalStoreServiceFactory","FxpGlobalStoreServiceProvider","FxpOCVFeedbackServiceFactory","FxpOCVFeedbackServiceProvider","_fxpLogger","_source","_eventBase","processEvent","eventName","propertyBag","CreatePropertyBag","processException","ReduxStoreException","key","PlatformReducer","Status","LoggedInUser","CurrentUser","OBO","LeftNavigation","SystemMessages","FeatureFlags","Notifications","fxpLogger","PlatformStoreFactory","FxpStore","Create","actionLoggerAdaptor","debugMode","EnvironmentName","Get","SetLogger","CreateStore","Platform","AllowAll","SystemMessagesService","TimeZoneHelper","moment","UiString","logger","$window","fxpSignalRService","dashboardService","fxpRouteService","fxpGlobalStore","errorCount","plannedDownTimeCollection","systemAnnouncementCollection","isFlashVisible","flashMessages","dismissedSysMessageIds","isSystemAnnouncementVisible","timeFormat","signalREventName","signalRTenant","onMessageFromSignalR","operation","x","payLoadObject","cleanSysMessageIdsInLocalStorage","concat","_","each","startTime","convertUtcToLocal","utc","endTime","updateFlash","intervalTimeMinutes","FlashPollingIntervalInMinutes","displayFlashBeforeMinutes","DisplayFlashBeforeMinutes","localStorage","systemMessagesInState","subscribeToSignalREvent","unsubscribeFunction","subscribe","unsubscribeSignalREvent","GetSystemAnnouncementMessageandUpdateFlash","onSystemAnnouncementSuccess","onRejected","getSystemAnnoucementCollection","updateSystemAnnouncementFlash","pollForPlannedDownTimesandUpdateFlash","onSuccess","getPlannedDownTimeCollection","nextLoad","pollForUpdateFlash","cancelNextLoad","loadPromise","pausePlannedDownTimesPoll","resumePlannedDownTimesPoll","currentLeftNavItem","downTime","now","isDownTimeConfigured","tempTime","isSystemDown","tz","guess","format","systemDownMessage","isSameOrAfter","subtract","isSameOrBefore","includes","PlannedDownTime_UpdateFlash_Failure","systemAnnouncementMesage","concatenateFlashMessage","PlannedDownTime_UpdateSystemAccouncement_Failure","businessCapability","isMessageConfiguredOnLeftNav","leftNavLinks","getCachedLeftNavForCurrentUser","dashboardItem","find","targetUIStateName","getDefaultStateName","leftNavItemsWithCurrentState","leftNav","selectedItem","businessFunction","parentId","isAfter","tempMessage","isStateDown","systemDown","downStateName","targetURL","targetEventName","closeSystemAnnouncement","closeSystemMessage","messageId","sysMessage","getSystemMessagesCollectionAsync","messageCount","pageOffset","sortOrder","systemMessagesEndPoint","saveSystemMessageAsync","systemMessage","post","deleteSystemMessageAsync","systemMessageId","delete","promises","allSystemMessagesEndpoint","endpoint","getSystemMessages","all","results","reduce","acc","val","userAlias","getLoggedInUser","allSystemAnnouncementEndpoints","SystemMessageEndpoints","split","SystemAnnouncementEndpoints","systemMessages","UpsertSystemMessage","UPSERT_SYSTEM_MESSAGE","RemoveSystemMessage","REMOVE_SYSTEM_MESSAGE","SystemMessageActions","SystemMessageReducer","defaultUser","Profile","Claims","LoggedInUserReducer","CurrentUserReducer","UserSessionCreated","FxpAppLaunched","StartUpFlagRetrieved","PageTourFlagRetrieved","SkypeBotInit","ProfileNotFound","RedirectedToSales","OnProfileFromGraphAPI","Application","Global","GlobalContextDBName","BootApiUrl","WorkerFilepath","BaseConfigDBName","PersonaConfigByRoleGroupId","PartnerDomain","PartnerDomainIss","UserProfile","UIConfigDB","UserInfo","UserClaims","BaseUrl","FxpBaseUrl","host","AssetsUrl","ProfileStateName","ErrorStateNames","RequiredMessage","CouchBaseLoginContract","FxpSessionKey","FxpApplaunchedKey","RequestStateName","FxpBreadcrumbStorageKey","PageTourFeature","UserPreferencesSettings","FxPAppName","FxPDbName","UserPreferencesStorageKey","PageTourLoggerService","SnowRequestTypeSettings","ESTenanatUrlString","SalesTenantUrlString","GraphApiProfileUrl","DefaultHelpLink","AdalLoginError","AdalLoginRequest","XUserProfileToken","FlightingStatusHeader","PIIFilterRegex","ProfileFlyoutConfig","CONST","fxpUserClaimsSession","String","StateEvents","OnStart","onError","onInvalid","metricConstants","GetBasicProfileSvcName","GetUserClaimsSvcName","FXPApplicationLaunchMetric","FXPApplicationLaunchTimeMetric","UserClaimsResponseTime","UserClaimsResponseTimeError","CurrentTime","StatusText","StartTime","EndTime","ServiceName","ServiceURL","UserAgent","UserProfileService","FxpAppLaunch","SessionId","UserUPN","UserBusinessRole","Geography","BrowserAgent","SearchProfileServiceTime","SearchProfileServiceErrorTime","AdminPersonalizationUserNavLinksCount","FxpLoadDuration","searchProfileSvcName","TimeStamp","L0BusinessProcessName","L0Name","L0Name_L1Name","UserRoleGroup","LeftNavigationClickCountbyRoleGroup","LeftNavigationClickCountbyRole","RequestedUserAlias","RequestedUserRoleGroupId","ScreenRoute","FeedbackType","Action","UserFeedback","UserFeedbackErrorMessage","OBOUserRoleGroupName","OBOUserBusinessRole","OBOUserUPN","BreadcrumbString","BrowserPageTitle","LoggedinUserName","OBOUserName","OperatingSystem","BrowserType","BrowserVersion","DeviceType","TotalDuration","UIRenderDuration","LeftNavPinStatus","GetSettingsAPIResponseDuration","SaveSettingsAPIResponseDuration","ModifiedRoleGroupName","ModifiedRoleGroupID","ModifiedBusinessRoleName","ModifiedBusinessRoleID","OBOUserAlias","LeftNavLinksValueBeforeModification","LeftNavLinksValueAfterModification","ErrorUrl","GlobalErrorDetail","FooterLinkUrl","FooterLinkName","HeaderClickNavigatedStateName","HeaderClickNavigatedStateTemplateURL","MiniProfileIconClick","ProfileLinkClick","ChatIconClick","MailIconClick","HelpLinkParent","HelpLinkChild","HelpIconClicked","HelpView","ErrorText","UserPorfileServiceEndPoint","IsLoginRequired","IsCSABlockedUser","ModuleBootstrapping","OBOConstants","OnBehalfOfUserName","OnBehalfOfUserAlias","OnBehalfOfUserUpn","ActonBehalfMode","OnBehalfOfUserBusinessRoleId","OnBehalfOfUserBusinessRole","OnBehalfOfUserRoleGroup","AdminActOnBehaflOfDuratoin","ActonBehalfofAdminStartTime","ActonBehalfofAdminEndTime","ActionTypes","Add","Save","Submit","Remove","Cancel","Click","keyCodes","escapeKey","arrowRightKey","arrowLeftKey","arrowDownKey","arrowUpKey","enterKey","tabKey","spaceBar","applicableDevice","desktop","mobile","BreadcrumbEventType","BreadcrumbLoad","BreadcrumbClick","askOps","createLink","viewLink","FxpLoad","GetUserClaims","GetUserThumbnail","GetBasicProfileWithAdal","AdalTimeGetBasicProfile","DashboardLoad","LoadRoutes","PreDashboardLoad","SavePersonalizedNavItems","SaveRoleGroupPersonalizedNavItems","GetPersonalizedNavItems","GetMasterLeftNavItems","SendUserFeedback","GetRoleGroupDetails","GetLeftNavData","GetTenantClaims","RoleGroupId","RoleGroupName","TenantKey","TenantName","getDBConnection","applicationName","DbConnection","createDatabase","destroy","localDatabaseName","PouchDB","getDatabase","pouchDbConnection","_docId","_localDbName","_database","save","jsonDocument","jsonDoc","documentId","documentRevision","saveUpdateDocument","put","getAllDocuments","options","allDocs","SettingsType","aadObjectId","alias","firstName","lastName","middleName","fullName","businessDomain","reportsTo","reportsToDisplayName","businessRoleId","seniority","businessRole","standardTitle","addressBookTitleDesc","email","resourceImage","reportsToFullName","preferredFirstName","businessRoleDisplayName","roleGroupId","roleGroupName","isDefaultProfile","domain","personnelNumber","primaryTool","costCenterCode","hiringDate","terminationDate","serviceJobTitle","resourceType","alignmentType","companyCode","subAreaCode","countryCode","homeLocationNotFoundInd","timeZoneId","standardTimeZone","resourceStatus","resourceCategory","resumeUrl","functionHierarchyCode","ComponentFramework","IOCVSource","IOCVFeedbackType","IOCVManifestType","ModuleBoostrapFailure","ModuleBoostrapFailureRequireJS","GlobalExceptionHandler","GlobalExceptionHandler_AngularJs","OnMsalLoginFailure","OnMsalTokenFailure","OnTelemetryContextError","OnSettingsServiceError","OnGetAdminTilesFailure","GetLeftNavData_Failure","SaveLeftNavPinSetting_Error","SystemMessage_Read_Collection_Rejection","SystemMessage_Fetch_Business_Workflow","SystemMessage_Save_Failure","SystemMessage_Update_Failure","SystemMessage_Delete_Failure","AcquireTokenFailure_UnKnown_Reason","OBO_User_Already_Active","Get_OBO_User_Configuration_Failure","OBO_User_Search_Failure","State_Not_Found","State_Change_Failure","Msal_ResourceTokenAcuqisition_Failure","SkypeBotInit_Failure","API_Threshold_Crossed","InitializeFeedback_Failure","Error_SubmittingFeedback","Error_LoadingFeedback","GetRoleGroupDetails_Failure","PublishNotifications_Failure","PublishNotificationsRolesRoleGroup_Failure","GetRequestTypeData_Failure","CloseActOnBehalofUser_Failure","GetContextualHelpArticles_Failure","GetArticleData_Failure","SaveHelpFeedback_Failure","SearchSuggestions_Failure","SaveViewCount_Failure","ShowErrorMsgNavigateToUserLookUp","GetNotifications_Failure","GetUnreadNotificationCount_Failure","MarkAllNotificationsAsRead_Failure","DismissAllNotifications_Failure","ReadNotification_Failure","DeleteNotification_Failure","SaveNotificationDNDSetting","ErrorLoadingDashboard","ErrorFetchingTokenForPowerBI","ErrorLoadingPowerBiDashboard","SubmitRoleGroupNavPresonalization_Failure","GetRoleGroupDetailsPersonalization_Failure","GetGlobalNavMasterList_Failure","GetRoleGroupNavList_Failure","ReadToastNotification_Failure","MarkNotificationAsRead_Failure","UserLookUpSearchUser_Failure","SetSelectedUser_Failure","NavigateToPersonalizationView_Failure","ErrorOnLeftNavClick","HandleProfileServiceResponse","AdalOnError","AdalOnErrorWithErrorCode","DefaultStateNotConfigured","ErrorRegisteringRoute","ErrorInLazyLoading","ErrorUpdatingStateObject","RouteResolveException","HttpInterceptorResponseError","DashboardService_GetLeftNavDataFailure","FxPConfigurationFailure","StartUpFlagRetrieveError","DataService_TokenFailure","FeedbackService_Error","CheckToastNotifications_Failure","SharedComponentNotRegistered","LazyLoadingFailedForSharedComponent","PersonalizationService_GetMasterLeftNav_Failure","PersonalizationService_GetPersonalizedLeftNav_Failure","PersonalizationSerivce_SavePersonalizedNavItems_Failure","PersonalizationSerivce_GetRoleGroupDetails_Failure","PersonalizationSerivce_GetRoleGroupDetailsForNotification_Failure","PersonalizationSerivce_GetRolePersonalizedNavItems_Failure","PersonalizationSerivce_GetRoleGroupPersonalizedList_Failure","PersonalizationSerivce_SaveRoleGroupPersonalizedNavItems_Failure","AuthSerive_UserClaimsEmptyInLocalStorage","AuthSerive_MissingApplicationObjectInClaims","AuthSerive_MissingRolesObjectInClaims","AuthSerive_TenantClaimsEmptyInLocalStorage","AuthSerive_TenantObjectMissingInClaims","AuthSerive_ClaimsMissingInTenantObject","AuthService_TokenAcquisitionInProgress","AuthService_TokenAcquisitionInProgress_TenantClaims","AuthService_TenantClaimsObjectMissingInClaims","AuthService_APICallFailedWithUnknownReason","AuthService_ErrorNotifyingCachedClaims","AuthService_UnknownException","AuthService_GetClaimsFailure","GetUserThumbnail_TokenNotFound","GetBasicProfile_TokenNotFound","GetBasicProfile_BusinessRoleMissing","GetBasicProfile_RoleGroupMissing","GetBasicProfile_ProfileNotFound","BasicProfile_UnknownError","SearchProfile_TokenMissing","ProfileServiceFailure","ProfileService_ErrorNotifyingCachedProfile","ErrorOnProfileSearch","Resiliency_ExternalResourceLoadingError","Resiliency_ModuleLoadingError","SignalR_ErrorOnDisconnect","SignalR_ErrorOnMessageSend","SignalR_ErrorOnJoinGroup","SignalR_ErrorOnLeaveGroup","SignalR_ErrorOnConnection","PartnerAppRegistrationService_ErrorOnAppRegistration","PartnerAppRegistrationService_ErrorOnSharedComponentRegistration","OnStateChangeStartException","iPouchDBProvider","FxpContext","_iPouchDBProvider","pouchService","GetInstance","saveContext","saveData","readContext","readData","getDocumentKeys","getDocumentKeysData","deleteContext","db","getDBService","doc","_rev","err","exception","getFxpBaseUrl","getAssetLibraryUrl","getCurrentSessionId","PropBagInternal","JSONData","include_docs","rows","map","row","fxpFeedbackService","headerText","pageTitle","getHeaderText","setHeaderText","OnAppHeaderChanged","getPageTitle","setPageTitle","OnPageTitleChanged","setPageTitleFromRoute","toState","setScreenRoute","setBrowserTitle","setAppHeaderFromRoute","headerName","getUIDataFactoryObj","FxpUIData","settingsServiceConfig","settingsServiceBaseUrl","$get","$inject","init","otherwise","input","configure","settingsSeerviceConfig","getSettings","settingType","settingId","settingNames","saveSettings","settingName","settingValue","pathUrl","getPathUrl","Array","setting","getSettingsSvc","saveSettingsSvc","unavailablePartnerModules","externalResourceLoadFailed","scriptName","logMsg","FxpLoggerService","getResilientModules","modules","statesWithMissingModules","resilientModules","moduleName","failedModules","checkModuleResiliency","logFailedModulesInfo","app","requires","reverse","join","hasChildren","Resiliency","$resource","serviceEndpoints","registerEndPoint","applicationId","getCachedToken","acquireToken","callback","authResult","result","isTokenRetrievalStarted","resource","subjects","broadCastSubject","eventIndex","getIndexOfObject","subject","onNext","getSubjectInstance","subscribeToSubject","unsubscribeSubject","unsubscribe","callBack","$on","emit","$emit","fxploggerService","retryCount","parentDeferred","getWithAdalTokenSync","getAsObservable","observer","next","complete","retryCountForUrl","propBag","$state","states","stateGo","object","checkStatePermission","isStateAuthorized","redirectToUnauthorizedState","trim","current","telemetrymsg","UnauthorizedUIString","logWarning","preventDefault","go","isAuthorized","appName","stateConfig","appConfig","angularPartnerStateConfig","s","routes","r","isAppAdmin","adminPermissionsRules","getAppAdminRules","hasUserPermissions","hasUserRoles","hasRoles","allRolesMandatory","AllRolesMandatory","roles","Value","getClaimsList","every","checkRoleFunc","hasResourcePermissions","userResourcePermissions","areResourcesAuthorized","allResourcePermissionsMandatory","AllResourcesMandatory","resourcePermissions","p","checkResourcePermissionFunc","allowedPermissions","authorizeRolesAndResources","AuthorizeRolesAndResources","Roles","ResourcePermissions","areRolesAuthorized","authorizationRules","getStateAuthorizationRules","AllowedPermissions","actOnBehalfOfUserActive","IsRestrictedInObo","authRules","AuthorizationRules","StateName","adminRules","tenantClaims","getAppList","getUserTenantClaims","apps","role","permission","Resource","el","a","npd","NPDClaims","claims","hasOwnProperty","hasPermissions","Permissions","AllPermissionsMandatory","permissions","fxpStorageService","fxpTelemetryContext","isLeftNavItemClicked","setBreadcrumbFromRoute","breadcrumbText","href","setCurrentPageBreadcrumb","breadcrumbItem","startNewBreadcrumbOnSpecificState","fxpBreadcrumb","setBreadcrumb","setBreadcrumbItem","storageKey","userNavigatedStatesWithBreadcrumb","getFromLocalStorage","newTabBreadcrumbStorageKey","hashCode","prevSessionBreadcrumbArray","deleteFromLocalStorage","expectedBreadcrumbForCurrentState","getExpectedBreadcrumbForCurrentState","breadcrumbArraySearchKey","storedBreadcrumbForCurrentState","saveInLocalStorage","updateBreadcrumb","breadcrumbList","breadcrumbItemIndex","copy","NonGLNStateCollectionForBreadcrumb","logBreadcrumbTelemetryInfo","userInfo","breadcrumbString","loginUserInfo","sessionId","isActingOnBehalfOf","oboUserInfo","oboUserData","getTimeStamp","logInformation","breadcrumbFeature","LinkClicked","logFeatureUsageEvent","setTempBreadcrumbArray","overrideBreadcrumbText","updateDisplayNameForCurrentBreadcrumbItem","getBreadcrumbItemIndex","fxpBreadcrumbContext","breadcrumbName","saveBreadcrumbContextForCurrentState","breadcrumbLastItem","updateBreadcrumbUrlByName","newUrl","FxpBroadcastedEvents","fxpAppSettings","fxpBaseConfiguration","modelConfiguration","GetConfiguration","rootscope","userProfileService","feedbackRouteData","feedbackPropBag","_feedbackItemCollection","_userId","_subscriprtionId","_feedbackServiceEndpoint","setUserId","userId","getUserID","setFeedbackItemCollection","itemCollection","OnFeedbackConfigurationChanged","getFeedbackItemCollection","setFeedbackEndpoint","getFeedbackEndpoint","setSubscriprtionId","subscriprtionId","getSubscriprtionId","addToFeedbackPropBag","getFeedbackPropBagItems","addFeedbackPropBagRange","property","removeFeedbackPropBagRange","removeFromFeedbackPropBag","browserTitle","OnFeedbackContextChanged","currentRoute","setFeedbackServiceProperties","usersDetails","getEnvironmentDetails","feedbackEnvData","EnvironmetName","ServiceOffering","ServiceLine","setUserDetailsToFeedback","userDetails","oboUserBasicInfo","getBasicProfileByAlias","loginUserBasicInfo","UserId","getLoggedInUserUpn","UserName","BusinessRole","getCurrentUserData","getCurrentUserUpn","logFeedbackInformation","feedbackInfo","feedbackStatusInfo","telemetry_source","tags","feedbackType","feedback","toEs6Promise","qPromise","reason","responseType","patch","jsonp","head","launchIrisBot","hideIrisBot","OnHideIrisBot","fxpHttpService","fxpConfigService","SubmitFeedback","feedbackMessage","feedbackPayload","manifestType","feedbackManifestType","appId","OCVAppId","submitTime","toISOString","Client","rating","clientFeedbackId","getNewGuId","comment","application","appData","telemetry","loggableUserId","featureArea","partnerName","officeBuild","BuildNumber","tenantId","survey","surveyId","web","browser","navigator","browserVersion","version","sourcePageName","getElementsByTagName","innerHTML","sourcePageURI","sendFeedback","FeedbackOCVEndpoint","_interceptorHooks","RegisterInterceptorHook","httpInterceptorHookInstance","UnRegisterInterceptorHook","getRegisteredInterceptorHooks","fxpBreadcrumbService","getAllStates","statesList","getURLfromState","statename","navigatetoState","warn","navigatetoNewWindow","open","screen","height","navigatetoSpecificState","transitionOptions","navigateToSpecificUrl","features","replace","navigateToUrl","defaultStateName","setDefaultStateName","getStateDetails","getCurrentStateDetails","isNewTabAllowed","listeners","connectionPromise","pingTimeOutRef","pingInterval","signalRServiceEndPoint","SignalRPlatformEndPoint","processName","Number","isInteger","SignalRPlatformPingIntervalInMinutes","setupPingForSignalServer","ping","sendMessage","connect","connection","Connected","currentProcessName","eventData","DataStore","customProperties","CLASSNAME","METHODNAME","logSystemEvent","setupConnection","disconnect","stop","Low","methodName","send","args","joinGroup","groupName","tenantName","environment","leaveGroup","unsubscribeAll","onMessageFromServer","messageData","callBackFunctions","callbackFunc","SignalRPlatformClientId","withUrl","accessTokenFactory","getTokenForAppIdAsync","accesstoken","withAutomaticReconnect","build","onreconnecting","Reconnecting","onreconnected","connectionId","onclose","Disconnected","start","$injector","$transitions","onStart","onStartStateChangeHandler","onSuccessStateChangeHandler","onErrorStateChangeHandler","onInvalidStateHandler","transition","getStateInfo","syncRouteAction","OnLeftNavHighlightByStateName","to","logFeatureUsageEventForState","logPageView","appNameForTelemetry","partnerTelemetryName","pageName","pageNameForTelemetry","telemetryName","displayNameForPageView","parseFloat","stateChangeStartTime","duration","performance","measurements","createMetricBag","LOGGING_SOURCE","featureName","subFeatureName","actionName","fromState","from","previousFeatureName","displayFeatureName","renewSubCorrelationId","SubFeatureName","toParams","fromParams","onStateChangeStart","onStateChangeSuccess","onStateChangeFailure","onStateNotFound","offStateChangeStart","observers","offStateChangeSuccess","offStateChangeFailure","offStateNotFound","FxpStorageService","setItem","removeItem","deviceFactory","helpCentralServiceEndPoint","HelpCentralServiceEndpoint","helpCentralServiceAppId","HelpCentralAppId","MappedTenantName","getContextualHelpArticles","topArticles","businessFunctions","searchString","deviceType","isMobile","getContextualHelpArticleContent","articleId","urlGetArticle","getSuggestions","searchPhrase","saveArticleFeedback","saveArticleViewCount","publicClientApplication","anonymousEndpointList","anonEndpoints","AuthExcludedDomains","registerEndpoints","initializeAuthentication","configuration","login","accounts","getAllAccounts","setActiveAccount","addEventCallback","eventType","LOGIN_SUCCESS","account","LOGIN_FAILURE","errorDesc","ACQUIRE_TOKEN_FAILURE","errorCode","localPublicClientApplication","handleRedirectPromise","loginResponse","getActiveAccount","loginRedirect","idToken","silentRequest","scopes","forceRefresh","request","loginHint","username","acquireTokenSilent","INVALID_GRANT_ERROR","errorCodes","isServerError","isInteractionRequiredError","isRefreshTokenError","acquireTokenRedirect","isInvalidGrantError","tokenResponse","getTokenRedirect","getTokenRedirectAsync","getAccount","redirectRequest","authExceptionEndpoints","addAuthenticationExceptionEndpoints","getResourceForEndpoint","redirectStartPage","partnerEnpoints","getRegisterEndpoints","endpoints","eval","Endpoints","jsonConcat","_msalEndpoints","clientId","FxpAppClientId","loginResource","redirectUri","bestMatchedConfigEndpoint","configEndpoint","trimStart","startsWith","_getHostFromUri","uri","extractedUri","_config","_msalService","MsalAuthenticationService","notificationActions","NotificationConfiguration","ActionConfiguration","iconConfiguration","IconConfiguration","excecuteNotificationAction","actions","content","notification","Subject","OpenInNewTab","ActionType","absolute","registerNotificationAction","actionType","openInNewTab","notificationAction","appendPropertiesToNotifications","notifications","icon","From","senderAddress","Icon","hasAction","publishedOn","notificationApiWebNotifResourceUrl","notificationApiBaseUrl","NotificationServiceEndpoint","getNotifications","startIndex","count","offset","user","channel","urlGetNotiicationsByPage","requestConfig","deleteNotification","webNotificationId","urlDeleteNotification","deleteAllNotification","urlDeleteAllNotification","markNotificationAsRead","urlMarkAsRead","markAllNotificationsAsRead","urlMarkAllAsRead","publishNotifications","notificationArray","publishEventUrl","Notification","WebNotification","Content","To","publishNotificationsRolesRoleGroup","urlPublish","notificationService","defered","fxpContextService","OBOUser","OBOUserRoutes","OBOUserStatus","OBOUserSessionInfo","OBOUserTenantConfiguration","isOBOAsNewTab","OBOUserService","initilizeOBOEntity","setOBOUserSessionInfo","setActingOnBehalfOfFlag","setCurrentUserOID","setCurrentUser","setCurrentUserUpn","userUpn","saveOBOEntityInContext","setCurrentUserStateFromLoggedInUserState","initializeOBOEntityFromContext","udata","IsError","removeOBOUserContext","oboData","Result","getCalimsSvc","ex","SelectedProfileRoles","$$phase","$apply","getLoggedInUserOID","getOBOUserRoutes","getOBOUser","getOBOUserTenantConfiguration","setLazyLoader","lazyLoaderInstance","lazyLoader","registerPartnerEndpoints","partnerRegisteredEndpoints","getRegisteredEndPointsFromPartnerAppRegistrationClass","getAuthExcpetionFromPartnerAppRegistrationClass","addApplicationWithStores","applicationsWithStore","isStoreRegistered","registerPartnerApp","appInstance","registeredApps","getRoutes","addRouteConfigurationAction","registerPartnerAppRoutes","updateStateObject","componentFramework","element","body","React","stateInfo","updateRouteConfiguration","getRegisteredRoutes","fxpAppContext","routesInfo","registeredRoutes","apply","registerLazyLoadedApp","registryInstance","registry","updateAppName","bundles","getBundles","getGeneratedBundles","registerPartnerAppBundles","registerPartnerAppEndpoints","getServiceEndPoints","getAuthExceptionEndpoints","registerAuthExceptionEndpoints","getSharedComponentsInfo","registerAngularSharedComponents","configObject","sharedComponentsInfo","disableSharing","angularPartnerSharedComponents","ocBundles","ocBundle","files","sequentialLoading","serviceEndPoint","updateSharedComponentDetails","compName","components","componentName","partnerApp","toLocaleLowerCase","sharedComponents","comp","sharedBundles","generatedBundle","getSharedComponentReference","sharedComponentConfig","sharedComponentReference","sharedComponent","Angular","getSharedComponentFactory","profileStore","ProfileStore","oneProfileEndPoint","ProfileAPIEndPoint","authStore","AuthStore","rolePersonalizationStore","RolePersonalizationStore","tenantClaimsApiEndpoint","TenantClaimsEndPoint","tenantRolesApiEndpoint","TenantRolesEndPoint","tenantNPD","NPD","NotificationStore","NotificationApiEndpoint","NotificationApiEndPoint","getPersistedPersonalization","context","keyContext","persistUserPersonalization","selectedUserPersonalization","removePersistedUserPersonalization","getMasterLeftNavItems","AADAuthFailureError","getPersonalizedNavItems","userRoleId","savePersonalizedNavItems","savedUserPrefNavList","shouldAssignRoles","ShouldAssignRoles","getRoleGroupDetails","getRoleGroupDetailsForNotification","telemtry_source","getRolePersonalizedNavItems","getRoleGroupPersonalizedList","saveRoleGroupPersonalizedNavItems","savedRoleGroupPrefNavList","getRoleGroup","PacificRegion","getCurrentUtcDateTime","addHoursToCurrentUtcDateTime","hours","add","getCurrentLocalDateTime","local","addHoursToLocalUtcDateTime","getCurrentPacificDateTime","AddHoursToCurrentPacificDateTime","convertToPacific","isMoment","convertToLocal","convertToUtc","changeTimeZoneComponentToPacific","utcOffset","changeTimeZoneComponentToUniversal","timeUtc","getCurrentTimeZoneCode","timezone","fxpContext","iTenantReqCount","fxpcontext","loggedInUserAlias","currentUserAlias","claimsApiEndpoint","UserClaimsEndPoint","getLoggedInUserClaims","getUserClaimsForAlias","getLoggedInUserTenantClaims","getUserClaims","getCurrentUserOID","getUserClaimsForScopes","scopeDirection","getClaimsForUserAlias","accumulator","filteredClaims","filterRolesBasedOnScopes","inputClaims","tenants","tenantScopesMap","formTenantScopeMapping","tenant","tenantScopes","propertyName","delegatedClaims","filteredScopes","roleName","roleObj","Scopes","roleScopes","scope","roleScope","tenantScope","filterScope","existingPermission","Set","DefaultPermisssions","modifiedScope","tenantMatch","tenantTrimmedScope","substring","headerScope","roleParts","headerParts","getUserTenatClaimsByObjectId","objectId","userClaimsLocalStorage","getClaimsFromLocalStorage","genericPropBag","getClaimsPropertyBag","AuthServiceReturnsBlankAppError","Applications","AuthServiceReturnsBlankAppRoleError","entityId","entityType","localStorageValue","claimsData","objectToString","ErrorInfo","claimsLocalStorage","isV2ClaimsTenantId","createClaimsPropertyBag","claimId","getTenatClaimsSvc","objectID","areHeadersAvailable","TenantClaimsHeaders","FXP_TELEMETRY_PLATFORM_BOOTSTRAP","getUserClaimsSvc","getObjectIdFromIdentifier","OID","useridentifier","isGuid","loggedInUserInfo","userinfo","telmetry_source","oid","parsedClaims","getClaimsFromGlobalStore","claimsEndpoint","tenantheaders","systemEvent","responseData","dispatchClaimsAction","getClaimsByObjectId","userIdentifier","sendDate","claimData","fxpAppLaunched","isAppLaunched","setUserInfo","localStorageClaims","notify","tResponse","logClaimsMetrics","getDefaultAppRole","saveClaimsData","logClaimsException","IsAuthorizationRequired","isLoginRequired","statusText","responseCode","GetUserClaimsSvcReturnsError","currentClaims","strCalimsData","getAliasFromOID","logInfo","receiveDate","responseTime","getTime","toUTCString","logMetric","AuthzServiceReturnsError","isObo","upn","listOfRoles","ApplicationName","RoleName","DefaultAppRole","getUserDelegatedRoles","getUserConsolidatedRoles","promiseList","userDelegatedRoles","consolidatedRoles","union","getUserResources","listOfResources","FxpNpd","lstClaims","appRole","prefix","isDefaultRole","claimsStorageKey","getSessionStorageUserClaimsKey","currentUser","loggedInUser","currentUserUpn","loggedInUserUpn","loggedInUserOID","currentUserOID","getCurrentUserClaims","getLoggedInUserProfile","setLoggedInUserOID","aadOID","setLoggedInUser","getCurrentUserContext","setUpAjaxCallsHeaders","getAADObjectIDFromAlias","setLoggedInUserUpn","OBOUserSession","isOboActive","aadObjectID","ajaxSetup","userData","userClaimsData","featureFlagService","startUpFlightConfig","pageTourWaitTime","DashboardService","getLeftNavData","leftNavDataKey","leftNavData","GetLeftNavAuthFailureError","internalLinks","getGLNFlatDataStructure","list","L0length","j","L1length","children","fxpConfigurationFailed","userAgent","getGeography","UserRoleGroupFxpConfigNotFoundError","getInitialFeatureFlagsForPlatform","featureFlagPromise","eventNames","initialFlags","getLoggedInUserFlighitngContext","flightingContext","getFeatureFlags","envName","featureNames","InitialFeatureFlags","pageTourEnabled","_logger","appReducer","middlewares","globalActions","shouldReplace","shouldUpdate","_globalStore","RegisterStore","store","RegisterGlobalActions","GetPartnerState","GetGlobalState","DispatchLocalAction","DispatchAction","Subscribe","partner","eager","SubscribeToGlobalState","AddSelectors","selectors","mergeSelectors","SelectPartnerState","selector","defaultReturn","$ocLazyLoad","appControllerHelper","isPageTourInProgress","currentLeftNavPinState","isLeftNavPinned","isLeftNavOpen","telemetrySource","responseStartTime","isBasicProfileRefreshed","telemetryContext","graphAPIProfileUrl","GraphAdEndPoint","graphAPIUserProfileUrl","GraphApiUserProfileUrl","graphAPIUserThumbnailUrl","GraphApiUserThumbnailUrl","profileApiEndpoint","searchProfileApiEndpoint","SearchAPIEndPoint","isProfileRequired","IsProfileRequired","getUserThumbnail","getBasicUserProfile","pDeferred","getBasicProfileByOID","refreshBasicUserProfileInContext","getBasicProfile","currentProfile","AadObjectId","includeInactiveUser","getBasicProfileByAliasIncludingInActiveUser","bag","getFlightingContext","roleGroupIdInternalId","getPropertyValueCaseInsensitive","resourceCategoryInternalId","sDODomainInternalId","opFieldsArray","LeftNavFlightingContextProperties","field","fieldName","getBasicUserProfileLoggedInUser","getCurrentUserFlighitngContext","getProfileURL","userIdentifierType","toUpperCase","getBasicProfileSvc","getShowBannerValue","localStorageProfile","getProfileFromLocalStorage","dispatchProfileActions","attr","BusinessDomain","SDODomain","AddressBookTitleDesc","RoleGroupID","Email","EmailName","DisplayName","FullName","MiddleName","LastName","Seniority","BusinessRoleDisplayName","IsDefaultProfile","BusinessRoleId","UserProfileBusinessRoleMissingError","tenantMapping","newTenant","UserProfileRoleGroupMissingError","getProfileDataFromGraphResponse","setLocalStorageProfile","OnBasicUserProfileRefresh","UserProfileNotFoundError","isBlockedCSAUser","ErrorCode","CSAErrorCode","logBasicProfileFailureError","ProfileServiceCallFailedError","getDeafultUserInfo","Alias","getSessionStorageUserInfoKey","profileStorageKey","searchProfile","parentDiffered","SearchAPIHeaders","FirstName","givenName","surname","userPrincipalName","mailNickname","PersonnelNumber","immutableId","jobTitle","ReportsToDisplayName","ReportsToFullName","aadBasicUserInfo","getAADBasicInfoFromLocalStorage","userProfileAAD","isBotEnabled","fromJson","environmentName","serviceOffering","serviceLine","service","componentId","ictoId","businessProcessName","ComponentId","ComponentName","AppName","IctoId","BusinessProcessName","ErrorSeverityLevel","componentType","FeatureUsageEvent","getTaskName","TaskName","setTaskName","getTaskStatus","TaskStatus","setTaskStatus","getCapabilityType","CapabilityType","setCapabilityType","getEmbeddedExpereinceName","EmbeddedExpereinceName","setEmbeddedExpereinceName","setIsEmbeddedExperience","IsEmbeddedExperience","getIsEmbeddedExperience","getEventName","EventName","getEventType","EventType","setEventType","getDuration","Duration","setDuration","getFeatureName","FeatureName","getSubFeatureName","setSubFeatureName","getActionName","ActionName","getActionType","setExperimentationConfigId","ExperimentationConfigId","getExperimentationConfigId","setExperimentationConfigName","ExperimentationConfigName","getExperimentationConfigName","setExperimentationConfigResult","ExperimentationConfigResult","getExperimentationConfigResult","getTemplateType","TemplateType","getComponentType","ComponentType","getUserRoleName","UserRoleName","setUserRoleName","getStartDateTime","StartDateTime","setStartDateTime","getEndDateTime","EndDateTime","setEndDateTime","getComponentUri","ComponentUri","setComponentUri","getEntityId","EntityId","setEntityId","getActionStatus","setActionStatus","currentDate","day","getDate","month","getMonth","year","getFullYear","getHours","minutes","getMinutes","seconds","getSeconds","suffix","getTelemetryUniqueKey","date","pad2","getNewSessionId","d","c","Math","random","floor","getAppNameFromSource","addEnvironmentDetails","eventProperties","transactionId","aiInstrumentKey","telemetryAppName","environmentData","CurrentContext","globalProperties","getGlobalPropertyBag","addRange","ENVIRONMENTNAME","SERVICEOFFERING","SERVICELINE","SERVICE","COMPONENTID","COMPONENTNAME","XCV","AIAPPKEY","LOGGEDFROM","ICTOID","BUSINESSPROCESSNAME","n","appIngisht","appIngishtInstance","fxpLoggerServiceExtension","FxpLoggerServiceExtension","logBusinessProcessEvent","TrackBusinessProcessEvent","getItems","TrackFeatureUsageEventV2","StartFeatureUsageEvent","EndFeatureUsageEvent","logTrackSystemEvent","TrackSystemEvent","logFxpBootFailure","descriptionText","isCSABlockedUser","sourceName","FxPLoggerService","metricBagInternal","propBagInternal","isObject","stringVal","removePII","removeFromBag","getValue","PouchSyncMode","DiagnosticLevel","PAGENAME","PAGEVISITED","URL","ERRORPREFIX","USER_ALIAS","AIFeatureUsageEvent","AIBusinessProcessEvent","InstrumentationKey","EndPointUrl","ERROR","Metric","WARNING","TRACE","INFORMATION","CUSTOMEVENT","ACTIONURI","APPACTION","COMPONENTTYPE","EVENTTYPE","TARGETENTITYKEY","USERROLENAME","COMPONENTURI","DURATION","LOGGEDINUSERROLEGROUPID","LOGGEDINUSERROLEGROUPNAME","OBOROLEGROUPID","OBOROLEGROUPNAME","LOGGEDINUSERTENANTKEY","LOGGEDINUSERTENANTNAME","OBOTENANTKEY","OBOTENANTNAME","_appInsight","_events","instrumentationKey","Telemetry","clickPluginInstance","configObj","extensions","extensionConfig","identifier","autoCapture","dataTags","useDefaultContentNameOrId","captureAllMetaDataContent","_environmentValues","InitializeTelemetryWithConfiguration","_context","initUserSession","setContextInfo","addContextChangeListener","_correlator","correlator","telemetryInitializer","envelope","telemetryItem","baseData","telemetryInitializerInit","appInsights","addTelemetryInitializer","AddMsitTelemetryInitializers","_loggerServiceExtenstion","_loggerServiceInstance","session","getSessionID","ver","getAppVersion","getCurrentPartnerTelemetryName","finalProperties","assign","ngInjector","stackTrace","severityLevel","stack","internalCustomLog","setTransactionIdAndCommonProperties","TrackException","TrackEvent","pageViewTelemetry","refUri","pageType","isLoggedIn","trackPageView","metricName","metricValue","metricTelemetry","average","trackMetric","TrackTrace","setCorrelationProvider","correlationProvider","getPageLoadMetrics","pageLoadMetric","setPageLoadMetrics","logPageLoadMetrics","pageLoadTime","pageLoadMetricsCalled","pageLoadData","totalDuration","sourceRoute","destinationRoute","pageLoadDuration","pageDisplayName","sourceRouteURL","destinationRouteURL","pageTransitionStatus","stateChangeDuration","preStateDuration","pageLoadError","threshold","thresholdCrossed","thresholdValue","rootscopestartTime","setLoggedInUserContext","loggedInUserRoleId","loggedInUserRoleName","isOBO","loggedInUserTenantKey","loggedInUserTenantName","loggedInUserContext","setOBOUserContext","OBOUserRoleId","OBOUserRoleName","OBOUserTenantKey","OBOUserTenantName","OBOUserContext","logUserAction","setTransactionId","subCorrelationId","getSubCorrelationId","correlationId","getCorrelationId","telemetryTrace","traceID","parentID","addPropertyBagValues","buildCommonLogProperties","logProperties","addUserRoleGroupDetails","addUserTenantDetails","getCurrentNetworkSpeed","getDefaultPropertyBagValues","_connection","mozConnection","webkitConnection","broadcastNetworkChange","_networkConnection","NetworkConnection","_effectiveType","effectiveType","newEffectiveType","networkChangeCustomEvent","CustomEvent","bubbles","cancelable","dispatchEvent","_appName","_appVersion","_userRole","_sessionId","_geography","_envData","_globalPropertyBag","contextChangeListeners","setAppContext","_currentContext","TelemetryContext","addToGlobalPropertyBag","removeFromGlobalPropertyBag","setUserID","userID","appVersion","notifyContextChangeListeners","getAppName","setUserRole","userRole","getUserRole","setSessionID","sessionID","setGeography","geo","setNewUserSession","sessionIdCached","setEnvironmentDetails","envData","setPartnerEnvironmentDetails","partnersTelmetryInfo","partnerTelmetryInfo","Name","listener","jQuery","isEmptyObject","obj","pullFocusToElement","elementId","angularInherits","ctor","superCtor","super_","prototype","enumerable","charCodeAt","getArrayLength","arrayCollection","CommonUtils","compareKey","generateUPN","UPN","Domain","UpnCorpnet","UpnPartner","stringFormat","str","match","number","getTenantURLSpecificPageTitle","obj1","obj2","isObjectAnArray","call","isPlainObject","k","sortJsonObj","inputJson","isArray","inputObject","sort","v","b","getQueryString","string","getScriptBaseUrl","baseUrl","currentScriptUrl","currentScript","lastIndexOf","endsWith","PIIRegex","regexp","getWindowSize","innerWidth","innerHeight","updateType","resolution","size","types","tablet","isSmallScreen","isTablet","isDesktop","devicePixelRatio","lazyUpdate","throttle","OnLayoutChanged","showSystemDownOverlay","supportLinkText","supportLink","showSupportLinks","title","setAttribute","hide","fxpModule","$urlService","deferIntercept","dependentModules","platformReference","bootstrap","documentElement","urlService","run","listen","sync","systemDownHeader","systemDownDescription","systemDownPageTitle","JavaScriptException","PageTitle","errorProperites"],"mappings":"kSAAA,SAASA,yBAAyBC,KAGjC,OAAOC,QAAQC,UAAUC,MAAK,WAC7B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBL,IAAM,KAEjD,MADAI,EAAEE,KAAO,mBACHF,CACP,GACD,CACAL,yBAAyBQ,KAAO,WAAa,MAAO,EAAI,EACxDR,yBAAyBG,QAAUH,yBACnCS,OAAOC,QAAUV,yBACjBA,yBAAyBW,GAAK,sD,+HCV9B,mxBAoBA,+BAiBC,6BACCC,MACAC,GACAC,WACAC,SACAC,iBACAC,cACAC,0BACAC,WACQC,kBACAC,gBACAC,QACAC,oBAHA,KAAAH,oCACA,KAAAC,gCACA,KAAAC,gBACA,KAAAC,sCAlBD,KAAAC,OAAiB,EACjB,KAAAC,UAAoB,EACpB,KAAAC,QAAkB,EAClB,KAAAC,mBAAwB,6EAAmBC,wBAAuB,uBAiBzEC,KAAKC,KAAOlB,MACZiB,KAAKE,EAAIlB,GACTgB,KAAKG,UAAYlB,WACjBe,KAAKI,QAAUlB,SACfc,KAAKK,cAAgB,IACrBL,KAAKb,iBAAmBA,iBACxBa,KAAKM,UAAYlB,cACjBY,KAAKO,mBAAqBP,KAAKb,iBAAiBqB,eAAeC,mBAC/DT,KAAKX,0BAA4BA,0BACjCW,KAAKU,cAAgBpB,UACtB,CA2FD,OAzFC,8BAAAqB,uBA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C,wBAAwBhH,WAAWilF,oBAAoB/kF,kBAC/F6kF,sBAAwBh+E,qBAAqBC,wBAAwBhH,WAAWilF,oBAAoB1kF,aACpGykF,oBAAsB,+DAAY3D,8BAA8Bt6E,qBAAqBC,wBAAwBhH,WAAWilF,oBAAoBC,YAE5In6E,QAAQtK,MAAM,mEAGlBsK,QAAQtK,MAAM,yBAA0B0mC,IAAI3jC,SAE5C,IAAM2hF,gBAAkB5hF,iBAAiB2B,oBACzCigF,gBAAgB//E,SAAS,UAAW+hC,IAAI3jC,SACxC2hF,gBAAgB//E,SAAS,YAAa,kEAAW05B,uBAEjDv7B,iBAAiBwL,aAAahQ,OAAQooC,IAAKg+C,gBAAiBngF,UAAWA,UAAW,kFAAmBgK,UACrG,yFAAuBikE,kBAAkBkS,gBAAiBpmF,OAAS+lF,iBAAkBC,sBAAuBC,oB,+CC7GhHjoF,OAAOC,QAAUue,O","file":"ng2Main.bundle.js","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"F6A22FA4/./src/$$_lazy_route_resource lazy recursive\";","import { IRootScope } from \"../../js/interfaces/IRootScope\";\r\nimport { ILogger } from \"../../js/interfaces/ILogger\";\r\nimport { FxpConstants, PerfMarkers, ApplicationConstants } from \"../../js/common/ApplicationConstants\";\r\nimport { FxpMessageService } from \"../banner/FxpMessageService\";\r\nimport { FxpConfigurationService } from \"../../js/services/FxpConfiguration\";\r\nimport { UserClaimsService } from \"../../js/services/UserClaimsService\"\r\nimport { UserInfoService } from \"../../js/services/UserInfoService\";\r\nimport { IFxPService } from \"../../js/interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"../../js/services/fxp.global.store.service\";\r\nimport { setAdminTiles } from \"./adminTile.action\";\r\nimport { TelemetryConstants } from \"../../js/telemetry/TelemetryConst\";\r\nimport { ErrorCodes } from \"../../js/constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../../js/telemetry/ErrorSeverityLevel\";\r\nimport { MsalAuthenticationService } from \"../../js/services/MsalAuthenticationService\";\r\ndeclare var _: any; \r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n\r\nexport class AdminLandingService implements IFxPService {\r\n\tprivate http: angular.IHttpService;\r\n\tprivate q: angular.IQService;\r\n\tprivate rootScope: IRootScope;\r\n\tprivate timeout: angular.ITimeoutService;\r\n\tprivate sleepInterval: number;\r\n\tprivate userAlias: string;\r\n\tprivate fxpConfiguration: FxpConfigurationService;\r\n\tprivate fxplogger: ILogger;\r\n\tprivate fxpServiceEndPoint: string;\r\n\tprivate msalAuthenticationService: MsalAuthenticationService;\r\n\tprivate iCount: number = 0;\r\n\tprivate iReqCount: number = 0;\r\n\tprivate iUCount: number = 0;\r\n\tprivate sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.AdminLandingService`;\r\n\tprivate fxpMessageSvc: FxpMessageService;\r\n\r\n\tconstructor(\r\n\t\t$http: angular.IHttpService, \r\n\t\t$q: angular.IQService, \r\n\t\t$rootScope: IRootScope, \r\n\t\t$timeout: angular.ITimeoutService, \r\n\t\tfxpConfiguration: FxpConfigurationService, \r\n\t\tloggerService: ILogger, \r\n\t\tmsalAuthenticationService: MsalAuthenticationService, \r\n\t\tfxpMessage: FxpMessageService, \r\n\t\tprivate userClaimsService: UserClaimsService, \r\n\t\tprivate userInfoService: UserInfoService, \r\n\t\tprivate $base64: any,\r\n\t\tprivate globalStoreService: FxpGlobalStoreService) \r\n\t{\r\n\t\tthis.http = $http;\r\n\t\tthis.q = $q;\r\n\t\tthis.rootScope = $rootScope;\r\n\t\tthis.timeout = $timeout;\r\n\t\tthis.sleepInterval = 100;\r\n\t\tthis.fxpConfiguration = fxpConfiguration;\r\n\t\tthis.fxplogger = loggerService;\r\n\t\tthis.fxpServiceEndPoint = this.fxpConfiguration.FxpAppSettings.FxpServiceEndPoint;\r\n\t\tthis.msalAuthenticationService = msalAuthenticationService;\r\n\t\tthis.fxpMessageSvc = fxpMessage;\r\n\t}\r\n\r\n\tGetAdminDataFromServer(): angular.IPromise {\r\n\t\tlet source = `${this.sourceForTelemetry}.GetAdminDataFromServer`;\r\n\t\tvar deferred = this.q.defer();\r\n\t\tvar self = this;\r\n\t\tself.userClaimsService.getUserRoles()\r\n\t\t\t.then(function (response) {\r\n\t\t\t\tlet userResouces = self.userClaimsService.getUserAdminResources();\r\n\t\t\t\t\r\n\t\t\t\tif (userResouces.toString() == \"\") {\r\n\t\t\t\t\treturn deferred.resolve([]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet userRoles = self.$base64.encode(response).toString();\r\n\t\t\t\tlet encodedUserResources = self.$base64.encode(userResouces).toString();\r\n\t\t\t\tvar url = self.fxpServiceEndPoint + \"/adminTiles/\";\r\n\t\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetAdminDataFromServer);\r\n\t\t\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\t\t\tself.iReqCount++;\r\n\t\t\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\t\t\tself.fxplogger.logError(source, \r\n\t\t\t\t\t\t\t\t\t\t\t\tself.rootScope.fxpUIConstants.UIMessages.GetAdminDataFailureError.ErrorMessageTitle, \r\n\t\t\t\t\t\t\t\t\t\t\t\tErrorCodes.OnGetAdminDataFromServerFailure,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\tErrorSeverityLevel.Medium);\r\n\t\t\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.GetAdminDataAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tself.timeout(function () {\r\n\t\t\t\t\t\tself.GetAdminDataFromServer();\r\n\t\t\t\t\t}, self.sleepInterval);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tself.iReqCount = 0;\r\n\t\t\t\t\tself.fxplogger.logTrace(source, \"getAdminDataFromServer\");\r\n\r\n\t\t\t\t\tlet requestHeaders = {};\r\n\t\t\t\t\trequestHeaders[ApplicationConstants.XUserClaimsToken] = userRoles;\r\n\t\t\t\t\trequestHeaders[ApplicationConstants.XTenantId] = window[\"tenantConfiguration\"].TenantId;\r\n\t\t\t\t\trequestHeaders[ApplicationConstants.XResources] = encodedUserResources;\r\n\t\t\t\t\tself.http({\r\n\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\turl: url,\r\n\t\t\t\t\t\theaders: requestHeaders\r\n\t\t\t\t\t}).then(function (response) {\r\n\t\t\t\t\t\tvar data = JSON.stringify(response.data);\r\n\t\t\t\t\t\tself.globalStoreService.GetPlatformStore().dispatch(setAdminTiles(JSON.parse(data)));\r\n\t\t\t\t\t\tvar sessionStorageKey = ApplicationConstants.FxpAdminData + \"_\" + self.userInfoService.getCurrentUser();\r\n\t\t\t\t\t\tsessionStorage[sessionStorageKey] = data;\r\n\t\t\t\t\t\tdeferred.resolve(response);\r\n\t\t\t\t\t}, function (error) {\r\n\t\t\t\t\t\tdeferred.reject(error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetAdminDataFromServer);\r\n\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\tGetAdminTileDetails(isRefresh: boolean): angular.IPromise {\r\n\t\tvar deferred = this.q.defer();\r\n\t\tvar self = this;\r\n\t\tvar adminTilesData;\r\n\t\tif (!isRefresh) {\r\n\t\t\tadminTilesData = !Object.keys(self.globalStoreService.GetPlatformState().AdminTiles).length ? self.GetAdminDataFromCache() : self.globalStoreService.GetPlatformState().AdminTiles;\r\n\t\t}\r\n\t\tif (adminTilesData == null) {\r\n\t\t\tself.GetAdminDataFromServer().then(function (response) {\r\n\t\t\t\tdeferred.resolve(response.data);\r\n\t\t\t}, function (error) {\r\n\t\t\t\tdeferred.reject(error);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tdeferred.resolve(adminTilesData);\r\n\t\t}\r\n\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\tGetAdminDataFromCache(): any {\r\n\t\tvar self = this;\r\n\t\tvar sessionStorageKey = ApplicationConstants.FxpAdminData + \"_\" + self.userInfoService.getCurrentUser();\r\n\t\tvar adminData = JSON.parse(window.sessionStorage.getItem(sessionStorageKey));\r\n\t\tself.globalStoreService.GetPlatformStore().dispatch(setAdminTiles(adminData));\r\n\t\treturn adminData;\r\n\t}\r\n\r\n}\r\n","import { IAdminTileGroup } from './adminTiles.model';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Actions } from './adminTile.action.types';\r\n\r\nexport const setAdminTiles = (payload: Array): IAction> => {\r\n return {\r\n type: Actions.SET_ADMIN_TILES,\r\n payload: payload\r\n }\r\n}\r\n\r\nexport const removeOboContext = (): IAction> => {\r\n return {\r\n type: Actions.REMOVE_OBO_CONTEXT,\r\n payload: []\r\n }\r\n}","export enum Actions {\r\n SET_ADMIN_TILES = \"SET_ADMIN_TILE\",\r\n REMOVE_OBO_CONTEXT= \"REMOVE_OBO_CONTEXT\"\r\n}","import { Reducer } from 'redux';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Actions } from './adminTile.action.types';\r\nimport { IAdminTileGroup } from './adminTiles.model';\r\n\r\nconst defaultState: Array = [];\r\n\r\nexport const AdminTileReducer: Reducer, IAction> = (\r\n state: Array = defaultState,\r\n action: IAction\r\n): Array => {\r\n\r\n switch(action.type) {\r\n case Actions.SET_ADMIN_TILES : {\r\n return action.payload;\r\n }\r\n case Actions.REMOVE_OBO_CONTEXT : {\r\n return defaultState;\r\n }\r\n }\r\n \r\n return state;\r\n}\r\n\r\n","import { IRootScope } from \"../../js/interfaces/IRootScope\";\r\nimport { FxpConfigurationService } from \"../../js/services/FxpConfiguration\";\r\nimport { ILogger } from \"../../js/interfaces/ILogger\";\r\nimport { FxpConstants } from \"../../js/common/ApplicationConstants\";\r\nimport { IFxPService } from \"../../js/interfaces/IFxpService\";\r\nimport { AddBanner, CloseBanner } from './banner.action';\r\nimport { IPlatformState } from '../store/platform.state.model';\r\nimport { FxpGlobalStoreService } from \"../../js/services/fxp.global.store.service\";\r\nimport { PlatformStoreFactory } from '../store/platform.store.factory';\r\nimport { TelemetryConstants } from \"../../js/telemetry/TelemetryConst\";\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to display all types of Messages like Error, Warning, Information\r\n * @class Fxp.Services.fxpMessageService\r\n * @classdesc A service to display all types of Messages like Error, Warning, Information\r\n * @example Example to create an instance of Fxp Message Service \r\n * //Initializing Fxp Message\r\n * angular.module('FxPApp').controller('AppController', ['fxpMessageService', AppController]);\r\n * function AppController(fxpMessageService, fxpConstants){ fxpMessageService.addMessage('message from FXP', Fxp.Common.Constants.FxpConstants.messageType.error); }\r\n */\r\nexport class FxpMessageService implements IFxPService {\r\n\tprivate $rootScope: IRootScope;\r\n\tprivate msgTimeout;\r\n\tprivate msgInterval;\r\n\tprivate $interval: angular.IIntervalService;\r\n\tprivate $timeout: any;\r\n\tprivate fxpConfigurationService: FxpConfigurationService;\r\n\tprivate trackIdLabel;\r\n\tprivate msgIDLabel;\r\n\tprivate controlIdToFocusOnClose: any;\r\n\tpublic showBanner: boolean;\r\n\r\n\tconstructor($rootScope: IRootScope, $interval: angular.IIntervalService, $timeout, fxpConfigurationService: FxpConfigurationService,\r\n\t\tprivate fxpLoggerService: ILogger, private globalStoreService: FxpGlobalStoreService) {\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope.messages = [];\r\n\t\tthis.$rootScope.messageClass = \"modal-hide\";\r\n\t\tthis.$interval = $interval;\r\n\t\tthis.msgTimeout = fxpConfigurationService.FxpAppSettings.FxpMessageTimeout;\r\n\t\tif (this.msgTimeout == \"\" || this.msgTimeout == null || isNaN(this.msgTimeout))\r\n\t\t\tthis.msgTimeout = 2000;\r\n\t\tthis.$rootScope.closeMessage = this.closeMessage.bind(this);\r\n\t\tthis.$rootScope.clearAndReload = this.clearAndReload.bind(this);\r\n\t\tthis.trackIdLabel = fxpConfigurationService.FxpBaseConfiguration.FxpConfigurationStrings.UIStrings.MessageToasterTrackId;\r\n\t\tthis.msgIDLabel = fxpConfigurationService.FxpBaseConfiguration.FxpConfigurationStrings.UIStrings.MessageID;\r\n\t\tthis.showBanner = true;\r\n\r\n\t\tPlatformStoreFactory.CreateIfNotExist(fxpLoggerService);\r\n\r\n\t\tthis.globalStoreService.SubscribeToPlatformState(\"Platform\", (platformState: IPlatformState) => {\r\n\t\t\tthis.updateBanners(platformState);\r\n\t\t});\r\n\t}\r\n\tprivate updateBanners(platformState: IPlatformState) {\r\n\t\tif (platformState.Banners && platformState.Banners.length != this.$rootScope.messages.length) {\r\n\t\t\tvar isNewMessageAdded = platformState.Banners.length > this.$rootScope.messages.length\r\n\t\t\tif (isNewMessageAdded) {\r\n\t\t\t\tvar msg = platformState.Banners[platformState.Banners.length - 1];\r\n\t\t\t\tthis.$rootScope.messages.push(msg);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0; i < this.$rootScope.messages.length; i++) {\r\n\t\t\t\t\tvar index = platformState.Banners.indexOf(this.$rootScope.messages[i]);\r\n\t\t\t\t\tif (index == -1) {\r\n\t\t\t\t\t\tthis.$rootScope.messages.splice(i, 1);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t* Displays Error/Warning/Information messages on FXP and Focus\r\n\t* @method Fxp.Services.fxpMessageService.addMessage \r\n\t* @param {string} a mandatory string value which contains Error/Warning/Information. \r\n\t* @param {string} a mandatory string value determing type of messsage Error/Warning/Information. \r\n\t* @example Example to invoke addMessage\r\n\t* fxpMessageService.addMessage('Error from FXP', fxpConstants.messageType.error);\r\n\t*/\r\n\taddMessage = function (message: any, messageType: string, doNotAutoClose?: boolean, trackingId?: string, messageID?: string, focusControlIdOnClose?: any) {\r\n\t\tvar self = this;\r\n\t\tthis.controlIdToFocusOnClose = focusControlIdOnClose;\r\n\t\tif (!this.showBanner) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!message || message.length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar $rootScope = this.$rootScope;\r\n\t\tvar msgTrackId = trackingId ? this.trackIdLabel + trackingId : \"\";\r\n\t\tvar msgID = messageID ? this.msgIDLabel + messageID : \"\";\r\n\r\n\t\tvar isMsgItemExist = $rootScope.messages.some(function (item) {\r\n\r\n\t\t\treturn item.MessageType == messageType && item.Message == message && item.trackId == msgTrackId && item.uniqueTransactionId == msgID;\r\n\t\t});\r\n\t\tif (isMsgItemExist) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar msg: any = {};\r\n\t\tmsg.msgDate = new Date();\r\n\t\tmsg.MessageType = messageType || FxpConstants.messageType.info;\r\n\t\tmsg.Message = message;\r\n\t\tmsg.show = true;\r\n\t\tmsg.trackId = msgTrackId;\r\n\t\tmsg.uniqueTransactionId = msgID;\r\n\r\n\t\tswitch (msg.MessageType) {\r\n\t\t\tcase FxpConstants.messageType.success:\r\n\t\t\t\tmsg.doNotAutoClose = (doNotAutoClose !== undefined && doNotAutoClose !== null) ? doNotAutoClose : false;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FxpConstants.messageType.error:\r\n\t\t\t\tmsg.doNotAutoClose = true; // Never auto close\r\n\t\t\t\tvar propbag = this.fxpLoggerService.createPropertyBag();\r\n\t\t\t\tvar errorMessageWithTrackingId = trackingId ? message + \" \" + trackingId : message;\r\n\t\t\t\tpropbag.addToBag(\"ErrorMessage\", errorMessageWithTrackingId);\r\n\t\t\t\tpropbag.addToBag(\"Location\", window.location.hash);\r\n\t\t\t\tthis.fxpLoggerService.logEvent(`${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpMessageService.addMessage`, `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.ErrorDisplayed`, propbag);\r\n\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t// Do not auotoclose unless it is asked explicitly\r\n\t\t\t\tmsg.doNotAutoClose = (doNotAutoClose !== undefined && doNotAutoClose !== null) ? doNotAutoClose : true;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t//Dispatch action to add banner\r\n\t\tself.globalStoreService.DispatchGlobalAction(\"Platform\", AddBanner(msg));\r\n\t\tthis.$rootScope.messageClass = this.$rootScope.messages.length > 0 ? \"modal-show\" : \"modal-hide\";\r\n\r\n\t\tif (this.isAnyBlockingMessageVisible())\r\n\t\t\tthis.$rootScope.messageClass += \" modal-blocker\";\r\n\r\n\t\tif (this.$rootScope.messages.length == 1 && $(\":focus\").length > 0) {\r\n\t\t\tthis.$rootScope.activeElement = $(\":focus\");\r\n\t\t}\r\n\r\n\t\tif (this.$rootScope.messages.length > 0) {\r\n\t\t\tlet timeout = setTimeout(function () {\r\n\t\t\t\tvar messagecontainers = $(\".message-container\");\r\n\t\t\t\tif (messagecontainers.length) {\r\n\t\t\t\t\tlet msgContainer = messagecontainers[$rootScope.messages.length - 1];\r\n\t\t\t\t\t$(\".\" + msgContainer.className + \" > button\").first().focus();\r\n\t\t\t\t}\r\n\t\t\t\tclearTimeout(timeout);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t\tif (!msg.doNotAutoClose) {\r\n\t\t\tthis.monitorMessages();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate monitorMessages() {\r\n\t\tif (this.msgInterval) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet $timeout = this.$timeout;\r\n\t\tlet timeout = this.msgTimeout;\r\n\t\tlet $rootScope = this.$rootScope;\r\n\t\tlet self = this;\r\n\t\tthis.msgInterval = this.$interval(function () {\r\n\t\t\tlet dt: any = new Date();\r\n\t\t\tlet diff: number;\r\n\t\t\tlet messageExists = false;\r\n\t\t\tfor (var i = self.globalStoreService.GetPlatformState().Banners.length - 1; i >= 0; i--) {\r\n\t\t\t\tvar message = self.globalStoreService.GetPlatformState().Banners[i];\r\n\t\t\t\tvar messageType = message.MessageType.toLowerCase();\r\n\r\n\t\t\t\tif ((messageType == \"success\" || messageType == \"warning\" || messageType == \"info\") && (!$rootScope.messages[i].doNotAutoClose)) {\r\n\t\t\t\t\tmessageExists = true;\r\n\t\t\t\t\tdiff = dt - message.msgDate;\r\n\t\t\t\t\tif (diff >= timeout)\r\n\t\t\t\t\t\tself.globalStoreService.DispatchGlobalAction(\"Platform\", CloseBanner(message));\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!messageExists) {\r\n\t\t\t\tself.$interval.cancel(self.msgInterval);\r\n\t\t\t\tself.msgInterval = null;\r\n\t\t\t}\r\n\t\t\tif ($rootScope.messages.length == 0) {\r\n\t\t\t\t$rootScope.messageClass = \"modal-hide\";\r\n\t\t\t\tif ($rootScope.activeElement) {\r\n\t\t\t\t\tlet timeout = $timeout(function () {\r\n\t\t\t\t\t\tif ($rootScope.activeElement)\r\n\t\t\t\t\t\t\t$rootScope.activeElement.focus();\r\n\t\t\t\t\t\t$rootScope.activeElement = undefined;\r\n\t\t\t\t\t\t$timeout.cancel(timeout);\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, 1000);\r\n\t}\r\n\r\n\t/**\r\n\t* An event handler whenever message close button is clicked.\r\n\t* @method Fxp.Services.fxpMessageService.closeMessage\r\n\t* @param {onject} message An object which is passed from the view.\r\n\t* @example Example to use closeMessage\r\n\t*
Close Message
;\r\n\t*
closeMessage
;\r\n\t*/\r\n\tcloseMessage = function (message) {\r\n\t\tvar self = this;\r\n\t\t//Dispatch action to close banner\r\n\t\tself.globalStoreService.DispatchGlobalAction(\"Platform\", CloseBanner(message));\r\n\t\tthis.$rootScope.messageClass = this.$rootScope.messages.length > 0 ? \"modal-show\" : \"modal-hide\";\r\n\t\tif (this.isAnyBlockingMessageVisible())\r\n\t\t\tthis.$rootScope.messageClass += \" modal-blocker\";\r\n\t\tif (this.$rootScope.messages.length == 0) {\r\n\t\t\tthis.$interval.cancel(this.msgInterval);\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (!self.controlIdToFocusOnClose) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (self.controlIdToFocusOnClose.focus) {\r\n\t\t\t\t\tself.controlIdToFocusOnClose.focus();\r\n\t\t\t\t}\r\n\t\t\t\telse if (typeof (self.controlIdToFocusOnClose) === 'string') {\r\n\t\t\t\t\t$('#' + self.controlIdToFocusOnClose).focus();\r\n\t\t\t\t}\r\n\t\t\t}, 0);\r\n\t\t}\r\n\t\telse\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tvar messagecontainers = $(\".message-container\");\r\n\t\t\t\tif (messagecontainers.length) {\r\n\t\t\t\t\tlet msgContainer = messagecontainers[messagecontainers.length - 1];\r\n\t\t\t\t\t$(\".\" + msgContainer.className + \" > button\").first().focus();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}, 100);\r\n\r\n\t}\r\n\r\n\tclearAndReload = function () {\r\n\t\tvar propbag = this.fxpLoggerService.createPropertyBag();\r\n\t\tpropbag.addToBag(\"Message\", \"User clicked reset application\");\r\n\t\tpropbag.addToBag(\"Location\", window.location.hash);\r\n\t\tthis.fxpLoggerService.logEvent(`${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpMessageService.clearAndReload`, `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.ResetApplication`, propbag);\r\n\t\twindow[\"localStorage\"].clear();\r\n\t\twindow[\"sessionStorage\"].clear();\r\n\t\twindow.location.reload();\r\n\t}\r\n\r\n\tprivate isAnyBlockingMessageVisible() {\r\n\r\n\t\treturn this.$rootScope.messages.some(e => e.MessageType == FxpConstants.messageType.error);\r\n\t}\r\n}\r\n","//action creators for Banner\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Banner } from \"./banner.model\"\r\nimport { BannerActionTypes } from './banner.action.types';\r\n\r\nexport const AddBanner = (payload: Banner): IAction => {\r\n return {\r\n type: BannerActionTypes.ADD_BANNER_MESSAGE,\r\n payload: payload\r\n }\r\n}\r\nexport const CloseBanner = (payload: Banner): IAction => {\r\n return {\r\n type: BannerActionTypes.CLOSE_BANNER_MESSAGE,\r\n payload: payload\r\n }\r\n}","export enum BannerActionTypes {\r\n ADD_BANNER_MESSAGE = \"ADD_BANNER_MESSAGE\",\r\n CLOSE_BANNER_MESSAGE = \"CLOSE_BANNER_MESSAGE\",\r\n}","import { Reducer } from 'redux'\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Banner } from \"./banner.model\"\r\nimport { BannerActionTypes } from './banner.action.types';\r\nconst defaultState: Array = [];\r\n\r\n\r\nexport const BannerReducer: Reducer, IAction> = (\r\n state: Array = defaultState,\r\n action: IAction\r\n): Array => {\r\n switch (action.type) {\r\n case BannerActionTypes.ADD_BANNER_MESSAGE: {\r\n return [...state, action.payload];\r\n }\r\n case BannerActionTypes.CLOSE_BANNER_MESSAGE: {\r\n var index = state.indexOf(action.payload);\r\n return [...state.slice(0, index), ...state.slice(index + 1)];\r\n }\r\n }\r\n\r\n return state;\r\n}","import { IAction } from 'redux-micro-frontend';\r\nimport { Claims } from '../claims/claims.model'\r\nimport { ClaimsActionTypes } from '../claims/claims.action.types';\r\nexport const AddLoggedInUserClaims = (userClaims: Claims): IAction => ({\r\n type: ClaimsActionTypes.ADD_LOGGED_IN_USER_CLAIMS,\r\n payload: userClaims,\r\n logEnabled: false\r\n});\r\n\r\nexport const AddCurrentUserClaims = (userClaims: Claims): IAction => ({\r\n type: ClaimsActionTypes.ADD_CURRENT_USER_CLAIMS,\r\n payload: userClaims,\r\n logEnabled: false\r\n});","export enum ClaimsActionTypes {\r\n ADD_CURRENT_USER_CLAIMS=\"ADD_CURRENT_USER_CLAIMS\",\r\n ADD_LOGGED_IN_USER_CLAIMS=\"ADD_LOGGED_IN_USER_CLAIMS\"\r\n}","import { Reducer } from 'redux';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Claims } from './claims.model';\r\nimport { ClaimsActionTypes } from './claims.action.types';\r\n\r\nconst defaultClaims: Claims = {} as Claims\r\n\r\nexport const ClaimsReducer: Reducer> = (\r\n state: Claims = defaultClaims,\r\n action: IAction): Claims => {\r\n\r\n if (action.type==ClaimsActionTypes.ADD_CURRENT_USER_CLAIMS || action.type == ClaimsActionTypes.ADD_LOGGED_IN_USER_CLAIMS) {\r\n return action.payload;\r\n }\r\n\r\n return state;\r\n}","import {\r\n Component,\r\n Injector} from '@angular/core';\r\nimport { createCustomElement } from '@angular/elements';\r\nimport { FxpSharedComponentLoader } from '@fxp/fxpsharedcomponentloader';\r\nimport { SharedComponentsModule, SharedComponentLoader} from '@fxp/angularcontrols';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n})\r\n\r\nexport class AppComponent {\r\n\r\n constructor(injector: Injector) {\r\n //define customElements\r\n const sharedComponentLoaderControl = createCustomElement(FxpSharedComponentLoader, {injector});\r\n customElements.define('fxp-shared-component-control', sharedComponentLoaderControl);\r\n }\r\n\r\n}\r\n\r\n","
\r\n \r\n \r\n \r\n
\r\n","import { Component, Inject, OnInit, ViewChild, ViewContainerRef, forwardRef } from '@angular/core';\r\nimport { StateService } from \"@uirouter/core\";\r\nimport { PartnerAppRegistrationService } from '../../../js/services/PartnerAppRegistrationService';\r\nimport { FxpLazyLoader } from '../../fxplazyloader';\r\nimport { LazyLoaderService } from \"../../../js/services/lazyLoaderService\";\r\nimport { PageLoaderService } from '../../loader/pageLoaderService';\r\nimport { FxpEventBroadCastService } from '../../../js/services/BroadCastingService';\r\nimport { FxpBroadcastedEvents } from '../../../js/services/FxpBroadcastedEvents';\r\nimport { FxpLoggerService } from '../../../js/telemetry/fxpLogger';\r\nimport { ComponentFramework } from '../../../js/common/enum/ComponentFramework';\r\nimport { ISharedComponentReference } from '../../../js/interfaces/ISharedComponentReference';\r\n\r\n@Component({\r\n selector: 'iris-launcher',\r\n templateUrl: './fxpbot.component.html'\r\n})\r\nexport class FxpBotLauncherComponent implements OnInit {\r\n\r\n constructor(\r\n @Inject(forwardRef(() => PageLoaderService)) public pageLoaderService: PageLoaderService,\r\n @Inject(forwardRef(() => LazyLoaderService)) public lazyLoadingService: LazyLoaderService,\r\n @Inject(forwardRef(() => FxpEventBroadCastService)) private fxpEventBroadCastService: FxpEventBroadCastService,\r\n @Inject(forwardRef(() => FxpLoggerService)) private fxpLoggerService: FxpLoggerService,\r\n @Inject(forwardRef(() => StateService)) private stateService: StateService,\r\n ) {\r\n\r\n }\r\n\r\n @ViewChild('container', { read: ViewContainerRef, static: false }) entry: ViewContainerRef;\r\n ngOnInit() {\r\n this.fxpEventBroadCastService.On(FxpBroadcastedEvents.OnLaunchIrisBot, this.showVirtualAssistant.bind(this));\r\n }\r\n\r\n showVirtualAssistant = function () {\r\n this.fxpLoggerService.renewCorrelationId();\r\n if (window[\"IsBotVisible\"] == undefined || !window[\"IsBotVisible\"]) {\r\n let self = this;\r\n this.pageLoaderService.fnShowPageLoader(\"Loading Bot...\");\r\n var FxpAppSettings = FxpAppSettings || window[\"FxpAppSettings\"] || {};\r\n const moduleBundle = FxpAppSettings.IrisModuleBundle;\r\n const bundle = FxpAppSettings.IrisBundle;\r\n this.lazyLoadingService.getInstance().load([moduleBundle, bundle], { serie: true }).then(function () {\r\n let route = self.stateService.get('iris-launcher');\r\n let ngComponent = route.childComponent;\r\n let ngModule = route.ngModule;\r\n\r\n setTimeout(function () {\r\n if (ngModule._ngModuleDefFactory) {\r\n //Module is AOT compiled\r\n let ngModuelRef = FxpLazyLoader.instantiateModule(ngModule);\r\n self.loadComponent(ngModuelRef, ngComponent);\r\n return;\r\n }\r\n\r\n FxpLazyLoader.compileAndLoadModule(ngModule).then(function (ngModuleRef) {\r\n self.loadComponent(ngModuleRef, ngComponent);\r\n }).catch((error) => {\r\n console.log(error);\r\n });\r\n }, 0);\r\n self.pageLoaderService.fnHidePageLoader();\r\n window[\"IsBotVisible\"] = true;\r\n });\r\n }\r\n }\r\n\r\n\r\n loadComponent(moduleRef: any, component: any): void {\r\n const self = this;\r\n try {\r\n let componentFactory = moduleRef.componentFactoryResolver.resolveComponentFactory(component);\r\n this.entry.createComponent(componentFactory, 0, moduleRef.injector);\r\n }\r\n catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { FxpBotLauncherComponent } from \"./fxpbot.component\";\r\n\r\n@NgModule ({\r\n declarations: [FxpBotLauncherComponent],\r\n entryComponents: [FxpBotLauncherComponent],\r\n providers: []\r\n})\r\n\r\n\r\n\r\nexport class FxpBotModule {}\r\n","
\r\n \r\n \r\n
\r\n {{unViewedTourCount}}\r\n
\r\n \r\n
\r\n","import { Component, Inject, OnInit, ViewChild, ViewContainerRef, forwardRef, ComponentRef } from '@angular/core';\r\nimport { PartnerAppRegistrationService } from '../../../js/services/PartnerAppRegistrationService';\r\nimport { FxpLazyLoader } from '../../fxplazyloader';\r\nimport { LazyLoaderService } from \"../../../js/services/lazyLoaderService\";\r\nimport { PageLoaderService } from '../../loader/pageLoaderService';\r\nimport { FxpEventBroadCastService } from '../../../js/services/BroadCastingService';\r\nimport { FxpBroadcastedEvents } from '../../../js/services/FxpBroadcastedEvents';\r\nimport { FxpLoggerService } from '../../../js/telemetry/fxpLogger';\r\n\r\n@Component({\r\n selector: 'page-tour',\r\n templateUrl: './pageTour.component.html'\r\n})\r\nexport class PageTourLauncherComponent implements OnInit {\r\n private pageTourComponent;\r\n private isPageTourFlyoutOpen: boolean;\r\n public unViewedTourCount: number;\r\n public showCountClass: string = 'hideCount';\r\n constructor(@Inject(forwardRef(() => PageLoaderService)) public pageLoaderService: PageLoaderService,\r\n @Inject(forwardRef(() => LazyLoaderService)) public lazyLoadingService: LazyLoaderService,\r\n @Inject(forwardRef(() => FxpEventBroadCastService)) private fxpEventBroadCastService: FxpEventBroadCastService,\r\n @Inject(forwardRef(() => FxpLoggerService)) private fxpLoggerService: FxpLoggerService\r\n ) {\r\n\r\n }\r\n\r\n @ViewChild('container', { read: ViewContainerRef, static: false }) entry: ViewContainerRef;\r\n ngOnInit() {\r\n this.isPageTourFlyoutOpen = false;\r\n this.initPageTourComponent();\r\n this.bindEventListeners();\r\n\r\n }\r\n\r\n initPageTourComponent = () =>{\r\n this.fxpLoggerService.renewCorrelationId();\r\n if (this.pageTourComponent == null) {\r\n let self = this;\r\n let pageTourBundle = PartnerAppRegistrationService.getBundlesForSharedComponent('pagetour', \"pagetour-flyout\");\r\n this.lazyLoadingService.getInstance().load(pageTourBundle, { serie: true }).then(function(){\r\n let route = PartnerAppRegistrationService.getSharedComponentDetails('pagetour', \"pagetour-flyout\");\r\n let ngComponent = route.component;\r\n let ngModule = route.ngModule;\r\n let ngModuelRef = FxpLazyLoader.instantiateModule(ngModule);\r\n let componentFactory = ngModuelRef.componentFactoryResolver.resolveComponentFactory(ngComponent);\r\n self.pageTourComponent = self.entry.createComponent(componentFactory);\r\n });\r\n }\r\n }\r\n\r\n bindEventListeners = () => {\r\n let self = this;\r\n self.fxpEventBroadCastService.On(FxpBroadcastedEvents.OnPageTourFlyoutOpened, (state)=>this.setPageTourFlyoutState(true));\r\n self.fxpEventBroadCastService.On(FxpBroadcastedEvents.OnPageTourFlyoutClosed, (state)=>this.setPageTourFlyoutState(false));\r\n self.fxpEventBroadCastService.On(\"ShowUnviewedTourCount\", function (event, props) {\r\n self.unViewedTourCount = props.get(\"unviewedTourCount\");\r\n if(self.unViewedTourCount > 0)\r\n self.showCountClass = 'showCount';\r\n });\r\n }\r\n\r\n setPageTourFlyoutState = (isOpen: boolean) =>{\r\n this.isPageTourFlyoutOpen = isOpen;\r\n }\r\n\r\n togglePageTour = () => {\r\n if (!this.isPageTourFlyoutOpen)\r\n this.showPageTourFlyout();\r\n else\r\n this.hidePageTourFlyout();\r\n }\r\n\r\n showPageTourFlyout = function () {\r\n if(this.isPageTourFlyoutOpen) return;\r\n this.fxpEventBroadCastService.broadCast(FxpBroadcastedEvents.ShowPageTour, true);\r\n }\r\n\r\n hidePageTourFlyout = () => {\r\n if(!this.isPageTourFlyoutOpen) return;\r\n if (this.pageTourComponent != null) {\r\n this.fxpEventBroadCastService.broadCast(FxpBroadcastedEvents.HidePageTour, true);\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { PageTourLauncherComponent } from \"./pageTour.component\";\r\n\r\n@NgModule ({\r\n declarations: [PageTourLauncherComponent],\r\n entryComponents: [PageTourLauncherComponent],\r\n providers: []\r\n})\r\n\r\n\r\n\r\nexport class FxpPageTourModule {}\r\n","\r\n","import { Component, OnInit, OnDestroy, ViewContainerRef, ViewChild, Inject, forwardRef, NgModuleFactory, CompilerFactory } from \"@angular/core\";\r\nimport { StateService } from \"@uirouter/core\";\r\nimport { FxpLazyLoader } from \"../../../app/fxplazyloader\"\r\nimport { PageLoaderService } from \"../../loader/pageLoaderService\";\r\nimport { PartnerStateService } from \"./partnerStateService\";\r\nimport { FxpMessageService } from \"../../banner/FxpMessageService\";\r\nimport { FxpConstants } from \"../../../js/common/ApplicationConstants\";\r\nimport { PartnerAppRegistrationService } from \"../../../js/services/PartnerAppRegistrationService\";\r\nimport { TelemetryConstants } from \"../../../js/telemetry/TelemetryConst\";\r\nimport { ErrorSeverityLevel } from \"../../../js/telemetry/ErrorSeverityLevel\";\r\nimport { ErrorCodes } from \"../../../js/constants/errorCodes\";\r\nimport { FxpLoggerService } from \"../../../js/telemetry/fxpLogger\";\r\n\r\n@Component({\r\n selector: 'fxp-app-partnerapp',\r\n templateUrl: \"./partnerContainer-component.html\"\r\n})\r\nexport class PartnerContainerComponent implements OnInit, OnDestroy {\r\n\r\n @ViewChild('container', { read: ViewContainerRef, static: false }) entry: ViewContainerRef;\r\n componentRef: any;\r\n\r\n currentStateName: string;\r\n sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.PartnerContainerComponent`;\r\n\r\n constructor(\r\n @Inject(forwardRef(() => StateService)) private stateService: StateService,\r\n @Inject(forwardRef(() => PageLoaderService)) private fxpLoaderService: PageLoaderService,\r\n @Inject(forwardRef(() => FxpLoggerService)) private fxpLoggerService: FxpLoggerService,\r\n @Inject(forwardRef(() => FxpMessageService)) private fxpMessageService: FxpMessageService,\r\n @Inject(PartnerStateService) private fxpPartnerStateService: PartnerStateService,\r\n @Inject(CompilerFactory) private compilerFactory: CompilerFactory\r\n ) {\r\n FxpLazyLoader.setCompilerFactory(this.compilerFactory);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.componentRef) {\r\n this.entry.clear();\r\n this.componentRef = null;\r\n }\r\n this.fxpPartnerStateService.remove(this.currentStateName);\r\n }\r\n\r\n ngOnInit(): void {\r\n const currentState: any = this.stateService.$current;\r\n\r\n window.addEventListener(\"beforeunload\", function (e) {\r\n if(window[\"_showPageDirtyPopup\"]){\r\n var confirmationMessage = \"\\o/\";\r\n e.returnValue = confirmationMessage; \r\n return confirmationMessage;\r\n }\r\n });\r\n\r\n if (!currentState.ngModule || !currentState.childComponent){\r\n currentState.path.forEach(path => {\r\n if (path.name && path.data && path.data.partnerAppName && (!path.childComponent || !path.ngModule)) {\r\n let routeInfo = PartnerAppRegistrationService.getRegisteredAppRoute(path.data.partnerAppName, path.name);\r\n if (routeInfo) {\r\n path.childComponent = routeInfo.component;\r\n path.ngModule = routeInfo.ngModule;\r\n \r\n if (routeInfo.sticky && routeInfo.views) {\r\n let name = Object.keys(routeInfo.views)[0]; // sticky:true requires there to be a named view in the `views` attribute\r\n path.childComponent = routeInfo.views[name].component;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n \r\n\r\n let ngModule = currentState.ngModule;\r\n let component = currentState.childComponent;\r\n const self = this;\r\n\r\n if (!ngModule) {\r\n let message = \"Reference to module is misisng in route configuration. Please set ngModule property of route config.\";\r\n this.fxpMessageService.addMessage(message, FxpConstants.messageType.error, true);\r\n console.error(message);\r\n return;\r\n }\r\n const moduleName = (ngModule.moduleType && ngModule.moduleType.name)? ngModule.moduleType.name : ngModule.name;\r\n const timerLabel = \"PartnerModule \" + moduleName + \" compilation: \";\r\n this.fxpLoaderService.fnShowPageLoader(\"Loading...\");\r\n let currentStateHandle: any;\r\n currentStateHandle = currentState;\r\n\r\n while (currentStateHandle.parent && currentStateHandle.parent.childComponent && !this.fxpPartnerStateService.contains(currentStateHandle.parent.name)) {\r\n currentStateHandle = currentStateHandle.parent;\r\n }\r\n\r\n this.fxpPartnerStateService.addState(currentStateHandle.name);\r\n this.currentStateName = currentStateHandle.name;\r\n component = currentStateHandle.childComponent;\r\n ngModule = currentStateHandle.ngModule;\r\n\r\n setTimeout(function () {\r\n if (ngModule._ngModuleDefFactory) {\r\n //Module is AOT compiled\r\n let ngModuelRef = FxpLazyLoader.instantiateModule(ngModule);\r\n self.loadComponent(ngModuelRef, component);\r\n console.time(timerLabel);\r\n return;\r\n }\r\n\r\n FxpLazyLoader.compileAndLoadModule(ngModule).then(function (ngModuleRef) {\r\n console.timeEnd(timerLabel);\r\n self.loadComponent(ngModuleRef, component);\r\n }).catch((error) => {\r\n let message = \"An error occured while compiling angular module: \" + ngModule.name + \". Please see the browser console for more details. \";\r\n let properties = self.fxpLoggerService.createPropertyBag();\r\n properties.addToBag(\"ngModuleName\", ngModule.name);\r\n self.fxpLoggerService.logException(`${self.sourceForTelemetry}.NgOnInit`, error, properties, null, null, ErrorSeverityLevel.Critical, ErrorCodes.ModuleCompilationError);\r\n self.fxpMessageService.addMessage(message, FxpConstants.messageType.error, true);\r\n console.error(message);\r\n console.error(error);\r\n self.fxpLoaderService.fnHidePageLoader();\r\n });\r\n }, 0);\r\n }\r\n\r\n loadComponent(moduleRef: any, component: any): void {\r\n const self = this;\r\n try {\r\n const label = \"Loading partner component: \" + component.name;\r\n console.time(label);\r\n let componentFactory = moduleRef.componentFactoryResolver.resolveComponentFactory(component);\r\n const currentState: any = this.stateService.$current\r\n if (currentState.includeRootModule) {\r\n this.componentRef = this.entry.createComponent(componentFactory, 0, moduleRef.injector);\r\n }\r\n else {\r\n this.componentRef = this.entry.createComponent(componentFactory, undefined, undefined, undefined, moduleRef);\r\n }\r\n\r\n this.fxpLoaderService.fnHidePageLoader();\r\n console.timeEnd(label);\r\n }\r\n catch (error) {\r\n let message = \"An error occured while instantiating the component: \" + component.name + \" of Module: \" + moduleRef.instance.constructor.name + \". Please see the browser console for more details. \";\r\n let properties = self.fxpLoggerService.createPropertyBag();\r\n properties.addToBag(\"ComponentName\", component.name);\r\n self.fxpLoggerService.logException(`${self.sourceForTelemetry}.LoadComponent`, error, properties, null, null, ErrorSeverityLevel.Critical, ErrorCodes.ErrorInstantiatingComponent);\r\n self.fxpMessageService.addMessage(message, FxpConstants.messageType.error, true);\r\n console.error(message);\r\n console.error(error);\r\n self.fxpLoaderService.fnHidePageLoader();\r\n }\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\n\r\n@Injectable()\r\nexport class PartnerStateService {\r\n\r\n private _currentStateName: Array = [];\r\n\r\n public get RunningStates(){\r\n return this._currentStateName;\r\n }\r\n\r\n public addState(stateName:string){\r\n this._currentStateName.push(stateName);\r\n }\r\n\r\n public clear(){\r\n this._currentStateName = [];\r\n }\r\n\r\n public contains(stateName:string){\r\n return this._currentStateName.indexOf(stateName) != -1; \r\n }\r\n\r\n public remove(stateName:string){\r\n this._currentStateName = this._currentStateName.filter(function(item){\r\n return item !== stateName\r\n });\r\n }\r\n}\r\n","
\r\n
","import {\r\n Component,\r\n ElementRef,\r\n forwardRef,\r\n Inject,\r\n OnDestroy,\r\n OnInit,\r\n ViewChild,\r\n} from \"@angular/core\";\r\nimport * as pbi from \"powerbi-client\";\r\n\r\nimport { StateService } from \"@uirouter/angular\";\r\nimport { CommonUtils } from \"../../../js/utils/CommonUtils\";\r\nimport { FxpMessageService } from \"../../banner/FxpMessageService\";\r\nimport { FxpConstants } from \"../../../js/common/ApplicationConstants\";\r\nimport { PageLoaderService } from \"../../loader/pageLoaderService\";\r\nimport { ErrorCodes } from \"../../../js/constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../../../js/telemetry/ErrorSeverityLevel\";\r\nimport { FxpLoggerService } from \"../../../js/telemetry/fxpLogger\";\r\nimport { TelemetryConstants } from \"../../../js/telemetry/TelemetryConst\";\r\nimport { FeatureUsageEvent } from \"../../../js/telemetry/FeatureUsageEvent\";\r\nimport {\r\n ActionStatus,\r\n ActionType,\r\n ComponentType,\r\n EventName,\r\n} from \"@microsoftit/telemetry-extensions-npm\";\r\nimport { FxpConfigurationService } from \"../../../js/services/FxpConfiguration\";\r\nimport { UserInfoService } from \"../../../js/services/UserInfoService\";\r\nimport { LogPropertyBag } from \"../../../js/telemetry/LogPropertyBag\";\r\nimport { MsalAuthenticationService } from \"../../../js/services/MsalAuthenticationService\";\r\n\r\nconst PowerBiFeatureName = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxPPowerBiIntegration`;\r\n@Component({\r\n selector: \"fxp-app-powerbi-container\",\r\n templateUrl: \"./powerbi-container-component.html\",\r\n})\r\nexport class PowerBIReportContainerComponent implements OnInit, OnDestroy {\r\n private sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.PowerBIReportContainerComponent`;\r\n\r\n @ViewChild(\"reportContainer\", {\r\n static: false,\r\n })\r\n reportContainer: ElementRef;\r\n\r\n constructor(\r\n @Inject(forwardRef(() => MsalAuthenticationService))\r\n private msalAuthenticationService: MsalAuthenticationService,\r\n @Inject(forwardRef(() => FxpLoggerService))\r\n private fxpLoggerService: FxpLoggerService,\r\n @Inject(forwardRef(() => PageLoaderService))\r\n private pageLoaderService: PageLoaderService,\r\n @Inject(forwardRef(() => FxpMessageService))\r\n private fxpMessageService: FxpMessageService,\r\n @Inject(forwardRef(() => FxpConfigurationService))\r\n private fxpConfigurationService: FxpConfigurationService,\r\n @Inject(StateService) public stateService: StateService,\r\n @Inject(forwardRef(() => UserInfoService))\r\n private userInfoService: UserInfoService\r\n ) {}\r\n\r\n ngOnInit(): void {\r\n let self = this;\r\n self.preReportRender();\r\n\r\n const embededReportId = self.stateService.params.reportId\r\n ? self.stateService.params.reportId\r\n : \"\";\r\n const embededDashboardId = self.stateService.params.dashboardId\r\n ? self.stateService.params.dashboardId\r\n : \"\";\r\n let powerBiBaseUrl =\r\n self.fxpConfigurationService.FxpAppSettings.PowerBiReportBaseUrl;\r\n\r\n const powerBiService = new pbi.service.Service(\r\n pbi.factories.hpmFactory,\r\n pbi.factories.wpmpFactory,\r\n pbi.factories.routerFactory\r\n );\r\n const properties = self.fxpLoggerService.createPropertyBag();\r\n\r\n if (CommonUtils.isNullOrEmpty(powerBiBaseUrl)) {\r\n powerBiBaseUrl = \"https://app.powerbi.com\";\r\n }\r\n\r\n if (!CommonUtils.isNullOrEmpty(embededReportId)) {\r\n self.showReport(\r\n embededReportId,\r\n powerBiBaseUrl,\r\n powerBiService,\r\n properties\r\n );\r\n } else if (!CommonUtils.isNullOrEmpty(embededDashboardId)) {\r\n self.showDashBoard(\r\n embededReportId,\r\n powerBiBaseUrl,\r\n powerBiService,\r\n properties\r\n );\r\n } else {\r\n self.showError(properties);\r\n }\r\n }\r\n\r\n preReportRender() {\r\n let self = this;\r\n self.pageLoaderService.fnShowPageLoader(\"Loading...\");\r\n self.fxpLoggerService.renewCorrelationId();\r\n }\r\n\r\n showReport(\r\n embededReportId: string,\r\n powerBiBaseURL: string,\r\n powerBiService: pbi.service.Service,\r\n properties: LogPropertyBag\r\n ) {\r\n let self = this;\r\n const powerBiFeatureUsageEvent = new FeatureUsageEvent(\r\n `${PowerBiFeatureName}`,\r\n ActionType.User,\r\n \"PowerBIReportLoad\",\r\n EventName.PageLoad,\r\n ComponentType.Web\r\n );\r\n self.fxpLoggerService.startFeatureUsageEvent(powerBiFeatureUsageEvent);\r\n\r\n const source = `${self.sourceForTelemetry}.ShowReport`;\r\n const embededUrl = `${powerBiBaseURL}/reportEmbed?reportId=${embededReportId}`;\r\n const settings = self.getReportSettings();\r\n\r\n const config: pbi.IEmbedConfiguration = {\r\n type: \"report\",\r\n id: embededReportId,\r\n embedUrl: embededUrl,\r\n filters: [],\r\n settings: settings,\r\n };\r\n\r\n properties.addToBag(\"embededReportId\", embededReportId);\r\n\r\n self\r\n .getAccessToken()\r\n .then((token) => {\r\n config.accessToken = token;\r\n const reportContainer = this.reportContainer.nativeElement;\r\n powerBiService.reset(reportContainer);\r\n const powerBiReport = (\r\n powerBiService.embed(reportContainer, config)\r\n );\r\n self.attachEventHandlers(\r\n powerBiReport,\r\n source,\r\n powerBiFeatureUsageEvent,\r\n properties\r\n );\r\n })\r\n .finally(() => {\r\n setTimeout(function () {\r\n self.pageLoaderService.fnHidePageLoader();\r\n }, 0);\r\n });\r\n }\r\n\r\n showDashBoard(\r\n embededDashBoardId: string,\r\n powerBiBaseURL: string,\r\n powerBiService: pbi.service.Service,\r\n properties: LogPropertyBag\r\n ) {\r\n let self = this;\r\n const powerBiFeatureUsageEvent = new FeatureUsageEvent(\r\n `${PowerBiFeatureName}`,\r\n ActionType.User,\r\n \"PowerBIDashBoardLoad\",\r\n EventName.PageLoad,\r\n ComponentType.Web\r\n );\r\n self.fxpLoggerService.startFeatureUsageEvent(powerBiFeatureUsageEvent);\r\n\r\n const source = `${self.sourceForTelemetry}.ShowDashBoard`;\r\n const embededUrl = `${powerBiBaseURL}/dashboardEmbed?${embededDashBoardId}`;\r\n\r\n let config: pbi.IEmbedConfiguration = {\r\n type: \"dashboard\",\r\n id: embededDashBoardId,\r\n embedUrl: embededUrl,\r\n filters: [],\r\n };\r\n properties.addToBag(\"embededDashBoardId\", embededDashBoardId);\r\n self\r\n .getAccessToken()\r\n .then((token) => {\r\n config.accessToken = token;\r\n const dashBoardContainer = this.reportContainer.nativeElement;\r\n powerBiService.reset(dashBoardContainer);\r\n const powerBiDashBoard = (\r\n powerBiService.embed(dashBoardContainer, config)\r\n );\r\n self.attachEventHandlers(\r\n powerBiDashBoard,\r\n source,\r\n powerBiFeatureUsageEvent,\r\n properties\r\n );\r\n })\r\n .finally(() => {\r\n setTimeout(function () {\r\n self.pageLoaderService.fnHidePageLoader();\r\n }, 0);\r\n });\r\n }\r\n\r\n showError(properties: LogPropertyBag) {\r\n let self = this;\r\n const source = `${self.sourceForTelemetry}.ShowReport`;\r\n self.fxpLoggerService.logError(\r\n source,\r\n \"Invalid configuration for the report. Missing DashboardId and ReportId\",\r\n ErrorCodes.PowerBI_Invalid_Configuration,\r\n null,\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.High\r\n );\r\n self.fxpMessageService.addMessage(\r\n \"System Error has occurred. If the problem persists, please contact IT support.\",\r\n FxpConstants.messageType.error\r\n );\r\n return;\r\n }\r\n\r\n attachEventHandlers(\r\n powerBiComponent: pbi.Report | pbi.Dashboard,\r\n source: string,\r\n featureUsageEvent: FeatureUsageEvent,\r\n properties: LogPropertyBag\r\n ) {\r\n if (powerBiComponent instanceof pbi.Report) {\r\n this.handlePowerBiLoaded(powerBiComponent, source, properties);\r\n }\r\n this.handlePowerBiRendered(\r\n powerBiComponent,\r\n source,\r\n featureUsageEvent,\r\n properties\r\n );\r\n this.handlePowerBiError(\r\n powerBiComponent,\r\n source,\r\n featureUsageEvent,\r\n properties\r\n );\r\n }\r\n\r\n handlePowerBiLoaded(\r\n powerBiReport: pbi.Report,\r\n source: string,\r\n properties: LogPropertyBag\r\n ) {\r\n let self = this;\r\n powerBiReport.off(\"loaded\");\r\n powerBiReport.on(\"loaded\", (event) => {\r\n self.fxpLoggerService.logEvent(\r\n source,\r\n \"FxpPlatform.PowerBIModule.ReportLoaded\",\r\n properties\r\n );\r\n powerBiReport.getFilters().then((filters) => {\r\n const updatedFilters = self.getUpdatedFilters(filters);\r\n powerBiReport.setFilters(updatedFilters).then(() => {\r\n self.fxpLoggerService.logEvent(\r\n source,\r\n \"FxpPlatform.PowerBIModule.ReportFiltersUpdated\",\r\n properties\r\n );\r\n });\r\n });\r\n });\r\n }\r\n\r\n handlePowerBiRendered(\r\n powerBiComponent: pbi.Report | pbi.Dashboard,\r\n source: string,\r\n featureUsageEvent: FeatureUsageEvent,\r\n properties: LogPropertyBag\r\n ) {\r\n let self = this;\r\n powerBiComponent.off(\"rendered\");\r\n powerBiComponent.on(\"rendered\", (event) => {\r\n let propForEvents = CommonUtils.clone(properties);\r\n let propForFeature = CommonUtils.clone(properties);\r\n self.fxpLoggerService.logEvent(\r\n source,\r\n \"FxpPlatform.PowerBIModule.PowerBiRendered\",\r\n propForEvents\r\n );\r\n featureUsageEvent.ActionStatus = ActionStatus.Succeeded;\r\n self.fxpLoggerService.endFeatureUsageEvent(\r\n source,\r\n featureUsageEvent,\r\n propForFeature\r\n );\r\n });\r\n }\r\n\r\n handlePowerBiError(\r\n powerBiComponent: pbi.Report | pbi.Dashboard,\r\n source: string,\r\n featureUsageEvent: FeatureUsageEvent,\r\n properties: LogPropertyBag\r\n ) {\r\n let self = this;\r\n const accessRequestUrl = this.stateService.params.accessRequestUrl\r\n ? this.stateService.params.accessRequestUrl\r\n : \"\";\r\n\r\n powerBiComponent.off(\"error\");\r\n powerBiComponent.on(\"error\", (event) => {\r\n properties.addToBag(\"errorDetails\", JSON.stringify(event.detail));\r\n let errorMessage = \"\";\r\n if (event.detail && event.detail[\"message\"])\r\n errorMessage = event.detail[\"message\"];\r\n self.fxpLoggerService.logError(\r\n source,\r\n \"Error rendering powerbi component: \" + errorMessage,\r\n ErrorCodes.PowerBI_OnError,\r\n null,\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.Medium\r\n );\r\n featureUsageEvent.ActionStatus = ActionStatus.Failed;\r\n self.fxpLoggerService.endFeatureUsageEvent(\r\n source,\r\n featureUsageEvent,\r\n properties\r\n );\r\n if (accessRequestUrl && accessRequestUrl !== \"\")\r\n self.fxpMessageService.addMessage(\r\n `Seems you have insufficient access. Please visit [PSDL Portal](${accessRequestUrl}) to raise access`,\r\n FxpConstants.messageType.error\r\n );\r\n else\r\n self.fxpMessageService.addMessage(\r\n \"Error rendering powerbi component\",\r\n FxpConstants.messageType.error\r\n );\r\n this.pageLoaderService.fnHidePageLoader();\r\n });\r\n }\r\n\r\n getReportSettings(): pbi.IEmbedSettings {\r\n const settings: pbi.IEmbedSettings = {\r\n filterPaneEnabled: true,\r\n navContentPaneEnabled: true,\r\n };\r\n return settings;\r\n }\r\n\r\n getUpdatedFilters(\r\n existingFilters: pbi.models.IFilter[]\r\n ): pbi.models.IFilter[] {\r\n const newFilters = this.getNewFilters();\r\n\r\n for (const newFilter of newFilters) {\r\n let existingFilterIndex = existingFilters.findIndex((existingFilter) => {\r\n const target: any = existingFilter.target;\r\n return (\r\n newFilter.target.table == target.table &&\r\n newFilter.target.column == target.column\r\n );\r\n });\r\n\r\n if (existingFilterIndex == -1) existingFilters.push(newFilter);\r\n else existingFilters[existingFilterIndex] = newFilter;\r\n }\r\n return existingFilters;\r\n }\r\n\r\n getNewFilters(): any {\r\n const profile = this.userInfoService.getCurrentUserProfile();\r\n let filters = this.stateService.params.filters;\r\n let newFilters = [];\r\n\r\n for (const filter of filters) {\r\n if (\r\n filter.operator &&\r\n filter.values &&\r\n filter.target &&\r\n filter.displaySettings\r\n ) {\r\n let values = [];\r\n\r\n for (const value of filter.values) {\r\n values.push(this.getValueForFilter(value, profile));\r\n }\r\n\r\n newFilters.push({\r\n $schema:\r\n this.fxpConfigurationService.FxpAppSettings.PowerBiFilterSchemaUrl,\r\n displaySettings: {\r\n displayName: filter.displaySettings.displayName,\r\n },\r\n target: {\r\n table: filter.target.table,\r\n column: filter.target.column,\r\n },\r\n operator: filter.operator,\r\n values: values,\r\n filterType: pbi.models.FilterType.Basic,\r\n });\r\n }\r\n }\r\n return newFilters;\r\n }\r\n\r\n getValueForFilter(value: string, profile): string {\r\n const filterValueRegExp = new RegExp(\r\n this.fxpConfigurationService.FxpAppSettings.PowerBiFilterValueRegularExpression\r\n );\r\n if (filterValueRegExp.test(value)) {\r\n let result = filterValueRegExp.exec(value);\r\n return profile[result[1]];\r\n }\r\n return value;\r\n }\r\n\r\n getAccessToken(): Promise {\r\n let powerBITokenURL =\r\n this.fxpConfigurationService.FxpAppSettings.PowerBiEndpoint;\r\n if (CommonUtils.isNullOrEmpty(powerBITokenURL)) {\r\n powerBITokenURL = \"https://api.powerbi.com\";\r\n }\r\n\r\n const source = `${this.sourceForTelemetry}.GetAccessToken`;\r\n const self = this;\r\n return new Promise((resolve, reject) => {\r\n self.msalAuthenticationService\r\n .acquireTokenAsPromise(powerBITokenURL)\r\n .then((token) => {\r\n resolve(token.accessToken);\r\n })\r\n .catch((error) => {\r\n reject(error);\r\n const properties = self.fxpLoggerService.createPropertyBag();\r\n properties.addToBag(\"API\", powerBITokenURL);\r\n self.fxpLoggerService.logError(\r\n source,\r\n `Failed to acquire access token for ${powerBITokenURL}`,\r\n ErrorCodes.PowerBI_Token_Failure,\r\n null,\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.High\r\n );\r\n self.fxpMessageService.addMessage(\r\n \"System Error has occurred. Please try again. If the problem persists, please contact IT support.\",\r\n FxpConstants.messageType.error\r\n );\r\n });\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {}\r\n}\r\n","
\r\n
","import * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { UiView } from '@fxp/reactrouter';\r\nimport { StateService } from '@uirouter/core';\r\nimport { FxpLazyLoader } from \"../../../app/fxplazyloader\";\r\nimport { FxpMessageService } from \"../../banner/FxpMessageService\";\r\nimport { FxpConstants } from \"../../../js/common/ApplicationConstants\";\r\nimport { PageLoaderService } from \"../../loader/pageLoaderService\";\r\nimport { FxpGlobalStoreService } from \"../../../js/services/fxp.global.store.service\";\r\nimport { PartnerStateService } from \"../partnerContainer-component/partnerStateService\";\r\nimport { Component, ViewChild, Inject, forwardRef, CompilerFactory, ElementRef, AfterViewInit, OnInit } from \"@angular/core\";\r\nimport { TelemetryConstants } from '../../../js/telemetry/TelemetryConst';\r\nimport { FxpLoggerService } from '../../../js/telemetry/fxpLogger';\r\nimport { ErrorSeverityLevel } from '../../../js/telemetry/ErrorSeverityLevel';\r\nimport { ErrorCodes } from '../../../js/constants/errorCodes';\r\n\r\n@Component({\r\n selector: 'fxp-app-partnerreactapp',\r\n templateUrl: \"./reactpartner-component.html\"\r\n})\r\nexport class ReactPartnerContainerComponent implements AfterViewInit, OnInit {\r\n @ViewChild('container1', { read: ElementRef, static: false }) entry: ElementRef;\r\n componentRef: any;\r\n currentStateName: string;\r\n sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.ReactPartnerContainerComponent`;\r\n stateChangeUnsubscribeCaller: () => void;\r\n\r\n constructor(\r\n @Inject(forwardRef(() => PageLoaderService)) private fxpLoaderService: PageLoaderService,\r\n @Inject(forwardRef(() => FxpLoggerService)) private fxpLoggerService: FxpLoggerService,\r\n @Inject(forwardRef(() => FxpMessageService)) private fxpMessageService: FxpMessageService,\r\n @Inject(forwardRef(() => FxpGlobalStoreService)) private globalStore: FxpGlobalStoreService,\r\n @Inject(forwardRef(() => StateService)) private stateService: StateService,\r\n @Inject(PartnerStateService) private fxpPartnerStateService: PartnerStateService,\r\n @Inject(CompilerFactory) private compilerFactory: CompilerFactory\r\n ) {\r\n FxpLazyLoader.setCompilerFactory(this.compilerFactory);\r\n }\r\n ngOnInit(): void {\r\n window.addEventListener(\"beforeunload\", function (e) {\r\n if(window[\"_showPageDirtyPopup\"]){\r\n var confirmationMessage = \"\\o/\";\r\n e.returnValue = confirmationMessage; \r\n return confirmationMessage;\r\n }\r\n });\r\n }\r\n ngOnDestroy(): void {\r\n this.fxpPartnerStateService.remove(this.currentStateName);\r\n if (this.stateChangeUnsubscribeCaller) {\r\n this.stateChangeUnsubscribeCaller();\r\n }\r\n this.unloadComponent(this.entry.nativeElement);\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n const self = this;\r\n this.currentStateName = this.stateService.$current.name;\r\n this.fxpPartnerStateService.addState(this.currentStateName);\r\n this.loadComponent(self.entry.nativeElement);\r\n this.fxpLoaderService.fnHidePageLoader();\r\n\r\n this.stateChangeUnsubscribeCaller =\r\n this.globalStore.SubscribeToPartnerState(\"Fxp.ReactPartnerContainerComponent\", \"PLATFORM_ROUTER\", (routeState) => {\r\n if(window.location.hash === routeState[\"CurrentRoute\"][\"Url\"]){\r\n self.loadComponent(self.entry.nativeElement);\r\n }\r\n });\r\n }\r\n\r\n private loadComponent(nativeElement: any) {\r\n try {\r\n ReactDOM.render(\r\n React.createElement(UiView, null, null),\r\n nativeElement\r\n );\r\n } catch (error) {\r\n this.fxpLoggerService.logException(`${this.sourceForTelemetry}.LoadComponent`, error, null, null, null, ErrorSeverityLevel.Critical, ErrorCodes.ErrorLoadingReactComponent);\r\n this.fxpMessageService.addMessage(\"There was an error in loading the React Component\", FxpConstants.messageType.error);\r\n }\r\n }\r\n\r\n private unloadComponent(nativeElement: any) {\r\n try {\r\n ReactDOM.unmountComponentAtNode(nativeElement);\r\n } catch (error) {\r\n this.fxpLoggerService.logException(`${this.sourceForTelemetry}.UnLoadComponent`, error, null, null, null, ErrorSeverityLevel.Critical, ErrorCodes.ErrorUnloadingReactComponent);\r\n this.fxpMessageService.addMessage(\"There was an error in removing the React Component\", FxpConstants.messageType.warning);\r\n }\r\n }\r\n}\r\n","export enum FlightingActions {\r\n UPSERT_FEATURE_FLAG = \"UPSERT_FEATURE_FLAG\",\r\n}","import { FlightingActions } from \"./featureFlags.action.types\"\r\n\r\nexport const UpsertFeatureFlags = (payload: Record) => {\r\n return {\r\n type: FlightingActions.UPSERT_FEATURE_FLAG,\r\n payload: payload\r\n }\r\n}\r\n\r\n","import { IAction } from 'redux-micro-frontend';\r\nimport { Reducer } from \"redux\";\r\nimport { FlightingActions } from \"./featureFlags.action.types\";\r\n\r\nconst defaultState: Record = {};\r\n\r\nexport const FeatureFlagReducer: Reducer, IAction>> = (\r\n state: Record = defaultState,\r\n action: IAction>\r\n): Record => {\r\n\r\n switch(action.type) {\r\n case FlightingActions.UPSERT_FEATURE_FLAG : { \r\n return {...state, ...action.payload};\r\n }\r\n }\r\n\r\n return state;\r\n}","import { Compiler, NgModuleRef, CompilerFactory, NgModuleFactory } from \"@angular/core\";\r\nimport { AppModule } from \"./modules/app.module\";\r\nimport { PartnerContainerComponent } from \"./components/partnerContainer-component/partnerContainer-component\";\r\n\r\nexport class FxpLazyLoader {\r\n static _partnerModules:{};\r\n static _compiler: Compiler;\r\n static _fxprootModule: NgModuleRef;\r\n static _compilerFactory: CompilerFactory;\r\n\r\n static setRootModuleReference(parentModuleRef: NgModuleRef){\r\n \r\n this._fxprootModule = parentModuleRef;\r\n }\r\n static setCompilerFactory(compilerFactory: CompilerFactory){\r\n this._compilerFactory = compilerFactory;\r\n if (!this._compiler) {\r\n this._compiler = this._compilerFactory.createCompiler([{useJit:true}]);\r\n }\r\n }\r\n\r\n static compileAndLoadModule(jitModuleRef):Promise{\r\n let self = this;\r\n \r\n return new Promise(function(resolve, reject){\r\n self._compiler.compileModuleAndAllComponentsAsync(jitModuleRef).then((factory) => {\r\n let partnerModule = factory.ngModuleFactory.create(self._fxprootModule.injector);\r\n \r\n resolve(partnerModule);\r\n })\r\n .catch(function(e){\r\n reject(e);\r\n });\r\n \r\n });\r\n }\r\n\r\n static instantiateModule(aotModuleFactoryRef: any):any{\r\n return aotModuleFactoryRef.create(this._fxprootModule.injector);\r\n }\r\n \r\n \r\n}\r\n","export enum AppStatusActionTypes {\r\n START_APP_INITIALIZATION = \"START_APP_INITIALIZATION\",\r\n COMPLETE_APP_INITIALIZATION = \"COMPLETE_APP_INITIALIZATION\",\r\n AUTHENTICATE_USER = \"AUTHENTICATE_USER\",\r\n FAIL_AUTHENTICATION = \"FAIL_AUTHENTICATION\",\r\n\r\n // Test\r\n UPDATE_COUNTER = \"UPDATE_COUNTER\"\r\n}","import { Reducer } from 'redux';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { AppStatus } from './app.status.model';\r\nimport { AppStatusActionTypes } from './app.status.action.types';\r\n\r\nconst defaultState: AppStatus = {\r\n Initialization: \"Not started\",\r\n Authentication: \"Unauhtenticated\",\r\n HitCounter: 0\r\n};\r\n\r\nexport const AppStatusReducer: Reducer> = (\r\n state: AppStatus = defaultState,\r\n action: IAction\r\n): AppStatus => {\r\n switch(action.type) {\r\n case AppStatusActionTypes.START_APP_INITIALIZATION: {\r\n return { ...state, Initialization: \"STARTED\" }\r\n }\r\n case AppStatusActionTypes.COMPLETE_APP_INITIALIZATION: {\r\n return { ...state, Initialization: \"COMPLETED\" }\r\n }\r\n case AppStatusActionTypes.AUTHENTICATE_USER: {\r\n return { ...state, Authentication: \"Authenticated\" }\r\n }\r\n case AppStatusActionTypes.FAIL_AUTHENTICATION: {\r\n return { ...state, Authentication: \"Failed\" }\r\n }\r\n // Test\r\n case AppStatusActionTypes.UPDATE_COUNTER: {\r\n return { ...state, HitCounter: state.HitCounter + action.payload }\r\n }\r\n }\r\n\r\n return state;\r\n}","import { IAction } from \"redux-micro-frontend\"\r\nimport { Actions } from \"./leftNavigation.action.types\"\r\nimport { ILeftNavigationGroup } from \"./leftNavigation.model\"\r\nexport const setLeftnav = (payload: ILeftNavigationGroup): IAction => {\r\n return {\r\n type: Actions.SET_LEFTNAV,\r\n payload: payload\r\n }\r\n}","export enum Actions {\r\n SET_LEFTNAV = \"SET_LEFTNAV\"\r\n}","import { IAction } from 'redux-micro-frontend';\r\nimport { Reducer } from \"redux\";\r\nimport { Actions } from './leftNavigation.action.types';\r\nimport { ILeftNavigationGroup } from './leftNavigation.model';\r\n\r\nconst defaultState: ILeftNavigationGroup = {} as ILeftNavigationGroup;\r\n\r\nexport const LeftNavigationReducer: Reducer> = (\r\n state: ILeftNavigationGroup = defaultState,\r\n action: IAction\r\n): ILeftNavigationGroup => {\r\n\r\n switch (action.type) {\r\n case Actions.SET_LEFTNAV: {\r\n return action.payload;\r\n }\r\n }\r\n\r\n return state;\r\n}","import { IAction } from 'redux-micro-frontend';\r\nimport { LoaderActionTypes } from \"./loader.actions.types\";\r\nimport { ILoader } from \"./loader.model\";\r\n\r\n\r\nexport const ShowLoader = (payload: ILoader): IAction => {\r\n if(!payload.showLoader) payload.showLoader = true;\r\n\tif(payload.timeoutCallback) payload.timeoutCallback = payload.timeoutCallback.bind(payload);\r\n return {\r\n type: LoaderActionTypes.SHOW_LOADER,\r\n payload: payload\r\n }\r\n}\r\n\r\nexport const HideLoader = (payload: Object): IAction => {\r\n return {\r\n type: LoaderActionTypes.HIDE_LOADER,\r\n payload: payload\r\n }\r\n}\r\n\r\nexport const ShowSpecificLoader = (payload: ILoader) : IAction => {\r\n if(!payload.name) payload.name = 'default-fxp-loader';\r\n if(!payload.showLoader) payload.showLoader = true;\r\n return {\r\n type: LoaderActionTypes.SHOW_SPECIFIC_LOADER,\r\n payload: payload\r\n }\r\n}\r\n\r\nexport const HideSpecificLoader = (payload: Object): IAction => {\r\n return {\r\n type: LoaderActionTypes.HIDE_SPECIFIC_LOADER,\r\n payload: payload\r\n }\r\n}\r\n\r\n","export enum LoaderActionTypes {\r\n SHOW_LOADER = \"SHOW_LOADER\",\r\n HIDE_LOADER = \"HIDE_LOADER\",\r\n SHOW_SPECIFIC_LOADER = \"SHOW_SPECIFIC_LOADER\",\r\n HIDE_SPECIFIC_LOADER = \"HIDE_SPECIFIC_LOADER\",\r\n}","import { IAction } from 'redux-micro-frontend';\r\nimport { Reducer } from \"redux\";\r\nimport { LoaderActionTypes } from \"./loader.actions.types\";\r\nimport { ILoader } from \"./loader.model\";\r\n\r\nconst defaultState: Array = [];\r\n\r\nexport const LoaderReducer: Reducer, IAction > = (\r\n state: Array = defaultState,\r\n action: IAction \r\n): Array => {\r\n switch (action.type) {\r\n case LoaderActionTypes.SHOW_LOADER : {\r\n return [...state, action.payload];\r\n }\r\n case LoaderActionTypes.HIDE_LOADER : {\r\n return defaultState;\r\n }\r\n case LoaderActionTypes.SHOW_SPECIFIC_LOADER : {\r\n return [...state, action.payload];\r\n }\r\n case LoaderActionTypes.HIDE_SPECIFIC_LOADER : {\r\n return action.payload.name ? state.filter(loader => loader.name != action.payload.name) : defaultState;\r\n }\r\n }\r\n\r\n return state;\r\n\r\n};","import { IRootScope } from \"../../js/interfaces/IRootScope\";\r\nimport { FxpConfigurationService } from \"../../js/services/FxpConfiguration\";\r\nimport { FxpBroadcastedEvents } from \"../../js/services/FxpBroadcastedEvents\";\r\nimport { IFxPService } from \"../../js/interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from '../../js/services/fxp.global.store.service';\r\nimport { ShowLoader, HideLoader, ShowSpecificLoader, HideSpecificLoader } from './loader.actions';\r\nimport { ILoader } from \"./loader.model\";\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\ndeclare var Spinner: any;\r\n\r\n/**\r\n * A service to connect to Page Loader Service to fetch the detaisl of page loader\r\n * @class Fxp.Services.PageLoaderService\r\n * @classdesc A service to connect to Page Loader service to fetch the page loader details\r\n * @example Example to create an instance of Page Loader Service\r\n * //Initializing Page Loader Service\r\n * angular.module('FxPApp').controller('AppController', ['PageLoaderService', AppController]);\r\n * function AppController(PageLoaderService){ PageLoaderService.fnHidePageLoader(); }\r\n */\r\nexport class PageLoaderService implements IFxPService {\r\n\r\n\tprivate http: angular.IHttpService;\r\n\tprivate rootScope: IRootScope;\r\n\tprivate timeout: angular.ITimeoutService;\r\n\tprivate static _instance: PageLoaderService;\r\n\tprivate defaultLoaderName = 'fxploader';\r\n\tprivate loaderInstance;\r\n\tprivate timeoutIntervalInMs;\r\n\tprivate timeOutCallback;\r\n\tprivate pageLoadTimers: Array>;\r\n\tprivate currentLoaderState: Array;\r\n\r\n\tconstructor($http: angular.IHttpService,\r\n\t\t$rootScope: IRootScope,\r\n\t\t$timeout: angular.ITimeoutService,\r\n\t\tfxpConfigurationService: FxpConfigurationService,\r\n\t\tprivate globalStoreService: FxpGlobalStoreService)\r\n\t{\r\n\t\tthis.http = $http;\r\n\t\tthis.rootScope = $rootScope;\r\n\t\tthis.timeout = $timeout;\r\n\t\tthis.timeoutIntervalInMs = fxpConfigurationService.FxpBaseConfiguration.PageLoadTimeOut || 30000;\r\n\t\tthis.pageLoadTimers = [];\r\n\r\n\t\tif (PageLoaderService._instance) {\r\n\t\t\treturn PageLoaderService._instance;\r\n\t\t}\r\n\t\tPageLoaderService._instance = this;\r\n\r\n\t\tthis.globalStoreService.SubscribeToPlatformState(\"Platform\", (state) => {\r\n\t\t\tlet incomingLoaderState = state.Loader;\r\n\t\t\tif(incomingLoaderState !== null && incomingLoaderState !== undefined) {\r\n\t\t\t\tthis.showOrHideLoaders(incomingLoaderState, this.currentLoaderState);\r\n\t\t\t\tthis.currentLoaderState = incomingLoaderState;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n * Decides whether to hide/show loader based on difference of loaderState.\r\n */\r\n\tprivate showOrHideLoaders(incomingLoaderState, currentLoaderState = []) {\r\n\t\tif(incomingLoaderState.length > currentLoaderState.length) {\r\n\t\t\tlet loaderToShow = incomingLoaderState[incomingLoaderState.length ? incomingLoaderState.length - 1 : 0];\r\n\t\t\tif(Object.entries(loaderToShow).length !== 0 && loaderToShow[\"name\"] && loaderToShow[\"name\"] !== \"fxploader\") {\r\n\t\t\t\tthis.fnChangeLoaderState(loaderToShow);\r\n\t\t\t} else {\r\n\t\t\t\tthis.disablePageLoaderTimers();\r\n\t\t\t\tthis.fnChangeLoaderState(loaderToShow);\r\n\t\t\t\tthis.setPageLoadTimer(loaderToShow.timeoutCallback);\r\n\t\t\t}\r\n\t\t} else if (incomingLoaderState.length < currentLoaderState.length) {\r\n\t\t\tlet loaderToHide = currentLoaderState.filter(\r\n\t\t\t\tcurrentLoader =>\r\n\t\t\t\t !incomingLoaderState.some(\r\n\t\t\t\t\tincomingLoader => incomingLoader[\"name\"] === currentLoader[\"name\"]\r\n\t\t\t\t )\r\n\t\t\t);\r\n\r\n\t\t\tif(loaderToHide !== undefined && loaderToHide !== null && loaderToHide.length && loaderToHide[0][\"name\"] && loaderToHide[0][\"name\"] !== \"fxploader\") {\r\n\t\t\t\tthis.fnChangeLoaderState({showLoader: false});\r\n\t\t\t} else {\r\n\t\t\t\tthis.disablePageLoaderTimers();\r\n\t\t\t\tthis.fnChangeLoaderState({showLoader: false});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets Page loading time to the PageLoadTimers\r\n\t * @method Fxp.Services.PageLoaderService.setPageLoadTimer \r\n\t * @example Example to invoke setPageLoadTimer \r\n\t * PageLoaderService.setPageLoadTimer(3000 // time in milliseconds); \r\n\t */\r\n\tprivate setPageLoadTimer(timeOutCallback?) {\r\n\t\tvar self = this;\r\n\t\tself.timeOutCallback = timeOutCallback;\r\n\t\tvar pageLoadTimer = self.timeout(function () {\r\n\t\t\tself.fnHidePageLoader();\r\n\t\t\tif (self.timeOutCallback)\r\n\t\t\t\tself.timeOutCallback();\r\n\t\t}, self.timeoutIntervalInMs);\r\n\t\t\r\n\t\t// Storing timers in collection to cancel all of them once hide event is called. \r\n\t\tself.pageLoadTimers.push(pageLoadTimer);\r\n\t}\r\n\r\n\t/**\r\n * Gets Show Page Loader from the Page Loader Service\r\n * @method Fxp.Services.PageLoaderService.fnShowPageLoader \r\n * @example Example to invoke fnShowPageLoader\r\n * PageLoaderService.fnShowPageLoader('loading text');\r\n */\r\n\tfnShowPageLoader(loadingText, timeoutCallback?) {\r\n\t\tvar loader = this.fnCreateLoaderData(true, this.defaultLoaderName, loadingText, timeoutCallback);\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\", ShowLoader(loader));\r\n\t}\r\n\r\n\t/**\r\n\t* A method to show page loader which are part of series of steps\r\n\t* @method Fxp.Services.PageLoaderService.fnShowPageLoaderStep\r\n\t* @example Example to invoke fnShowPageLoaderStep\r\n\t* PageLoaderService.fnShowPageLoaderStep('Authenticating', 1, 2); // Will have a string \"Authenticating (1/2)\"\r\n\t*/\r\n\tfnShowPageLoaderStep(loadingText: string, currentStepIndex: number, totalStepsCount: number, timeOutCallback?) {\r\n\t\tlet loadingTextWithStep = `${loadingText} (${currentStepIndex}/${totalStepsCount})`;\r\n\t\tthis.fnShowPageLoader(loadingTextWithStep, timeOutCallback);\r\n\t}\r\n\t/**\r\n\t* Gets Hide Page Loader from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnHidePageLoader\r\n\t* @example Example to invoke fnHidePageLoader\r\n\t* PageLoaderService.fnHidePageLoader();\r\n\t*/\r\n\tfnHidePageLoader() {\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\", HideLoader({}));\r\n\t}\r\n\r\n\t/**\r\n * Gets Show In line Loader from the Page Loader Service\r\n * @method Fxp.Services.PageLoaderService.fnShowInlineLoader\r\n * @example Example to invoke fnShowInlineLoader\r\n * PageLoaderService.fnShowInlineLoader('loader name','loading text');\r\n */\r\n\tfnShowInlineLoader(loaderName, loadingText) {\r\n\t\tvar loader = this.fnCreateLoaderData(true, loaderName, loadingText);\r\n\t\tthis.fnBroadcastInlineLoading(loader)\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Hide In line Loader from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnHideInlineLoader\r\n\t* @example Example to invoke fnHideInlineLoader\r\n\t* PageLoaderService.fnHideInlineLoader('loader name');\r\n\t*/\r\n\tfnHideInlineLoader(loaderName) {\r\n\t\tvar loader = this.fnCreateLoaderData(false, loaderName, '');\r\n\t\tthis.fnBroadcastInlineLoading(loader)\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Show Flyout Inline Loader from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnShowFlyoutInlineLoader\r\n\t* @example Example to invoke fnShowFlyoutInlineLoader\r\n\t* PageLoaderService.fnShowFlyoutInlineLoader('loader name','loader tooltip');\r\n\t*/\r\n\tfnShowFlyoutInlineLoader(loaderName, loaderTooltip) {\r\n\t\tvar loader = this.fnCreateFlyoutLoaderData(true, loaderName, loaderTooltip);\r\n\t\tthis.fnBroadcastInlineLoading(loader);\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Hide Flyout Inline Loader from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnHideFlyoutInlineLoader\r\n\t* @example Example to invoke fnHideFlyoutInlineLoader\r\n\t* PageLoaderService.fnHideFlyoutInlineLoader('loader name');\r\n\t*/\r\n\tfnHideFlyoutInlineLoader(loaderName) {\r\n\t\tvar loader = this.fnCreateFlyoutLoaderData(false, loaderName, '');\r\n\t\tthis.fnBroadcastInlineLoading(loader)\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Show Specific Page Loader from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnShowSpecificPageLoader\r\n\t* @example Example to invoke fnShowSpecificPageLoader\r\n\t* PageLoaderService.fnShowSpecificPageLoader('loader name','loader text');\r\n\t*/\r\n\tfnShowSpecificPageLoader(loaderName, loadingText) {\r\n\t\tvar loader = this.fnCreateLoaderData(true, loaderName, loadingText);\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\", ShowSpecificLoader(loader));\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Hide Specific Page Loader from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnHideSpecificPageLoader\r\n\t* @example Example to invoke fnHideSpecificPageLoader\r\n\t* PageLoaderService.fnHideSpecificPageLoader('loader name');\r\n\t*/\r\n\tfnHideSpecificPageLoader(loaderName) {\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\", HideSpecificLoader({name: loaderName}));\r\n\t}\r\n\r\n\t/**\r\n * Gets Create Loader Data from the Page Loader Service\r\n * @method Fxp.Services.PageLoaderService.fnCreateLoaderData\r\n * @example Example to invoke fnCreateLoaderData\r\n * PageLoaderService.fnCreateLoaderData('show loader','loader name','loading text');\r\n */\r\n\tfnCreateLoaderData(showLoader, loaderName, loadingText, timeOutCallback?) {\r\n\t\treturn { name: loaderName, showLoader: showLoader, loadingText: loadingText, timeoutCallback: timeOutCallback};\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Create Flyout Loader Data from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnCreateFlyoutLoaderData\r\n\t* @example Example to invoke fnCreateFlyoutLoaderData\r\n\t* PageLoaderService.fnCreateFlyoutLoaderData('show loader','loader name','loading text');\r\n\t*/\r\n\tfnCreateFlyoutLoaderData(showLoader, loaderName, loadingText) {\r\n\t\treturn angular.extend(this.fnCreateLoaderData(showLoader, loaderName, loadingText), { flyout: true });\r\n\t}\r\n\r\n\t/**\r\n\t* Gets Broadcast Loading from the Page Loader Service\r\n\t* @method Fxp.Services.PageLoaderService.fnChangeLoaderState\r\n\t* @example Example to invoke fnChangeLoaderState\r\n\t* PageLoaderService.fnChangeLoaderState('loader');\r\n\t*/\r\n\tfnChangeLoaderState(loader) {\r\n\t\tlet self = this;\r\n\t\tself.rootScope.showLoader = loader.showLoader;\r\n\t\tif (loader.showLoader) {\r\n\t\t\t//Timeout to make sure angular digest runs for the above \r\n\t\t\t//statement after which the spinContainer is available.\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\t//Add spinner if not exists already.\r\n\t\t\t\tif (!self.loaderInstance) {\r\n\t\t\t\t\tvar spinConfig = {\r\n\t\t\t\t\t\tlines: 8 // The number of lines to draw\r\n\t\t\t\t\t\t, length: 0 // The length of each line\r\n\t\t\t\t\t\t, width: 8 // The line thickness\r\n\t\t\t\t\t\t, radius: 10 // The radius of the inner circle\r\n\t\t\t\t\t\t, scale: 1.5 // Scales overall size of the spinner\r\n\t\t\t\t\t\t, corners: 1 // Corner roundness (0..1)\r\n\t\t\t\t\t\t, color: '#0063b1' // #rgb or #rrggbb or array of colors\r\n\t\t\t\t\t\t, opacity: 0.25 // Opacity of the lines\r\n\t\t\t\t\t\t, rotate: 0 // The rotation offset\r\n\t\t\t\t\t\t, direction: 1 // 1: clockwise, -1: counterclockwise\r\n\t\t\t\t\t\t, speed: 1.9 // Rounds per second\r\n\t\t\t\t\t\t, trail: 60 // Afterglow percentage\r\n\t\t\t\t\t\t, fps: 20 // Frames per second when using setTimeout() as a fallback for CSS \r\n\t\t\t\t\t\t, className: 'spinner' // The CSS class to assign to the spinner\r\n\t\t\t\t\t};\r\n\t\t\t\t\tself.loaderInstance = new Spinner(spinConfig).spin(document.getElementById('fxp_loadercontainer'));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tself.rootScope.loadingText = loader.loadingText || \"Loading\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n * Gets Broadcast Inline Loading from the Page Loader Service\r\n * @method Fxp.Services.PageLoaderService.fnBroadcastInlineLoading\r\n * @example Example to invoke fnBroadcastInlineLoading\r\n * PageLoaderService.fnBroadcastInlineLoading('loader');\r\n */\r\n\tfnBroadcastInlineLoading(loader) {\r\n\t\tthis.rootScope.$broadcast(FxpBroadcastedEvents.OnShowHideInlineLoader, loader);\r\n\t}\r\n\r\n\tprivate disablePageLoaderTimers() {\r\n\t\tthis.pageLoadTimers.forEach((timer) => this.timeout.cancel(timer));\r\n\t\tthis.pageLoadTimers = [];\r\n\t}\r\n}\r\n\r\n","import { NgModule } from '@angular/core';\r\nimport { OverlayModule } from '@angular/cdk/overlay';\r\n\r\nimport {\r\n MatButtonModule,\r\n MatCheckboxModule,\r\n MatRadioModule,\r\n MatCardModule,\r\n MatAutocompleteModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatButtonToggleModule,\r\n MatChipsModule,\r\n MatDialogModule,\r\n MatDatepickerModule,\r\n MatDividerModule,\r\n MatExpansionModule,\r\n MatGridListModule,\r\n MatIconModule,\r\n MatNativeDateModule,\r\n MatMenuModule,\r\n MatListModule,\r\n MatProgressBarModule,\r\n MatProgressSpinnerModule,\r\n MatRippleModule,\r\n MatSelectModule,\r\n MatSidenavModule,\r\n MatPaginatorModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatSnackBarModule,\r\n MatSortModule,\r\n MatTableModule,\r\n MatToolbarModule,\r\n MatTabsModule,\r\n MatStepperModule,\r\n MatTooltipModule\r\n} from '@angular/material';\r\n\r\n@NgModule({\r\n imports: [\r\n MatFormFieldModule,\r\n MatAutocompleteModule,\r\n MatButtonModule,\r\n MatButtonToggleModule,\r\n MatCardModule,\r\n MatCheckboxModule,\r\n MatChipsModule,\r\n MatDatepickerModule,\r\n MatDialogModule,\r\n MatDividerModule,\r\n MatExpansionModule,\r\n MatGridListModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatListModule,\r\n MatMenuModule,\r\n MatNativeDateModule,\r\n MatPaginatorModule,\r\n MatProgressBarModule,\r\n MatProgressSpinnerModule,\r\n MatRadioModule,\r\n MatRippleModule,\r\n MatSelectModule,\r\n MatSidenavModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatSnackBarModule,\r\n MatSortModule,\r\n MatStepperModule,\r\n MatTableModule,\r\n MatTabsModule,\r\n MatToolbarModule,\r\n MatTooltipModule,\r\n OverlayModule\r\n ],\r\n exports: [\r\n MatFormFieldModule,\r\n MatAutocompleteModule,\r\n MatButtonModule,\r\n MatButtonToggleModule,\r\n MatCardModule,\r\n MatCheckboxModule,\r\n MatChipsModule,\r\n MatDatepickerModule,\r\n MatDialogModule,\r\n MatDividerModule,\r\n MatExpansionModule,\r\n MatGridListModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatListModule,\r\n MatMenuModule,\r\n MatNativeDateModule,\r\n MatPaginatorModule,\r\n MatProgressBarModule,\r\n MatProgressSpinnerModule,\r\n MatRadioModule,\r\n MatRippleModule,\r\n MatSelectModule,\r\n MatSidenavModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatSnackBarModule,\r\n MatSortModule,\r\n MatStepperModule,\r\n MatTableModule,\r\n MatTabsModule,\r\n MatToolbarModule,\r\n MatTooltipModule,\r\n OverlayModule\r\n ]\r\n})\r\nexport class AngularMaterialModule {\r\n \r\n \r\n}\r\n","import { NgModule, COMPILER_OPTIONS, CompilerFactory } from '@angular/core'\r\nimport { BrowserModule } from '@angular/platform-browser';\r\nimport { UpgradeModule } from '@angular/upgrade/static';\r\nimport { HttpClientModule } from \"@angular/common/http\";\r\nimport { FormsModule } from '@angular/forms';\r\nimport { NgbModule } from '@ng-bootstrap/ng-bootstrap';\r\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\r\nimport { ReactAppModule } from './reactapp.module';\r\nimport { PowerBiReportContainerModule } from './powerbi-module';\r\n\r\n\r\nimport {\r\n FxpConfigurationServiceProvider,\r\n AdalLoginHelperServiceProvider,\r\n DashboardServiceProvider,\r\n FxpMessageServiceProvider,\r\n HelpCentralServiceProvider,\r\n OBOUserServiceProvider,\r\n pageTourEventServiceProvider,\r\n SystemMessagesServiceProvider,\r\n UserInfoServiceProvider,\r\n UserProfileServiceProvider,\r\n UserClaimsServiceProvider,\r\n FxpBreadcrumbServiceProvider,\r\n AdminLandingServiceProvider,\r\n DataServiceProvider,\r\n NotificationActionCenterProvider,\r\n FxpStorageServiceProvider,\r\n PersonalizationServiceProvider,\r\n FxpFeedbackServiceProvider,\r\n FxpRouteServiceProvider,\r\n NotificationStoreProvider,\r\n PageLoaderServiceProvider,\r\n PlannedDownTimeServiceProvider,\r\n TimeZoneHelperProvider,\r\n FxpAuthorizationServiceProvider,\r\n NotificationServiceProvider,\r\n FxpEventBroadCastServiceProvider,\r\n FxpHttpServiceProvider,\r\n FxpLoggerServiceProvider,\r\n FxpFeatureFlagServiceProvider,\r\n FxpConfitServiceProvider,\r\n FxpStateTransitionServiceProvider,\r\n FxpUIDataProvider,\r\n SettingsServiceProvider,\r\n DeviceFactoryProvider,\r\n FxpContextServiceProvider,\r\n FxpHttpInterceptorHooksProvider,\r\n LazyLoaderServiceProvider,\r\n FxpIrisBotServiceProvider,\r\n FxpGlobalStoreServiceProvider,\r\n FxpOCVFeedbackServiceProvider,\r\n FxpSignalRServiceProvider,\r\n MsalAuthenticationServiceProvider,\r\n // MsalAuthenticationServiceProvider\r\n\r\n} from '../services/FxpServices';\r\nimport { AppComponent } from '../components/app-component/app.component';\r\nimport { UIRouterUpgradeModule } from '@uirouter/angular-hybrid';\r\nimport { PartnerContainerComponent } from '../components/partnerContainer-component/partnerContainer-component';\r\nimport { PartnerStateService } from '../components/partnerContainer-component/partnerStateService';\r\nimport { UIRouterModule } from '@uirouter/angular';\r\nimport { JitCompilerFactory } from '@angular/platform-browser-dynamic';\r\nimport { FxpBotModule } from '../components/fxpbot/fxpbot.module';\r\nimport { AngularMaterialModule } from './angular.material.module';\r\nimport { FxpSharedComponentLoader, FxpsharedcomponentloaderModule } from '@fxp/fxpsharedcomponentloader';\r\nimport { FxpPageTourModule } from '../components/pageTour-Component/pageTour.module';\r\n\r\nimport { SharedComponentsModule, SharedComponentLoader} from '@fxp/angularcontrols';\r\n\r\nlet importModules = [\r\n BrowserModule,\r\n FormsModule,\r\n UpgradeModule,\r\n HttpClientModule,\r\n UIRouterUpgradeModule,\r\n UIRouterModule,\r\n BrowserAnimationsModule,\r\n NgbModule,\r\n FxpBotModule,\r\n AngularMaterialModule,\r\n ReactAppModule,\r\n FxpsharedcomponentloaderModule,\r\n PowerBiReportContainerModule,\r\n FxpPageTourModule,\r\n SharedComponentsModule\r\n];\r\n\r\nconst fxpServices = [\r\n HttpClientModule,\r\n FxpConfigurationServiceProvider,\r\n MsalAuthenticationServiceProvider,\r\n AdalLoginHelperServiceProvider,\r\n AdminLandingServiceProvider,\r\n DashboardServiceProvider,\r\n DataServiceProvider,\r\n FxpAuthorizationServiceProvider,\r\n FxpBreadcrumbServiceProvider,\r\n FxpFeedbackServiceProvider,\r\n FxpMessageServiceProvider,\r\n FxpRouteServiceProvider,\r\n FxpStorageServiceProvider,\r\n HelpCentralServiceProvider,\r\n NotificationActionCenterProvider,\r\n NotificationServiceProvider,\r\n NotificationStoreProvider,\r\n OBOUserServiceProvider,\r\n PageLoaderServiceProvider,\r\n pageTourEventServiceProvider,\r\n PersonalizationServiceProvider,\r\n PlannedDownTimeServiceProvider,\r\n SystemMessagesServiceProvider,\r\n TimeZoneHelperProvider,\r\n UserInfoServiceProvider,\r\n UserProfileServiceProvider,\r\n UserClaimsServiceProvider,\r\n FxpEventBroadCastServiceProvider,\r\n FxpHttpServiceProvider,\r\n FxpLoggerServiceProvider,\r\n FxpFeatureFlagServiceProvider,\r\n FxpConfitServiceProvider,\r\n FxpStateTransitionServiceProvider,\r\n FxpUIDataProvider,\r\n SettingsServiceProvider,\r\n DeviceFactoryProvider,\r\n PartnerStateService,\r\n FxpContextServiceProvider,\r\n FxpHttpInterceptorHooksProvider,\r\n LazyLoaderServiceProvider,\r\n FxpIrisBotServiceProvider,\r\n FxpOCVFeedbackServiceProvider,\r\n { provide: COMPILER_OPTIONS, useValue: {}, multi: true},\r\n { provide: CompilerFactory, useClass: JitCompilerFactory, deps: [COMPILER_OPTIONS]},\r\n FxpGlobalStoreServiceProvider,\r\n FxpSignalRServiceProvider\r\n];\r\n\r\n@NgModule({\r\n imports: importModules,\r\n declarations: [AppComponent, PartnerContainerComponent ],\r\n providers: fxpServices,\r\n bootstrap: [\r\n AppComponent\r\n ],\r\nentryComponents: [PartnerContainerComponent, FxpSharedComponentLoader, SharedComponentLoader],\r\nexports: [PartnerContainerComponent]\r\n})\r\nexport class AppModule {\r\n\r\n}\r\n\r\n\r\n\r\n\r\n","import { NgModule } from '@angular/core';\r\nimport { PowerBIReportContainerComponent } from '../components/powerbi-component/powerbi-container-component';\r\n\r\n@NgModule({\r\n declarations: [PowerBIReportContainerComponent],\r\n entryComponents: [PowerBIReportContainerComponent],\r\n exports: [PowerBIReportContainerComponent],\r\n bootstrap: [\r\n PowerBIReportContainerComponent\r\n ],\r\n})\r\nexport class PowerBiReportContainerModule {\r\n \r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { ReactPartnerContainerComponent } from '../components/reactContainer-component/reactpartner-component';\r\n\r\n\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [ReactPartnerContainerComponent],\r\n bootstrap: [\r\n ReactPartnerContainerComponent\r\n ],\r\n entryComponents: [ReactPartnerContainerComponent],\r\n exports: [ReactPartnerContainerComponent]\r\n})\r\nexport class ReactAppModule {\r\n constructor() {\r\n \r\n }\r\n}\r\n","export enum NotificationActionTypes {\r\n Push_Notification= \"Push_Notification\",\r\n Mark_Notification = \"Mark_Notification\",\r\n Dismiss_Notification = \"Dismiss_Notification\",\r\n Reset_Notification_Collection = \"Reset_Notification_Collection\"\r\n}","import { Reducer } from 'redux'\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Notification, NotificationDTO } from \"./notifications.model\"\r\nimport { NotificationActionTypes } from './notifications.action.type';\r\nconst defaultState: NotificationDTO = {UserNotifications:[],UnreadNotificationCount:0};\r\n\r\n\r\nexport const NotificationReducer: Reducer> = (\r\n state: NotificationDTO = defaultState,\r\n action: IAction\r\n): NotificationDTO => {\r\n switch (action.type) {\r\n case NotificationActionTypes.Push_Notification: {\r\n return {UserNotifications:[action.payload,...state.UserNotifications],UnreadNotificationCount:state.UnreadNotificationCount+1};\r\n }\r\n case NotificationActionTypes.Dismiss_Notification: {\r\n var index = state.UserNotifications.indexOf(action.payload);\r\n var UserNotifications=[...state.UserNotifications.slice(0, index), ...state.UserNotifications.slice(index + 1)];\r\n if(action.payload.status.name==\"Read\")\r\n return {UserNotifications:UserNotifications,UnreadNotificationCount:state.UnreadNotificationCount}\r\n return {UserNotifications:UserNotifications,UnreadNotificationCount:state.UnreadNotificationCount-1}\r\n \r\n }\r\n case NotificationActionTypes.Mark_Notification: {\r\n var index = state.UserNotifications.indexOf(action.payload);\r\n var notifications= [...state.UserNotifications.slice(0, index),action.payload, ...state.UserNotifications.slice(index + 1)];\r\n return {UserNotifications:notifications,UnreadNotificationCount:state.UnreadNotificationCount-1};\r\n }\r\n case NotificationActionTypes.Reset_Notification_Collection: {\r\n return action.payload;\r\n }\r\n }\r\n\r\n return state;\r\n}","//action creators for OBO Entity\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { OBOEntity } from \"./obo.model\"\r\nimport { OBOActionTypes } from './obo.action.types';\r\n\r\nexport const AddOBOEntity = (payload: OBOEntity): IAction => {\r\n return {\r\n type: OBOActionTypes.ADD_OBO_ENTITY,\r\n payload: payload\r\n }\r\n}\r\nexport const RemoveOBOEntity = (): IAction => {\r\n return {\r\n type: OBOActionTypes.REMOVE_OBO_ENTITY,\r\n payload: {} as OBOEntity\r\n }\r\n}","export enum OBOActionTypes {\r\n ADD_OBO_ENTITY=\"ADD_OBO_ENTITY\",\r\n REMOVE_OBO_ENTITY=\"REMOVE_OBO_ENTITY\",\r\n \r\n}","import { Reducer } from 'redux';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { OBOEntity } from './obo.model';\r\nimport { OBOActionTypes } from './obo.action.types';\r\n\r\nconst defaultOBOEntity: OBOEntity = {} as OBOEntity\r\n\r\nexport const OBOReducer: Reducer> = (\r\n state: OBOEntity = defaultOBOEntity,\r\n action: IAction): OBOEntity => {\r\n switch (action.type) {\r\n case OBOActionTypes.ADD_OBO_ENTITY :{\r\n return action.payload\r\n \r\n }\r\n case OBOActionTypes.REMOVE_OBO_ENTITY:{\r\n return {} as OBOEntity\r\n }\r\n }\r\n return state;\r\n}","import { ProfileActionTypes } from './profile.action.types';\r\nimport {Profile} from './profile.model';\r\nimport { IAction } from 'redux-micro-frontend';\r\nexport const AddLoggedInUserProfile = (userProfile: Profile): IAction => ({\r\n type: ProfileActionTypes.ADD_LOGGED_IN_USER_PROFILE,\r\n payload: userProfile,\r\n logEnabled: false\r\n});\r\nexport const AddCurrentUserProfile = (userProfile: Profile): IAction => ({\r\n type: ProfileActionTypes.ADD_CURRENT_USER_PROFILE,\r\n payload: userProfile,\r\n logEnabled: false\r\n});","export enum ProfileActionTypes {\r\n ADD_CURRENT_USER_PROFILE=\"ADD_CURRENT_USER_PROFILE\",\r\n ADD_LOGGED_IN_USER_PROFILE=\"ADD_LOGGED_IN_USER_PROFILE\"\r\n}","import { Reducer } from 'redux';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Profile } from './profile.model';\r\nimport { ProfileActionTypes } from './profile.action.types';\r\n\r\nconst defaultProfile: Profile = {} as Profile\r\n\r\nexport const ProfileReducer: Reducer> = (\r\n state: Profile = defaultProfile,\r\n action: IAction): Profile => {\r\n\r\n if (action.type == ProfileActionTypes.ADD_CURRENT_USER_PROFILE || action.type == ProfileActionTypes.ADD_LOGGED_IN_USER_PROFILE) {\r\n return action.payload\r\n\r\n }\r\n return state;\r\n}","import { StateService } from \"@uirouter/core\";\r\nimport { FxpConfigurationService } from \"../../js/services/FxpConfiguration\";\r\nimport { FxpEventBroadCastService } from \"../../js/services/BroadCastingService\";\r\nimport { FxpStateTransitionService } from \"../../js/services/FxpStateTransitionService\";\r\nimport { FxpHttpService } from \"../../js/services/FxpHttpService\";\r\n// import { MsalAuthenticationService } from \"../../js/services/MsalAuthenticationService\";\r\nimport { AdminLandingService } from \"../adminTiles/AdminLandingService\";\r\nimport { DashboardService } from \"../../js/services/dashboardService\";\r\nimport { DataService } from \"../../js/services/DataService\";\r\nimport { FxpAuthorizationService } from \"../../js/services/FxpAuthorizationService\";\r\nimport { FxpBreadcrumbService } from \"../../js/services/FxpBreadcrumbService\";\r\nimport { FxpFeedbackService } from \"../../js/services/FxpFeedbackService\";\r\nimport { FxpMessageService } from \"../banner/FxpMessageService\";\r\nimport { FxpRouteService } from \"../../js/services/FxpRouteService\";\r\nimport { FxpStorageService } from \"../../js/services/FxpStorageService\";\r\nimport { HelpCentralService } from \"../../js/services/HelpCentralService\";\r\nimport { NotificationActionCenter } from \"../../js/services/NotificationActionCenter\";\r\nimport { NotificationService } from \"../../js/services/NotificationService\";\r\nimport { NotificationStore } from \"../../js/services/NotificationStore\";\r\nimport { OBOUserService } from \"../../js/services/OBOUserService\";\r\nimport { PageLoaderService } from \"../loader/pageLoaderService\";\r\nimport { pageTourEventService } from \"../../js/services/pageTourEventService\";\r\nimport { PersonalizationService } from \"../../js/services/PersonalizationService\";\r\nimport { PlannedDownTimeService } from \"../systemMessages/PlannedDownTimeService\";\r\nimport { SystemMessagesService } from \"../systemMessages/SystemMessagesService\";\r\nimport { TimeZoneHelper } from \"../../js/services/TimeZoneHelper\";\r\nimport { UserInfoService } from \"../../js/services/UserInfoService\";\r\nimport { UserClaimsService } from \"../../js/services/UserClaimsService\";\r\nimport { UserProfileService } from \"../../js/services/userProfileService\";\r\nimport { ConFitService } from \"@fxp/confitsdk/service/ConfigService\";\r\nimport { FeatureFlagService } from \"@fxp/flightingsdk/service/FeatureFlagServiceProvider\";\r\nimport { FxpUIData } from \"../../js/factory/FxpUIDataFactory\";\r\nimport { DeviceFactoryProvider as deviceFactoryProvider } from './../../js/utils/devicefactoryService';\r\nimport { SettingsServiceProvider as settingsServiceProvider } from './../../js/provider/SettingsServiceProvider';\r\nimport { FxpContext as fxpContextService, FxpContext } from './../../js/context/FxpContext'; \r\nimport { FxpPartnerHttpInterceptorHooks } from \"./../../js/services/FxpPartnerHttpInterceptorHooks\";\r\nimport { LazyLoaderService } from \"../../js/services/lazyLoaderService\";\r\nimport { FxpIrisBotService } from \"../../js/services/FxpIrisBotService\";\r\nimport { FxpGlobalStoreService } from \"../../js/services/fxp.global.store.service\";\r\nimport { FxpOCVFeedbackService } from \"../../js/services/FxpOCVFeedbackService\";\r\nimport { FxpSignalRService } from './../../js/services/FxpSignalRClient'; \r\nimport { FxpLoggerService } from \"../../js/telemetry/fxpLogger\";\r\nimport { AdalLoginHelperService } from \"../../js/services/AdalLoginHelperService\";\r\nimport { MsalAuthenticationService } from \"../../js/services/MsalAuthenticationService\";\r\n\r\nlet fxpComponentRegistrationService = null;\r\nlet partnerAppRegistrationService = null;\r\nlet resiliency = null;\r\n\r\n\r\n// Inject FxpConfigurationService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpConfigurationServiceFactory(i: any) {\r\n return i.get('FxpConfigurationService');\r\n}\r\n\r\nexport let FxpConfigurationServiceProvider = {\r\n provide: FxpConfigurationService,\r\n useFactory: FxpConfigurationServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// export function MsalAuthenticationServiceFactory(i: any) {\r\n// return i.get('MsalAuthenticationService');\r\n// }\r\n\r\n// export let MsalAuthenticationServiceProvider = {\r\n// provide: MsalAuthenticationService,\r\n// useFactory: MsalAuthenticationServiceFactory,\r\n// deps: ['$injector']\r\n// };\r\n\r\nexport function FxpEventBroadCastServiceFactory(i: any) {\r\n return i.get('FxpEventBroadCastService');\r\n}\r\nexport let FxpEventBroadCastServiceProvider = {\r\n provide: FxpEventBroadCastService,\r\n useFactory: FxpEventBroadCastServiceFactory,\r\n deps: ['$injector']\r\n}\r\n\r\nexport function FxpStateTransitionServiceFactory(i: any) {\r\n return i.get('FxpStateTransitionService');\r\n}\r\nexport let FxpStateTransitionServiceProvider = {\r\n provide: FxpStateTransitionService,\r\n useFactory: FxpStateTransitionServiceFactory,\r\n deps: ['$injector']\r\n}\r\n\r\nexport function FxpHttptServiceFactory(i: any) {\r\n return i.get('FxpHttpService');\r\n}\r\nexport let FxpHttpServiceProvider = {\r\n provide: FxpHttpService,\r\n useFactory: FxpHttptServiceFactory,\r\n deps: ['$injector']\r\n}\r\n\r\nexport function FxpSignalRServiceFactory(i: any) {\r\n return i.get('FxpSignalRService');\r\n}\r\nexport let FxpSignalRServiceProvider = {\r\n provide: FxpSignalRService,\r\n useFactory: FxpSignalRServiceFactory,\r\n deps: ['$injector']\r\n}\r\n\r\nexport function MsalAuthenticationServiceFactory(i: any) {\r\n return i.get('MsalAuthenticationService');\r\n}\r\n\r\nexport let MsalAuthenticationServiceProvider = {\r\n provide: MsalAuthenticationService,\r\n useFactory: MsalAuthenticationServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject AdalLoginHelperService to be used by Angular Component inside Fxp\r\n\r\nexport function AdalLoginHelperServiceFactory(i: any) {\r\n return i.get('AdalLoginHelperService');\r\n}\r\n\r\nexport let AdalLoginHelperServiceProvider = {\r\n provide: AdalLoginHelperService,\r\n useFactory: AdalLoginHelperServiceFactory,\r\n deps: ['$injector', 'MsalAuthenticationService']\r\n};\r\n\r\nexport function AdminLandingServiceFactory(i: any) {\r\n return i.get('AdminLandingService');\r\n}\r\n\r\nexport let AdminLandingServiceProvider = {\r\n provide: AdminLandingService,\r\n useFactory: AdminLandingServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject DashboardService to be used by Angular Component inside Fxp\r\n\r\nexport function DashboardServiceFactory(i: any) {\r\n return i.get('DashboardService');\r\n}\r\n\r\nexport let DashboardServiceProvider = {\r\n provide: DashboardService,\r\n useFactory: DashboardServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject DataService to be used by Angular Component inside Fxp\r\n\r\nexport function DataServiceFactory(i: any) {\r\n return i.get('DataService');\r\n}\r\n\r\nexport let DataServiceProvider = {\r\n provide: DataService,\r\n useFactory: DataServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpAuthorizationService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpAuthorizationServiceFactory(i: any) {\r\n return i.get('FxpAuthorizationService');\r\n}\r\n\r\nexport let FxpAuthorizationServiceProvider = {\r\n provide: FxpAuthorizationService,\r\n useFactory: FxpAuthorizationServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpBreadcrumbService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpBreadcrumbServiceFactory(i: any) {\r\n return i.get('FxpBreadcrumbService');\r\n}\r\n\r\nexport let FxpBreadcrumbServiceProvider = {\r\n provide: FxpBreadcrumbService,\r\n useFactory: FxpBreadcrumbServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpFeedbackService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpFeedbackServiceFactory(i: any) {\r\n return i.get('FxpFeedbackService');\r\n}\r\n\r\nexport let FxpFeedbackServiceProvider = {\r\n provide: FxpFeedbackService,\r\n useFactory: FxpFeedbackServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpMessageService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpMessageServiceFactory(i: any) {\r\n return i.get('FxpMessageService');\r\n}\r\n\r\nexport let FxpMessageServiceProvider = {\r\n provide: FxpMessageService,\r\n useFactory: FxpMessageServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpRouteService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpRouteServiceFactory(i: any) {\r\n return i.get('FxpRouteService');\r\n}\r\n\r\nexport let FxpRouteServiceProvider = {\r\n provide: FxpRouteService,\r\n useFactory: FxpRouteServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpStorageService to be used by Angular Component inside Fxp\r\n\r\nexport function FxpStorageServiceFactory(i: any) {\r\n return i.get('FxpStorageService');\r\n}\r\n\r\nexport let FxpStorageServiceProvider = {\r\n provide: FxpStorageService,\r\n useFactory: FxpStorageServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpConfigurationService to be used by Angular Component inside Fxp\r\n\r\n\r\n// Inject HelpCentralService to be used by Angular Component inside Fxp\r\n\r\nexport function HelpCentralServiceFactory(i: any) {\r\n return i.get('HelpCentralService');\r\n}\r\n\r\nexport let HelpCentralServiceProvider = {\r\n provide: HelpCentralService,\r\n useFactory: HelpCentralServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject NotificationActionCenter to be used by Angular Component inside Fxp\r\n\r\nexport function NotificationActionCenterFactory(i: any) {\r\n return i.get('NotificationActionCenter');\r\n}\r\n\r\nexport let NotificationActionCenterProvider = {\r\n provide: NotificationActionCenter,\r\n useFactory: NotificationActionCenterFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject NotificationService to be used by Angular Component inside Fxp\r\n\r\nexport function NotificationServiceFactory(i: any) {\r\n return i.get('NotificationService');\r\n}\r\n\r\nexport let NotificationServiceProvider = {\r\n provide: NotificationService,\r\n useFactory: NotificationServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n\r\n// Inject NotificationStore to be used by Angular Component inside Fxp\r\n\r\nexport function NotificationStoreFactory(i: any) {\r\n return i.get('NotificationStore');\r\n}\r\n\r\nexport let NotificationStoreProvider = {\r\n provide: NotificationStore,\r\n useFactory: NotificationStoreFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject OBOUserService to be used by Angular Component inside Fxp\r\n\r\nexport function OBOUserServiceFactory(i: any) {\r\n return i.get('OBOUserService');\r\n}\r\n\r\nexport let OBOUserServiceProvider = {\r\n provide: OBOUserService,\r\n useFactory: OBOUserServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject PageLoaderService to be used by Angular Component inside Fxp\r\n\r\nexport function PageLoaderServiceFactory(i: any) {\r\n return i.get('PageLoaderService');\r\n}\r\n\r\nexport let PageLoaderServiceProvider = {\r\n provide: PageLoaderService,\r\n useFactory: PageLoaderServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject pageTourEventService to be used by Angular Component inside Fxp\r\n\r\nexport function pageTourEventServiceFactory(i: any) {\r\n return i.get('pageTourEventService');\r\n}\r\n\r\nexport let pageTourEventServiceProvider = {\r\n provide: pageTourEventService,\r\n useFactory: pageTourEventServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject PersonalizationService to be used by Angular Component inside Fxp\r\n\r\nexport function PersonalizationServiceFactory(i: any) {\r\n return i.get('PersonalizationService');\r\n}\r\n\r\nexport let PersonalizationServiceProvider = {\r\n provide: PersonalizationService,\r\n useFactory: PersonalizationServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject PlannedDownTimeService to be used by Angular Component inside Fxp\r\n\r\nexport function PlannedDownTimeServiceFactory(i: any) {\r\n return i.get('PlannedDownTimeService');\r\n}\r\n\r\nexport let PlannedDownTimeServiceProvider = {\r\n provide: PlannedDownTimeService,\r\n useFactory: PlannedDownTimeServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject SystemMessagesService to be used by Angular Component inside Fxp\r\n\r\nexport function SystemMessagesServiceFactory(i: any) {\r\n return i.get('SystemMessagesService');\r\n}\r\n\r\nexport let SystemMessagesServiceProvider = {\r\n provide: SystemMessagesService,\r\n useFactory: SystemMessagesServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject FxpConfigurationService to be used by Angular Component inside Fxp\r\n\r\nexport function TimeZoneHelperFactory(i: any) {\r\n return i.get('TimeZoneHelper');\r\n}\r\n\r\nexport let TimeZoneHelperProvider = {\r\n provide: TimeZoneHelper,\r\n useFactory: TimeZoneHelperFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject UserInfoService to be used by Angular Component inside Fxp\r\n\r\nexport function UserInfoServiceFactory(i: any) {\r\n return i.get('UserInfoService');\r\n}\r\n\r\nexport let UserInfoServiceProvider = {\r\n provide: UserInfoService,\r\n useFactory: UserInfoServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject UserClaimsService to be used by Angular Component inside Fxp\r\n\r\nexport function UserClaimsServiceFactory(i: any) {\r\n return i.get('UserClaimsService');\r\n}\r\n\r\nexport let UserClaimsServiceProvider = {\r\n provide: UserClaimsService,\r\n useFactory: UserClaimsServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n// Inject UserProfileService to be used by Angular Component inside Fxp\r\n\r\nexport function UserProfileServiceFactory(i: any) {\r\n return i.get('UserProfileService');\r\n}\r\n\r\nexport let UserProfileServiceProvider = {\r\n provide: UserProfileService,\r\n useFactory: UserProfileServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function FxpLoggerServiceFactory(i: any) {\r\n return i.get('FxpLoggerService');\r\n}\r\n\r\nexport let FxpLoggerServiceProvider = {\r\n provide: FxpLoggerService,\r\n useFactory: FxpLoggerServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n\r\nexport function FxpConfitServiceFactory(i: any) {\r\n return i.get('ConFitService');\r\n}\r\n\r\nexport let FxpConfitServiceProvider = {\r\n provide: ConFitService,\r\n useFactory: FxpConfitServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n\r\nexport function FxpFeatureFlagServiceFactory(i: any) {\r\n return i.get('FeatureFlagService');\r\n}\r\n\r\nexport let FxpFeatureFlagServiceProvider = {\r\n provide: FeatureFlagService,\r\n useFactory: FxpFeatureFlagServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function FxpUIDataFactory(i: any) {\r\n return i.get('FxpUIData');\r\n}\r\n\r\nexport let FxpUIDataProvider = {\r\n provide: FxpUIData,\r\n useFactory: FxpUIDataFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function DeviceFactoryFactory(i: any) {\r\n return i.get('DeviceFactory');\r\n}\r\n\r\nexport let DeviceFactoryProvider = {\r\n provide: deviceFactoryProvider,\r\n useFactory: DeviceFactoryFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function SettingsServiceFactory(i: any) {\r\n return i.get('SettingsService');\r\n}\r\n\r\nexport let SettingsServiceProvider = {\r\n provide: settingsServiceProvider,\r\n useFactory: SettingsServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n\r\nexport function FxpStateServiceFactory(i: any) {\r\n return i.get('$state');\r\n}\r\n\r\nexport let FxpStateServiceProvider = {\r\n provide: StateService,\r\n useFactory: FxpStateServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function FxpPartnerHttpInterceptorHooksFactory(i: any) {\r\n return i.get('FxpPartnerHttpInterceptorHooks');\r\n}\r\n\r\nexport let FxpHttpInterceptorHooksProvider = {\r\n provide: FxpPartnerHttpInterceptorHooks,\r\n useFactory: FxpPartnerHttpInterceptorHooksFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function FxpContextServiceFactory(i: any) {\r\n return i.get('FxpContextService');\r\n}\r\n\r\nexport let FxpContextServiceProvider = {\r\n provide: FxpContext,\r\n useFactory: FxpContextServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n\r\nexport function LazyLoaderServiceFactory(i: any) {\r\n return i.get('LazyLoaderService');\r\n}\r\n\r\nexport let LazyLoaderServiceProvider = {\r\n provide: LazyLoaderService,\r\n useFactory: LazyLoaderServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function FxpIrisBotServiceFactory(i: any) {\r\n return i.get('FxpIrisBotService');\r\n}\r\n\r\nexport let FxpIrisBotServiceProvider = {\r\n provide: FxpIrisBotService,\r\n useFactory: FxpIrisBotServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\nexport function FxpGlobalStoreServiceFactory(i: any) {\r\n return i.get('FxpGlobalStoreService');\r\n}\r\n\r\nexport let FxpGlobalStoreServiceProvider = {\r\n provide: FxpGlobalStoreService,\r\n useFactory: FxpGlobalStoreServiceFactory,\r\n deps: ['$injector']\r\n};\r\n\r\n\r\nexport function FxpOCVFeedbackServiceFactory(i: any) {\r\n return i.get('FxpOCVFeedbackService');\r\n}\r\n\r\nexport let FxpOCVFeedbackServiceProvider = {\r\n provide: FxpOCVFeedbackService,\r\n useFactory: FxpOCVFeedbackServiceFactory,\r\n deps: ['$injector']\r\n};","import { AbstractLogger } from 'redux-micro-frontend';\r\nimport { LogPropertyBag } from '../../js/telemetry/LogPropertyBag';\r\nimport { ILogger as IFxpLogger } from '../../js/interfaces/ILogger';\r\nimport { ErrorSeverityLevel } from '../../js/telemetry/ErrorSeverityLevel';\r\nimport { ErrorCodes } from '../../js/constants/errorCodes';\r\nimport { TelemetryConstants } from '../../js/telemetry/TelemetryConst';\r\n\r\nexport class ActionLoggerAdapter extends AbstractLogger {\r\n private _source: string = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.Store.ActionLogger`;\r\n private _eventBase: string =`${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.Store`; \r\n\r\n constructor(private _fxpLogger: IFxpLogger) {\r\n super(\"FXP_APP_INSIGHTS_LOGGER\");\r\n }\r\n\r\n processEvent(source: string, eventName: string, properties: any): void {\r\n let propertyBag = this.CreatePropertyBag(properties);\r\n this._fxpLogger.logEvent(this._source, `${this._eventBase}.${eventName}`, propertyBag);\r\n }\r\n\r\n processException(source: string, error: Error, properties: any): void {\r\n let propertyBag = this.CreatePropertyBag(properties);\r\n this._fxpLogger.logException(this._source, error, propertyBag, null, null, ErrorSeverityLevel.Medium, ErrorCodes.ReduxStoreException);\r\n }\r\n\r\n private CreatePropertyBag(properties: any): LogPropertyBag {\r\n let propertyBag = this._fxpLogger.createPropertyBag();\r\n if (properties !== undefined && properties !== null && Object.keys(properties).length) {\r\n Object.keys(properties).forEach(key => {\r\n propertyBag.addToBag(key, properties[key]);\r\n });\r\n }\r\n return propertyBag;\r\n }\r\n}","import { AppStatusReducer } from '../init/app.status.reducer';\r\nimport { AdminTileReducer } from '../adminTiles/adminTiles.reducer';\r\nimport {BannerReducer} from '../banner/banner.reducer'\r\nimport { Reducer, combineReducers } from 'redux';\r\nimport { LoaderReducer } from '../loader/loader.reducer';\r\nimport { LoggedInUserReducer,CurrentUserReducer } from '../user/user.reducer';\r\nimport { OBOReducer } from '../obo/obo.reducer';\r\nimport { LeftNavigationReducer } from '../leftNavigation/leftNavigation.reducer';\r\nimport { FeatureFlagReducer } from '../flighting/flighting.reducer';\r\nimport { SystemMessageReducer } from '../systemMessages/systemMessage.reducer';\r\nimport { NotificationReducer } from '../notifications/notifications.reducer';\r\n\r\nexport const PlatformReducer: Reducer = combineReducers({\r\n Status: AppStatusReducer,\r\n Banners: BannerReducer,\r\n LoggedInUser: LoggedInUserReducer,\r\n CurrentUser: CurrentUserReducer,\r\n OBO:OBOReducer,\r\n AdminTiles: AdminTileReducer,\r\n LeftNavigation: LeftNavigationReducer,\r\n SystemMessages: SystemMessageReducer,\r\n Loader: LoaderReducer,\r\n FeatureFlags: FeatureFlagReducer,\r\n Notifications: NotificationReducer\r\n});","import { Store } from 'redux';\r\nimport { GlobalStore } from 'redux-micro-frontend';\r\nimport { PlatformReducer } from './platform.reducer';\r\nimport { IPlatformState } from './platform.state.model'\r\nimport { ActionLoggerAdapter } from './action.logger.adaptor';\r\nimport { ILogger as IFxpLogger } from '../../js/interfaces/ILogger';\r\nexport class PlatformStoreFactory {\r\n \r\n public static FxpStore: Store;\r\n static CreateIfNotExist(fxpLogger: IFxpLogger): Store {\r\n if (PlatformStoreFactory.FxpStore !== undefined && PlatformStoreFactory.FxpStore !== null) {\r\n return PlatformStoreFactory.FxpStore;\r\n }\r\n return this.Create(fxpLogger);\r\n }\r\n static Create(fxpLogger: IFxpLogger): Store {\r\n let actionLoggerAdaptor = fxpLogger !== undefined && fxpLogger !== null \r\n ? new ActionLoggerAdapter(fxpLogger)\r\n : null;\r\n \r\n let environment = window[\"FxpAppSettings\"].EnvironmentName;\r\n let debugMode = environment !== \"Production\";\r\n let globalStore = GlobalStore.Get(debugMode, actionLoggerAdaptor);\r\n if (actionLoggerAdaptor)\r\n globalStore.SetLogger(actionLoggerAdaptor);\r\n PlatformStoreFactory.FxpStore = globalStore.CreateStore(GlobalStore.Platform, PlatformReducer, [], [GlobalStore.AllowAll], false, true);\r\n return PlatformStoreFactory.FxpStore;\r\n }\r\n\r\n static Get(): Store {\r\n if (PlatformStoreFactory.FxpStore !== undefined && PlatformStoreFactory.FxpStore !== null) {\r\n return PlatformStoreFactory.FxpStore;\r\n }\r\n throw new Error(\"FXP Store hasn't been created\");\r\n }\r\n}","import { ISystemMessage } from \"./systemMessage.model\";\r\nimport { FxpConstants } from \"../../js/common/ApplicationConstants\";\r\nimport { FxpConfigurationService } from \"../../js/services/FxpConfiguration\";\r\nimport { SYSTEM_MESSAGE_UI } from \"../../js/constants/systemMessages.constants\";\r\nimport { ILogger } from \"../../js/interfaces/ILogger\";\r\nimport { TimeZoneHelper } from \"../../js/services/TimeZoneHelper\";\r\nimport { SystemMessagesService } from \"./SystemMessagesService\";\r\nimport { IRootScope } from \"../../js/interfaces/IRootScope\";\r\nimport { IFxPService } from \"../../js/interfaces/IFxpService\";\r\nimport { FxpSignalRService } from \"../../js/services/FxpSignalRClient\";\r\nimport { DashboardService } from \"../../js/services/dashboardService\";\r\nimport { FxpRouteService } from \"../../js/services/FxpRouteService\";\r\nimport { FxpGlobalStoreService } from \"../../js/services/fxp.global.store.service\";\r\nimport { IPlatformState } from \"../store/platform.state.model\";\r\nimport { TelemetryConstants } from \"../../js/telemetry/TelemetryConst\";\r\nimport { RemoveSystemMessage, UpsertSystemMessage } from \"./systemMessage.action\";\r\nimport { ErrorSeverityLevel } from \"../../js/telemetry/ErrorSeverityLevel\";\r\nimport { ErrorCodes } from \"../../js/constants/errorCodes\";\r\n\r\ndeclare var _: any;\r\n\r\nexport class PlannedDownTimeService implements IFxPService {\r\n\tprivate intervalTimeMinutes: number;\r\n\tprivate displayFlashBeforeMinutes: number;\r\n\tprivate errorCount = 0;\r\n\tprivate loadPromise: angular.IPromise;\r\n\tprivate plannedDownTimeCollection: Array = [];\r\n\r\n\tprivate systemAnnouncementCollection: Array = [];\r\n\tprivate isFlashVisible: boolean = false;\r\n\tprivate flashMessages: Array = [];\r\n\tprivate dismissedSysMessageIds: Array = [];\r\n\r\n\tpublic isSystemAnnouncementVisible: boolean = false;\r\n\tprivate systemAnnouncementMesage: string;\r\n\tprivate currentLeftNavItem: any;\r\n\tprivate systemDownMessage: string;\r\n\tprivate timeFormat = \"MM/DD/YYYY h:mm a z\";\r\n\tprivate unsubscribeFunction: any;\r\n\tprivate readonly signalREventName = \"onSystemMessageChange\";\r\n\tprivate readonly signalRTenant = \"FXP\";\r\n\tsourceForTelemetry: string = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.PlannedDownTimeService`;\r\n\r\n\tconstructor(private $timeout: any,\r\n\t\tprivate fxpConfiguration: FxpConfigurationService,\r\n\t\tprivate SystemMessagesService: SystemMessagesService,\r\n\t\tprivate TimeZoneHelper: TimeZoneHelper,\r\n\t\tprivate moment: any,\r\n\t\tprivate UiString: SYSTEM_MESSAGE_UI,\r\n\t\tprivate logger: ILogger,\r\n\t\tprivate $window: angular.IWindowService,\r\n\t\tprivate fxpSignalRService: FxpSignalRService,\r\n\t\tprivate dashboardService: DashboardService,\r\n\t\tprivate $rootScope: IRootScope,\r\n\t\tprivate fxpRouteService: FxpRouteService,\r\n\t\tprivate fxpGlobalStore: FxpGlobalStoreService) {\r\n\r\n\t\tthis.intervalTimeMinutes = fxpConfiguration.FxpAppSettings.FlashPollingIntervalInMinutes;\r\n\t\tthis.displayFlashBeforeMinutes = fxpConfiguration.FxpAppSettings.DisplayFlashBeforeMinutes;\r\n\t\t\r\n\t\tthis.dismissedSysMessageIds = localStorage['DismissedSystemMessages'] ? JSON.parse(localStorage['DismissedSystemMessages']) : [];\r\n\r\n\t\t// subscribe to platform state\r\n\t\tthis.fxpGlobalStore.SubscribeToPlatformState(\"Platform\", (platformState : IPlatformState) => {\r\n\t\t\tlet systemMessagesInState = platformState.SystemMessages;\r\n\t\t\tif(systemMessagesInState.length > 0) {\t\t\r\n\t\t\t\tthis.flashMessages = systemMessagesInState;\r\n\t\t\t\tthis.isFlashVisible = true;\r\n\t\t\t} else {\r\n\t\t\t\tthis.isFlashVisible = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\r\n\tpublic subscribeToSignalREvent() {\r\n\t\tif (!this.unsubscribeFunction) {\r\n\t\t\tthis.unsubscribeFunction = this.fxpSignalRService.subscribe(this.signalREventName, this.signalRTenant, this.onMessageFromSignalR.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tpublic unsubscribeSignalREvent() {\r\n\t\tif (this.unsubscribeFunction) {\r\n\t\t\tthis.unsubscribeFunction();\r\n\t\t\tthis.unsubscribeFunction = null;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate onMessageFromSignalR = function (response: any) {\r\n\t\tif (!response)\r\n\t\t\treturn;\r\n\r\n\t\tif (response.operation === \"edit\" || response.operation === \"delete\")\r\n\t\t\tthis.plannedDownTimeCollection = this.plannedDownTimeCollection.filter(x => x.id !== response.payLoadObject.id);\r\n\r\n\t\tthis.cleanSysMessageIdsInLocalStorage();\r\n\r\n\t\tif (response.operation === \"add\" || response.operation === \"edit\")\r\n\t\t\tthis.plannedDownTimeCollection = this.plannedDownTimeCollection.concat(response.payLoadObject);\r\n\r\n\t\t_.each(this.plannedDownTimeCollection, (item: ISystemMessage) => {\r\n\t\t\titem.startTime = this.TimeZoneHelper.convertUtcToLocal(this.moment.utc(item.startTime));\r\n\t\t\titem.endTime = this.TimeZoneHelper.convertUtcToLocal(this.moment.utc(item.endTime));\r\n\t\t});\r\n\r\n\t\tthis.updateFlash();\r\n\t}\r\n\r\n\tGetSystemAnnouncementMessageandUpdateFlash() {\r\n\t\tlet self = this;\r\n\t\tconst tenSeconds = 10000;\r\n\t\tself.$timeout(function () {\r\n\t\t\tself.SystemMessagesService.getSystemAnnoucementCollection()\r\n\t\t\t\t.then(onSystemAnnouncementSuccess.bind(self))\r\n\t\t\t\t.then(self.updateSystemAnnouncementFlash.bind(self))\r\n\t\t\t\t.catch(onRejected.bind(self));\r\n\t\t}, tenSeconds);\r\n\r\n\t\tfunction onSystemAnnouncementSuccess(response) {\r\n\t\t\tlet self = this;\r\n\r\n\t\t\tif (!response)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tself.systemAnnouncementCollection = response;\r\n\r\n\t\t\t_.each(self.systemAnnouncementCollection, (item: ISystemMessage) => {\r\n\t\t\t\titem.startTime = self.TimeZoneHelper.convertUtcToLocal(self.moment.utc(item.startTime));\r\n\t\t\t\titem.endTime = self.TimeZoneHelper.convertUtcToLocal(self.moment.utc(item.endTime));\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction onRejected(error) {\r\n\t\t}\r\n\t}\r\n\r\n\tpollForPlannedDownTimesandUpdateFlash() {\r\n\t\tlet self = this;\r\n\t\tconst tenSeconds = 10000;\r\n\t\tself.$timeout(function () {\r\n\t\t\tself.SystemMessagesService.getPlannedDownTimeCollection()\r\n\t\t\t\t.then(onSuccess.bind(self))\r\n\t\t\t\t.then(self.updateFlash.bind(self))\r\n\t\t\t\t.catch(onRejected.bind(self))\r\n\t\t\t\t.finally(self.nextLoad.bind(self));\r\n\t\t}, tenSeconds);\r\n\r\n\t\tfunction onSuccess(response) {\r\n\t\t\tlet self = this;\r\n\r\n\t\t\tif (!response)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tself.plannedDownTimeCollection = response;\r\n\r\n\t\t\t_.each(self.plannedDownTimeCollection, (item: ISystemMessage) => {\r\n\t\t\t\titem.startTime = self.TimeZoneHelper.convertUtcToLocal(self.moment.utc(item.startTime));\r\n\t\t\t\titem.endTime = self.TimeZoneHelper.convertUtcToLocal(self.moment.utc(item.endTime));\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction onRejected(error) {\r\n\t\t}\r\n\t};\r\n\r\n\tprivate pollForUpdateFlash() {\r\n\t\tlet self = this;\r\n\t\tself.updateFlash();\r\n\t\tself.nextLoad();\r\n\t}\r\n\r\n\tcancelNextLoad() {\r\n\t\tlet self = this;\r\n\t\tself.$timeout.cancel(self.loadPromise);\r\n\t};\r\n\r\n\tnextLoad() {\r\n\t\tlet self = this;\r\n\t\tself.cancelNextLoad();\r\n\t\tself.loadPromise = self.$timeout(self.pollForUpdateFlash.bind(self), self.intervalTimeMinutes * 60 * 1000);\r\n\t};\r\n\r\n\tpausePlannedDownTimesPoll() {\r\n\t\tvar self = this;\r\n\t\tif (self.loadPromise) {\r\n\t\t\tself.cancelNextLoad();\r\n\t\t}\r\n\t};\r\n\r\n\tresumePlannedDownTimesPoll() {\r\n\t\tvar self = this;\r\n\t\tself.pollForPlannedDownTimesandUpdateFlash();\r\n\t};\r\n\r\n\tupdateFlash() {\r\n\t\tlet self = this;\r\n\t\tif (!self.plannedDownTimeCollection || !self.currentLeftNavItem)\r\n\t\t\treturn;\r\n\r\n\t\tvar item = self.currentLeftNavItem;\r\n\t\tthis.isFlashVisible = false;\r\n\r\n\t\ttry {\r\n\t\t\tlet messagesToFlash: Array = [];\r\n\t\t\t_.each(self.plannedDownTimeCollection, (downTime: ISystemMessage) => {\r\n\t\t\t\tvar now = this.moment();\r\n\r\n\t\t\t\tif (self.isDownTimeConfigured(item, downTime)) {\r\n\t\t\t\t\t//Intermittent Message or Flash\r\n\t\t\t\t\tvar tempTime = downTime.startTime.clone();\r\n\t\t\t\t\tif (self.isSystemDown(downTime)) {\r\n\t\t\t\t\t\tthis.isFlashVisible = false;\r\n\t\t\t\t\t\tvar end = this.moment.tz(downTime.endTime, this.moment.tz.guess()).format(this.timeFormat);\r\n\t\t\t\t\t\tthis.systemDownMessage = downTime.message;\r\n\t\t\t\t\t\t//If any of the system down time message is active then break the loop.\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (now.isSameOrAfter(tempTime.subtract(self.displayFlashBeforeMinutes, \"minutes\"))\r\n\t\t\t\t\t\t&& now.isSameOrBefore(downTime.endTime)) {\r\n\t\t\t\t\t\t// check for the messageId in the localStorage, push if the id is not found.\r\n\t\t\t\t\t\tif(!this.dismissedSysMessageIds.includes(downTime.id)) {\r\n\t\t\t\t\t\t\tmessagesToFlash.push(downTime);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tthis.fxpGlobalStore.DispatchGlobalAction(\"Platform\", UpsertSystemMessage(messagesToFlash));\r\n\t\t}\r\n\t\tcatch (e) {\r\n \t\tself.logger.logException(`${this.sourceForTelemetry}.UpdateFlash`, e, null, null, null, ErrorSeverityLevel.Medium, ErrorCodes.PlannedDownTime_UpdateFlash_Failure);\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tupdateSystemAnnouncementFlash() {\r\n\t\tlet self = this;\r\n\t\tif (!self.systemAnnouncementCollection || !self.currentLeftNavItem)\r\n\t\t\treturn;\r\n\r\n\t\tvar item = self.currentLeftNavItem;\r\n\t\tthis.systemAnnouncementMesage = '';\r\n\t\tthis.isSystemAnnouncementVisible = false;\r\n\r\n\t\ttry {\r\n\t\t\t_.each(self.systemAnnouncementCollection, (downTime: ISystemMessage) => {\r\n\t\t\t\tvar now = this.moment();\r\n\r\n\t\t\t\tif (self.isDownTimeConfigured(item, downTime)) {\r\n\t\t\t\t\t//Intermittent Message or Flash\r\n\t\t\t\t\tvar tempTime = downTime.startTime.clone();\r\n\t\t\t\t\tif (now.isSameOrAfter(tempTime.subtract(self.displayFlashBeforeMinutes, \"minutes\"))\r\n\t\t\t\t\t\t&& now.isSameOrBefore(downTime.endTime)) {\r\n\r\n\t\t\t\t\t\tthis.systemAnnouncementMesage = self.concatenateFlashMessage(this.systemAnnouncementMesage, downTime);\r\n\t\t\t\t\t\tthis.isSystemAnnouncementVisible = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tself.logger.logException(`${this.sourceForTelemetry}.UpdateSystemAnnouncementFlash`, e, null, null, null, ErrorSeverityLevel.Medium, ErrorCodes.PlannedDownTime_UpdateSystemAccouncement_Failure);\r\n\t\t}\r\n\t};\r\n\r\n\tisDownTimeConfigured(item: any, downTime: ISystemMessage) {\r\n\r\n\t\t//Return true when capability is All. Id for All is 0.\r\n\t\tif (downTime.businessCapability[0].id == 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (this.isMessageConfiguredOnLeftNav(item, downTime)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tvar leftNavLinks = this.dashboardService.getCachedLeftNavForCurrentUser();\r\n\t\t\tif (leftNavLinks === undefined || leftNavLinks === null || leftNavLinks.length <= 0)\r\n\t\t\t\treturn false;\r\n\t\t\tvar dashboardItem = leftNavLinks.find(item => item.id == 100);\r\n\t\t\tif(dashboardItem)\r\n\t\t\t\tdashboardItem.targetUIStateName = this.fxpRouteService.getDefaultStateName();\r\n\t\t\t\r\n\t\t\tvar leftNavItemsWithCurrentState = leftNavLinks.filter(function (leftNav) {\r\n\t\t\t\treturn (leftNav.targetUIStateName && leftNav.targetUIStateName.toLowerCase() === item.targetUIStateName.toLowerCase());\r\n\t\t\t});\r\n\t\t\tif (leftNavItemsWithCurrentState === undefined || leftNavItemsWithCurrentState === null || leftNavItemsWithCurrentState.length <= 0)\r\n\t\t\t\treturn false;\r\n\t\t\tlet isSystemMessageVisible = false;\r\n\t\t\tleftNavItemsWithCurrentState.forEach(selectedItem => {\r\n\t\t\t\tif (this.isMessageConfiguredOnLeftNav(selectedItem, downTime))\r\n\t\t\t\t\tisSystemMessageVisible = true;\r\n\t\t\t});\r\n\t\t\treturn isSystemMessageVisible;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate isMessageConfiguredOnLeftNav(item: any, downTime: ISystemMessage) {\r\n\t\treturn (item.id == downTime.businessCapability[0].id\r\n\t\t\t|| (downTime.businessFunction.length > 0\r\n\t\t\t\t&& item.id == downTime.businessFunction[0].id)\r\n\t\t\t|| (item.parentId == downTime.businessCapability[0].id\r\n\t\t\t\t&& downTime.businessFunction[0].id == 0));\r\n\t}\r\n\r\n\tisSystemDown(downTime: ISystemMessage) {\r\n\t\tvar now = this.moment();\r\n\r\n\t\tif (downTime.messageType == \"SystemDown\"\r\n\t\t\t&& now.isAfter(downTime.startTime)\r\n\t\t\t&& now.isSameOrBefore(downTime.endTime))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tconcatenateFlashMessage(message: string, downTime: ISystemMessage) {\r\n\t\tlet tempMessage = message;\r\n\r\n\t\tif (tempMessage != '')\r\n\t\t\ttempMessage = tempMessage + '
';\r\n\r\n\t\ttempMessage = tempMessage + downTime.message;\r\n\r\n\t\treturn tempMessage;\r\n\t}\r\n\r\n\tisStateDown(stateName) {\r\n\t\tvar self = this;\r\n\r\n\t\tif (!self.plannedDownTimeCollection || !self.currentLeftNavItem)\r\n\t\t\treturn false;\r\n\r\n\t\tvar item = self.currentLeftNavItem;\r\n\t\tvar systemDown = false;\r\n\r\n\t\t_.each(self.plannedDownTimeCollection, (downTime: ISystemMessage) => {\r\n\r\n\t\t\tif (self.isDownTimeConfigured(item, downTime)) {\r\n\t\t\t\tif (self.isSystemDown(downTime)) {\r\n\r\n\t\t\t\t\tvar downStateName = item.targetUIStateName || item.targetURL || item.targetEventName;\r\n\r\n\t\t\t\t\tif (stateName == downStateName) {\r\n\t\t\t\t\t\tsystemDown = true;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn systemDown;\r\n\t}\r\n\r\n\tcloseSystemAnnouncement() {\r\n\t\tvar self = this;\r\n\t\tself.isSystemAnnouncementVisible = false;\r\n\t\tself.$rootScope.isSystemAnnouncementVisible = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Closes the specific SytemMessage when dismissed. \r\n\t * @param messageId - id of the System Message to be removed\r\n\t */\r\n\tprivate closeSystemMessage(messageId) {\r\n\t\tvar self = this;\r\n\t\t// push the messageId to the dismissedSystemMessages in local storage.\r\n\t\tthis.dismissedSysMessageIds.push(messageId)\r\n\t\tlocalStorage['DismissedSystemMessages'] = JSON.stringify(this.dismissedSysMessageIds);\r\n\t\tself.fxpGlobalStore.DispatchGlobalAction(\"Platform\", RemoveSystemMessage(messageId));\r\n\t}\r\n\r\n\t/**\r\n\t * Cleans the dismissedSysMessageId in local storage by comparing with plannedDownTimeCollection. \r\n\t */\r\n\tprivate cleanSysMessageIdsInLocalStorage() {\r\n\t\tthis.dismissedSysMessageIds = this.dismissedSysMessageIds.filter(id => this.plannedDownTimeCollection.some(sysMessage => sysMessage.id === id));\r\n\t\tlocalStorage['DismissedSystemMessages'] = JSON.stringify(this.dismissedSysMessageIds);\r\n\t}\r\n}\r\n","import { ISystemMessagesService } from \"./ISystemMessagesService\";\r\nimport { FxpConfigurationService } from \"../../js/services/FxpConfiguration\";\r\nimport { ISystemMessage } from \"./systemMessage.model\";\r\nimport { UserInfoService } from \"../../js/services/UserInfoService\";\r\nimport { IHttpPromise, IPromise } from \"angular\";\r\nimport { IFxPService } from \"../../js/interfaces/IFxpService\";\r\n\r\nexport class SystemMessagesService implements ISystemMessagesService,IFxPService {\r\n\tprivate systemMessagesEndPoint: string;\r\n\tprivate allSystemMessagesEndpoint: string[];\r\n\r\n\tprivate allSystemAnnouncementEndpoints: string[];\r\n\r\n\tconstructor(private http: angular.IHttpService,\r\n\t\tprivate fxpConfiguration: FxpConfigurationService, private $q: angular.IQService, private userInfoService: UserInfoService) {\r\n\t\tthis.systemMessagesEndPoint = this.fxpConfiguration.FxpAppSettings.FxpServiceEndPoint + \"/systemmessages\";\r\n\t\tthis.allSystemMessagesEndpoint = this.fxpConfiguration.FxpAppSettings.SystemMessageEndpoints.split(',');\r\n\t\tthis.allSystemAnnouncementEndpoints = this.fxpConfiguration.FxpAppSettings.SystemAnnouncementEndpoints.split(',');\r\n\t}\r\n\r\n\tgetSystemMessagesCollectionAsync = (messageCount: number, pageOffset: number, sortOrder: string): IHttpPromise> => {\r\n\t\tlet params = {\r\n\t\t\t'pageSize': messageCount,\r\n\t\t\t'pageNo': pageOffset,\r\n\t\t\t'sortOrder': sortOrder\r\n\t\t};\r\n\t\treturn this.http.get(this.systemMessagesEndPoint, { params: params });\r\n\t}\r\n\r\n\tsaveSystemMessageAsync = (systemMessage: ISystemMessage): IPromise => {\r\n\t\treturn this.http.post(this.systemMessagesEndPoint, systemMessage, { headers: { 'Content-Type': 'application/json' } });\r\n\t}\r\n\r\n\tdeleteSystemMessageAsync = (systemMessageId: string): IPromise => {\r\n\t\tlet params = { 'id': systemMessageId };\r\n\t\treturn this.http.delete(this.systemMessagesEndPoint, { params: params });\r\n\t}\r\n\r\n\tgetPlannedDownTimeCollection = (): IPromise> => {\r\n\t\tlet promises : Array>> = [];\r\n\t\tlet self = this;\r\n\t\tself.allSystemMessagesEndpoint.forEach(endpoint => { promises.push(this.getSystemMessages(endpoint))})\r\n\t\treturn this.$q.all(promises).then((results: Array>) => {\r\n\t\t\treturn results.reduce((acc, val) => acc.concat(val), []);\r\n\t\t});\r\n\t}\r\n\r\n\tgetSystemAnnoucementCollection = (): IPromise> => {\r\n\t\tlet promises : Array>> = [];\r\n\t\tlet self = this;\r\n\t\tlet userAlias = self.userInfoService.getLoggedInUser();\r\n\t\tlet requestHeaders = {};\r\n\t\trequestHeaders[\"x-alias\"] = userAlias;\r\n\t\tself.allSystemAnnouncementEndpoints.forEach(endpoint => { promises.push(this.getSystemMessages(endpoint, requestHeaders))})\r\n\t\treturn this.$q.all(promises).then((results: Array>) => {\r\n\t\t\t// append all the api results in a single array\r\n\t\t\treturn results.reduce((acc, val) => acc.concat(val), []);\r\n\t\t});\r\n\t}\r\n\r\n\tgetSystemMessages(url: string, headers?: any) : IPromise> {\r\n\t\treturn this.http.get(url, { headers: headers })\r\n\t\t\t.then(response => (response.data).systemMessages);\r\n\t}\r\n}","import { IAction } from 'redux-micro-frontend';\r\nimport { SystemMessageActions } from \"./systemMessage.action.types\";\r\nimport { ISystemMessage } from \"./systemMessage.model\";\r\n\r\nexport const UpsertSystemMessage = (payload: Array): IAction> => {\r\n return { \r\n type: SystemMessageActions.UPSERT_SYSTEM_MESSAGE,\r\n payload: payload\r\n } \r\n}\r\n\r\nexport const RemoveSystemMessage = (payload: string): IAction => {\r\n return {\r\n type: SystemMessageActions.REMOVE_SYSTEM_MESSAGE,\r\n payload: payload\r\n }\r\n}","export enum SystemMessageActions {\r\n UPSERT_SYSTEM_MESSAGE = \"UPSERT_SYSTEM_MESSAGE\",\r\n REMOVE_SYSTEM_MESSAGE = \"REMOVE_SYSTEM_MESSAGE\"\r\n}","import { IAction } from 'redux-micro-frontend';\r\nimport { Reducer } from \"redux\";\r\nimport { SystemMessageActions } from \"./systemMessage.action.types\";\r\nimport { ISystemMessage } from \"./systemMessage.model\";\r\n\r\n\r\nlet defaultState: Array = [];\r\n\r\nexport const SystemMessageReducer: Reducer, IAction | string>> = (\r\n state: Array = defaultState,\r\n action: IAction\r\n): Array => {\r\n\r\n switch(action.type) {\r\n case SystemMessageActions.UPSERT_SYSTEM_MESSAGE: {\r\n return (action.payload === undefined || action.payload === null) ? defaultState : action.payload; \r\n }\r\n case SystemMessageActions.REMOVE_SYSTEM_MESSAGE: {\r\n return state.filter(message => message.id !== action.payload)\r\n }\r\n }\r\n return state;\r\n}\r\n","import { ProfileReducer } from '../profile/profile.reducer';\r\nimport { Reducer, combineReducers } from 'redux';\r\nimport { ClaimsReducer } from '../claims/claims.reducer';\r\nimport { User } from './user.state.model';\r\nimport { IAction } from 'redux-micro-frontend';\r\nimport { Claims } from '../claims/claims.model';\r\nimport { ClaimsActionTypes } from '../claims/claims.action.types';\r\nimport { ProfileActionTypes } from '../profile/profile.action.types';\r\nimport { Profile } from '../profile/profile.model';\r\nvar defaultUser: User = {\r\n Profile: {} as Profile,\r\n Claims: {} as Claims\r\n}\r\nexport const LoggedInUserReducer: Reducer> = (\r\n state: User = defaultUser,\r\n action: IAction): User => {\r\n if (action.type == ClaimsActionTypes.ADD_LOGGED_IN_USER_CLAIMS || action.type == ProfileActionTypes.ADD_LOGGED_IN_USER_PROFILE) {\r\n\r\n return {\r\n Profile: ProfileReducer(state.Profile, action),\r\n Claims: ClaimsReducer(state.Claims, action)\r\n }\r\n }\r\n return state;\r\n}\r\nexport const CurrentUserReducer: Reducer> = (\r\n state: User = defaultUser,\r\n action: IAction): User => {\r\n if (action.type == ClaimsActionTypes.ADD_CURRENT_USER_CLAIMS || action.type ==ProfileActionTypes.ADD_CURRENT_USER_PROFILE) {\r\n\r\n return {\r\n Profile: ProfileReducer(state.Profile, action),\r\n Claims: ClaimsReducer(state.Claims, action)\r\n }\r\n }\r\n return state;\r\n}","import { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\n\r\nexport class CustomEvents {\r\n\tpublic static UserSessionCreated: string = 'UserSessionCreated';\r\n\tpublic static FxpAppLaunched: string = 'FxpAppLaunched';\r\n\tpublic static StartUpFlagRetrieved = 'StartUpFlagRetrieved';\r\n\tpublic static PageTourFlagRetrieved = 'PageTourFlagRetrieved';\r\n\tpublic static SkypeBotInit = 'SkypeBotInit';\r\n\tpublic static ProfileNotFound = 'ProfileNotFound';\r\n\tpublic static RedirectedToSales = 'RedirectedToSales';\r\n\tpublic static OnProfileFromGraphAPI = 'OnProfileFromGraphAPI';\r\n}\r\n\r\nexport class ApplicationConstants {\r\n\tpublic static Application = \"Application\";\r\n\tpublic static Global = \"Global\";\r\n\tpublic static GlobalContextDBName: string = 'globalV3';\r\n\tpublic static BootApiUrl = \"/Home/GetClientSideConfiguration\";\r\n\tpublic static WorkerFilepath = \"../js/webworker/fxpwebworker.js\";\r\n\tpublic static BaseConfigDBName = \"BaseConfigDB\";\r\n\tpublic static PersonaConfigByRoleGroupId = \"/Home/GetConfiguration\";\r\n\t/*Added for partner Login : OPS is expecting \"Partners~user\" for getBasicprofile api */\r\n\tpublic static PartnerDomain = \"Partners~\";\r\n\tpublic static PartnerDomainIss = \"https://sts.windows.net/a5f51bc5-4d47-4954-a546-bafe55e8db16/\";\r\n\tpublic static UserProfile = \"UserInfo\";\r\n\tpublic static UIConfigDB = \"UIConfigDB\";\r\n\tpublic static UserInfo = \"userInfo\";\r\n\tpublic static UserClaims = \"userClaims\";\r\n\tpublic static BaseUrl = \"BaseUrl\";\r\n\tpublic static FxpBaseUrl = \"https://\" + window.location.host;\r\n\tpublic static AssetsUrl = \"AssetsUrl\";\r\n\tpublic static ProfileStateName = \"profile\";\r\n\tpublic static ErrorStateNames = [\"oneprofile.customErrorPage\", \"unauthorized\"];\r\n\tpublic static RequiredMessage = \"{0} is required\";\r\n\tpublic static CouchBaseLoginContract = \"api/Login?dbName=\";\r\n\tpublic static FxpSessionKey = \"FxpSessionId\";\r\n\tpublic static FxpApplaunchedKey = \"FxpAppLaunched\";\r\n\tpublic static RequestStateName = \"REQSTATE\";\r\n\tpublic static FxpBreadcrumbStorageKey = \"FxpBreadCrumb\";\r\n\tpublic static PageTourFeature = \"PageTour\";\r\n\tpublic static UserPreferencesSettings = \"UserPreferences\";\r\n\tpublic static FxPAppName = \"FxP\";\r\n\tpublic static FxPDbName = \"FxPV2\";\r\n\tpublic static UserPreferencesStorageKey = \"{0}-preferences\";\r\n\tpublic static PageTourLoggerService = \"FxpLoggerService\";\r\n\tpublic static FxpAdminData = \"AdminTilesData\";\r\n\tpublic static SnowRequestTypeSettings = \"SnowRequestType\";\r\n\tpublic static ESTenanatUrlString = \"ESXP\";\r\n\tpublic static SalesTenantUrlString = \"li360\";\r\n\tpublic static XUserClaimsToken = \"X-UserClaimsToken\";\r\n\tpublic static XTenantId = \"X-TenantId\";\r\n\tpublic static XResources = \"X-Resources\";\r\n\tpublic static GraphApiProfileUrl = \"myorganization/me?api-version=1.6\";\r\n\tpublic static DefaultHelpLink = \"Default\";\r\n\tpublic static AdalLoginError = \"AdalLoginError\";\r\n\tpublic static AdalLoginRequest = \"AdalLoginRequest\";\r\n\tpublic static XUserProfileToken =\"X-UserProfileToken\";\r\n\tpublic static FlightingStatusHeader =\"X-Flighting-Call-Status\";\r\n\tpublic static signalRTenant = \"FXP\";\r\n\tpublic static PIIFilterRegex = `[\"Bearer\\\\\\\\sey[^\\\\\"'\\\\\\\\s,]+\"]`\r\n\tpublic static ProfileFlyoutConfig = \"[{\\\"experience\\\":\\\"r360wbExperience\\\",\\\"featureFlag\\\":\\\"VERGE__R360wbflag\\\",\\\"link\\\":\\\"#/myprofile\\\",\\\"displayName\\\":\\\"Manage Profile\\\",\\\"tooltip\\\":\\\"Click to manage profile\\\",\\\"isEnabled\\\":false,\\\"target\\\":\\\"_self\\\",\\\"popoutIcon\\\":false},{\\\"experience\\\":\\\"basicProfileExperience\\\",\\\"featureFlag\\\":\\\"VERGE__R360wbflag\\\",\\\"link\\\":\\\"#/profile/{userAlias}/basic\\\",\\\"displayName\\\":\\\"View Full Profile\\\",\\\"tooltip\\\":\\\"Click to view profile\\\",\\\"isEnabled\\\":false,\\\"target\\\":\\\"_self\\\",\\\"popoutIcon\\\":false}]\";\r\n}\r\n\r\nexport class FxpConstants {\r\n\tpublic static messageType = {\r\n\t\terror: \"error\",\r\n\t\twarning: \"warning\",\r\n\t\tinfo: \"info\",\r\n\t\tsuccess: \"success\",\r\n\t\treload: \"reload\"\r\n\t};\r\n\r\n\tpublic static CONST = {\r\n\t\tfxpUserClaimsSession: \"fxpUserClaims\",\r\n\t\tString: \"string\" \r\n\t};\r\n\r\n\tpublic static StateEvents = {\r\n\t\tOnStart: 1,\r\n\t\tonSuccess: 2,\r\n\t\tonError: 3,\r\n\t\tonInvalid: 4\r\n\t}\r\n\r\n\tpublic static metricConstants = {\r\n\t\tGetBasicProfileSvcName: \"Get Basic Profile Service\",\r\n\t\tGetUserClaimsSvcName: \"Get User Claims Service\",\r\n\t\tFXPApplicationLaunchMetric: \"FXP Application Launch Metric\",\r\n\t\tFXPApplicationLaunchTimeMetric: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FXPApplicationLaunchMetric`,\r\n\t\tUserClaimsResponseTime: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.UserClaimsResponseTime`,\r\n\t\tUserClaimsResponseTimeError: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.UserClaimsResponseTimeError`,\r\n\t\tStatus: \"Status\",\r\n\t\tCurrentTime: \"CurrentTime\",\r\n\t\tStatusText: \"StatusText\",\r\n\t\tStartTime: \"StartTime\",\r\n\t\tEndTime: \"EndTime\",\r\n\t\tServiceName: \"ServiceName\",\r\n\t\tServiceURL: \"ServiceURL\",\r\n\t\tUserAgent: \"UserAgent\",\r\n\t\tUserProfileService: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.UserProfileService`,\r\n\t\tFxpAppLaunch: \"Fxp.AppLaunch\",\r\n\t\tSessionId: \"SessionId\",\r\n\t\tUserUPN: \"UserUPN\",\r\n\t\tUserBusinessRole: \"UserBusinessRole\",\r\n\t\tGeography: \"Geography\",\r\n\t\tBrowserAgent: \"BrowserAgent\",\r\n\t\tSearchProfileServiceTime: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SearchProfileServiceResponseTime`,\r\n\t\tSearchProfileServiceErrorTime: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SearchProfileServiceResponseTime-Error`,\r\n\t\tAdminPersonalizationUserNavLinksCount: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.AdminPersonalizationUserNavLinksCount`,\r\n\t\tFxpLoadDuration: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpLoadDuration`,\r\n\t\tsearchProfileSvcName: \"Search Profile Service\",\r\n\t\tTimeStamp: \"TimeStamp\",\r\n\t\tL0BusinessProcessName: \"L0BusinessProcessName\",\r\n\t\tL0Name: \"L0Name\",\r\n\t\tL0Name_L1Name: \"L0Name_L1Name\",\r\n\t\tUserRoleGroup: \"UserRoleGroup\",\r\n\t\tLeftNavigationClickCountbyRoleGroup: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.LeftNavigationClickCountbyRoleGroup`,\r\n\t\tLeftNavigationClickCountbyRole: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.LeftNavigationClickCountbyRole`,\r\n\t\tRequestedUserAlias: \"RequestedUserAlias\",\r\n\t\tRequestedUserRoleGroupId: \"RequestedUserRoleGroupId\",\r\n\t\tScreenRoute: \"ScreenRoute\",\r\n\t\tFeedbackType: \"FeedbackType\",\r\n\t\tAction: \"Action\",\r\n\t\tUserFeedback: \"UserFeedback\",\r\n\t\tUserFeedbackErrorMessage: \"UserFeedbackErrorMessage\",\r\n\t\tOBOUserRoleGroupName: \"OBOUserRoleGroupName\",\r\n\t\tOBOUserBusinessRole: \"OBOUserBusinessRole\",\r\n\t\tOBOUserUPN: \"OBOUserUPN\",\r\n\t\tBreadcrumbString: \"BreadcrumbString\",\r\n\t\tBrowserPageTitle: \"BrowserPageTitle\",\r\n\t\tLoggedinUserName: \"UserName\",\r\n\t\tOBOUserName: \"OBOUserName\",\r\n\t\tOperatingSystem: \"OperatingSystem\",\r\n\t\tBrowserType: \"BrowserType\",\r\n\t\tBrowserVersion: \"BrowserVersion\",\r\n\t\tDeviceType: \"DeviceType\",\r\n\t\tTotalDuration: \"TotalDuration\",\r\n\t\tUIRenderDuration: \"UIRenderDuration\",\r\n\t\tLeftNavPinStatus: \"LeftNavPinStatus\",\r\n\t\tGetSettingsAPIResponseDuration: \"GetSettingsAPIResponseDuration\",\r\n\t\tSaveSettingsAPIResponseDuration: \"SaveSettingsAPIResponseDuration\",\r\n\t\tModifiedRoleGroupName: \"ModifiedRoleGroupName\",\r\n\t\tModifiedRoleGroupID: \"ModifiedRoleGroupID\",\r\n\t\tModifiedBusinessRoleName: \"ModifiedBusinessRoleName\",\r\n\t\tModifiedBusinessRoleID: \"ModifiedBusinessRoleID\",\r\n\t\tOBOUserAlias: \"OBOUserAlias\",\r\n\t\tLeftNavLinksValueBeforeModification: \"LeftNavLinksValueBeforeModification\",\r\n\t\tLeftNavLinksValueAfterModification: \"LeftNavLinksValueAfterModification\",\r\n\t\tErrorUrl: \"ErrorUrl\",\r\n\t\tGlobalErrorDetail: \"ErrorDetails\",\r\n\t\tFooterLinkUrl: \"FooterLinkUrl\",\r\n\t\tFooterLinkName: \"FooterLinkName\",\r\n\t\tHeaderClickNavigatedStateName: \"NavigatedStateName\",\r\n\t\tHeaderClickNavigatedStateTemplateURL: \"NavigatedStateTemplateURL\",\r\n\t\tMiniProfileIconClick: \"MiniProfileIconClick\",\r\n\t\tProfileLinkClick: \"ProfileLinkClick\",\r\n\t\tChatIconClick: \"ChatIconClick\",\r\n\t\tMailIconClick: \"MailIconClick\",\r\n\t\tHelpLinkParent: \"HelpLinkParent\",\r\n\t\tHelpLinkChild: \"HelpLinkChild\",\r\n\t\tHelpIconClicked: \"HelpIconClicked\",\r\n\t\tHelpView: \"HelpView\",\r\n\t\tErrorText: \"ErrorText\",\r\n\t\tUserPorfileServiceEndPoint:\"User Porfile Service EndPoint\",\r\n\t\tIsLoginRequired: \"IsLoginRequired\",\r\n\t\tError: \"Error\",\r\n\t\tIsCSABlockedUser: \"IsCSABlockedUser\",\r\n\t\tModuleBootstrapping: `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.ModuleBootstrapping`\r\n\t};\r\n\r\n\tpublic static OBOConstants =\r\n\t\t{\r\n\t\t\tOnBehalfOfUserName: \"OnBehalfOfUserName\",\r\n\t\t\tOnBehalfOfUserAlias: \"OnBehalfOfUserAlias\",\r\n\t\t\tOnBehalfOfUserUpn: \"OnBehalfOfUserUpn\",\r\n\t\t\tActonBehalfMode: \"ActonBehalfMode\",\r\n\t\t\tOnBehalfOfUserBusinessRoleId: \"OnBehalfOfUserBusinessRoleId\",\r\n\t\t\tOnBehalfOfUserBusinessRole: \"OnBehalfOfUserBusinessRole\",\r\n\t\t\tOnBehalfOfUserRoleGroup: \"OnBehalfOfUserRoleGroup\",\r\n\t\t\tAdminActOnBehaflOfDuratoin: \"AdminActOnBehaflOfDuratoin\",\r\n\t\t\tActonBehalfofAdminStartTime: \"ActonBehalfofAdminStartTime\",\r\n\t\t\tActonBehalfofAdminEndTime: \"ActonBehalfofAdminEndTime\"\r\n\t\t};\r\n\tpublic static ActionTypes =\r\n\t\t{\r\n\t\t\tAdd: \"AddedItems\",\r\n\t\t\tSave: \"Save\",\r\n\t\t\tSubmit: \"Submit\",\r\n\t\t\tRemove: \"RemovedItems\",\r\n\t\t\tCancel: \"Cancel\",\r\n\t\t\tClick: \"Click\"\r\n\t\t};\r\n\tpublic static keyCodes =\r\n\t\t{\r\n\t\t\tescapeKey: 27,\r\n\t\t\tarrowRightKey: 39,\r\n\t\t\tarrowLeftKey: 37,\r\n\t\t\tarrowDownKey: 40,\r\n\t\t\tarrowUpKey: 38,\r\n\t\t\tenterKey: 13,\r\n\t\t\ttabKey: 9,\r\n\t\t\tspaceBar: 32\r\n\t\t};\r\n\tpublic static applicableDevice = {\r\n\t\tdesktop: \"Desktop\",\r\n\t\tmobile: \"Mobile\",\r\n\t\tall: \"All\"\r\n\t};\r\n\tpublic static BreadcrumbEventType = {\r\n\t\tBreadcrumbLoad: \"BreadcrumbLoad\",\r\n\t\tBreadcrumbClick: \"BreadcrumbClick\"\r\n\t};\r\n\tpublic static askOps = {\r\n\t\tcreateLink: \"createAskOpsRequest\",\r\n\t\tviewLink: \"https://microsoft.service-now.com/it/my_items.do?view=open_items\"\r\n\t};\r\n}\r\n\r\nexport class PerfMarkers {\r\n\tpublic static FxpLoad = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpLoad`;\r\n\tpublic static GetUserClaims = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetUserClaims`;\r\n\tpublic static GetUserThumbnail = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetUserThumbnail`;\r\n\tpublic static GetBasicProfileWithAdal = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetBasicProfileWithAdal`;\r\n\tpublic static AdalTimeGetBasicProfile = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.AdalTimeGetBasicProfile`;\r\n\tpublic static DashboardLoad = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.DashboardLoad`;\r\n\tpublic static LoadRoutes = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.LoadRoutes`;\r\n\tpublic static PreDashboardLoad = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.PreDashboardLoad`;\r\n\tpublic static SavePersonalizedNavItems = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SavePersonalizedNavItems`;\r\n\tpublic static SaveRoleGroupPersonalizedNavItems = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SaveRoleGroupPersonalizedNavItems`;\r\n\tpublic static GetPersonalizedNavItems = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetPersonalizedNavItems`;\r\n\tpublic static GetMasterLeftNavItems = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetMasterLeftNavItems`;\r\n\tpublic static SendUserFeedback = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SendUserFeedback`;\r\n\tpublic static GetRoleGroupDetails = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetRoleGroupDetails`;\r\n\r\n\tpublic static GetLeftNavData = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetLeftNavData`;\r\n\tpublic static GetAdminDataFromServer = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetAdminDataFromServer` ;\r\n\tpublic static GetTenantClaims = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GetTenantClaims`;\r\n}\r\n\r\nexport class RoleGroupInfo {\r\n\tpublic static RoleGroupId = \"RoleGroupId\";\r\n\tpublic static RoleGroupName = \"RoleGroupName\";\r\n}\r\n\r\nexport class TenantInfo {\r\n\tpublic static TenantKey = \"TenantKey\";\r\n\tpublic static TenantName = \"TenantName\";\r\n}","import { IPouchDbService } from \"../interfaces/ipouchdbservice\";\r\nimport { PouchDbConnection } from \"./PouchDbConnection\";\r\nimport { IPouchDBProvider } from \"../interfaces/IPouchDBProvider\";\r\nimport { PouchDbService } from \"./PouchDbService\";\r\n\r\n\r\n/**\r\n* A service which provides PouchDb Connection\r\n* @class Fxp.Common.PouchDBProvider\r\n* @classdesc A service which provides PouchDb Connection\r\n* @example Example to create an instance of Fxp PouchDBProvider \r\n* //Initializing Fxp Message\r\n* angular.module('FxPApp').service('FxpContextService', ['PouchDBProvider', FxpContext]);\r\n* function FxpContext(PouchDBProvider){ PouchDBProvider.getDBConnection(Fxp.Common.Constants.ApplicationConstants.GlobalContextDBName)}\r\n*/\r\nexport class PouchDBProvider implements IPouchDBProvider {\r\n\r\n\tconstructor() { }\r\n\r\n\t/**\r\n * Saves the current value in PouchDB using specified key and returns a Javascript Promise\r\n * @method Fxp.Context.FxpContext#saveContext\r\n * @param {string} applicationName The name of the DB for which connection object has to be fetched \r\n * @example Example to use getDBConnection\r\n * PouchDBProvider.getDBConnection(Fxp.Common.Constants.ApplicationConstants.GlobalContextDBName)\r\n */\r\n\tgetDBConnection(applicationName: string): IPouchDbService {\r\n\t\tvar DbConnection = new PouchDbConnection();\r\n\t\tDbConnection.createDatabase(applicationName);\r\n\t\treturn new PouchDbService(applicationName, DbConnection);\r\n\t}\r\n}","import { IPouchDbConnection } from \"../interfaces/IPouchDbConnection\";\r\n\r\ndeclare var PouchDB: any;\r\n\r\nexport class PouchDbConnection implements IPouchDbConnection {\r\n\r\n\tpublic destroy(localDatabaseName: string) {\r\n\t\tvar database = new PouchDB(localDatabaseName);\r\n\t\tdatabase.destroy();\r\n\t};\r\n\r\n\tpublic createDatabase(localDatabaseName: string) {\r\n\t\tvar database = new PouchDB(localDatabaseName);\r\n\t};\r\n\r\n\tpublic getDatabase(localDatabaseName: string): any {\r\n\t\tvar database = new PouchDB(localDatabaseName);\r\n\t\treturn database;\r\n\t};\r\n\r\n\r\n}","import { IPouchDbService } from \"../interfaces/ipouchdbservice\";\r\nimport { IPouchDbConnection } from \"../interfaces/IPouchDbConnection\";\r\n\r\nexport class PouchDbService implements IPouchDbService {\r\n\tprivate _database: any;\r\n\tprivate _localDbName: string;\r\n\tprivate _docId: string = \"\";\r\n\r\n\tconstructor(localDatabaseName: string, pouchDbConnection: IPouchDbConnection) {\r\n\t\tthis._localDbName = localDatabaseName;\r\n\t\tthis._database = pouchDbConnection.getDatabase(localDatabaseName);\r\n\t}\r\n\r\n\tpublic save(jsonDocument: string): angular.IPromise {\r\n\t\tvar jsonDoc = JSON.parse(jsonDocument);\r\n\t\treturn this._database.post(jsonDoc);\r\n\t};\r\n\r\n\tpublic delete(documentId: string, documentRevision: string) {\r\n\t\treturn this._database.remove(documentId, documentRevision);\r\n\t};\r\n\r\n\tpublic saveUpdateDocument(jsonDocument: string, documentId: string): angular.IPromise {\r\n\t\tvar jsonDoc = JSON.parse(jsonDocument);\r\n\t\treturn this._database.put(jsonDoc, documentId);\r\n\t};\r\n\r\n\tpublic getAllDocuments(options: any = {}): angular.IPromise {\r\n\t\treturn this._database.allDocs(options);\r\n\t};\r\n\r\n\tpublic get(documentId: string): angular.IPromise {\r\n\t\treturn this._database.get(documentId);\r\n\t};\r\n}","export enum SettingsType {\r\n\tUser,\r\n\tUserGroup,\r\n\tApp\r\n}","\r\nexport class HomeLocation {\r\n\tHomeCountry: string;\r\n\tHomeCountryName: string;\r\n\tHomeState: string;\r\n\tHomeCity: string;\r\n\tHomeLocLongitude: string;\r\n\tHomeLocLatitude: string;\r\n}\r\n\r\nexport class WorkLocation {\r\n\tWorkCountryCode: string;\r\n\tWorkCountry: string;\r\n\tWorkState: string;\r\n\tWorkCity: string;\r\n\tWorkLocLatitude: string;\r\n\tWorkLocLogitude: string;\r\n}\r\n\r\nexport class UserInfo {\r\n\tprivate firstName: string;\r\n\tprivate lastName: string;\r\n\tprivate middleName: string;\r\n\tprivate fullName: string;\r\n\tprivate displayName: string;\r\n\tprivate businessDomain: string;\r\n\tprivate reportsTo: string;\r\n\tprivate reportsToDisplayName: string;\r\n\tprivate businessRole: string;\r\n\tprivate addressBookTitleDesc: string;\r\n\tprivate standardTitle: string;\r\n\tprivate email: string;\r\n\tprivate resourceImage: string;\r\n\tprivate businessRoleId: number;\r\n\tprivate reportsToFullName: string;\r\n\tprivate alias: string;\r\n\tprivate preferredFirstName: string;\r\n\tprivate seniority: string;\r\n\tprivate businessRoleDisplayName: string;\r\n\tprivate roleGroupId: number;\r\n\tprivate roleGroupName: string;\r\n\tprivate isDefaultProfile: boolean;\r\n\tprivate domain: string;\r\n\tprivate personnelNumber: number;\r\n\tprivate primaryTool: string;\r\n\tprivate costCenterCode: string;\r\n\tprivate hiringDate: any;\r\n\tprivate terminationDate: any;\r\n\tprivate serviceJobTitle: string;\r\n\tprivate resourceType: string;\r\n\tprivate alignmentType: string;\r\n\tprivate companyCode: number;\r\n\tprivate subAreaCode: number;\r\n\tprivate countryCode: any;\r\n\tprivate homeLocationNotFoundInd: boolean;\r\n\tprivate timeZoneId: number;\r\n\tprivate standardTimeZone: string;\r\n\tprivate resourceStatus: string;\r\n\tprivate resourceCategory: string;\r\n\tprivate resumeUrl: any;\r\n\tprivate functionHierarchyCode: string;\r\n\tprivate aadObjectId: string;\r\n\r\n\tconstructor() {\r\n\t}\r\n\tget AadObjectId(): string {\r\n\t\treturn this.aadObjectId;\r\n\t}\r\n\tset AadObjectId(value: string) {\r\n\t\tthis.aadObjectId = value;\r\n\t}\r\n\tget Alias(): string {\r\n\t\treturn this.alias;\r\n\t}\r\n\tset Alias(value: string) {\r\n\t\tthis.alias = value;\r\n\t}\r\n\tget FirstName(): string {\r\n\t\treturn this.firstName;\r\n\t}\r\n\tset FirstName(value: string) {\r\n\t\tthis.firstName = value;\r\n\t}\r\n\tget LastName(): string {\r\n\t\treturn this.lastName;\r\n\t}\r\n\tset LastName(value: string) {\r\n\t\tthis.lastName = value;\r\n\t}\r\n\tget MiddleName(): string {\r\n\t\treturn this.middleName;\r\n\t}\r\n\tset MiddleName(value: string) {\r\n\t\tthis.middleName = value;\r\n\t}\r\n\tget FullName(): string {\r\n\t\treturn this.fullName;\r\n\t}\r\n\tset FullName(value: string) {\r\n\t\tthis.fullName = value;\r\n\t}\r\n\tget DisplayName(): string {\r\n\t\treturn this.displayName;\r\n\t}\r\n\tset DisplayName(value: string) {\r\n\t\tthis.displayName = value;\r\n\t}\r\n\tget BusinessDomain(): string {\r\n\t\treturn this.businessDomain;\r\n\t}\r\n\tset BusinessDomain(value: string) {\r\n\t\tthis.businessDomain = value;\r\n\t}\r\n\tget ReportsTo(): string {\r\n\t\treturn this.reportsTo;\r\n\t}\r\n\tset ReportsTo(value: string) {\r\n\t\tthis.reportsTo = value;\r\n\t}\r\n\tget ReportsToDisplayName(): string {\r\n\t\treturn this.reportsToDisplayName;\r\n\t}\r\n\tset ReportsToDisplayName(value: string) {\r\n\t\tthis.reportsToDisplayName = value;\r\n\t}\r\n\tget BusinessRoleId(): number {\r\n\t\treturn this.businessRoleId;\r\n\t}\r\n\tset BusinessRoleId(value: number) {\r\n\t\tthis.businessRoleId = value;\r\n\t}\r\n\tget Seniority(): string {\r\n\t\treturn this.seniority;\r\n\t}\r\n\tset Seniority(value: string) {\r\n\t\tthis.seniority = value;\r\n\t}\r\n\tget BusinessRole(): string {\r\n\t\treturn this.businessRole;\r\n\t}\r\n\tset BusinessRole(value: string) {\r\n\t\tthis.businessRole = value;\r\n\t}\r\n\tget StandardTitle(): string {\r\n\t\treturn this.standardTitle;\r\n\t}\r\n\tset StandardTitle(value: string) {\r\n\t\tthis.standardTitle = value;\r\n\t}\r\n\tget AddressBookTitleDesc(): string {\r\n\t\treturn this.addressBookTitleDesc;\r\n\t}\r\n\tset AddressBookTitleDesc(value:string) {\r\n\t\tthis.addressBookTitleDesc = value;\r\n\t}\r\n\tget Email(): string {\r\n\t\treturn this.email;\r\n\t}\r\n\tset Email(value: string) {\r\n\t\tthis.email = value;\r\n\t}\r\n\tget ResourceImage(): string {\r\n\t\treturn this.resourceImage;\r\n\t}\r\n\tset ResourceImage(resourceImage: string) {\r\n\t\tthis.resourceImage = resourceImage;\r\n\t}\r\n\tget ReportsToFullName(): string {\r\n\t\treturn this.reportsToFullName;\r\n\t}\r\n\tset ReportsToFullName(reportsToFullName: string) {\r\n\t\tthis.reportsToFullName = reportsToFullName;\r\n\t}\r\n\tget PreferredFirstName(): string {\r\n\t\treturn this.preferredFirstName;\r\n\t}\r\n\tset PreferredFirstName(value: string) {\r\n\t\tthis.preferredFirstName = value;\r\n\t}\r\n\tget BusinessRoleDisplayName(): string {\r\n\t\treturn this.businessRoleDisplayName;\r\n\t}\r\n\tset BusinessRoleDisplayName(value: string) {\r\n\t\tthis.businessRoleDisplayName = value;\r\n\t}\r\n\tget RoleGroupId(): number {\r\n\t\treturn this.roleGroupId;\r\n\t}\r\n\tset RoleGroupId(value: number) {\r\n\t\tthis.roleGroupId = value;\r\n\t}\r\n\tget RoleGroupName(): string {\r\n\t\treturn this.roleGroupName;\r\n\t}\r\n\tset RoleGroupName(value: string) {\r\n\t\tthis.roleGroupName = value;\r\n\t}\r\n\tget IsDefaultProfile(): boolean {\r\n\t\treturn this.isDefaultProfile;\r\n\t}\r\n\tset IsDefaultProfile(value: boolean) {\r\n\t\tthis.isDefaultProfile = value;\r\n\t}\r\n\tget Domain(): string {\r\n\t\treturn this.domain;\r\n\t}\r\n\tset Domain(value: string) {\r\n\t\tthis.domain = value;\r\n\t}\r\n\tget PersonnelNumber(): number {\r\n\t\treturn this.personnelNumber;\r\n\t}\r\n\tset PersonnelNumber(value: number) {\r\n\t\tthis.personnelNumber = value;\r\n\t}\r\n\tget PrimaryTool(): string {\r\n\t\treturn this.primaryTool;\r\n\t}\r\n\tset PrimaryTool(value: string) {\r\n\t\tthis.primaryTool = value;\r\n\t}\r\n\tget CostCenterCode(): string {\r\n\t\treturn this.costCenterCode;\r\n\t}\r\n\tset CostCenterCode(value: string) {\r\n\t\tthis.costCenterCode = value;\r\n\t}\r\n\tget HiringDate(): any {\r\n\t\treturn this.hiringDate;\r\n\t}\r\n\tset HiringDate(value: any) {\r\n\t\tthis.hiringDate = value;\r\n\t}\r\n\tget TerminationDate(): any {\r\n\t\treturn this.terminationDate;\r\n\t}\r\n\tset TerminationDate(value: any) {\r\n\t\tthis.terminationDate = value;\r\n\t}\r\n\tget ServiceJobTitle(): string {\r\n\t\treturn this.serviceJobTitle;\r\n\t}\r\n\tset ServiceJobTitle(value: string) {\r\n\t\tthis.serviceJobTitle = value;\r\n\t}\r\n\tget ResourceType(): string {\r\n\t\treturn this.resourceType;\r\n\t}\r\n\tset ResourceType(value: string) {\r\n\t\tthis.resourceType = value;\r\n\t}\r\n\tget AlignmentType(): string {\r\n\t\treturn this.alignmentType;\r\n\t}\r\n\tset AlignmentType(value: string) {\r\n\t\tthis.alignmentType = value;\r\n\t}\r\n\tget CompanyCode(): number {\r\n\t\treturn this.companyCode;\r\n\t}\r\n\tset CompanyCode(value: number) {\r\n\t\tthis.companyCode = value;\r\n\t}\r\n\tget SubAreaCode(): number {\r\n\t\treturn this.subAreaCode;\r\n\t}\r\n\tset SubAreaCode(value: number) {\r\n\t\tthis.subAreaCode = value;\r\n\t}\r\n\tget CountryCode(): any {\r\n\t\treturn this.countryCode;\r\n\t}\r\n\tset CountryCode(value: any) {\r\n\t\tthis.countryCode = value;\r\n\t}\r\n\tget HomeLocationNotFoundInd(): boolean {\r\n\t\treturn this.homeLocationNotFoundInd;\r\n\t}\r\n\tset HomeLocationNotFoundInd(value: boolean) {\r\n\t\tthis.homeLocationNotFoundInd = value;\r\n\t}\r\n\tget TimeZoneId(): number {\r\n\t\treturn this.timeZoneId;\r\n\t}\r\n\tset TimeZoneId(value: number) {\r\n\t\tthis.timeZoneId = value;\r\n\t}\r\n\tget StandardTimeZone(): string {\r\n\t\treturn this.standardTimeZone;\r\n\t}\r\n\tset StandardTimeZone(value: string) {\r\n\t\tthis.standardTimeZone = value;\r\n\t}\r\n\tget ResourceStatus(): string {\r\n\t\treturn this.resourceStatus;\r\n\t}\r\n\tset ResourceStatus(value: string) {\r\n\t\tthis.resourceStatus = value;\r\n\t}\r\n\tget ResourceCategory(): string {\r\n\t\treturn this.resourceCategory;\r\n\t}\r\n\tset ResourceCategory(value: string) {\r\n\t\tthis.resourceCategory = value;\r\n\t}\r\n\tget ResumeUrl(): any {\r\n\t\treturn this.resumeUrl;\r\n\t}\r\n\tset ResumeUrl(value: any) {\r\n\t\tthis.resumeUrl = value;\r\n\t}\r\n\tget FunctionHierarchyCode(): string {\r\n\t\treturn this.functionHierarchyCode;\r\n\t}\r\n\tset FunctionHierarchyCode(value: string) {\r\n\t\tthis.functionHierarchyCode = value;\r\n\t}\r\n\tHomeLocation: HomeLocation;\r\n\tWorkLocation: WorkLocation;\r\n\tWeekdays: string[];\r\n\tTenantName: string;\r\n\tMappedTenantName: string;\r\n}","export enum ComponentFramework {\r\n React = \"React\",\r\n Angular = \"Angular\"\r\n}","export enum IOCVSource {\r\n Client = \"Client\",\r\n }\r\n \r\n export enum IOCVFeedbackType {\r\n Smile = \"Smile\",\r\n Frown = \"Frown\",\r\n Idea = \"Idea\",\r\n Survey = \"Survey\",\r\n Bug = \"Bug\",\r\n }\r\n \r\n export enum IOCVManifestType {\r\n Sas = \"Sas\",\r\n Nps = \"Nps\",\r\n Nlqs = \"Nlqs\",\r\n Psat = \"Psat\",\r\n Bps = \"Bps\",\r\n Fps = \"Fps\",\r\n }","import { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { LogPropertyBag } from \"../telemetry/LogPropertyBag\";\r\n\r\nexport class ErrorCodes {\r\n public static readonly ModuleBoostrapFailure = '3012'; \r\n public static readonly ModuleBoostrapFailureRequireJS = '3013';\r\n public static readonly GlobalExceptionHandler = '3301';\r\n public static readonly GlobalExceptionHandler_AngularJs = '3300';\r\n public static readonly OnMsalLoginFailure = '3303';\r\n public static readonly OnMsalTokenFailure = '3305';\r\n public static readonly OnTelemetryContextError = '3306';\r\n public static readonly OnSettingsServiceError = '3307';\r\n\tpublic static readonly OnGetAdminTilesFailure = '2702';\r\n public static readonly OnGetAdminDataFromServerFailure = '2701';\r\n public static readonly PowerBI_Invalid_Configuration = '50003';\r\n public static readonly PowerBI_OnError = '50001'; \r\n public static readonly PowerBI_Token_Failure = '50002';\r\n public static readonly GetLeftNavData_Failure = '1801';\r\n public static readonly SaveLeftNavPinSetting_Error = '3502';\r\n public static readonly PlannedDownTime_UpdateFlash_Failure = '2931'; \r\n public static readonly PlannedDownTime_UpdateSystemAccouncement_Failure = '2932'; \r\n public static readonly SystemMessage_Read_Collection_Rejection = '2916';\r\n public static readonly SystemMessage_Fetch_Business_Workflow = '2917';\r\n public static readonly SystemMessage_Save_Failure = '2918';\r\n public static readonly SystemMessage_Update_Failure = '2918';\r\n public static readonly SystemMessage_Delete_Failure = '2920';\r\n public static readonly AcquireTokenFailure_UnKnown_Reason = '3304';\r\n public static readonly OBO_User_Already_Active = '2907';\r\n public static readonly Get_OBO_User_Configuration_Failure = '2906'; \r\n public static readonly OBO_User_Search_Failure = '2602';\r\n public static readonly State_Not_Found = '2908';\r\n public static readonly State_Change_Failure = '2909';\r\n public static readonly Msal_ResourceTokenAcuqisition_Failure = '3302';\r\n public static readonly SkypeBotInit_Failure = '2911';\r\n public static readonly API_Threshold_Crossed = '2910';\r\n public static readonly InitializeFeedback_Failure = '3400';\r\n public static readonly Error_SubmittingFeedback = '3401';\r\n public static readonly Error_LoadingFeedback = '3402';\r\n public static readonly GetRoleGroupDetails_Failure = '3452';\r\n public static readonly PublishNotifications_Failure = '3451';\r\n public static readonly PublishNotificationsRolesRoleGroup_Failure = '3453';\r\n public static readonly GetRequestTypeData_Failure = '3501';\r\n public static readonly CloseActOnBehalofUser_Failure = '3502';\r\n public static readonly GetContextualHelpArticles_Failure = '4001'; \r\n public static readonly GetArticleData_Failure = '4002';\r\n public static readonly SaveHelpFeedback_Failure = '4003';\r\n public static readonly SearchSuggestions_Failure = '4004';\r\n public static readonly SaveViewCount_Failure = '4005';\r\n public static readonly ShowErrorMsgNavigateToUserLookUp = '4006'; \r\n public static readonly SavePersonalizedNavItems = '4007';\r\n public static readonly GetNotifications_Failure = '2940';\r\n public static readonly GetUnreadNotificationCount_Failure = '2941';\r\n public static readonly MarkAllNotificationsAsRead_Failure = '2943';\r\n public static readonly DismissAllNotifications_Failure = '2942';\r\n public static readonly ReadNotification_Failure = '2943';\r\n public static readonly DeleteNotification_Failure = '2942';\r\n public static readonly SaveNotificationDNDSetting = '3503';\r\n public static readonly ErrorLoadingDashboard = '2913'; \r\n public static readonly ErrorFetchingTokenForPowerBI = '2914';\r\n public static readonly ErrorLoadingPowerBiDashboard = '2915';\r\n public static readonly SubmitRoleGroupNavPresonalization_Failure = '2921';\r\n public static readonly GetRoleGroupDetailsPersonalization_Failure = '2921';\r\n public static readonly GetGlobalNavMasterList_Failure = '2917';\r\n public static readonly GetRoleGroupNavList_Failure = '2916';\r\n public static readonly ReadToastNotification_Failure = '2943';\r\n public static readonly MarkNotificationAsRead_Failure = '2944';\r\n public static readonly UserLookUpSearchUser_Failure = '2945';\r\n public static readonly SetSelectedUser_Failure = '2946';\r\n public static readonly NavigateToPersonalizationView_Failure = '2947';\r\n public static readonly ErrorOnLeftNavClick = '2948';\r\n public static readonly HandleProfileServiceResponse = '2949';\r\n public static readonly AdalOnError = '0001';\r\n public static readonly AdalOnErrorWithErrorCode = '0002';\r\n public static readonly DefaultStateNotConfigured = '2905';\r\n public static readonly ErrorRegisteringRoute = '2904';\r\n public static readonly ErrorInLazyLoading = '2906';\r\n public static readonly ErrorUpdatingStateObject = '2907';\r\n public static readonly RouteResolveException = '2908';\r\n public static readonly HttpInterceptorResponseError = '2500';\r\n public static readonly DashboardService_GetLeftNavDataFailure = '2603';\r\n public static readonly FxPConfigurationFailure = '2604'\r\n public static readonly StartUpFlagRetrieveError = '2912';\r\n public static readonly DataService_TokenFailure = '5001';\r\n public static readonly FeedbackService_Error = '3401';\r\n public static readonly CheckToastNotifications_Failure = '2940';\r\n public static readonly SharedComponentNotRegistered = '2941';\r\n public static readonly LazyLoadingFailedForSharedComponent = '2942';\r\n public static readonly PersonalizationService_GetMasterLeftNav_Failure = '2605'; \r\n public static readonly PersonalizationService_GetPersonalizedLeftNav_Failure = '2606';\r\n public static readonly PersonalizationSerivce_SavePersonalizedNavItems_Failure = '2607';\r\n public static readonly PersonalizationSerivce_GetRoleGroupDetails_Failure = '2608';\r\n public static readonly PersonalizationSerivce_GetRoleGroupDetailsForNotification_Failure = '2609';\r\n public static readonly PersonalizationSerivce_GetRolePersonalizedNavItems_Failure = '2610';\r\n public static readonly PersonalizationSerivce_GetRoleGroupPersonalizedList_Failure = '2611';\r\n public static readonly PersonalizationSerivce_SaveRoleGroupPersonalizedNavItems_Failure = '2612';\r\n public static readonly AuthSerive_UserClaimsEmptyInLocalStorage = \"2804\";\r\n public static readonly AuthSerive_MissingApplicationObjectInClaims = \"2805\";\r\n public static readonly AuthSerive_MissingRolesObjectInClaims = \"2806\";\r\n public static readonly AuthSerive_TenantClaimsEmptyInLocalStorage = \"2801\";\r\n public static readonly AuthSerive_TenantObjectMissingInClaims = \"2802\";\r\n public static readonly AuthSerive_ClaimsMissingInTenantObject = \"2803\";\r\n public static readonly AuthService_TokenAcquisitionInProgress = '2804';\r\n public static readonly AuthService_TokenAcquisitionInProgress_TenantClaims = '2805';\r\n public static readonly AuthService_TenantClaimsObjectMissingInClaims = '2806';\r\n public static readonly AuthService_APICallFailedWithUnknownReason = '2807';\r\n public static readonly AuthService_ErrorNotifyingCachedClaims = '2809';\r\n public static readonly AuthService_UnknownException = '2808';\r\n public static readonly AuthService_GetClaimsFailure = '2810';\r\n public static readonly GetUserThumbnail_TokenNotFound = '2901';\r\n public static readonly GetBasicProfile_TokenNotFound = '2902';\r\n public static readonly GetBasicProfile_BusinessRoleMissing = '2903';\r\n public static readonly GetBasicProfile_RoleGroupMissing = '2904';\r\n public static readonly GetBasicProfile_ProfileNotFound = '2905';\r\n public static readonly BasicProfile_UnknownError = '2906';\r\n public static readonly SearchProfile_TokenMissing = '2908'\r\n public static readonly ProfileServiceFailure = '2909';\r\n public static readonly ProfileService_ErrorNotifyingCachedProfile = '2910';\r\n public static readonly ErrorOnProfileSearch = '2911';\r\n public static readonly ModuleCompilationError = '5000';\r\n public static readonly ErrorInstantiatingComponent = '5001';\r\n public static readonly ErrorLoadingReactComponent = '5002';\r\n public static readonly ErrorUnloadingReactComponent = '5003';\r\n public static readonly Resiliency_ExternalResourceLoadingError = '1800';\r\n public static readonly Resiliency_ModuleLoadingError = '1800';\r\n public static readonly SignalR_ErrorOnDisconnect = '1900';\r\n public static readonly SignalR_ErrorOnMessageSend = '1901';\r\n public static readonly SignalR_ErrorOnJoinGroup = '1902';\r\n public static readonly SignalR_ErrorOnLeaveGroup = '1903';\r\n public static readonly SignalR_ErrorOnConnection = '1904';\r\n public static readonly PartnerAppRegistrationService_ErrorOnAppRegistration = '2001';\r\n public static readonly PartnerAppRegistrationService_ErrorOnSharedComponentRegistration = '2002';\r\n public static readonly ReduxStoreException = '6000';\t\r\n\r\n public static readonly OnStateChangeStartException = '3701'; \r\n\r\n}\r\n","import { IFxpContext } from \"../interfaces/IFxpContext\";\r\nimport { IPouchDbService } from \"../interfaces/ipouchdbservice\";\r\nimport { IPouchDBProvider } from \"../interfaces/IPouchDBProvider\";\r\nimport { ApplicationConstants } from \"../common/ApplicationConstants\";\r\nimport { PouchDBProvider } from \"../common/PouchDBProvider\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\ndeclare var Promise: any;\r\n/**\r\n * @module Fxp.Context\r\n */\r\n\r\n/**\r\n * Represents an FxpContext\r\n * @class Fxp.Context.FxpContext\r\n * @example Example to create an object of FxpContext \r\n * //Initializing FxpContext\r\n * var fxpContext = new Fxp.Context.FxpContext(); \r\n */\r\nexport class FxpContext implements IFxpContext,IFxPService {\r\n\tprivate static _instance: FxpContext;\r\n\tprivate pouchService: IPouchDbService;\r\n\tprivate _iPouchDBProvider: IPouchDBProvider;\r\n\r\n\tconstructor(iPouchDBProvider: IPouchDBProvider) {\r\n\t\tif (FxpContext._instance) {\r\n\t\t\treturn FxpContext._instance;\r\n\t\t}\r\n\t\tthis._iPouchDBProvider = iPouchDBProvider;\r\n\t\tthis.pouchService = this._iPouchDBProvider.getDBConnection(ApplicationConstants.GlobalContextDBName);\r\n\r\n\t\tFxpContext._instance = this;\r\n\t}\r\n\r\n\t//Keeping this function as is for backward Compatibility\r\n\tpublic static GetInstance(): FxpContext {\r\n\t\tif (!FxpContext._instance) {\r\n\t\t\tFxpContext._instance = new FxpContext(new PouchDBProvider());\r\n\t\t}\r\n\r\n\t\treturn FxpContext._instance;\r\n\t}\r\n\r\n\t/**\r\n * Saves the current value in PouchDB using specified key and returns a Javascript Promise\r\n * @method Fxp.Context.FxpContext#saveContext\r\n * @param {string} key A key which will be identifier of the value of the data to be saved in PouchDB \r\n * @param {string} value The value that needs to be saved\r\n * @param {string} applicationName The name of application. It is optional.\r\n * @example Example to use saveContext\r\n * var fxpContext = Fxp.Context.FxpContext.GetInstance()\r\n * fxpContext.saveContext(\"UIConfigDB\",\"UIConfigDBName\");\r\n * fxpContext.saveContext(\"UIConfigDB\",\"UIConfigDBName\", \"ApplicationName\");\r\n */\r\n\r\n\tpublic saveContext(key: string, value: string, applicationName?: string): Promise {\r\n\t\treturn this.saveData(key, value, applicationName);\r\n\t}\r\n\r\n\t/**\r\n\t* Read Data from Context using specified key and application name. If application name is null then it will fetch data from Global context otherwise ApplicationContext. \r\n\t* It returns a Javascript Promise\r\n\t* @method Fxp.Context.FxpContext#readContext\r\n\t* @param {string} key A key which will be identifier of the value of the data that needs to be fetched from PouchDB \r\n\t* @param {string} applicationName The name of application. It is optional parameter.\r\n\t* @example Example to use readContext\r\n\t* var fxpContext = Fxp.Context.FxpContext.GetInstance()\r\n\t* fxpContext.readContext(\"sessionId\", \"FXP\");\r\n\t* fxpContext.readContext(\"sessionId\");\r\n\t*/\r\n\tpublic readContext(key: string, applicationName?: string): Promise {\r\n\t\treturn this.readData(key, applicationName);\r\n\t}\r\n\r\n\t /**\r\n * Read Document Keys from Context using specified application name.\r\n * It returns a Javascript Promise\r\n * @method Fxp.Context.FxpContext#readApplicationKeyIDs\r\n * @param {string} applicationName The name of application. \r\n * @example Example to use readApplicationKeyIDs\r\n * var fxpContext = Fxp.Context.FxpContext.GetInstance()\r\n * fxpContext.readApplicationKeyIDs(\"sessionId\");\r\n */\r\n\tpublic getDocumentKeys(applicationName: string): Promise {\r\n\t\treturn this.getDocumentKeysData( applicationName);\r\n\t}\r\n\t/**\r\n * Delete data from context using specified key and application name. If application name is null then it will delete data from Global context otherwise ApplicationContext. \r\n * It returns a Javascript Promise\r\n * @method Fxp.Context.FxpContext#deleteContext\r\n * @param {string} key A key which will be identifier of the value of the data that needs to be fetched from PouchDB \r\n * @param {string} applicationName The name of application. It is optional parameter.\r\n * @example Example to use deleteContext\r\n * var fxpContext = new Fxp.Context.deleteContext()\r\n * fxpContext.deleteContext(\"sessionId\", \"FXP\");\r\n * fxpContext.deleteContext(\"sessionId\");\r\n */\r\n\tpublic deleteContext(key: string, applicationName?: string): Promise {\r\n\t\ttry {\r\n\t\t\tvar db: IPouchDbService = this.getDBService(applicationName);\r\n\r\n\t\t\treturn new Promise(function (resolve, reject) {\r\n\t\t\t\tdb.get(key).then(function (doc) {\r\n\t\t\t\t\tdb.delete(key, doc._rev).\r\n\t\t\t\t\t\tthen(function (doc) {\r\n\t\t\t\t\t\t\tresolve(doc)\r\n\t\t\t\t\t\t}).catch(function (err) {\r\n\t\t\t\t\t\t\tdb.get(key).then(function (doc) {\r\n\t\t\t\t\t\t\t\tdb.delete(key, doc._rev).then(function () {\r\n\t\t\t\t\t\t\t\t\tresolve(doc)\r\n\t\t\t\t\t\t\t\t}).catch(function (err) {\r\n\t\t\t\t\t\t\t\t\tconsole.log(err);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}).catch(function (err) {\r\n\t\t\t\t\tif (err.name == \"not_found\") {\r\n\t\t\t\t\t\tconsole.log(\"not-found\");\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch (exception) {\r\n\t\t\t//TODO: REVISIT THE scenario where exception occurs\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t* Get FxpBaseUrl from FxpContext. It returns a Javascript Promise.\r\n\t* @method Fxp.Context.FxpContext#getFxpBaseUrl\r\n\t* @example Example to use getFxpBaseUrl\r\n\t* var fxpContext = Fxp.Context.FxpContext.GetInstance()\r\n\t* fxpContext.getFxpBaseUrl();\r\n\t*/\r\n\tpublic getFxpBaseUrl(): Promise {\r\n\t\treturn this.readData(ApplicationConstants.BaseUrl);\r\n\t}\r\n\r\n\t/**\r\n\t* Get SessionId from FxpContext. It returns a Javascript Promise.\r\n\t* @method Fxp.Context.FxpContext#getAssetLibraryUrl\r\n\t* @example Example to use getAssetLibraryUrl\r\n\t* var fxpContext = Fxp.Context.FxpContext.GetInstance()\r\n\t* fxpContext.getAssetLibraryUrl();\r\n\t*/\r\n\tpublic getAssetLibraryUrl(): Promise {\r\n\t\treturn this.readData(ApplicationConstants.AssetsUrl);\r\n\t}\r\n\r\n\t/**\r\n\t* Get SessionId from FxpContext. It returns a Javascript Promise.\r\n\t* @method Fxp.Context.FxpContext#getCurrentSessionId\r\n\t* @example Example to use getCurrentSessionId\r\n\t* var fxpContext = new Fxp.Context.FxpContext()\r\n\t* fxpContext.getCurrentSessionId();\r\n\t*/\r\n\tpublic getCurrentSessionId(): Promise {\r\n\t\treturn this.readData(\"sessionId\");\r\n\t}\r\n\r\n\t/**\r\n * Saves the current value in PouchDB using specified key and returns a Javascript Promise\r\n * @method Fxp.Context.FxpContext#saveData\r\n * @param {string} key A key which will be identifier of the value of the data to be saved in PouchDB \r\n * @param {string} value The value that needs to be saved\r\n * @param {string} applicationName The name of application. It is optional. \r\n */\r\n\tprivate saveData(key: string, value: string, applicationName?: string): Promise {\r\n\r\n\t\tvar saveUpdateDocument = this.saveUpdateDocument;\r\n\r\n\t\ttry {\r\n\t\t\tvar db: IPouchDbService = this.getDBService(applicationName);\r\n\r\n\t\t\treturn new Promise(function (resolve, reject) {\r\n\t\t\t\tdb.get(key).then(function (doc) {\r\n\t\t\t\t\tdoc[key] = value;\r\n\t\t\t\t\tresolve(saveUpdateDocument(db, JSON.stringify(doc), key, value));\r\n\t\t\t\t}).catch(function (err) {\r\n\t\t\t\t\tif (err.name == \"not_found\") {\r\n\t\t\t\t\t\tvar PropBagInternal: any = {};\r\n\t\t\t\t\t\tPropBagInternal[key] = value;\r\n\t\t\t\t\t\tvar JSONData = JSON.stringify(PropBagInternal);\r\n\t\t\t\t\t\tresolve(saveUpdateDocument(db, JSONData, key, value));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch (exception) { }\r\n\t}\r\n\r\n\t/**\r\n\t* Saves Data to Context\r\n\t* It returns a any\r\n\t* @method Fxp.Context.FxpContext#saveUpdateDocument\r\n\t* @param {Fxp.Interfaces.IPouchDbService} db PouchDB Connnection Object\r\n\t* @param {string} document Json Document to be saved in PouchDB. \r\n\t* @param {string} key A key which will be identifier of the value of the data to be saved in PouchDB \r\n\t* @param {string} value The value that needs to be saved\r\n\t*/\r\n\tprivate saveUpdateDocument(db: IPouchDbService, document: string, key: string, value: string): any {\r\n\t\tdb.saveUpdateDocument(document, key).\r\n\t\t\tthen(function (doc) {\r\n\t\t\t\treturn (doc)\r\n\t\t\t}).catch(function (err) {\r\n\t\t\t\tconsole.log(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t* Read Data from Context using specified key and application name. If application name is null then it will fetch data from Global context otherwise ApplicationContext. \r\n\t* It returns a Javascript Promise\r\n\t* @method Fxp.Context.FxpContext#readData\r\n\t* @param {string} key A key which will be identifier of the value of the data that needs to be fetched from PouchDB \r\n\t* @param {string} applicationName The name of application. It is optional parameter. \r\n\t*/\r\n\tprivate readData(key: string, applicationName?: string): Promise {\r\n\t\ttry {\r\n\t\t\tvar db: IPouchDbService = this.getDBService(applicationName);\r\n\t\t\tvar PropBagInternal: any = {};\r\n\t\t\treturn new Promise(function (resolve, reject) {\r\n\t\t\t\tdb.get(key).then(function (doc) {\r\n\t\t\t\t\tPropBagInternal[\"IsError\"] = false;\r\n\t\t\t\t\tPropBagInternal[\"Result\"] = doc[key];\r\n\t\t\t\t\tPropBagInternal[\"Error\"] = null;\r\n\t\t\t\t\tresolve(PropBagInternal);\r\n\t\t\t\t}).catch(function (err) {\r\n\t\t\t\t\tPropBagInternal[\"IsError\"] = true;\r\n\t\t\t\t\tPropBagInternal[\"Result\"] = null;\r\n\t\t\t\t\tPropBagInternal[\"Error\"] = err;\r\n\t\t\t\t\tresolve(PropBagInternal);\r\n\t\t\t\t});\r\n\t\t\t});\t\t\t\r\n\t\t}\r\n\t\tcatch (exception) {\r\n\t\t\tconsole.log(`Error while reading ${key} from context` + exception);\r\n\t\t }\r\n\t}\r\n\r\n\t /**\r\n * Read Keys of documents from Context using specified application name.\r\n * It returns a Javascript Promise\r\n * @method Fxp.Context.FxpContext#readApplicationKeyIDsData\r\n * @param {string} applicationName The name of application for which keys will be returned.\r\n */\r\n\tprivate getDocumentKeysData(applicationName: string): Promise {\r\n\t\ttry {\r\n\t\tvar db: IPouchDbService = this.getDBService(applicationName);\r\n\t\tvar PropBagInternal: any = {};\r\n\t\treturn new Promise(function (resolve, reject) {\r\n\t\t\tdb.getAllDocuments({ include_docs :false})\r\n\t\t\t.then(function (doc) {\r\n\t\t\t\tPropBagInternal[\"IsError\"] = false;\r\n\t\t\t\tPropBagInternal[\"Result\"] = doc.rows.map(row=>row.key);\r\n\t\t\t\tPropBagInternal[\"Error\"] = null;\r\n\t\t\t\tresolve(PropBagInternal);\r\n\t\t\t})\r\n\t\t\t.catch(function (err) {\r\n\t\t\t\tPropBagInternal[\"IsError\"] = true;\r\n\t\t\t\tPropBagInternal[\"Result\"] = null;\r\n\t\t\t\tPropBagInternal[\"Error\"] = err;\r\n\t\t\t\tresolve(PropBagInternal);\r\n\t\t\t});\r\n\t\t});\r\n\t\t} catch (exception) {\r\n\t\tconsole.log(`Error while reading keys from context` + exception);\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t* Get DB Connetion Object\r\n\t* It returns a Fxp.Interfaces.IPouchDbService\r\n\t* @method Fxp.Context.FxpContext#getDBService \r\n\t* @param {string} applicationName The name of application. It is optional parameter. \r\n\t*/\r\n\tprivate getDBService(applicationName?: string): IPouchDbService {\r\n\t\ttry {\r\n\t\t\tvar db: IPouchDbService;\r\n\t\t\tswitch (applicationName) {\r\n\t\t\t\tcase \"\":\r\n\t\t\t\tcase null:\r\n\t\t\t\tcase undefined:\r\n\t\t\t\t\tdb = this.pouchService;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdb = this._iPouchDBProvider.getDBConnection(applicationName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn db;\r\n\t\t}\r\n\t\tcatch (exception) { }\r\n\t}\r\n}","import { FxpFeedbackService } from \"../services/FxpFeedbackService\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { FxpBroadcastedEvents } from \"../services/FxpBroadcastedEvents\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n\r\n/**\r\n * A main factory which acts as an helper for AppController. This is the factory having common functionalities.\r\n * @class Fxp.Factory.FxpUIData\r\n * @classdesc An factory to get and set main header text\r\n * @example \r\n * //How To use this factory\r\n * angular.module('FxPApp').controller('AppController', ['FxpUIData', FxpUIData]);\r\n * function AppController(AnyDependency){ FxpUIData.getHeaderText(); }\r\n */\r\nexport class FxpUIData implements IFxPService{\r\n\tprivate headerText: string;\r\n\tprivate pageTitle: string;\r\n\tprivate $rootScope: angular.IRootScopeService;\r\n\tprivate fxpFeedbackService: FxpFeedbackService;\r\n\tconstructor($rootScope: angular.IRootScopeService, fxpFeedbackService: FxpFeedbackService) {\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.fxpFeedbackService = fxpFeedbackService;\r\n\t\tthis.headerText = \"\";\r\n\t\tthis.pageTitle = \"\";\r\n\t}\r\n\r\n\t/**\r\n\t* @method Fxp.Factory.FxpUIData.getHeaderText()\r\n\t* @example Example to use getHeaderText\r\n\t* FxpUIData.getHeaderText();\r\n\t*/\r\n\tpublic getHeaderText() {\r\n\t\treturn this.headerText;\r\n\t}\r\n\r\n\t/**\r\n\t* A method to set the header text.\r\n\t* @method Fxp.Factory.FxpUIData.setHeaderText(\"Professional Services\")\r\n\t* @param {string} headerText Header Text\r\n\t* @example Example to use setHeaderText\r\n\t* FxpUIData.setHeaderText(\"Professional Services\");\r\n\t*/\r\n\tpublic setHeaderText(headerText: string) {\r\n\t\tthis.headerText = headerText;\r\n\t\tthis.$rootScope.$broadcast(FxpBroadcastedEvents.OnAppHeaderChanged, headerText);\r\n\t}\r\n\r\n\t/**\r\n\t* A method to get the Page Title.\r\n\t* @method Fxp.Factory.FxpUIData.getPageTitle()\r\n\t* @example Example to use getPageTitle\r\n\t* FxpUIData.getPageTitle();\r\n\t*/\r\n\tpublic getPageTitle() {\r\n\t\treturn this.pageTitle;\r\n\t}\r\n\r\n\t/**\r\n\t* A method to set the Page Title.\r\n\t* @method Fxp.Factory.FxpUIData.setPageTitle(\"Professional Services\")\r\n\t* @param {string} pageTitle Page Title\r\n\t* @example Example to use setPageTitle\r\n\t* FxpUIData.setPageTitle(\"Professional Services\");\r\n\t*/\r\n\tpublic setPageTitle(pageTitle: string) {\r\n\t\tthis.pageTitle = pageTitle;\r\n\t\tthis.$rootScope.$broadcast(FxpBroadcastedEvents.OnPageTitleChanged, pageTitle);\r\n\t}\r\n\r\n\t/**\r\n\t* A method to set the Page Title RouteChangeSuccess Event.\r\n\t* @method Fxp.Factory.FxpUIData.setpageTitleFromRoute()\r\n\t* @param {any} toState object from ui router\r\n\t* @example Example to use setpageTitleFromRoute\r\n\t* FxpUIData.setpageTitleFromRoute();\r\n\t*/\r\n\tpublic setPageTitleFromRoute(toState) {\r\n\t\tvar self = this;\r\n\t\tself.fxpFeedbackService.setScreenRoute(toState.name);\r\n\t\tvar pageTitle = toState.data.pageTitle;\r\n\t\tif (CommonUtils.isNullOrEmpty(pageTitle)) {\r\n\t\t\tconsole.error(\"Page title is not set for \" + toState.name + \" state\");\r\n\t\t\tpageTitle = \"\";\r\n\t\t}\r\n\t\tself.fxpFeedbackService.setBrowserTitle(pageTitle);\r\n\t\tself.setPageTitle(pageTitle);\r\n\t}\r\n\r\n\t/**\r\n\t A method to set the AppHeader RouteChangeSuccess Event.\r\n\t* @method Fxp.Factory.FxpUIData.seAppHeaderFromRoute()\r\n\t* @param {any} toState object from ui router\r\n\t* @example Example to use setAppHeaderFromRoute\r\n\t* FxpUIData.setAppHeaderFromRoute();\r\n\t*/\r\n\tpublic setAppHeaderFromRoute(toState) {\r\n\t\tvar self = this;\r\n\t\tvar headerName = toState.data.headerName;\r\n\t\tif (CommonUtils.isNullOrEmpty(headerName)) {\r\n\t\t\tconsole.error(\"Appheader is not set for \" + toState.name + \" state\");\r\n\t\t\theaderName = \"\";\r\n\t\t}\r\n\t\tself.setHeaderText(headerName);\r\n\t}\r\n\r\n\tstatic getUIDataFactoryObj($rootScope, fxpFeedbackService) {\r\n\t\treturn new FxpUIData($rootScope, fxpFeedbackService);\r\n\t}\r\n}","import { ISettingsServiceConfig } from \"../interfaces/ISettingsServiceConfig\";\r\nimport { ISettingsService } from \"../interfaces/ISettingsService\";\r\nimport { ISettingsServiceProvider } from \"../interfaces/ISettingsServiceProvider\";\r\nimport { SettingsType } from \"../common/SettingsType\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { MsalAuthenticationService } from \"../services/MsalAuthenticationService\";\r\n\r\ndeclare var deferred: any;\r\n\r\nexport class SettingsServiceProvider implements ISettingsServiceProvider, ISettingsService, IFxPService {\r\n\tinit() {\r\n\t\t//throw new Error(\"Method not implemented.\");\r\n\t}\r\n\taddState(stateName: any, config: any): void {\r\n\t\t//throw new Error(\"Method not implemented.\");\r\n\t}\r\n\totherwise(input: any): void {\r\n\t\t//throw new Error(\"Method not implemented.\");\r\n\t}\r\n\tprivate settingsServiceConfig: ISettingsServiceConfig = { settingsServiceBaseUrl: \"\" };\r\n\tprivate iReqCount: number;\r\n\tprivate sleepInterval: number;\r\n\tprivate http: angular.IHttpService;\r\n\tprivate msalAuthenticationService: MsalAuthenticationService;\r\n\tprivate timeout: angular.ITimeoutService;\r\n\tprivate q: angular.IQService;\r\n\r\n\tpublic configure(settingsSeerviceConfig: ISettingsServiceConfig) {\r\n\t\tangular.extend(this.settingsServiceConfig, settingsSeerviceConfig);\r\n\t}\r\n\tconstructor() {\r\n\t\tthis.$get.$inject = ['$http', 'MsalAuthenticationService', '$timeout', '$q'];\r\n\t}\r\n\r\n\t$get($http: angular.IHttpService,\r\n\t\tmsalAuthenticationService: MsalAuthenticationService,\r\n\t\t$timeout: angular.ITimeoutService,\r\n\t\t$q: angular.IQService): ISettingsService {\r\n\t\tthis.http = $http;\r\n\t\tthis.msalAuthenticationService = msalAuthenticationService;\r\n\t\tthis.timeout = $timeout;\r\n\t\tthis.q = $q;\r\n\t\tthis.iReqCount = 0;\r\n\t\tthis.sleepInterval = 100;\r\n\t\tvar settingsService: ISettingsService = {\r\n\t\t\tgetSettings: (settingType: SettingsType, settingId: string, settingNames: string[]): angular.IPromise => this.getSettings(settingType, settingId, settingNames),\r\n\t\t\tsaveSettings: (settingType: SettingsType, settingId: string, settingName: string, settingValue: string): angular.IPromise => this.saveSettings(settingType, settingId, settingName, settingValue)\r\n\t\t};\r\n\t\treturn settingsService;\r\n\t}\r\n\r\n\tgetSettings(settingType: SettingsType, settingId: string, settingNames: string[]): angular.IPromise {\r\n\t\tvar pathUrl = this.getPathUrl(settingType, settingId);\r\n\t\tvar url = this.settingsServiceConfig.settingsServiceBaseUrl + pathUrl + '?';\r\n\t\tif (typeof settingNames == 'string') {\r\n\t\t\turl += 'settingNames=' + settingNames;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (settingNames instanceof Array) {\r\n\t\t\t\tsettingNames.forEach((setting: string, index: number) => {\r\n\t\t\t\t\turl += index > 0 ?\r\n\t\t\t\t\t\t'&settingNames=' + setting :\r\n\t\t\t\t\t\t'settingNames=' + setting;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.getSettingsSvc(url);\r\n\t}\r\n\r\n\tsaveSettings(settingType: SettingsType, settingId: string, settingName: string, settingValue: string): angular.IPromise {\r\n\t\tvar pathUrl = this.getPathUrl(settingType, settingId);\r\n\t\tvar url = this.settingsServiceConfig.settingsServiceBaseUrl + pathUrl;\r\n\t\treturn this.saveSettingsSvc(url, { settingName: settingName, settingValue: settingValue });\r\n\t}\r\n\r\n\tprivate getSettingsSvc(url: string): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\treturn deferred.promise;\r\n\t\t\t}\r\n\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getSettingsSvc(url);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn self.http.get(url);\r\n\t\t}\r\n\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\tprivate saveSettingsSvc(url: string, value: any): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\treturn deferred.promise;\r\n\t\t\t}\r\n\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.saveSettingsSvc(url, value);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn self.http.post(url, value, { headers: { 'Content-Type': 'application/json' } });\r\n\t\t}\r\n\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\tprivate getPathUrl(settingType: SettingsType, settingId: string): string {\r\n\t\tvar settingTypeValue = SettingsType[settingType];\r\n\t\tvar pathUrl = '/' + settingTypeValue + '/' + settingId + '/settings';\r\n\t\treturn pathUrl;\r\n\t}\r\n}","import { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { FxpLoggerService } from \"../telemetry/fxpLogger\";\r\nimport { GlobalExceptionHandler } from \"../telemetry/GlobalExceptionHandler\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\n\r\n///*Fxp.Resiliency can be used to method when Angular boot fails*/\r\nexport class Resiliency {\r\n\tprivate static resilientModules: any;\r\n\tprivate static failedModules: any;\r\n\tprivate static unavailablePartnerModules: any;\r\n\tprivate static hasChildren: boolean = false;\r\n\tpublic static statesWithMissingModules: any = [];\r\n\tpublic static get FxpLoggerService(): FxpLoggerService {\r\n\t\treturn FxpLoggerService.getInstance(); \r\n\t}\r\n\tstatic source = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.Resiliency`;\r\n\r\n\tstatic init(){\r\n\t\t\r\n\t}\r\n\r\n\tpublic static get UnavailablePartnerModules() {\r\n\t\treturn this.unavailablePartnerModules;\r\n\t}\r\n\tpublic static set UnavailablePartnerModules(value: any) {\r\n\t\tthis.unavailablePartnerModules = value;\r\n\t}\r\n\t/**\r\n * @method Fxp.Resiliency.externalResourceLoadFailed to log Global Event when js cdn files is mispelled or not available.\r\n * @param {string} scriptName - name of the script file\r\n */\r\n\tstatic externalResourceLoadFailed(scriptName): void {\r\n\t\tvar logMsg = \"Unable to load resource: \" + scriptName;\r\n\t\tlet properties = this.FxpLoggerService.createPropertyBag();\r\n\t\tproperties.addToBag(\"Details\", logMsg);\r\n\t\tthis.FxpLoggerService.logError(`${this.source}.ExternalResourceLoadFailed`, logMsg, ErrorCodes.Resiliency_ExternalResourceLoadingError, \"\", properties, null, null, ErrorSeverityLevel.Medium); \r\n\t\tconsole.error(\"Fxp Resiliency: \", logMsg);\r\n\t}\r\n\r\n\r\n\t/**\r\n * @method Fxp.Resiliency.getResilientModules to fetch modules which are resilient.\r\n * @param {any} modules -list of modules which needs to be injected\r\n */\r\n\tstatic getResilientModules(modules): any {\r\n\t\t// to capture all resilient modules \r\n\t\tthis.statesWithMissingModules = [];\r\n\t\tthis.unavailablePartnerModules = [];\r\n\t\tthis.resilientModules = [];\r\n\t\tmodules.forEach(function (moduleName, i) {\r\n\t\t\tthis.failedModules = [];\r\n\t\t\tif (this.checkModuleResiliency(moduleName))\r\n\t\t\t\tthis.resilientModules.push(moduleName);\r\n\t\t\telse {\r\n\t\t\t\tthis.unavailablePartnerModules.push(moduleName);\r\n\t\t\t\tthis.failedModules.push(moduleName);\r\n\t\t\t\tthis.logFailedModulesInfo(moduleName);\r\n\t\t\t}\r\n\t\t}, this);\r\n\t\treturn this.resilientModules;\r\n\t}\r\n\r\n\t/**\r\n\t* @method Fxp.Resiliency.checkModuleResiliency to check if the modules are avaialble for FXP module injection .\r\n\t* @param {any} modules - modules whose resiliency needs to be checked\r\n\t*/\r\n\tprivate static checkModuleResiliency(module): boolean {\r\n\t\ttry {\r\n\t\t\tvar app = angular.module(module);\r\n\t\t\tif (app.requires.length > 0) {\r\n\t\t\t\tfor (var i = 0; i < app.requires.length; i++) {\r\n\t\t\t\t\tif (!this.checkModuleResiliency(app.requires[i])) {\r\n\t\t\t\t\t\tthis.failedModules.push(app.requires[i]);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}\r\n\t/**\r\n * @method Fxp.Resiliency.logFailedModulesInfo call global event and log property bag value .\r\n * @param {any} moduleName - modules whose resiliency needs to be checked\r\n */\r\n\tprivate static logFailedModulesInfo(moduleName) {\r\n\t\tvar msg = this.failedModules.length > 1 ? \" due to \" + this.failedModules[0] + \", \" + this.failedModules.reverse().join(\" <- \") : \".\";\r\n\t\tvar logMsg = \"Failed to instantiate module \" + moduleName + `${msg}`;\r\n\t\tlet error = new Error();\r\n\t\terror.message = logMsg; \r\n\t\terror.name = \"AngularJS Module Instantiation Failed\"; \r\n\r\n\t\tlet properties = this.FxpLoggerService.createPropertyBag();\r\n\t\tproperties.addToBag('ModuleName', moduleName);\r\n\t\tthis.FxpLoggerService.logException(this.source, error, properties, undefined, undefined, ErrorSeverityLevel.Critical, ErrorCodes.Resiliency_ModuleLoadingError);\r\n\t\tconsole.error(\"Fxp Resiliency: \", logMsg);\r\n\t}\r\n}\r\nResiliency.init();","/// \r\n/// \r\n/// \r\n\r\nimport { AuthenticationResult } from \"@azure/msal-browser\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { IServiceEndPoints } from \"../interfaces/IServiceEndPoints\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n\r\ndeclare global {\r\n\tinterface Window { _msalEndpoints: any; }\r\n}\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Utils.Services\r\n */\r\n\r\n/**\r\n * A service keeping the generic methods used in the fxp application and for multiple adal requests \r\n * @class Fxp.Services.AdalLoginHelperService\r\n * @classdesc A service used for generic methods in the fxp application and adal simultaneous cors requests\r\n * @example Example to create an instance of AdalLoginHelperService\r\n * //Initializing AdalLoginHelperService\r\n * angular.module('FxPApp').controller('AppController', ['AdalLoginHelperService', AppController]);\r\n * function AppController(AdalLoginHelperService){ AdalLoginHelperService.getJsonData(path, callbackfunc); }\r\n */\r\nexport class AdalLoginHelperService implements IFxPService {\r\n\tprivate serviceEndpoints: Array = [];\r\n\tprivate $q;\r\n\tprivate $resource;\r\n\r\n\tconstructor($q: angular.IQService, $resource: angular.resource.IResourceService, private msalAuthenticationService: MsalAuthenticationService) {\r\n\t}\r\n\r\n\t/**\r\n * Checks for whether the adal service request is in progress or not and returns boolean \r\n * @method Fxp.Utils.Services.AdalLoginHelperService.registerEndPoint\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @param {ResourceId} ResourceId is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke accessTokenRequestInProgress\r\n * AdalLoginHelperService.registerEndPoint('http://oneprofiledevapi.azurewebsites.net', 'asdasd-asdasd-asdasda-asdasd');\r\n */\r\n\tregisterEndPoint(endpoint: string, applicationId: string) {\r\n\t\tthis.msalAuthenticationService.registerEndPoint(endpoint, applicationId);\r\n\t}\r\n\r\n\t/**\r\n * Checks for whether the adal service request is in progress or not and returns boolean \r\n * @method Fxp.Utils.Services.AdalLoginHelperService.accessTokenRequestInProgress\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke accessTokenRequestInProgress\r\n * AdalLoginHelperService.accessTokenRequestInProgress('http://oneprofiledevapi.azurewebsites.net');\r\n */\r\n\taccessTokenRequestInProgress(endpoint): boolean {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n * Returns cached token for a given endpoint \r\n * @method Fxp.Utils.Services.AdalLoginHelperService.getCachedToken\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke getCachedToken\r\n * AdalLoginHelperService.getCachedToken('http://oneprofiledevapi.azurewebsites.net');\r\n */\r\n\tgetCachedToken(endpoint) {\r\n\t\t// var resource = this.adal.getResourceForEndpoint(endpoint);\r\n\t\t// return this.adal.getCachedToken(resource);\r\n\t\treturn this.msalAuthenticationService.getCachedToken(endpoint);\r\n\t}\r\n\r\n\t/**\r\n * To kick off token acquisition manually on special cases \r\n * @method Fxp.Utils.Services.AdalLoginHelperService.acquireToken\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke acquireToken\r\n * AdalLoginHelperService.acquireToken('http://oneprofiledevapi.azurewebsites.net');\r\n */\r\n\tacquireToken(endpoint, callback) {\r\n\t\tthis.msalAuthenticationService.acquireTokenAsPromise(endpoint).then((authResult: AuthenticationResult) => {\r\n\t\t\tif (authResult && authResult.accessToken) {\r\n\t\t\t\tcallback(null, authResult.accessToken, null);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconsole.log(\"Token not acquired\");\r\n\t\t\t\tcallback('User login is required', null, 'login required');\r\n\t\t\t}\r\n\t\t}).catch((error: any) => callback('User login is required', null, 'login required'));\r\n\t}\r\n\r\n\tacquireTokenAsPromise(endpoint) {\r\n\t\tvar self = this;\r\n\t\treturn new Promise(function (resolve, reject) {\r\n\t\t\tself.msalAuthenticationService.acquireTokenAsPromise(endpoint)\r\n\t\t\t\t.then((result: AuthenticationResult) => resolve(result.accessToken))\r\n\t\t\t\t.catch((error: any) => reject(error))\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n * Checks for whether the token retrieval is started for the endpoint provided \r\n * @method Fxp.Utils.Services.AdalLoginHelperService.isTokenRetrievalStarted\r\n * @param {Resource} resource an endpoint which is passed to check for it in the logs entry.\r\n * @example Example to invoke isTokenRetrievalStarted\r\n * AdalLoginHelperService.isTokenRetrievalStarted('https://microsoft.onmicrosoft.com/FXPCouchBaseAPI');\r\n */\r\n\tisTokenRetrievalStarted(resource): boolean {\r\n\t\tvar isTokenRetrievalStarted = false;\r\n\r\n\t\t// console.log(this.adal.CONSTANTS.LOG_ENTRY + resource);\r\n\t\t// var log = this.adal._getItem(this.adal.CONSTANTS.LOG_ENTRY + resource);\r\n\t\t// if (log) {\r\n\t\t// \tvar logEntries = log.split(';');\r\n\t\t// \tvar lastEntry = logEntries[logEntries.length - 2];\r\n\t\t// \tvar entryTime = new Date(lastEntry.substr(0, lastEntry.indexOf('GMT:') + 3));\r\n\t\t// \tvar now = new Date();\r\n\t\t// \tisTokenRetrievalStarted = now.getTime() < entryTime.getTime() + 10000;\r\n\t\t// }\r\n\r\n\t\treturn isTokenRetrievalStarted;\r\n\t}\r\n\r\n}\r\n\r\n","import { Subject } from 'rxjs';\r\nimport { IRootScope } from '../interfaces/IRootScope';\r\nimport { CommonUtils } from '../utils/CommonUtils';\r\nimport { IFxPService } from '../interfaces/IFxpService';\r\n\r\nexport class FxpEventBroadCastService implements IFxPService {\r\n\r\n\tprivate subject: Subject;\r\n\tprivate subjects: any = [];\r\n\tconstructor(private $rootScope: IRootScope) {\r\n\t}\r\n\tprivate broadCastSubject(eventName: string, value: any) {\r\n\t\tvar self = this;\r\n\t\tvar eventIndex = CommonUtils.getIndexOfObject(self.subjects, \"eventName\", eventName);\r\n\t\tif (eventIndex > -1) {\r\n\t\t\tself.subjects[eventIndex].subject.onNext(value);\r\n\t\t} else {\r\n\t\t\tlet event = {\r\n\t\t\t\teventName: eventName,\r\n\t\t\t\tsubject: self.getSubjectInstance()\r\n\t\t\t}\r\n\t\t\tself.subjects.push(event);\r\n\t\t}\r\n\t}\r\n\tprivate subscribeToSubject(eventName: string): Subject {\r\n\t\tvar self = this;\r\n\t\tvar eventIndex = CommonUtils.getIndexOfObject(self.subjects, \"eventName\", eventName);\r\n\t\tif (eventIndex > -1) {\r\n\t\t\treturn self.subjects[eventIndex].subject;\r\n\t\t} else {\r\n\t\t\tlet event = {\r\n\t\t\t\teventName: eventName,\r\n\t\t\t\tsubject: self.getSubjectInstance()\r\n\t\t\t}\r\n\t\t\tself.subjects.push(event);\r\n\t\t\treturn event.subject;\r\n\t\t}\r\n\t}\r\n\tprivate unsubscribeSubject(eventName: string) {\r\n\t\tvar self = this;\r\n\t\tvar eventIndex = CommonUtils.getIndexOfObject(self.subjects, \"eventName\", eventName);\r\n\t\tif (eventIndex > -1) {\r\n\t\t\tself.subjects[eventIndex].subject.unsubscribe();\r\n\t\t}\r\n\t}\r\n\tpublic On(eventName: string, callBack: any): any {\r\n\t\tvar self = this;\r\n\t\treturn self.$rootScope.$on(eventName, callBack);\r\n\t}\r\n\tpublic broadCast(eventName: string, value: any) {\r\n\t\tvar self = this;\r\n\t\tself.$rootScope.$broadcast(eventName, value);\r\n\t}\r\n\tpublic emit(eventName: string, callBack: any) {\r\n\t\tvar self = this;\r\n\t\tself.$rootScope.$emit(eventName, callBack);\r\n\t}\r\n\r\n\tprivate getSubjectInstance(): any {\r\n\t\tvar subject = new Subject();\r\n\t\treturn subject;\r\n\t}\r\n\r\n}\r\n","import { IDataService } from \"../interfaces/IDataService\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { Observable } from \"rxjs\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n\r\n/**\r\n* @application Fxp\r\n*/\r\n/**\r\n* @module Fxp.Utils.Services\r\n*/\r\nexport class DataService implements IDataService,IFxPService {\r\n\r\n\tprivate sleepInterval: number = 100;\r\n\tprivate retryCount = {};\r\n\tprivate sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.DataService`;\r\n\r\n\tconstructor(\r\n\t\tprivate $http: angular.IHttpService,\r\n\t\tprivate $q: angular.IQService,\r\n\t\tprivate $timeout: angular.ITimeoutService,\r\n\t\tprivate msalAuthenticationService: MsalAuthenticationService,\r\n\t\tprivate fxploggerService: ILogger) {\r\n\t}\r\n\r\n\tpublic get(url: string, parentDeferred: any): angular.IPromise {\r\n\t\treturn this.getWithAdalTokenSync(url, parentDeferred);\r\n\t}\r\n\r\n\tpublic getAsObservable(url: string): Observable {\r\n\t\treturn Observable.create(observer=>{\r\n\t\t\tthis.getWithAdalTokenSync(url, null).then((data) => {\r\n\t\t\t\tobserver.next(data); \r\n\t\t\t\tobserver.complete(); \r\n\t\t\t}).catch((error)=> {\r\n\t\t\t\tobserver.error(error); \r\n\t\t\t})\r\n\t\t})\r\n\t\t\r\n\t}\r\n\tprivate getWithAdalTokenSync(url: string, parentDeferred: any): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = parentDeferred || self.$q.defer();\r\n\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tvar retryCountForUrl = self.retryCount[url] || 0;\r\n\t\t\tretryCountForUrl++;\r\n\t\t\tself.retryCount[url] = retryCountForUrl;\r\n\t\t\tif (retryCountForUrl == 5) {\r\n\t\t\t\tdelete self.retryCount[url];\r\n\t\t\t\tvar propBag = self.fxploggerService.createPropertyBag();\r\n\t\t\t\tpropBag.addToBag('ServiceUrl', url);\r\n\r\n\t\t\t\tself.fxploggerService.logError(`${self.sourceForTelemetry}.GetWithAdalTokenSync`, 'AdalTokenAquisitionFailed', ErrorCodes.DataService_TokenFailure, null, propBag, null, null, ErrorSeverityLevel.Medium);\r\n\t\t\t\t\r\n\t\t\t\treturn deferred.promise;\r\n\t\t\t}\r\n\t\t\tself.$timeout(function () {\r\n\t\t\t\tself.getWithAdalTokenSync(url, deferred);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdelete self.retryCount[url];\r\n\t\t\treturn this.$http.get(url);\r\n\t\t}\r\n\r\n\t\treturn deferred.promise;\r\n\t}\r\n}\r\n\r\n","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { UserClaimsService } from \"./UserClaimsService\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { StateService } from \"@uirouter/core\"\r\nimport { PartnerAppRegistrationService } from \"./PartnerAppRegistrationService\";\r\nimport { IUserPermission, IUserRole, IUserResourcePermissions, IResourcePermission } from \"../interfaces/IUserPermission\";\r\nimport { IStateConfig } from \"../interfaces/IStateConfig\";\r\nimport { IStateAuthorizationRule } from \"../interfaces/IStateAuthorizationRule\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to check Authorization Rules\r\n * @class Fxp.Services.FxpAuthorizationService \r\n * @classdesc A service to check Authorization Rules\r\n * @example Example to create an instance of Fxp Authorization Service\r\n * //Initializing Fxp Route Service\r\n * angular.module('FxPApp').controller('AppController', ['FxpAuthorizationService ', AppController]);\r\n */\r\nexport class FxpAuthorizationService implements IFxPService {\r\n\tprivate states;\r\n\tprivate stateGo: StateService;\r\n\tprivate rootScope: IRootScope;\r\n\tprivate fxplogger: ILogger;\r\n\tprivate userClaimsService: UserClaimsService;\r\n\tprivate userInfoService: UserInfoService;\r\n\tprivate fxpConfigurationService: FxpConfigurationService;\r\n\r\n\tconstructor($state: StateService,\r\n\t\t$rootScope: IRootScope,\r\n\t\tloggerService: ILogger,\r\n\t\tuserClaimsService: UserClaimsService,\r\n\t\tuserInfoService: UserInfoService,\r\n\t\tfxpConfigurationService: FxpConfigurationService\r\n\t) {\r\n\t\tthis.states = $state.get();\r\n\t\tthis.stateGo = $state;\r\n\t\tthis.rootScope = $rootScope;\r\n\t\tthis.userClaimsService = userClaimsService;\r\n\t\tthis.userInfoService = userInfoService;\r\n\t\tthis.fxplogger = loggerService;\r\n\t\tthis.fxpConfigurationService = fxpConfigurationService;\r\n\r\n\t}\r\n\r\n\tprivate isNullOrEmpty(object: any) {\r\n\t\treturn (typeof object === 'undefined' || object === null || object.length < 1)\r\n\t}\r\n\r\n\tpublic checkStatePermission(event, state: IStateConfig): void {\r\n\t\tconst self = this;\r\n\t\tif (self.isStateAuthorized(state) === false)\r\n\t\t\tself.redirectToUnauthorizedState(event, state.name);\r\n\t}\r\n\r\n\tpublic redirectToUnauthorizedState(event:any=null, currentState:string=\"\"): void {\r\n\t\tconst self = this;\r\n\t\tconst propbag = self.fxplogger.createPropertyBag();\r\n\t\tif (currentState.trim().length === 0){\r\n\t\t\tcurrentState = self.states.current.name;\r\n\t\t}\r\n\t\tpropbag.addToBag(\"currentUser\", self.userInfoService.getCurrentUser());\r\n\t\tpropbag.addToBag(\"currentState\", currentState);\r\n\t\tvar telemetrymsg = self.rootScope.fxpUIConstants.UIStrings.UnauthorizedUIString + currentState;\r\n\t\tself.fxplogger.logWarning(\"FxpAuthorizationService\", telemetrymsg, propbag);\r\n\t\tif (event){\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t\tthis.stateGo.go(\"unauthorized\");\r\n\t}\t\r\n\r\n\t/*check if given state for a given app is authorized*/\r\n\tpublic isAuthorized(stateName: string, appName?: string): boolean \r\n\t{\r\n\t\tconst self = this;\r\n\t\tlet stateConfig = { name: stateName } as IStateConfig;\r\n\r\n\t\tif(!self.isNullOrEmpty(appName))\r\n\t\t{\r\n\t\t\tconst appConfig = PartnerAppRegistrationService.angularPartnerStateConfig.find(s => s.applicationName && s.applicationName.toLowerCase() === appName.toLowerCase());\r\n\t\t\tif(!self.isNullOrEmpty(appConfig)) //if it is a registered partner app with its routes registered in Fxp\r\n\t\t\t{\r\n\t\t\t\tstateConfig = appConfig.routes.find(r => r.name.toLowerCase() === stateName.toLowerCase());\t\t\t\r\n\t\t\t}\r\n\t\t}\t\t\r\n\r\n\t\treturn self.isStateAuthorized(stateConfig);\r\n\t}\r\n\r\n\t/*check if user is admin*/\r\n\tpublic isAppAdmin(appName: string): boolean\r\n\t{\r\n\t\tif(!appName)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tconst self = this;\r\n\t\tconst adminPermissionsRules = self.getAppAdminRules(appName);\r\n\r\n\t\tif (self.isNullOrEmpty(adminPermissionsRules)) return false; //if no auth rules defined, the user is not an admin by default\r\n\r\n\t\treturn self.hasUserPermissions(adminPermissionsRules);\r\n\t}\r\n\r\n\t/*check if user has the required role*/\r\n\tpublic hasUserRoles(userRoles: IUserRole) : boolean\r\n\t{\t\r\n\t\tconst self = this;\r\n\t\tlet hasRoles = false;\r\n\t\tif(userRoles)\r\n\t\t{\r\n\t\t\tconst allRolesMandatory = userRoles.AllRolesMandatory;\r\n\t\t\tconst roles = userRoles.Value;\r\n\t\t\t\r\n\t\t\t//Role based authorization\r\n\t\t\tif(!self.isNullOrEmpty(roles)){\r\n\t\t\t\tconst claimsList = self.getClaimsList(userRoles.Value, null);\r\n\t\t\t\tif (allRolesMandatory) {\r\n\t\t\t\t\thasRoles = roles.every(r => self.checkRoleFunc(r, claimsList));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\thasRoles = roles.some(r => self.checkRoleFunc(r, claimsList));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn hasRoles;\r\n\t}\r\n\r\n\t/*check if user has the required resource permission*/\r\n\tpublic hasResourcePermissions(userResourcePermissions: IUserResourcePermissions) : boolean\r\n\t{\r\n\t\tconst self = this;\r\n\t\tlet areResourcesAuthorized = false;\r\n\t\tif(userResourcePermissions)\r\n\t\t{\r\n\t\t\tconst allResourcePermissionsMandatory = userResourcePermissions.AllResourcesMandatory;\r\n\t\t\tconst resourcePermissions = userResourcePermissions.Value;\r\n\t\t\t\r\n\t\t\t// Resource Permission based authorization\r\n\t\t\tif (!self.isNullOrEmpty(resourcePermissions)){\r\n\t\t\t\tconst tenantClaims = self.getClaimsList(null, userResourcePermissions.Value);\r\n\t\t\t\tif (allResourcePermissionsMandatory) {\r\n\t\t\t\t\tareResourcesAuthorized = resourcePermissions.every(p => self.checkResourcePermissionFunc(p, tenantClaims));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tareResourcesAuthorized = resourcePermissions.some(p => self.checkResourcePermissionFunc(p, tenantClaims));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn areResourcesAuthorized;\r\n\t}\t\r\n\r\n\t/*check if user has the required role/resource permissions*/\r\n\tpublic hasUserPermissions(allowedPermissions: IUserPermission) : boolean\r\n\t{\r\n\t\tconst self = this;\r\n\t\t// if both roles and resource permissions are required\r\n\t\tconst authorizeRolesAndResources = allowedPermissions.AuthorizeRolesAndResources;\t\r\n\t\t\r\n\t\tlet userRoles: IUserRole\r\n\t\tif(allowedPermissions.Roles && !self.isNullOrEmpty(allowedPermissions.Roles.Value)) \r\n\t\t{\r\n\t\t\tuserRoles = allowedPermissions.Roles;\r\n\t\t}\r\n\t\t\r\n\t\tlet userResourcePermissions: IUserResourcePermissions\t\t\r\n\t\tif(allowedPermissions.ResourcePermissions && !self.isNullOrEmpty(allowedPermissions.ResourcePermissions.Value)) \r\n\t\t{\r\n\t\t\tuserResourcePermissions = allowedPermissions.ResourcePermissions;\r\n\t\t}\r\n\r\n\t\tvar areRolesAuthorized = () => {\r\n\t\t\treturn self.hasUserRoles(userRoles);\t\t\r\n\t\t}\r\n\t\tvar areResourcesAuthorized = () => {\r\n\t\t\treturn self.hasResourcePermissions(userResourcePermissions);\r\n\t\t}\r\n\r\n\t\tif(authorizeRolesAndResources){\r\n\t\t\treturn (areRolesAuthorized() && areResourcesAuthorized());\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn (areRolesAuthorized() || areResourcesAuthorized());\r\n\t\t}\r\n\t}\t\t\r\n\t\r\n\tprivate isStateAuthorized(state: IStateConfig): boolean \r\n\t{\r\n\t\tconst self = this;\r\n\t\tconst authorizationRules = self.getStateAuthorizationRules(state)\r\n\r\n\t\tif (self.isNullOrEmpty(authorizationRules) || self.isNullOrEmpty(authorizationRules.AllowedPermissions)) return true; //if no auth rules defined, the state is authorized by default\r\n\t\t\r\n\t\tif (self.rootScope.actOnBehalfOfUserActive && authorizationRules.IsRestrictedInObo === true)\r\n\t\t\treturn false;\r\n\r\n\t\t/*check if either admin or user state is authorized*/\r\n\t\treturn self.hasUserPermissions(authorizationRules.AllowedPermissions) || (state.data && state.data[\"partnerAppName\"] ? self.isAppAdmin(state.data[\"partnerAppName\"]) : false);\r\n\t}\t\r\n\r\n\tprivate getStateAuthorizationRules(state: IStateConfig) : IStateAuthorizationRule\r\n\t{\r\n\t\tconst self = this;\r\n\t\tconst stateName = state.name\r\n\t\tlet authRules = self.fxpConfigurationService.FxpBaseConfiguration.AuthorizationRules.filter(function (item) {\r\n\t\t\treturn (item.StateName === stateName);\r\n\t\t})[0];\r\n\t\tif(!self.isNullOrEmpty(authRules))\r\n\t\t{\r\n\t\t\treturn authRules; // auth rules for the state in startup config takes precedence over partner app config\r\n\t\t}\t\r\n\t\t\r\n\t\treturn state.authorizationRules;\r\n\t}\r\n\r\n\tprivate getAppAdminRules(appName : string) : IUserPermission\r\n\t{\r\n\t\tconst self = this;\r\n\t\tlet adminRules;\r\n\t\tif(!self.isNullOrEmpty(appName))\r\n\t\t{\r\n\t\t\tconst appConfig = PartnerAppRegistrationService.angularPartnerStateConfig.find(s => s.applicationName.toLowerCase() === appName.toLowerCase());\r\n\t\t\tif(appConfig)\r\n\t\t\t{\r\n\t\t\t\tadminRules = appConfig.adminRules\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn adminRules;\r\n\t}\t\r\n\r\n\tprivate getClaimsList(roles: Array, resourcePermissions: Array)\r\n\t{\r\n\t\tconst self = this;\r\n\t\tconst tenantClaims = {};\r\n\r\n\t\tconst apps = self.getAppList(roles, resourcePermissions);\r\n\t\t\r\n\t\t/*get claims as per app Id passed in auth rule*/\r\n\t\tapps.forEach(app => {\r\n try {\r\n tenantClaims[app] = self.userClaimsService.getUserTenantClaims(app);\r\n } catch (e) {\r\n }\r\n\t\t});\r\n\t\treturn tenantClaims;\r\n\t}\r\n\r\n\tprivate getAppList(roles: Array, resourcePermissions: Array = null): Array\r\n\t{\r\n\t\tlet apps = [];\r\n\t\tif(roles)\r\n\t\t{\r\n\t\t\tapps = apps.concat(roles.map((role) => {\r\n\t\t\t\treturn role.split(\".\")[0];\r\n\t\t\t}));\r\n\t\t}\r\n\t\tif(resourcePermissions)\r\n\t\t{\r\n\t\t\tapps = apps.concat(resourcePermissions.map((permission) => {\t\t\t\t\r\n\t\t\t\treturn permission.Resource.split(\".\")[0];\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\t/*remove duplicates from app list to avoid calling claims service repeatedly for same app */\r\n\t\tapps = apps.filter((el, i, a) => i === a.indexOf(el))\r\n\t\t\r\n\t\treturn apps;\r\n\t}\t\r\n\r\n\tprivate checkRoleFunc(item: string, tenantClaims) : boolean\r\n\t{\r\n\t\tconst self = this;\r\n\t\tlet hasRoles = false;\r\n\t\tif(!self.isNullOrEmpty(item))\r\n\t\t{\r\n\t\t\tconst[npd, role] = item.split(\".\");\r\n\t\t\tconst NPDClaims = tenantClaims[npd];\r\n\t\t\tif (NPDClaims && NPDClaims.claims.roles.hasOwnProperty(role) === true) {\r\n\t\t\t\thasRoles = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn hasRoles;\r\n\t}\t\r\n\r\n\tprivate checkResourcePermissionFunc(item: IResourcePermission, tenantClaims) : boolean\r\n\t{\r\n\t\tconst self = this;\r\n\t\tlet hasPermissions = false;\r\n\t\tif(item && !self.isNullOrEmpty(item.Resource))\r\n\t\t{\r\n\t\t\tconst[npd, resource] = item.Resource.split(\".\");\r\n\t\t\tconst NPDClaims = tenantClaims[npd];\r\n\t\t\tif (NPDClaims && NPDClaims.claims.resourcePermissions) {\r\n\t\t\t\tconst resourcePermission = NPDClaims.claims.resourcePermissions.find((r) => (r.resource.toLowerCase() == resource.toLowerCase()));\r\n\t\t\t\tif (resourcePermission && resourcePermission.resource) {\r\n\t\t\t\t\tif(!item.Permissions || self.isNullOrEmpty(item.Permissions.Value)) //if no permissions mentioned only check on resource\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\thasPermissions = true;\r\n\t\t\t\t\t\treturn hasPermissions;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst allPermissionsMandatory = item.Permissions.AllPermissionsMandatory;\r\n\t\t\t\t\tif(allPermissionsMandatory)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\thasPermissions = item.Permissions.Value.every(p=> resourcePermission.permissions.includes(p));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\thasPermissions = item.Permissions.Value.some(p=> resourcePermission.permissions.includes(p));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn hasPermissions;\r\n\t}\t\t\r\n}\r\n","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { TelemetryContext } from \"../telemetry/telemetrycontext\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport {\r\n ApplicationConstants,\r\n FxpConstants,\r\n} from \"../common/ApplicationConstants\";\r\nimport { FxpLogHelper } from \"../telemetry/FxpLogHelper\";\r\nimport { FxpStorageService } from \"./FxpStorageService\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { DashboardService } from \"./dashboardService\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { StateService } from \"@uirouter/core\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"../services/fxp.global.store.service\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { FeatureUsageEvent } from \"../telemetry/FeatureUsageEvent\";\r\nimport {\r\n ActionStatus,\r\n ActionType,\r\n ComponentType,\r\n EventName,\r\n} from \"@microsoftit/telemetry-extensions-npm\";\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to connect to FxpBreadcrumbService to maintain breadcrumb across all routes\r\n * @class Fxp.Services.FxpBreadcrumbService\r\n * @classdesc A service to connect to FxpBreadcrumbService to maintain breadcrumb\r\n * @example Example to create an instance of FxpBreadcrumbService\r\n * //Initializing FxpBreadcrumbService\r\n * angular.module('FxPApp').controller('LeftNavController', ['FxpBreadcrumbService', LeftNavController]);\r\n * function LeftNavController(FxpBreadcrumbService){ FxpBreadcrumbService.setBreadcrumbsObj(userAlias,roleGroupId); }\r\n */\r\nexport class FxpBreadcrumbService implements IFxPService {\r\n private $state;\r\n private $rootScope: IRootScope;\r\n private $q: angular.IQService;\r\n private fxpStorageService: FxpStorageService;\r\n private static _instance: FxpBreadcrumbService;\r\n private userInfoService: UserInfoService;\r\n private dashboardService: DashboardService;\r\n private fxpConfigurationService: FxpConfigurationService;\r\n private fxpLogger: ILogger;\r\n private fxpTelemetryContext: TelemetryContext;\r\n private sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpBreadcrumbService`;\r\n public isLeftNavItemClicked: boolean;\r\n\r\n constructor(\r\n $state: StateService,\r\n $q: angular.IQService,\r\n $rootScope: IRootScope,\r\n fxpStorageService: FxpStorageService,\r\n userInfoService: UserInfoService,\r\n dashboardService: DashboardService,\r\n fxpConfigurationService: FxpConfigurationService,\r\n fxpLogger: ILogger,\r\n fxpTelemetryContext: TelemetryContext,\r\n private globalStore: FxpGlobalStoreService\r\n ) {\r\n this.$state = $state;\r\n this.$q = $q;\r\n this.fxpStorageService = fxpStorageService;\r\n this.userInfoService = userInfoService;\r\n this.dashboardService = dashboardService;\r\n this.fxpConfigurationService = fxpConfigurationService;\r\n this.fxpTelemetryContext = fxpTelemetryContext;\r\n this.fxpLogger = fxpLogger;\r\n this.$rootScope = $rootScope;\r\n this.isLeftNavItemClicked = false;\r\n }\r\n\r\n /**\r\n * Create the breadcrumb item and update the breadcrumb Array\r\n * @method Fxp.Services.FxpBreadcrumbService.setBreadcrumbFromRoute\r\n * @param {toState } toState current state object.\r\n * @example Example to invoke setBreadcrumbFromRoute\r\n * FxpBreadcrumbService.setBreadcrumbFromRoute();\r\n */\r\n setBreadcrumbFromRoute(toState: any): void {\r\n var self = this;\r\n var breadcrumbText = !CommonUtils.isNullOrEmpty(toState.data.breadcrumbText)\r\n ? toState.data.breadcrumbText\r\n : \"\";\r\n var href = self.$state.href(toState.name);\r\n if (!breadcrumbText || !href || href.indexOf(\"//\") > -1)\r\n //Don't update breadcrumb for invalid urls'\r\n return;\r\n self.setCurrentPageBreadcrumb({\r\n displayName: breadcrumbText,\r\n href: href,\r\n });\r\n }\r\n\r\n /**\r\n * Set the Breadcrumb for Current Page\r\n * @method Fxp.Services.FxpBreadcrumbService.setCurrentPageBreadcrumb\r\n * @param {breadcrumbItem } breadcrumbItem breadcrumbItem of current page.\r\n * @example Example to invoke setCurrentPageBreadcrumb\r\n * FxpBreadcrumbService.setCurrentPageBreadcrumb(breadcrumbItem);\r\n */\r\n setCurrentPageBreadcrumb(breadcrumbItem: any): void {\r\n var self = this;\r\n var currentStateName = self.$state.current.name;\r\n self.startNewBreadcrumbOnSpecificState(currentStateName);\r\n if (self.isLeftNavItemClicked) {\r\n self.$rootScope.fxpBreadcrumb = new Array();\r\n }\r\n self.setBreadcrumb(breadcrumbItem);\r\n self.isLeftNavItemClicked = false;\r\n }\r\n\r\n /**\r\n * Add breadcrumb item by partners\r\n * @method Fxp.Services.FxpBreadcrumbService.setBreadcrumbItem\r\n * @param {breadcrumbItem } breadcrumbItem breadcrumbItem object.\r\n * @example Example to invoke setBreadcrumbItem\r\n * FxpBreadcrumbService.setBreadcrumbItem(breadcrumbItem);\r\n */\r\n setBreadcrumbItem(breadcrumbItem: any): void {\r\n var self = this;\r\n self.setBreadcrumb(breadcrumbItem);\r\n }\r\n\r\n /**\r\n * Save and Get the breadcrumb array in $rootScope.fxpBreadcrumb and localStorage\r\n * @method Fxp.Services.FxpBreadcrumbService.setBreadcrumb\r\n * @param {breadcrumbItem } breadcrumbItem breadcrumbItem object.\r\n * @example Example to invoke setBreadcrumb\r\n * FxpBreadcrumbService.setBreadcrumb(breadcrumbItem);\r\n */\r\n private setBreadcrumb(breadcrumbItem: any): void {\r\n var self = this;\r\n var storageKey =\r\n self.userInfoService.getCurrentUser() +\r\n \"-\" +\r\n ApplicationConstants.FxpBreadcrumbStorageKey;\r\n var userNavigatedStatesWithBreadcrumb =\r\n self.fxpStorageService.getFromLocalStorage(storageKey) || {};\r\n var newTabBreadcrumbStorageKey = CommonUtils.hashCode(breadcrumbItem.href);\r\n var prevSessionBreadcrumbArray = self.fxpStorageService.getFromLocalStorage(\r\n newTabBreadcrumbStorageKey\r\n );\r\n if (prevSessionBreadcrumbArray) {\r\n self.$rootScope.fxpBreadcrumb = prevSessionBreadcrumbArray;\r\n self.fxpStorageService.deleteFromLocalStorage(newTabBreadcrumbStorageKey);\r\n }\r\n if (!self.$rootScope.fxpBreadcrumb)\r\n self.$rootScope.fxpBreadcrumb = new Array();\r\n var expectedBreadcrumbForCurrentState =\r\n self.getExpectedBreadcrumbForCurrentState(\r\n self.$rootScope.fxpBreadcrumb,\r\n breadcrumbItem\r\n );\r\n var breadcrumbArraySearchKey = CommonUtils.hashCode(\r\n self.$state.current.name.toLowerCase() +\r\n \"_\" +\r\n (breadcrumbItem.href ? breadcrumbItem.href.toLowerCase() : \"\") +\r\n \"_\" +\r\n breadcrumbItem.displayName.toLowerCase()\r\n );\r\n var isBreadcrumbStateExist =\r\n userNavigatedStatesWithBreadcrumb.hasOwnProperty(\r\n breadcrumbArraySearchKey\r\n );\r\n if (!isBreadcrumbStateExist) {\r\n self.$rootScope.fxpBreadcrumb = self.updateBreadcrumb(\r\n self.$rootScope.fxpBreadcrumb,\r\n breadcrumbItem\r\n );\r\n userNavigatedStatesWithBreadcrumb[breadcrumbArraySearchKey] =\r\n self.$rootScope.fxpBreadcrumb;\r\n self.fxpStorageService.saveInLocalStorage(\r\n storageKey,\r\n userNavigatedStatesWithBreadcrumb\r\n );\r\n } else {\r\n if (\r\n (self.$rootScope.fxpBreadcrumb === undefined ||\r\n self.$rootScope.fxpBreadcrumb.length == 0) &&\r\n !self.isLeftNavItemClicked\r\n ) {\r\n self.$rootScope.fxpBreadcrumb =\r\n userNavigatedStatesWithBreadcrumb[breadcrumbArraySearchKey];\r\n return;\r\n }\r\n var storedBreadcrumbForCurrentState =\r\n userNavigatedStatesWithBreadcrumb[breadcrumbArraySearchKey];\r\n if (\r\n CommonUtils.hashCode(\r\n JSON.stringify(expectedBreadcrumbForCurrentState)\r\n ) ===\r\n CommonUtils.hashCode(JSON.stringify(storedBreadcrumbForCurrentState))\r\n ) {\r\n self.$rootScope.fxpBreadcrumb = storedBreadcrumbForCurrentState;\r\n } else {\r\n self.$rootScope.fxpBreadcrumb = expectedBreadcrumbForCurrentState;\r\n userNavigatedStatesWithBreadcrumb[breadcrumbArraySearchKey] =\r\n expectedBreadcrumbForCurrentState;\r\n self.fxpStorageService.saveInLocalStorage(\r\n storageKey,\r\n userNavigatedStatesWithBreadcrumb\r\n );\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * check if breadcrumb item is exist or not in current breadcrumb list\r\n * @method Fxp.Services.FxpBreadcrumbService.updateBreadcrumb\r\n * @param {breadcrumbList } breadcrumbList breadcrumb list\r\n * @param {breadcrumbItem } breadcrumbItem breadcrumbItem\r\n * @example Example to invoke updateBreadcrumb\r\n * FxpBreadcrumbService.updateBreadcrumb(breadcrumbList, breadcrumbItem);\r\n */\r\n private updateBreadcrumb(breadcrumbList: any, breadcrumbItem: any): any {\r\n var breadcrumbItemIndex = -1;\r\n for (let i = 0, length = breadcrumbList.length; i < length; i++) {\r\n if (\r\n breadcrumbList[i].displayName.toLowerCase() ===\r\n breadcrumbItem.displayName.toLowerCase()\r\n ) {\r\n breadcrumbItemIndex = i;\r\n breadcrumbList[i].href = breadcrumbItem.href;\r\n break;\r\n }\r\n }\r\n if (breadcrumbItemIndex > -1) {\r\n breadcrumbList.splice(breadcrumbItemIndex + 1);\r\n } else {\r\n breadcrumbList.push(breadcrumbItem);\r\n }\r\n return breadcrumbList;\r\n }\r\n\r\n /**\r\n * expected breadcrumb when we visit the page.\r\n * @method Fxp.Services.FxpBreadcrumbService.getExpectedBreadcrumbForCurrentState\r\n * @param {breadcrumbList } breadcrumbList breadcrumb list\r\n * @param {breadcrumbItem } breadcrumbItem breadcrumbItem\r\n * @example Example to invoke getExpectedBreadcrumbForCurrentState\r\n * FxpBreadcrumbService.getExpectedBreadcrumbForCurrentState(breadcrumbList, breadcrumbItem);\r\n */\r\n private getExpectedBreadcrumbForCurrentState(\r\n breadcrumbList: any,\r\n breadcrumbItem: any\r\n ): any {\r\n var self = this;\r\n return self.updateBreadcrumb(angular.copy(breadcrumbList), breadcrumbItem);\r\n }\r\n\r\n /**\r\n * in special case where a breadcrumb start as fresh\r\n * @method Fxp.Services.FxpBreadcrumbService.startNewBreadcrumbOnSpecificState\r\n * @param {currentStateName } currentStateName current state name.\r\n * @example Example to invoke startNewBreadcrumbOnSpecificState\r\n * FxpBreadcrumbService.startNewBreadcrumbOnSpecificState(currentStateName);\r\n */\r\n private startNewBreadcrumbOnSpecificState(currentStateName): void {\r\n var self = this;\r\n var nonGLNStateCollectionForBreadcrumb =\r\n self.fxpConfigurationService.FxpBaseConfiguration\r\n .NonGLNStateCollectionForBreadcrumb;\r\n var isStateAvailable = nonGLNStateCollectionForBreadcrumb.some((item) => {\r\n return item.toLowerCase() === currentStateName.toLowerCase();\r\n });\r\n if (isStateAvailable) {\r\n self.$rootScope.fxpBreadcrumb = new Array();\r\n }\r\n }\r\n\r\n /**\r\n * Breadcrumb info capture in Telemetry when user navigate different link options\r\n * @method Fxp.Services.FxpBreadcrumbService.logBreadcrumbTelemetryInfo\r\n * @example Example to invoke logBreadcrumbTelemetryInfo\r\n * FxpBreadcrumbService.logBreadcrumbTelemetryInfo();\r\n */\r\n public logBreadcrumbTelemetryInfo(type: string, breadcrumbItem: any): void {\r\n var self = this,\r\n propBag,\r\n userInfo,\r\n breadcrumbString;\r\n var profile = self.globalStore.GetPlatformState().LoggedInUser.Profile;\r\n if (!CommonUtils.isNullOrEmpty(profile)) userInfo = JSON.stringify(profile);\r\n if (!self.$rootScope.fxpBreadcrumb || !userInfo) return;\r\n\r\n var loginUserInfo = JSON.parse(userInfo);\r\n\r\n if (CommonUtils.isNullOrEmpty(breadcrumbItem)) {\r\n breadcrumbString = self.$rootScope.fxpBreadcrumb\r\n .map(function (breadcrumbItem) {\r\n return breadcrumbItem.displayName;\r\n })\r\n .join(\" > \");\r\n } else {\r\n //To handle breadcrumb text on breadcrumb Click, Need to build breadcrumb text by the item clicked.\r\n var breadcrumbForClick = self.updateBreadcrumb(\r\n self.$rootScope.fxpBreadcrumb,\r\n breadcrumbItem\r\n );\r\n breadcrumbString = breadcrumbForClick\r\n .map(function (breadcrumbItem) {\r\n return breadcrumbItem.displayName;\r\n })\r\n .join(\" > \");\r\n }\r\n\r\n propBag = self.fxpLogger.createPropertyBag();\r\n propBag.addToBag(\r\n FxpConstants.metricConstants.SessionId,\r\n self.$rootScope.sessionId\r\n );\r\n propBag.addToBag(\r\n FxpConstants.metricConstants.UserBusinessRole,\r\n loginUserInfo.businessRole\r\n );\r\n\r\n if (self.userInfoService.isActingOnBehalfOf()) {\r\n var oboUserInfo;\r\n let profile = self.globalStore.GetPlatformState().CurrentUser.Profile;\r\n if (!CommonUtils.isNullOrEmpty(profile))\r\n oboUserInfo = JSON.stringify(profile);\r\n if (!oboUserInfo) return;\r\n var oboUserData = JSON.parse(oboUserInfo);\r\n propBag.addToBag(\r\n FxpConstants.metricConstants.OBOUserBusinessRole,\r\n oboUserData.OBOUserBusinessRole\r\n );\r\n }\r\n propBag.addToBag(\r\n FxpConstants.metricConstants.TimeStamp,\r\n FxpLogHelper.getTimeStamp()\r\n );\r\n propBag.addToBag(\r\n FxpConstants.metricConstants.BreadcrumbString,\r\n breadcrumbString\r\n );\r\n\r\n if (type === FxpConstants.BreadcrumbEventType.BreadcrumbClick) {\r\n self.fxpLogger.logInformation(\r\n self.sourceForTelemetry,\r\n `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.BreadcrumbItemClicked`,\r\n propBag\r\n );\r\n const breadcrumbFeature = new FeatureUsageEvent(\r\n `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.Breadcrumb`,\r\n ActionType.User,\r\n \"BreadcrumbClicked\",\r\n EventName.LinkClicked,\r\n ComponentType.Web\r\n );\r\n breadcrumbFeature.ActionStatus = ActionStatus.Succeeded;\r\n self.fxpLogger.logFeatureUsageEvent(\r\n self.sourceForTelemetry,\r\n breadcrumbFeature,\r\n propBag\r\n );\r\n } else {\r\n self.fxpLogger.logInformation(\r\n self.sourceForTelemetry,\r\n `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.BreadcrumbLoad`,\r\n propBag\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Store the current fxpBreadcrumb array into localStorage with newTabBreadcrumbStorageKey\r\n * Before opening any link in newtab through click action, have to call setTempBreadcrumbArray\r\n * @method Fxp.Services.FxpBreadcrumbService.setTempBreadcrumbArray\r\n * @example Example to invoke setTempBreadcrumbArray\r\n * FxpBreadcrumbService.setTempBreadcrumbArray();\r\n */\r\n setTempBreadcrumbArray(url: string): void {\r\n var self = this;\r\n var newTabBreadcrumbStorageKey = CommonUtils.hashCode(url);\r\n self.fxpStorageService.saveInLocalStorage(\r\n newTabBreadcrumbStorageKey,\r\n self.$rootScope.fxpBreadcrumb\r\n );\r\n }\r\n\r\n /**\r\n * Partners can override the current State/Url breadcrumbItem displayName using this method\r\n * @method Fxp.Services.FxpBreadcrumbService.overrideBreadcrumbText\r\n * @param {breadcrumbText } breadcrumbText of the current state/url.\r\n * @example Example to invoke overrideBreadcrumbText\r\n * FxpBreadcrumbService.overrideBreadcrumbText(breadcrumbText);\r\n */\r\n overrideBreadcrumbText(breadcrumbText: string): void {\r\n var self = this;\r\n self.updateDisplayNameForCurrentBreadcrumbItem(breadcrumbText);\r\n }\r\n\r\n /**\r\n * Update the DisplayName of current State/Url breadcrumbItem\r\n * @method Fxp.Services.FxpBreadcrumbService.updateDisplayNameForCurrentBreadcrumbItem\r\n * @param {breadcrumbText } breadcrumbText of the current state/url.\r\n * @example Example to invoke updateDisplayNameForCurrentBreadcrumbItem\r\n * FxpBreadcrumbService.updateDisplayNameForCurrentBreadcrumbItem(breadcrumbText);\r\n */\r\n updateDisplayNameForCurrentBreadcrumbItem(breadcrumbText: string): void {\r\n var self = this;\r\n if (\r\n self.$rootScope.fxpBreadcrumb &&\r\n self.$rootScope.fxpBreadcrumb.length > 0\r\n ) {\r\n self.$rootScope.fxpBreadcrumb[\r\n self.$rootScope.fxpBreadcrumb.length - 1\r\n ].displayName = breadcrumbText;\r\n }\r\n }\r\n\r\n /**\r\n * Method to get the index of breadcrumbItem from breadcrumb context.\r\n * @method Fxp.Services.FxpBreadcrumbService.getBreadcrumbItemIndex\r\n * @param {fxpBreadcrumbContext } fxpBreadcrumbContext is an array.\r\n * @param {breadcrumbName } breadcrumbName is the displayName of the breadcrumbItem.\r\n * @example Example to invoke getBreadcrumbItemIndex\r\n * FxpBreadcrumbService.getBreadcrumbItemIndex(fxpBreadcrumbContext, breadcrumbItem);\r\n */\r\n getBreadcrumbItemIndex(\r\n fxpBreadcrumbContext: any,\r\n breadcrumbName: string\r\n ): number {\r\n if (!fxpBreadcrumbContext || !breadcrumbName) {\r\n return -1;\r\n }\r\n for (var i = 0; i < fxpBreadcrumbContext.length; i++) {\r\n if (\r\n fxpBreadcrumbContext[i].displayName.toLowerCase() ===\r\n breadcrumbName.toLowerCase()\r\n ) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n /**\r\n * Method to save the context of breadcrumb for the current state/url in local storage.\r\n * @method Fxp.Services.FxpBreadcrumbService.saveBreadcrumbContextForCurrentState\r\n * @example Example to invoke saveBreadcrumbContextForCurrentState\r\n * FxpBreadcrumbService.saveBreadcrumbContextForCurrentState(breadcrumbArray);\r\n */\r\n saveBreadcrumbContextForCurrentState(): void {\r\n var self = this;\r\n var breadcrumbLastItem =\r\n self.$rootScope.fxpBreadcrumb[self.$rootScope.fxpBreadcrumb.length - 1];\r\n var storageKey =\r\n self.userInfoService.getCurrentUser() +\r\n \"-\" +\r\n ApplicationConstants.FxpBreadcrumbStorageKey;\r\n var userNavigatedStatesWithBreadcrumb =\r\n self.fxpStorageService.getFromLocalStorage(storageKey) || {};\r\n var breadcrumbArraySearchKey = CommonUtils.hashCode(\r\n self.$state.current.name.toLowerCase() +\r\n \"_\" +\r\n (breadcrumbLastItem.href ? breadcrumbLastItem.href.toLowerCase() : \"\") +\r\n \"_\" +\r\n breadcrumbLastItem.displayName.toLowerCase()\r\n );\r\n userNavigatedStatesWithBreadcrumb[breadcrumbArraySearchKey] =\r\n self.$rootScope.fxpBreadcrumb;\r\n self.fxpStorageService.saveInLocalStorage(\r\n storageKey,\r\n userNavigatedStatesWithBreadcrumb\r\n );\r\n }\r\n\r\n /**\r\n * Method to update the url of breadcrumbItem which is sent by partners.\r\n * @method Fxp.Services.FxpBreadcrumbService.updateBreadcrumbUrlByName\r\n * @param {breadcrumbName } breadcrumbName is the displayName of the breadcrumbItem.\r\n * @param {newUrl } newUrl is href of breadcrumbItem.\r\n * @example Example to invoke updateBreadcrumbUrlByName\r\n * FxpBreadcrumbService.updateBreadcrumbUrlByName(breadcrumbName, newUrl);\r\n */\r\n updateBreadcrumbUrlByName(breadcrumbName: string, newUrl: string): void {\r\n var self = this;\r\n var breadcrumbItemIndex = self.getBreadcrumbItemIndex(\r\n self.$rootScope.fxpBreadcrumb,\r\n breadcrumbName\r\n );\r\n if (breadcrumbItemIndex > -1) {\r\n self.$rootScope.fxpBreadcrumb[breadcrumbItemIndex].href = newUrl;\r\n }\r\n self.saveBreadcrumbContextForCurrentState();\r\n }\r\n}\r\n","export enum FxpBroadcastedEvents {\r\n OnUserContextChanged = \"UserContextChanged\",\r\n OnLeftNavHighlightByStateName = \"HighlightLeftNavByStateName\",\r\n OnLeftNavToggleExpandedState = \"toggleLeftNavExpandedState\",\r\n OnLeftNavTogglePinState = \"toggleLeftNavPinState\",\r\n OnFxpLoadCompleted = \"OnFxpLoadedEvent\",\r\n OnAppHeaderChanged = \"AppHeaderChanged\",\r\n OnPageTitleChanged = \"PageTitleChanged\",\r\n OnFeedbackContextChanged = \"FeedbackContext\",\r\n OnFeedbackConfigurationChanged = \"FeedbackConfiguration\",\r\n OnNewNotificationsRecieved = \"newNotifications\",\r\n OnShowHideInlineLoader = \"showHideInlineLoader\",\r\n OnBasicUserProfileRefresh = \"GetLatestBasicUserProfile\",\r\n OnLayoutChanged = \"layoutChanged\",\r\n OnPageLoadComplete = \"OnPageLoadComplete\",\r\n OnUserSessionTimeout = \"FxPUserSessionTimeout\",\r\n OnLaunchIrisBot = 'LaunchIrisBot',\r\n\tOnHideIrisBot = 'HideIrisBot',\r\n OnPageTourFlyoutOpened = 'PageTourFlyoutOpened',\r\n OnPageTourFlyoutClosed = 'PageTourFlyoutClosed',\r\n LaunchHelpSection = 'LaunchHelpSection',\r\n HidePageTour = 'HidePageTour',\r\n ShowPageTour = 'ShowPageTour',\r\n ActOnBehalfClosed = \"ActOnBehalfClosed\",\r\n ShowPopupOnPageDirty = \"ShowPopupOnPageDirty\"\r\n}","import { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to keep all the configurations used for the application in \r\n * @class Fxp.Services.FxpConfiguration\r\n * @classdesc A service to keep all the settings required for base, application and telemetry settings \r\n * @example Example to use one from FxpConfiguration \r\n * //Using in a Controller\r\n * angular.module('FxPApp').controller('AppController', ['FxpConfigurationService', AppController]);\r\n * function AppController(fxpConfigurationService){ var appSettings = fxpConfigurationService.fxpAppSettings; }\r\n */\r\nexport class FxpConfigurationService implements IFxPService {\r\n\tpublic fxpAppSettings = window[\"FxpAppSettings\"];\r\n\t//TODO: Below two config's should be fetched through Confit service connected from client side\r\n\tprivate fxpBaseConfiguration = window[\"FxpBaseConfiguration\"];\r\n\tprivate modelConfiguration = window[\"ModelConfiguration\"];\r\n\r\n\tpublic get FxpAppSettings(): any {\r\n\t\treturn this.fxpAppSettings;\r\n\t}\r\n\r\n\tget FxpBaseConfiguration(): any {\r\n\t\treturn this.fxpBaseConfiguration;\r\n\t}\r\n\r\n\tget ModelConfiguration(): any {\r\n\t\treturn this.modelConfiguration;\r\n\t}\r\n\r\n\tGetConfiguration(config: string): any {\r\n\r\n\t\tif (window[\"tenantConfiguration\"] && window[\"tenantConfiguration\"][config]) {\r\n\t\t\treturn window[\"tenantConfiguration\"][config];\r\n\t\t}\r\n\t\telse if (this.FxpBaseConfiguration && this.FxpBaseConfiguration[config]) {\r\n\t\t\treturn this.FxpBaseConfiguration[config];\r\n\t\t}\r\n\t\telse if (this.FxpAppSettings && this.FxpAppSettings[config]) {\r\n\t\t\treturn this.FxpAppSettings[config];\r\n\t\t}\r\n\t\telse return;\r\n\r\n\t}\r\n\r\n}","import { ILogger } from \"../interfaces/ILogger\";\r\nimport { TelemetryContext } from \"../telemetry/telemetrycontext\";\r\nimport { FxpConstants } from \"../common/ApplicationConstants\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { UserProfileService } from \"./userProfileService\";\r\nimport { FxpBroadcastedEvents } from \"./FxpBroadcastedEvents\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\n\r\nexport class FxpFeedbackService implements IFxPService {\r\n\tprivate fxplogger: ILogger;\r\n\tprivate userInfoService: UserInfoService;\r\n\tprivate fxpTelemetryContext: TelemetryContext;\r\n\tprivate userProfileService: UserProfileService;\r\n\tprivate rootscope: angular.IRootScopeService;\r\n\tprivate feedbackRouteData: any = {};\r\n\tprivate feedbackPropBag = {};\r\n\tprivate _feedbackItemCollection: any = [];\r\n\tprivate _userId: string = \"\";\r\n\tprivate _subscriprtionId: string = \"\";\r\n\tprivate _feedbackServiceEndpoint: string = \"\";\r\n\tprivate sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FeedbackService`;\r\n\tconstructor(loggerService: ILogger, rootscope: angular.IRootScopeService, userInfoService: UserInfoService, fxpTelemetryContext: TelemetryContext, userProfileService: UserProfileService) {\r\n\t\tthis.fxplogger = loggerService;\r\n\t\tthis.userInfoService = userInfoService;\r\n\t\tthis.rootscope = rootscope;\r\n\t\tthis.fxpTelemetryContext = fxpTelemetryContext;\r\n\t\tthis.userProfileService = userProfileService;\r\n\t}\r\n\r\n\t/**\r\n\t* sets setBrowserTitle of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setBrowserTitle\r\n\t* @param {string} setBrowserTitle a broser tab title.\r\n\t* @example Example to invoke setBrowserTitle\r\n\t* FeedbackWidgetContextService.setBrowserTitle('xxxxxx');\r\n\t*/\r\n\tsetBrowserTitle(browserTitle) {\r\n\t\tvar self = this;\r\n\t\tif (browserTitle) {\r\n\t\t\tself.feedbackRouteData[\"BrowserPageTitle\"] = browserTitle;\r\n\t\t\tself.addToFeedbackPropBag(\"BrowserPageTitle\", browserTitle);\r\n\t\t\tself.rootscope.$broadcast(FxpBroadcastedEvents.OnFeedbackContextChanged);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t* sets setScreenRoute of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setScreenRoute\r\n\t* @param {object} currentRoute a user navigated screen Route.\r\n\t* @example Example to invoke setScreenRoute\r\n\t* Fxp.Services.FxpFeedbackService.setScreenRoute('xxxxxx');\r\n\t*/\r\n\tsetScreenRoute(currentRoute) {\r\n\t\tvar self = this;\r\n\t\tif (currentRoute) {\r\n\t\t\tself.feedbackRouteData[\"ScreenRoute\"] = currentRoute;\r\n\t\t\tself.addToFeedbackPropBag(\"ScreenRoute\", currentRoute);\r\n\t\t\tself.rootscope.$broadcast(FxpBroadcastedEvents.OnFeedbackContextChanged);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t* sets setFeedbackServiceProperties for FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setFeedbackServiceProperties\r\n\t* @param {object } usersDetails a userdetail object having userName, BusinessRole.\r\n\t* @example Example to invoke setFeedbackServiceProperties\r\n\t* Fxp.Services.FxpFeedbackService.setFeedbackServiceProperties();\r\n\t*/\r\n\tsetFeedbackServiceProperties(usersDetails) {\r\n\t\tvar self = this;\r\n\t\tself.removeFeedbackPropBagRange();\r\n\t\tself.addFeedbackPropBagRange(usersDetails);\r\n\t\tself.addFeedbackPropBagRange(self.getEnvironmentDetails());\r\n\t\tself.addFeedbackPropBagRange(self.feedbackRouteData);\r\n\t\tself.rootscope.$broadcast(FxpBroadcastedEvents.OnFeedbackContextChanged);\r\n\t}\r\n\r\n\t/**\r\n\t* get EnvironmentDetails for FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.getEnvironmentDetails\r\n\t* @example Example to invoke getEnvironmentDetails\r\n\t* Fxp.Services.FxpFeedbackService.getEnvironmentDetails();\r\n\t*/\r\n\tgetEnvironmentDetails(): any {\r\n\t\tvar self = this;\r\n\t\tvar feedbackEnvData = self.fxpTelemetryContext.getEnvironmentDetails(null);\r\n\t\tif (!feedbackEnvData)\r\n\t\t\treturn;\r\n\r\n\t\treturn {\r\n\t\t\tEnvironmentName: feedbackEnvData.EnvironmetName,\r\n\t\t\tService: feedbackEnvData.Service,\r\n\t\t\tServiceOffering: feedbackEnvData.ServiceOffering,\r\n\t\t\tServiceLine: feedbackEnvData.ServiceLine\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t* this method is used to accumulate all application specific proprities for FeedbackComponent\r\n\t* @method Fxp.Services.FxpFeedbackService.setUserDetailsToFeedback\r\n\t* @example Example to invoke setUserDetailsToFeedback\r\n\t* Fxp.Services.FxpFeedbackService.setUserDetailsToFeedback();\r\n\t*/\r\n\tsetUserDetailsToFeedback(): void {\r\n\t\tvar self = this, userDetails, oboUserBasicInfo;\r\n\t\tself.userProfileService.getBasicProfileByAlias(self.userInfoService.getLoggedInUser(), null).then(function (loginUserBasicInfo:any) {\r\n\t\t\tif (!loginUserBasicInfo)\r\n\t\t\t\treturn\r\n\r\n\t\t\tuserDetails =\r\n\t\t\t\t{\r\n\t\t\t\t\tUserId: self.userInfoService.getLoggedInUserUpn(),\r\n\t\t\t\t\tUserName: loginUserBasicInfo.fullName,\r\n\t\t\t\t\tBusinessRole: loginUserBasicInfo.businessRole,\r\n\t\t\t\t\tRoleGroupName: loginUserBasicInfo.roleGroupName\r\n\t\t\t\t}\r\n\r\n\t\t\tif (self.userInfoService.isActingOnBehalfOf()) {\r\n\t\t\t\toboUserBasicInfo = self.userInfoService.getCurrentUserData();\r\n\t\t\t\tif (!oboUserBasicInfo)\r\n\t\t\t\t\treturn\r\n\r\n\t\t\t\tuserDetails.OBOUserUPN = self.userInfoService.getCurrentUserUpn();\r\n\t\t\t\tuserDetails.OBOUserBusinessRole = oboUserBasicInfo.businessRole;\r\n\t\t\t\tuserDetails.OBOUserRoleGroupName = oboUserBasicInfo.roleGroupName;\r\n\t\t\t\tuserDetails.OBOUserName = oboUserBasicInfo.fullName;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.setFeedbackServiceProperties(userDetails);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t* sets setUserId of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setUserDetails\r\n\t* @param {string} UserID a Logged IN setUserDetails in Application.\r\n\t* @example Example to invoke setUserDetails\r\n\t* FxpFeedbackService.setUserId('xxxxxx');\r\n\t*/\r\n\tsetUserId = function (userId) {\r\n\t\tvar self = this;\r\n\t\tself._userId = userId;\r\n\t};\r\n\r\n\t/**\r\n\t* getUserID of FeedbackService Context Object\r\n\t* @method Feedback.FeedbackWidgetContextService.getUserID\r\n\t* @example Example to invoke getUserID\r\n\t* FxpFeedbackService.getUserID();\r\n\t*/\r\n\tgetUserID = function () {\r\n\t\tvar self = this;\r\n\t\treturn self._userId;\r\n\t};\r\n\r\n\t/**\r\n\t* sets setFeedbackItemCollection of FeedbackWidget Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setFeedbackItemCollection\r\n\t* @param { any} ItemCollection a feedback dropdown item collection\r\n\t* @example Example to invoke setFeedbackItemCollection\r\n\t* FxpFeedbackService.setFeedbackItemCollection('xxxxxx');\r\n\t*/\r\n\tsetFeedbackItemCollection = function (itemCollection) {\r\n\t\tvar self = this;\r\n\t\tself._feedbackItemCollection = itemCollection;\r\n\t\tself.rootscope.$broadcast(FxpBroadcastedEvents.OnFeedbackConfigurationChanged)\r\n\t};\r\n\r\n\t/**\r\n\t* get FeedbackItemCollection of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.getFeedbackItemCollection\r\n\t* @example Example to invoke getFeedbackItemCollection\r\n\t* FxpFeedbackService.getFeedbackItemCollection();\r\n\t*/\r\n\tgetFeedbackItemCollection = function () {\r\n\t\tvar self = this;\r\n\t\treturn self._feedbackItemCollection;\r\n\t};\r\n\r\n\t/**\r\n\t* sets setFeedbackEndpoint of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setFeedbackEndpoint\r\n\t* @param {string} endpoint a feedback API Endpoint.\r\n\t* @example Example to invoke setFeedbackEndpoint\r\n\t* FxpFeedbackService.setFeedbackEndpoint('xxxxxx');\r\n\t*/\r\n\tsetFeedbackEndpoint = function (endpoint) {\r\n\t\tvar self = this;\r\n\t\tself._feedbackServiceEndpoint = endpoint;\r\n\t\tself.rootscope.$broadcast(FxpBroadcastedEvents.OnFeedbackConfigurationChanged)\r\n\t};\r\n\t/**\r\n\t* sets getFeedbackEndpoint of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.getFeedbackEndpoint\r\n\t* @example Example to invoke getFeedbackEndpoint\r\n\t* FxpFeedbackService.getFeedbackEndpoint();\r\n\t*/\r\n\tgetFeedbackEndpoint = function () {\r\n\t\tvar self = this;\r\n\t\treturn self._feedbackServiceEndpoint;\r\n\t};\r\n\t/**\r\n\t* sets setSubsctiptionId of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.setSubsctiptionId\r\n\t* @param {string} subsctiptionId a subscrption of consumer Id .\r\n\t* @example Example to invoke setSubsctiptionId\r\n\t* FxpFeedbackService.setSubsctiptionId('xxxxxx');\r\n\t*/\r\n\tsetSubscriprtionId = function (subscriprtionId) {\r\n\t\tvar self = this;\r\n\t\tself._subscriprtionId = subscriprtionId;\r\n\t\tself.rootscope.$broadcast(FxpBroadcastedEvents.OnFeedbackConfigurationChanged)\r\n\t};\r\n\r\n\t/**\r\n\t* getSubsctiptionId of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.getSubsctiptionId\r\n\t* @example Example to invoke getSubsctiptionId\r\n\t* FxpFeedbackService.getSubsctiptionId();\r\n\t*/\r\n\tgetSubscriprtionId = function () {\r\n\t\tvar self = this;\r\n\t\treturn self._subscriprtionId;\r\n\t};\r\n\r\n\t/**\r\n\t* sets addToFeedbackPropBag of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.addToFeedbackPropBag\r\n\t* @param {string} key a object key.\r\n\t* @param {string} value a object value.\r\n\t* @example Example to invoke addToFeedbackPropBag\r\n\t* FxpFeedbackService.addToFeedbackPropBag('key','value');\r\n\t*/\r\n\taddToFeedbackPropBag = function (key, value) {\r\n\t\tvar self = this;\r\n\t\tself.feedbackPropBag[key] = value;\r\n\t};\r\n\t/**\r\n\t* sets getFeedbackPropBagItems of FeedbackService Context Object\r\n\t* @method Feedback.FeedbackWidgetContextService.getItems\r\n\t* @example Example to invoke getFeedbackPropBagItems\r\n\t* FxpFeedbackService.getFeedbackPropBagItems();\r\n\t*/\r\n\tgetFeedbackPropBagItems = function () {\r\n\t\tvar self = this;\r\n\t\treturn self.feedbackPropBag;\r\n\t};\r\n\t/**\r\n\t * sets addFeedbackPropBagRange of FeedbackService Context Object\r\n\t * @method Fxp.Services.FxpFeedbackService.addRange\r\n\t * @param { object } properties is collection of properties like object.\r\n\t * @example Example to invoke addFeedbackPropBagRange\r\n\t * FxpFeedbackService.addFeedbackPropBagRange('xxxxxx');\r\n\t */\r\n\taddFeedbackPropBagRange = function (properties) {\r\n\t\tvar self = this;\r\n\t\tfor (var property in properties) {\r\n\t\t\tself.addToFeedbackPropBag(property, properties[property]);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * removeFeedbackPropBagRange of FeedbackService Context Object\r\n\t * @method Fxp.Services.FxpFeedbackService.removeFeedbackPropBagRange\r\n\t * @example Example to invoke addRange\r\n\t * FxpFeedbackService.removeFeedbackPropBagRange();\r\n\t */\r\n\tremoveFeedbackPropBagRange = function () {\r\n\t\tvar self = this;\r\n\t\tif (self.feedbackPropBag)\r\n\t\t\tself.feedbackPropBag = {};\r\n\t};\r\n\r\n\t/**\r\n\t* sets removeFromFeedbackPropBag of FeedbackService Context Object\r\n\t* @method Fxp.Services.FxpFeedbackService.removeFromFeedbackPropBag\r\n\t* @param {string} key a property key.\r\n\t* @example Example to invoke key\r\n\t* FxpFeedbackService.removeFromFeedbackPropBag('xxxxxx');\r\n\t*/\r\n\tremoveFromFeedbackPropBag = function (key) {\r\n\t\tvar self = this;\r\n\t\tdelete self.feedbackPropBag[key];\r\n\t};\r\n\r\n\r\n\t/**\r\n\t*A method to use the log the UserFeedback Information.\r\n\t* @method Fxp.Services.FxpFeedbackService.logFeedbackInformation\r\n\t* @param {feedbackInfo } toState feedbackInfo.\r\n\t* @param {feedbackStatusInfo } toState feedbackStatusInfo.\r\n\t* @param {status } toState status.\r\n\t* @param {error } toState error.\r\n\t* @example Example to use logFeedbackInformation\r\n\t* logFeedbackInformation(feedbackInfo: any, feedbackStatusInfo: string, status: string, error: any)\r\n\t*/\r\n\tlogFeedbackInformation(feedbackInfo: any, feedbackStatusInfo: string, status: string, error: any): void {\r\n\t\tvar self = this, propBag;\r\n\t\tconst telemetry_source = `${this.sourceForTelemetry}.LogFeedbackInformation`;\r\n\t\tpropBag = self.fxplogger.createPropertyBag();\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.UserUPN, feedbackInfo.userId);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.UserBusinessRole, feedbackInfo.tags.BusinessRole);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.UserRoleGroup, feedbackInfo.tags.RoleGroupName);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.LoggedinUserName, feedbackInfo.tags.UserName);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.BrowserPageTitle, feedbackInfo.tags.BrowserPageTitle);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.FeedbackType, feedbackInfo.feedbackType);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.Action, feedbackInfo.tags.Action);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.UserFeedback, feedbackInfo.feedback);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.BrowserType, feedbackInfo.tags.BrowserType);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.BrowserVersion, feedbackInfo.tags.BrowserVersion);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.OperatingSystem, feedbackInfo.tags.OperatingSystem);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.ScreenRoute, feedbackInfo.tags.ScreenRoute);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.DeviceType, feedbackInfo.tags.DeviceType);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.TotalDuration, feedbackInfo.TotalDuration);\r\n\t\tpropBag.addToBag(FxpConstants.metricConstants.UIRenderDuration, feedbackInfo.UIRenderDuration);\r\n\r\n\t\tif (self.userInfoService.isActingOnBehalfOf()) {\r\n\t\t\tpropBag.addToBag(FxpConstants.metricConstants.OBOUserUPN, feedbackInfo.tags.OBOUserUPN);\r\n\t\t\tpropBag.addToBag(FxpConstants.metricConstants.OBOUserName, feedbackInfo.tags.OBOUserName);\r\n\t\t\tpropBag.addToBag(FxpConstants.metricConstants.OBOUserBusinessRole, feedbackInfo.tags.OBOUserBusinessRole);\r\n\t\t\tpropBag.addToBag(FxpConstants.metricConstants.OBOUserRoleGroupName, feedbackInfo.tags.OBOUserRoleGroupName);\r\n\t\t}\r\n\r\n\t\tif (status === FxpConstants.messageType.success)\r\n\t\t\tself.fxplogger.logInformation(telemetry_source, feedbackStatusInfo, propBag);\r\n\r\n\t\tif (status === FxpConstants.messageType.error)\r\n\t\t\tself.fxplogger.logError(telemetry_source, feedbackStatusInfo + \". Error Message: \" + error, ErrorCodes.FeedbackService_Error, null, propBag, null, null, ErrorSeverityLevel.Medium);\r\n\t}\r\n}\r\n","import { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n//import { Observable , from as fromPromise } from 'rxjs';\r\n\r\nexport class FxpHttpService implements IFxPService {\r\n constructor(private $http: angular.IHttpService) {\r\n }\r\n\r\n private toEs6Promise(qPromise: any) {\r\n return new Promise(function (resolve, reject) {\r\n qPromise.then(function (response) {\r\n resolve(response);\r\n }).catch(function (reason) {\r\n reject(reason);\r\n })\r\n });\r\n }\r\n get(url: string, headers?: any, responseType?: string): Promise {\r\n var self = this;\r\n return this.toEs6Promise(self.$http.get(url, { headers: headers, responseType: responseType }));\r\n }\r\n put(url: string, data: any, headers?: any): Promise {\r\n var self = this;\r\n return this.toEs6Promise(self.$http.put(url, data, { headers: headers }));\r\n }\r\n patch(url: string, data: any, headers?: any): Promise {\r\n var self = this;\r\n return this.toEs6Promise(self.$http.patch(url, data, { headers: headers }));\r\n }\r\n post(url: string, data: any, headers?: any, responseType?: string): Promise {\r\n var self = this;\r\n return this.toEs6Promise(self.$http.post(url, data, { headers: headers, responseType: responseType }));\r\n }\r\n jsonp(url: string, data: any, headers?: any): Promise {\r\n var self = this;\r\n return this.toEs6Promise(self.$http.jsonp(url, { headers: headers }));\r\n }\r\n delete(url: string, headers?: any, data?: any): Promise {\r\n var self = this;\r\n if (data) {\r\n return this.toEs6Promise(self.$http({ method: 'DELETE', url: url, data: data, headers: headers}));\r\n }\r\n\r\n return this.toEs6Promise(self.$http.delete(url, { headers: headers }));\r\n }\r\n head(url: string, headers?: any): Promise {\r\n var self = this;\r\n return this.toEs6Promise(self.$http.head(url, { headers: headers }));\r\n }\r\n}\r\n","import { FxpEventBroadCastService } from \"./BroadCastingService\";\r\nimport { FxpBroadcastedEvents } from './FxpBroadcastedEvents';\r\n\r\n\r\nexport class FxpIrisBotService {\r\n\r\n constructor(private fxpEventBroadCastService: FxpEventBroadCastService) {\r\n\r\n }\r\n\r\n launchIrisBot() {\r\n this.fxpEventBroadCastService.broadCast( FxpBroadcastedEvents.OnLaunchIrisBot , \"Launch Bot\");\r\n }\r\n\r\n hideIrisBot() {\r\n this.fxpEventBroadCastService.broadCast( FxpBroadcastedEvents.OnHideIrisBot, \"Hide Bot\");\r\n }\r\n \r\n}","import { ILogger } from \"../interfaces/ILogger\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { IOCVSource } from \"../common/enum/Feedback.enum\";\r\nimport { IOCVFeedbackPayload } from \"../interfaces/IOCVFeedbackPayload\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { FxpHttpService } from \"./FxpHttpService\";\r\nimport { IFxpFeedbackMessage } from \"../interfaces/IFxpFeedbackMessage\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { FxpGlobalStoreService } from \"./fxp.global.store.service\";\r\n\r\nexport class FxpOCVFeedbackService {\r\n\r\n private fxplogger: ILogger;\r\n private fxpHttpService: FxpHttpService;\r\n private fxpConfigService: FxpConfigurationService;\r\n\r\n constructor(loggerService: ILogger, private globalStore: FxpGlobalStoreService, fxpHttpService: FxpHttpService, fxpConfigurationService: FxpConfigurationService) {\r\n\t\tthis.fxplogger = loggerService;\r\n this.fxpHttpService = fxpHttpService;\r\n this.fxpConfigService = fxpConfigurationService;\r\n }\r\n \r\n public SubmitFeedback(feedbackMessage: IFxpFeedbackMessage) : Promise {\r\n let feedbackPayload: IOCVFeedbackPayload = {\r\n manifestType: feedbackMessage.feedbackManifestType,\r\n appId: this.fxpConfigService.FxpAppSettings.OCVAppId,\r\n submitTime: new Date().toISOString(),\r\n source: IOCVSource.Client,\r\n type: feedbackMessage.feedbackType,\r\n rating: feedbackMessage.rating,\r\n clientFeedbackId: CommonUtils.getNewGuId(),\r\n comment: feedbackMessage.feedbackMessage,\r\n email: feedbackMessage.email,\r\n application: {\r\n appData: feedbackMessage.appData\r\n },\r\n telemetry: {\r\n loggableUserId: this.globalStore.GetPlatformState().CurrentUser.Claims.aadObjectId,\r\n featureArea: feedbackMessage.partnerName,\r\n officeBuild: this.fxpConfigService.FxpAppSettings.BuildNumber,\r\n tenantId: this.fxpConfigService.FxpAppSettings.TenantId\r\n },\r\n survey: {\r\n surveyId: feedbackMessage.surveyId\r\n },\r\n web: {\r\n browser: navigator[\"browserDetails\"] ? navigator[\"browserDetails\"].name : \"\",\r\n browserVersion: navigator[\"browserDetails\"] ? navigator[\"browserDetails\"].version : \"\",\r\n sourcePageName: document.getElementsByTagName(\"title\")[0].innerHTML,\r\n sourcePageURI: window.location.href\r\n }\r\n };\r\n return this.sendFeedback(feedbackPayload);\r\n }\r\n\r\n private sendFeedback(feedbackPayload: IOCVFeedbackPayload) : Promise\r\n { \r\n let url = this.fxpConfigService.FxpAppSettings.FeedbackOCVEndpoint;\r\n let requestHeaders = {};\r\n requestHeaders[\"Content-Type\"] = \"application/json\";\r\n return this.fxpHttpService.post(url, feedbackPayload, requestHeaders);\r\n }\r\n}","import { IFxpHttpInterceptorHook } from './../interfaces/IFxpHttpInterceptorHook'; \r\nimport { IFxPService } from '../interfaces/IFxpService';\r\nexport class FxpPartnerHttpInterceptorHooks implements IFxPService {\r\n \r\n\tprotected _interceptorHooks : Array = [];\r\n\t\r\n\tRegisterInterceptorHook = function(httpInterceptorHookInstance: IFxpHttpInterceptorHook):void {\r\n\t\tif (this._interceptorHooks.indexOf(httpInterceptorHookInstance)>=0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._interceptorHooks.push(httpInterceptorHookInstance); \r\n\t}\r\n\tUnRegisterInterceptorHook =function(httpInterceptorHookInstance: IFxpHttpInterceptorHook):void {\r\n\t\tconst index = this._interceptorHooks.indexOf(httpInterceptorHookInstance);\r\n\t\tthis._interceptorHooks.splice(index, 1); \r\n\t}\r\n\r\n\tgetRegisteredInterceptorHooks=function(): Array{\r\n\t\treturn this._interceptorHooks;\r\n\t}\r\n}\r\n\r\n","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { FxpBreadcrumbService } from \"./FxpBreadcrumbService\";\r\nimport { FxpConstants } from \"../common/ApplicationConstants\";\r\nimport { Resiliency } from \"../resiliency/FxpResiliency\";\r\nimport { UserProfileService } from \"./userProfileService\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { StateService, TransitionOptions } from \"@uirouter/core\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to connect to user Route users to their configured URLs\r\n * @class Fxp.Services.FxpRouteService\r\n * @classdesc A service to Route users to their configured URLs\r\n * @example Example to create an instance of Fxp Route Service\r\n * //Initializing Fxp Route Service\r\n * angular.module('FxPApp').controller('AppController', ['FxpRouteService', AppController]);\r\n * function AppController(FxpRouteService){ FxpRouteService.getAllStates(); }\r\n */\r\nexport class FxpRouteService implements IFxPService{\r\n\tprivate stateGo: StateService;\r\n\tprivate rootScope: IRootScope;\r\n\tprivate fxplogger: ILogger;\r\n\tprivate userProfileService: UserProfileService;\r\n\tprivate userInfoService: UserInfoService;\r\n\tprivate fxpBreadcrumbService: FxpBreadcrumbService;\r\n\tprivate defaultStateName: string;\r\n\tconstructor($state: StateService, $rootScope: IRootScope, loggerService: ILogger, userProfileService: UserProfileService, userInfoService: UserInfoService, fxpBreadcrumbService: FxpBreadcrumbService) {\r\n\t\tthis.stateGo = $state;\r\n\t\tthis.rootScope = $rootScope;\r\n\t\tthis.userProfileService = userProfileService;\r\n\t\tthis.userInfoService = userInfoService;\r\n\t\tthis.fxplogger = loggerService;\r\n\t\tthis.fxpBreadcrumbService = fxpBreadcrumbService;\r\n\t\tif (this.rootScope.isNewTabAllowed === undefined) {\r\n\t\t\tthis.rootScope.isNewTabAllowed = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* Gets List of States from URL State Provider\r\n\t* @method Fxp.Services.FxpRouteService.getAllStates\r\n\t* @example Example to invoke getAllStates\r\n\t* FxpRouteService.getAllStates();\r\n\t*/\r\n\tgetAllStates = function (): any {\r\n\t\tvar statesList = [];\r\n\t\tfor (var i = 0; i < this.states.length; i++) {\r\n\t\t\tstatesList.push(this.states[i].name);\r\n\t\t}\r\n\t\treturn statesList;\r\n\t}\r\n\r\n\tget states():any {\r\n\t\treturn this.stateGo.get();\r\n\t}\r\n\r\n\t/**\r\n\t* Gets URL of mentioned state from URL State Provider\r\n\t* @method Fxp.Services.FxpRouteService.getURLfromState\r\n\t* @param statename {string} a mandatory string value.\r\n\t* @param params {any} $state parameters values\r\n\t* @param options {any} an options values.\r\n\t* @example Example to invoke getURLfromState\r\n\t* FxpRouteService.getURLfromState(stateOrName [, params] [, options]);\r\n\t* FxpRouteService.getURLfromState($state.current.name, $state.params, {absolute: true});\r\n\t*/\r\n\tgetURLfromState = function (statename: string, params?: any, options?: any) {\r\n\t\tfor (var i = 0; i < this.states.length; i++) {\r\n\t\t\tif (this.states[i].name == statename)\r\n\t\t\t\treturn this.stateGo.href(this.states[i].name, params, options);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t* @deprecated Use new method FxpRouteService.navigatetoNewWindow('Home')\r\n\t*/\r\n\tnavigatetoState = function (statename: string) {\r\n\t\tconsole.warn(\"This method has been deprecated.Please use navigatetoNewWindow(statename) \");\r\n\t\tthis.navigatetoNewWindow(statename);\r\n\t}\r\n\t/**\r\n\t* Open a New Browser Window of mentioned state by Picking URL from URL State Provider\r\n\t* @method Fxp.Services.FxpRouteService.navigatetoNewWindow\r\n\t* @param {string} a mandatory string value.\r\n\t* @example Example to invoke navigatetoNewWindow\r\n\t* FxpRouteService.navigatetoNewWindow('Home');\r\n\t*/\r\n\r\n\tnavigatetoNewWindow = function (statename: string) {\r\n\r\n\t\t//Check if the requested state is missing any dependencies.\r\n\t\tif (Resiliency.statesWithMissingModules && Resiliency.statesWithMissingModules.indexOf(statename) > -1) {\r\n\t\t\tthrow new Error('The requested state cannot be navigated due to missing dependencies.');\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this.states.length; i++) {\r\n\t\t\tif (this.states[i].name == statename) {\r\n\t\t\t\twindow.open(\"#\" + this.states[i].url, \"Popup\", \"location=1,status=1,scrollbars=1, resizable=1, directories=1, toolbar=1, titlebar=1, width=\" + screen.width + \", height=\" + screen.height);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t/**\r\n * Navigates to a the specific state which is passed as a parameter,also can pass optional parameters like params,target,features,replace\r\n * @method Fxp.Services.FxpRouteService.navigatetoSpecificState\r\n * @param {string} statename string specifies the name of the state.\r\n * @param {any} params any specifies the object.\r\n * @param {TransitionOptions} transitionOptions TransitionOptions specifies the options.\r\n\r\n * @example Example to invoke navigatetoSpecificState\r\n * FxpRouteService.navigatetoSpecificState('Home');\r\n */\r\n\tnavigatetoSpecificState = function (statename: string, params?: any, transitionOptions?: TransitionOptions) {\r\n\r\n\t\t//Check if the requested state is missing any dependencies.\r\n\t\tif (Resiliency.statesWithMissingModules && Resiliency.statesWithMissingModules.indexOf(statename) > -1) {\r\n\t\t\tthrow new Error('The requested state cannot be navigated due to missing dependencies.');\r\n\t\t}\r\n\r\n if (params !== undefined && params !== null && transitionOptions !== undefined && transitionOptions !== null)\r\n this.stateGo.go(statename, params, transitionOptions);\r\n\t\telse if (params !== undefined && params !== null)\r\n\t\t\tthis.stateGo.go(statename, params);\r\n\t\telse\r\n\t\t\tthis.stateGo.go(statename);\r\n\t}\r\n\r\n\t/**\r\n\t* Navigates to a the specific URL which is passed as a parameter,also can pass optional parameters like target,features,replace\r\n\t* @method Fxp.Services.FxpRouteService.navigateToSpecificUrl\r\n\t* @param {string} url string that specifies the URL of the document to display.\r\n\t* @param {string} target string that specifies the name of the window.\r\n\t* @param {string} features string that contains a list of items separated by commas.\r\n\t* @param {boolean} replace boolean that specifies whether the url creates a new entry or replaces the current entry in the window's history list.\r\n\t* @example Example to invoke navigateToSpecificUrl\r\n\t* FxpRouteService.navigateToSpecificUrl('#/Home');\r\n\t*/\r\n\tnavigateToSpecificUrl = function (url: string, target?: string, features?: string, replace?: boolean) {\r\n\t\tvar self = this;\r\n\t\tself.navigateToUrl(url, target, features, replace);\r\n\t}\r\n\r\n\t/**\r\n\t* Navigates to a the URL which is passed as a parameter,also can pass optional parameters like target,features,replace\r\n\t* @method Fxp.Services.FxpRouteService.navigateToSpecificUrl\r\n\t* @param {string} url string that specifies the URL of the document to display.\r\n\t* @param {string} target string that specifies the name of the window.\r\n\t* @param {string} features string that contains a list of items separated by commas.\r\n\t* @param {boolean} replace boolean that specifies whether the url creates a new entry or replaces the current entry in the window's history list.\r\n\t* @example Example to invoke navigateToUrl\r\n\t* FxpRouteService.navigateToUrl('#/Home');\r\n\t*/\r\n\tprivate navigateToUrl(url: string, target?: string, features?: string, replace?: boolean) {\r\n\t\tvar self = this;\r\n\t\ttarget = self.rootScope.isNewTabAllowed && target != undefined ? target : \"_self\";\r\n\t\tfeatures = features || \"\";\r\n\t\treplace = replace || false;\r\n\t\tif (target === \"_blank\") {\r\n\t\t\tself.fxpBreadcrumbService.setTempBreadcrumbArray(url);\r\n\t\t}\r\n\t\twindow.open(url, target, features, replace);\r\n\t}\r\n\r\n\t/**\r\n\t* getDefaultStateName\r\n\t* @method Fxp.Services.FxpRouteService.getDefaultStateName\r\n\t* @example Example to invoke getDefaultStateName\r\n\t* FxpRouteService.getDefaultStateName();\r\n\t*/\r\n\tgetDefaultStateName = function () {\r\n\t\treturn this.defaultStateName;\r\n\t}\r\n\r\n\t/**\r\n\t* setDefaultStateName\r\n\t* @method Fxp.Services.FxpRouteService.setDefaultStateName\r\n\t* @param {string} value mandatory string value to set as default StateName.\r\n\t* @example Example to invoke setDefaultStateName\r\n\t* FxpRouteService.setDefaultStateName('Home');\r\n\t*/\r\n\tsetDefaultStateName = function (value: string) {\r\n\t\tthis.defaultStateName = value;\r\n\t}\r\n\r\n\t/**\r\n\t* getStateDetails\r\n\t* @method Fxp.Services.FxpRouteService.getStateDetails\r\n\t* @param {string} value mandatory string value to get the state details.\r\n\t* @example Example to invoke getStateDetails\r\n\t* FxpRouteService.getStateDetails('Home');\r\n\t*/\r\n\tgetStateDetails = function (stateName: string) {\r\n\t\treturn this.states.find((item) => (item.name == stateName));\r\n\t}\r\n\r\n\t/**\r\n\t* getCurrentStateDetails\r\n\t* @method Fxp.Services.FxpRouteService.getCurrentStateDetails\r\n\t* @example Example to invoke getCurrentStateDetails\r\n\t* FxpRouteService.getCurrentStateDetails();\r\n\t*/\r\n\tgetCurrentStateDetails = function () {\r\n\t\treturn this.getStateDetails(this.stateGo.current.name);\r\n\t}\r\n}\r\n","import { HubConnection, HubConnectionBuilder, HubConnectionState } from '@microsoft/signalr';\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { SystemEvent } from \"./../telemetry/SystemEvent\";\r\nimport { ComponentType } from \"@microsoftit/telemetry-extensions-npm\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n\r\n\r\nexport class FxpSignalRService {\r\n private connection: HubConnection;\r\n private signalRServiceEndPoint: string;\r\n private listeners = {};\r\n private connectionPromise: Promise = null;\r\n private pingTimeOutRef = null;\r\n private pingInterval = 10; //default value 10 mins\r\n private processName: string;\r\n private signalREventName: string;\r\n private readonly sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpSignalRService`;\r\n\r\n constructor(\r\n protected logger: ILogger,\r\n private fxpConfigurationService: FxpConfigurationService,\r\n private msalAuthenticationService: MsalAuthenticationService\r\n ) {\r\n this.signalRServiceEndPoint = fxpConfigurationService.FxpAppSettings.SignalRPlatformEndPoint;\r\n this.processName = TelemetryConstants.FXP_TELEMETRY_BASE_NAME + \".SignalRClient\";\r\n this.signalREventName = \"SignalREventName\";\r\n\r\n if (Number.isInteger(fxpConfigurationService.FxpAppSettings.SignalRPlatformPingIntervalInMinutes)){\r\n this.pingInterval = fxpConfigurationService.FxpAppSettings.SignalRPlatformPingIntervalInMinutes;\r\n }\r\n this.pingInterval = this.pingInterval * 60 * 1000;\r\n\r\n }\r\n\r\n\r\n private setupPingForSignalServer() {\r\n const self = this;\r\n self.ping();\r\n self.nextLoad();\r\n }\r\n\r\n cancelNextLoad() {\r\n const self = this;\r\n if (self.pingTimeOutRef) {\r\n clearTimeout(self.pingTimeOutRef);\r\n self.pingTimeOutRef = null;\r\n }\r\n };\r\n\r\n nextLoad() {\r\n const self = this;\r\n self.cancelNextLoad();\r\n self.pingTimeOutRef = setTimeout(self.setupPingForSignalServer.bind(self), self.pingInterval);\r\n };\r\n\r\n private ping(): void {\r\n this.sendMessage(\"ping\", \"ping server\");\r\n }\r\n\r\n private connect(): Promise {\r\n const self = this;\r\n\r\n return new Promise((resolve, reject) => {\r\n if (self.connection && self.connection.state === HubConnectionState.Connected) {\r\n resolve();\r\n let currentProcessName = this.processName + '.SignalServerConnected';\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'SignalServer Connection Created');\r\n let customProperties = this.logger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"FxpSignalRClient\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"connect\");\r\n this.logger.logSystemEvent(this.sourceForTelemetry, eventData, customProperties);\r\n\r\n return;\r\n }\r\n self.setupConnection().then(() => {\r\n resolve();\r\n });\r\n });\r\n }\r\n\r\n private disconnect(): void {\r\n if (this.connection && this.connection.state === HubConnectionState.Connected) {\r\n this.connection.stop()\r\n .then(() => {\r\n let currentProcessName = this.processName + '.SignalServerDisconnected';\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'SignalServer disconnected');\r\n let customProperties = this.logger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"FxpSignalRClient\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"disconnect\");\r\n this.logger.logSystemEvent(this.sourceForTelemetry, eventData, customProperties);\r\n })\r\n .catch(error => {\r\n this.logger.logException(this.sourceForTelemetry, error, null, null, null, ErrorSeverityLevel.Low, ErrorCodes.SignalR_ErrorOnDisconnect);\r\n });\r\n };\r\n\r\n }\r\n\r\n private sendMessage(methodName: string, ...args): Promise {\r\n return this.connection.send(methodName, args)\r\n .catch(error => {\r\n this.logger.logException(this.sourceForTelemetry, error, null, null, null, ErrorSeverityLevel.Medium, ErrorCodes.SignalR_ErrorOnMessageSend);\r\n });\r\n }\r\n\r\n private joinGroup(groupName: string, tenantName: string, environment: string): Promise {\r\n try {\r\n if(environment)\r\n return this.sendMessage(\"joinGroup\", groupName, tenantName, environment);\r\n else\r\n return this.sendMessage(\"joinGroup\", groupName, tenantName);\r\n }\r\n catch (error) {\r\n this.logger.logException(this.sourceForTelemetry, error, null, null, null, ErrorSeverityLevel.High, ErrorCodes.SignalR_ErrorOnJoinGroup);\r\n }\r\n }\r\n\r\n private leaveGroup(groupName: string, tenantName: string, environment: string): Promise {\r\n try {\r\n if(environment)\r\n return this.sendMessage(\"leaveGroup\", groupName, tenantName, environment);\r\n else\r\n return this.sendMessage(\"leaveGroup\", groupName, tenantName);\r\n\r\n }\r\n catch (error) {\r\n this.logger.logException(this.sourceForTelemetry, error, null, null, null, ErrorSeverityLevel.Medium, ErrorCodes.SignalR_ErrorOnLeaveGroup);\r\n }\r\n }\r\n\r\n subscribe(eventName, tenantName: string, callBack: any) {\r\n const self = this;\r\n const environment = this.fxpConfigurationService.FxpAppSettings.EnvironmentName;\r\n this.connect().then(() => {\r\n self.joinGroup(eventName, tenantName, environment);\r\n if (!self.listeners.hasOwnProperty(eventName)) {\r\n self.listeners[eventName] = [];\r\n }\r\n self.listeners[eventName].push(callBack);\r\n let currentProcessName = this.processName + '.SubscribeEvent.' + eventName;\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, `Subscribed to event: ${eventName}`);\r\n let customProperties = this.logger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"FxpSignalRClient\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"subscribe\");\r\n customProperties.addToBag(this.signalREventName, eventName);\r\n this.logger.logSystemEvent(this.sourceForTelemetry, eventData, customProperties);\r\n\r\n });\r\n\r\n return function () {\r\n self.unsubscribe(eventName, tenantName, callBack, environment);\r\n\r\n }\r\n }\r\n\r\n private unsubscribe(eventName, tenantName: string, callBack: any, environment: string = null) {\r\n this.leaveGroup(eventName, tenantName, environment);\r\n\r\n let currentProcessName = this.processName + '.UnSubscribeEvent.' + eventName;\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, `UnSubscribed to event: ${eventName}`);\r\n let customProperties = this.logger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"FxpSignalRClient\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"unsubscribe\");\r\n customProperties.addToBag(this.signalREventName, eventName);\r\n this.logger.logSystemEvent(this.sourceForTelemetry, eventData, customProperties);\r\n\r\n if (!this.listeners.hasOwnProperty(eventName)) {\r\n return;\r\n }\r\n this.listeners[eventName] = this.listeners[eventName].filter(x => x != callBack);\r\n if (this.listeners[eventName].length === 0) {\r\n delete this.listeners[eventName];\r\n }\r\n if (Object.keys(this.listeners).length === 0) {\r\n this.disconnect();\r\n }\r\n }\r\n\r\n unsubscribeAll() {\r\n this.listeners = {};\r\n this.disconnect();\r\n }\r\n\r\n private onMessageFromServer(eventName: string, messageData: any) {\r\n if (eventName === \"pingResponse\") {\r\n return;\r\n }\r\n\r\n let currentProcessName = this.processName + '.MessageFromServer.' + eventName;\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, `Message from SignalR Server for event: ${eventName}`);\r\n let customProperties = this.logger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"FxpSignalRClient\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"onMessageFromServer\");\r\n customProperties.addToBag(this.signalREventName, eventName);\r\n this.logger.logSystemEvent(this.sourceForTelemetry, eventData, customProperties);\r\n\r\n if (this.listeners.hasOwnProperty(eventName)) {\r\n const callBackFunctions = this.listeners[eventName];\r\n if (callBackFunctions.length > 0) {\r\n callBackFunctions.forEach(callbackFunc => {\r\n callbackFunc(messageData);\r\n });\r\n }\r\n }\r\n }\r\n\r\n private setupConnection(): Promise {\r\n const self = this;\r\n const resource = self.fxpConfigurationService.FxpAppSettings.SignalRPlatformClientId;\r\n\r\n if (self.connectionPromise) {\r\n return self.connectionPromise;\r\n }\r\n self.connection = new HubConnectionBuilder()\r\n .withUrl(self.signalRServiceEndPoint, { accessTokenFactory: async ()=>{\r\n let token;\r\n await this.msalAuthenticationService.getTokenForAppIdAsync(resource).then(function (accesstoken) {\r\n token = accesstoken;\r\n })\r\n return token;\r\n } })\r\n .withAutomaticReconnect()\r\n .build();\r\n\r\n self.connection.onreconnecting(error => {\r\n if(self.connection.state === HubConnectionState.Reconnecting){\r\n self.logger.logEvent(this.sourceForTelemetry, `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SignalRReconnecting`)\r\n }\r\n });\r\n\r\n self.connection.onreconnected(connectionId => {\r\n if(self.connection.state === HubConnectionState.Connected){\r\n self.logger.logEvent(this.sourceForTelemetry, `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SignalRReconnected`)\r\n }\r\n });\r\n self.connection.onclose(error => {\r\n if (self.connection.state === HubConnectionState.Disconnected) {\r\n self.logger.logEvent(this.sourceForTelemetry, `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SignalRDisconnected`)\r\n }\r\n });\r\n\r\n self.connectionPromise = self.connection.start().then(() => {\r\n self.connection.on('eventFromServer', self.onMessageFromServer.bind(self));\r\n self.connectionPromise = null;\r\n self.setupPingForSignalServer();\r\n self.logger.logEvent(this.sourceForTelemetry, `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.SignalRConnected`)\r\n\r\n })\r\n .catch(error => {\r\n // Logging disabled to reduce noise\r\n // self.logger.logException(this.sourceForTelemetry, error, null, null, null, ErrorSeverityLevel.High, ErrorCodes.SignalR_ErrorOnConnection);\r\n })\r\n return self.connectionPromise;\r\n\r\n }\r\n\r\n}\r\n","import { Subject } from \"rxjs\";\r\nimport { StateService } from \"@uirouter/core\";\r\nimport { SyncRoutes } from \"@fxp/staterouter\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpConstants } from \"../common/ApplicationConstants\";\r\nimport { FxpGlobalStoreService } from \"./fxp.global.store.service\";\r\nimport { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { FxpBroadcastedEvents } from \"./FxpBroadcastedEvents\";\r\n//import { FxpLoggerService } from './../telemetry/FxpLogger';\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { FeatureUsageEvent } from \"../telemetry/FeatureUsageEvent\";\r\nimport {\r\n ActionStatus,\r\n ActionType,\r\n ComponentType,\r\n EventName,\r\n} from \"@microsoftit/telemetry-extensions-npm\";\r\nimport { FxpLoggerService } from \"../telemetry/fxpLogger\";\r\nimport { LogMetricBag } from \"../telemetry/LogMetricBag\";\r\nimport { LogPropertyBag } from \"../telemetry/LogPropertyBag\";\r\n\r\nexport class FxpStateTransitionService implements IFxPService {\r\n private $transitions;\r\n private subjects: any = [];\r\n private $rootScope: IRootScope;\r\n constructor(\r\n $rootScope: IRootScope,\r\n private $injector: angular.auto.IInjectorService,\r\n private stateService: StateService,\r\n private globalStore: FxpGlobalStoreService,\r\n private logger: FxpLoggerService\r\n ) {\r\n this.$transitions = this.$injector.get(\"$transitions\");\r\n this.$transitions.onStart({}, this.onStartStateChangeHandler.bind(this));\r\n this.$transitions.onSuccess(\r\n {},\r\n this.onSuccessStateChangeHandler.bind(this)\r\n );\r\n this.$transitions.onError({}, this.onErrorStateChangeHandler.bind(this));\r\n this.stateService.onInvalid(this.onInvalidStateHandler.bind(this));\r\n this.$rootScope = $rootScope;\r\n this.subjects = [\r\n { id: FxpConstants.StateEvents.OnStart, subject: new Subject() },\r\n { id: FxpConstants.StateEvents.onSuccess, subject: new Subject() },\r\n { id: FxpConstants.StateEvents.onError, subject: new Subject() },\r\n { id: FxpConstants.StateEvents.onInvalid, subject: new Subject() },\r\n ];\r\n }\r\n\r\n onStartStateChangeHandler(transition: any): void {\r\n const self = this;\r\n self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.OnStart)[0]\r\n .subject.next(self.getStateInfo(transition));\r\n }\r\n\r\n onSuccessStateChangeHandler(transition: any): void {\r\n const self = this;\r\n self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.onSuccess)[0]\r\n .subject.next(self.getStateInfo(transition));\r\n const syncRouteAction = SyncRoutes({\r\n $current: this.stateService.$current,\r\n params: this.stateService.params,\r\n });\r\n this.globalStore.DispatchGlobalAction(\r\n \"Fxp.FxpStateTransitionService\",\r\n syncRouteAction\r\n );\r\n self.$rootScope.$broadcast(\r\n FxpBroadcastedEvents.OnLeftNavHighlightByStateName,\r\n transition.to().name\r\n );\r\n this.logFeatureUsageEventForState(transition);\r\n this.logPageView(transition);\r\n }\r\n\r\n private logPageView(transition: any) {\r\n const currentState = transition.to();\r\n const appName =\r\n currentState.data.appNameForTelemetry ||\r\n currentState.data.partnerTelemetryName;\r\n const pageName =\r\n currentState.data.pageNameForTelemetry ||\r\n currentState.data.breadcrumbText;\r\n const telemetryName =\r\n currentState.data.partnerTelemetryName ||\r\n TelemetryConstants.FXP_TELEMETRY_BASE_NAME;\r\n let displayNameForPageView = \"\";\r\n if (pageName && appName) {\r\n displayNameForPageView = `${appName}.${pageName}`;\r\n } else {\r\n displayNameForPageView = currentState.data.headerName;\r\n }\r\n const startTime = parseFloat(this.$rootScope.stateChangeStartTime);\r\n let duration = 0;\r\n if (!isNaN(startTime) || startTime !== 0) {\r\n duration = (performance.now() - startTime) / 1000;\r\n }\r\n const measurements = this.logger.createMetricBag();\r\n const properties = this.logger.createPropertyBag();\r\n\r\n properties.addToBag(\r\n TelemetryConstants.LOGGING_SOURCE,\r\n `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpStateTransitionService.logFeatureUsageEventForState`\r\n );\r\n properties.addToBag(\"Unit\", \"Seconds\");\r\n measurements.addToBag(\"StateTransitionTime\", duration);\r\n this.logger.logPageView(\r\n telemetryName,\r\n displayNameForPageView,\r\n window.location.href,\r\n properties,\r\n measurements,\r\n duration\r\n );\r\n }\r\n\r\n private logFeatureUsageEventForState(transition: any) {\r\n const currentState = transition.to();\r\n const appName = currentState.data.appNameForTelemetry;\r\n const featureName = currentState.data.featureName;\r\n const subFeatureName = currentState.data.subFeatureName;\r\n const actionName = currentState.data.actionName;\r\n const telemetryName =\r\n currentState.data.partnerTelemetryName ||\r\n TelemetryConstants.FXP_TELEMETRY_BASE_NAME;\r\n const fromState = transition.from();\r\n let previousFeatureName = \"\",\r\n previousAppName: \"\",\r\n previousSubFeatureName = \"\";\r\n if (fromState && fromState.data) {\r\n previousFeatureName = fromState.data.featureName;\r\n previousAppName = fromState.data.appNameForTelemetry;\r\n previousSubFeatureName = fromState.data.subFeatureName;\r\n }\r\n let displayFeatureName = \"\";\r\n if (!CommonUtils.isNullOrEmpty(featureName)) {\r\n displayFeatureName = `${appName}.${featureName}`;\r\n if (!CommonUtils.isNullOrEmpty(subFeatureName)) {\r\n displayFeatureName = `${displayFeatureName}.${subFeatureName}`;\r\n if (\r\n !CommonUtils.isNullOrEmpty(featureName) &&\r\n previousFeatureName === featureName\r\n ) {\r\n this.logger.renewSubCorrelationId();\r\n } else {\r\n this.logger.renewCorrelationId();\r\n }\r\n } else {\r\n this.logger.renewCorrelationId();\r\n }\r\n //TODO: May be we can create featureusageevent object and set subfeature instead of playing with strings.\r\n const featureUsageEvent = new FeatureUsageEvent(\r\n displayFeatureName,\r\n ActionType.User,\r\n actionName,\r\n EventName.PageLoad,\r\n ComponentType.Web\r\n );\r\n featureUsageEvent.SubFeatureName = subFeatureName;\r\n featureUsageEvent.ActionStatus = ActionStatus.Succeeded;\r\n const properties = this.logger.createPropertyBag();\r\n properties.addToBag(\r\n TelemetryConstants.LOGGING_SOURCE,\r\n `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.FxpStateTransitionService.logFeatureUsageEventForState`\r\n );\r\n this.logger.logFeatureUsageEvent(\r\n telemetryName,\r\n featureUsageEvent,\r\n properties,\r\n null,\r\n null\r\n );\r\n }\r\n }\r\n\r\n onErrorStateChangeHandler(transition: any): void {\r\n const self = this;\r\n self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.onError)[0]\r\n .subject.next(self.getStateInfo(transition));\r\n }\r\n\r\n onInvalidStateHandler(toState: any, fromState: any, injector: any): void {\r\n const self = this;\r\n self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.onInvalid)[0]\r\n .subject.next({\r\n toState: toState,\r\n fromState: fromState,\r\n injector: injector,\r\n });\r\n }\r\n\r\n getStateInfo(transition: any): any {\r\n const stateInfo = {\r\n toState: transition.to(),\r\n toParams: transition.params(\"to\"),\r\n fromState: transition.from(),\r\n fromParams: transition.params(\"from\"),\r\n error: transition.error(),\r\n };\r\n return stateInfo;\r\n }\r\n\r\n onStateChangeStart(callback): Subject {\r\n const self = this;\r\n return self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.OnStart)[0]\r\n .subject.subscribe(callback);\r\n }\r\n onStateChangeSuccess(callback): Subject {\r\n const self = this;\r\n return self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.onSuccess)[0]\r\n .subject.subscribe(callback);\r\n }\r\n onStateChangeFailure(callback): Subject {\r\n const self = this;\r\n return self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.onError)[0]\r\n .subject.subscribe(callback);\r\n }\r\n onStateNotFound(callback): Subject {\r\n const self = this;\r\n return self.subjects\r\n .filter((event) => event.id === FxpConstants.StateEvents.onInvalid)[0]\r\n .subject.subscribe(callback);\r\n }\r\n\r\n offStateChangeStart(observer): void {\r\n const self = this;\r\n const currentSubject = self.subjects.filter(\r\n (event) => event.id === FxpConstants.StateEvents.OnStart\r\n )[0].subject;\r\n currentSubject.observers.filter((x) => x == observer)[0].unsubscribe();\r\n }\r\n\r\n offStateChangeSuccess(observer): void {\r\n const self = this;\r\n const currentSubject = self.subjects.filter(\r\n (event) => event.id === FxpConstants.StateEvents.onSuccess\r\n )[0].subject;\r\n currentSubject.observers.filter((x) => x == observer)[0].unsubscribe();\r\n }\r\n\r\n offStateChangeFailure(observer): void {\r\n const self = this;\r\n const currentSubject = self.subjects.filter(\r\n (event) => event.id === FxpConstants.StateEvents.onError\r\n )[0].subject;\r\n currentSubject.observers.filter((x) => x == observer)[0].unsubscribe();\r\n }\r\n\r\n offStateNotFound(observer): void {\r\n const self = this;\r\n const currentSubject = self.subjects.filter(\r\n (event) => event.id === FxpConstants.StateEvents.onInvalid\r\n )[0].subject;\r\n currentSubject.observers.filter((x) => x == observer)[0].unsubscribe();\r\n }\r\n}\r\n","import { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to connect to dashboard service to fetch the leftnav data of the user\r\n * @class Fxp.Services.FxpStorageService\r\n * @classdesc A service to connect to dashaboard service to fetch the leftnav data \r\n * @example Example to create an instance of dashboard service \r\n * //Initializing FxpStorageService\r\n * angular.module('FxPApp').controller('LeftNavController', ['FxpStorageService', LeftNavController]);\r\n * function LeftNavController(FxpStorageService){ FxpStorageService.getLeftNavData(userAlias,roleGroupId); }\r\n */\r\nexport class FxpStorageService implements IFxPService{\r\n\tprivate static _instance: FxpStorageService;\r\n\tprivate $window;\r\n\r\n\tconstructor($window) {\r\n\t\tthis.$window = $window;\r\n\t\tif (FxpStorageService._instance) {\r\n\t\t\treturn FxpStorageService._instance;\r\n\t\t}\r\n\t\tFxpStorageService._instance = this;\r\n\t}\r\n\r\n\tsaveInLocalStorage(key: string, data: any): void {\r\n\t\tvar self = this;\r\n\t\tif (data)\r\n\t\t\tself.$window.localStorage && self.$window.localStorage.setItem(key, JSON.stringify(data));\r\n\t}\r\n\r\n\tgetFromLocalStorage(key: string): any {\r\n\t\tvar self = this;\r\n\t\tvar data;\r\n\t\tdata = (self.$window.localStorage && self.$window.localStorage.getItem(key));\r\n\t\tif (data)\r\n\t\t\tdata = JSON.parse(data);\r\n\t\treturn data;\r\n\t}\r\n\r\n\tdeleteFromLocalStorage(key: string): any {\r\n\t\tvar self = this;\r\n\t\tself.$window.localStorage && self.$window.localStorage.removeItem(key);\r\n\t}\r\n}","import { IHelpCentralService } from \"../interfaces/IHelpCentralService\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to handle service call for Contextual Help Articles\r\n * @class Fxp.Services.HelpCentralService\r\n * @classdesc A service to handle service calls for Contextual Help Articles\r\n * @example Example to create an instance of HelpCentralService\r\n * //Initializing HelpCentralService\r\n * angular.module('FxPApp').controller('AppController', ['HelpCentralService', AppController]);\r\n * function AppController(helpCentralService, fxpConstants){ helpCentralService.getContextualHelpArticles(); }\r\n */\r\nexport class HelpCentralService implements IHelpCentralService,IFxPService {\r\n\r\n\tprivate helpCentralServiceEndPoint: string;\r\n\tprivate roleGroupId: string;\r\n\tprivate tenantName: string;\r\n\tprivate helpCentralServiceAppId: string;\r\n\tconstructor(\r\n\t\tprivate $http: angular.IHttpService,\r\n\t\tprivate fxpConfiguration: FxpConfigurationService,\r\n\t\tprivate userInfoService: UserInfoService,\r\n\t\tprivate deviceFactory: any\r\n\t) {\r\n\r\n\t\tthis.helpCentralServiceEndPoint = fxpConfiguration.FxpAppSettings.HelpCentralServiceEndpoint;\r\n\t\tthis.helpCentralServiceAppId = window[\"tenantConfiguration\"].UIStrings.HelpCentralAppId;\r\n\t\tthis.roleGroupId = this.userInfoService.getCurrentUserData().roleGroupId;\r\n\t\tthis.tenantName = this.userInfoService.getCurrentUserData().MappedTenantName ? this.userInfoService.getCurrentUserData().MappedTenantName : this.userInfoService.getCurrentUserData().TenantName;\r\n\t}\r\n\r\n\t/**\r\n\t* Get Help Article content\r\n\t* @method Fxp.Services.HelpCentralService.getContextualHelpArticles\r\n\t* @param {number} topArticles mandatory number value which contains number of notification to be fetched.\r\n\t* @param {number} businessCapability optional number value which contains GLN-L0 Help Articles to be fetched.\r\n\t* @param {number} businessFunctions optional number value which contains GLN-L1 Help Articles to be fetched.\r\n\t* @param {string} searchString optional string value which contains search value against which Help Articles are to be fetched.\r\n\t* @example Example to invoke getNotifications\r\n\t* helpCentralService.getContextualHelpArticles(startIndex, count);\r\n\t*/\r\n\tgetContextualHelpArticles(topArticles, businessCapability?, businessFunctions?, searchString?, route?): angular.IPromise {\r\n\t\tvar self = this,\r\n\t\t\tdeviceType = self.deviceFactory.isMobile() ? \"Mobile\" : \"Desktop\";\r\n\t\tvar url = self.helpCentralServiceEndPoint + \"tenants/\" + self.tenantName + \"/app/\" + self.helpCentralServiceAppId\r\n\t\t\t+ \"/search?Filter=Meta_ViewPort:\" + deviceType + \";\";\r\n\t\tif (searchString) {\r\n\t\t\turl += \"&SearchString=\" + searchString;\r\n\t\t} else {\r\n\t\t\turl += \"Meta_RoleGroup:\" + self.roleGroupId + \";\";\r\n\t\t\turl += (businessCapability) ? \"Meta_L0:\" + businessCapability + \";\" : '';\r\n\t\t\turl += (businessFunctions) ? \"Meta_L1:\" + businessFunctions + \";\" : '';\r\n\t\t\turl += (route) ? \"Meta_Route:\" + route + \";\" : '';\r\n\t\t}\r\n\t\turl += \"&top=\" + topArticles + \"&skip=0\";\r\n\t\treturn this.$http.get(url);\r\n\t}\r\n\r\n\t/**\r\n\t* Get Help Article content\r\n\t* @method Fxp.Services.HelpCentralService.getContextualHelpArticleContent\r\n\t* @param {object} articleId mandatory value which contains id of article to be fetched.\r\n\t* @example Example to invoke getContextualHelpArticleContent\r\n\t* helpCentralService.getContextualHelpArticleContent(articleId);\r\n\t*/\r\n\tgetContextualHelpArticleContent(articleId): angular.IPromise {\r\n\t\tvar urlGetArticle = this.helpCentralServiceEndPoint + \"articles/\" + articleId + \"?tenantid=\" + this.tenantName + \"&appid=\" + this.helpCentralServiceAppId;\r\n\t\treturn this.$http.get(urlGetArticle);\r\n\t}\r\n\tgetSuggestions(searchPhrase: string): angular.IPromise {\r\n\t\tvar url = this.helpCentralServiceEndPoint + \"tenants/\" + this.tenantName + \"/app/\" + this.helpCentralServiceAppId + \"/suggest?SuggestString=\" + searchPhrase + \"&FuzzySearch=true\";\r\n\t\treturn this.$http.get(url);\r\n\t}\r\n\r\n\tsaveArticleFeedback(feedback): angular.IPromise {\r\n\t\tvar url = this.helpCentralServiceEndPoint + \"article/feedback?tenantid=\" + this.tenantName + \"&appid=\" + this.helpCentralServiceAppId;\r\n\t\treturn this.$http.post(url, feedback, { headers: { 'Content-Type': 'application/json' } });\r\n\t}\r\n\r\n\tsaveArticleViewCount(articleId): angular.IPromise {\r\n\t\tvar url = this.helpCentralServiceEndPoint + \"articles/\" + articleId + \"/readhistory?tenantid=\" + this.tenantName + \"&appid=\" + this.helpCentralServiceAppId;\r\n\t\treturn this.$http.post(url, { headers: { 'Content-Type': 'application/json' } });\r\n\t}\r\n}\r\n\r\n","import { AccountInfo, AuthenticationResult, BrowserAuthError, Configuration, EventType, InteractionRequiredAuthError, PublicClientApplication, RedirectRequest, ServerError, SilentRequest } from \"@azure/msal-browser\";\r\nimport { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { PartnerAppRegistrationService } from \"./PartnerAppRegistrationService\";\r\nimport { BrowserConstants } from \"@azure/msal-browser/dist/utils/BrowserConstants\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n\r\n/**\r\n * A service keeping the generic methods used in the fxp application and for multiple adal requests\r\n * @class Fxp.Services.MsalAuthenticationService\r\n * @classdesc A service used for generic methods in the fxp application and adal simultaneous cors requests\r\n * @example Example to create an instance of MsalAuthenticationService\r\n * //Initializing MsalAuthenticationService\r\n * angular.module('FxPApp').controller('AppController', ['MsalAuthenticationService', AppController]);\r\n * function AppController(MsalAuthenticationService){ MsalAuthenticationService.getJsonData(path, callbackfunc); }\r\n */\r\nexport class MsalAuthenticationService {\r\n\r\n private publicClientApplication: PublicClientApplication = null;\r\n private anonymousEndpointList = [];\r\n constructor(config: Configuration) {\r\n if (!this.publicClientApplication) {\r\n this.publicClientApplication = new PublicClientApplication(config);\r\n }\r\n\r\n var FxpAppSettings = FxpAppSettings || window[\"FxpAppSettings\"] || {};\r\n var anonEndpoints = FxpAppSettings.AuthExcludedDomains;\r\n if (anonEndpoints) {\r\n this.anonymousEndpointList = anonEndpoints.split(';');\r\n }\r\n }\r\n\r\n registerEndPoint(endpoint: string, applicationId: string) {\r\n PartnerAppRegistrationService.registerEndpoints(endpoint, applicationId);\r\n }\r\n\r\n\r\n initializeAuthentication(configuration: Configuration) {\r\n if (!this.publicClientApplication)\r\n this.publicClientApplication = new PublicClientApplication(configuration);\r\n }\r\n\r\n /**\r\n * Checks for whether the adal service request is in progress or not and returns boolean\r\n * @method Fxp.Utils.Services.MsalAuthenticationService.accessTokenRequestInProgress\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke accessTokenRequestInProgress\r\n * MsalAuthenticationService.accessTokenRequestInProgress('http://oneprofiledevapi.azurewebsites.net');\r\n */\r\n accessTokenRequestInProgress(endpoint): boolean {\r\n return false;\r\n }\r\n\r\n async login($rootScope: IRootScope) {\r\n\r\n const accounts = this.publicClientApplication.getAllAccounts();\r\n if (accounts.length > 0) {\r\n this.publicClientApplication.setActiveAccount(accounts[0]);\r\n }\r\n\r\n const callbackId = this.publicClientApplication.addEventCallback((message: any) => {\r\n // Update UI or interact with EventMessage here\r\n if (message.eventType === EventType.LOGIN_SUCCESS) {\r\n const payload: any = message.payload;\r\n this.publicClientApplication.setActiveAccount(payload?.account as AccountInfo);\r\n } else if (message.eventType === EventType.LOGIN_FAILURE) {\r\n console.log(\"MsalError: \" + message.error);\r\n $rootScope.$broadcast('msal:loginFailure', { errorDesc: message.error, err: message.eventType});\r\n }\r\n else if (message.eventType === EventType.ACQUIRE_TOKEN_FAILURE) {\r\n console.log(\"MsalError: \" + message.error);\r\n $rootScope.$broadcast('msal:acquireTokenFailure', message.error, message.eventType, \"\", message?.error?.errorDesc?.errorCode);\r\n }\r\n });\r\n\r\n var localPublicClientApplication = this.publicClientApplication;\r\n if (accounts.length === 0) {\r\n await this.publicClientApplication\r\n .handleRedirectPromise()\r\n .then(async (loginResponse: AuthenticationResult | null) => {\r\n if (loginResponse !== null) {\r\n const account = localPublicClientApplication.getActiveAccount();\r\n if (!account) {\r\n // redirect anonymous user to login page\r\n await localPublicClientApplication.loginRedirect();\r\n }\r\n $rootScope.$broadcast('msal:loginSuccess', loginResponse.idToken);\r\n }\r\n else {\r\n await localPublicClientApplication.loginRedirect();\r\n }\r\n })\r\n .catch((error: any) => {\r\n console.log(error);\r\n throw (error);\r\n });\r\n }\r\n else {\r\n var silentRequest = {\r\n scopes: [\"User.Read\"],\r\n account: accounts[0],\r\n forceRefresh: false\r\n };\r\n\r\n var request = {\r\n scopes: [\"User.Read\"],\r\n loginHint: accounts[0].username // For v1 endpoints, use upn from idToken claims\r\n };\r\n\r\n const tokenResponse = await this.publicClientApplication.acquireTokenSilent(silentRequest).catch(error => {\r\n console.log(\"MsalError: Login Error\");\r\n $rootScope.$broadcast('msal:acquireTokenFailure', { errorDesc: \"Login Error msal:acquireTokenFailure\", err: error });\r\n $rootScope.$broadcast('msal:loginFailure', { errorDesc: \"Login Error due to Refresh Token msal:loginFailure\", err: \"Login Error due to Refresh Token msal:loginFailure\" });\r\n if (error.errorCode === BrowserConstants.INVALID_GRANT_ERROR) {\r\n // Refresh token expired, prompt for re-authentication\r\n if (error.error === \"invalid_grant\" && error.errorCodes && error.errorCodes.includes(700084))\r\n {\r\n localStorage.clear();\r\n $rootScope.$broadcast('msal:loginFailure', { errorDesc: \"Session expired, please re-authenticate\", err: error });\r\n $rootScope.$broadcast('msal:acquireTokenFailure', { errorDesc: \"Session expired, please re-authenticate 1\", err: error });\r\n return this.publicClientApplication.loginRedirect(); // Redirect for re-authentication\r\n }\r\n \r\n }\r\n const isServerError = error instanceof ServerError;\r\n const isInteractionRequiredError = error instanceof InteractionRequiredAuthError;\r\n const isRefreshTokenError = error instanceof BrowserAuthError;\r\n\r\n\r\n if (isInteractionRequiredError) {\r\n // fallback to interaction when silent call fails\r\n localStorage.clear();\r\n return this.publicClientApplication.acquireTokenRedirect(request)\r\n }\r\n else {\r\n if (isRefreshTokenError) {\r\n localStorage.clear();\r\n window.location.reload();\r\n }\r\n else {\r\n const isInvalidGrantError = (error.errorCode === BrowserConstants.INVALID_GRANT_ERROR);\r\n if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {\r\n console.log(\"MsalError: Login Error due to Refresh Token\");\r\n $rootScope.$broadcast('msal:loginFailure', { errorDesc: \"Login Error due to Refresh Token\", err: \"Login Error due to Refresh Token\" });\r\n localStorage.clear();\r\n window.location.reload();\r\n }\r\n else {\r\n const isMonitorTimeoutError = (error.errorCode === \"monitor_window_timeout\");\r\n if (isMonitorTimeoutError) {\r\n console.log(\"MsalError: Login Error due to Refresh token on Iframe Timeout\");\r\n $rootScope.$broadcast('msal:loginFailure', { errorDesc: \"Token acquisition in iframe failed due to timeout\", err: \"Token acquisition in iframe failed due to timeout\" });\r\n localStorage.clear();\r\n window.location.reload();\r\n }\r\n }\r\n }\r\n }\r\n })\r\n if (tokenResponse) {\r\n $rootScope.$broadcast('msal:loginSuccess', tokenResponse.idToken);\r\n }\r\n // const idToken = (await this.getTokenRedirect(null, this.publicClientApplication.getActiveAccount()));\r\n // if (idToken) {\r\n // $rootScope.$broadcast('msal:loginSuccess', idToken);\r\n // }\r\n // else {\r\n\r\n // }\r\n\r\n }\r\n }\r\n\r\n /**\r\n * Returns cached token for a given endpoint\r\n * @method Fxp.Utils.Services.MsalAuthenticationService.getCachedToken\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke getCachedToken\r\n * MsalAuthenticationService.getCachedToken('http://oneprofiledevapi.azurewebsites.net');\r\n */\r\n async getCachedToken(endpoint) {\r\n return await this.getTokenRedirect(endpoint);\r\n }\r\n\r\n /**\r\n * To kick off token acquisition manually on special cases\r\n * @method Fxp.Utils.Services.MsalAuthenticationService.acquireToken\r\n * @param {EndPoint} endpoint is the api endpoint for the resource or the api to which adal authorizes.\r\n * @example Example to invoke acquireToken\r\n * MsalAuthenticationService.acquireToken('http://oneprofiledevapi.azurewebsites.net');\r\n */\r\n async acquireToken(endpoint) {\r\n return await (await this.getTokenRedirectAsync(endpoint)).accessToken;\r\n }\r\n\r\n acquireTokenAsPromise(endpoint) {\r\n return this.getTokenRedirectAsync(endpoint);\r\n }\r\n\r\n /**\r\n * Checks for whether the token retrieval is started for the endpoint provided\r\n * @method Fxp.Utils.Services.MsalAuthenticationService.isTokenRetrievalStarted\r\n * @param {Resource} resource an endpoint which is passed to check for it in the logs entry.\r\n * @example Example to invoke isTokenRetrievalStarted\r\n * MsalAuthenticationService.isTokenRetrievalStarted('https://microsoft.onmicrosoft.com/FXPCouchBaseAPI');\r\n */\r\n isTokenRetrievalStarted(resource): boolean {\r\n return false;\r\n }\r\n\r\n getAccount(): AccountInfo {\r\n return this.publicClientApplication.getActiveAccount();\r\n }\r\n\r\n private async getTokenRedirect(\r\n endpoint: string, account: AccountInfo = null\r\n ): Promise {\r\n try {\r\n var response = await this.getTokenRedirectAsync(endpoint, account);\r\n return response.accessToken;\r\n } catch (error) {\r\n console.error(error);\r\n console.log(\"silent token acquisition fails.\");\r\n if (error.errorCode === BrowserConstants.INVALID_GRANT_ERROR) {\r\n if (error.error === \"invalid_grant\" && error.errorCodes && error.errorCodes.includes(700084)) {\r\n // Refresh token expired, prompt for re-authentication\r\n localStorage.clear();\r\n this.publicClientApplication.loginRedirect(); // Redirect for re-authentication\r\n }\r\n }\r\n else if (error instanceof InteractionRequiredAuthError) {\r\n console.log(\"acquiring token using redirect\");\r\n this.publicClientApplication.loginRedirect();\r\n } else {\r\n console.error(error);\r\n }\r\n }\r\n }\r\n\r\n async getTokenForAppIdAsync(appId: string): Promise {\r\n return new Promise((resolve, reject) => {\r\n var silentRequest = { scopes: [appId + \"/.default\"] };\r\n var redirectRequest: RedirectRequest = { scopes: [\"User.Read\"] };\r\n redirectRequest.account = this.publicClientApplication.getActiveAccount();\r\n try {\r\n this.publicClientApplication.acquireTokenSilent(\r\n silentRequest\r\n ).then((response: AuthenticationResult) => resolve(response.accessToken));\r\n } catch (e) {\r\n console.log(\"silent token acquisition fails.\");\r\n if (e instanceof InteractionRequiredAuthError) {\r\n console.log(\"acquiring token using redirect\");\r\n this.publicClientApplication.acquireTokenRedirect(redirectRequest);\r\n } else {\r\n console.error(e);\r\n reject(\"error getting token: \" + e);\r\n }\r\n }\r\n })\r\n }\r\n\r\n private getTokenRedirectAsync(\r\n endpoint: string, account: AccountInfo = null\r\n ): Promise {\r\n var silentRequest: SilentRequest = { scopes: [\"User.Read\"] };\r\n var redirectRequest: RedirectRequest = { scopes: [\"User.Read\"] };\r\n if (account) {\r\n silentRequest = { scopes: [\"User.Read\"] };\r\n redirectRequest = { scopes: [\"User.Read\"] };\r\n redirectRequest.account = account;\r\n }\r\n else if (endpoint) {\r\n var authExceptionEndpoints = PartnerAppRegistrationService.addAuthenticationExceptionEndpoints();\r\n this.anonymousEndpointList = this.anonymousEndpointList.concat(authExceptionEndpoints);\r\n if (this.anonymousEndpointList) {\r\n for (var i = 0; i < this.anonymousEndpointList.length; i++) {\r\n if (endpoint.indexOf(this.anonymousEndpointList[i]) > -1) {\r\n return Promise.resolve({ accessToken: '' } as AuthenticationResult);\r\n\r\n }\r\n }\r\n }\r\n\r\n var resource = this.getResourceForEndpoint(endpoint);\r\n if (resource) {\r\n silentRequest = { scopes: [resource + \"/.default\"] };\r\n redirectRequest = { scopes: [\"User.Read\"], redirectStartPage: window.location.href };\r\n redirectRequest.account = this.publicClientApplication.getActiveAccount();\r\n }\r\n }\r\n try {\r\n return this.publicClientApplication.acquireTokenSilent(\r\n silentRequest\r\n );\r\n } catch (e) {\r\n console.log(\"silent token acquisition fails.\");\r\n if (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR) {\r\n if (e.error === \"invalid_grant\" && e.errorCodes && e.errorCodes.includes(700084)) {\r\n // Refresh token expired, prompt for re-authentication\r\n localStorage.clear();\r\n this.publicClientApplication.loginRedirect(); // Redirect for re-authentication\r\n }\r\n }\r\n else if (e instanceof InteractionRequiredAuthError) {\r\n console.log(\"acquiring token using redirect\");\r\n this.publicClientApplication.acquireTokenRedirect(redirectRequest);\r\n } else {\r\n console.error(e);\r\n }\r\n }\r\n\r\n return new Promise((resolve, reject) => reject('No resource found for the Request'));\r\n }\r\n\r\n private getResourceForEndpoint(endpoint) {\r\n\r\n var config = window[\"ModelConfiguration\"];\r\n var FxpAppSettings = FxpAppSettings || window[\"FxpAppSettings\"] || {};\r\n var partnerEnpoints = PartnerAppRegistrationService.getRegisterEndpoints();\r\n var endpoints = JSON.parse(JSON.stringify(eval(\"(\" + \"{\" + config.Endpoints + \"}\" + \")\"))); // CodeQL [SM04509] Intent is to set a config value\r\n\r\n endpoints = CommonUtils.jsonConcat(endpoints, partnerEnpoints);\r\n window._msalEndpoints = endpoints;\r\n var clientId = FxpAppSettings.FxpAppClientId;\r\n // var clientId = \"853531f8-add1-44d2-824b-b4a2790b08ac\";\r\n endpoints.loginResource = this.publicClientApplication ? clientId /*FxpAppSettings.FxpAppClientId */ : null;\r\n endpoints.redirectUri = this.publicClientApplication ? window.location.host : null;\r\n\r\n if (endpoints) {\r\n var bestMatchedConfigEndpoint = \"\";\r\n endpoint = endpoint.trimStart();\r\n for (var configEndpoint in endpoints) {\r\n if (endpoint.startsWith(configEndpoint) && configEndpoint.length > bestMatchedConfigEndpoint.length) {\r\n bestMatchedConfigEndpoint = configEndpoint;\r\n }\r\n }\r\n if (bestMatchedConfigEndpoint !== \"\") {\r\n return endpoints[bestMatchedConfigEndpoint];\r\n }\r\n // for (var configEndpoint in endpoints) {\r\n // // configEndpoint is like /api/Todo requested endpoint can be /api/Todo/1\r\n // myArray.filter(element => element.includes(\"substring\"));\r\n // if (endpoint.indexOf(configEndpoint) > -1) {\r\n // return endpoints[configEndpoint];\r\n // }\r\n // }\r\n }\r\n\r\n // default resource will be clientid if nothing specified\r\n // App will use idtoken for calls to itself\r\n // check if it's staring from http or https, needs to match with app host\r\n if (endpoint.indexOf('http://') > -1 || endpoint.indexOf('https://') > -1) {\r\n if (this._getHostFromUri(endpoint) === this._getHostFromUri(endpoints.redirectUri)) {\r\n return endpoints.loginResource;\r\n }\r\n else {\r\n if (endpoint.indexOf('azureedge.net') > -1) {\r\n return '';\r\n }\r\n }\r\n }\r\n else {\r\n // in angular level, the url for $http interceptor call could be relative url,\r\n // if it's relative call, we'll treat it as app backend call.\r\n return endpoints.loginResource;\r\n }\r\n\r\n // if not the app's own backend or not a domain listed in the endpoints structure\r\n return null;\r\n };\r\n\r\n /**\r\n * Strips the protocol part of the URL and returns it.\r\n * @ignore\r\n */\r\n private _getHostFromUri(uri) {\r\n // remove http:// or https:// from uri\r\n var extractedUri = String(uri).replace(/^(https?:)\\/\\//, '');\r\n extractedUri = extractedUri.split('/')[0];\r\n return extractedUri;\r\n };\r\n\r\n}\r\n\r\nexport class MsalAuthenticationServiceProvider implements angular.IServiceProvider {\r\n\r\n _config: any;\r\n _msalService: MsalAuthenticationService;\r\n public configure(config: Configuration): void {\r\n this._config = config;\r\n if (!this._msalService) {\r\n this._msalService = new MsalAuthenticationService(this._config);\r\n }\r\n }\r\n\r\n $get(): any {\r\n return this._msalService;\r\n }\r\n\r\n init() {\r\n // throw new Error(\"Method not implemented.\");\r\n }\r\n addState(stateName: any, config: any): void {\r\n // throw new Error(\"Method not implemented.\");\r\n }\r\n otherwise(input: any): void {\r\n // throw new Error(\"Method not implemented.\");\r\n }\r\n}\r\n\r\n","import { FxpRouteService } from \"./FxpRouteService\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { StateService } from \"@uirouter/core\"\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { CommonUtils } from '../../js/utils/CommonUtils';\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to handle notification actions\r\n * @class Fxp.Services.NotificationActionCenter\r\n * @classdesc A service to handle actions for Notifications\r\n * @example Example to create an instance of NotificationActionCenter \r\n * //Initializing NotificationActionCenter\r\n * angular.module('FxPApp').controller('AppController', ['NotificationActionCenter', AppController]);\r\n * function AppController(notificationActionCenter, fxpConstants){ notificationActionCenter.excecuteNotificationAction('New Resource Request'); }\r\n */\r\nexport class NotificationActionCenter implements IFxPService{\r\n\tprivate notificationActions: any;\r\n\tprivate iconConfiguration: any;\r\n\tconstructor(\r\n\t\tprivate $rootScope: IRootScope,\r\n\t\tprivate $state: StateService,\r\n\t\tfxpConfigurationService: FxpConfigurationService,\r\n\t\tprivate fxpRouteService: FxpRouteService\r\n\t) {\r\n\t\tthis.notificationActions = fxpConfigurationService.FxpBaseConfiguration.NotificationConfiguration ? fxpConfigurationService.FxpBaseConfiguration.NotificationConfiguration.ActionConfiguration : [];\r\n\t\tthis.iconConfiguration = fxpConfigurationService.FxpBaseConfiguration.NotificationConfiguration ? fxpConfigurationService.FxpBaseConfiguration.NotificationConfiguration.IconConfiguration : [];\r\n\t}\r\n\r\n\t/**\r\n * Navigate to a state/url based on the subject passed\r\n * @method Fxp.Services.notificationActionCenter.excecuteNotificationAction\r\n * @param {any} is an object of containing details of notification.\r\n * @example Example to invoke excecuteNotificationAction\r\n * notificationActionCenter.excecuteNotificationAction('New Resource Request');\r\n */\r\n\texcecuteNotificationAction(item) {\r\n\t\tvar self = this,\r\n\t\t\ttarget = \"\",\r\n\t\t\tactions = [];\r\n\r\n\t\ttry {\r\n\t\t\tactions.push(JSON.parse(item.content));\r\n\t\t} catch (e) {\r\n\t\t\tactions = self.notificationActions.filter(function (notification) {\r\n\t\t\t\treturn !CommonUtils.isNullOrEmpty(item.subject) && notification.Subject.toLowerCase() == item.subject.toLowerCase();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (actions.length) {\r\n\t\t\tif (actions[0].OpenInNewTab) {\r\n\t\t\t\ttarget = \"_blank\";\r\n\t\t\t}\r\n\t\t\tif (actions[0].ActionType.toLowerCase() == \"state\" && self.$state.get(actions[0].Action)) {\r\n\t\t\t\tif (target)\r\n\t\t\t\t\tself.fxpRouteService.navigateToSpecificUrl(self.$state.href(actions[0].Action, {}, { absolute: true }), target);\r\n\t\t\t\telse\r\n\t\t\t\t\tself.fxpRouteService.navigatetoSpecificState(actions[0].Action);\r\n\t\t\t} else if (actions[0].ActionType.toLowerCase() == \"url\") {\r\n\t\t\t\tself.fxpRouteService.navigateToSpecificUrl(actions[0].Action, target);\r\n\t\t\t} else if (actions[0].ActionType.toLowerCase() == \"function\") {\r\n\t\t\t\tself.$rootScope.$broadcast(actions[0].Action, item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* Register to a new state to map with notification\r\n\t* @method Fxp.Services.notificationActionCenter.registerNotificationAction\r\n\t* @param {string} a mandatory string value which contains notification subject.\r\n\t* @param {string} a mandatory string value which contains action to be performed.\r\n\t* @param {string} a mandatory string value which contains action type: state/url/function.\r\n\t* @param {boolean} a mandatory bool value whether to perform the action in new tab.\r\n\t* @example Example to invoke registerNotificationAction\r\n\t* notificationActionCenter.registerNotificationAction('New Resource Request');\r\n\t*/\r\n\tregisterNotificationAction(subject, action, actionType, openInNewTab) {\r\n\t\tvar notificationAction = this.notificationActions.filter(item => item.Subject == subject);\r\n\t\tif (!notificationAction.length) {\r\n\t\t\tthis.notificationActions.push({\r\n\t\t\t\tSubject: subject,\r\n\t\t\t\tActionType: actionType,\r\n\t\t\t\tOpenInNewTab: openInNewTab,\r\n\t\t\t\tAction: action\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tnotificationAction[0].ActionType = actionType;\r\n\t\t\tnotificationAction[0].OpenInNewTab = openInNewTab;\r\n\t\t\tnotificationAction[0].Action = action;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* Appends icons and other properties to the notification\r\n\t* @method Fxp.Services.notificationActionCenter.appendPropertiesToNotifications\r\n\t* @param {any} notifications mandatory array of notifications.\r\n\t* @example Example to invoke appendPropertiesToNotifications\r\n\t* notificationActionCenter.appendPropertiesToNotifications([]);\r\n\t*/\r\n\tappendPropertiesToNotifications(notifications) {\r\n\t\tvar self = this;\r\n\t\tnotifications.forEach(function (item) {\r\n\t\t\t// Find icon corresponding to notification.\r\n\t\t\tvar icon = self.iconConfiguration.filter(function (icon) {\r\n\t\t\t\treturn icon.From.toLowerCase() == item.senderAddress.toLowerCase();\r\n\t\t\t});\r\n\t\t\t// Check if notification has corresponding icon.\r\n\t\t\tif (icon.length)\r\n\t\t\t\titem.icon = icon[0].Icon;\r\n\r\n\t\t\t// Check for dynamic action\r\n\t\t\titem.hasAction = item.content.indexOf(\"ActionType\") > -1;\r\n\r\n\t\t\t// Check notification has corresponding action.\r\n\t\t\tif (!item.hasAction) {\r\n\t\t\t\titem.hasAction = self.notificationActions.some(function (action) {\r\n\t\t\t\t\treturn !CommonUtils.isNullOrEmpty(item.subject) && action.Subject.toLowerCase() == item.subject.toLowerCase();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Convert date to local.\r\n\t\t\titem.publishedOn = new Date(item.publishedOn);\r\n\t\t});\r\n\t\treturn notifications;\r\n\t}\r\n}\r\n","import { UserInfoService } from './UserInfoService'\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { INotificationService } from \"../interfaces/INotificationService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n\t* A service to handle service call for notifications\r\n\t* @class Fxp.Services.NotificationService\r\n\t* @classdesc A service to handle service calls for notifications\r\n\t* @example Example to create an instance of NotificationService\r\n\t* //Initializing NotificationService\r\n\t* angular.module('FxPApp').controller('AppController', ['NotificationService', AppController]);\r\n\t* function AppController(notificationService, fxpConstants){ notificationService.getUnreadNotificationCount(); }\r\n\t*/\r\nexport class NotificationService implements INotificationService, IFxPService {\r\n\tprivate notificationApiBaseUrl: string;\r\n\tprivate fxpServiceEndPoint: string;\r\n\tprivate notificationApiWebNotifResourceUrl: string = \"/api/webnotifications\";\r\n\t\r\n\tconstructor(\r\n\t\tprivate $http: angular.IHttpService,\r\n\t\tprivate fxpConfiguration: FxpConfigurationService,\r\n\t\tprivate userInfoService: UserInfoService\r\n\t\t) {\r\n\t\tthis.notificationApiBaseUrl = fxpConfiguration.FxpAppSettings.NotificationServiceEndpoint;\r\n\t\tthis.fxpServiceEndPoint = fxpConfiguration.FxpAppSettings.FxpServiceEndPoint;\r\n\t\tthis.notificationApiWebNotifResourceUrl = this.notificationApiBaseUrl + this.notificationApiWebNotifResourceUrl;\r\n\t \r\n\t}\r\n\r\n\t/**\r\n\t* Get notifications\r\n\t* @method Fxp.Services.notificationService.getNotifications\r\n\t* @param {number} startIndex mandatory number value which contains index after which notification is to be fetched.\r\n\t* @param {number} count mandatory number value which contains number of notification to be fetched.\r\n\t* @param {string} status optional string value which contains status of notifications to be fetched.\r\n\t* @param {number} offset optional number value which contains id of last notification fetched.\r\n\t* @example Example to invoke getNotifications\r\n\t* notificationService.getNotifications(startIndex, count);\r\n\t*/\r\n\tgetNotifications(startIndex, count, status?, offset?, user?, channel?): angular.IPromise {\r\n\t\tuser = user ? user : this.userInfoService.getCurrentUserUpn();\r\n\t\tchannel = channel ? channel : this.fxpConfiguration.FxpAppSettings[\"NotificationServiceChannel\"];\r\n\t\tvar urlGetNotiicationsByPage = this.notificationApiWebNotifResourceUrl + \"?channel=\" + channel + \"&userId=\" + user + \"&skip=\" + startIndex + \"&take=\" + count;\r\n\t\tif (status) {\r\n\t\t\turlGetNotiicationsByPage += \"&status=\" + status;\r\n\t\t}\r\n\t\tif (offset) {\r\n\t\t\turlGetNotiicationsByPage += \"&filter=notification.PublishedOnTicks >\" + offset;\r\n\t\t}\r\n\t\turlGetNotiicationsByPage += \"&Order=notification.PublishedOnTicks DESC\";\r\n\t\tvar requestConfig: any = {};\r\n\r\n\t\tif (this.fxpConfiguration.FxpAppSettings[\"NotificationServiceAllowNullHeader\"]) {\r\n\t\t\trequestConfig = {\r\n\t\t\t\theaders: {}\r\n\t\t\t};\r\n\t\t\trequestConfig.headers[this.fxpConfiguration.FxpAppSettings[\"NotificationServiceAllowNullHeader\"]] = true;\r\n\t\t}\r\n\t\treturn this.$http.get(urlGetNotiicationsByPage, requestConfig);\r\n\t}\r\n\r\n\t/**\r\n\t* Delete notification\r\n\t* @method Fxp.Services.notificationService.deleteNotification\r\n\t* @param {number} webNotificationId mandatory number value which contains id of the notification which is to be deleted.\r\n\t* @example Example to invoke deleteNotification\r\n\t* notificationService.deleteNotification(webNotificationId);\r\n\t*/\r\n\tdeleteNotification(webNotificationId, user?, channel?): angular.IPromise {\r\n\t\tuser = user ? user : this.userInfoService.getCurrentUserUpn();\r\n\t\tchannel = channel ? channel : this.fxpConfiguration.FxpAppSettings[\"NotificationServiceChannel\"];\r\n\t\tvar urlDeleteNotification = this.notificationApiWebNotifResourceUrl + \"/\" + webNotificationId + \"?channel=\" + channel + \"&userId=\" + user;\r\n\t\treturn this.$http.delete(urlDeleteNotification);\r\n\t}\r\n\r\n\t/**\r\n\t* Delete all notification\r\n\t* @method Fxp.Services.notificationService.deleteAllNotification\r\n\t* @example Example to invoke deleteAllNotification\r\n\t* notificationService.deleteAllNotification();\r\n\t*/\r\n\tdeleteAllNotification(user?, channel?): angular.IPromise {\r\n\t\tuser = user ? user : this.userInfoService.getCurrentUserUpn();\r\n\t\tchannel = channel ? channel : this.fxpConfiguration.FxpAppSettings[\"NotificationServiceChannel\"];\r\n\t\tvar urlDeleteAllNotification = this.notificationApiWebNotifResourceUrl + \"?channel=\" + channel + \"&userId=\" + user;\r\n\t\treturn this.$http.delete(urlDeleteAllNotification);\r\n\t}\r\n\r\n\t/**\r\n\t* Mark notification as Read\r\n\t* @method Fxp.Services.notificationService.markNotificationAsRead\r\n\t* @param {number} webNotificationId mandatory number value which contains id of the notification which is to be marked as read.\r\n\t* @example Example to invoke markNotificationAsRead\r\n\t* notificationService.markNotificationAsRead(webNotificationId);\r\n\t*/\r\n\tmarkNotificationAsRead(webNotificationId, user?, channel?): angular.IPromise {\r\n\t\tuser = user ? user : this.userInfoService.getCurrentUserUpn();\r\n\t\tchannel = channel ? channel : this.fxpConfiguration.FxpAppSettings[\"NotificationServiceChannel\"];\r\n\t\tvar urlMarkAsRead = this.notificationApiWebNotifResourceUrl + \"/\" + webNotificationId + \"/mark\" + \"?channel=\" + channel + \"&userId=\" + user;\r\n\t\treturn this.$http.put(urlMarkAsRead, {});\r\n\t}\r\n\r\n\t/**\r\n\t* Mark all notification as Read\r\n\t* @method Fxp.Services.notificationService.markAllNotificationAsRead\r\n\t* @example Example to invoke markAllNotificationAsRead\r\n\t* notificationService.markAllNotificationAsRead();\r\n\t*/\r\n\tmarkAllNotificationsAsRead(user?, channel?): angular.IPromise {\r\n\t\tuser = user ? user : this.userInfoService.getCurrentUserUpn();\r\n\t\tchannel = channel ? channel : this.fxpConfiguration.FxpAppSettings[\"NotificationServiceChannel\"];\r\n\t\tvar urlMarkAllAsRead = this.notificationApiWebNotifResourceUrl + \"/mark\" + \"?channel=\" + channel + \"&userId=\" + user;\r\n\t\treturn this.$http.put(urlMarkAllAsRead, {});\r\n\t}\r\n\r\n\t/**\r\n\t* Publish Notification\r\n\t* @method Fxp.Services.notificationService.publishNotifications\r\n\t* @example Example to invoke publishNotifications\r\n\t* notificationService.publishNotifications();\r\n\t*/\r\n\tpublishNotifications(notificationArray: Array): angular.IPromise {\r\n\t\tvar publishEventUrl = this.fxpConfiguration.FxpAppSettings[\"EventStoreEndpoint\"] + \"api/events\";\r\n\t\tvar event = {\r\n\t\t\t\"EventName\": this.fxpConfiguration.FxpAppSettings[\"EventStoreDefaultNotificationEventName\"],\r\n\t\t\t\"EventType\": \"notification\",\r\n\t\t\t\"EventSubject\": this.fxpConfiguration.FxpAppSettings[\"EventStoreDefaultNotificationEventName\"],\r\n\t\t\t\"Publisher\": {\r\n\t\t\t\t\"Id\": this.fxpConfiguration.FxpAppSettings[\"EventStoreDefaultNotificationPublisherId\"],\r\n\t\t\t\t\"Name\": this.fxpConfiguration.FxpAppSettings[\"EventStoreDefaultNotificationPublisherName\"],\r\n\t\t\t},\r\n\t\t\t\"Payload\": \"\",\r\n\t\t\t\"Notification\": {\r\n\t\t\t\t\"WebNotification\": {\r\n\t\t\t\t\t\"Enabled\": true,\r\n\t\t\t\t\t\"Channel\": this.fxpConfiguration.FxpAppSettings[\"NotificationServiceChannel\"],\r\n\t\t\t\t\t\"Notifications\": []\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (notificationArray) {\r\n\t\t\tfor (var notification of notificationArray) {\r\n\t\t\t\tevent.Notification.WebNotification.Notifications.push({\r\n\t\t\t\t\t\"SenderAddress\": notification.From ? notification.From : this.fxpConfiguration.FxpAppSettings[\"FxPAdminName\"],\r\n\t\t\t\t\t\"Subject\": notification.Subject ? notification.Subject : \"\",\r\n\t\t\t\t\t\"Content\": notification.Content,\r\n\t\t\t\t\t\"ReceiverAddresses\": [notification.To]\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.$http.post(\r\n\t\t\tpublishEventUrl,\r\n\t\t\tevent,\r\n\t\t\t{\r\n\t\t\t\theaders:\r\n\t\t\t\t{\r\n\t\t\t\t\t'Content-Type': 'application/json'\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t* Publish Notification (Deprecated - DO NOT USE)\r\n\t* @method Fxp.Services.notificationService.publishNotificationsRolesRoleGroup\r\n\t* @example Example to invoke publishNotificationsRolesRoleGroup\r\n\t* notificationService.publishNotificationsRolesRoleGroup();\r\n\t*/\r\n\tpublishNotificationsRolesRoleGroup(notificationArray): angular.IPromise {\r\n\t\tvar urlPublish = this.fxpServiceEndPoint + \"/notification\";\r\n\r\n\t\treturn this.$http.post(\r\n\t\t\turlPublish,\r\n\t\t\tnotificationArray,\r\n\t\t\t{\r\n\t\t\t\theaders:\r\n\t\t\t\t{\r\n\t\t\t\t\t'Content-Type': 'application/json; charset=UTF-8'\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n}","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { NotificationService } from \"./NotificationService\";\r\nimport { FxpBroadcastedEvents } from \"./FxpBroadcastedEvents\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { CommonUtils } from '../../js/utils/CommonUtils';\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n* A service to handle service call for notifications\r\n* @class Fxp.Services.NotificationStore\r\n* @classdesc A service to handle service calls for notifications\r\n* @example Example to create an instance of NotificationStore\r\n* //Initializing NotificationService\r\n* angular.module('FxPApp').controller('AppController', ['NotificationStore', AppController]);\r\n* function AppController(notificationStore, fxpConstants){ notificationStore.getUnreadNotificationCount(); }\r\n*/\r\nexport class NotificationStore implements IFxPService {\r\n\tconstructor(\r\n\t\tprivate $rootScope: IRootScope,\r\n\t\tprivate $q: angular.IQService,\r\n\t\tprivate notificationService: NotificationService\r\n\t) {\r\n\t}\r\n\r\n\t/**\r\n\t* Get notifications\r\n\t* @method Fxp.Services.notificationStore.getNotifications\r\n\t* @param {number} startIndex mandatory number value which contains index after which notification is to be fetched.\r\n\t* @param {number} count mandatory number value which contains number of notification to be fetched.\r\n\t* @param {string} status optional string value which contains status of notification to be fetched.\r\n\t* @param {number} offset optional number value which contains id of last notification fetched.\r\n\t* @example Example to invoke getNotifications\r\n\t* notificationStore.getNotifications(startIndex, count);\r\n\t*/\r\n\tgetNotifications(startIndex, count, status?, offset?): angular.IPromise {\r\n\t\tvar self = this,\r\n\t\t\tdefered = self.$q.defer();\r\n\t\tself.notificationService.getNotifications(startIndex, count, status, offset).then((response) => {\r\n\t\t\t\r\n\t\t\tdefered.resolve(response);\r\n\t\t}, (error) => {\r\n\t\t\tdefered.reject(error);\r\n\t\t});\r\n\t\treturn defered.promise;\r\n\t}\r\n\t\r\n\t\r\n\t/**\r\n\t* Delete notification\r\n\t* @method Fxp.Services.notificationStore.deleteNotification\r\n\t* @param {number} webNotificationId mandatory number value which contains id of the notification which is to be deleted.\r\n\t* @example Example to invoke deleteNotification\r\n\t* notificationStore.deleteNotification(webNotificationId);\r\n\t*/\r\n\tdeleteNotification(webNotificationId): angular.IPromise {\r\n\t\tvar self = this,\r\n\t\t\tdefered = self.$q.defer();\r\n\t\tif (!CommonUtils.isNullOrEmpty(webNotificationId)) {\r\n\t\t\t//Delete particular notification\r\n\t\t\tself.notificationService.deleteNotification(webNotificationId).then((response) => {\r\n\t\t\t\tdefered.resolve(response);\r\n\t\t\t}, (error) => {\r\n\t\t\t\tdefered.reject(error);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t//Delete all notification\r\n\t\t\tself.notificationService.deleteAllNotification().then((response) => {\r\n\t\t\t\tdefered.resolve(response);\r\n\t\t\t}, (error) => {\r\n\t\t\t\tdefered.reject(error);\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn defered.promise;\r\n\t}\r\n\r\n\t/**\r\n\t* Mark notification as Read\r\n\t* @method Fxp.Services.notificationStore.markNotificationAsRead\r\n\t* @param {number} webNotificationId mandatory number value which contains id of the notification which is to be marked as read.\r\n\t* @example Example to invoke markNotificationAsRead\r\n\t* notificationStore.markNotificationAsRead(webNotificationId);\r\n\t*/\r\n\tmarkNotificationAsRead(webNotificationId?): angular.IPromise {\r\n\t\tvar self = this,\r\n\t\t\tdefered = self.$q.defer();\r\n\t\tif (webNotificationId) {\r\n\t\t\t//Mark particular notification as Read\r\n\t\t\tself.notificationService.markNotificationAsRead(webNotificationId).then((response) => {\r\n\t\t\t\tdefered.resolve(response);\r\n\t\t\t}, (error) => {\r\n\t\t\t\tdefered.reject(error);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t//Mark particular notification as Read\r\n\t\t\tself.notificationService.markAllNotificationsAsRead().then((response) => {\r\n\t\t\t\tdefered.resolve(response);\r\n\t\t\t}, (error) => {\r\n\t\t\t\tdefered.reject(error);\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn defered.promise;\r\n\t}\r\n\r\n\t/**\r\n\t* Publish notifications\r\n\t* @method Fxp.Services.notificationStore.publishNotifications\r\n\t* @param {any} notificationArray array of notification object.\r\n\t* @example Example to invoke publishNotifications\r\n\t* notificationStore.publishNotifications(startIndex, count);\r\n\t*/\r\n\tpublishNotifications(notificationArray): angular.IPromise {\r\n\t\tvar self = this,\r\n\t\t\tdefered = self.$q.defer();\r\n\t\tself.notificationService.publishNotifications(notificationArray).then((response) => {\r\n\t\t\tdefered.resolve(response);\r\n\t\t}, (error) => {\r\n\t\t\tdefered.reject(error);\r\n\t\t});\r\n\t\treturn defered.promise;\r\n\t}\r\n\t/**\r\n\t* Publish notifications\r\n\t* @method Fxp.Services.notificationStore.publishNotificationsRolesRoleGroup\r\n\t* @param {any} notificationArray array of notification object.\r\n\t* @example Example to invoke publishNotificationsRolesRoleGroup\r\n\t* notificationStore.publishNotificationsRolesRoleGroup(notificationArray);\r\n\t*/\r\n\tpublishNotificationsRolesRoleGroup(notificationArray): angular.IPromise {\r\n\t\tvar self = this,\r\n\t\t\tdefered = self.$q.defer();\r\n\t\tself.notificationService.publishNotificationsRolesRoleGroup(notificationArray).then((response) => {\r\n\t\t\tdefered.resolve(response);\r\n\t\t}, (error) => {\r\n\t\t\tdefered.reject(error);\r\n\t\t});\r\n\t\treturn defered.promise;\r\n\t}\r\n}","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { FxpContext } from \"../context/FxpContext\";\r\nimport { FxpMessageService } from \"../../app/banner/FxpMessageService\";\r\nimport { FxpConstants } from \"../common/ApplicationConstants\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { UserProfileService } from \"./userProfileService\";\r\nimport { UserClaimsService } from \"./UserClaimsService\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"./fxp.global.store.service\";\r\nimport { AddCurrentUserClaims } from \"../../app/claims/claims.action\";\r\nimport { AddCurrentUserProfile } from \"../../app/profile/profile.action\";\r\nimport {AddOBOEntity , RemoveOBOEntity} from \"../../app/obo/obo.action\";\r\nimport { removeOboContext } from \"../../app/adminTiles/adminTile.action\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to connect to user profile service to fetch the detaisl of user info and user claims related to partner apps\r\n * @class Fxp.Services.OBOUserService\r\n * @classdesc A service to connect to user profile service to fetch the user profile details and claims \r\n * @example Example to create an instance of user profile service \r\n * //Initializing User Profile Service\r\n * angular.module('FxPApp').controller('AppController', ['OBOUserService', AppController]);\r\n * function AppController(OBOUserService){ OBOUserService.InitializeOBOEntityFromContext(); }\r\n */\r\n\r\nexport class OBOUserService implements IFxPService {\r\n\tprivate $rootScope: IRootScope;\r\n\tprivate static _instance: OBOUserService;\r\n\tprivate fxpContextService: FxpContext;\r\n\tprivate q: angular.IQService;\r\n\tprivate OBOUserStatus: boolean;\r\n\tprivate OBOUserRoutes: any;\r\n\tprivate OBOUser: any;\r\n\tprivate OBOUserSessionInfo: string;\r\n\tprivate OBOUserTenantConfiguration: any;\r\n\tprivate fxpMessageService: FxpMessageService;\r\n\tprivate userInfoService: UserInfoService;\r\n\tprivate userProfileService: UserProfileService;\r\n\tprivate isOBOAsNewTab: boolean;\r\n\tprivate userClaimsService:UserClaimsService;\r\n\t\r\n\tconstructor($rootScope: IRootScope, fxpContextService: FxpContext, q: angular.IQService, fxpMessageService: FxpMessageService, userInfoService: UserInfoService, userProfileService: UserProfileService,userClaimsService:UserClaimsService,private globalStoreService:FxpGlobalStoreService) {\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.fxpContextService = fxpContextService;\r\n\t\tthis.q = q;\r\n\t\tthis.OBOUser = \"\";\r\n\t\tthis.OBOUserRoutes = \"\";\r\n\t\tthis.OBOUserStatus = false;\r\n\t\tthis.OBOUserSessionInfo = \"\";\r\n\t\tthis.OBOUserTenantConfiguration = \"\";\r\n\t\tthis.fxpMessageService = fxpMessageService;\r\n\t\tthis.userInfoService = userInfoService;\r\n\t\tthis.userProfileService = userProfileService;\r\n\t\tthis.isOBOAsNewTab = false;\r\n\t\tthis.userClaimsService=userClaimsService;\r\n\r\n\t\tif (OBOUserService._instance) {\r\n\t\t\treturn OBOUserService._instance;\r\n\t\t}\r\n\t\tOBOUserService._instance = this;\r\n\t}\r\n\r\n\t/**\r\n * Intitalizes the in memory variables for OBO using the value passed\r\n * @method Fxp.Services.OBOUserService.initilizeOBOEntity\r\n * @param {any} value the json value for OBO entity\r\n * @example Example to invoke initilizeOBOEntity\r\n * OBOUserService.initilizeOBOEntity(value);\r\n */\r\n\tinitilizeOBOEntity(value: any): void {\r\n\t\tthis.$rootScope.actOnBehalfOfUserActive = value.OBOUserStatus;\r\n\t\tthis.OBOUser = value.OBOUser;\r\n\t\tthis.OBOUserRoutes = value.OBOUserRoutes;\r\n\t\tthis.OBOUserStatus = value.OBOUserStatus;\r\n\t\tthis.OBOUserSessionInfo = value.OBOUserSessionInfo;\r\n\t\tthis.OBOUserTenantConfiguration = value.OBOUserTenantConfiguration;\r\n\t\tthis.userInfoService.setOBOUserSessionInfo(value.OBOUserSessionInfo);\r\n\t\tthis.userInfoService.setActingOnBehalfOfFlag(true);\r\n\t\tif (!this.isOBOAsNewTab) {\r\n\t\t\tthis.userInfoService.setCurrentUserOID(value.OBOUser.aadObjectId);\r\n\t\t\tthis.userInfoService.setCurrentUser(this.OBOUser.alias);\r\n\t\t\tthis.userInfoService.setCurrentUserUpn(this.OBOUser.userUpn);\r\n\t\t}\r\n\t\t//Dispatch action to save obo entity state\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\",AddOBOEntity(value));\r\n\t}\r\n\r\n\r\n\t/**\r\n\t* Saves the entity of OBO in context and local inmemory variables\r\n\t* @method Fxp.Services.OBOUserService.saveOBOEntityInContext\r\n\t* @param {any} value the json value for OBO entity\r\n\t* @example Example to invoke saveOBOEntityInContext\r\n\t* OBOUserService.saveOBOEntityInContext(value);\r\n\t*/\r\n\tsaveOBOEntityInContext(value: any): void {\r\n\t\tthis.initilizeOBOEntity(value);\r\n\t\tthis.fxpContextService.saveContext(\"OBOEntity\", JSON.stringify(value));\r\n\t}\r\n\r\n\tsetCurrentUserStateFromLoggedInUserState():void{\r\n\t\t//set current user details from logged in user details\r\n\t\tlet profile = this.globalStoreService.GetPlatformState().LoggedInUser.Profile;\r\n\t\tlet claims = this.globalStoreService.GetPlatformState().LoggedInUser.Claims;\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\", AddCurrentUserClaims(claims));\r\n\t\tthis.globalStoreService.DispatchGlobalAction(\"Platform\", AddCurrentUserProfile(profile));\r\n\t}\r\n\t/**\r\n\t * Saves the entity of OBO in context and local inmemory variables\r\n\t * @method Fxp.Services.OBOUserService.saveOBOEntityInContext\r\n\t * @param {any} value the json value for OBO entity\r\n\t * @example Example to invoke saveOBOEntityInContext\r\n\t * OBOUserService.saveOBOEntityInContext(value);\r\n\t */\r\n\r\n initializeOBOEntityFromContext(): angular.IPromise {\r\n let self = this;\r\n //Wrapping it up in a promise just to make FxP wait until this is done. This promise need to succeed in all the cases. \r\n let defer = self.q.defer();\r\n this.fxpContextService.readContext(\"OBOEntity\").then(function (udata) {\r\n if (!udata.IsError) {\r\n\t\t var oboData = JSON.parse(udata.Result);\r\n\t\t self.userInfoService.setCurrentUserOID(oboData.OBOUser.aadObjectId);\r\n\t\t self.userProfileService.setCurrentUser(oboData.OBOUser.alias);\r\n try {\r\n\t\t\tself.initilizeOBOEntity(oboData);\r\n self.userClaimsService.getCalimsSvc(oboData.OBOUser.alias).then(function () {\r\n self.isOBOAsNewTab = true;\r\n defer.resolve(oboData.OBOUser);\r\n }).catch(function () {\r\n //TODO: Log exception here.\r\n\t\t\t defer.resolve(null);\r\n\t\t\t self.removeOBOUserContext();\r\n });\r\n }\r\n catch (ex) {\r\n self.fxpMessageService.addMessage(self.$rootScope.fxpUIConstants.UIMessages.SelectedProfileRoles.ErrorMessage, FxpConstants.messageType.error);\r\n //TODO: Log exception here. \r\n // Do not reject this promise otherwise FxP will not load. If this is failing OBO will not get initialized but FxP will boot normal. \r\n\t\t\tdefer.resolve(null);\r\n\t\t\tself.removeOBOUserContext();\r\n }\r\n }\r\n else {\r\n self.removeOBOUserContext();\r\n defer.resolve(null);\r\n }\r\n //Due to async nature of the call to this method, the variable \r\n //actOnBehalfOfUserActive is not being set by the time FXP has \r\n //reached Home page.Hence forcing it to apply the rootscope once again.\r\n if (!self.$rootScope.$$phase) {\r\n self.$rootScope.$apply();\r\n }\r\n\r\n }, function (error) {\r\n self.removeOBOUserContext();\r\n //Due to async nature of the call to this method, the variable \r\n //actOnBehalfOfUserActive is not being set by the time FXP has \r\n //reached Home page.Hence forcing it to apply the rootscope once again.\r\n if (!self.$rootScope.$$phase) {\r\n self.$rootScope.$apply();\r\n }\r\n defer.resolve(null);\r\n\r\n });\r\n\r\n return defer.promise;\r\n }\r\n\r\n\t/**\r\n\t* Reset the value in context and in memory variables for OBO User by removing values from there\r\n\t* @method Fxp.Services.OBOUserService.removeOBOUserContext\r\n\t* @example Example to invoke removeOBOUserContext\r\n\t* OBOUserService.removeOBOUserContext();\r\n\t*/\r\n\tremoveOBOUserContext(): void {\r\n\t\tvar self = this;\r\n\t\t//dispatch action to remove obo context state\r\n\t\tself.globalStoreService.DispatchGlobalAction(\"Platform\",RemoveOBOEntity());\r\n\t\r\n\t\tself.$rootScope.actOnBehalfOfUserActive = false;\r\n\t\tif (self.OBOUser != \"\" && self.OBOUser.alias) {\r\n\t\t\tself.fxpContextService.deleteContext(self.OBOUser.alias + \"-userInfo\").then(function (data) {\r\n\t\t\t\tconsole.log(self.OBOUser.alias + \"-userInfo - deleted\" + data);\r\n\t\t\t}, function (error) {\r\n\t\t\t\tconsole.log(self.OBOUser.alias + \"-userInfo - deleted Error :\", error);\r\n\t\t\t});\r\n\r\n\t\t\tself.fxpContextService.deleteContext(self.OBOUser.alias + \"-userclaims\").then(function (data) {\r\n\t\t\t\tconsole.log(self.OBOUser.alias + \"-userclaims - deleted\" + data);\r\n\t\t\t}, function (error) {\r\n\t\t\t\tconsole.log(self.OBOUser.alias + \"-userclaims - deleted Error :\", error);\r\n\t\t\t});\r\n\t\t\tself.fxpContextService.deleteContext(self.OBOUser.aadObjectId + \"-userclaims\").then(function (data) {\r\n\t\t\t\tconsole.log(self.OBOUser.aadObjectId + \"-userclaims - deleted\" + data);\r\n\t\t\t}, function (error) {\r\n\t\t\t\tconsole.log(self.OBOUser.aadObjectId + \"-userclaims - deleted Error :\", error);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.OBOUserRoutes = \"\";\r\n\t\tthis.OBOUser = \"\";\r\n\t\tthis.OBOUserStatus = false\r\n\t\tthis.OBOUserTenantConfiguration = \"\";\r\n\t\tthis.fxpContextService.deleteContext(\"OBOEntity\");\r\n\t\tthis.userInfoService.setActingOnBehalfOfFlag(false);\r\n\t\tthis.userInfoService.setCurrentUserOID(this.userInfoService.getLoggedInUserOID());\r\n\t\tthis.userInfoService.setCurrentUser(this.userInfoService.getLoggedInUser());\r\n\t\tthis.userInfoService.setCurrentUserUpn(this.userInfoService.getLoggedInUserUpn());\r\n\t\tthis.globalStoreService.GetPlatformStore().dispatch(removeOboContext());\r\n\t};\r\n\r\n\r\n\t/**\r\n\t* Get the routes for OBO User\r\n\t* @method Fxp.Services.OBOUserService.getOBOUserRoutes\r\n\t* @example Example to invoke getOBOUserRoutes\r\n\t* OBOUserService.getOBOUserRoutes();\r\n\t*/\r\n\tgetOBOUserRoutes(): any {\r\n\t\treturn this.OBOUserRoutes;\r\n\t};\r\n\r\n\t/**\r\n\t* get the OBO User Informations\r\n\t* @method Fxp.Services.OBOUserService.getOBOUser\r\n\t* @example Example to invoke getOBOUser\r\n\t* OBOUserService.getOBOUser(OBOUser);\r\n\t*/\r\n\tgetOBOUser(): any {\r\n\t\treturn this.OBOUser;\r\n\t};\r\n\r\n\t/**\r\n\t* get the OBO User Tenant UIStrings\r\n\t* @method Fxp.Services.OBOUserService.getOBOUserTenantConfiguration\r\n\t* @example Example to invoke getOBOUserTenantConfiguration\r\n\t* OBOUserService.getOBOUserTenantConfiguration();\r\n\t*/\r\n\tgetOBOUserTenantConfiguration(): any {\r\n\t\treturn this.OBOUserTenantConfiguration;\r\n\t};\r\n}\r\n","import { IStateConfig } from \"../interfaces/IStateConfig\";\r\nimport { GlobalExceptionHandler } from \"../telemetry/GlobalExceptionHandler\";\r\nimport { IFxpAppContext } from \"../interfaces/IFxpAppContext\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { IAuthExceptionServiceEndPoints, IServiceEndPoints } from \"../interfaces/IServiceEndPoints\";\r\nimport { IRouteInfo } from \"../interfaces/IRouteInfo\";\r\nimport { ILazyloadBundle } from \"../interfaces/ILazyLoadBundle\";\r\nimport { IPartnerBundle } from \"../interfaces/IPartnerBundle\";\r\nimport { AddRouteConfiguration, UpdateRouteConfiguration } from \"@fxp/staterouter\";\r\nimport { GlobalStore } from 'redux-micro-frontend';\r\nimport { FxpLazyLoader } from \"../../app/fxplazyloader\";\r\nimport { ISharedComponents } from \"../interfaces/ISharedComponents\";\r\nimport { ISharedComponentConfig } from \"../interfaces/ISharedComponentConfig\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { FxpLoggerService } from \"../telemetry/fxpLogger\";\r\nimport { ComponentFramework } from \"../common/enum/ComponentFramework\";\r\nimport { ISharedComponentReference } from \"../interfaces/ISharedComponentReference\";\r\nimport { IStateInfo } from \"@fxp/staterouter/src/common/interfaces/IStateInfo\";\r\n\r\n\r\nexport class PartnerAppRegistrationService {\r\n private static registeredApps: any = {};\r\n private static registerPartnerEndpoints = {};\r\n private static registeredRoutes: Array = [];\r\n public static angularPartnerStateConfig: Array = [];\r\n public static partnerRegisteredEndpoints = {};\r\n public static authExceptionEndpoints = [];\r\n\r\n private static lazyLoader = null;\r\n public static angularPartnerSharedComponents: Array = [];\r\n private static applicationsWithStore: Array = [];\r\n private static get FxpLoggerService(): FxpLoggerService {\r\n return FxpLoggerService.getInstance();\r\n }\r\n private static sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.PartnerAppRegistrationService`;\r\n\r\n public static setLazyLoader(lazyLoaderInstance){\r\n if (!this.lazyLoader){\r\n this.lazyLoader = lazyLoaderInstance;\r\n }\r\n }\r\n\r\n\r\n public static registerEndpoints(endpoint: string, clientId: string) {\r\n console.warn(\"[Obsolete] - PartnerAppRegistrationService.registerEndpoints() has been marked as obsolete and will be removed in future. Please start using getServiceEndPoints() method of IAppService.\");\r\n if (!this.registerPartnerEndpoints[endpoint]) {\r\n this.registerPartnerEndpoints[endpoint] = clientId;\r\n }\r\n }\r\n\r\n public static getRegisterEndpoints() {\r\n const partnerRegisteredEndpoints = this.getRegisteredEndPointsFromPartnerAppRegistrationClass();\r\n return CommonUtils.jsonConcat(partnerRegisteredEndpoints, this.registerPartnerEndpoints);\r\n }\r\n\r\n public static addAuthenticationExceptionEndpoints() {\r\n const partnerExceptionEndpoints = this.getAuthExcpetionFromPartnerAppRegistrationClass();\r\n return partnerExceptionEndpoints;\r\n }\r\n\r\n public static addApplicationWithStores(appName: string): void{\r\n if(this.applicationsWithStore.indexOf(appName) >= 0){\r\n return;\r\n }\r\n this.applicationsWithStore.push(appName);\r\n }\r\n\r\n public static isStoreRegistered(appName: string): boolean{\r\n return this.applicationsWithStore.indexOf(appName) >= 0;\r\n }\r\n\r\n public static registerPartnerApp(appName: string, appInstance): void {\r\n let properties = this.FxpLoggerService.createPropertyBag();\r\n properties.addToBag('PartnerAppName', appName );\r\n if (!this.registeredApps[appName]) {\r\n this.registeredApps[appName] = appInstance;\r\n //TO-DO (Discussion needed) - Where do we need to configure the routes with proper action?\r\n const routeInfo = (new appInstance()).getRoutes();\r\n const addRouteConfigurationAction = AddRouteConfiguration(routeInfo);\r\n GlobalStore.Get().DispatchGlobalAction(\"Fxp.PartnerAppRegistrationService\", addRouteConfigurationAction);\r\n this.registerPartnerAppRoutes(routeInfo);\r\n }\r\n else {\r\n const error = new Error();\r\n error.message = 'Application name with ' + appName + ' is already registered.';\r\n console.error(error.message);\r\n this.FxpLoggerService.logException(`${this.sourceForTelemetry}.RegisterPartnerApp`, error, properties, null, null, ErrorSeverityLevel.High, ErrorCodes.PartnerAppRegistrationService_ErrorOnAppRegistration);\r\n }\r\n }\r\n\r\n public static updateStateObject(stateName: string, ngModule: any, component: any, componentFramework?: ComponentFramework){\r\n const $stateService:any = angular.element(document.body).injector().get(\"$state\");\r\n const $state = $stateService.get(stateName);\r\n if($state != null) {\r\n $state.ngModule = ngModule;\r\n $state.childComponent = component;\r\n $state.componentFramework = componentFramework\r\n\r\n if ($state.componentFramework == ComponentFramework.React && $state.data.partnerAppName){\r\n const stateInfo: IStateInfo = {\r\n stateName: stateName,\r\n component: component,\r\n applicationName: $state.data.partnerAppName\r\n }\r\n const updateRouteConfiguration = UpdateRouteConfiguration(stateInfo);\r\n\r\n GlobalStore.Get().DispatchGlobalAction(\"Fxp.PartnerAppRegistrationService\", updateRouteConfiguration);\r\n\r\n }\r\n }\r\n }\r\n\r\n public static getRegisteredRoutes(fxpAppContext: IFxpAppContext): Array {\r\n Object.keys(this.registeredApps).forEach((key) => {\r\n const appInstance = new this.registeredApps[key]();\r\n const routesInfo = appInstance.getRoutes(fxpAppContext);\r\n this.registeredRoutes.push.apply(this.registeredRoutes, routesInfo);\r\n });\r\n return this.registeredRoutes;\r\n }\r\n\r\n public static getRegisteredAppRoute(appName: string, stateName: string): IStateConfig {\r\n let routeInfo;\r\n if (this.registeredApps.hasOwnProperty(appName)) {\r\n const appInstance = new this.registeredApps[appName]();\r\n const routeCollection = appInstance.getRoutes().routes;\r\n routeInfo = routeCollection.find(route => { return route.name === stateName });\r\n }\r\n return routeInfo;\r\n }\r\n\r\n public static registerLazyLoadedApp(registryInstance: any, appName?: string) {\r\n const registry = new registryInstance();\r\n const routeInfo = this.updateAppName(registry.getRoutes(), appName);\r\n let bundles: Array = [];\r\n if (registry.getBundles){\r\n bundles = [...bundles, ...registry.getBundles()];\r\n }\r\n if (registry.getGeneratedBundles){\r\n bundles = [...bundles, ...registry.getGeneratedBundles()];\r\n }\r\n this.registerPartnerAppBundles(bundles);\r\n this.registerPartnerAppRoutes(routeInfo);\r\n this.registerPartnerAppEndpoints(registry.getServiceEndPoints(), routeInfo.applicationName);\r\n if(registry.getAuthExceptionEndpoints)\r\n this.registerAuthExceptionEndpoints(registry.getAuthExceptionEndpoints(), routeInfo.applicationName);\r\n if (registry.getSharedComponentsInfo) {\r\n this.registerAngularSharedComponents(this.updateAppName(registry.getSharedComponentsInfo(), appName));\r\n }\r\n }\r\n\r\n private static updateAppName(configObject: any, appName?: string){\r\n if(appName && appName.length>0){\r\n configObject.appName = appName\r\n }\r\n return configObject;\r\n }\r\n\r\n private static registerAngularSharedComponents(sharedComponentsInfo: ISharedComponents) {\r\n if (sharedComponentsInfo.appName && !sharedComponentsInfo.disableSharing) {\r\n this.angularPartnerSharedComponents.push(sharedComponentsInfo);\r\n }\r\n else if(!sharedComponentsInfo.appName)\r\n {\r\n const error = new Error();\r\n error.message = 'Application name is not provided for the shared components';\r\n console.error(error.message);\r\n let props = this.FxpLoggerService.createPropertyBag();\r\n props.addToBag(\"Details\", error.message);\r\n\r\n this.FxpLoggerService.logException(`${this.sourceForTelemetry}.RegisterAngularSharedComponents`,\r\n error,\r\n props,\r\n null,\r\n null,\r\n ErrorSeverityLevel.High,\r\n ErrorCodes.PartnerAppRegistrationService_ErrorOnSharedComponentRegistration);\r\n }\r\n }\r\n\r\n private static registerPartnerAppRoutes(config: IRouteInfo): void {\r\n this.angularPartnerStateConfig.push(config);\r\n }\r\n\r\n private static registerPartnerAppBundles(bundles: Array): void {\r\n const ocBundles = Array();\r\n bundles.forEach(bundle => {\r\n const ocBundle: ILazyloadBundle = {\r\n name: bundle.name,\r\n files: bundle.files,\r\n serie: bundle.sequentialLoading\r\n }\r\n ocBundles.push(ocBundle);\r\n });\r\n\r\n window[\"OcModules\"] = [...window[\"OcModules\"], ...ocBundles];\r\n }\r\n\r\n private static registerPartnerAppEndpoints(endpoints: Array, key: string) {\r\n endpoints.forEach(endpoint => {\r\n if (!endpoint.serviceEndPoint) {\r\n console.error(\"[ValidationError-\" + key + \"] - Endpoint/Url is missing in the data provided in getServiceEndPoints() method.\");\r\n return;\r\n }\r\n if (!endpoint.clientId) {\r\n console.error(\"[ValidationError-\" + key + \"] - ClientId is missing in the data provided in getServiceEndPoints() method.\");\r\n return;\r\n }\r\n if (!this.partnerRegisteredEndpoints[endpoint.serviceEndPoint]) {\r\n this.partnerRegisteredEndpoints[endpoint.serviceEndPoint] = endpoint.clientId;\r\n }\r\n });\r\n }\r\n\r\n private static registerAuthExceptionEndpoints(endpoints: Array, key: string) {\r\n endpoints.forEach(endpoint => {\r\n if (!endpoint.serviceEndPoint) {\r\n console.error(\"[ValidationError-\" + key + \"] - Endpoint/Url is missing in the data provided in getAuthException() method.\");\r\n return;\r\n }\r\n \r\n if (!this.authExceptionEndpoints[endpoint.serviceEndPoint]) {\r\n this.authExceptionEndpoints.push(endpoint.serviceEndPoint);\r\n }\r\n });\r\n }\r\n\r\n private static getRegisteredEndPointsFromPartnerAppRegistrationClass() {\r\n Object.keys(this.registeredApps).forEach((key) => {\r\n const appInstance = new this.registeredApps[key]();\r\n if (!appInstance || !appInstance.getServiceEndPoints) {\r\n return;\r\n }\r\n const endpoints = appInstance.getServiceEndPoints();\r\n if (!endpoints || endpoints.length === 0) {\r\n return;\r\n }\r\n this.registerPartnerAppEndpoints(endpoints, key);\r\n });\r\n\r\n return this.partnerRegisteredEndpoints;\r\n }\r\n\r\n private static getAuthExcpetionFromPartnerAppRegistrationClass() {\r\n Object.keys(this.registeredApps).forEach((key) => {\r\n const appInstance = new this.registeredApps[key]();\r\n if (!appInstance || !appInstance.getAuthExceptionEndpoints) {\r\n return;\r\n }\r\n \r\n const endpoints = appInstance.getAuthExceptionEndpoints();\r\n if (!endpoints || endpoints.length === 0) {\r\n return;\r\n }\r\n this.registerAuthExceptionEndpoints(endpoints, key);\r\n });\r\n\r\n return this.authExceptionEndpoints;\r\n }\r\n\r\n public static updateSharedComponentDetails(appName: string, compName: string, component: any, ngModule: any, componentFramework?: ComponentFramework){\r\n this.angularPartnerSharedComponents.forEach(item => {\r\n if (item.appName === appName){\r\n const sharedComponentDetails = item;\r\n if (sharedComponentDetails){\r\n sharedComponentDetails.components.forEach(item=> {\r\n if (item.componentName.toString().toLowerCase().trim() === compName.toString().toLowerCase().trim()){\r\n item.component = component;\r\n item.ngModule = ngModule;\r\n item.componentFramework = componentFramework;\r\n }\r\n })\r\n }\r\n }\r\n });\r\n }\r\n\r\n public static getSharedComponentDetails(appName: string, compName: string): ISharedComponentConfig {\r\n const partnerApp: ISharedComponents = this.angularPartnerSharedComponents.find((partnerApp) => (partnerApp.appName.toLocaleLowerCase() === appName.toLocaleLowerCase()));\r\n if (partnerApp){\r\n const sharedComponents = partnerApp.components.find((comp) => (comp.componentName.toLocaleLowerCase() === compName.toLocaleLowerCase()));\r\n if (sharedComponents){\r\n return sharedComponents;\r\n }\r\n }\r\n }\r\n\r\n public static getBundlesForSharedComponent(appName: string, compName:string): Array {\r\n let bundles = [ ];\r\n const partnerApp:ISharedComponents = this.angularPartnerSharedComponents.find((partnerApp) => (partnerApp.appName.toLocaleLowerCase() === appName.toLocaleLowerCase()));\r\n if (partnerApp){\r\n if (partnerApp.sharedBundles){\r\n bundles = partnerApp.sharedBundles;\r\n }\r\n const sharedComponents = partnerApp.components.find((comp) => (comp.componentName.toLocaleLowerCase() === compName.toLocaleLowerCase()));\r\n if (sharedComponents && !CommonUtils.isNullOrEmpty(sharedComponents.generatedBundle)){\r\n bundles.push(sharedComponents.generatedBundle);\r\n }\r\n }\r\n return bundles;\r\n }\r\n\r\n public static getSharedComponentReference(appName: string, compName: string): Promise {\r\n const self = this;\r\n const telemetry_source = `${this.sourceForTelemetry}.GetSharedComponentFactory`;\r\n let properties = self.FxpLoggerService.createPropertyBag();\r\n properties.addToBag(\"AppName\", appName);\r\n properties.addToBag(\"ComponentName\", compName);\r\n return new Promise(function (resolve, reject) {\r\n //let partnerApp:ISharedComponents = self.angularPartnerSharedComponents.find((partnerApp) => (partnerApp.appName.toLocaleLowerCase() === appName.toLocaleLowerCase()));\r\n let sharedComponentConfig = self.getSharedComponentDetails(appName, compName);\r\n if (sharedComponentConfig) {\r\n let bundles = self.getBundlesForSharedComponent(appName, compName);\r\n self.lazyLoader.load(bundles, { serie: true }).then(() => {\r\n let component, componentFramework, ngModule = null ;\r\n let sharedComponentReference: ISharedComponentReference;\r\n sharedComponentConfig = self.getSharedComponentDetails(appName, compName);\r\n if (sharedComponentConfig.component){ // Non lazyloaded angular bundles.\r\n component = sharedComponentConfig.component;\r\n ngModule = sharedComponentConfig.ngModule;\r\n componentFramework = sharedComponentConfig.componentFramework;\r\n }\r\n else {\r\n const application = self.registeredApps[appName];\r\n const instance = new application();\r\n const componentInfo = instance.getSharedComponentsInfo();\r\n const sharedComponent = componentInfo.components.find(item=> item.componentName == compName);\r\n if (sharedComponent){\r\n component = sharedComponent.component;\r\n ngModule = sharedComponent.ngModule;\r\n componentFramework = sharedComponent.componentFramework;\r\n }\r\n }\r\n // This is Angular block\r\n if (ngModule){\r\n if (ngModule._ngModuleDefFactory){\r\n const moduleRef = FxpLazyLoader.instantiateModule(ngModule);\r\n const factory = moduleRef.componentFactoryResolver.resolveComponentFactory(component);\r\n sharedComponentReference = {component: factory, componentFramework: ComponentFramework.Angular, ngModule: moduleRef};\r\n resolve(sharedComponentReference);\r\n return ;\r\n }\r\n FxpLazyLoader.compileAndLoadModule(ngModule).then(function (ngModuleRef) {\r\n const factory = ngModuleRef.componentFactoryResolver.resolveComponentFactory(component);\r\n sharedComponentReference = {component: factory, componentFramework: ComponentFramework.Angular, ngModule: ngModuleRef};\r\n resolve(factory);\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n return;\r\n\r\n }\r\n // React\r\n if (componentFramework && componentFramework === ComponentFramework.React) {\r\n sharedComponentReference = {component: component, componentFramework: ComponentFramework.React, ngModule: null};\r\n resolve(sharedComponentReference);\r\n return;\r\n }\r\n\r\n const errorMessage = `Unable to identify the JS Framwork for Component: ${compName} of Application: ${appName}. Please specify componentFramework in getSharedComponentsInfo() of application.ts file.`;\r\n console.error(errorMessage);\r\n self.FxpLoggerService.logException(telemetry_source,\r\n new Error(errorMessage),\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.High,\r\n ErrorCodes.LazyLoadingFailedForSharedComponent);\r\n })\r\n .catch(function (e) {\r\n self.FxpLoggerService.logException(telemetry_source,\r\n e,\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.High,\r\n ErrorCodes.LazyLoadingFailedForSharedComponent);\r\n reject(e);\r\n });\r\n\r\n }\r\n else {\r\n let error = `${appName} app shared components not registered.`;\r\n reject(error);\r\n self.FxpLoggerService.logError(telemetry_source,\r\n error,\r\n ErrorCodes.SharedComponentNotRegistered,\r\n \"\",\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.High);\r\n }\r\n });\r\n }\r\n\r\n public static getSharedComponentFactory(appName: string, compName: string): Promise {\r\n return this.getSharedComponentReference(appName, compName).then(function(componentRef: ISharedComponentReference){\r\n return componentRef.component;\r\n });\r\n }\r\n}\r\n","import { IPersonalizationService } from \"../interfaces/IPersonalizationService\";\r\nimport { FxpContext } from \"../context/FxpContext\";\r\nimport { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { FxpMessageService } from \"../../app/banner/FxpMessageService\";\r\nimport { FxpConstants, PerfMarkers } from \"../common/ApplicationConstants\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n\r\nexport class PersonalizationService implements IPersonalizationService,IFxPService {\r\n\tprivate sleepInterval: number;\r\n\tprivate iCount: number = 0;\r\n\tprivate iReqCount: number = 0;\r\n\tprivate iUCount: number = 0;\r\n\tprivate fxpServiceEndPoint: string;\r\n\tprivate oneProfileEndPoint: string;\r\n\tprivate sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.PersonalizationService`;\r\n\tprivate tenantClaimsApiEndpoint: string;\r\n\tprivate tenantRolesApiEndpoint: string;\r\n\tprivate tenantNPD: string;\r\n\tprivate NotificationApiEndpoint: string;\r\n\tconstructor(private http: angular.IHttpService,\r\n\t\tprivate q: angular.IQService,\r\n\t\tprivate rootScope: IRootScope,\r\n\t\tprivate fxpConfiguration: FxpConfigurationService,\r\n\t\tprivate timeout: angular.ITimeoutService,\r\n\t\tprivate fxplogger: ILogger,\r\n\t\tprivate msalAuthenticationService: MsalAuthenticationService,\r\n\t\tprivate fxpMessageSvc: FxpMessageService) {\r\n\r\n\t\tthis.sleepInterval = 100;\r\n\t\tthis.fxpServiceEndPoint = this.fxpConfiguration.FxpAppSettings.FxpServiceEndPoint;\r\n\t\tlet profileStore = window[\"tenantConfiguration\"].ProfileStore || {};\r\n\t\tthis.oneProfileEndPoint = profileStore.ProfileAPIEndPoint;\r\n\t\tlet authStore = window[\"tenantConfiguration\"].AuthStore || {};\r\n\t\tlet rolePersonalizationStore = window[\"tenantConfiguration\"].RolePersonalizationStore || {};\r\n\t\tthis.tenantClaimsApiEndpoint = authStore.TenantClaimsEndPoint;\r\n\t\tthis.tenantRolesApiEndpoint = rolePersonalizationStore.TenantRolesEndPoint;\r\n\t\tthis.tenantNPD = window[\"tenantConfiguration\"].NPD;\r\n\t\tlet NotificationStore = window[\"tenantConfiguration\"].NotificationStore || {};\r\n\t\tthis.NotificationApiEndpoint = NotificationStore.NotificationApiEndPoint;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t* A method to Get the Persisted Pesanalization User Informantion\r\n\t* @method Fxp.Services.PersonalizationService.getPersistedPersonalization\r\n\t* @example Example to use getPersistedPersonalization\r\n\t* PersonalizationService.getPersistedPersonalization()\r\n\t*/\r\n\tgetPersistedPersonalization(): any {\r\n\t\tlet context = localStorage.getItem(\"selectedUserPersonalization\");\r\n\t\tlet keyContext = null;\r\n\t\tif (!CommonUtils.isNullOrEmpty(context)) {\r\n\t\t\tlet data = JSON.parse(context);\r\n\t\t\tkeyContext = data.user;\r\n\t\t}\r\n\t\treturn keyContext;\r\n\r\n\t}\r\n\t/**\r\n * A method to Persisted Pesanalization for selected User\r\n * @method Fxp.Services.PersonalizationService.getPersistedPersonalization\r\n * @example Example to use getPersistedPersonalization\r\n * PersonalizationService.persistUserPersonalization()\r\n */\r\n\tpersistUserPersonalization(value): void {\r\n\t\tlet context = localStorage.getItem(\"selectedUserPersonalization\");\r\n\t\tlet selectedUserPersonalization = null;\r\n\t\tif (!CommonUtils.isNullOrEmpty(context)) {\r\n\t\t\tselectedUserPersonalization = JSON.parse(context);\r\n\t\t} else {\r\n\t\t\tselectedUserPersonalization = {\r\n\t\t\t\tuser: null\r\n\t\t\t}\r\n\t\t}\r\n\t\tselectedUserPersonalization.user = value;\r\n\t\tif (!CommonUtils.isNullOrEmpty(selectedUserPersonalization)) {\r\n\t\t\tlocalStorage.setItem(\"selectedUserPersonalization\", JSON.stringify(selectedUserPersonalization));\r\n\t\t}\r\n\t}\r\n\t/**\r\n * A method to Remove the Persisted Pesanalization User Informantion\r\n * @method Fxp.Services.PersonalizationService.removePersistedUserPersonalization\r\n * @example Example to use removePersistedUserPersonalization\r\n * PersonalizationService.removePersistedUserPersonalization()\r\n */\r\n\tremovePersistedUserPersonalization(): void {\r\n\t\tlocalStorage.removeItem(\"selectedUserPersonalization\");\r\n\t}\r\n\t/**\r\n\t *A method to use Fetch the Global Master LeftNav Items From Api\r\n\t * @method Fxp.Services.PersonalizationService.getMasterLeftNavItems\r\n\t * @example Example to use getMasterLeftNavItems\r\n\t * PersonalizationService.getMasterLeftNavItems()\r\n\t */\r\n\tgetMasterLeftNavItems(): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tconst telemetry_source = `${self.sourceForTelemetry}.GetMasterLeftNavItems`;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tvar url = self.fxpServiceEndPoint + \"/leftNav/master\";\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationService_GetMasterLeftNav_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getMasterLeftNavItems();\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetMasterLeftNavItems);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\tlet requestHeaders = {};\r\n\t\t\trequestHeaders[\"X-TenantId\"] = window[\"tenantConfiguration\"].TenantId;\r\n\t\t\treturn self.http.get(url, { headers: requestHeaders });\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetMasterLeftNavItems);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use Fetch the Personalaized NavItems From Api\r\n\t* @method Fxp.Services.PersonalizationService.getPersonalizedNavItems\r\n\t* @example Example to use getPersonalizedNavItems\r\n\t* PersonalizationService.getPersonalizedNavItems()\r\n\t*/\r\n\tgetPersonalizedNavItems(userAlias: string, roleGroupId: string, userRoleId: string): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tconst telemetry_source = `${self.sourceForTelemetry}.GetPersonalizedNavItems`;\r\n\t\tvar url = this.fxpServiceEndPoint + \"/user/\" + userAlias + \"/leftNav/personalization?roleGroupId=\" + roleGroupId + \"&userRoleId=\" + userRoleId;\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationService_GetPersonalizedLeftNav_Failure, null, null, null, null, ErrorSeverityLevel.Medium);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getPersonalizedNavItems(userAlias, roleGroupId, userRoleId);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetPersonalizedNavItems);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn self.http.get(url);\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetPersonalizedNavItems);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use save the Personalaized NavItems to Api\r\n\t* @method Fxp.Services.PersonalizationService.savePersonalizedNavItems\r\n\t* @example Example to use savePersonalizedNavItems\r\n\t* PersonalizationService.savePersonalizedNavItems(userAlias: string, savedUserPrefNavList: any)\r\n\t*/\r\n\tsavePersonalizedNavItems(userAlias: string, savedUserPrefNavList: any, shouldAssignRoles: boolean = true): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tconst telemetry_source = `${self.sourceForTelemetry}.SavePersonalizedNavItems`;\r\n\t\tvar url = self.fxpServiceEndPoint + \"/user/\" + userAlias + \"/leftNav/personalization\";\r\n\t\tsavedUserPrefNavList.ShouldAssignRoles = shouldAssignRoles;\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationSerivce_SavePersonalizedNavItems_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.savePersonalizedNavItems(userAlias, savedUserPrefNavList);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.SavePersonalizedNavItems);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn self.http.post(url, savedUserPrefNavList, { headers: { 'Content-Type': 'application/json' } });\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.SavePersonalizedNavItems);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use Fetch the RoleGroupDetails From Api\r\n\t* @method Fxp.Services.PersonalizationService.getRoleGroupDetails\r\n\t* @example Example to use getRoleGroupDetails\r\n\t* PersonalizationService.getRoleGroupDetails()\r\n\t*/\r\n\tgetRoleGroupDetails(): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tconst telemetry_source = `${this.sourceForTelemetry}.GetRoleGroupDetails`; \r\n\t\tvar url = self.tenantRolesApiEndpoint + \"/roles\";\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationSerivce_GetRoleGroupDetails_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getRoleGroupDetails();\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetRoleGroupDetails);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\tlet requestHeaders = {};\r\n\t\t\trequestHeaders[\"X-Tenants\"] = self.tenantNPD;\r\n\t\t\treturn this.http.get(url, { headers: requestHeaders });\r\n\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetRoleGroupDetails);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use Fetch the RoleGroupDetails From Api\r\n\t* @method Fxp.Services.PersonalizationService.getRoleGroupDetailsForNotification\r\n\t* @example Example to use getRoleGroupDetails\r\n\t* PersonalizationService.getRoleGroupDetailsForNotification()\r\n\t*/\r\n\tgetRoleGroupDetailsForNotification(): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tconst telemtry_source = `${this.sourceForTelemetry}.GetRoleGroupDetailsForNotification`;\r\n\t\tvar url = self.NotificationApiEndpoint + \"/master/rolegroup\";\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemtry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationSerivce_GetRoleGroupDetailsForNotification_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getRoleGroupDetails();\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetRoleGroupDetails);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn this.http.get(url);\r\n\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetRoleGroupDetails);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use get the Role Personalaized NavItems from Api\r\n\t* @method Fxp.Services.PersonalizationService.getRolePersonalizedNavItems\r\n\t* @example Example to use getRolePersonalizedNavItems\r\n\t* PersonalizationService.getRolePersonalizedNavItems(userRoleId, roleGroupId)\r\n\t*/\r\n\tgetRolePersonalizedNavItems(userRoleId: string, roleGroupId: string): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tvar url = this.fxpServiceEndPoint + \"/navigation/personalization?roleGroupId=\" + roleGroupId;\r\n\t\tconst telemetry_source = `${this.sourceForTelemetry}.GetRolePersonalizedNavItems`;\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationSerivce_GetRolePersonalizedNavItems_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getRolePersonalizedNavItems(userRoleId, roleGroupId);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetPersonalizedNavItems);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\tvar requestHeaders = {}\r\n\t\t\trequestHeaders[\"tenantId\"] = window[\"tenantConfiguration\"].TenantId;\r\n\t\t\treturn self.http.get(url, { headers: requestHeaders });\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetPersonalizedNavItems);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use get the RoleGroup Personalaized NavItems from Api\r\n\t* @method Fxp.Services.PersonalizationService.savePersonalizedNavItems\r\n\t* @example Example to use getRoleGroupPersonalizedList\r\n\t* PersonalizationService.getRoleGroupPersonalizedList(roleGroupId)\r\n\t*/\r\n\tgetRoleGroupPersonalizedList(roleGroupId: string): angular.IPromise {\r\n\t\tvar self = this;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tconst telemetry_source = `${this.sourceForTelemetry}.GetRoleGroupPersonalizedList`;\r\n\t\tvar url = self.fxpServiceEndPoint + \"/navigation/personalization?AppRole=\" + roleGroupId;\r\n\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationSerivce_GetRoleGroupPersonalizedList_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getRoleGroupPersonalizedList(roleGroupId);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.GetPersonalizedNavItems);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn self.http.get(url, { headers: { \"X-TenantId\": window[\"tenantConfiguration\"].TenantId } });\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetPersonalizedNavItems);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use save the Personalaized NavItems to Api\r\n\t* @method Fxp.Services.PersonalizationService.savePersonalizedNavItems\r\n\t* @example Example to use savePersonalizedNavItems\r\n\t* PersonalizationService. saveRoleGroupPersonalizedNavItems(roleGroupId: string, userRoleId: string, savedRoleGroupPrefNavList: any)\r\n\t*/\r\n\tsaveRoleGroupPersonalizedNavItems(savedRoleGroupPrefNavList: any, shouldAssignRoles: boolean = true): angular.IPromise {\r\n\t\tvar self = this, url;\r\n\t\tvar deferred = self.q.defer();\r\n\t\tconst telemetry_source = `${this.sourceForTelemetry}.SaveRoleGroupPersonalizedNavItems`; \r\n\t\tsavedRoleGroupPrefNavList.ShouldAssignRoles = shouldAssignRoles;\r\n\t\turl = self.fxpServiceEndPoint + \"/navigation/personalization\";\r\n\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.PersonalizationSerivce_SaveRoleGroupPersonalizedNavItems_Failure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.saveRoleGroupPersonalizedNavItems(savedRoleGroupPrefNavList, shouldAssignRoles);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t} else {\r\n\t\t\tself.fxplogger.startTrackPerformance(PerfMarkers.SaveRoleGroupPersonalizedNavItems);\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\treturn self.http.post(url, savedRoleGroupPrefNavList, { headers: { 'Content-Type': 'application/json', 'X-TenantId': window['tenantConfiguration'].TenantId } });\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.SaveRoleGroupPersonalizedNavItems);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\t/**\r\n\t*A method to use get the RoleGroup which is configured in Sysytem\r\n\t* @method Fxp.Services.PersonalizationService.getDefaultRoleGroup\r\n\t* @example Example to use getDefaultRoleGroup\r\n\t* PersonalizationService.getDefaultRoleGroup(roleGroupId: number)\r\n\t*/\r\n\tgetRoleGroup(roleGroupId: number): any {\r\n\t\tvar self = this;\r\n\t\treturn self.http.get(\"/Home/GetRoleGroup?roleGroupId=\" + roleGroupId);\r\n\t}\r\n}\r\n","import { IFxPService } from \"../interfaces/IFxpService\";\r\nexport class TimeZoneHelper implements IFxPService{\r\n\r\n\tprivate PacificRegion = \"America/Los_Angeles\";\r\n\r\n\tconstructor(private moment: any) {\r\n\t}\r\n\r\n\tgetCurrentUtcDateTime = () => {\r\n\t\treturn this.moment.utc();\r\n\t}\r\n\r\n\taddHoursToCurrentUtcDateTime = (hours) => {\r\n\t\treturn this.moment.utc.add(hours,'hours');\r\n\t}\r\n\r\n\tgetCurrentLocalDateTime = () => {\r\n\t\treturn this.moment.utc().local();\r\n\t}\r\n\r\n\taddHoursToLocalUtcDateTime = (hours) => {\r\n\t\treturn this.moment.utc().local().add(hours,'hours');\r\n\t}\r\n\r\n\r\n\tgetCurrentPacificDateTime = () => {\r\n\t\treturn this.moment.tz(this.PacificRegion);\r\n\t}\r\n\r\n\tAddHoursToCurrentPacificDateTime = (hours) => {\r\n\t\treturn this.moment.tz(this.PacificRegion).add(hours,'hours');\r\n\t}\r\n\r\n\tconvertToPacific = (moment) => {\r\n\t\tlet a = this.moment.isMoment(moment) ? moment : this.moment(moment);\r\n\t\treturn this.moment.tz(a, this.PacificRegion);\r\n\t}\r\n\r\n\tconvertToLocal = (moment) => {\r\n\t\tlet currentTime = this.moment.isMoment(moment) ? moment : this.moment(moment);\r\n\t\treturn currentTime.utc().local();\r\n\t}\r\n\r\n\tconvertToUtc = (moment) => {\r\n\t\treturn this.moment.utc(moment);\r\n\t}\r\n\r\n\tchangeTimeZoneComponentToPacific = (moment) => {\r\n\t\tlet clone = moment.clone();\r\n\t\tclone = this.moment.tz(clone, this.PacificRegion);\r\n\t\tclone.add(moment.utcOffset() - clone.utcOffset(), 'minutes');\r\n\t\treturn clone;\r\n\t}\r\n\tchangeTimeZoneComponentToUniversal = (time) => {\r\n\t\tlet timeUtc = this.moment.utc(time.clone());\r\n\t\ttimeUtc.add(time.utcOffset(), 'minutes');\r\n\t\treturn timeUtc;\r\n\t}\r\n\tconvertUtcToLocal = (time) => {\r\n\t\tlet utcDate = this.moment.utc(time.clone());\r\n\t\tlet timeLocal = utcDate.local();\r\n\t\treturn timeLocal;\r\n\t}\r\n\r\n\tgetCurrentTimeZoneCode = (timezone) => {\r\n\t\treturn this.moment().tz(timezone).format('zz')\r\n\t}\r\n}\r\n","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { FxpContext } from \"../context/FxpContext\";\r\nimport { FxpMessageService } from \"../../app/banner/FxpMessageService\";\r\nimport { FxpConstants, ApplicationConstants, PerfMarkers } from \"../common/ApplicationConstants\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { LogPropertyBag } from \"../telemetry/LogPropertyBag\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"../services/fxp.global.store.service\";\r\nimport { AddLoggedInUserClaims, AddCurrentUserClaims } from \"../../app/claims/claims.action\";\r\n\r\ndeclare var _: any;\r\nimport { TelemetryConstants } from './../telemetry/TelemetryConst';\r\nimport { SystemEvent } from './../telemetry/SystemEvent';\r\nimport { ComponentType } from '@microsoftit/telemetry-extensions-npm';\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { UserProfileService } from \"./userProfileService\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n\r\ndeclare var _: any;\r\n/**\r\n * A service to connect to user cliams service to fetch the detaisl of user claims related to partner apps\r\n * @class Fxp.Services.UserClaimsService\r\n * @classdesc A service to connect to user cliams service to fetch the detaisl of user claims related to partner apps\r\n * @example Example to create an instance of user cliams service\r\n * //Initializing User Cliams Service\r\n * angular.module('FxPApp').controller('AppController', ['UserClaimsService', AppController]);\r\n * function AppController(userClaimsService){ userClaimsService.getUserThumbnail(upn); }\r\n */\r\nexport class UserClaimsService implements IFxPService {\r\n private http: angular.IHttpService;\r\n private q: angular.IQService;\r\n private rootScope: IRootScope;\r\n private timeout: angular.ITimeoutService;\r\n private sleepInterval: number;\r\n private msalAuthenticationService: MsalAuthenticationService;\r\n private claimsApiEndpoint: string;\r\n private tenantClaimsApiEndpoint: string;\r\n private loggedInUserAlias: string;\r\n private fxplogger: ILogger;\r\n private fxpcontext: FxpContext;\r\n private userAlias: string;\r\n private fxpMessageSvc: FxpMessageService;\r\n private iReqCount: number = 0;\r\n private iTenantReqCount: number = 0;\r\n private userInfoService: UserInfoService;\r\n public currentUserAlias;\r\n private sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.UserClaimsService`;\r\n\r\n constructor($http: angular.IHttpService, $q: angular.IQService, $rootScope: IRootScope, $timeout: angular.ITimeoutService, loggerService: ILogger,\r\n msalAuthenticationService: MsalAuthenticationService, fxpMessage: FxpMessageService, fxpContext: FxpContext,\r\n userInfoService: UserInfoService, private fxpConfiguration: FxpConfigurationService, private globalStoreService: FxpGlobalStoreService, private userProfileService: UserProfileService) {\r\n this.http = $http;\r\n this.q = $q;\r\n this.rootScope = $rootScope;\r\n this.timeout = $timeout;\r\n this.sleepInterval = 100;\r\n this.msalAuthenticationService = msalAuthenticationService;\r\n this.fxplogger = loggerService;\r\n this.fxpMessageSvc = fxpMessage;\r\n this.fxpcontext = fxpContext;\r\n this.userAlias = \"\";\r\n this.loggedInUserAlias = \"\";\r\n this.currentUserAlias = \"\";\r\n this.userInfoService = userInfoService;\r\n let authStore = window[\"tenantConfiguration\"].AuthStore || {};\r\n this.claimsApiEndpoint = authStore.UserClaimsEndPoint;\r\n this.tenantClaimsApiEndpoint = authStore.TenantClaimsEndPoint;\r\n }\r\n\r\n\r\n /**\r\n * Gets userclaims of the logged in user from the fxp context for an application.\r\n * @method Fxp.Services.UserClaimsService.getLoggedInUserClaims\r\n * @param {ApplcationId } appId application name for which the roles defined.\r\n * @example Example to invoke getLoggedInUserClaims\r\n * UserClaimsService.getLoggedInUserClaims('oneProfile');\r\n */\r\n getLoggedInUserClaims(appId: string): any {\r\n return this.getUserClaimsForAlias(appId, this.userInfoService.getLoggedInUserOID());\r\n }\r\n\r\n /**\r\n * Gets tenant claims of the logged in user from the fxp context for an application.\r\n * @method Fxp.Services.UserProfileService.getUserClaims\r\n * @param {string } tenantId tenant id for which the roles defined.\r\n * @example Example to invoke getUserClaims\r\n * UserClaimsService.getUserClaims('oneProfile');\r\n */\r\n getLoggedInUserTenantClaims(tenantId: string): any {\r\n return this.getUserClaimsForAlias(tenantId, this.userInfoService.getLoggedInUserOID());\r\n }\r\n\r\n /**\r\n * Gets userclaims of the logged in user from the fxp context for an application.\r\n * @method Fxp.Services.UserClaimsService.getUserClaims\r\n * @param {string} appId application name for which the roles defined.\r\n * @example Example to invoke getUserClaims\r\n * UserClaimsService.getUserClaims('oneProfile');\r\n */\r\n getUserClaims(appId: string): any {\r\n return this.getUserClaimsForAlias(appId, this.userInfoService.getCurrentUserOID());\r\n }\r\n\r\n /**\r\n * Gets userclaims of the logged in user from the fxp context for an application.\r\n * @method Fxp.Services.UserClaimsService.getUserClaimsForScopes\r\n * @param {string} userAlias alias of the user\r\n * @param {string[]} appId application / tenant names for which the roles defined.\r\n * @param {string[]} scopes scopes of role, for which the claims has to be returned.\r\n * @param {string} scopeDirection direction on which you want to search the scopes for, this inclues \"Exact\", \"ScopeAndAbove\", \"ScopeAndBelow\". By default it is \"ScopeAndBelow\"\r\n * @example Example to invoke getUserClaimsForScopes\r\n * UserClaimsService.getUserClaimsForScopes('your-alias', ['ps','mdm'], ['/contracts/role/abc','/contracts/role/abc'], 'ScopeAndBelow');\r\n */\r\n async getUserClaimsForScopes(userAlias: string, appId: string[], scopes: string[] = [], scopeDirection: string = \"ScopeAndBelow\") {\r\n const self = this;\r\n if(CommonUtils.isNullOrEmpty(userAlias)){\r\n throw new Error('User Alias cannot be null or Empty');\r\n }\r\n if(CommonUtils.isNullOrEmpty(appId)){\r\n throw new Error('Tenant ID cannot be null or empty');\r\n }\r\n let userClaims = await this.getClaimsForUserAlias(userAlias, appId);\r\n if(!CommonUtils.isNullOrEmpty(userClaims.tenantClaims)){\r\n let userClaimsCopy = JSON.parse(JSON.stringify(userClaims));\r\n let tenantClaims = Object.keys(userClaimsCopy.tenantClaims).reduce((accumulator, key)=> {\r\n accumulator[key.toLowerCase()] = userClaimsCopy.tenantClaims[key]; \r\n return accumulator;\r\n },{});\r\n appId = appId.map(app => app.toLowerCase());\r\n let filteredClaims = self.filterRolesBasedOnScopes(tenantClaims, appId, scopes, scopeDirection);\r\n userClaimsCopy.tenantClaims = {};\r\n for(let app of appId){\r\n if(!CommonUtils.isNullOrEmpty(filteredClaims[app])) {\r\n userClaimsCopy.tenantClaims[app] = filteredClaims[app]\r\n }\r\n }\r\n return userClaimsCopy;\r\n } else {\r\n throw new Error('Tenant claims is empty');\r\n }\r\n }\r\n\r\n filterRolesBasedOnScopes(inputClaims, tenants, scopes, scopeDirection) {\r\n if (CommonUtils.isNullOrEmpty(inputClaims)) {\r\n throw new Error('Tenant claims cannot be null.');\r\n }\r\n \r\n let tenantScopesMap = this.formTenantScopeMapping(scopes, tenants);\r\n \r\n for (const tenant of tenants) {\r\n if (CommonUtils.isNullOrEmpty(tenantScopesMap[tenant])) {\r\n continue;\r\n }\r\n\r\n let tenantScopes = tenantScopesMap[tenant];\r\n \r\n const properties = Object.keys(inputClaims[tenant]);\r\n for (let i = 0; i < properties.length; i++) {\r\n const propertyName = properties[i];\r\n \r\n if (propertyName !== 'claims' && propertyName !== 'delegatedClaims') {\r\n break;\r\n }\r\n \r\n let roles = {};\r\n if (propertyName === 'claims') {\r\n roles = inputClaims[tenant].claims.roles;\r\n inputClaims[tenant].claims.resourcePermissions = [];\r\n } else if (propertyName === 'delegatedClaims') {\r\n roles = inputClaims[tenant].delegatedClaims.roles;\r\n inputClaims[tenant].delegatedClaims.resourcePermissions = [];\r\n }\r\n let filteredScopes = [];\r\n \r\n for (const roleName in roles) {\r\n if (!roles.hasOwnProperty(roleName)) {\r\n continue;\r\n }\r\n \r\n const roleObj = roles[roleName];\r\n \r\n if (!roleObj || !roleObj.Scopes) {\r\n continue;\r\n }\r\n \r\n const roleScopes = roleObj.Scopes;\r\n \r\n switch (scopeDirection) {\r\n case 'None':\r\n filteredScopes = [];\r\n break;\r\n case 'Exact':\r\n filteredScopes = roleScopes.filter((scope) =>tenantScopes.includes(scope));\r\n break;\r\n case 'ScopeAndBelow':\r\n filteredScopes = roleScopes.filter((roleScope) => {\r\n return tenantScopes.some((tenantScope) =>\r\n this.filterScope(roleScope, tenantScope)\r\n );\r\n });\r\n break;\r\n case 'ScopeAndAbove':\r\n filteredScopes = roleScopes.filter((roleScope) => tenantScopes.some((tenantScope) => tenantScope.startsWith(roleScope)));\r\n break;\r\n default:\r\n throw new Error('Invalid search direction');\r\n }\r\n \r\n if (filteredScopes.length === 0) {\r\n if (propertyName === 'claims') {\r\n delete inputClaims[tenant].claims.roles[roleName];\r\n } else if (propertyName === 'delegatedClaims') {\r\n delete inputClaims[tenant].delegatedClaims.roles[roleName];\r\n }\r\n } else {\r\n if (propertyName === 'claims') {\r\n inputClaims[tenant].claims.roles[roleName].Scopes = filteredScopes;\r\n if(roleObj.resourcePermissions){\r\n for (const permission of roleObj.resourcePermissions) {\r\n const existingPermission = inputClaims[tenant].claims.resourcePermissions.find((existingPermission) => \r\n existingPermission.resource.toLowerCase() === permission.resource.toLowerCase());\r\n if (existingPermission) {\r\n existingPermission.permissions.push(...permission.permissions);\r\n existingPermission.permissions = Array.from(\r\n new Set(existingPermission.permissions)\r\n );\r\n continue;\r\n }\r\n inputClaims[tenant].claims.resourcePermissions.push(permission);\r\n }\r\n }\r\n } else if (propertyName === 'delegatedClaims') {\r\n inputClaims[tenant].delegatedClaims.roles[roleName].Scopes = filteredScopes;\r\n if(roleObj?.DefaultPermisssions){\r\n for (const permission of roleObj.DefaultPermisssions) {\r\n const existingPermission =\r\n inputClaims[tenant].delegatedClaims.resourcePermissions.find(\r\n (existingPermission) =>\r\n existingPermission.resource.toLowerCase() ===\r\n permission.resource.toLowerCase()\r\n );\r\n \r\n if (existingPermission) {\r\n existingPermission.permissions.push(...permission.permissions);\r\n existingPermission.permissions = Array.from(\r\n new Set(existingPermission.permissions)\r\n );\r\n continue;\r\n }\r\n inputClaims[tenant].delegatedClaims.resourcePermissions.push(permission);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return inputClaims;\r\n }\r\n\r\n formTenantScopeMapping(scopes, tenants) {\r\n let tenantScopesMap = {};\r\n (tenants ?? []).forEach((tenant) => {\r\n tenantScopesMap[tenant] = [];\r\n });\r\n\r\n if (scopes && scopes.length > 0) {\r\n (scopes ?? []).forEach((scope) => {\r\n let modifiedScope = scope.replace(/^\\/+/, '');\r\n let tenantMatch = tenants.find((tenant) =>\r\n modifiedScope.toLowerCase().startsWith(tenant.toLowerCase())\r\n );\r\n if (tenantMatch) {\r\n let tenantTrimmedScope =\r\n modifiedScope.indexOf('/') >= 0\r\n ? modifiedScope.substring(modifiedScope.indexOf('/'))\r\n : null;\r\n if (tenantTrimmedScope) {\r\n tenantScopesMap[tenantMatch].push(tenantTrimmedScope);\r\n }\r\n }\r\n });\r\n }\r\n return tenantScopesMap;\r\n }\r\n filterScope(roleScope, headerScope) {\r\n const roleParts = roleScope.split('/');\r\n const headerParts = headerScope.split('/');\r\n if (headerParts.length > roleParts.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < headerParts.length; i++) {\r\n if (headerParts[i].toLowerCase() !== roleParts[i].toLowerCase()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets userclaims of the logged in user from the fxp context for an application.\r\n * @method Fxp.Services.UserProfileService.getUserClaims\r\n * @param {ApplcationId } appId application name for which the roles defined.\r\n * @example Example to invoke getUserClaims\r\n * UserClaimsService.getUserClaims('oneProfile');\r\n */\r\n getUserTenantClaims(tenantId: string): any {\r\n return this.getUserTenatClaimsByObjectId(this.userInfoService.getCurrentUserOID(), tenantId);\r\n }\r\n\r\n /**\r\n * Gets userclaims of the user from the fxp context for an application.\r\n * @method Fxp.Services.UserProfileService.getUserClaims\r\n * @param {ApplcationId } appId application name for which the roles defined.\r\n * @example Example to invoke getUserClaims\r\n * UserClaimsService.getUserClaims('oneProfile');\r\n */\r\n\r\n private getUserClaimsForAlias(appId: string, objectId: string): any {\r\n let userClaimsLocalStorage = this.getClaimsFromLocalStorage(objectId);\r\n let genericPropBag = this.getClaimsPropertyBag(objectId, appId, \"AppId\");\r\n const telemetry_source = `${this.sourceForTelemetry}.GetUserClaimsForAlias`;\r\n if (CommonUtils.isNullOrEmpty(userClaimsLocalStorage)) {\r\n this.fxplogger.logError(telemetry_source, this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessageTitle, ErrorCodes.AuthSerive_UserClaimsEmptyInLocalStorage, null, genericPropBag, null, null, ErrorSeverityLevel.High);\r\n throw new Error(this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessage);\r\n }\r\n let userClaims = JSON.parse(userClaimsLocalStorage);\r\n if (CommonUtils.isNullOrEmpty(appId))\r\n return userClaims.Applications;\r\n\r\n if (!userClaims.Applications || Object.keys(userClaims.Applications).indexOf(appId) < 0) {\r\n this.fxplogger.logError(telemetry_source, this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessageTitle, ErrorCodes.AuthSerive_MissingApplicationObjectInClaims, null, genericPropBag, null, null, ErrorSeverityLevel.High);\r\n throw new Error(this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessage);\r\n }\r\n\r\n let application = userClaims.Applications[appId];\r\n\r\n if (application.Roles === undefined || Object.keys(application.Roles).length === 0) {\r\n this.fxplogger.logError(telemetry_source, this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppRoleError.ErrorMessageTitle, ErrorCodes.AuthSerive_MissingRolesObjectInClaims, null, genericPropBag, null, null, ErrorSeverityLevel.High);\r\n throw new Error(this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppRoleError.ErrorMessage);\r\n }\r\n return application;\r\n }\r\n\r\n private getClaimsPropertyBag(alias: string, entityId: string, entityType: string): LogPropertyBag {\r\n let propertyBag = this.fxplogger.createPropertyBag();\r\n try {\r\n let localStorageValue = this.getClaimsFromLocalStorage(alias);\r\n propertyBag.addToBag('alias', alias);\r\n propertyBag.addToBag(`${entityType}`, entityId);\r\n\r\n if (!CommonUtils.isNullOrEmpty(localStorageValue)) {\r\n let claimsData = JSON.parse(localStorageValue);\r\n propertyBag.addToBag(\"localStorage-V1Claims\", CommonUtils.objectToString(claimsData.Applications));\r\n propertyBag.addToBag(\"localStorage-V2Claims\", CommonUtils.objectToString(claimsData.tenantClaims));\r\n propertyBag.addToBag(\"localStorage-ErrorInfor\", CommonUtils.objectToString(claimsData.ErrorInfo));\r\n }\r\n else {\r\n propertyBag.addToBag(\"IsLocalStorageEmpty\", 'True');\r\n }\r\n\r\n }\r\n catch (e) {\r\n //ingore if something is breaking. \r\n }\r\n return propertyBag;\r\n }\r\n /**\r\n * Gets tenant claims of the user based on alias and tenantId\r\n * @method Fxp.Services.UserProfileService.getUserTenatClaimsByAlias\r\n * @param {string } alias user alias information\r\n * @param {string } tenantId tenant id\r\n * @example Example to invoke getUserTenatClaimsByAlias\r\n * UserClaimsService.getUserTenatClaimsByAlias('oneProfile');\r\n */\r\n private getUserTenatClaimsByObjectId(objectId: string, tenantId?: string): any {\r\n let claimsLocalStorage = this.getClaimsFromLocalStorage(objectId);\r\n let genericPropBag = this.getClaimsPropertyBag(objectId, tenantId, \"TenantId\");\r\n const telemetry_source = `${this.sourceForTelemetry}.GetUserTenatClaimsByAlias`;\r\n\r\n if (CommonUtils.isNullOrEmpty(claimsLocalStorage)) {\r\n this.fxplogger.logError(telemetry_source, this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessageTitle, ErrorCodes.AuthSerive_TenantClaimsEmptyInLocalStorage, null, genericPropBag, null, null, ErrorSeverityLevel.High);\r\n throw new Error(this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessage);\r\n }\r\n let claimsData = JSON.parse(claimsLocalStorage);\r\n if (CommonUtils.isNullOrEmpty(tenantId))\r\n return claimsData.tenantClaims;\r\n\r\n if (Object.keys(claimsData.tenantClaims).indexOf(tenantId) < 0) {\r\n\r\n this.fxplogger.logError(telemetry_source, this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessageTitle, ErrorCodes.AuthSerive_TenantObjectMissingInClaims, null, genericPropBag, null, null, ErrorSeverityLevel.High);\r\n throw new Error(this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessage);\r\n }\r\n let tenant = claimsData.tenantClaims[tenantId];\r\n if (tenant.claims === undefined || Object.keys(tenant.claims).length === 0) {\r\n this.fxplogger.logError(telemetry_source, this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppRoleError.ErrorMessageTitle, ErrorCodes.AuthSerive_ClaimsMissingInTenantObject, null, genericPropBag, null, null, ErrorSeverityLevel.High);\r\n throw new Error(this.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppRoleError.ErrorMessage);\r\n }\r\n\r\n return tenant;\r\n }\r\n\r\n public isV2ClaimsTenantId(appId: string): boolean {\r\n let result: boolean = false;\r\n let alias = this.userInfoService.getCurrentUser();\r\n\r\n\r\n var claimsData = this.globalStoreService.GetPlatformState().LoggedInUser.Claims;\r\n if (!CommonUtils.isNullOrEmpty(appId) && !CommonUtils.isNullOrEmpty(claimsData) && claimsData.tenantClaims && (Object.keys(claimsData.tenantClaims).indexOf(appId) >= 0)) {\r\n {\r\n result = true;\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n private createClaimsPropertyBag(claimId: string, claims: any, method: string): LogPropertyBag {\r\n let propBag = this.fxplogger.createPropertyBag();\r\n propBag.addToBag('Method', method);\r\n propBag.addToBag('ClaimId', claimId);\r\n propBag.addToBag('V1Claims', CommonUtils.objectToString(claims.Applications));\r\n propBag.addToBag('V2Claims', CommonUtils.objectToString(claims.tenantClaims));\r\n propBag.addToBag('ErrorInfo', CommonUtils.objectToString(claims.ErrorInfo));\r\n propBag.addToBag('ClaimsURL', this.tenantClaimsApiEndpoint);\r\n return propBag;\r\n }\r\n /**\r\n * this method used get get tenant claims\r\n * @method Fxp.Services.UserProfileService.getTenatClaimsSvc\r\n * @param {string} alias it contains user alias information\r\n * @example Example to invoke getTenatClaimsSvc\r\n * UserClaimsService.getTenatClaimsSvc(alias);\r\n */\r\n getTenatClaimsSvc(objectID, parentDeferred?: any) {\r\n let self = this;\r\n const telemetry_source = `${this.sourceForTelemetry}.GetTenatClaimsSvc`;\r\n let deferred = parentDeferred || self.q.defer();\r\n if (this.tenantClaimsApiEndpoint) {\r\n let url = this.tenantClaimsApiEndpoint + '/User/' + objectID + '/claims';\r\n if (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n self.iTenantReqCount++;\r\n if (self.iTenantReqCount === 5) {\r\n self.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.AuthService_TokenAcquisitionInProgress, null, null, null, null, ErrorSeverityLevel.Medium);\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n return deferred.promise;\r\n }\r\n self.timeout(function () {\r\n self.getTenatClaimsSvc(objectID, deferred);\r\n }, self.sleepInterval);\r\n }\r\n else {\r\n self.iTenantReqCount = 0;\r\n let areHeadersAvailable = window[\"tenantConfiguration\"].AuthStore != null && window[\"tenantConfiguration\"].AuthStore.TenantClaimsHeaders != null;\r\n let currentProcessName = TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + '.Authorization.FetchUserClaims';\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'Fetching User Claims data. ');\r\n\r\n self.fxplogger.logSystemEvent(telemetry_source, eventData, null);\r\n\r\n return areHeadersAvailable ?\r\n this.http.get(url, { headers: window[\"tenantConfiguration\"].AuthStore.TenantClaimsHeaders }) : this.http.get(url);\r\n }\r\n } else {\r\n let defer = self.q.defer();\r\n defer.resolve({ data: { tenantClaims: {} } });\r\n return defer.promise;\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n /**\r\n * Gets user claims by connecting to the service through the url\r\n * @method Fxp.Services.UserProfileService.getUserClaimsSvc\r\n * @example Example to invoke getUserClaimsSvc\r\n * UserClaimsService.getUserClaimsSvc();\r\n */\r\n getUserClaimsSvc(alias: string, parentDeferred?: any): angular.IPromise {\r\n let self = this;\r\n let deferred = parentDeferred || self.q.defer();\r\n let url: string;\r\n const telemetry_source = `${this.sourceForTelemetry}.GetUserClaimsSvc`;\r\n if (self.claimsApiEndpoint) {\r\n this.getObjectIdFromIdentifier(alias).then(function (result) {\r\n let OID = result;\r\n url = self.claimsApiEndpoint + \"/User/\" + OID + \"/claims\";\r\n this.fxplogger.startTrackPerformance(PerfMarkers.GetUserClaims);\r\n if (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n self.iReqCount++;\r\n if (self.iReqCount == 5) {\r\n self.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.AuthService_TokenAcquisitionInProgress_TenantClaims, null, null, null, null, ErrorSeverityLevel.Medium);\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n return deferred.promise;\r\n }\r\n self.timeout(function () {\r\n self.getUserClaimsSvc(alias);\r\n }, self.sleepInterval);\r\n }\r\n else {\r\n this.iReqCount = 0;\r\n return this.http.get(url);\r\n }\r\n self.fxplogger.stopTrackPerformance(PerfMarkers.GetUserClaims);\r\n });\r\n }\r\n else {\r\n let defer = self.q.defer();\r\n //returning empty claims if profile api is not configured\r\n defer.resolve({ data: { \"Applications\": {} } });\r\n return defer.promise;\r\n }\r\n return deferred.promise;\r\n }\r\n \r\n getObjectIdFromIdentifier(useridentifier: string): angular.IPromise {\r\n var self = this;\r\n let deferred = this.q.defer();\r\n if (CommonUtils.isGuid(useridentifier))\r\n deferred.resolve(useridentifier);\r\n\r\n else if (useridentifier.toLowerCase() == self.userInfoService.getLoggedInUser().toLowerCase())\r\n deferred.resolve(self.userInfoService.getLoggedInUserOID());\r\n\r\n\r\n else if (useridentifier.toLowerCase() == self.userInfoService.getCurrentUser().toLowerCase())\r\n deferred.resolve(self.userInfoService.getCurrentUserOID());\r\n\r\n\r\n else {\r\n // get oid from one profile call\r\n self.userProfileService.getBasicProfileByAlias(useridentifier).then(function (loggedInUserInfo: any) {\r\n var userinfo = loggedInUserInfo;\r\n deferred.resolve(userinfo.aadObjectId);\r\n });\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n /**\r\n * This is a temporary method used to get claims for the given alias.\r\n * This method is written to ensure that error cases are gracefully handled by partners\r\n * @param alias Alias of the user\r\n * @param tenants List of Tenants for which claims are needed. If not passed then the list is picked from tenant configuration\r\n */\r\n getClaimsForUserAlias(alias: string, tenants?: string[]): angular.IPromise {\r\n let self = this;\r\n let deferred = this.q.defer();\r\n const telmetry_source = `${this.sourceForTelemetry}.GetClaimsForUserAlias`;\r\n\r\n self.getObjectIdFromIdentifier(alias).then(function (oid) {\r\n let objectID = oid;\r\n var parsedClaims = self.getClaimsFromGlobalStore(objectID);\r\n\r\n if (!CommonUtils.isNullOrEmpty(parsedClaims)) {\r\n deferred.resolve(parsedClaims);\r\n return deferred.promise;\r\n }\r\n let claimsEndpoint = self.tenantClaimsApiEndpoint + \"/User/\" + objectID + \"/claims\";\r\n let tenantheaders = tenants === undefined || tenants === null || tenants.length === 0\r\n ? window[\"tenantConfiguration\"].AuthStore.TenantClaimsHeaders\r\n : { \"X-Tenants\": tenants.join(\",\") };\r\n\r\n self.http.get(claimsEndpoint, {\r\n headers: tenantheaders\r\n }).then(response => {\r\n let properties = self.fxplogger.createPropertyBag();\r\n properties.addToBag(\"Alias\", alias);\r\n let systemEvent = new SystemEvent(`${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.ClaimsCallSuccessfull`, ComponentType.Web, `Claims received for alias: ${alias}`);\r\n self.fxplogger.logSystemEvent(self.sourceForTelemetry, systemEvent, properties, null, null);\r\n var responseData = JSON.stringify(response.data);\r\n self.dispatchClaimsAction(responseData, objectID);\r\n deferred.resolve(response.data);\r\n }, error => {\r\n let properties = self.fxplogger.createPropertyBag();\r\n properties.addToBag(\"UserAlias\", alias);\r\n self.fxplogger.logException(telmetry_source,\r\n error,\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.Critical,\r\n ErrorCodes.ProfileServiceFailure);\r\n deferred.reject(error)\r\n });\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n /**\r\n * This method is used to get user claims by Object ID\r\n * This method is written to ensure that error cases are gracefully handled by partners\r\n * @param objectId Object ID of the user\r\n * @param tenants List of Tenants for which claims are needed. If not passed then the list is picked from tenant configuration\r\n */\r\n getClaimsByObjectId(objectId: string, tenants?: string[]): angular.IPromise {\r\n let self = this;\r\n let deferred = this.q.defer();\r\n const telmetry_source = `${this.sourceForTelemetry}.GetClaimsByObjectId`;\r\n var parsedClaims = self.getClaimsFromGlobalStore(objectId);\r\n\r\n if (!CommonUtils.isNullOrEmpty(parsedClaims)) {\r\n deferred.resolve(parsedClaims);\r\n return deferred.promise;\r\n }\r\n let claimsEndpoint = this.tenantClaimsApiEndpoint + \"/User/\" + objectId + \"/claims\";\r\n let tenantheaders = tenants === undefined || tenants === null || tenants.length === 0\r\n ? window[\"tenantConfiguration\"].AuthStore.TenantClaimsHeaders\r\n : { \"X-Tenants\": tenants.join(\",\") };\r\n\r\n this.http.get(claimsEndpoint, {\r\n headers: tenantheaders\r\n }).then(response => {\r\n let properties = self.fxplogger.createPropertyBag();\r\n properties.addToBag(\"ObjectId\", objectId);\r\n let systemEvent = new SystemEvent(`${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.ClaimsCallSuccessfull`, ComponentType.Web, `Claims received for Object ID: ${objectId}`);\r\n self.fxplogger.logSystemEvent(this.sourceForTelemetry, systemEvent, properties, null, null);\r\n var responseData = JSON.stringify(response.data);\r\n self.dispatchClaimsAction(responseData, objectId);\r\n deferred.resolve(response.data);\r\n }, error => {\r\n let properties = self.fxplogger.createPropertyBag();\r\n properties.addToBag(\"ObjectId\", objectId);\r\n self.fxplogger.logException(telmetry_source,\r\n error,\r\n properties,\r\n null,\r\n null,\r\n ErrorSeverityLevel.Critical,\r\n ErrorCodes.ProfileServiceFailure);\r\n deferred.reject(error)\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n /**\r\n * this method used get user claims and tenant cliams based on user alias\r\n * @method Fxp.Services.UserClaimsService.getCalimsSvc\r\n * @param {string} alias it contains user alias info\r\n * @example Example to invoke getCalimsSvc\r\n * UserClaimsService.getCalimsSvc(alias);\r\n */\r\n getCalimsSvc(userIdentifier?: string): angular.IPromise {\r\n let self = this;\r\n let deferred = self.q.defer();\r\n let sendDate = new Date();\r\n const telemetry_source = `${this.sourceForTelemetry}.GetCalimsSvc`;\r\n self.getObjectIdFromIdentifier(userIdentifier).then(function (response) {\r\n let objectId = response;\r\n let customProperties = self.fxplogger.createPropertyBag();\r\n customProperties.addToBag(\"AADObjectId\", objectId);\r\n\r\n var fxpAppLaunched = window.sessionStorage.getItem(ApplicationConstants.FxpApplaunchedKey);\r\n let isAppLaunched = !CommonUtils.isNullOrEmpty(fxpAppLaunched) && fxpAppLaunched === \"true\";\r\n\r\n let claimData;\r\n claimData = self.getClaimsFromGlobalStore(objectId);\r\n\r\n if (isAppLaunched && !CommonUtils.isNullOrEmpty(claimData)) {\r\n self.setUserInfo(claimData);\r\n self.timeout(function () {\r\n deferred.resolve(claimData);\r\n }, self.sleepInterval);\r\n return deferred.promise;\r\n } else {\r\n let appCliams = {};\r\n var localStorageClaims = self.getClaimsFromLocalStorage(objectId);\r\n if (localStorageClaims) {\r\n self.dispatchClaimsAction(localStorageClaims, objectId);\r\n let claims = JSON.parse(localStorageClaims);\r\n if (claims.tenantClaims) {\r\n self.timeout(function () {\r\n try {\r\n deferred.notify(JSON.parse(localStorageClaims));\r\n let currentProcessName = TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + '.Authorization.GetUserClaimsFromCache';\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'User Claims data from browser cache. ');\r\n self.fxplogger.logSystemEvent(telemetry_source, eventData, customProperties);\r\n\r\n } catch (exception) {\r\n self.fxplogger.logException(telemetry_source, exception, customProperties, null, null, ErrorSeverityLevel.Medium, ErrorCodes.AuthService_ErrorNotifyingCachedClaims);\r\n }\r\n }, self.sleepInterval);\r\n }\r\n }\r\n\r\n self.getTenatClaimsSvc(objectId)\r\n .then(function (tResponse) {\r\n if (tResponse.data) {\r\n appCliams = tResponse.data;\r\n self.setUserInfo(appCliams);\r\n self.logClaimsMetrics(sendDate, 'getTenatClaimsSvc() Start');\r\n\r\n if (appCliams[\"tenantClaims\"] == undefined || Object.keys(appCliams[\"tenantClaims\"]).length == 0) {\r\n let propBag = self.createClaimsPropertyBag('', appCliams, 'getCalimsSvc-getTenatClaimsSvc');\r\n self.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessageTitle, ErrorCodes.AuthService_TenantClaimsObjectMissingInClaims, null, propBag, null, null, ErrorSeverityLevel.High);\r\n }\r\n appCliams[\"defaultAppRole\"] = self.getDefaultAppRole(appCliams[\"tenantClaims\"]);\r\n\r\n self.logClaimsMetrics(sendDate, 'getUserAppRolesSvc() End');\r\n }\r\n self.saveClaimsData(objectId, appCliams);\r\n deferred.resolve(appCliams);\r\n }, function (err) {\r\n console.log(\"ClaimsFailed\" + new Date());\r\n self.logClaimsException(err, sendDate);\r\n if (window[\"tenantConfiguration\"].IsAuthorizationRequired || self.rootScope.isLoginRequired) {\r\n let error = {};\r\n if (err.data && err.data.ErrorInfo != null) {\r\n if (err.data.ErrorInfo[\"V1\"] != null)\r\n error = { statusText: \"V1 Claims Call Failed\", status: err.data.ErrorInfo[\"V1\"].responseCode, config: err.config };\r\n if (err.data.ErrorInfo[\"V2\"] != null)\r\n error = { statusText: \"V2 Claims Call Failed\", status: err.data.ErrorInfo[\"V2\"].responseCode, config: err.config };\r\n if (!err.data.ErrorInfo) {\r\n error = { statusText: \"Claims service call failed with unknown reasons - Error information not found\" };\r\n }\r\n }\r\n else {\r\n error = { statusText: \"Claims service call failed with unknown reasons - Error data not found\" };\r\n }\r\n let genericPropBag = self.fxplogger.createPropertyBag();\r\n genericPropBag.addToBag(FxpConstants.metricConstants.IsLoginRequired, self.rootScope.isLoginRequired);\r\n genericPropBag.addToBag(FxpConstants.metricConstants.Error, JSON.stringify(error));\r\n self.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.GetUserClaimsSvcReturnsError.ErrorMessageTitle, ErrorCodes.AuthService_APICallFailedWithUnknownReason, null, genericPropBag, null, null, ErrorSeverityLevel.Critical);\r\n deferred.reject(error);\r\n }\r\n else {\r\n\r\n if (self.getClaimsFromLocalStorage(objectId)) {\r\n appCliams[\"defaultAppRole\"] = self.getClaimsFromLocalStorage(objectId);\r\n }\r\n else {\r\n appCliams[\"defaultAppRole\"] = self.getDefaultAppRole(null);\r\n self.saveClaimsData(objectId, appCliams);\r\n }\r\n deferred.resolve(appCliams);\r\n }\r\n });\r\n\r\n\r\n }\r\n }, function (err) {\r\n self.logClaimsException(err, sendDate);\r\n deferred.reject(err);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n private dispatchClaimsAction(localStorageClaims: string, objectId: string) {\r\n var self = this;\r\n if (objectId == self.userInfoService.getLoggedInUserOID()) {\r\n self.globalStoreService.DispatchGlobalAction(\"Platform\", AddLoggedInUserClaims(JSON.parse(localStorageClaims)));\r\n }\r\n if (objectId == self.userInfoService.getCurrentUserOID()) {\r\n self.globalStoreService.DispatchGlobalAction(\"Platform\", AddCurrentUserClaims(JSON.parse(localStorageClaims)));\r\n\r\n }\r\n }\r\n\r\n private getClaimsFromGlobalStore(objectId: string) {\r\n var self = this;\r\n var claimData;\r\n if (objectId == self.userInfoService.getLoggedInUserOID()) {\r\n claimData = self.globalStoreService.GetPlatformState().LoggedInUser.Claims;\r\n }\r\n else if (objectId == self.userInfoService.getCurrentUserOID()) {\r\n let currentClaims = self.globalStoreService.GetPlatformState().CurrentUser.Claims;\r\n if (!CommonUtils.isNullOrEmpty(currentClaims) && objectId == currentClaims.aadObjectId)\r\n claimData = currentClaims;\r\n }\r\n\r\n return claimData;\r\n }\r\n\r\n /**\r\n * this method is used to save claims data into session storage\r\n * @method Fxp.Services.UserClaimsService.setUserInfo\r\n * @param {string} alias user alias\r\n * @param {Object} claimsData it contains claims data\r\n * @example Example to invoke saveClaimsData\r\n * UserClaimsService.saveClaimsData(alias, claimsData, sessionkey, contextkey);\r\n */\r\n saveClaimsData(objectId: string, claimsData): void {\r\n let strCalimsData = JSON.stringify(claimsData);\r\n var self = this;\r\n this.dispatchClaimsAction(strCalimsData, objectId);\r\n localStorage[FxpConstants.CONST.fxpUserClaimsSession + \"_\" + objectId] = strCalimsData;\r\n this.fxpcontext.saveContext(objectId + '-' + ApplicationConstants.UserClaims, strCalimsData);\r\n let alias = self.getAliasFromOID(objectId);\r\n if (!CommonUtils.isNullOrEmpty(alias)) {\r\n localStorage[FxpConstants.CONST.fxpUserClaimsSession + \"_\" + alias.toLowerCase()] = strCalimsData;\r\n this.fxpcontext.saveContext(alias.toLowerCase() + '-' + ApplicationConstants.UserClaims, strCalimsData);\r\n }\r\n }\r\n getAliasFromOID(objectId: string): string {\r\n return objectId == this.userInfoService.getLoggedInUserOID() ? this.userInfoService.getLoggedInUser() :\r\n objectId == this.userInfoService.getCurrentUserOID() ? this.userInfoService.getCurrentUser() : \"\";\r\n }\r\n /**\r\n * this method is used to log get user cliams api response metrics\r\n * @method Fxp.Services.UserClaimsService.logUserClaimsMetrics\r\n * @param {date} sendDate it contains user claims service intiate date and time\r\n * @example Example to invoke saveClaimsData\r\n * UserClaimsService.logUserClaimsMetrics(sendDate);\r\n */\r\n private logClaimsMetrics(sendDate, logInfo: string): void {\r\n let self = this,\r\n propbag = self.fxplogger.createPropertyBag(),\r\n receiveDate = new Date(),\r\n responseTime = receiveDate.getTime() - sendDate.getTime(); // in millisecs\r\n\r\n propbag.addToBag(FxpConstants.metricConstants.StartTime, sendDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.EndTime, receiveDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.ServiceName, FxpConstants.metricConstants.GetBasicProfileSvcName);\r\n\r\n self.fxplogger.logMetric(self.sourceForTelemetry, FxpConstants.metricConstants.UserClaimsResponseTime, responseTime, propbag);\r\n //self.fxplogger.logInformation(self.classNameUserClaimsService, logInfo);\r\n }\r\n\r\n /**\r\n * this method is used to log exception details of user cliams api =\r\n * @method Fxp.Services.UserClaimsService.logUserClaimsException\r\n * @param {object} exception it contains exception details\r\n * @param {date} sendDate it contains user claims service intiate date and time\r\n * @example Example to invoke logUserClaimsException\r\n * UserClaimsService.logUserClaimsException(exception,sendDate);\r\n */\r\n private logClaimsException(exception, sendDate): void {\r\n let self = this, propbag = self.fxplogger.createPropertyBag(),\r\n receiveDate = new Date(),\r\n responseTime = receiveDate.getTime() - sendDate.getTime();\r\n propbag.addToBag(FxpConstants.metricConstants.Status, exception.status);\r\n propbag.addToBag(FxpConstants.metricConstants.StatusText, exception.statusText);\r\n propbag.addToBag(FxpConstants.metricConstants.ErrorUrl, exception.config ? exception.config.url : '');\r\n propbag.addToBag(FxpConstants.metricConstants.ErrorText, exception.data ? JSON.stringify(exception.data) : '');\r\n self.fxplogger.logError(`${self.sourceForTelemetry}.LogClaimsException`, self.rootScope.fxpUIConstants.UIMessages.AuthServiceReturnsBlankAppError.ErrorMessageTitle, ErrorCodes.AuthService_UnknownException, \"\", propbag, null, null, ErrorSeverityLevel.High);\r\n propbag.addToBag(FxpConstants.metricConstants.StartTime, sendDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.EndTime, receiveDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.ServiceName, FxpConstants.metricConstants.GetUserClaimsSvcName);\r\n self.fxplogger.logMetric(self.sourceForTelemetry, FxpConstants.metricConstants.UserClaimsResponseTimeError, responseTime, propbag);\r\n if (window[\"tenantConfiguration\"].IsAuthorizationRequired)\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AuthzServiceReturnsError.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n\r\n /**\r\n * this method is used to get is Acting On Behalf Of is activate\r\n * @example Example to invoke logTenantClaimsException\r\n * UserClaimsService.isObo();\r\n */\r\n private isObo(): boolean {\r\n return this.userInfoService.isActingOnBehalfOf();\r\n }\r\n\r\n /**\r\n * this method is used to set the Upn and AAD Object ID for the Resepective users\r\n * @method Fxp.Services.UserClaimsService.setUserInfo\r\n * @param {claimsData } claimsData user cliams\r\n * @example Example to invoke setUserInfo\r\n * UserClaimsService.setUserInfo(claimsData);\r\n */\r\n private setUserInfo(claimsData): void {\r\n this.userInfoService.setCurrentUserUpn(claimsData.upn);\r\n }\r\n\r\n /**\r\n * intializing current user alias\r\n * @method Fxp.Services.UserClaimsService.setCurrentUser\r\n * @param {string } alias it contains user alias\r\n * @example Example to invoke setCurrentUser\r\n * UserClaimsService.setCurrentUser(alias);\r\n */\r\n setCurrentUser(alias: string) {\r\n this.userAlias = alias;\r\n this.currentUserAlias = alias;\r\n }\r\n\r\n getUserRoles(alias?: string): angular.IPromise {\r\n let self = this;\r\n let deferred = self.q.defer();\r\n let listOfRoles = [];\r\n let userIdentifier = alias || self.userInfoService.getCurrentUser();\r\n if(CommonUtils.isNullOrEmpty(userIdentifier))\r\n userIdentifier = self.userInfoService.getCurrentUserOID();\r\n try {\r\n self.getCalimsSvc(userIdentifier)\r\n .then(function (response) {\r\n let result = response;\r\n if (result.Applications) {\r\n _.each(result.Applications, function (app) {\r\n var appName = app.ApplicationName;\r\n _.each(app.Roles, function (role) {\r\n listOfRoles.push(appName + \".\" + role.RoleName);\r\n });\r\n });\r\n }\r\n if (result.tenantClaims) {\r\n for (let npd in result.tenantClaims) {\r\n _.each(result.tenantClaims[npd].claims.roles, function (role) {\r\n listOfRoles.push(role.roleName);\r\n });\r\n }\r\n }\r\n if (listOfRoles.length == 0) {\r\n //adding dummy app role if user dont have app roles\r\n listOfRoles.push(window[\"tenantConfiguration\"].DefaultAppRole);\r\n }\r\n deferred.resolve(listOfRoles);\r\n });\r\n }\r\n catch (ex) {\r\n deferred.reject(ex);\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.SelectedProfileRoles.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n getUserDelegatedRoles(alias?: string): angular.IPromise {\r\n let self = this;\r\n let deferred = self.q.defer();\r\n let listOfRoles: string[] = [];\r\n let userIdentifier = alias || self.userInfoService.getCurrentUser();\r\n if(CommonUtils.isNullOrEmpty(userIdentifier))\r\n userIdentifier = self.userInfoService.getCurrentUserOID();\r\n try {\r\n self.getCalimsSvc(userIdentifier)\r\n .then(function (response) {\r\n let result = response;\r\n if (result.tenantClaims) {\r\n for (let npd in result.tenantClaims) {\r\n if (result.tenantClaims[npd].delegatedClaims !== undefined\r\n && result.tenantClaims[npd].delegatedClaims !== null\r\n && result.tenantClaims[npd].delegatedClaims.roles !== undefined\r\n && result.tenantClaims[npd].delegatedClaims.roles !== null) {\r\n _.each(result.tenantClaims[npd].delegatedClaims.roles, function (role) {\r\n listOfRoles.push(role.roleName);\r\n });\r\n }\r\n }\r\n }\r\n deferred.resolve(listOfRoles);\r\n });\r\n }\r\n catch (ex) {\r\n deferred.reject(ex);\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.SelectedProfileRoles.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n getUserConsolidatedRoles(alias?: string): angular.IPromise {\r\n let self = this;\r\n let deferred = self.q.defer();\r\n let getUserRolesPromise = self.getUserRoles(alias);\r\n let getUserDelegatedRolesPromise = self.getUserDelegatedRoles(alias);\r\n\r\n let promiseList = [getUserRolesPromise, getUserDelegatedRolesPromise];\r\n self.q.all(promiseList)\r\n .then(function (result) {\r\n if (result === undefined || result === null || result.length === 0) {\r\n deferred.resolve([]);\r\n }\r\n let userRoles = result.length > 0 ? result[0] : [];\r\n let userDelegatedRoles = result.length > 1 ? result[1] : [];\r\n let consolidatedRoles = _.union(userRoles, userDelegatedRoles);\r\n deferred.resolve(consolidatedRoles);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n /**\r\n * userd to get user resources list\r\n * @method Fxp.Services.UserClaimsService.getUserResources\r\n * @param {string } alias it contains user alias\r\n * @example Example to invoke getUserResources\r\n * UserClaimsService.getUserResources(alias);\r\n *\r\n */\r\n getUserResources(objectId?: string) {\r\n let self = this;\r\n let listOfResources = [];\r\n objectId = objectId || self.userInfoService.getCurrentUserOID();\r\n try {\r\n let result = self.getUserTenatClaimsByObjectId(objectId);\r\n if (result && result[window[\"tenantConfiguration\"].NPD]) {\r\n _.each(result[window[\"tenantConfiguration\"].NPD].claims.resourcePermissions, function (item) {\r\n listOfResources.push(item.resource);\r\n });\r\n }\r\n }\r\n catch (ex) {\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.SelectedProfileRoles.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n return listOfResources;\r\n }\r\n\r\n /**\r\n * userd to get user resources list\r\n * @method Fxp.Services.UserClaimsService.getUserResources\r\n * @param {string } alias it contains user alias\r\n * @example Example to invoke getUserResources\r\n * UserClaimsService.getUserResources(alias);\r\n *\r\n */\r\n getUserAdminResources(objectId?: string) {\r\n let self = this;\r\n let listOfResources = [];\r\n objectId = objectId || self.userInfoService.getCurrentUserOID();\r\n try {\r\n let result = self.getUserTenatClaimsByObjectId(objectId);\r\n if (result) {\r\n _.each(result[self.fxpConfiguration.FxpAppSettings.FxpNpd].claims.resourcePermissions, function (item) {\r\n listOfResources.push(item.resource);\r\n });\r\n }\r\n }\r\n catch (ex) {\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.SelectedProfileRoles.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n return listOfResources;\r\n }\r\n\r\n getDefaultAppRole(lstClaims) {\r\n let appRole;\r\n if (lstClaims && lstClaims[window[\"tenantConfiguration\"].NPD]) {\r\n var tenantClaims = lstClaims[window[\"tenantConfiguration\"].NPD];\r\n var prefix = window[\"tenantConfiguration\"].TenantId;\r\n _.each(tenantClaims.claims.roles, function (role) {\r\n if (role.isDefaultRole) {\r\n appRole = prefix + \".\" + role.roleName;\r\n }\r\n });\r\n }\r\n return (appRole) ? appRole : window[\"tenantConfiguration\"].DefaultAppRole;\r\n }\r\n\r\n private getClaimsFromLocalStorage(userIdentifier) {\r\n if (!userIdentifier)\r\n return null;\r\n\r\n let claimsStorageKey = CommonUtils.getSessionStorageUserClaimsKey(userIdentifier);\r\n if (!claimsStorageKey) \r\n return null;\r\n \r\n var localStorageProfile = localStorage[claimsStorageKey];\r\n return localStorageProfile;\r\n }\r\n}\r\n","import { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { IUserContext } from \"../interfaces/IUserContext\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"../services/fxp.global.store.service\";\r\nimport { Profile } from \"../../app/profile/profile.model\";\r\nimport { Claims } from \"../../app/claims/claims.model\";\r\n/**\r\n * A service to connect to user profile service to fetch the detaisl of user info and user claims related to partner apps\r\n * @class Fxp.Services.UserInfoService\r\n * @classdesc A service to connect to user profile service to fetch the user profile details and claims \r\n * @example Example to create an instance of user profile service \r\n * //Initializing User Profile Service\r\n * angular.module('FxPApp').service('UserInfoService', [UserInfoService]); \r\n */\r\nexport class UserInfoService implements IFxPService {\r\n\tprivate currentUser: string;\r\n\tprivate loggedInUser: string;\r\n\tprivate loggedInUserOID: string;\r\n\tprivate currentUserOID: string;\r\n\tprivate currentUserUpn: string;\r\n\tprivate loggedInUserUpn: string;\r\n\tprivate OBOUserSession: any;\r\n\tprivate isOboActive: boolean;\r\n\tprivate globalStoreService: FxpGlobalStoreService;\r\n\tconstructor(globalStoreService: FxpGlobalStoreService) {\r\n\t\tthis.currentUser = \"\";\r\n\t\tthis.loggedInUser = \"\";\r\n\t\tthis.currentUserUpn = \"\";\r\n\t\tthis.loggedInUserUpn = \"\";\r\n\t\tthis.loggedInUserOID=\"\";\r\n\t\tthis.currentUserOID=\"\";\r\n\t\tthis.globalStoreService = globalStoreService;\r\n\t}\r\n\tgetCurrentUserProfile():Profile{\r\n\t\treturn this.globalStoreService.GetPlatformState().CurrentUser.Profile;\r\n\t}\r\n\tgetCurrentUserClaims():Claims{\r\n\t\treturn this.globalStoreService.GetPlatformState().CurrentUser.Claims;\r\n\t}\r\n\tgetLoggedInUserProfile():Profile{\r\n\t\treturn this.globalStoreService.GetPlatformState().LoggedInUser.Profile;\r\n\t}\r\n\tpublic \tgetLoggedInUserOID():string{\r\n\t\treturn this.loggedInUserOID;\r\n\t}\r\n\tpublic \tgetCurrentUserOID():string{\r\n\t\treturn this.currentUserOID;\r\n\t}\r\n\tpublic \tsetLoggedInUserOID(aadOID:string){\r\n\t\t this.loggedInUserOID = aadOID;\r\n\t}\r\n\tpublic \tsetCurrentUserOID(aadOID:string){\r\n\t\tthis.currentUserOID = aadOID;\r\n\t}\r\n\tpublic getCurrentUser(): string {\r\n\t\treturn this.currentUser;\r\n\t}\r\n\r\n\tpublic setCurrentUser(alias: string) {\r\n\t\tthis.currentUser = alias ? alias.toLowerCase() : alias;\r\n\t}\r\n\r\n\tpublic getLoggedInUser(): string {\r\n\t\treturn this.loggedInUser;\r\n\t}\r\n\r\n\tpublic setLoggedInUser(alias: string) {\r\n\t\tthis.loggedInUser = alias;\r\n\t}\r\n\r\n\tpublic getCurrentUserUpn(): string {\r\n\t\tlet userClaims = this.getCurrentUserContext().userClaims;\r\n\t\tif (userClaims) {\r\n\t\t\tlet upn = userClaims.upn;\r\n\t\t\treturn upn;\r\n\t\t}\r\n\t\telse return this.getCurrentUser();\r\n\t}\r\n\r\n\tpublic setCurrentUserUpn(upn: string) {\r\n\t\tthis.currentUserUpn = upn;\r\n\t\tthis.setUpAjaxCallsHeaders();\r\n\r\n\t}\r\n\r\n\tpublic getAADObjectIDFromAlias(alias: string): string {\r\n\t\treturn alias == this.getCurrentUser() ? this.currentUserOID : this.loggedInUserOID\r\n\t}\r\n\r\n\tpublic setLoggedInUserUpn(upn: string) {\r\n\t\tthis.loggedInUserUpn = upn;\r\n\t}\r\n\r\n\tpublic getLoggedInUserUpn() {\r\n\t\treturn this.loggedInUserUpn;\r\n\t}\r\n\r\n\tpublic setOBOUserSessionInfo(value: string) {\r\n\t\tthis.OBOUserSession = value;\r\n\t}\r\n\r\n\tpublic getCurrentUserData() {\r\n\t\tvar userInfo;\r\n\t\tvar self = this;\r\n\r\n\t\t//remove sessionStorage and keep the data only in state for loggedinUser\r\n\t\tif (!self.isActingOnBehalfOf()) {\r\n\r\n\t\t\tvar profile = self.getLoggedInUserProfile();\r\n\t\t\tif (profile && !CommonUtils.isNullOrEmpty(profile))\r\n\t\t\t\tuserInfo = JSON.stringify(profile);\r\n\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tuserInfo = self.OBOUserSession;\r\n\t\t}\r\n\t\tif (userInfo) {\r\n\t\t\tuserInfo = JSON.parse(userInfo);\r\n\t\t\treturn userInfo;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic isActingOnBehalfOf() {\r\n\t\treturn this.isOboActive;\r\n\t}\r\n\r\n\tpublic setActingOnBehalfOfFlag(value: boolean) {\r\n\t\tthis.isOboActive = value;\r\n\t}\r\n\r\n\tprivate setUpAjaxCallsHeaders() {\r\n\t\tif (this.isActingOnBehalfOf()) {\r\n\t\t\tlet userClaims = this.getCurrentUserContext().userClaims;\r\n\t\t\tlet upn;\r\n\t\t\tlet aadObjectID;\r\n\t\t\tif (!userClaims) {\r\n\t\t\t\tupn = this.getCurrentUser();\r\n\t\t\t\taadObjectID = this.getAADObjectIDFromAlias(this.getCurrentUser());\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tupn = userClaims.upn;\r\n\t\t\t\taadObjectID = userClaims.aadObjectId;\r\n\t\t\t}\r\n\t\t\t$.ajaxSetup({\r\n\t\t\t\theaders: { \"X-ActonBehalfMode\": 'true', \"X-OnBehalfOfUser\": upn, \"X-OnBehalfOfUserObjectId\": aadObjectID }\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$.ajaxSetup({\r\n\t\t\t\theaders: { \"X-ActonBehalfMode\": 'false', \"X-OnBehalfOfUser\": '', \"X-OnBehalfOfUserObjectId\": '' }\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tpublic getCurrentUserContext(): IUserContext {\r\n\t\tvar self = this;\r\n\t\tlet userData = null;\r\n\t\tlet userClaimsData = null;\r\n\t\tvar profile = self.globalStoreService.GetPlatformState().CurrentUser.Profile;\r\n\r\n\t\tif (!CommonUtils.isNullOrEmpty(profile)) {\r\n\t\t\tuserData = profile\r\n\t\t}\r\n\t\tvar claims = self.globalStoreService.GetPlatformState().CurrentUser.Claims;\r\n\t\tif (!CommonUtils.isNullOrEmpty(claims)) {\r\n\t\t\tuserClaimsData = claims;\r\n\t\t}\r\n\r\n\t\tlet userContext: IUserContext = {\r\n\t\t\tuserInfo: userData,\r\n\t\t\tuserClaims: userClaimsData\r\n\t\t};\r\n\t\treturn userContext;\r\n\t}\r\n}","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { FxpConstants, ApplicationConstants, PerfMarkers, CustomEvents } from \"../common/ApplicationConstants\";\r\nimport { TelemetryContext } from \"../telemetry/telemetrycontext\";\r\nimport { FxpLogHelper } from \"../telemetry/FxpLogHelper\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { FxpMessageService } from \"../../app/banner/FxpMessageService\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { UserProfileService } from \"./userProfileService\";\r\nimport { FeatureFlagService } from \"@fxp/flightingsdk\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"./fxp.global.store.service\";\r\nimport { setLeftnav } from \"../../app/leftNavigation/leftNavigation.action\";\r\nimport { ILeftNavigationGroup } from \"../../app/leftNavigation/leftNavigation.model\";\r\nimport { HideLoader } from \"../../app/loader/loader.actions\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { UpsertFeatureFlags } from \"../../app/flighting/featureFlags.actions\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Services\r\n */\r\n/**\r\n * A service to connect to dashboard service to fetch the leftnav data of the user\r\n * @class Fxp.Services.DashboardService\r\n * @classdesc A service to connect to dashaboard service to fetch the leftnav data \r\n * @example Example to create an instance of dashboard service \r\n * //Initializing DashboardService\r\n * angular.module('FxPApp').controller('LeftNavController', ['DashboardService', LeftNavController]);\r\n * function LeftNavController(dashboardService){ dashboardService.getLeftNavData(userAlias,roleGroupId); }\r\n */\r\ndeclare type IStateService = any;\r\n\r\nexport class DashboardService implements IFxPService {\r\n\tprivate http: angular.IHttpService;\r\n\tprivate q: angular.IQService;\r\n\tprivate rootScope: IRootScope;\r\n\tprivate fxpConfiguration: FxpConfigurationService;\r\n\tprivate timeout: angular.ITimeoutService;\r\n\tprivate sleepInterval: number;\r\n\tprivate fxplogger: ILogger;\r\n\tprivate userAlias: string;\r\n\tprivate fxpMessageSvc: FxpMessageService;\r\n\tprivate userInfoService: UserInfoService;\r\n\tprivate fxpConstants: FxpConstants;\r\n\tprivate fxpTelemetryContext: TelemetryContext;\r\n\tprivate userProfileService: UserProfileService;\r\n\tprivate iCount: number = 0;\r\n\tprivate iReqCount: number = 0;\r\n\tprivate iUCount: number = 0;\r\n\tprivate fxpServiceEndPoint: string;\r\n\tprivate sourceForTelemetry = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.DashboardService`;\r\n\tprivate static _instance: DashboardService;\r\n\tprivate pageTourWaitTime: number = 2000;\r\n\tprivate msalAuthenticationService: MsalAuthenticationService;\r\n\r\n\tprivate static featureFlagPromise: angular.IPromise;\r\n\r\n\tconstructor($http: angular.IHttpService, \r\n\t\t$q: angular.IQService, \r\n\t\t$rootScope: IRootScope, \r\n\t\tfxpConfiguration: FxpConfigurationService, \r\n\t\t$timeout: angular.ITimeoutService, \r\n\t\tloggerService: ILogger, \r\n\t\tmsalAuthenticationService: MsalAuthenticationService, \r\n\t\tfxpMessage: FxpMessageService, \r\n\t\tuserInfoService: UserInfoService,\r\n\t\tfxpTelemetryContext: TelemetryContext, \r\n\t\tuserProfileService: UserProfileService, \r\n\t\tprivate featureFlagService: FeatureFlagService, \r\n\t\tprivate startUpFlightConfig: any,\r\n\t\tprivate globalStoreService: FxpGlobalStoreService\r\n\t\t) {\r\n\t\tthis.http = $http;\r\n\t\tthis.q = $q;\r\n\t\tthis.rootScope = $rootScope;\r\n\t\tthis.timeout = $timeout;\r\n\t\tthis.sleepInterval = 100;\r\n\t\tthis.fxplogger = loggerService;\r\n\t\tthis.fxpMessageSvc = fxpMessage;\r\n\t\tthis.fxpTelemetryContext = fxpTelemetryContext;\r\n\t\tthis.fxpConfiguration = fxpConfiguration;\r\n\t\tthis.userInfoService = userInfoService;\r\n\t\tthis.userProfileService = userProfileService;\r\n\t\tthis.fxpServiceEndPoint = this.fxpConfiguration.FxpAppSettings.FxpServiceEndPoint;\r\n\t\tthis.msalAuthenticationService = msalAuthenticationService;\r\n\t\tif (DashboardService._instance) {\r\n\t\t\treturn DashboardService._instance;\r\n\t\t}\r\n\t\tDashboardService._instance = this;\r\n\t}\r\n\t/**\r\n* Get the Leftnavigation data of the user\r\n* @method Fxp.Services.DashboardService.getLeftNavData\r\n* @param {tenantId } tenantId of the user.\r\n* @param {userRoles } userRoles of the user.\r\n* @example Example to invoke getLeftNavData\r\n* DashboardService.getLeftNavData(tenantId,userRoles);\r\n*/\r\n\tgetLeftNavData(tenantId: string, userProfile: string): angular.IPromise {\r\n\t\tvar deferred = this.q.defer();\r\n\t\tconst telemetry_source = `${this.sourceForTelemetry}.GetLeftNavData`; \r\n\t\tvar url = this.fxpServiceEndPoint + \"/navigation\";\r\n\t\tvar self = this;\r\n\t\tlet currentUser = this.userInfoService.getCurrentUser();\r\n\t\t// if current alias is undefined\r\n\t\tconst leftNavDataKey = currentUser? \"LeftNavData-\" + currentUser.toLowerCase() : \"LeftNavData-\" + this.userInfoService.getCurrentUserOID();\r\n\t\tlet leftNavData = localStorage.getItem(leftNavDataKey);\t\t\r\n\t\tif (leftNavData && leftNavData.length > 0) {\r\n\t\t\ttry {\r\n\t\t\t\tself.globalStoreService.GetPlatformStore().dispatch(setLeftnav(JSON.parse(leftNavData)));\r\n\t\t\t\tlet timeoutHandle = setTimeout(function () {\r\n\t\t\t\t\tleftNavData = JSON.parse(leftNavData);\r\n\t\t\t\t\tdeferred.notify(leftNavData);\r\n\t\t\t\t\tclearTimeout(timeoutHandle);\r\n\t\t\t\t}, 0);\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\t//ingore. \r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.fxplogger.startTrackPerformance(PerfMarkers.GetLeftNavData);\r\n\t\tif (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n\t\t\tself.iReqCount++;\r\n\t\t\tif (self.iReqCount == 5) {\r\n\t\t\t\tself.fxplogger.logError(telemetry_source, self.rootScope.fxpUIConstants.UIMessages.GetLeftNavAuthFailureError.ErrorMessageTitle, ErrorCodes.DashboardService_GetLeftNavDataFailure, null, null, null, null, ErrorSeverityLevel.High);\r\n\t\t\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.GetLeftNavAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\t\t}\r\n\t\t\tself.timeout(function () {\r\n\t\t\t\tself.getLeftNavData(tenantId, userProfile);\r\n\t\t\t}, self.sleepInterval);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tself.iReqCount = 0;\r\n\t\t\tlet requestHeaders = {};\r\n\t\t\trequestHeaders[ApplicationConstants.XTenantId] = tenantId;\r\n\t\t\trequestHeaders[ApplicationConstants.XUserProfileToken] = userProfile;\r\n\t\t\tthis.http.get(url, {\r\n\t\t\t\theaders: requestHeaders\r\n\t\t\t}).then(function (responseData) {\r\n\t\t\t\tlocalStorage[leftNavDataKey] = JSON.stringify(responseData.data);\r\n\t\t\t\tlet data : ILeftNavigationGroup = JSON.parse(JSON.stringify(responseData.data));\r\n\t\t\t\tself.globalStoreService.GetPlatformStore().dispatch(setLeftnav(data));\r\n\t\t\t\tdeferred.resolve(responseData);\r\n\t\t\t\tif (responseData.headers != undefined) {\r\n\t\t\t\t\tvar properties = self.fxplogger.createPropertyBag();\r\n\t\t\t\t\tproperties.addToBag(\"Flighting-Call-Status\", responseData.headers(ApplicationConstants.FlightingStatusHeader));\r\n\t\t\t\t}\r\n\t\t\t}).catch(function (err) {\r\n\t\t\t\tdeferred.reject(err);\r\n\t\t\t});\r\n\t\t}\r\n\t\tself.fxplogger.stopTrackPerformance(PerfMarkers.GetLeftNavData);\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\tgetCachedLeftNavForCurrentUser() {\r\n\t\tlet currentUser = this.userInfoService.getCurrentUser();\r\n\t\tconst leftNavDataKey = currentUser? \"LeftNavData-\" + currentUser.toLowerCase() : \"LeftNavData-\" + this.userInfoService.getCurrentUserOID();\r\n\t\t\r\n\t\tlet leftNavData = JSON.parse(localStorage.getItem(leftNavDataKey));\r\n\t\tthis.globalStoreService.GetPlatformStore().dispatch(setLeftnav(leftNavData));\r\n\t\tif (leftNavData && leftNavData.internalLinks.length > 0) {\r\n\t\t\treturn this.getGLNFlatDataStructure(leftNavData.internalLinks);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t* Get the flat structure of Leftnavigation data\r\n\t* @method Fxp.Services.DashboardService.getGLNFlatDataStructure\r\n\t* @param {leftnavData } leftNavData leftnavigation data of the user.\r\n\t* @example Example to invoke getGLNFlatDataStructure\r\n\t* DashboardService.getGLNFlatDataStructure();\r\n\t*/\r\n\tgetGLNFlatDataStructure(leftNavData: any) {\r\n\t\tvar list = new Array();\r\n\t\tfor (var i = 0, L0length = leftNavData.length; i < L0length; i++) {\r\n\t\t\tif (leftNavData[i].hasChildren) {\r\n\t\t\t\tfor (var j = 0, L1length = leftNavData[i].children.length; j < L1length; j++) {\r\n\t\t\t\t\tlist.push(leftNavData[i].children[j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlist.push(leftNavData[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn list;\r\n\t}\r\n\r\n\t/**\r\n\t* Logging Telemetry Info and Display Error message when FxpUIConfiguration Fetching is Failed by RoleGroupId\r\n\t* @method Fxp.Services.DashboardService.fxpConfigurationFailed\r\n\t* @example Example to invoke fxpConfigurationFailed\r\n\t* DashboardService.fxpConfigurationFailed();\r\n\t*/\r\n\tfxpConfigurationFailed(): void {\r\n\t\tvar self = this;\r\n\t\tvar userData = self.globalStoreService.GetPlatformState().CurrentUser.Profile;\r\n\t\tvar propbag = self.fxplogger.createPropertyBag();\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.SessionId, self.rootScope.sessionId);\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.TimeStamp, FxpLogHelper.getTimeStamp());\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.UserUPN, self.userInfoService.getCurrentUser());\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.UserBusinessRole, userData.businessRole);\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.UserRoleGroup, userData.roleGroupName);\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.UserAgent, navigator.userAgent);\r\n\t\tpropbag.addToBag(FxpConstants.metricConstants.Geography, self.fxpTelemetryContext.getGeography());\r\n\t\tself.fxplogger.logError(`${self.sourceForTelemetry}.FxpConfigurationFailed`, self.rootScope.fxpUIConstants.UIMessages.UserRoleGroupFxpConfigNotFoundError.ErrorMessageTitle, ErrorCodes.FxPConfigurationFailure, \"\", propbag, null, null, ErrorSeverityLevel.High);\r\n\t\tself.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.UserRoleGroupFxpConfigNotFoundError.ErrorMessage, FxpConstants.messageType.error);\r\n\t\tself.globalStoreService.DispatchGlobalAction(\"Platform\", HideLoader({}));\r\n\t}\r\n\r\n\tgetInitialFeatureFlagsForPlatform(): angular.IPromise {\r\n\t\tif (DashboardService.featureFlagPromise) return DashboardService.featureFlagPromise;\r\n\r\n\t\tvar self = this;\r\n\t\tvar context = {};\r\n\t\tvar eventNames = CustomEvents;\r\n\t\tself.rootScope.initialFlags = {}; //to avoid undefined errors\r\n\t\tvar config = self.startUpFlightConfig;\r\n\r\n\t\tvar deferred = this.q.defer();\r\n\t\tself.userProfileService.getLoggedInUserFlighitngContext().then((flightingContext) => {\r\n\t\t\tDashboardService.featureFlagPromise = self.featureFlagService\r\n\t\t\t\t.getFeatureFlags(config.appName, config.envName, config.featureNames, flightingContext)\r\n\t\t\t\t.then(function (response) {\r\n\t\t\t\t\tresponse = self.fxpConfiguration?.FxpAppSettings?.InitialFeatureFlags ?\r\n\t\t\t\t\t{...JSON.parse(self.fxpConfiguration?.FxpAppSettings?.InitialFeatureFlags), ...response} :\r\n\t\t\t\t\tresponse;\r\n\t\t\t\r\n\t\t\t\t\tself.globalStoreService.DispatchGlobalAction(\"Platform\", UpsertFeatureFlags(response));\r\n\t\t\t\t\tlocalStorage[\"FeatureFlags\"] = JSON.stringify(response);\r\n\t\t\t\t\tlet pageTourEnabled = response.pageTourEnabled;\r\n\t\t\t\t\tself.rootScope.initialFlags = response;\r\n\t\t\t\t\tself.rootScope.initialFlags.pageTourEnabled = false;\r\n\r\n\t\t\t\t\t// Remove timeout once pagetour api is optimized.\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\tself.rootScope.initialFlags.pageTourEnabled = pageTourEnabled;\r\n\t\t\t\t\t\tself.rootScope.$emit(eventNames.PageTourFlagRetrieved);\r\n\t\t\t\t\t}, self.pageTourWaitTime);\r\n\r\n\t\t\t\t\tself.rootScope.$emit(eventNames.StartUpFlagRetrieved);\r\n\t\t\t\t\tDashboardService.featureFlagPromise = null;\r\n\t\t\t\t\tdeferred.resolve();\r\n\t\t\t\t}, function (error) {\r\n\t\t\t\t\tself.fxplogger.logException(`${self.sourceForTelemetry}.GetInitialFeatureFlagsForPlatform`, error, null, null, null, ErrorSeverityLevel.High, ErrorCodes.StartUpFlagRetrieveError);\r\n\t\t\t\t\tself.rootScope.$emit(eventNames.StartUpFlagRetrieved);\r\n\t\t\t\t\tDashboardService.featureFlagPromise = null;\r\n\t\t\t\t\tdeferred.reject(error);\r\n\t\t\t\t});\r\n\t\t}, function (error) {\r\n\t\t\tdeferred.reject(error);\r\n\t\t});\r\n\t\treturn deferred.promise;\r\n\r\n\t}\r\n}\r\n","import { Store, Reducer, Middleware } from 'redux';\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpLoggerService } from '../telemetry/fxpLogger';\r\nimport { IPlatformState } from '../../app/store/platform.state.model';\r\nimport { PlatformStoreFactory } from '../../app/store/platform.store.factory';\r\nimport { IAction, IGlobalStore, GlobalStore, AbstractLogger as ILogger } from 'redux-micro-frontend';\r\n\r\n/**\r\n * Summary: Anuglar 1 service to access the global store.\r\n * Description: Angular 1 wrapper on top of the Global Store.\r\n */\r\nexport class FxpGlobalStoreService implements IGlobalStore,IFxPService {\r\n private readonly _globalStore: IGlobalStore;\r\n\r\n constructor(private _logger: FxpLoggerService) {\r\n this._globalStore = GlobalStore.Get(this._logger);\r\n }\r\n\r\n AddSelectors(source: string, selectors: Record, mergeSelectors?: boolean): void {\r\n this._globalStore.AddSelectors(source, selectors, mergeSelectors);\r\n }\r\n\r\n SelectPartnerState(partner: string, selector: string, defaultReturn?: any) {\r\n this._globalStore.SelectPartnerState(partner, selector, defaultReturn);\r\n }\r\n\r\n CreateStore = (appName: string, appReducer: Reducer, middlewares?: Array, globalActions?: Array, shouldReplace: boolean = false, shouldUpdate: boolean = false): Store =>\r\n this._globalStore.CreateStore(appName, appReducer, middlewares, globalActions, shouldReplace, shouldUpdate);\r\n RegisterStore = (appName: string, store: Store, globalActions?: Array, shouldReplace: boolean = false): void => \r\n this._globalStore.RegisterStore(appName, store, globalActions, shouldReplace)\r\n RegisterGlobalActions = (appName: string, actions: Array): void => \r\n this._globalStore.RegisterGlobalActions(appName, actions);\r\n\r\n GetPlatformState = (): any => this._globalStore.GetPlatformState();\r\n GetPlatformStore = (): Store => PlatformStoreFactory.Get();\r\n GetPartnerState = (partnerName: string): any => this._globalStore.GetPartnerState(partnerName);\r\n GetGlobalState = (): any => this._globalStore.GetGlobalState();\r\n\r\n DispatchGlobalAction = (source: string, action: IAction): void =>\r\n this._globalStore.DispatchGlobalAction(source, action);\r\n DispatchLocalAction = (source: string, action: IAction): void => \r\n this._globalStore.DispatchLocalAction(source, action);\r\n DispatchAction = (source: string, action: IAction): void => \r\n this._globalStore.DispatchAction(source, action)\r\n\r\n Subscribe = (source: string, callback: (state: any) => void): () => void => \r\n this._globalStore.Subscribe(source, callback);\r\n SubscribeToPlatformState = (source: string, callback: (state: any) => void): () => void =>\r\n this._globalStore.SubscribeToPlatformState(source, callback);\r\n SubscribeToPartnerState = (source: string, partner: string, callback: (state: any) => void, eager: boolean = true): () => void =>\r\n this._globalStore.SubscribeToPartnerState(source, partner, callback, eager);\r\n SubscribeToGlobalState = (source: string, callback: (state: any) => void): () => void =>\r\n this._globalStore.SubscribeToGlobalState(source, callback);\r\n SetLogger = (logger: ILogger): void => this._globalStore.SetLogger(logger);\r\n}","import { $injector } from \"@uirouter/core\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\nexport class LazyLoaderService implements IFxPService{\r\n\r\n constructor(private $ocLazyLoad){\r\n }\r\n \r\n public getInstance(): ILazyLoaderService{\r\n return this.$ocLazyLoad; \r\n }\r\n}\r\n\r\nexport interface ILazyLoaderService{\r\n load(bundles:Array, options: Object); \r\n}\r\n","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { UserProfileService } from \"./userProfileService\";\r\nimport { AppControllerHelper } from \"../factory/AppControllerHelper\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\n\r\nexport class pageTourEventService implements IFxPService{\r\n\tprivate rootScope: IRootScope;\r\n\tcurrentLeftNavPinState: boolean;\r\n\tisPageTourInProgress: boolean;\r\n\tconstructor($rootScope: IRootScope,\r\n\t\tprivate userProfileService: UserProfileService,\r\n\t\tappControllerHelper: AppControllerHelper\r\n\t) {\r\n\t\tthis.rootScope = $rootScope;\r\n\t\tthis.isPageTourInProgress = false;\r\n\t}\r\n\tinit() {\r\n\t\tvar self = this;\r\n\t\tself.rootScope.$on('pageTour-initialize', function (event) {\r\n\t\t\tself.isPageTourInProgress = true;\r\n\t\t\tself.currentLeftNavPinState = self.rootScope.isLeftNavPinned;\r\n\t\t\tself.rootScope.isLeftNavOpen = true;\r\n\t\t\tself.rootScope.isLeftNavPinned = true;\r\n\t\t\tself.rootScope.isNewTabAllowed = false;\r\n\t\t});\r\n\r\n\t\tself.rootScope.$on('pageTour-Completed', function (event) {\r\n\t\t\tself.isPageTourInProgress = false;\r\n\t\t\tself.rootScope.isLeftNavPinned = self.rootScope.isLeftNavOpen = self.currentLeftNavPinState;\r\n\t\t\tself.rootScope.isNewTabAllowed = true;\r\n\t\t});\r\n\r\n\t\tself.rootScope.$on('collapse-leftNav', function (event) {\r\n\t\t\tself.rootScope.isLeftNavPinned = false;\r\n\t\t\tself.rootScope.isLeftNavOpen = false\r\n\t\t\tself.currentLeftNavPinState = false;\r\n\t\t\tself.rootScope.isNewTabAllowed = true;\r\n\t\t});\r\n\r\n\t\tself.rootScope.$on('reset-leftNav', function (event) {\r\n\t\t\tself.rootScope.isLeftNavPinned = true;\r\n\t\t\tself.rootScope.isLeftNavOpen = true;\r\n\t\t\tself.currentLeftNavPinState = true;\r\n\t\t\tself.rootScope.isNewTabAllowed = true;\r\n\t\t});\r\n\r\n\t}\r\n}","import { IRootScope } from \"../interfaces/IRootScope\";\r\nimport { ILogger } from \"../interfaces/ILogger\";\r\nimport { FxpContext } from \"../context/FxpContext\";\r\nimport { FxpMessageService } from \"../../app/banner/FxpMessageService\";\r\nimport { FxpConstants, ApplicationConstants, PerfMarkers, CustomEvents } from \"../common/ApplicationConstants\";\r\nimport { FxpConfigurationService } from \"./FxpConfiguration\";\r\nimport { TelemetryContext } from \"../telemetry/telemetrycontext\";\r\nimport { UserInfoService } from \"./UserInfoService\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { LogPropertyBag } from \"../telemetry/LogPropertyBag\";\r\nimport { FxpLogHelper } from \"../telemetry/FxpLogHelper\";\r\nimport { UserInfo } from \"../common/UserInfo\";\r\nimport { IHttpPromise } from \"angular\";\r\nimport { FxpBroadcastedEvents } from \"./FxpBroadcastedEvents\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { FxpGlobalStoreService } from \"../services/fxp.global.store.service\";\r\nimport { PlatformStoreFactory } from \"../../app/store/platform.store.factory\";\r\nimport { AddLoggedInUserProfile, AddCurrentUserProfile } from \"../../app/profile/profile.action\";\r\nimport { TelemetryConstants } from \"../telemetry/TelemetryConst\";\r\nimport { SystemEvent } from \"../telemetry/SystemEvent\";\r\nimport { ComponentType } from \"@microsoftit/telemetry-extensions-npm\";\r\nimport { ErrorCodes } from \"../constants/errorCodes\";\r\nimport { ErrorSeverityLevel } from \"../telemetry/ErrorSeverityLevel\";\r\nimport { IUserInfo } from \"../interfaces/IUserInfo\";\r\nimport { MsalAuthenticationService } from \"./MsalAuthenticationService\";\r\n//import { FxpLoggerService } from \"../telemetry/FxpLogger\";\r\n\r\n\r\n/**\r\n * A service to connect to user profile service to fetch the detaisl of user info and user claims related to partner apps\r\n * @class Fxp.Services.UserProfileService\r\n * @classdesc A service to connect to user profile service to fetch the user profile details and claims\r\n * @example Example to create an instance of user profile service\r\n * //Initializing User Profile Service\r\n * angular.module('FxPApp').controller('AppController', ['UserProfileService', AppController]);\r\n * function AppController(userProfileService){ userProfileService.getUserThumbnail(upn); }\r\n */\r\nexport class UserProfileService implements IFxPService {\r\n private q: angular.IQService;\r\n private rootScope: IRootScope;\r\n private timeout: angular.ITimeoutService;\r\n private sleepInterval: number;\r\n private msalAuthenticationService: MsalAuthenticationService;\r\n private profileApiEndpoint: string;\r\n private claimsApiEndpoint: string;\r\n private loggedInUserAlias: string;\r\n private fxplogger: ILogger;\r\n private fxpcontext: FxpContext;\r\n private userAlias: string;\r\n private fxpMessageSvc: FxpMessageService;\r\n private fxpConfiguration: FxpConfigurationService;\r\n private iCount: number = 0;\r\n private iReqCount: number = 0;\r\n private iUCount: number = 0;\r\n private telemetryContext: TelemetryContext;\r\n private userInfoService: UserInfoService;\r\n public currentUserAlias;\r\n private telemetrySource = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.UserProfileService`;\r\n private responseStartTime = 0;\r\n private isBasicProfileRefreshed = true;\r\n private graphAPIProfileUrl: string;\r\n private graphAPIUserThumbnailUrl: string;\r\n private graphAPIUserProfileUrl: string;\r\n private defaultRoleGroupId: number;\r\n private defaultBusinessRoleId: number;\r\n private searchProfileApiEndpoint: string;\r\n private isProfileRequired: boolean;\r\n constructor(private $http: angular.IHttpService, $q: angular.IQService, $rootScope: IRootScope, $timeout: angular.ITimeoutService, loggerService: ILogger, msalAuthenticationService: MsalAuthenticationService, fxpMessage: FxpMessageService, fxpContext: FxpContext, fxpConfiguration: FxpConfigurationService,\r\n fxpTelemetryContext: TelemetryContext, userInfoService: UserInfoService, private globalStoreService: FxpGlobalStoreService) {\r\n this.telemetryContext = fxpTelemetryContext;\r\n this.q = $q;\r\n this.rootScope = $rootScope;\r\n this.timeout = $timeout;\r\n this.sleepInterval = 100;\r\n this.msalAuthenticationService = msalAuthenticationService;\r\n this.fxplogger = loggerService;\r\n this.fxpMessageSvc = fxpMessage;\r\n this.fxpConfiguration = fxpConfiguration;\r\n this.fxpcontext = fxpContext;\r\n this.userAlias = \"\";\r\n this.loggedInUserAlias = \"\";\r\n this.currentUserAlias = \"\";\r\n this.userInfoService = userInfoService;\r\n this.graphAPIProfileUrl = fxpConfiguration.FxpAppSettings.GraphAdEndPoint;\r\n this.graphAPIUserProfileUrl = fxpConfiguration.FxpAppSettings.GraphApiUserProfileUrl;\r\n this.graphAPIUserThumbnailUrl = fxpConfiguration.FxpAppSettings.GraphApiUserThumbnailUrl;\r\n let profileStore = window[\"tenantConfiguration\"].ProfileStore || {};\r\n this.profileApiEndpoint = profileStore.ProfileAPIEndPoint;\r\n this.searchProfileApiEndpoint = profileStore.SearchAPIEndPoint;\r\n this.isProfileRequired = window[\"tenantConfiguration\"].IsProfileRequired;\r\n }\r\n\r\n /**\r\n * Gets thumbnail image from the graph api service\r\n * @method Fxp.Services.UserProfileService.getUserThumbnail\r\n * @param {Email} upn a User Principal Name (UPN) is the name of a system user in an e-mail address format.\r\n * @param {Boolean} deferred a boolean value which is false by default.\r\n * @example Example to invoke getUserThumbnail\r\n * userProfileService.getUserThumbnail('logged in user email');\r\n */\r\n getUserThumbnail(upn: string, parentDeferred: any): any {\r\n let url = this.graphAPIUserProfileUrl + upn + this.graphAPIUserThumbnailUrl;\r\n let deferred = parentDeferred || this.q.defer();\r\n let self = this;\r\n\r\n if (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n self.iCount++;\r\n if (self.iCount == 5) {\r\n // log only error. \r\n self.fxplogger.logError(self.telemetrySource, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.GetUserThumbnail_TokenNotFound, null, null, null, null, ErrorSeverityLevel.Medium);\r\n return deferred.promise;\r\n }\r\n self.timeout(function () {\r\n self.getUserThumbnail(upn, deferred);\r\n }, self.sleepInterval);\r\n }\r\n else {\r\n self.iCount = 0;\r\n let currentProcessName = TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + '.Authorization.FetchUserThumbnail';\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'Fetching user thumbnail from graph');\r\n let customProperties = self.fxplogger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"UserProfileService\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"getUserThumbnail\");\r\n self.fxplogger.logSystemEvent(TelemetryConstants.FXP_TELEMETRY_BASE_NAME + \".UserProfileService\", eventData, customProperties);\r\n\r\n return self.$http({\r\n url: url,\r\n method: \"get\",\r\n responseType: \"blob\"\r\n });\r\n }\r\n\r\n return deferred.promise;\r\n };\r\n\r\n /**\r\n * Gets user's basic profile details by connecting to the service through the url\r\n * @method Fxp.Services.UserProfileService.getBasicUserProfile\r\n * @example Example to invoke getBasicUserProfile\r\n * userProfileService.getBasicUserProfile();\r\n */\r\n getBasicUserProfile(pDeferred: Object, showBanner?: boolean): angular.IPromise {\r\n if (!this.isBasicProfileRefreshed)\r\n console.warn(\"getBasicUserProfile was called before basic profile details were refreshed\");\r\n return this.getBasicProfileByOID(this.userInfoService.getCurrentUserOID(), pDeferred, showBanner);\r\n }\r\n /**\r\n * Gets user's latest basic profile details by connecting to the service through the url\r\n * @method Fxp.Services.UserProfileService.refreshBasicUserProfileInContext\r\n * @example Example to invoke refreshBasicUserProfileInContext\r\n * userProfileService.refreshBasicUserProfileInContext();\r\n */\r\n refreshBasicUserProfileInContext(pDeferred: any): angular.IPromise {\r\n let self = this;\r\n let deferred = pDeferred || this.q.defer();\r\n self.isBasicProfileRefreshed = false;\r\n self.responseStartTime = performance.now();\r\n console.log(\"Basic Profile Api Call Start Time : \" + self.responseStartTime);\r\n self.getBasicProfile(this.currentUserAlias, true, deferred);\r\n return deferred.promise;\r\n }\r\n /**\r\n * Gets user's basic profile details for passed in Alias\r\n * @method Fxp.Services.UserProfileService.getBasicProfileByOID\r\n * @param {Alias} alias an alias of a user\r\n * @param {Object} deferred holds promise of a parent caller if set\r\n * @example Example to invoke getBasicProfileSvc\r\n * userProfileService.getBasicProfileByOID('<>');\r\n */\r\n public getBasicProfileByOID(aadObjectID: string, pDeferred?: any, showBanner?: boolean): angular.IPromise {\r\n let self = this;\r\n let deferred = pDeferred || this.q.defer();\r\n let userData = null;\r\n // Removed as part of FXP Event Cleanup (keep comments for near future reference)\r\n if (self.userInfoService.getLoggedInUserOID() == aadObjectID) {\r\n userData = self.globalStoreService.GetPlatformState().LoggedInUser.Profile;\r\n\r\n }\r\n else if (aadObjectID == self.userInfoService.getCurrentUserOID()) {\r\n let currentProfile = self.globalStoreService.GetPlatformState().CurrentUser.Profile;\r\n if (!CommonUtils.isNullOrEmpty(currentProfile) && aadObjectID == currentProfile.AadObjectId)\r\n userData = currentProfile;\r\n\r\n }\r\n if (!CommonUtils.isNullOrEmpty(userData)) {\r\n self.timeout(() => {\r\n deferred.resolve(userData);\r\n }, self.sleepInterval);\r\n\r\n }\r\n else {\r\n self.getBasicProfile(aadObjectID, true, deferred, showBanner);\r\n }\r\n return deferred.promise;\r\n }\r\n public getBasicProfileByAlias(alias: string, pDeferred?: any, showBanner?: boolean,includeInactiveUser: boolean = false): angular.IPromise {\r\n if (includeInactiveUser)\r\n return this.getBasicProfileByAliasIncludingInActiveUser(alias);\r\n let self = this;\r\n let deferred = pDeferred || this.q.defer();\r\n let userData = null;\r\n // Removed as part of FXP Event Cleanup (keep comments for near future reference)\r\n if (self.loggedInUserAlias == alias) {\r\n userData = self.globalStoreService.GetPlatformState().LoggedInUser.Profile;\r\n\r\n }\r\n else if (alias == self.currentUserAlias) {\r\n let currentProfile = self.globalStoreService.GetPlatformState().CurrentUser.Profile;\r\n if (!CommonUtils.isNullOrEmpty(currentProfile) && alias == currentProfile.alias)\r\n userData = currentProfile;\r\n\r\n }\r\n if (!CommonUtils.isNullOrEmpty(userData)) {\r\n self.timeout(() => {\r\n deferred.resolve(userData);\r\n }, self.sleepInterval);\r\n\r\n }\r\n else {\r\n self.getBasicProfile(alias, true, deferred, showBanner);\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n private getBasicProfileByAliasIncludingInActiveUser(alias: string): angular.IPromise {\r\n var self = this;\r\n var url = self.searchProfileApiEndpoint + '/profile/' + alias+ '?IncludeInactive='+true;\r\n\r\n var deferred = self.q.defer();\r\n\r\n if (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n self.iUCount++;\r\n if (self.iUCount == 5) {\r\n self.fxplogger.logError(self.telemetrySource, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.SearchProfile_TokenMissing, null, null, null, null, ErrorSeverityLevel.Medium);\r\n return deferred.promise;\r\n }\r\n self.timeout(function () {\r\n self.getBasicProfileByAliasIncludingInActiveUser(alias);\r\n }, self.sleepInterval);\r\n }\r\n else {\r\n self.iUCount = 0;\r\n let bag = this.fxplogger.createPropertyBag();\r\n bag.addToBag('Url', url);\r\n const currentProcessName = TelemetryConstants.FXP_TELEMETRY_BASE_NAME + '.getBasicProfileByAliasIncludeInActiveUser';\r\n const eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'User Profile api call');\r\n\r\n self.fxplogger.logSystemEvent(TelemetryConstants.FXP_TELEMETRY_BASE_NAME + \".UserProfileService.getBasicProfileByAliasIncludeInActiveUser\", eventData, bag);\r\n\r\n return self.$http.get(url);\r\n }\r\n return deferred.promise;\r\n }\r\n // get flighting context from user profile data\r\n getFlightingContext(data: any, userUpn: string): any {\r\n let roleGroupIdInternalId = CommonUtils.getPropertyValueCaseInsensitive(data, \"RoleGroupId\");\r\n if (roleGroupIdInternalId === null || roleGroupIdInternalId === undefined) {\r\n roleGroupIdInternalId = -1;\r\n }\r\n let resourceCategoryInternalId = CommonUtils.getPropertyValueCaseInsensitive(data, \"ResourceCategoryId\");\r\n if (resourceCategoryInternalId === null || resourceCategoryInternalId === undefined) {\r\n resourceCategoryInternalId = -1\r\n }\r\n let sDODomainInternalId = CommonUtils.getPropertyValueCaseInsensitive(data, \"SDODomainId\");\r\n if (sDODomainInternalId === null || sDODomainInternalId === undefined) {\r\n sDODomainInternalId = -1;\r\n }\r\n\r\n var FxpAppSettings = FxpAppSettings || window[\"FxpAppSettings\"] || {};\r\n var flightingContext = {};\r\n var opFields = FxpAppSettings.LeftNavFlightingContextProperties;\r\n var opFieldsArray = opFields.split(',');\r\n var field = \"\";\r\n\r\n flightingContext[\"RoleGroupId\"] = roleGroupIdInternalId;\r\n flightingContext[\"ResourceCategoryId\"] = resourceCategoryInternalId;\r\n flightingContext[\"SDODomainId\"] = sDODomainInternalId;\r\n flightingContext[\"userUpn\"] = userUpn;\r\n\r\n opFieldsArray.forEach(fieldName => {\r\n field = CommonUtils.getPropertyValueCaseInsensitive(data, fieldName);\r\n flightingContext[fieldName] = field;\r\n });\r\n \r\n return flightingContext;\r\n }\r\n\r\n /**\r\n * Get flighting context for logged in user\r\n * @method Fxp.Services.UserProfileService.getLoggedInUserFlighitngContext\r\n * @example Example to invoke getLoggedInUserFlighitngContext\r\n * userProfileService.getLoggedInUserFlighitngContext();\r\n */\r\n getLoggedInUserFlighitngContext(): angular.IPromise {\r\n let self = this;\r\n let deferred = this.q.defer();\r\n let flightingContext = {};\r\n this.getBasicUserProfileLoggedInUser().then(\r\n (data) => {\r\n flightingContext = self.getFlightingContext(data, self.userInfoService.getLoggedInUserUpn());\r\n deferred.resolve(flightingContext);\r\n }, (error) => {\r\n this.fxplogger.logEvent('Fxp.userProfileService.getBasicUserProfileLoggedInUser', `BasicProfile:${this.userInfoService.getLoggedInUserOID()} failed.`);\r\n deferred.reject(error);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n /**\r\n * Get flighting context for Current user\r\n * @method Fxp.Services.UserProfileService.getCurrentUserFlighitngContext\r\n * @example Example to invoke getCurrentUserFlighitngContext\r\n * userProfileService.getCurrentUserFlighitngContext();\r\n */\r\n getCurrentUserFlighitngContext(): angular.IPromise {\r\n let self = this;\r\n let deferred = this.q.defer();\r\n let flightingContext = {};\r\n this.getBasicProfileByOID(this.userInfoService.getCurrentUserOID(), null).then(\r\n (data) => {\r\n flightingContext = self.getFlightingContext(data, self.userInfoService.getCurrentUserUpn());\r\n deferred.resolve(flightingContext);\r\n }, (error) => {\r\n this.fxplogger.logEvent('Fxp.userProfileService.getBasicProfileByAlias', `BasicProfile:${this.userInfoService.getCurrentUserOID()} failed.`);\r\n deferred.reject(error);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n\r\n /**\r\n * Gets user's basic profile details by connecting to the service through the url\r\n * @method Fxp.Services.UserProfileService.getBasicProfileSvc\r\n * @param {Alias} alias an alias is the name of a user upto the symbol @ in the upn.\r\n * @param {Boolean} deferred a boolean value which is false by default.\r\n * @example Example to invoke getBasicProfileSvc\r\n * userProfileService.getBasicProfileSvc('logged in user alias', false);\r\n */\r\n private getProfileURL(userIdentifier: string, userIdentifierType: string) {\r\n var self = this;\r\n var url = '';\r\n if (self.profileApiEndpoint && userIdentifierType.toUpperCase() == \"OBJECTID\") {\r\n url = self.profileApiEndpoint + \"/profile/basic/\" + userIdentifier;\r\n\r\n }\r\n else if (self.profileApiEndpoint && userIdentifierType.toUpperCase() == \"ALIAS\") {\r\n url = self.profileApiEndpoint + \"/profile/\" + userIdentifier;\r\n }\r\n\r\n else {\r\n //call graph API\r\n url = self.graphAPIProfileUrl + ApplicationConstants.GraphApiProfileUrl;\r\n }\r\n return url;\r\n }\r\n private getBasicProfileSvc(userIdentifier: string, parentDeferred: any, showBanner?: boolean): IHttpPromise {\r\n let self = this;\r\n var userIdentifierType = CommonUtils.isGuid(userIdentifier) ? \"objectid\" : \"alias\";\r\n let url = this.getProfileURL(userIdentifier, userIdentifierType);\r\n let deferred = parentDeferred || self.q.defer();\r\n\r\n if (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n self.iUCount++;\r\n if (self.iUCount == 5) {\r\n self.fxplogger.logError(self.telemetrySource, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.GetBasicProfile_TokenNotFound, null, null, null, null, ErrorSeverityLevel.Medium);\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n return deferred.promise;\r\n }\r\n self.timeout(function () {\r\n self.getBasicProfileSvc(userIdentifier, deferred, showBanner);\r\n }, self.sleepInterval);\r\n }\r\n else {\r\n self.iUCount = 0;\r\n self.fxplogger.stopTrackPerformance(PerfMarkers.AdalTimeGetBasicProfile);\r\n let bag = this.fxplogger.createPropertyBag();\r\n bag.addToBag('Url', url);\r\n let currentProcessName = TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + '.Authorization.FetchBasicProfile';\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'Basic Profile api call');\r\n\r\n bag.addToBag(TelemetryConstants.CLASSNAME, \"UserProfileService\");\r\n bag.addToBag(TelemetryConstants.METHODNAME, \"getBasicProfileSvc\");\r\n self.fxplogger.logSystemEvent(TelemetryConstants.FXP_TELEMETRY_BASE_NAME + \".UserProfileService\", eventData, bag);\r\n\r\n return this.$http.get(url);\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n getBasicProfile(userIdentifier: string, isRefresh: boolean, pDeferred?: any, showBanner?: boolean): angular.IPromise {\r\n let self = this;\r\n let userData = null;\r\n let receiveDate;\r\n let responseTime;\r\n let rootScope = this.rootScope;\r\n let deferred = pDeferred || this.q.defer();\r\n let telemetryContext = this.telemetryContext;\r\n showBanner = this.getShowBannerValue(showBanner);\r\n var userIdentifierType = CommonUtils.isGuid(userIdentifier) ? \"objectid\" : \"alias\";\r\n if (!isRefresh) {\r\n return self.getBasicUserProfile(deferred, showBanner);\r\n }\r\n else {\r\n let currentProcessName = TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + '.Authorization.GetBasicProfileFromCache';\r\n let customProperties = self.fxplogger.createPropertyBag();\r\n customProperties.addToBag(TelemetryConstants.CLASSNAME, \"UserProfileService\");\r\n customProperties.addToBag(TelemetryConstants.METHODNAME, \"getBasicProfile\");\r\n customProperties.addToBag(userIdentifierType, userIdentifier);\r\n var localStorageProfile = this.getProfileFromLocalStorage(userIdentifier);\r\n if (localStorageProfile) {\r\n self.dispatchProfileActions(localStorageProfile, userIdentifier);\r\n self.timeout(function () {\r\n try {\r\n deferred.notify(JSON.parse(localStorageProfile));\r\n let eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'Returned Basic Profile from browser cache');\r\n self.fxplogger.logSystemEvent(TelemetryConstants.FXP_TELEMETRY_BASE_NAME + \".UserProfileService\", eventData, customProperties);\r\n }\r\n catch (exception) {\r\n self.fxplogger.logException(currentProcessName, new Error(\"Invalid JSON in local Storage for Basic Profile\"), customProperties, null, null, ErrorSeverityLevel.Medium, ErrorCodes.ProfileService_ErrorNotifyingCachedProfile);\r\n }\r\n }, self.sleepInterval);\r\n }\r\n\r\n let sendDate = new Date();\r\n this.fxplogger.startTrackPerformance(PerfMarkers.GetBasicProfileWithAdal);\r\n this.fxplogger.startTrackPerformance(PerfMarkers.AdalTimeGetBasicProfile);\r\n self.getBasicProfileSvc(userIdentifier, false, showBanner).then(function (data) {\r\n userData = data;\r\n // Logging a metric with the response\r\n\r\n receiveDate = new Date();\r\n responseTime = receiveDate.getTime() - sendDate.getTime(); // in millisecs\r\n var propbag = self.fxplogger.createPropertyBag();\r\n propbag.addToBag(FxpConstants.metricConstants.Status, userData.status);\r\n propbag.addToBag(FxpConstants.metricConstants.StatusText, userData.statusText);\r\n\r\n propbag.addToBag(FxpConstants.metricConstants.StartTime, sendDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.EndTime, receiveDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.ServiceName, FxpConstants.metricConstants.GetBasicProfileSvcName);\r\n let url = self.getProfileURL(userIdentifier, userIdentifierType);\r\n propbag.addToBag(FxpConstants.metricConstants.ServiceURL, url);\r\n propbag.addToBag(FxpConstants.metricConstants.UserAgent, navigator.userAgent);\r\n\r\n propbag.addToBag(FxpConstants.metricConstants.SessionId, rootScope.sessionId);\r\n propbag.addToBag(userIdentifierType, userIdentifier);\r\n propbag.addToBag(FxpConstants.metricConstants.UserBusinessRole, userData.BusinessRole);\r\n propbag.addToBag(FxpConstants.metricConstants.Geography, telemetryContext.getGeography());\r\n self.fxplogger.stopTrackPerformance(PerfMarkers.GetBasicProfileWithAdal);\r\n self.fxplogger.logMetric(self.telemetrySource, FxpConstants.metricConstants.UserProfileService, responseTime, propbag);\r\n\r\n if (userData.data != undefined && userData.data != null) {\r\n userData = userData.data;\r\n if (userData.hasOwnProperty(\"CacheHit\")) {\r\n delete userData[\"CacheHit\"];\r\n }\r\n var userInfo = new UserInfo();\r\n if (self.profileApiEndpoint) {\r\n for (var attr in userData) {\r\n userInfo[attr] = userData[attr];\r\n }\r\n\r\n // Adding BusinessDomain\r\n userInfo.BusinessDomain = userData.SDODomain;\r\n userInfo.AddressBookTitleDesc = userData.AddressBookTitleDesc;\r\n //Adding RoleGrouId\r\n userInfo.RoleGroupId = userData.RoleGroupID;\r\n rootScope.BusinessRole = userInfo.BusinessRole;\r\n\r\n // Adding Email\r\n userInfo.Email = userData.EmailName;\r\n\r\n // Adding FirstName to FullName\r\n if (!CommonUtils.isNullOrEmpty(userInfo.DisplayName)) {\r\n userInfo.FullName = userInfo.DisplayName;\r\n }\r\n\r\n // Adding MiddleName to FullName\r\n if (!CommonUtils.isNullOrEmpty(userInfo.MiddleName)) {\r\n userInfo.FullName += (userInfo.FullName.length > 0 ? \" \" : \"\") + userInfo.MiddleName;\r\n }\r\n\r\n // Adding LastName to FullName\r\n if (!CommonUtils.isNullOrEmpty(userInfo.LastName)) {\r\n userInfo.FullName += (userInfo.FullName.length > 0 ? \" \" : \"\") + userInfo.LastName;\r\n }\r\n\r\n //Adding BusinessRoleDisplayName\r\n if (!CommonUtils.isNullOrEmpty(userInfo.BusinessRole)) {\r\n if (!CommonUtils.isNullOrEmpty(userInfo.Seniority)) {\r\n userInfo.BusinessRoleDisplayName = userInfo.Seniority + \" \" + userInfo.BusinessRole;\r\n }\r\n else {\r\n userInfo.BusinessRoleDisplayName = userInfo.BusinessRole;\r\n }\r\n }\r\n\r\n //Checking isDefaultProfile flag\r\n userInfo.IsDefaultProfile = false;\r\n\r\n //Checking BusinessRole and BusinessRoleId\r\n if ((userInfo.BusinessRoleId == null || userInfo.BusinessRoleId == 0) ||\r\n (CommonUtils.isNullOrEmpty(userInfo.BusinessRole))) {\r\n self.fxplogger.logError(self.telemetrySource, rootScope.fxpUIConstants.UIMessages.UserProfileBusinessRoleMissingError.ErrorMessageTitle, ErrorCodes.GetBasicProfile_BusinessRoleMissing, null, null, null, null, ErrorSeverityLevel.High);\r\n if (showBanner) {\r\n self.fxpMessageSvc.addMessage(rootScope.fxpUIConstants.UIMessages.UserProfileBusinessRoleMissingError.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n }\r\n\r\n // Adding old tenant\r\n var tenantMapping = self.fxpConfiguration.FxpAppSettings[\"UserTenantMapping\"];\r\n if (tenantMapping) {\r\n tenantMapping = JSON.parse(tenantMapping);\r\n var newTenant = userInfo.TenantName;\r\n if (tenantMapping[newTenant]) {\r\n userInfo.MappedTenantName = tenantMapping[newTenant];\r\n } else {\r\n userInfo.MappedTenantName = newTenant;\r\n }\r\n }\r\n\r\n // Checking RoleGroup\r\n if ((!userInfo.RoleGroupId || userInfo.RoleGroupId <= 0) ||\r\n (CommonUtils.isNullOrEmpty(userInfo.RoleGroupName))) {\r\n propbag = self.fxplogger.createPropertyBag();\r\n propbag.addToBag(FxpConstants.metricConstants.SessionId, rootScope.sessionId);\r\n propbag.addToBag(FxpConstants.metricConstants.TimeStamp, FxpLogHelper.getTimeStamp());\r\n //change\r\n // propbag.addToBag(FxpConstants.metricConstants.UserUPN, alias);\r\n propbag.addToBag(FxpConstants.metricConstants.UserAgent, navigator.userAgent);\r\n propbag.addToBag(FxpConstants.metricConstants.UserBusinessRole, userInfo.BusinessRole);\r\n propbag.addToBag(FxpConstants.metricConstants.Geography, telemetryContext.getGeography());\r\n self.fxplogger.logError(self.telemetrySource, rootScope.fxpUIConstants.UIMessages.UserProfileRoleGroupMissingError.ErrorMessageTitle, ErrorCodes.GetBasicProfile_RoleGroupMissing, \"\", propbag, null, null, ErrorSeverityLevel.Critical);\r\n }\r\n\r\n } else {\r\n //read data incase graph api call\r\n userInfo = self.getProfileDataFromGraphResponse(userData);\r\n }\r\n\r\n // adding user profile data to the local \r\n self.setLocalStorageProfile(userInfo);\r\n let localStorageProfile = JSON.stringify(userInfo);\r\n self.dispatchProfileActions(localStorageProfile, userIdentifier);\r\n var responseEndTime = performance.now();\r\n var responseTotalDuration = responseEndTime - self.responseStartTime;\r\n self.isBasicProfileRefreshed = true;\r\n self.rootScope.$broadcast(FxpBroadcastedEvents.OnBasicUserProfileRefresh);\r\n }\r\n else {\r\n self.fxplogger.logError(self.telemetrySource, this.rootScope.fxpUIConstants.UIMessages.UserProfileNotFoundError.ErrorMessageTitle, ErrorCodes.GetBasicProfile_ProfileNotFound, null, null, null, null, ErrorSeverityLevel.Critical);\r\n if (self.isProfileRequired && showBanner)\r\n self.fxpMessageSvc.addMessage(rootScope.fxpUIConstants.UIMessages.UserProfileNotFoundError.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n\r\n deferred.resolve(userInfo);\r\n }).catch(function (err) {\r\n self.fxplogger.stopTrackPerformance(PerfMarkers.GetBasicProfileWithAdal);\r\n self.rootScope.isBlockedCSAUser = false;\r\n\r\n if (err && err.data && err.data.ErrorCode && err.data.ErrorCode.toString() === self.fxpConfiguration.FxpAppSettings.CSAErrorCode) {\r\n self.rootScope.isBlockedCSAUser = true;\r\n }\r\n // property bag for error\r\n if (self.isProfileRequired || self.rootScope.isLoginRequired || self.rootScope.isBlockedCSAUser) {\r\n var propbag = self.fxplogger.createPropertyBag();\r\n receiveDate = new Date();\r\n responseTime = receiveDate.getTime() - sendDate.getTime(); // in millisecs\r\n propbag.addToBag(FxpConstants.metricConstants.StartTime, sendDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.EndTime, receiveDate.toUTCString());\r\n propbag.addToBag(FxpConstants.metricConstants.ServiceName, FxpConstants.metricConstants.GetBasicProfileSvcName);\r\n propbag.addToBag(FxpConstants.metricConstants.IsLoginRequired, self.rootScope.isLoginRequired);\r\n if (err != null) {\r\n propbag.addToBag(FxpConstants.metricConstants.Status, err.status);\r\n propbag.addToBag(FxpConstants.metricConstants.StatusText, err.statusText);\r\n propbag.addToBag(FxpConstants.metricConstants.ErrorUrl, err.config ? err.config.url : '');\r\n propbag.addToBag(FxpConstants.metricConstants.IsCSABlockedUser, self.rootScope.isBlockedCSAUser.toString());\r\n\r\n if (err.status == \"404\") {\r\n self.fxplogger.logEvent(`${self.telemetrySource}.getBasicProfile`, CustomEvents.ProfileNotFound, propbag);\r\n }\r\n else {\r\n self.logBasicProfileFailureError(propbag);\r\n }\r\n\r\n //Added a flag to show/hide banner. By default banner will be visible. User need to send false value to hide the flag\r\n if (showBanner && !self.rootScope.isBlockedCSAUser) {\r\n self.fxpMessageSvc.addMessage(rootScope.fxpUIConstants.UIMessages.ProfileServiceCallFailedError.ErrorMessage, FxpConstants.messageType.error);\r\n }\r\n } else {\r\n propbag.addToBag(FxpConstants.metricConstants.ServiceURL, self.getProfileURL(userIdentifier, userIdentifierType));\r\n propbag.addToBag(FxpConstants.metricConstants.ErrorText, \"Error object is null\");\r\n self.logBasicProfileFailureError(propbag);\r\n }\r\n deferred.reject(err);\r\n }\r\n else {\r\n var userInfo = self.getDeafultUserInfo();\r\n self.isBasicProfileRefreshed = true;\r\n self.setLocalStorageProfile(userInfo);\r\n let localStorageProfile = JSON.stringify(userInfo);\r\n self.dispatchProfileActions(localStorageProfile, userIdentifier);\r\n deferred.resolve(userInfo);\r\n }\r\n });\r\n }\r\n\r\n return deferred.promise;\r\n }\r\n private setLocalStorageProfile(profile: UserInfo) {\r\n let alias = profile.Alias;\r\n let OID = profile.AadObjectId;\r\n let localStorageProfile = JSON.stringify(profile);\r\n if (!CommonUtils.isNullOrEmpty(alias))\r\n localStorage[CommonUtils.getSessionStorageUserInfoKey(alias)] = localStorageProfile;\r\n if (!CommonUtils.isNullOrEmpty(OID))\r\n localStorage[CommonUtils.getSessionStorageUserInfoKey(OID)] = localStorageProfile;\r\n }\r\n\r\n // need to save for both so will work always both here\r\n private getProfileFromLocalStorage(userIdentifier) {\r\n if (!userIdentifier)\r\n return null;\r\n\r\n let profileStorageKey = CommonUtils.getSessionStorageUserInfoKey(userIdentifier);\r\n if (!profileStorageKey)\r\n return null;\r\n \r\n var localStorageProfile = localStorage[profileStorageKey];\r\n return localStorageProfile;\r\n }\r\n\r\n private dispatchProfileActions(localStorageProfile: any, userIdentifier: string) {\r\n let self = this;\r\n if (userIdentifier == self.userInfoService.getLoggedInUserOID() || userIdentifier == self.loggedInUserAlias) {\r\n //dispatch action with payload as localStorage\r\n self.globalStoreService.DispatchGlobalAction(\"Platform\", AddLoggedInUserProfile(JSON.parse(localStorageProfile)));\r\n this.setLoggedInUser(localStorageProfile);\r\n }\r\n if (userIdentifier == self.userInfoService.getCurrentUserOID() || userIdentifier == self.currentUserAlias)\r\n {\r\n self.globalStoreService.DispatchGlobalAction(\"Platform\", AddCurrentUserProfile(JSON.parse(localStorageProfile)));\r\n \r\n }\r\n }\r\n\r\n /**\r\n * Logs exception occured in get basic profile\r\n * @method Fxp.Services.UserProfileService.logBasicProfileFailureError\r\n * @param {object} propbag contains all property bag values.\r\n * userProfileService.logBasicProfileFailureError(propbag);\r\n */\r\n logBasicProfileFailureError(propbag: LogPropertyBag): void {\r\n var self = this;\r\n self.fxplogger.logError(self.telemetrySource, self.rootScope.fxpUIConstants.UIMessages.ProfileServiceCallFailedError.ErrorMessageTitle, ErrorCodes.BasicProfile_UnknownError, null, propbag, null, null, ErrorSeverityLevel.Critical);\r\n }\r\n\r\n /**\r\n * Gets logged in user's basic profile details by getBasicUserProfileLoggedInUser to the service through the url\r\n * @method Fxp.Services.UserProfileService.getBasicUserProfile\r\n * @example Example to invoke getBasicUserProfileLoggedInUser\r\n * userProfileService.getBasicUserProfileLoggedInUser();\r\n */\r\n getBasicUserProfileLoggedInUser(): angular.IPromise {\r\n return this.getBasicProfileByOID(this.userInfoService.getLoggedInUserOID(), null);\r\n }\r\n\r\n setLoggedInUser(localStorageProfile) {\r\n let userProfile = JSON.parse(localStorageProfile);\r\n this.loggedInUserAlias = userProfile.alias;\r\n this.userInfoService.setLoggedInUser(this.loggedInUserAlias);\r\n if (!this.isObo())\r\n {\r\n this.userInfoService.setCurrentUser(this.loggedInUserAlias);\r\n this.setCurrentUser(this.loggedInUserAlias);\r\n }\r\n }\r\n\r\n setCurrentUser(alias: string) {\r\n if (alias) {\r\n this.userAlias = alias;\r\n this.currentUserAlias = alias;\r\n this.userInfoService.setCurrentUser(alias);\r\n }\r\n }\r\n\r\n isObo(): boolean {\r\n return this.userInfoService.isActingOnBehalfOf();\r\n }\r\n /**\r\n * Returns search results from the profile API for the specified search string\r\n * @method Fxp.Services.UserProfileService.searchProfile\r\n * @param {string} searchString search string for a user alias.\r\n * @example Example to invoke searchProfile\r\n * userProfileService.searchProfile('search string');\r\n */\r\n searchProfile(searchString, parentDiffered?) {\r\n var self = this;\r\n var url = self.searchProfileApiEndpoint + '/profile/searchprofile?searchText=' + searchString;\r\n\r\n var deferred = parentDiffered || self.q.defer();\r\n\r\n if (self.msalAuthenticationService.accessTokenRequestInProgress(url)) {\r\n self.iUCount++;\r\n if (self.iUCount == 5) {\r\n self.fxplogger.logError(self.telemetrySource, self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessageTitle, ErrorCodes.SearchProfile_TokenMissing, null, null, null, null, ErrorSeverityLevel.Medium);\r\n self.fxpMessageSvc.addMessage(self.rootScope.fxpUIConstants.UIMessages.AADAuthFailureError.ErrorMessage, FxpConstants.messageType.error);\r\n return deferred.promise;\r\n }\r\n self.timeout(function () {\r\n self.searchProfile(searchString, deferred);\r\n }, self.sleepInterval);\r\n }\r\n else {\r\n self.iUCount = 0;\r\n let bag = this.fxplogger.createPropertyBag();\r\n bag.addToBag('Url', url);\r\n //this.fxplogger.logEvent('Fxp.userProfileService.getBasicProfileSvc', 'GetBasicProfile:StartingServiceCall', bag);\r\n const currentProcessName = TelemetryConstants.FXP_TELEMETRY_BASE_NAME + '.UserProfileSearch';\r\n const eventData = new SystemEvent(currentProcessName, ComponentType.DataStore, 'User Profile api call');\r\n\r\n self.fxplogger.logSystemEvent(TelemetryConstants.FXP_TELEMETRY_BASE_NAME + \".UserProfileService.searchProfile\", eventData, bag);\r\n\r\n return (window[\"tenantConfiguration\"].ProfileStore && window[\"tenantConfiguration\"].ProfileStore.SearchAPIHeaders) ?\r\n self.$http.get(url, { headers: window[\"tenantConfiguration\"].ProfileStore.SearchAPIHeaders }) : self.$http.get(url);\r\n }\r\n return deferred.promise;\r\n }\r\n\r\n\r\n\r\n private getProfileDataFromGraphResponse(userData: any): any {\r\n var userInfo = new UserInfo();\r\n userInfo.FirstName = userData.givenName;\r\n userInfo.LastName = userData.surname;\r\n userInfo.FullName = userData.displayName;\r\n userInfo.Email = userData.userPrincipalName;\r\n userInfo.DisplayName = userData.displayName;\r\n userInfo.Alias = userData.mailNickname;\r\n userInfo.PersonnelNumber = userData.immutableId;\r\n userInfo.BusinessRole = userData.jobTitle || {};\r\n userInfo.BusinessRoleDisplayName = userData.jobTitle || {};\r\n userInfo.IsDefaultProfile = false;\r\n\r\n for (let item in userData) {\r\n if (item.indexOf(\"ReportsToFullName\") > 0) {\r\n userInfo.ReportsToDisplayName = userData[item]\r\n userInfo.ReportsToFullName = userInfo.ReportsToDisplayName;\r\n break;\r\n }\r\n }\r\n return userInfo;\r\n }\r\n private getDeafultUserInfo() {\r\n var aadBasicUserInfo = this.getAADBasicInfoFromLocalStorage();\r\n var userInfo = new UserInfo();\r\n if (aadBasicUserInfo === null) {\r\n userInfo.Email = \"\";\r\n userInfo.FirstName = \"\";\r\n userInfo.LastName = \"\";\r\n userInfo.FullName = \"\";\r\n userInfo.DisplayName = \"\";\r\n }\r\n else {\r\n console.log('Fetching user info from AAD user info.')\r\n var userProfileAAD = aadBasicUserInfo['profile'];\r\n userInfo.Email = userProfileAAD['upn'];\r\n userInfo.FirstName = userProfileAAD['given_name'];\r\n userInfo.LastName = userProfileAAD['family_name'];\r\n userInfo.FullName = userProfileAAD['name'];\r\n userInfo.DisplayName = userProfileAAD['name'];\r\n }\r\n\r\n userInfo.IsDefaultProfile = true;\r\n userInfo.BusinessRole = \"0\";\r\n userInfo.BusinessRoleDisplayName = \"0\";\r\n\r\n this.rootScope.$broadcast(CustomEvents.OnProfileFromGraphAPI);\r\n this.rootScope.isBotEnabled = false;\r\n\r\n return userInfo;\r\n }\r\n\r\n private getAADBasicInfoFromLocalStorage(): any {\r\n return angular.fromJson(localStorage.getItem(\"AADBasicInfo\"));\r\n }\r\n\r\n private getShowBannerValue(showBanner: boolean) {\r\n //Setting the showBanner variable to true when the value is undefined. Banner will be showing by default \r\n return (showBanner === false) ? false : true;\r\n }\r\n}\r\n","export class EnvironmentData {\r\n\tpublic EnvironmetName;\r\n\tpublic ServiceOffering;\r\n\tpublic ServiceLine;\r\n\tpublic Service;\r\n\tpublic ComponentId;\r\n\tpublic ComponentName;\r\n\tpublic AppName;\r\n\tpublic IctoId;\r\n\tpublic BusinessProcessName;\r\n\r\n\tconstructor(private environmentName: string, private serviceOffering: string, private serviceLine: string, private service: string, private componentId: string, private componentName: string, private appName: string, private ictoId: string, private businessProcessName: string) {\r\n\t\tthis.EnvironmetName = environmentName;\r\n\t\tthis.ServiceOffering = serviceOffering;\r\n\t\tthis.ServiceLine = serviceLine;\r\n\t\tthis.Service = service;\r\n\t\tthis.ComponentId = componentId;\r\n\t\tthis.ComponentName = componentName;\r\n\t\tthis.AppName = appName;\r\n\t\tthis.IctoId = ictoId;\r\n\t\tthis.BusinessProcessName = businessProcessName;\r\n\t}\r\n}","export enum ErrorSeverityLevel {\r\n Low = 1, // Error in which user or workflow in not impacted.\r\n Medium = 2, // Error which can impact a feature or workflow partially but user can proceed to complete it with workarounds. \r\n High = 3, // Any error which can bring feature(s) down. \r\n Critical = 4 // Any error which can bring FxP Platform down. \r\n} ","import { ComponentType, ActionType, FeatureUsageEventV2, EventName, ActionStatus, TaskStatus, ItEventType } from '@microsoftit/telemetry-extensions-npm'\r\nexport class FeatureUsageEvent extends FeatureUsageEventV2 {\r\n constructor(featureName: string, actionType: ActionType, actionName: string, eventName: EventName, componentType: ComponentType) {\r\n super(featureName, actionType, actionName, eventName, componentType);\r\n }\r\n \r\n public getTaskName(): string {\r\n return this.TaskName;\r\n }\r\n public setTaskName(value: string) {\r\n this.TaskName = value;\r\n }\r\n public getTaskStatus(): TaskStatus {\r\n return this.TaskStatus;\r\n }\r\n public setTaskStatus(value: TaskStatus) {\r\n this.TaskStatus = value;\r\n }\r\n public getCapabilityType(): string {\r\n return this.CapabilityType;\r\n }\r\n public setCapabilityType(value: string) {\r\n this.CapabilityType = value;\r\n }\r\n public getEmbeddedExpereinceName(): string {\r\n return this.EmbeddedExpereinceName;\r\n }\r\n public setEmbeddedExpereinceName(value: string) {\r\n this.EmbeddedExpereinceName = value;\r\n }\r\n public setIsEmbeddedExperience(value: boolean) {\r\n this.IsEmbeddedExperience = value;\r\n }\r\n public getIsEmbeddedExperience(): boolean {\r\n return this.IsEmbeddedExperience;\r\n }\r\n public getEventName(): EventName {\r\n return this.EventName;\r\n }\r\n public getEventType(): ItEventType {\r\n return this.EventType;\r\n }\r\n public setEventType(value: ItEventType) {\r\n this.EventType = value;\r\n }\r\n public getDuration(): number {\r\n return this.Duration;\r\n }\r\n public setDuration(value: number) {\r\n this.Duration = value;\r\n }\r\n public getFeatureName(): string {\r\n return this.FeatureName;\r\n }\r\n public getSubFeatureName(): string {\r\n return this.SubFeatureName;\r\n }\r\n public setSubFeatureName(value: string) {\r\n this.SubFeatureName = value;\r\n }\r\n public getActionName(): string {\r\n return this.ActionName;\r\n }\r\n public getActionType(): ActionType {\r\n return this.ActionType;\r\n }\r\n public setExperimentationConfigId(value: string) {\r\n this.ExperimentationConfigId = value;\r\n }\r\n public getExperimentationConfigId(): string {\r\n return this.ExperimentationConfigId;\r\n }\r\n public setExperimentationConfigName(value: string) {\r\n this.ExperimentationConfigName = value;\r\n }\r\n public getExperimentationConfigName(): string {\r\n return this.ExperimentationConfigName;\r\n }\r\n public setExperimentationConfigResult(value: boolean) {\r\n this.ExperimentationConfigResult = value;\r\n }\r\n public getExperimentationConfigResult(): boolean {\r\n return this.ExperimentationConfigResult;\r\n }\r\n public getTemplateType(): string {\r\n return this.TemplateType;\r\n }\r\n public getComponentType(): ComponentType {\r\n return this.ComponentType;\r\n }\r\n public getUserRoleName(): string {\r\n return this.UserRoleName;\r\n }\r\n public setUserRoleName(value: string) {\r\n this.UserRoleName = value;\r\n }\r\n public getStartDateTime(): Date {\r\n return this.StartDateTime;\r\n }\r\n public setStartDateTime(value: Date) {\r\n this.StartDateTime = value;\r\n }\r\n public getEndDateTime(): Date {\r\n return this.EndDateTime;\r\n }\r\n public setEndDateTime(value: Date) {\r\n this.EndDateTime = value;\r\n }\r\n public getComponentUri(): string {\r\n return this.ComponentUri;\r\n }\r\n public setComponentUri(value: string) {\r\n this.ComponentUri = value;\r\n }\r\n public getEntityId(): string {\r\n return this.EntityId;\r\n }\r\n public setEntityId(value: string) {\r\n this.EntityId = value;\r\n }\r\n public getActionStatus() {\r\n return this.ActionStatus;\r\n }\r\n public setActionStatus(status: ActionStatus) {\r\n this.ActionStatus = status;\r\n }\r\n}","import { LogPropertyBag } from \"./LogPropertyBag\";\r\nimport { LogMetricBag } from \"./LogMetricBag\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { TelemetryContext } from \"./telemetrycontext\";\r\nimport { EnvironmentData } from \"./TelemetryConst\";\r\n\r\n/**\r\n * @application Fxp\r\n */\r\n/**\r\n * @module Fxp.Telemetry.Helper\r\n */\r\n\r\n/**\r\n * Telmetry Log helper Class.\r\n * @class Fxp.Telemetry.Helper.FxpLogHelper\r\n * @classdesc Telmetry Log helper Class\r\n * @example \r\n * //To Use Telemetry.Helper.FxpLogHelper\r\n * var telemetryData = new Fxp.Telemetry.Helper.FxpLogHelper();\r\n */\r\nexport class FxpLogHelper {\r\n\t/**\r\n\t* Method Create Property Bag Object.\r\n\t* @method Fxp.Telemetry.Helper.FxpLogHelper().createPropertyBag()\r\n\t* @example Example to use new Fxp.Telemetry.Helper.FxpLogHelper().createPropertyBag()\r\n\t*/\r\n\tstatic createPropertyBag(): LogPropertyBag {\r\n\t\treturn new LogPropertyBag();\r\n\t}\r\n\r\n\t/**\r\n\t* Method Create Metric Bag Object.\r\n\t* @method Fxp.Telemetry.Helper.FxpLogHelper().createMetricBag()\r\n\t* @example Example to use new Fxp.Telemetry.Helper.FxpLogHelper().createMetricBag()\r\n\t*/\r\n\tstatic createMetricBag(): LogMetricBag {\r\n\t\treturn new LogMetricBag();\r\n\t}\r\n\r\n\t/**\r\n\t* Method to Get Current Time Stamp\r\n\t* @method Fxp.Telemetry.Helper.FxpLogHelper().getTimeStamp()\r\n\t* @example Example to use new Fxp.Telemetry.Helper.FxpLogHelper().getTimeStamp()\r\n\t*/\r\n\tstatic getTimeStamp(): string {\r\n\t\tvar currentDate = new Date();\r\n\t\tvar day: any = currentDate.getDate(),\r\n\t\t\tmonth: any = currentDate.getMonth() + 1,\r\n\t\t\tyear: any = currentDate.getFullYear(),\r\n\t\t\thours: any = currentDate.getHours(),\r\n\t\t\tminutes: any = currentDate.getMinutes(),\r\n\t\t\tseconds: any = currentDate.getSeconds();\r\n\t\tif (day < 10)\r\n\t\t\tday = \"0\" + day;\r\n\t\tif (month < 10)\r\n\t\t\tmonth = \"0\" + month;\r\n\t\tif (minutes < 10)\r\n\t\t\tminutes = \"0\" + minutes;\r\n\t\tif (seconds < 10)\r\n\t\t\tseconds = \"0\" + seconds;\r\n\t\tvar suffix = \"AM\";\r\n\t\tif (hours >= 12) {\r\n\t\t\tsuffix = \"PM\";\r\n\t\t\thours = hours - 12;\r\n\t\t}\r\n\t\tif (hours == 0) {\r\n\t\t\thours = 12;\r\n\t\t}\r\n\t\tif (hours < 10)\r\n\t\t\thours = \"0\" + hours;\r\n\t\treturn day + '/' + month + '/' + year + ' ' + hours + ':' + minutes + ':' + seconds + ' ' + suffix;\r\n\t}\r\n\r\n\t/**\r\n\t* Method to Get Telemetry Unique Key\r\n\t* @method Fxp.Telemetry.Helper.FxpLogHelper().getTelemetryUniqueKey()\r\n\t* @example Example to use new Fxp.Telemetry.Helper.FxpLogHelper().getTelemetryUniqueKey()\r\n\t*/\r\n\tstatic getTelemetryUniqueKey(): string {\r\n\t\tvar date = new Date();\r\n\r\n\t\treturn date.getFullYear().toString() +\r\n\t\t\tthis.pad2(date.getMonth() + 1) +\r\n\t\t\tthis.pad2(date.getDate()) +\r\n\t\t\tthis.pad2(date.getHours()) +\r\n\t\t\tthis.pad2(date.getMinutes()) +\r\n\t\t\tthis.pad2(date.getSeconds());\r\n\t}\r\n\r\n\t/**\r\n\t* Method to Get New SessionId\r\n\t* @method Fxp.Telemetry.Helper.FxpLogHelper().getNewSessionId()\r\n\t* @example Example to use new Fxp.Telemetry.Helper.FxpLogHelper().getNewSessionId()\r\n\t*/\r\n\tpublic static getNewSessionId(): string {\r\n\t\tvar d: number = new Date().getTime();\r\n\t\tvar guid: string = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n\t\t\tvar r = (d + Math.random() * 16) % 16 | 0;\r\n\t\t\td = Math.floor(d / 16);\r\n\t\t\treturn (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n\t\t});\r\n\r\n\t\treturn guid;\r\n\t}\r\n\r\n\tprivate static getAppNameFromSource(source: string): string{\r\n\t\tif (CommonUtils.isNullOrEmpty(source)) return; \r\n\t\treturn source.split('.')[0]; \r\n\t}\r\n\r\n/**\r\n * Adds environment detials to property bag\r\n * @param properties\r\n * @param transactionId\r\n */\r\n\tpublic static addEnvironmentDetails(eventProperties: LogPropertyBag, transactionId?: string, source?: string, aiInstrumentKey?: string, telemetryAppName?: string) {\r\n\t\tconst defaultAppName = \"FXP\" ;\r\n\t\tlet appName = (telemetryAppName)? telemetryAppName : null; \r\n\r\n\t\tif (!appName){\r\n\t\t\tappName = this.getAppNameFromSource(source);\r\n\t\t}\r\n\r\n\t\tif (!appName){\r\n\t\t\tappName = defaultAppName; \r\n\t\t}\r\n\r\n\t\t//get Environment details based on appName if environment details is not avilable then getting fxp environment details \r\n\t\tconst environmentData = TelemetryContext.CurrentContext.getEnvironmentDetails(appName) || TelemetryContext.CurrentContext.getEnvironmentDetails(defaultAppName);\r\n\t\tconst globalProperties = TelemetryContext.CurrentContext.getGlobalPropertyBag();\r\n\t\teventProperties.addRange(globalProperties);\r\n\t\tif (environmentData != null) {\r\n\t\t\teventProperties.addToBag(EnvironmentData.ENVIRONMENTNAME, environmentData.EnvironmetName || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.SERVICEOFFERING, environmentData.ServiceOffering || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.SERVICELINE, environmentData.ServiceLine || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.SERVICE, environmentData.Service || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.COMPONENTID, environmentData.ComponentId || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.COMPONENTNAME, environmentData.ComponentName || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.XCV, transactionId || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.AIAPPKEY, aiInstrumentKey || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.LOGGEDFROM, environmentData.AppName || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.ICTOID, environmentData.IctoId || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.BUSINESSPROCESSNAME, environmentData.BusinessProcessName || '');\r\n\t\t\teventProperties.addToBag(EnvironmentData.BuildNumber, window[\"FxpAppSettings\"].BuildNumber);\r\n\t\t}\r\n\t\treturn eventProperties;\r\n\t}\r\n\r\n\tprivate static pad2(n: number): string {\r\n\t\treturn n < 10 ? '0' + n.toString() : n.toString()\r\n\t}\r\n}\r\n","/**\r\n * A service to connect to FxpLoggerServiceExtension to log businessprocess,featureusage,systemevent etc.,\r\n * @class FxpTelemetry.FxpLoggerServiceExtension\r\n * @classdesc A service to connect to FxpLoggerServiceExtension to log businessprocess,featureusage,systemevent etc.,\r\n * @example Example to create an instance of FxpLoggerServiceExtension service\r\n * //Initializing Fxp FxpLoggerServiceExtension Service\r\n * angular.module('FxPApp').controller('AppController', ['FxpLoggerServiceExtension', AppController]);\r\n * function AppController(FxpLoggerServiceExtension){ FxpLoggerServiceExtension.logBusinessProcessEvent(); }\r\n */\r\n\r\nimport { LogPropertyBag } from './LogPropertyBag';\r\nimport { LogMetricBag } from './LogMetricBag';\r\nimport { BusinessProcessEvent } from './BusinessProcessEvent';\r\nimport { FeatureUsageEvent } from './FeatureUsageEvent';\r\nimport { SystemEvent } from './SystemEvent';\r\nimport { GlobalExceptionHandler } from './GlobalExceptionHandler';\r\nimport { AppInsights, Correlator } from \"@microsoftit/telemetry-extensions-npm/\";\r\n\r\nexport class FxpLoggerServiceExtension {\r\n\t//private msitInstance: any;\r\n\tprivate appIngishtInstance: AppInsights;\r\n\tprivate static fxpLoggerServiceExtension: FxpLoggerServiceExtension;\r\n\r\n\tconstructor() {\r\n\t}\r\n\r\n\t/**\r\n\t* Diagnostic method to log business process events\r\n\t* @method FxpTelemetry.FxpLoggerServiceExtension#init\r\n\t* @param {AppInsights} appIngisht - Application Insight Instance\r\n\t*/\r\n\tinit(appIngisht: AppInsights){\r\n\t\tthis.appIngishtInstance = appIngisht; \r\n\t\treturn this;\r\n\t}\r\n\r\n\tstatic getInstance() {\r\n\t\tif (!this.fxpLoggerServiceExtension){\r\n\t\t\tthis.fxpLoggerServiceExtension = new FxpLoggerServiceExtension(); \r\n\t\t}\r\n\t\treturn this.fxpLoggerServiceExtension; \r\n\t}\r\n\r\n\t/**\r\n\t* Diagnostic method to log business process events\r\n\t* @method FxpTelemetry.fxpLogger#logBusinessProcessEvent\r\n\t* @param {string} source - Source\r\n\t* @param {FeatureUsageEvent} eventData - event data that is to be logged\r\n\t* @param {Fxp.Telemetry.Helper.LogPropertyBag} properties - log properties\r\n\t* @param {Fxp.Telemetry.Helper.LogMetricBag} measurements - log metrics\r\n\t*/\r\n\tlogBusinessProcessEvent(eventData: BusinessProcessEvent, properties?: LogPropertyBag,\r\n\t\tmeasurements?:LogMetricBag) {\r\n\t this.appIngishtInstance.TrackBusinessProcessEvent(eventData, properties == null ? null : properties.getItems(), measurements == null ? null : measurements.getItems());\r\n\t}\r\n\r\n\t/**\r\n\t* Diagnostic method to log Feature Usage events\r\n\t* @method FxpTelemetry.FxpLoggerServiceExtension#logFeatureUsageEvent\r\n\t* @param {string} source - Source\r\n\t* @param {FeatureUsageEvent} eventData - event data that is to be logged\r\n\t* @param {Fxp.Telemetry.Helper.LogPropertyBag} properties - log properties\r\n\t* @param {Fxp.Telemetry.Helper.LogMetricBag} measurements - log metrics\r\n\t*/\r\n\tlogFeatureUsageEvent(eventData: FeatureUsageEvent, properties?: LogPropertyBag,\r\n\t\tmeasurements?: LogMetricBag) {\r\n\t\tthis.appIngishtInstance.TrackFeatureUsageEventV2(eventData, properties == null ? null : properties.getItems(), measurements == null ? null : measurements.getItems());\r\n\t}\r\n\r\n\tstartFeatureUsageEvent(featureUsageEvent: FeatureUsageEvent){\r\n this.appIngishtInstance.StartFeatureUsageEvent(featureUsageEvent); \r\n\t}\r\n\t\r\n endFeatureUsageEvent (featureUsageEvent: FeatureUsageEvent, properties?: LogPropertyBag){\r\n this.appIngishtInstance.EndFeatureUsageEvent(featureUsageEvent, properties == null ? null : properties.getItems()); \r\n }\r\n\r\n\t/**\r\n\t* Diagnostic method to log Track System events\r\n\t* @method FxpTelemetry.FxpLoggerServiceExtension#logTrackSystemEvent\r\n\t* @param {string} source - Source\r\n\t* @param {FeatureUsageEvent} eventData - event data that is to be logged\r\n\t* @param {Fxp.Telemetry.Helper.LogPropertyBag} properties - log properties\r\n\t* @param {Fxp.Telemetry.Helper.LogMetricBag} measurements - log metrics\r\n\t*/\r\n\tlogTrackSystemEvent(eventData: SystemEvent, properties?: LogPropertyBag,\r\n\t\tmeasurements?: LogMetricBag) {\r\n\t\tthis.appIngishtInstance.TrackSystemEvent(eventData, properties == null ? null : properties.getItems(), measurements == null ? null : measurements.getItems());\r\n\t}\r\n\t\r\n}","import { showSystemDownOverlay } from \"../utils/systemDownOverlay\";\r\nimport { TelemetryConstants } from \"./TelemetryConst\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { LogPropertyBag } from \"./LogPropertyBag\";\r\nimport { FxpLoggerService } from \"./fxpLogger\";\r\n\r\nexport class GlobalExceptionHandler {\r\n\r\n\t\r\n\tprivate static telemetrySource = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.GlobalExceptionHandler`;\r\n\t\r\n\tprivate static get FxPLoggerService(): FxpLoggerService {\r\n\t\treturn FxpLoggerService.getInstance();\r\n\t}\r\n\r\n\t\r\n\t\r\n\t/**\r\n * @method Fxp.GlobalExceptionHandler.logFxpBootFailure to log Global Event when Fxp App Boot Fails and redirect to System down page.\r\n * @param {any} properties - extra details which needs to be logged.\r\n * @param {string} source - source from where it is triggered.\r\n * @param {boolean} isDefaultPropertiesAvailable flag to check if default parameters are passed or not\r\n * @param {boolean} headerText for system down page.\r\n * @param {boolean} descriptionText for system down page.\r\n */\r\n\tstatic logFxpBootFailure(properties: LogPropertyBag, source: string, headerText: string, descriptionText: string, pageTitle: string, isCSABlockedUser: boolean = false) {\r\n\t\tconst eventName = `${TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP}.FxPBootAppFailure`;\r\n\t\tconst sourceName = CommonUtils.isNullOrEmpty(source)? this.telemetrySource: source; \r\n\t\t\r\n\t\tif (!properties) {\r\n\t\t\tproperties = this.FxPLoggerService.createPropertyBag();\r\n\t\t}\r\n\t\tif (!isCSABlockedUser){\r\n\t\t\tproperties.addToBag('Reason', 'Failed to boot FxP App');\r\n\t\t}\r\n\t\telse {\r\n\t\t\tproperties.addToBag('Reason', 'CSA Blocked Profile');\r\n\t\t}\r\n\t\tthis.FxPLoggerService.logEvent(sourceName, eventName, properties); \r\n\t\tshowSystemDownOverlay(headerText, descriptionText, pageTitle, undefined, undefined, !isCSABlockedUser);\r\n\t}\r\n}\r\n","export class LogMetricBag {\r\n\tprivate metricBagInternal: any = {};\r\n\tconstructor() {\r\n\t}\r\n\r\n\taddToBag(key: string, value: number) {\r\n\t\tthis.metricBagInternal[key] = value;\r\n\t}\r\n\r\n\tgetItems() {\r\n\t\treturn this.metricBagInternal;\r\n\t}\r\n}\r\n","import { CommonUtils } from \"../utils/CommonUtils\";\r\n\r\nexport class LogPropertyBag {\r\n\tprivate propBagInternal: any = {};\r\n\tconstructor() {\r\n\t}\r\n\r\n\taddToBag(key: string, value: string): void {\r\n\t\tif(CommonUtils.isNullOrEmpty(value)){\r\n\t\t\tthis.propBagInternal[key] = value;\r\n\t\t}\r\n\t\telse if(CommonUtils.isObject(value)){\r\n\t\t\tlet stringVal = CommonUtils.objectToString(value);\r\n\t\t\tif(!CommonUtils.isNullOrEmpty(stringVal)){\r\n\t\t\t\tthis.propBagInternal[key] = CommonUtils.removePII(stringVal);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.propBagInternal[key] = CommonUtils.removePII(String(value));\r\n\t\t}\r\n\t}\r\n\tgetItems(): any {\r\n\t\treturn this.propBagInternal;\r\n\t}\r\n\taddRange(propertyBag: LogPropertyBag) {\r\n\t\tvar properties = propertyBag.getItems();\r\n\r\n\t\tfor (var property in properties) {\r\n\t\t\tthis.addToBag(property, properties[property]);\r\n\t\t}\r\n\t}\r\n\tremoveFromBag(key: string) {\r\n\t\tdelete this.propBagInternal[key];\r\n\t}\r\n\tgetValue(key: string){\r\n\t\treturn this.propBagInternal[key];\r\n\t}\r\n\r\n}\r\n","\r\nimport * as MsitTelemetry from '@microsoftit/telemetry-extensions-npm';\r\n\r\nexport class SystemEvent extends MsitTelemetry.SystemEvent {\r\n \r\n\tconstructor(eventName: string, componentType: MsitTelemetry.ComponentType, systemMessage: string) {\r\n\t\tsuper(eventName, componentType, systemMessage);\r\n\t}\r\n}","/**\r\n * Defines telemetry constants\r\n * @class Fxp.common.Telemetry\r\n */\r\nexport class TelemetryConstants {\r\n\tpublic static PAGENAME: string = 'PageName';\r\n\tpublic static PAGEVISITED: string = 'PageVisited';\r\n\tpublic static URL: string = 'Url';\r\n\tpublic static Duration: string = 'Duration';\r\n\tpublic static ERRORPREFIX: string = 'Error in fxp logger : ';\r\n\tpublic static CLASSNAME: string = 'ClassName';\r\n\tpublic static METHODNAME: string = \"MethodName\";\r\n\tpublic static FXP_TELEMETRY_BASE_NAME = 'FxpPlatform';\r\n\tpublic static FXP_TELEMETRY_PLATFORM_BOOTSTRAP = \"FxpPlatform.PlatformBootstrap\"\r\n\tpublic static USER_ALIAS = \"alias\";\r\n\tpublic static LOGGING_SOURCE = 'LoggingSource'; \r\n}\r\n\r\nexport class TelemetryEventType {\r\n\tpublic static AIFeatureUsageEvent: string = 'AI.FeatureUsageEvent';\r\n\tpublic static AIBusinessProcessEvent: string = 'AI.BusinessProcessEvent';\r\n}\r\n\r\nexport class TelemetryConfigDefaults {\r\n\tpublic static InstrumentationKey: string = 'bdacee2d-2b6a-41b6-8454-f0e155db2721';\r\n\tpublic static EndPointUrl: string = '';\r\n}\r\n\r\n/**\r\n* Defines trackinglevel constants\r\n* @class Fxp.common.TracingLevel\r\n*/\r\nexport class TracingLevel {\r\n\t/** \r\n\t* @member {string} Fxp.common.TracingLevel#ERROR   \r\n\t*/\r\n\tpublic static ERROR: string = 'Error';\r\n\r\n\t/** \r\n * @member {string} Fxp.common.TracingLevel#ERRORWITHMETRIC   \r\n */\r\n\tpublic static Metric: string = 'Metric';\r\n\r\n\t/** \r\n * @member {string} Fxp.common.TracingLevel#WARNING   \r\n */\r\n\tpublic static WARNING: string = 'Warning';\r\n\r\n\t/** \r\n * @member {string} Fxp.common.TracingLevel#WARNING   \r\n */\r\n\tpublic static TRACE: string = 'Trace';\r\n\r\n\t/** \r\n * @member {string} Fxp.common.TracingLevel#INFORMATION   \r\n */\r\n\tpublic static INFORMATION: string = 'Information';\r\n\r\n\t/** \r\n * @member {string} Fxp.common.TracingLevel#CUSTOMEVENT\r\n */\r\n\tpublic static CUSTOMEVENT: string = 'CustomEvent';\r\n}\r\n\r\nexport enum PouchSyncMode {\r\n\tPush,\r\n\tPull,\r\n\tBoth,\r\n\tNone\r\n}\r\n\r\nexport enum DiagnosticLevel {\r\n\tOff = 0,\r\n\tError = 1,\r\n\tWarning = 2,\r\n\tInfo = 3,\r\n\tVerbose = 4\r\n}\r\n\r\nexport class EventDataProperties {\r\n\tpublic static ACTIONURI: string = 'ActionUri';\r\n\tpublic static APPACTION: string = 'AppAction';\r\n\tpublic static COMPONENTTYPE: string = 'ComponentType';\r\n\tpublic static EVENTTYPE: string = 'EventType';\r\n\tpublic static TARGETENTITYKEY: string = 'TargetEntityKey';\r\n\tpublic static USERROLENAME: string = 'UserRoleName';\r\n\tpublic static XCV: string = 'Xcv';\r\n\tpublic static COMPONENTURI: string = 'ComponentUri';\r\n\tpublic static DURATION: string = 'Duration';\r\n}\r\n\r\nexport class EnvironmentData {\r\n\tpublic static ENVIRONMENTNAME: string = 'EnvironmentName';\r\n\tpublic static SERVICEOFFERING: string = 'ServiceOffering';\r\n\tpublic static SERVICELINE: string = 'ServiceLine';\r\n\tpublic static SERVICE: string = 'Service';\r\n\tpublic static COMPONENTID: string = 'ComponentId';\r\n\tpublic static COMPONENTNAME: string = 'ComponentName';\r\n\tpublic static XCV: string = 'Xcv';\r\n\tpublic static AIAPPKEY: string = 'AiAppKey';\r\n\tpublic static LOGGEDFROM: string = 'AppName';\r\n\tpublic static ICTOID: string = 'IctoId';\r\n\tpublic static BUSINESSPROCESSNAME: string = 'BusinessProcessName';\r\n\tpublic static BuildNumber: string = 'BuildNumber';\r\n\r\n}\r\n\r\nexport class RoleGroupDetails {\r\n\tpublic static LOGGEDINUSERROLEGROUPID: string = 'LoggedInUserRoleGroupId';\r\n\tpublic static LOGGEDINUSERROLEGROUPNAME: string = 'LoggedInUserRoleGroupName';\r\n\tpublic static OBOROLEGROUPID: string = 'OBOUserRoleGroupId';\r\n\tpublic static OBOROLEGROUPNAME: string = 'OBOUserRoleGroupName';\r\n}\r\nexport class TenantDetails {\r\n\tpublic static LOGGEDINUSERTENANTKEY: string = 'LoggedInUserTenantKey';\r\n\tpublic static LOGGEDINUSERTENANTNAME: string = 'LoggedInUserTenantName';\r\n\tpublic static OBOTENANTKEY: string = 'OBOUserTenantKey';\r\n\tpublic static OBOTENANTNAME: string = 'OBOUserTenantName';\r\n}\r\n","import { ILogger } from \"../interfaces/ILogger\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\nimport { ICorrelationProvider } from \"../interfaces/ICorrelationProvider\";\r\nimport { BusinessProcessEvent } from \"./BusinessProcessEvent\";\r\nimport { FeatureUsageEvent } from \"./FeatureUsageEvent\";\r\nimport { LogMetricBag } from \"./LogMetricBag\";\r\nimport { LogPropertyBag } from \"./LogPropertyBag\";\r\nimport { SystemEvent } from \"./SystemEvent\";\r\nimport {\r\n AppInsights,\r\n Correlator,\r\n EnvironmentValues,\r\n FeatureUsageEventV2,\r\n} from \"@microsoftit/telemetry-extensions-npm\";\r\nimport { ClickAnalyticsPlugin } from \"@microsoft/applicationinsights-clickanalytics-js\";\r\nimport { TelemetryContext } from \"./telemetrycontext\";\r\nimport { FxpLogHelper } from \"./FxpLogHelper\";\r\nimport { ITelemetryContextListener } from \"../interfaces/ITelemetryContextListener\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\nimport { ErrorSeverityLevel } from \"./ErrorSeverityLevel\";\r\nimport { RoleGroupInfo, TenantInfo } from \"../common/ApplicationConstants\";\r\nimport {\r\n RoleGroupDetails,\r\n TelemetryConstants,\r\n TenantDetails,\r\n} from \"./TelemetryConst\";\r\nimport {\r\n IPageViewTelemetry,\r\n IMetricTelemetry,\r\n} from \"@microsoft/applicationinsights-common\";\r\nimport { FxpLoggerServiceExtension } from \"./FxpLoggerServiceExtension\";\r\nimport { NetworkConnection } from \"./network-connection\";\r\n\r\ndeclare type Envelope = any;\r\nconst PerfMarkerPrefix: string = \"Perf\";\r\n/**\r\n * A service for telemetry logging\r\n * @class FxpLoggerService\r\n * @classdesc A service to instrument data in Telemetry\r\n */\r\nexport class FxpLoggerService\r\n implements ILogger, IFxPService, ITelemetryContextListener\r\n{\r\n private _appInsight: AppInsights;\r\n private _environmentValues: EnvironmentValues;\r\n private _context: TelemetryContext;\r\n private _correlator: Correlator;\r\n private static _loggerServiceInstance: FxpLoggerService;\r\n private loggedInUserContext: any;\r\n private OBOUserContext: any;\r\n private isObo: boolean;\r\n private correlationProvider: ICorrelationProvider;\r\n private instrumentationKey: string;\r\n private pageLoadMetric: any;\r\n private _loggerServiceExtenstion: FxpLoggerServiceExtension;\r\n private _events: {\r\n [key: string]: number;\r\n };\r\n\r\n private constructor() {\r\n //this.init();\r\n }\r\n\r\n private init() {\r\n let FxpAppSettings: any = window[\"FxpAppSettings\"];\r\n let FxpBaseConfiguration: any = window[\"FxpBaseConfiguration\"];\r\n if (!this._appInsight) {\r\n this._events = {};\r\n this._appInsight = new AppInsights();\r\n this.instrumentationKey =\r\n FxpBaseConfiguration.Telemetry.InstrumentationKey;\r\n const clickPluginInstance = new ClickAnalyticsPlugin();\r\n // Click Analytics configuration\r\n const clickPluginConfig = {\r\n autoCapture: true,\r\n dataTags: {\r\n useDefaultContentNameOrId: true,\r\n captureAllMetaDataContent: true,\r\n },\r\n };\r\n // Application Insights Configuration\r\n const configObj = {\r\n instrumentationKey: FxpBaseConfiguration.Telemetry.InstrumentationKey,\r\n extensions: [clickPluginInstance],\r\n extensionConfig: {\r\n [clickPluginInstance.identifier]: clickPluginConfig,\r\n },\r\n };\r\n this._environmentValues = new EnvironmentValues(\r\n FxpAppSettings.EnvironmentName,\r\n FxpAppSettings.ServiceOffering,\r\n FxpAppSettings.ServiceLine,\r\n FxpAppSettings.Service,\r\n FxpAppSettings.ComponentName,\r\n FxpAppSettings.ComponentId,\r\n FxpAppSettings.IctoId\r\n );\r\n this._appInsight.InitializeTelemetryWithConfiguration(\r\n this._environmentValues,\r\n configObj\r\n );\r\n\r\n this._context = TelemetryContext.getInstance();\r\n this._context.initUserSession();\r\n this.setContextInfo();\r\n this._context.addContextChangeListener(this);\r\n this._correlator = new Correlator();\r\n $.correlator = this._correlator;\r\n const telemetryInitializer = {\r\n init: (envelope: Envelope) => {\r\n try {\r\n const telemetryItem = envelope.baseData;\r\n this.telemetryInitializerInit(\r\n telemetryItem,\r\n FxpBaseConfiguration.Telemetry.InstrumentationKey\r\n );\r\n } finally {\r\n envelope.tags[\"ai.cloud.role\"] = \"FxP-Client\";\r\n return true;\r\n }\r\n },\r\n };\r\n this._appInsight.appInsights.addTelemetryInitializer(\r\n telemetryInitializer.init\r\n );\r\n this._appInsight.AddMsitTelemetryInitializers(this._correlator);\r\n this._loggerServiceExtenstion =\r\n FxpLoggerServiceExtension.getInstance().init(this._appInsight);\r\n }\r\n }\r\n\r\n /**\r\n * Static method to get instance of FxpLoggerService\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#getInstance\r\n * @returns {FxpLoggerService} - Returns instance of FxpLoggerService\r\n */\r\n static getInstance(): FxpLoggerService {\r\n if (!this._loggerServiceInstance) {\r\n this._loggerServiceInstance = new FxpLoggerService();\r\n this._loggerServiceInstance.init();\r\n }\r\n return this._loggerServiceInstance;\r\n }\r\n\r\n notify() {\r\n this.setContextInfo();\r\n }\r\n\r\n private setContextInfo() {\r\n this._appInsight.appInsights.context.session.id =\r\n this._context.getSessionID();\r\n this._appInsight.appInsights.context.application.ver =\r\n this._context.getAppVersion();\r\n }\r\n\r\n private telemetryInitializerInit(\r\n telemetryItem: any,\r\n instrumentationKey: string\r\n ): void {\r\n const telemetryAppName = this.getCurrentPartnerTelemetryName();\r\n const properties = FxpLogHelper.addEnvironmentDetails(\r\n new LogPropertyBag(),\r\n null,\r\n null,\r\n instrumentationKey,\r\n telemetryAppName\r\n );\r\n let finalProperties = {};\r\n\r\n if (telemetryItem.properties) {\r\n finalProperties = Object.assign(\r\n {},\r\n telemetryItem.properties,\r\n properties.getItems()\r\n );\r\n }\r\n\r\n if (finalProperties[\"AppName\"] && finalProperties[\"AppName\"] === \"Fxp\") {\r\n finalProperties[\"AppName\"] = TelemetryConstants.FXP_TELEMETRY_BASE_NAME;\r\n }\r\n\r\n telemetryItem.properties = finalProperties;\r\n }\r\n\r\n private getCurrentPartnerTelemetryName(): string {\r\n const ngInjector = angular.element(document.body).injector();\r\n if (!ngInjector) return;\r\n\r\n const stateService: any = ngInjector.get(\"$state\");\r\n if (!stateService) return;\r\n\r\n const currentState = stateService.current;\r\n return currentState.data ? currentState.data.partnerTelemetryName : null;\r\n }\r\n\r\n /**\r\n * Diagnostic method to log error in telemetry\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logError\r\n * @param {string} source - Source where this exception originated. It should be in Format ..\r\n * @param {string} message - Error Message.\r\n * @param {string} errorCode - Error Code or Error Constant.\r\n * @param {string} stackTrace - StackTrace of the Error.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n * @param {ErrorSeverityLevel} severityLevel - Severity Level of the error.\r\n */\r\n logError(\r\n source: string,\r\n message: string,\r\n errorCode: string,\r\n stackTrace?: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: string,\r\n severityLevel?: ErrorSeverityLevel\r\n ): void {\r\n try {\r\n let error = new Error();\r\n error.message = CommonUtils.removePII(message);\r\n error.stack = CommonUtils.removePII(stackTrace);\r\n this.logException(\r\n source,\r\n error,\r\n properties,\r\n measurements,\r\n transactionId,\r\n severityLevel,\r\n errorCode\r\n );\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to log exception object\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logError\r\n * @param {string} source - Source where this exception originated. It should be in Format ..\r\n * @param {Error} exception - Exception object.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n * @param {ErrorSeverityLevel} severityLevel - Severity Level of the error.\r\n * @param {string} errorCode - Error Code or Error Constant.\r\n */\r\n logException(\r\n source: string,\r\n exception: Error,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: string,\r\n severityLevel?: ErrorSeverityLevel,\r\n errorCode?: string\r\n ): void {\r\n try {\r\n exception.stack = CommonUtils.removePII(exception?.stack);\r\n exception.message = CommonUtils.removePII(exception?.message);\r\n exception.name = CommonUtils.removePII(exception?.name);\r\n errorCode = CommonUtils.removePII(errorCode);\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties,\r\n errorCode,\r\n exception.stack\r\n );\r\n this._appInsight.TrackException(\r\n exception,\r\n severityLevel,\r\n properties.getItems(),\r\n measurements == null ? null : measurements.getItems()\r\n );\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Creates and returns a new instance of LogPropertyBag object.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#createMetricBag\r\n * @returns {LogPropertyBag}\r\n */\r\n createPropertyBag(): LogPropertyBag {\r\n return FxpLogHelper.createPropertyBag();\r\n }\r\n\r\n /**\r\n * Creates and returns a new instance of LogmetricBag object.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#createMetricBag\r\n * @returns {LogMetricBag}\r\n */\r\n createMetricBag(): LogMetricBag {\r\n return FxpLogHelper.createMetricBag();\r\n }\r\n\r\n /**\r\n * Diagnostic method to log warnings which will be captured in customEvents of application insights with EventType as Warning\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logWarning\r\n * @param {string} source - Source from where the Warning is logged. It should be in Format ..\r\n * @param {string} message - Warning Message.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logWarning(\r\n source: string,\r\n message: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n if (!properties) {\r\n properties = this.createPropertyBag();\r\n }\r\n properties.addToBag(\"EventType\", \"Warning\");\r\n this.logEvent(source, message, properties, measurements, transactionId);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to log Information which will be captured in customEvents of application insights with EventType as Information\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logInformation\r\n * @param {string} message - Information Message\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logInformation(\r\n source: string,\r\n message: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n if (!properties) {\r\n properties = this.createPropertyBag();\r\n }\r\n properties.addToBag(\"EventType\", \"Information\");\r\n this.logEvent(source, message, properties, measurements, transactionId);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to log Events which will be captured in customEvents of application insights.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logCustomEvents\r\n * @param {string} source - Source from where the Event is getting logged. It should be in Format ..\r\n * @param {string} eventName - Event Name to be logged.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logEvent(\r\n source: string,\r\n eventName: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n this._appInsight.TrackEvent(\r\n eventName,\r\n properties.getItems(),\r\n measurements\r\n );\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to Track Page Views in telemetry\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logPageView\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param pageName - Name of the visited page as string\r\n * @param {string} url - Url of the visited page.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {number} duration - Time took to load the page. The value should be a positive integer.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logPageView(\r\n source: string,\r\n pageName: string,\r\n url?: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n duration?: number,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n if (!measurements) {\r\n measurements = this.createMetricBag();\r\n }\r\n if (duration) {\r\n measurements.addToBag(`${pageName}-LoadDuration`, duration);\r\n }\r\n let pageViewTelemetry: IPageViewTelemetry = {\r\n name: pageName,\r\n uri: url,\r\n refUri: null,\r\n pageType: null,\r\n isLoggedIn: null,\r\n properties: properties.getItems(),\r\n measurements: measurements.getItems(),\r\n };\r\n this._appInsight.appInsights.trackPageView(pageViewTelemetry);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * OBSOLETE Method. Diagnostic method to Track Page Views\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#trackPageView\r\n * @param {string} url - Url of the visited page.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param duration - Time took to load the page. The value should be a number.\r\n * @deprecated - This method is deprecated and will be removed in future. Please use logPageView method instead.\r\n */\r\n trackPageView(\r\n url?: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n duration?: number,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n this.logPageView(null, null, url, properties, measurements, duration);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to Track Metrics in telemetry\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logMetric\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param {string} metricName - Name of the metric.\r\n * @param {number} metricValue - The value of the metric as number.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logMetric(\r\n source: string,\r\n metricName: string,\r\n metricValue: number,\r\n properties?: LogPropertyBag,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n let metricTelemetry: IMetricTelemetry = {\r\n name: metricName,\r\n average: metricValue,\r\n properties: properties.getItems(),\r\n };\r\n this._appInsight.appInsights.trackMetric(metricTelemetry);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Method to start tracking FeatureUsageEvent.\r\n * @description Method to start tracking FeatureUsageEvent.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logSystemEvent\r\n * @param {FeatureUsageEvent} featureUsageEvent - Instance of FeatureUsageEvent type.\r\n */\r\n startFeatureUsageEvent(featureUsageEvent: FeatureUsageEvent) {\r\n this._loggerServiceExtenstion.startFeatureUsageEvent(featureUsageEvent);\r\n }\r\n\r\n /**\r\n * Method to complete tracking FeatureUsageEvent.\r\n * @description Method to complete tracking FeatureUsageEvent.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#endFeatureUsageEvent\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param {FeatureUsageEvent} featureUsageEvent - Instance of SystemEvent type.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n endFeatureUsageEvent(\r\n source: string,\r\n featureUsageEvent: FeatureUsageEvent,\r\n properties?: LogPropertyBag,\r\n transactionId?: any\r\n ) {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n this._loggerServiceExtenstion.endFeatureUsageEvent(\r\n featureUsageEvent,\r\n properties\r\n );\r\n }\r\n\r\n /**\r\n * Diagnostic method to log Feature Usage in telemetry. This method can be used for tracking single session workflows.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logFeatureUsageEvent\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param {FeatureUsageEvent} eventData - Instance of FeatureUsageEvent.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logFeatureUsageEvent(\r\n source: string,\r\n eventData: FeatureUsageEvent,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: any\r\n ): void {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n this._loggerServiceExtenstion.logFeatureUsageEvent(\r\n eventData,\r\n properties,\r\n measurements\r\n );\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to log Business Process Event in telemetry.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logBusinessProcessEvent\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param {BusinessProcessEvent} eventData - Instance of FeatureUsageEvent.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logBusinessProcessEvent(\r\n source: string,\r\n eventData: BusinessProcessEvent,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: any\r\n ): void {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n this._loggerServiceExtenstion.logBusinessProcessEvent(\r\n eventData,\r\n properties,\r\n measurements\r\n );\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Diagnostic method to log trace information in telemetry.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logTrace\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param {string} message - Trace message.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logTrace(\r\n source: string,\r\n message: string,\r\n properties?: LogPropertyBag,\r\n transactionId?: string\r\n ): void {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n this._appInsight.TrackTrace(message, properties.getItems());\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Internal method to Set the correlationProvider object for FxpLoggerService. This method should only be invoked from Platform during initialization.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#setCorrelationProvider\r\n * @param {ICorrelationProvider} correlationProvider - Instance of ICorrelationProvider\r\n */\r\n setCorrelationProvider(correlationProvider: ICorrelationProvider) {\r\n this.correlationProvider = correlationProvider;\r\n }\r\n\r\n /**\r\n * Method to start performance tracking.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#startTrackPerformance\r\n * @param {string} eventName - Name of the event\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n startTrackPerformance(eventName: string, transactionId?: any): void {\r\n const metricName = PerfMarkerPrefix + eventName;\r\n try {\r\n if (!CommonUtils.isNullOrEmpty(this._events[metricName])) {\r\n console.warn(\r\n \"Start was called before calling stop for event : \" + metricName\r\n );\r\n } else {\r\n this._events[metricName] = performance.now();\r\n }\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Method to complete performance tracking.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#stopTrackPerformance\r\n * @param {string} eventName - Name of the event\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n stopTrackPerformance(\r\n eventName: string,\r\n source?: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: any\r\n ): void {\r\n const metricName = PerfMarkerPrefix + eventName;\r\n const start = this._events[metricName];\r\n\r\n if (isNaN(start)) {\r\n console.warn(\r\n \"Stop was called before calling start for event : \" + eventName\r\n );\r\n } else {\r\n const duration = performance.now() - start;\r\n delete this._events[eventName];\r\n this._events[eventName] = undefined;\r\n if (CommonUtils.isNullOrEmpty(measurements)) {\r\n measurements = new LogMetricBag();\r\n }\r\n\r\n try {\r\n measurements.addToBag(metricName, duration);\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n properties.addToBag(\"Unit\", \"Milliseconds\");\r\n let metricTelemetry: IMetricTelemetry = {\r\n name: metricName,\r\n average: duration,\r\n properties: properties.getItems(),\r\n };\r\n\r\n this._appInsight.appInsights.trackMetric(metricTelemetry);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n }\r\n\r\n getPageLoadMetrics() {\r\n return this.pageLoadMetric;\r\n }\r\n\r\n setPageLoadMetrics(value: any) {\r\n this.pageLoadMetric = value;\r\n }\r\n\r\n logPageLoadMetrics(pageLoadTime?: number): void {\r\n try {\r\n var pageLoadMetricsCalled = performance.now();\r\n var propBag = this.createPropertyBag();\r\n var pageLoadData = this.pageLoadMetric;\r\n\r\n pageLoadData.totalDuration = performance.now() - pageLoadData.startTime;\r\n\r\n if (\r\n !CommonUtils.isNullOrEmpty(pageLoadData.sourceRoute) &&\r\n !CommonUtils.isNullOrEmpty(pageLoadData.destinationRoute)\r\n ) {\r\n if (\r\n pageLoadTime != null &&\r\n pageLoadTime != undefined &&\r\n typeof pageLoadTime == \"number\"\r\n ) {\r\n pageLoadData.pageLoadDuration = pageLoadTime;\r\n } else pageLoadData.pageLoadDuration = 0;\r\n\r\n propBag.addToBag(\"pageDisplayName\", pageLoadData.pageDisplayName);\r\n propBag.addToBag(\"sourceRoute\", pageLoadData.sourceRoute);\r\n propBag.addToBag(\r\n \"sourceRouteURL\",\r\n CommonUtils.isNullOrEmpty(pageLoadData.sourceRouteURL)\r\n ? \"No_SourceRouteURL_Found\"\r\n : pageLoadData.sourceRouteURL\r\n );\r\n propBag.addToBag(\"destinationRoute\", pageLoadData.destinationRoute);\r\n propBag.addToBag(\r\n \"destinationRouteURL\",\r\n CommonUtils.isNullOrEmpty(pageLoadData.destinationRouteURL)\r\n ? \"No_DestinationRouteURL_Found\"\r\n : pageLoadData.destinationRouteURL\r\n );\r\n propBag.addToBag(\r\n \"pageTransitionStatus\",\r\n pageLoadData.pageTransitionStatus\r\n );\r\n propBag.addToBag(\r\n \"stateChangeDuration\",\r\n pageLoadData.stateChangeDuration.toString()\r\n );\r\n propBag.addToBag(\r\n \"preStateDuration\",\r\n pageLoadData.preStateDuration.toString()\r\n );\r\n propBag.addToBag(\"error\", pageLoadData.pageLoadError);\r\n propBag.addToBag(\r\n \"partnerPageLoadDuration\",\r\n pageLoadData.pageLoadDuration.toString()\r\n );\r\n propBag.addToBag(\r\n \"totalDuration\",\r\n pageLoadData.totalDuration.toString()\r\n );\r\n propBag.addToBag(\r\n \"thresholdCrossed\",\r\n pageLoadData.threshold.thresholdCrossed.toString()\r\n );\r\n propBag.addToBag(\r\n \"thresholdValue\",\r\n pageLoadData.threshold.thresholdValue.toString()\r\n );\r\n\r\n // Temp properties added for trouble shooting\r\n propBag.addToBag(\"startTime\", pageLoadData.startTime.toString());\r\n propBag.addToBag(\r\n \"$rootScope.startTime\",\r\n CommonUtils.isNullOrEmpty(pageLoadData.rootscopestartTime)\r\n ? \"0\"\r\n : pageLoadData.rootscopestartTime.toString()\r\n );\r\n propBag.addToBag(\r\n \"$rootScope.stateChangeStartTime\",\r\n CommonUtils.isNullOrEmpty(pageLoadData.stateChangeStartTime)\r\n ? \"0\"\r\n : pageLoadData.stateChangeStartTime.toString()\r\n );\r\n propBag.addToBag(\r\n \"pageLoadMetricsCalled\",\r\n pageLoadMetricsCalled.toString()\r\n );\r\n this.logEvent(\r\n pageLoadData.sourceRoute,\r\n \"FxpTelemetry.PageMetrics\",\r\n propBag\r\n );\r\n }\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n setLoggedInUserContext(\r\n loggedInUserRoleId: string,\r\n loggedInUserRoleName: string,\r\n isOBO: boolean,\r\n loggedInUserTenantKey: string,\r\n loggedInUserTenantName: string\r\n ) {\r\n this.loggedInUserContext = {\r\n [RoleGroupInfo.RoleGroupId]: loggedInUserRoleId\r\n ? loggedInUserRoleId.toString()\r\n : loggedInUserRoleId,\r\n [RoleGroupInfo.RoleGroupName]: loggedInUserRoleName,\r\n [TenantInfo.TenantKey]: loggedInUserTenantKey,\r\n [TenantInfo.TenantName]: loggedInUserTenantName,\r\n };\r\n this.isObo = isOBO;\r\n }\r\n\r\n setOBOUserContext(\r\n OBOUserRoleId: string,\r\n OBOUserRoleName: string,\r\n isOBO: boolean,\r\n OBOUserTenantKey: string,\r\n OBOUserTenantName: string\r\n ) {\r\n this.OBOUserContext = {\r\n [RoleGroupInfo.RoleGroupId]: OBOUserRoleId\r\n ? OBOUserRoleId.toString()\r\n : OBOUserRoleId,\r\n [RoleGroupInfo.RoleGroupName]: OBOUserRoleName,\r\n [TenantInfo.TenantKey]: OBOUserTenantKey,\r\n [TenantInfo.TenantName]: OBOUserTenantName,\r\n };\r\n this.isObo = isOBO;\r\n }\r\n\r\n /**\r\n * Method to log user actions which will be logged in customEvents with EventType as UserAction.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logSystemEvent\r\n * @param {string} source - Source from where this is getting logged. It should be in format ..\r\n * @param {string} eventName - Name of the event. It should be in format .\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logUserAction(\r\n source,\r\n eventName: string,\r\n message: string,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: string\r\n ) {\r\n try {\r\n if (!properties) {\r\n properties = this.createPropertyBag();\r\n }\r\n properties.addToBag(\"EventType\", \"UserAction\");\r\n properties.addToBag(\"message\", message);\r\n this.logEvent(source, eventName, properties, measurements, transactionId);\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n /**\r\n * Method to log system events which will be logged in customEvents with EventType as SystemEvent.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#logSystemEvent\r\n * @param {string} source - Source from where this is getting logged. It should be in Format ..\r\n * @param {SystemEvent} eventData - Instance of SystemEvent type.\r\n * @param {LogPropertyBag} properties - Properties for the customDimensions.\r\n * @param {LogMetricBag} measurements - measurements to be logged in customDimensions.\r\n * @param {string} transactionId - Transaction id or Operation id of the transaction.\r\n */\r\n logSystemEvent(\r\n source: string,\r\n eventData: SystemEvent,\r\n properties?: LogPropertyBag,\r\n measurements?: LogMetricBag,\r\n transactionId?: any\r\n ) {\r\n try {\r\n properties = this.setTransactionIdAndCommonProperties(\r\n source,\r\n transactionId,\r\n properties\r\n );\r\n this._appInsight.TrackSystemEvent(\r\n eventData,\r\n properties.getItems(),\r\n measurements\r\n );\r\n } catch (exception) {\r\n this.internalCustomLog(exception);\r\n }\r\n }\r\n\r\n private setTransactionId(transactionId?: any) {\r\n if (transactionId) {\r\n this._appInsight.appInsights.context.telemetryTrace.traceID =\r\n transactionId;\r\n return;\r\n }\r\n const subCorrelationId = this._correlator.getSubCorrelationId();\r\n const correlationId = this._correlator.getCorrelationId();\r\n if (subCorrelationId) {\r\n this._appInsight.appInsights.context.telemetryTrace.traceID =\r\n subCorrelationId;\r\n this._appInsight.appInsights.context.telemetryTrace.parentID =\r\n correlationId;\r\n return subCorrelationId;\r\n }\r\n this._appInsight.appInsights.context.telemetryTrace.traceID = correlationId;\r\n return correlationId;\r\n }\r\n\r\n private setTransactionIdAndCommonProperties(\r\n source?: string,\r\n transactionId?: any,\r\n properties?: LogPropertyBag,\r\n errorCode?: string,\r\n stackTrace?: string\r\n ) {\r\n this.setTransactionId(transactionId);\r\n properties = this.addPropertyBagValues(properties, transactionId, source);\r\n properties = this.buildCommonLogProperties(properties, source, null, null);\r\n return properties;\r\n }\r\n\r\n /**\r\n * To Builds log properties that are common to all methods\r\n * @param properties\r\n * @param source\r\n * @param errorCode\r\n * @param stackTrace\r\n */\r\n private buildCommonLogProperties(\r\n properties: LogPropertyBag,\r\n source: string,\r\n errorCode: string,\r\n stackTrace: string\r\n ) {\r\n const logProperties = properties || this.createPropertyBag();\r\n if (logProperties.getValue(TelemetryConstants.LOGGING_SOURCE)) {\r\n logProperties.addToBag(\r\n \"Source\",\r\n properties.getValue(TelemetryConstants.LOGGING_SOURCE)\r\n );\r\n logProperties.removeFromBag(TelemetryConstants.LOGGING_SOURCE);\r\n } else if (!CommonUtils.isNullOrEmpty(source)) {\r\n logProperties.addToBag(\"Source\", source);\r\n }\r\n if (!CommonUtils.isNullOrEmpty(errorCode))\r\n logProperties.addToBag(\"ErrorCode\", errorCode);\r\n\r\n if (!CommonUtils.isNullOrEmpty(stackTrace))\r\n logProperties.addToBag(\"StackTrace\", stackTrace);\r\n\r\n return logProperties;\r\n }\r\n\r\n private addPropertyBagValues(\r\n eventProperties: LogPropertyBag,\r\n transactionId?: string,\r\n source?: string\r\n ) {\r\n eventProperties = eventProperties || new LogPropertyBag();\r\n const appNameForTelemetry = this.getCurrentPartnerTelemetryName();\r\n eventProperties = FxpLogHelper.addEnvironmentDetails(\r\n eventProperties,\r\n transactionId,\r\n source,\r\n this.instrumentationKey,\r\n appNameForTelemetry\r\n );\r\n eventProperties = this.addUserRoleGroupDetails(eventProperties);\r\n eventProperties = this.addUserTenantDetails(eventProperties);\r\n eventProperties.addToBag(\r\n \"networkSpeed\",\r\n NetworkConnection.getInstance().getCurrentNetworkSpeed()\r\n );\r\n return eventProperties;\r\n }\r\n\r\n private addUserRoleGroupDetails(eventProperties: LogPropertyBag) {\r\n if (this.loggedInUserContext) {\r\n eventProperties.addToBag(\r\n RoleGroupDetails.LOGGEDINUSERROLEGROUPID,\r\n this.loggedInUserContext.RoleGroupId == undefined\r\n ? \"\"\r\n : this.loggedInUserContext.RoleGroupId\r\n );\r\n eventProperties.addToBag(\r\n RoleGroupDetails.LOGGEDINUSERROLEGROUPNAME,\r\n this.loggedInUserContext.RoleGroupName == undefined\r\n ? \"\"\r\n : this.loggedInUserContext.RoleGroupName\r\n );\r\n }\r\n if (this.isObo && this.OBOUserContext) {\r\n eventProperties.addToBag(\r\n RoleGroupDetails.OBOROLEGROUPID,\r\n this.OBOUserContext.RoleGroupId == undefined\r\n ? \"\"\r\n : this.OBOUserContext.RoleGroupId\r\n );\r\n eventProperties.addToBag(\r\n RoleGroupDetails.OBOROLEGROUPNAME,\r\n this.OBOUserContext.RoleGroupName == undefined\r\n ? \"\"\r\n : this.OBOUserContext.RoleGroupName\r\n );\r\n }\r\n return eventProperties;\r\n }\r\n\r\n /**\r\n * To add loggedIn user tenant properties that are common to all methods\r\n * @param properties\r\n */\r\n private addUserTenantDetails(eventProperties: LogPropertyBag) {\r\n if (this.loggedInUserContext) {\r\n eventProperties.addToBag(\r\n TenantDetails.LOGGEDINUSERTENANTKEY,\r\n this.loggedInUserContext == undefined\r\n ? \"\"\r\n : this.loggedInUserContext.TenantKey\r\n );\r\n eventProperties.addToBag(\r\n TenantDetails.LOGGEDINUSERTENANTNAME,\r\n this.loggedInUserContext.TenantName == undefined\r\n ? \"\"\r\n : this.loggedInUserContext.TenantName\r\n );\r\n }\r\n if (this.isObo && this.OBOUserContext) {\r\n eventProperties.addToBag(\r\n TenantDetails.OBOTENANTKEY,\r\n this.OBOUserContext == undefined ? \"\" : this.OBOUserContext.TenantKey\r\n );\r\n eventProperties.addToBag(\r\n TenantDetails.OBOTENANTNAME,\r\n this.OBOUserContext.TenantName == undefined\r\n ? \"\"\r\n : this.OBOUserContext.TenantName\r\n );\r\n }\r\n return eventProperties;\r\n }\r\n\r\n public getCorrelationId(correlationId?: string): string {\r\n if (!CommonUtils.isNullOrEmpty(correlationId)) return;\r\n if (this.correlationProvider)\r\n return this.correlationProvider.getCorrelationId();\r\n if (this._correlator) return this._correlator.getCorrelationId();\r\n if ($.correlator) return $.correlator.getCorrelationId();\r\n }\r\n\r\n public getSubCorrelationId(): string {\r\n if (this._correlator) return this._correlator.getSubCorrelationId();\r\n }\r\n\r\n /**\r\n * Method to renew the correlation identity.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#renewCorrelationId\r\n */\r\n public renewCorrelationId() {\r\n if (this._correlator) return this._correlator.renewCorrelationId();\r\n }\r\n\r\n /**\r\n * Method to renew the sub correlation identity.\r\n * @abstract\r\n * @method Fxp.telemetry.fxpLogger#renewSubCorrelationId\r\n * @description Method to renew the sub correlation identity.\r\n */\r\n public renewSubCorrelationId() {\r\n if (this._correlator) return this._correlator.renewSubCorrelationId();\r\n }\r\n\r\n /**\r\n * logs error to console\r\n * @param exception\r\n */\r\n private internalCustomLog(exception) {\r\n console.error(TelemetryConstants.ERRORPREFIX + JSON.stringify(exception));\r\n }\r\n\r\n getDefaultPropertyBagValues(properties?: LogPropertyBag): LogPropertyBag {\r\n let propBag = properties || this.createPropertyBag();\r\n propBag = this.addPropertyBagValues(propBag);\r\n return propBag;\r\n }\r\n}\r\n","declare var navigator: any; \r\n\r\nexport class NetworkConnection {\r\n _connection: any = navigator.connection || navigator.mozConnection || navigator.webkitConnection;\r\n _effectiveType: any;\r\n static _networkConnection: NetworkConnection; \r\n\r\n constructor(){\r\n this._connection.addEventListener('change', this.broadcastNetworkChange.bind(this));\r\n this.getCurrentNetworkSpeed();\r\n }\r\n\r\n static getInstance(): NetworkConnection{\r\n if (!this._networkConnection)\r\n this._networkConnection = new NetworkConnection(); \r\n\r\n return this._networkConnection;\r\n }\r\n\r\n getCurrentNetworkSpeed(){\r\n this._effectiveType = this._connection.effectiveType;\r\n return this._effectiveType; \r\n }\r\n\r\n broadcastNetworkChange() {\r\n const newEffectiveType = this._connection.effectiveType;\r\n const networkChangeCustomEvent = new CustomEvent(\"network_speed_changed\", {\r\n bubbles: true, // only bubbles and cancelable\r\n cancelable: true, // work in the Event constructor\r\n detail: {'from': this._effectiveType, 'to': newEffectiveType}\r\n });\r\n window.dispatchEvent(networkChangeCustomEvent);\r\n this._effectiveType = newEffectiveType; \r\n \r\n }\r\n}\r\n","import { LogPropertyBag } from \"./LogPropertyBag\";\r\nimport { EnvironmentData } from \"./EnvironmentData\";\r\nimport { FxpLogHelper } from \"./FxpLogHelper\";\r\nimport { ApplicationConstants } from \"../common/ApplicationConstants\";\r\nimport { ITelemetryContextListener } from \"../interfaces/ITelemetryContextListener\";\r\nimport { CommonUtils } from \"../utils/CommonUtils\";\r\n\r\n/**\r\n* A service to get/set telemetry context\r\n* @class Fxp.Telemetry.TelemetryContext\r\n* @classdesc A service to get/set telemetry context\r\n* @example Example to create an instance of FxpTelemetryContext \r\n* //Initializing FxpTelemetryContext Service\r\n* angular.module('FxPApp').controller('AppController', ['FxpTelemetryContext', AppController]);\r\n* function AppController(FxpTelemetryContext){ FxpTelemetryContext.setUserID(\"xxxxx\"); }\r\n*/\r\nexport class TelemetryContext {\r\n\r\n\tprivate static _currentContext: TelemetryContext;\r\n\tprivate _userId: string = \"\";\r\n\tprivate _appName: string = \"\";\r\n\tprivate _appVersion: string = \"\";\r\n\tprivate _userRole: string = \"\";\r\n\tprivate _sessionId: string = \"\";\r\n\tprivate _geography: string = \"\";\r\n\tprivate _envData: any = null;\r\n\tprivate _globalPropertyBag: LogPropertyBag = new LogPropertyBag();\r\n\tprivate contextChangeListeners: Array = new Array();\r\n\r\n\tprivate constructor() {\r\n\t\tthis.setAppContext('FXP', 'V1');\r\n\t\tthis._envData = [];\r\n\t}\r\n\r\n\tstatic getInstance(): TelemetryContext{\r\n\t\tif (!this._currentContext) {\r\n\t\t\tthis._currentContext = new TelemetryContext(); \r\n\t\t}\r\n\t\treturn this._currentContext;\r\n\t}\r\n\r\n\r\n\tgetGlobalPropertyBag(): LogPropertyBag {\r\n\t\treturn this._globalPropertyBag;\r\n\t}\r\n\r\n\taddToGlobalPropertyBag(key: string, value: string) {\r\n\t\tthis._globalPropertyBag.addToBag(key, value);\r\n\t}\r\n\r\n\tremoveFromGlobalPropertyBag(key: string) {\r\n\t\tthis._globalPropertyBag.removeFromBag(key);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t* gets instance of TelemetryContext Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.CurrentContext \r\n\t* @example Example to invoke CurrentContext\r\n\t* FxpTelemetryContext.CurrentContext();\r\n\t*/\r\n\t//Keeping this function as is for backward Compatibility\r\n\tpublic static get CurrentContext(): TelemetryContext {\r\n\t\tif (TelemetryContext._currentContext) {\r\n\t\t\treturn TelemetryContext._currentContext;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tTelemetryContext._currentContext = new TelemetryContext();\r\n\t\t\treturn TelemetryContext._currentContext;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* sets UserId of Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setUserID\r\n\t* @param {string} UserID a Logged IN UserId in FXP. \r\n\t* @example Example to invoke setUserID\r\n\t* FxpTelemetryContext.setUserID('xxxxxx');\r\n\t*/\r\n\tsetUserID(userID: string) {\r\n\t\tif (userID)\r\n\t\t\tthis._userId = userID;\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"User Id\"));\r\n\t}\r\n\r\n\t/**\r\n\t* gets UserId of Telemetry Context Object, return type of the method is a string\r\n\t* @method Fxp.Telemetry.TelemetryContext.setUserID \r\n\t* @example Example to invoke getUserID\r\n\t* FxpTelemetryContext.getUserID();\r\n\t*/\r\n\tgetUserID(): string {\r\n\t\treturn this._userId;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t* sets Application Context of Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setAppContext\r\n\t* @param {string} appName Application Name. \r\n\t* @param {string} appVersion Application Version. \r\n\t* @example Example to invoke setAppContext\r\n\t* FxpTelemetryContext.setAppContext('FXP','V1');\r\n\t*/\r\n\tsetAppContext(appName: string, appVersion: string) {\r\n\t\tif (appName)\r\n\t\t\tthis._appName = appName;\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"Application Name\"));\r\n\r\n\t\tif (appVersion)\r\n\t\t\tthis._appVersion = appVersion;\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"Application Version\"));\r\n\r\n\t\tthis.notifyContextChangeListeners();\r\n\t}\r\n\r\n\t/**\r\n\t* gets getAppVersion of Telemetry Context Object, return type of the method is a string\r\n\t* @method Fxp.Telemetry.TelemetryContext.getAppVersion \r\n\t* @example Example to invoke getAppVersion\r\n\t* FxpTelemetryContext.getAppVersion();\r\n\t*/\r\n\tgetAppVersion(): string {\r\n\t\treturn this._appVersion;\r\n\t}\r\n\r\n\t/**\r\n\t* gets Application Name of Telemetry Context Object, return type of the method is a string\r\n\t* @method Fxp.Telemetry.TelemetryContext.getAppName \r\n\t* @example Example to invoke getAppName\r\n\t* FxpTelemetryContext.getAppName();\r\n\t*/\r\n\tgetAppName(): string {\r\n\t\treturn this._appName;\r\n\t}\r\n\r\n\t/**\r\n\t* sets UserRole of Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setUserRole \r\n\t* @param {string} userRole Business Role of Logged in User. \r\n\t* @example Example to invoke setUserRole\r\n\t* FxpTelemetryContext.setUserRole('Architect');\r\n\t*/\r\n\tsetUserRole(userRole: string) {\r\n\t\tif (userRole) {\r\n\t\t\tthis._userRole = userRole;\r\n\t\t\tthis.notifyContextChangeListeners();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"User Role\"));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* gets UserRole of Telemetry Context Object, return type of the method is a string\r\n\t* @method Fxp.Telemetry.TelemetryContext.getUserRole \r\n\t* @example Example to invoke getUserRole\r\n\t* FxpTelemetryContext.getUserRole();\r\n\t*/\r\n\tgetUserRole(): string {\r\n\t\treturn this._userRole;\r\n\t}\r\n\r\n\t/**\r\n\t* sets SessionID of Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setSessionID \r\n\t* @param {string} SessionID SessionId of Logged in User. \r\n\t* @example Example to invoke setSessionID\r\n\t* FxpTelemetryContext.setSessionID(\"12345-56789-123364\");\r\n\t*/\r\n\tsetSessionID(sessionID: string) {\r\n\t\tif (sessionID)\r\n\t\t\tthis._sessionId = sessionID;\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"Session Id\"));\r\n\t}\r\n\r\n\t/**\r\n\t* gets SessionID of Telemetry Context Object, return type of the method is a string\r\n\t* @method Fxp.Telemetry.TelemetryContext.setSessionID \r\n\t* @example Example to invoke setSessionID\r\n\t* FxpTelemetryContext.setSessionID();\r\n\t*/\r\n\tgetSessionID(): string {\r\n\t\treturn this._sessionId;\r\n\t}\r\n\r\n\t/**\r\n\t* gets Geography Information of Telemetry Context Object, return type of the method is a string\r\n\t* @method Fxp.Telemetry.TelemetryContext.getGeography \r\n\t* @example Example to invoke getGeography\r\n\t* FxpTelemetryContext.getGeography();\r\n\t*/\r\n\tgetGeography(): string {\r\n\t\treturn this._geography;\r\n\t}\r\n\r\n\t/**\r\n\t* sets Geography of Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setGeography \r\n\t* @param {string} geo IP Address of Logged in User. \r\n\t* @example Example to invoke setGeography\r\n\t* FxpTelemetryContext.setGeography(\"127.0.0.1\");\r\n\t*/\r\n\tsetGeography(geo: string) {\r\n\t\tif (geo) {\r\n\t\t\tthis._geography = geo;\r\n\t\t\tthis.notifyContextChangeListeners();\r\n\t\t}\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"Geography\"));\r\n\r\n\t}\r\n\r\n\t/**\r\n\t* Sets user Session of Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setNewUserSession \r\n\t* @param {Fxp.Telemetry.UserInfo} userInfo UserInfo of Logged in User. \r\n\t* @param {string} sessionId sessionId of Logged in User. \r\n\t* @example Example to invoke setNewUserSession\r\n\t* FxpTelemetryContext.setNewUserSession();\r\n\t*/\r\n\tsetNewUserSession(userId: string, sessionId?: string): string {\r\n\t\tif (!sessionId)\r\n\t\t\tsessionId = FxpLogHelper.getNewSessionId(); // CodeQL [js/insecure-randomness] Not a security-sensitive data\r\n\r\n\t\tif (userId) {\r\n\t\t\tthis.setUserID(userId);\r\n\t\t\tthis.setSessionID(sessionId);\r\n\t\t\tthis.notifyContextChangeListeners();\r\n\t\t}\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"UserInfo\"));\r\n\r\n\t\treturn sessionId;\r\n\t}\r\n\r\n\tinitUserSession(){\r\n\t\tlet sessionIdCached = window.sessionStorage.getItem(ApplicationConstants.FxpSessionKey);\r\n\t\tif (CommonUtils.isNullOrEmpty(sessionIdCached)) {\r\n\t\t\tsessionIdCached = FxpLogHelper.getNewSessionId(); // CodeQL [SM01527] Insecure randomness - The value generated here is not a secret, guids for tracking purpose only\r\n\t\t\twindow.sessionStorage.setItem(ApplicationConstants.FxpSessionKey, sessionIdCached);\r\n\t\t}\r\n\t\tthis.setSessionID(sessionIdCached);\r\n\t\tthis.notifyContextChangeListeners();\r\n\t\tconsole.log(`SessionId: ${sessionIdCached}`) ;\r\n\t}\r\n\r\n\t/**\r\n\t* sets Enviroonment Details of FXP in Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setEnvironmentDetails\r\n\t* @param {string} appName Application Name\r\n\t* @param {Fxp.Telemetry.EnvironmentData} envData Environment Details of FXP. \r\n\t* @example Example to invoke setEnvironmentDetails\r\n\t* FxpTelemetryContext.setEnvironmentDetails();\r\n\t*/\r\n\tsetEnvironmentDetails(appName: string, envData: EnvironmentData) {\r\n\t\tif (!CommonUtils.isNullOrEmpty(appName) && (envData))\r\n\t\t\tthis._envData[appName.toLowerCase()] = envData;\r\n\t\telse\r\n\t\t\tthrow new Error(ApplicationConstants.RequiredMessage.replace('{0}', \"Environment Data\"));\r\n\t}\r\n\t/**\r\n\t* sets Partner Enviroonment Details of FXP in Telemetry Context Object\r\n\t* @method Fxp.Telemetry.TelemetryContext.setEnvironmentDetails\r\n\t* @param {string} environmentName EnvironmentName is Environment Name of the Application like \"Development\" or \"Production\" etc..\r\n\t* @param {Object} partnersTelmetryInfo is a collection of partner telemetry environment details\r\n\t* @example Example to invoke setEnvironmentDetails\r\n\t* FxpTelemetryContext.setPartnerEnvironmentDetails();\r\n\t*/\r\n\tsetPartnerEnvironmentDetails(environmentName, partnersTelmetryInfo) {\r\n\t\tvar self = this;\r\n\t\ttry {\r\n\t\t\tif (!CommonUtils.isNullOrEmpty(partnersTelmetryInfo)) {\r\n\t\t\t\tfor (var index = 0, length = partnersTelmetryInfo.length; index < length; index++) {\r\n\t\t\t\t\tvar partnerTelmetryInfo = partnersTelmetryInfo[index];\r\n\t\t\t\t\tif (!CommonUtils.isNullOrEmpty(partnerTelmetryInfo.Name))\r\n\t\t\t\t\t\tself._envData[partnerTelmetryInfo.Name.toLowerCase()] = new EnvironmentData(environmentName,\r\n\t\t\t\t\t\t\tpartnerTelmetryInfo.ServiceOffering,\r\n\t\t\t\t\t\t\tpartnerTelmetryInfo.ServiceLine,\r\n\t\t\t\t\t\t\t!CommonUtils.isNullOrEmpty(partnerTelmetryInfo.Service) ? partnerTelmetryInfo.Service : \"\",\r\n\t\t\t\t\t\t\t!CommonUtils.isNullOrEmpty(partnerTelmetryInfo.ComponentId) ? partnerTelmetryInfo.ComponentId : \"\",\r\n\t\t\t\t\t\t\tpartnerTelmetryInfo.ComponentName,\r\n\t\t\t\t\t\t\tpartnerTelmetryInfo.Name,\r\n\t\t\t\t\t\t\tpartnerTelmetryInfo.IctoId,\r\n\t\t\t\t\t\t\tpartnerTelmetryInfo.BusinessProcessName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (exception) {\r\n\t\t\tconsole.log(exception);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* gets Environment Details of FXP, return type of the method is a type of Fxp.Telemetry.EnvironmentData class\r\n\t* @method Fxp.Telemetry.TelemetryContext.getEnvironmentDetails\r\n\t* @param {string} appName Application Name\r\n\t* @example Example to invoke getEnvironmentDetails\r\n\t* FxpTelemetryContext.getEnvironmentDetails();\r\n\t*/\r\n\tgetEnvironmentDetails(appName: string): EnvironmentData {\r\n\t\tvar envData;\r\n\t\tif (!CommonUtils.isNullOrEmpty(appName))\r\n\t\t\tenvData = this._envData[appName.toLowerCase()];\r\n\t\treturn envData;\r\n\t}\r\n\r\n\t/**\r\n\t* adds Context Change Event Listner\r\n\t* @method Fxp.Telemetry.TelemetryContext.addContextChangeListener \r\n\t* @param {Fxp.Interfaces.ITelemetryContextListener} listener Context Change Event Listner\r\n\t* @example Example to invoke addContextChangeListener\r\n\t* FxpTelemetryContext.addContextChangeListener(\"xxxx\");\r\n\t*/\r\n\taddContextChangeListener(listener: ITelemetryContextListener) {\r\n\t\tthis.contextChangeListeners.push(listener);\r\n\t}\r\n\r\n\tprivate notifyContextChangeListeners() {\r\n\t\tfor (var listener in this.contextChangeListeners)\r\n\t\t\tthis.contextChangeListeners[listener].notify();\r\n\t}\r\n}\r\n","import { ApplicationConstants } from \"../common/ApplicationConstants\";\r\n\r\nexport class CommonUtils {\r\n\r\n public static clone(input: object): any {\r\n return JSON.parse(JSON.stringify(input));\r\n }\r\n\r\n public static isNullOrEmpty(input: any) {\r\n return (input === null || input === undefined || jQuery.isEmptyObject(input) || input.toString().length === 0 || input === \"null\");\r\n }\r\n\r\n public static getNewGuId(): string {\r\n var d: number = new Date().getTime();\r\n var guid: string = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n\r\n return guid;\r\n }\r\n\r\n public static isObject(obj: any): boolean {\r\n return (!!obj) && (obj.constructor === Object);\r\n }\r\n\r\n public static pullFocusToElement(elementId): void {\r\n $('#' + elementId).focus();\r\n }\r\n\r\n public static angularInherits(ctor, superCtor): void {\r\n ctor.super_ = superCtor;\r\n if (superCtor) {\r\n ctor.prototype = Object.create(superCtor.prototype, {\r\n constructor: {\r\n value: ctor,\r\n enumerable: false\r\n }\r\n });\r\n }\r\n }\r\n\r\n public static hashCode(value): string {\r\n var hash = 0;\r\n if (value.length == 0)\r\n return hash.toString();\r\n for (var i = 0; i < value.length; i++) {\r\n var char = value.toString().charCodeAt(i);\r\n hash = ((hash << 5) - hash) + char;\r\n hash = hash & hash; // Convert to 32bit integer\r\n }\r\n return hash.toString();\r\n }\r\n\r\n public static isGuid(value) {\r\n var regex = /[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}/i;\r\n var match = regex.exec(value);\r\n return match != null;\r\n }\r\n\r\n public static getSessionStorageUserInfoKey(userIdentifier: string): string {\r\n if (userIdentifier === undefined || userIdentifier === null)\r\n return null;\r\n\r\n if (this.isGuid(userIdentifier))\r\n return userIdentifier + \"-userInfo\";\r\n return userIdentifier.toLowerCase() + \"-userInfo\";\r\n }\r\n\r\n public static getSessionStorageUserClaimsKey(userIdentifier: string): string {\r\n if (userIdentifier === undefined || userIdentifier === null)\r\n return null;\r\n\r\n if (this.isGuid(userIdentifier))\r\n return \"fxpUserClaims_\" + userIdentifier;\r\n return \"fxpUserClaims_\" + userIdentifier.toLowerCase();\r\n }\r\n\r\n public static getArrayLength(arrayCollection): number {\r\n return CommonUtils.isNullOrEmpty(arrayCollection) ? 0 : arrayCollection.length;\r\n }\r\n\r\n public static getIndexOfObject(source, compareKey, value): number {\r\n var index = -1;\r\n var length = source.length;\r\n for (let i = 0; i < length; i++) {\r\n if (source[i][compareKey] === value) {\r\n index = i;\r\n break;\r\n }\r\n }\r\n return index;\r\n }\r\n\r\n public static generateUPN(userInfo: any, fxpAppSettings: any): string {\r\n // getting user alias and removing partners~ from it if it is there.\r\n let UPN = userInfo.Alias;\r\n if (userInfo.Domain.toLowerCase() == \"corpnet\")\r\n // appending domain.\r\n UPN += fxpAppSettings.UpnCorpnet;\r\n else\r\n // removing partners~ from UPN if it is there and appending partner domain.\r\n UPN = UPN.substring(UPN.indexOf('~') + 1) + fxpAppSettings.UpnPartner;\r\n return UPN.toLowerCase();\r\n }\r\n\r\n public static stringFormat(str: string, ...params: string[]) {\r\n return str.replace(/{(\\d+)}/g, function (match, number) {\r\n return typeof params[number] != 'undefined'\r\n ? params[number]\r\n : match\r\n ;\r\n });\r\n }\r\n\r\n public static getTenantURLSpecificPageTitle(str: string) {\r\n if (window.location.href.indexOf(ApplicationConstants.SalesTenantUrlString) > -1) {\r\n return str.replace(ApplicationConstants.ESTenanatUrlString, ApplicationConstants.SalesTenantUrlString);\r\n }\r\n return str;\r\n }\r\n\r\n public static jsonConcat(obj1: any, obj2: any) {\r\n for (var key in obj2) {\r\n obj1[key] = obj2[key];\r\n }\r\n return obj1;\r\n }\r\n\r\n private static isObjectAnArray(val: any): boolean {\r\n return Object.prototype.toString.call(val) === '[object Array]';\r\n }\r\n\r\n private static isPlainObject(val: any): boolean {\r\n return Object.prototype.toString.call(val) === '[object Object]';\r\n }\r\n\r\n /**\r\n * This method reads the value of the property specified with key parameter from the given object in case insensitive way.\r\n * @abstract\r\n * @method CommonUtils#getPropertyValueCaseInsensitive\r\n * @param {object} object - Object on which property has to be read.\r\n * @param {string} key - Name of the property in any case (Upper, Lower, Pascal, Camel)\r\n * @returns {string} - The value of the property on the given object.\r\n */\r\n public static getPropertyValueCaseInsensitive(object: object, key: string) {\r\n return object[Object.keys(object).filter(function (k) {\r\n return k.toLowerCase() === key.toLowerCase();\r\n })[0]];\r\n }\r\n\r\n public static sortJsonObj(inputJson: any, isArray: boolean = false) {\r\n isArray = isArray || false;\r\n let inputObject: any = {};\r\n if (CommonUtils.isObjectAnArray(inputJson)) {\r\n // Sort or don't sort arrays\r\n if (isArray) {\r\n inputObject = inputJson;\r\n } else {\r\n inputObject = inputJson.sort();\r\n }\r\n\r\n inputObject.forEach(function (v, i) {\r\n inputObject[i] = CommonUtils.sortJsonObj(v, isArray);\r\n });\r\n\r\n if (!isArray) {\r\n inputObject = inputObject.sort(function (a, b) {\r\n a = JSON.stringify(a);\r\n b = JSON.stringify(b);\r\n return a < b ? -1 : (a > b ? 1 : 0);\r\n });\r\n }\r\n } else if (CommonUtils.isPlainObject(inputJson)) {\r\n inputObject = {};\r\n Object.keys(inputJson).sort(function (a, b) {\r\n if (a.toLowerCase() < b.toLowerCase()) return -1;\r\n if (a.toLowerCase() > b.toLowerCase()) return 1;\r\n return 0;\r\n }).forEach(function (key) {\r\n inputObject[key] = CommonUtils.sortJsonObj(inputJson[key], isArray);\r\n });\r\n } else {\r\n inputObject = inputJson;\r\n }\r\n return inputObject;\r\n }\r\n\r\n public static objectToString(input: any): string {\r\n if (!input) return null;\r\n if (typeof input === \"string\") {\r\n return input;\r\n }\r\n if (!CommonUtils.isObject(input)) return null;\r\n\r\n try {\r\n return JSON.stringify(input);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n\r\n }\r\n\r\n public static getQueryString(field: string, url?: string) {\r\n var href = url ? url : window.location.href;\r\n var reg = new RegExp('[?&]' + field + '=([^&#]*)', 'i');\r\n var string = reg.exec(href);\r\n return string ? string[1] : null;\r\n };\r\n\r\n public static getScriptBaseUrl(){\r\n var baseUrl = '';\r\n var currentScriptUrl = document.currentScript['src'];\r\n if (currentScriptUrl.indexOf('exclude.inline.bundle') > 0) {\r\n currentScriptUrl = Error().stack.match(/(https?:\\/\\/[^ ]*)/g);\r\n baseUrl = currentScriptUrl\r\n .filter((item) => item.indexOf('localhost:5000') === -1)[0]\r\n .toLowerCase();\r\n baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));\r\n } else {\r\n baseUrl = currentScriptUrl.substring(0, currentScriptUrl.lastIndexOf('/'));\r\n }\r\n if (baseUrl.endsWith(\"/\")){\r\n baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));\r\n }\r\n return baseUrl;\r\n }\r\n\r\n public static removePII(data: string):string{\r\n let FxpAppSettings: any = window[\"FxpAppSettings\"];\r\n if (CommonUtils.isNullOrEmpty(data)) {\r\n return data;\r\n }\r\n else if(CommonUtils.isObject(data)){\r\n\t\t\tdata = CommonUtils.objectToString(data);\r\n\t\t\tif(CommonUtils.isNullOrEmpty(data)){\r\n\t\t\t\treturn data;\r\n\t\t\t}\r\n\t\t}\r\n else {\r\n data = String(data);\r\n }\r\n let PIIRegex;\r\n if (CommonUtils.isNullOrEmpty(FxpAppSettings?.PIIFilterRegex) \r\n && !CommonUtils.isNullOrEmpty(ApplicationConstants?.PIIFilterRegex)) {\r\n PIIRegex = JSON.parse(ApplicationConstants?.PIIFilterRegex);\r\n }\r\n else {\r\n PIIRegex = JSON.parse(FxpAppSettings?.PIIFilterRegex);\r\n }\r\n if(!CommonUtils.isNullOrEmpty(PIIRegex)){\r\n PIIRegex.forEach((filter) => {\r\n const regexp = new RegExp(filter, \"g\");\r\n data = data?.replace(regexp, \"REDACTED\");\r\n });\r\n }\r\n return data;\r\n }\r\n}\r\n","import { IWindowService } from \"angular\";\r\nimport { FxpBroadcastedEvents } from \"../services/FxpBroadcastedEvents\";\r\nimport { IFxPService } from \"../interfaces/IFxpService\";\r\ndeclare var _: any; \r\n\r\nexport class DeviceFactoryProvider implements IFxPService{ \r\n\r\n resolution: any;\r\n\r\n constructor(private $window:angular.IWindowService, private $rootScope:angular.IWindowService, private $timeout:angular.ITimeoutService){\r\n this.resolution = {\r\n devicePixelRatio:$window.devicePixelRatio,\r\n types: {\r\n mobile: 'xs',\r\n tablet: 'sm',\r\n desktop: 'lg'\r\n }\r\n };\r\n\r\n this.resolution.size = this.getWindowSize();\r\n this.resolution.type = this.updateType();\r\n\r\n var self = this;\r\n var lazyUpdate = _.throttle(function (event) {\r\n $timeout(function () {\r\n self.resolution.size = self.getWindowSize();\r\n self.resolution.type = self.updateType();\r\n $rootScope.$broadcast(FxpBroadcastedEvents.OnLayoutChanged, self.resolution.type);\r\n });\r\n }, 250);\r\n\r\n angular\r\n .element($window)\r\n .bind('resize', lazyUpdate);\r\n }\r\n\r\n getWindowSize = function () {\r\n return {\r\n width: this.$window.innerWidth,\r\n height: this.$window.innerHeight\r\n };\r\n };\r\n\r\n updateType = function () {\r\n if (this.resolution.size.width <= 736) {\r\n return this.resolution.types.mobile;\r\n }\r\n else if (this.resolution.size.width <= 1024) {\r\n return this.resolution.types.tablet;\r\n }\r\n else if (this.resolution.size.width > 1024) {\r\n return this.resolution.types.desktop;\r\n }\r\n };\r\n\r\n isSmallScreen = function () {\r\n return this.resolution.type === this.resolution.types.mobile\r\n || this.resolution.type === this.resolution.types.tablet;\r\n };\r\n\r\n isMobile = function () {\r\n return this.resolution.type === this.resolution.types.mobile;\r\n };\r\n\r\n isTablet = function () {\r\n return this.resolution.type === this.resolution.types.tablet;\r\n };\r\n\r\n isDesktop = function () {\r\n return this.resolution.type === this.resolution.types.desktop;\r\n };\r\n\r\n}\r\n","// download system-down-div.html and put in index.cshtml div.\r\nexport function showSystemDownOverlay(headerText, descriptionText, pageTitle, supportLinkText?, supportLink?, showSupportLinks?) {\r\n\tdocument.title = pageTitle;\r\n\t$(\"#contentHost\").load(\"templates/system-down-div.html\", function () {\r\n\t\tif (headerText)\r\n\t\t\tdocument.getElementById(\"headerText\").innerHTML = headerText;\r\n\t\tif (descriptionText)\r\n\t\t\tdocument.getElementById(\"descriptionText\").innerHTML = descriptionText;\r\n\r\n\t\tif (!showSupportLinks){\r\n\t\t\t$('#supportLinkContainer').hide();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (supportLinkText)\r\n\t\t\tdocument.getElementById(\"supportLink\").innerHTML = supportLinkText;\r\n\t\tif (supportLink) {\r\n\t\t\tdocument.getElementById(\"supportLink\").setAttribute(\"href\", supportLink);\r\n\t\t}\r\n\t});\r\n}","import * as core from '@angular/core';\r\nimport * as common from '@angular/common';\r\nimport * as forms from '@angular/forms';\r\nimport * as animations from \"@angular/animations\";\r\nimport * as router from '@uirouter/angular';\r\nimport * as rx from 'rxjs';\r\nimport * as plat from '@angular/platform-browser';\r\nimport * as dny from '@angular/platform-browser-dynamic';\r\nimport * as upgrade from '@angular/upgrade';\r\nimport * as ngbootstrap from '@ng-bootstrap/ng-bootstrap';\r\n\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { UpgradeModule, downgradeComponent } from '@angular/upgrade/static';\r\n\r\nimport { UrlService } from '@uirouter/core';\r\nimport '@uirouter/angularjs/release/stateEvents';\r\nimport { AppModule } from './app/modules/app.module';\r\nimport { CommonUtils } from './js/utils/CommonUtils';\r\nimport { GlobalExceptionHandler } from './js/telemetry/GlobalExceptionHandler';\r\nimport { enableProdMode, Compiler, NgZone } from '@angular/core';\r\nimport { FxpLazyLoader } from './app/fxplazyloader';\r\nimport { Resiliency } from './js/resiliency/FxpResiliency';\r\nimport { getUIRouter } from '@uirouter/angular-hybrid'\r\nimport { TelemetryConstants } from './js/telemetry/TelemetryConst';\r\nimport { SystemEvent } from './js/telemetry/SystemEvent';\r\nimport { ComponentType } from \"@microsoftit/telemetry-extensions-npm\";\r\nimport { FxpConstants } from './js/common/ApplicationConstants';\r\nimport { ErrorSeverityLevel } from './js/telemetry/ErrorSeverityLevel';\r\nimport { FxpLoggerService } from './js/telemetry/fxpLogger';\r\nimport { ErrorCodes } from './js/constants/errorCodes';\r\n\r\n//Exposing _showPageDirtyPopup in browser console.\r\ndeclare global {\r\n\tinterface Window { _showPageDirtyPopup: boolean; }\r\n}\r\ndeclare const angular: any;\r\nconst fxpLoggerService: FxpLoggerService = FxpLoggerService.getInstance(); \r\n\r\nconst fxpModule = angular.module('FxPApp');\r\nfxpModule.config(['$urlServiceProvider', ($urlService: UrlService) => $urlService.deferIntercept()]);\r\n\r\nconst dependentModules = Resiliency.getResilientModules(fxpModule.requires);\r\n// TODO: This needs to go to configuration.\r\ndependentModules.push('ui.router.upgrade');\r\ndependentModules.push('ui.router.state.events');\r\ndeclare const FxpBaseConfiguration: any;\r\n\r\nfxpModule.requires = dependentModules;\r\n\r\nconst source = `${TelemetryConstants.FXP_TELEMETRY_BASE_NAME}.Main` ;\r\n\r\nif (!CommonUtils.getQueryString(\"debug\")) {\r\n enableProdMode();\r\n console.log('Disabling console.log in PROD mode'); \r\n console.log = function(){}\r\n}\r\n\r\ntry {\r\n\r\n \r\n const customProperties = fxpLoggerService.createPropertyBag();\r\n \r\n fxpLoggerService.logSystemEvent(source, \r\n new SystemEvent(TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + \".ModuleBootstrapBegin\", \r\n ComponentType.Web, \"Bootstrapping angular modules\"),\r\n customProperties);\r\n\r\n const preBootstrapTimeStamp = performance.now();\r\n platformBrowserDynamic().bootstrapModule(AppModule).then(platformReference => {\r\n fxpLoggerService.logSystemEvent(source, \r\n new SystemEvent(TelemetryConstants.FXP_TELEMETRY_PLATFORM_BOOTSTRAP + \".ModuleBootstrapEnd\", \r\n ComponentType.Web, \r\n \"Bootstrapping angular modules completed\"), \r\n customProperties); \r\n \r\n customProperties.addToBag('SystemMessage', 'Time taken to Bootstrap FxP @angular and angularjs modules .');\r\n const duration: any = performance.now() - preBootstrapTimeStamp;\r\n fxpLoggerService.logMetric(source, FxpConstants.metricConstants.ModuleBootstrapping, duration, customProperties); \r\n\r\n const upgradeModule = platformReference.injector.get(UpgradeModule); \r\n upgradeModule.bootstrap(document.documentElement, ['FxPApp']);\r\n const url: UrlService = getUIRouter(platformReference.injector).urlService; //platformReference.injector.get(UrlService);\r\n function startUIRouter() {\r\n url.listen();\r\n url.sync();\r\n }\r\n const ngZone: NgZone = platformReference.injector.get(NgZone);\r\n ngZone.run(startUIRouter);\r\n FxpLazyLoader.setRootModuleReference(platformReference);\r\n });\r\n} catch (err) {\r\n const error = new Error();\r\n let systemDownHeader, systemDownDescription, systemDownPageTitle;\r\n error.message = 'FxP App Boot Failure';\r\n if (FxpBaseConfiguration.FxpConfigurationStrings.UIMessages.JavaScriptException) {\r\n systemDownHeader = FxpBaseConfiguration.FxpConfigurationStrings.UIMessages.JavaScriptException.ErrorMessageTitle;\r\n systemDownDescription = FxpBaseConfiguration.FxpConfigurationStrings.UIMessages.JavaScriptException.ErrorMessage;\r\n systemDownPageTitle = CommonUtils.getTenantURLSpecificPageTitle(FxpBaseConfiguration.FxpConfigurationStrings.UIMessages.JavaScriptException.PageTitle);\r\n } else {\r\n console.error(\"Failed to load JavaScriptException error string from UIMessages\");\r\n }\r\n // More specific error logging.\r\n console.error(\"FxP App Boot Failure: \", err.message);\r\n \r\n const errorProperites = fxpLoggerService.createPropertyBag();\r\n errorProperites.addToBag(\"Message\", err.message);\r\n errorProperites.addToBag('ErrorCode', ErrorCodes.ModuleBoostrapFailure)\r\n\r\n fxpLoggerService.logException(source, err, errorProperites, undefined, undefined, ErrorSeverityLevel.Critical); \r\n GlobalExceptionHandler.logFxpBootFailure(errorProperites, source, systemDownHeader, systemDownDescription, systemDownPageTitle);\r\n}\r\n","module.exports = angular;"],"sourceRoot":"webpack:///FxpNG2"}