From 983bdb0c0612586cf0d5b42deaaea6dfe30042e6 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Wed, 18 Jan 2017 09:16:01 -0800 Subject: Use col field (column name) if exists in translator. JIRA: COPPER-2 Change-Id: Ib890c45b3c7708bb035045011ff6296b9137934b Signed-off-by: Bryan Sullivan --- components/congress/test-webapp/www/copper.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'components') diff --git a/components/congress/test-webapp/www/copper.js b/components/congress/test-webapp/www/copper.js index 8c087aa..28ab57f 100644 --- a/components/congress/test-webapp/www/copper.js +++ b/components/congress/test-webapp/www/copper.js @@ -1,5 +1,5 @@ /* - Copyright 2015-2016 AT&T Intellectual Property, Inc + Copyright 2015-2017 AT&T Intellectual Property, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -133,8 +133,14 @@ function get_datasource_table_rows(dsIndex,tableIndex) { else { for (j in TRANSLATORS[datasource][i]['field-translators']) { tbhd = element('th',"",null,null); - tbhd.innerHTML = TRANSLATORS[datasource][i]['field-translators'][j]['fieldname']; - tbhd.title = TRANSLATORS[datasource][i]['field-translators'][j]['fieldname']; + if ("col" in TRANSLATORS[datasource][i]['field-translators'][j]) { + tbhd.innerHTML = TRANSLATORS[datasource][i]['field-translators'][j]['col']; + tbhd.title = TRANSLATORS[datasource][i]['field-translators'][j]['col']; + } + else { + tbhd.innerHTML = TRANSLATORS[datasource][i]['field-translators'][j]['fieldname']; + tbhd.title = TRANSLATORS[datasource][i]['field-translators'][j]['fieldname']; + } tbhr.appendChild(tbhd); } } -- cgit 1.2.3-korg