'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| IBM Cognos Products: Content Explorer *| (C) Copyright IBM Corp. 2020 *| *| US Government Users Restricted Rights - Use, duplication or disclosure *| restricted by GSA ADP Schedule Contract with IBM Corp. *+------------------------------------------------------------------------+ */ define([], function () { /** * @class * @hideconstructor * @classdesc provides the core dashboard service to be used in glass customaization inside glass */ var DashboardStartupService = function () { function DashboardStartupService() { _classCallCheck(this, DashboardStartupService); } /** * sets the dashbard core service which is available synchronously * waits for the DashboardUserProfile to be initialized * Important: initializing the UserProfileService cannot be expensive as this service is set as immediate * @param {Object} glassContext - glass context * @returns {Promise} resolved when the dashboard core service is set */ DashboardStartupService.prototype.initialize = function initialize(glassContext) { return glassContext.getSvc('.DashboardUserProfileService').then(function (userProfileService) { var coreService = { getFeature: function getFeature(featureName) { var feature = void 0; if (featureName === 'UserProfile') { feature = userProfileService; } else { throw new Error('Unknown feature: ' + featureName); } return feature; } }; glassContext.registerCoreService('.DashboardCoreService', coreService); }); }; return DashboardStartupService; }(); return DashboardStartupService; }); //# sourceMappingURL=DashboardStartupService.js.map