12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- '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 Business Analytics (C) Copyright IBM Corp. 2019, 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * @class Properties
- * @hideconstructor
- * @classdesc API class that is used to manage Properties
- */
- define(['../../../lib/@waca/dashboard-common/dist/core/APIFactory', './PropertiesPaneAPI', '../../../app/nls/StringResources', '../../../app/util/ErrorUtils'], function (APIFactory, PropertiesPaneAPI, StringResources, ErrorUtils) {
- var PROVIDER_ID = 'PropertiesPane';
- var PropertiesPane = function () {
- function PropertiesPane(_ref) {
- var features = _ref.features;
- _classCallCheck(this, PropertiesPane);
- this._dashboardApi = features.API;
- this._slideout = features.InAppSlideoutState;
- this._dashboardState = features.DashboardState;
- this._icons = features.Icons;
- this._api = null;
- }
- PropertiesPane.prototype.getAPI = function getAPI() {
- return this._api;
- };
- PropertiesPane.prototype.getProviderId = function getProviderId() {
- return PROVIDER_ID;
- };
- PropertiesPane.prototype.initialize = function initialize() {
- var _this = this;
- this._api = APIFactory.createAPI(this, [PropertiesPaneAPI]);
- var uiState = this._dashboardState.getUiState();
- this._slideout.registerContribution(this.getProviderId(), {
- name: 'properties',
- label: StringResources.get('commonPropertiesLabel'),
- icon: this._icons.getIcon('configure').id,
- type: 'Button',
- order: 5,
- text: StringResources.get('commonPropertiesLabel'),
- className: 'buttonWithText',
- disabled: function disabled() {
- return uiState.eventGroups;
- },
- isEnabled: function isEnabled(idList) {
- // by design, PropertiesPane is a dashboard level action;
- // when the widget is selected this method is called with a non-empty idList and should not be enabled
- if (idList.length > 0) {
- return false;
- }
- var shouldPropertiesActionInToolbar = ErrorUtils.hasCapability(_this._dashboardApi, 'canAuthorDashboard') && uiState.authoring;
- return shouldPropertiesActionInToolbar;
- }
- });
- };
- PropertiesPane.prototype.destroy = function destroy() {
- this._dashboardApi = null;
- this._api = null;
- };
- return PropertiesPane;
- }();
- return PropertiesPane;
- });
- //# sourceMappingURL=PropertiesPane.js.map
|