123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Dashboard
- *| (C) Copyright IBM Corp. 2014, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define(['../../../lib/@waca/core-client/js/core-client/ui/core/Class', '../../../app/nls/StringResources', 'jquery', 'doT', 'text!./InlineMessage.html'], function (Class, resources, $, dot, templString) {
- var ErrorView = Class.extend({
- /**
- * Constructor
- */
- init: function init() {
- ErrorView.inherited('init', this, arguments);
- this.msgTempl = dot.template(templString || '');
- },
- /**
- * Render container
- *
- * @param {object} data - error data
- * @param {string} data.id - error id
- * @param {string} data.type - error type
- * @param {object} data.msg - error message
- * @param {string} data.msg.str - error message string
- * @param {any} [data.msg.params] - error message string params
- *
- * @return {string} error message container
- */
- renderContainer: function renderContainer(data) {
- var msg = this.makeNlsMessage(data.msg);
- return $(this.msgTempl({
- id: data.id,
- type: data.type,
- msg: msg
- }));
- },
- makeNlsMessage: function makeNlsMessage(msg) {
- return msg.params ? resources.get(msg.str, msg.params) : resources.get(msg.str);
- }
- });
- return ErrorView;
- });
- //# sourceMappingURL=ErrorView.js.map
|