ErrorView.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /*
  4. *+------------------------------------------------------------------------+
  5. *| Licensed Materials - Property of IBM
  6. *| IBM Cognos Products: Dashboard
  7. *| (C) Copyright IBM Corp. 2018, 2019
  8. *|
  9. *| US Government Users Restricted Rights - Use, duplication or disclosure
  10. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  11. *+------------------------------------------------------------------------+
  12. */
  13. define(['jquery', '../../../app/nls/StringResources'], function ($, resources) {
  14. var ErrorView = function () {
  15. function ErrorView() {
  16. _classCallCheck(this, ErrorView);
  17. }
  18. ErrorView.prototype.renderContainer = function renderContainer(data) {
  19. return $('<div class="errorContainer error">Error: ' + this.makeNlsMessage(data.msg) + '</div>');
  20. };
  21. ErrorView.prototype.makeNlsMessage = function makeNlsMessage(msg) {
  22. return msg.params ? resources.get(msg.str, msg.params) : resources.get(msg.str);
  23. };
  24. return ErrorView;
  25. }();
  26. return ErrorView;
  27. });
  28. //# sourceMappingURL=ErrorView.js.map