"use strict"; /** * Licensed Materials - Property of IBM * * IBM Cognos Products: BI Glass * * Copyright IBM Corp. 2017 * * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', 'bi/glass/app/NavbarButtonSlideoutController'], function (_, BaseController) { 'use strict'; //NOSONAR var GlobalParametersController = BaseController.extend({ onRender: function onRender(context) { if (!this._canShowGlobalParametersIcon(context)) { context.target.plugin.$el.css('display', 'none'); } }, _canShowGlobalParametersIcon: function _canShowGlobalParametersIcon(context) { var perspective = context.glassContext.appController.currentAppView.perspective; if ('createBoard dashboard ca-modeller ca-modeller-create ca-modeller-upload'.indexOf(perspective) !== -1) { return false; } var parameter_values = context.glassContext.services.userProfile.userProfileSettings.parameter_values; if (!parameter_values || _.isEmpty(parameter_values)) { return false; } var allParameterValuesDisabled = true; for (var parameterName in parameter_values) { if (typeof parameter_values[parameterName].enabled === 'undefined' || parameter_values[parameterName].enabled === true) { allParameterValuesDisabled = false; break; } } return !allParameterValuesDisabled; }, _openSlideout: function _openSlideout() { var slideout = GlobalParametersController.inherited('_openSlideout', this, arguments); slideout.onHide = function () { this.contentView.saveToUserAccount(); }; return slideout; } }); return GlobalParametersController; });