DashboardContent.js 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. 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; }
  4. 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; }
  5. /**
  6. * Licensed Materials - Property of IBM
  7. * IBM Cognos Products: Dashboard (C) Copyright IBM Corp. 2020
  8. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. */
  10. /**
  11. * @class DashboardContent
  12. * @classdesc This Content child class provides content for the dashboard
  13. */
  14. define(['./Content'], function (Content) {
  15. var UNSUPPORTED_ERROR = 'Not supported.';
  16. var DashboardContent = function (_Content) {
  17. _inherits(DashboardContent, _Content);
  18. function DashboardContent() {
  19. _classCallCheck(this, DashboardContent);
  20. return _possibleConstructorReturn(this, _Content.apply(this, arguments));
  21. }
  22. DashboardContent.prototype.initialize = function initialize() {
  23. return Promise.resolve(this.getAPI());
  24. };
  25. DashboardContent.prototype.getType = function getType() {
  26. return 'dashboard';
  27. };
  28. DashboardContent.prototype.getContentInstance = function getContentInstance() {
  29. return undefined;
  30. };
  31. DashboardContent.prototype._getModel = function _getModel() {
  32. return this.boardModel;
  33. };
  34. DashboardContent.prototype._getModelItems = function _getModelItems() {
  35. // TODO: Once tied into the content hierarchy, this should return '[this.boardModel.layout]'
  36. return [];
  37. };
  38. DashboardContent.prototype.createFeatureLoader = function createFeatureLoader() {};
  39. DashboardContent.prototype.onAddItem = function onAddItem() /*payload*/{};
  40. DashboardContent.prototype.onRemoveItem = function onRemoveItem() /*payload*/{};
  41. DashboardContent.prototype.onChangeParent = function onChangeParent() /*payload*/{};
  42. DashboardContent.prototype.preRemoveItem = function preRemoveItem() /*payload*/{};
  43. // The following content api functions do not have an implementation yet, add as required
  44. DashboardContent.prototype.removeChildContent = function removeChildContent() /*id, transactionToken*/{
  45. throw new Error(UNSUPPORTED_ERROR);
  46. };
  47. DashboardContent.prototype.removeContentReference = function removeContentReference() /*content*/{
  48. throw new Error(UNSUPPORTED_ERROR);
  49. };
  50. DashboardContent.prototype.addContentReference = function addContentReference() /*content*/{
  51. throw new Error(UNSUPPORTED_ERROR);
  52. };
  53. DashboardContent.prototype.moveToContainer = function moveToContainer() /*newContainerInst*/{
  54. throw new Error(UNSUPPORTED_ERROR);
  55. };
  56. DashboardContent.prototype.moveContent = function moveContent() /*containerId, contentIdList, transactionToken, insertBeforeMap*/{
  57. throw new Error(UNSUPPORTED_ERROR);
  58. };
  59. DashboardContent.prototype.removeContent = function removeContent() /*id, transactionToken*/{
  60. throw new Error(UNSUPPORTED_ERROR);
  61. };
  62. return DashboardContent;
  63. }(Content);
  64. return DashboardContent;
  65. });
  66. //# sourceMappingURL=DashboardContent.js.map