'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| IBM Cognos Products: BI Dashboard *| (C) Copyright IBM Corp. 2019 *| *| US Government Users Restricted Rights - Use, duplication or disclosure *| restricted by GSA ADP Schedule Contract with IBM Corp. *+------------------------------------------------------------------------+ */ define(['../../../lib/@waca/upgrades/UpgradeBase'], function (UpgradeBase) { var DrillthroughDefinitionScopeUpgrade = function (_UpgradeBase) { _inherits(DrillthroughDefinitionScopeUpgrade, _UpgradeBase); function DrillthroughDefinitionScopeUpgrade() { _classCallCheck(this, DrillthroughDefinitionScopeUpgrade); var _this = _possibleConstructorReturn(this, _UpgradeBase.call(this)); _this.VERSION = 1404; return _this; } /** * Perform upgrades for drillthrough definitions. The old property needs * to be deleted and mapped to the appropriate scope since we now support 3 * rather than 2. * @param {object} spec - spec to perform upgrade on * * @return {Promise} Promise to be resolved when upgrade performed */ DrillthroughDefinitionScopeUpgrade.prototype.up = function up(spec) { if (spec && spec.drillThrough && spec.drillThrough.length) { spec.drillThrough.forEach(function (definition) { definition.scope = definition.reusable ? 'connection' : 'visualization'; delete definition.reusable; }); } return Promise.resolve(spec); }; return DrillthroughDefinitionScopeUpgrade; }(UpgradeBase); return new DrillthroughDefinitionScopeUpgrade(); }); //# sourceMappingURL=DrillthroughDefinitionScopeUpgrade.js.map