summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src
diff options
context:
space:
mode:
authoravigaffa <avi.gaffa@amdocs.com>2017-09-10 08:58:51 +0300
committeravigaffa <avi.gaffa@amdocs.com>2017-09-10 10:07:00 +0300
commit00e935fc6b8baae4d9b9ffef2c748202a60b66b4 (patch)
tree56d7b608dbb5a53022db0350f04977da8cd960f5 /openecomp-ui/src
parent75c572279398dc2be7652263843c8802a9406c4f (diff)
Add latest bug fixes to master
Change-Id: Ieddc2330ad4e093984f14a69b52f2ca5cb465a10 Issue-ID: SDC-293 Signed-off-by: avigaffa <avi.gaffa@amdocs.com>
Diffstat (limited to 'openecomp-ui/src')
-rw-r--r--openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx10
-rw-r--r--openecomp-ui/src/nfvo-utils/i18n/i18n.js18
2 files changed, 17 insertions, 11 deletions
diff --git a/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx b/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx
index 8d45d86a9d..40daeff9c5 100644
--- a/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx
+++ b/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx
@@ -115,7 +115,7 @@ const UploadErrorList = ({items}) => {
{item.list.map((error, i) => <ErrorMessage key={i} warning={error.level === 'WARNING'} error={error.message}/> )}
</div>
);}
-
+
return (
<div>
{errors}
@@ -152,10 +152,10 @@ const ErrorHeader = ({errorType, collapsed, onClick}) => {
const ErrorMessage = ({error, warning}) => {
return (
<ListGroupItem className='error-code-list-item'>
- <SVGIcon
- name={warning ? 'exclamationTriangleLine' : 'error'}
- color={warning ? 'warning' : 'negative'} />
- <span className='icon-label'>{error}</span>
+ <SVGIcon
+ name={warning ? 'exclamationTriangleLine' : 'error'}
+ color={warning ? 'warning' : 'negative'} />
+ <span className='icon-label'>{error}</span>
</ListGroupItem>
);
};
diff --git a/openecomp-ui/src/nfvo-utils/i18n/i18n.js b/openecomp-ui/src/nfvo-utils/i18n/i18n.js
index 2f63dfe605..ef97b8bab4 100644
--- a/openecomp-ui/src/nfvo-utils/i18n/i18n.js
+++ b/openecomp-ui/src/nfvo-utils/i18n/i18n.js
@@ -14,14 +14,16 @@
* permissions and limitations under the License.
*/
import IntlObj from 'intl';
+import IntlMessageFormatObj from 'intl-messageformat';
import IntlRelativeFormatObj from 'intl-relativeformat';
import createFormatCacheObj from 'intl-format-cache';
import i18nJson from 'i18nJson';
/*
- Intl libs are using out dated transpailer from ecmascript6.
-* TODO: As soon as they fix it, remove this assignments!!!
-* */
+ Intl libs are using out dated transpailer from ecmascript6.
+ * TODO: As soon as they fix it, remove this assignments!!!
+ * */
var Intl = window.Intl || IntlObj.default,
+ IntlMessageFormat = IntlMessageFormatObj.default,
IntlRelativeFormat = IntlRelativeFormatObj.default,
createFormatCache = createFormatCacheObj.default;
@@ -68,11 +70,15 @@ var i18n = {
dateRelative(date, options) {
return createFormatCache(IntlRelativeFormat)(this._locale, options).format(date);
},
- message(messageId) {
+ message(messageId, options) {
+ let messageTxt = null;
if (i18nJson && i18nJson[messageId]) {
- return i18nJson[messageId];
+ messageTxt = i18nJson[messageId];
+ } else {
+ messageTxt = String(messageId);
}
- return messageId;
+ return createFormatCache(IntlMessageFormat)(messageTxt, this._locale).format(options);
+
},
getLocale() {
return this._locale;