From 1ad40bcd83e02a625a14aec581dbc8ba883fa51a Mon Sep 17 00:00:00 2001 From: Jacky Date: Wed, 15 Nov 2017 23:20:44 -0500 Subject: [PATCH] check if the project has the userMetadata --- .../core/scripts/index/open-project-ui.js | 29 ++++++++++--------- .../core/styles/index/open-project-ui.less | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/main/webapp/modules/core/scripts/index/open-project-ui.js b/main/webapp/modules/core/scripts/index/open-project-ui.js index a6f9a73a7..d12307fab 100644 --- a/main/webapp/modules/core/scripts/index/open-project-ui.js +++ b/main/webapp/modules/core/scripts/index/open-project-ui.js @@ -108,19 +108,22 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { var project = data.projects[n]; project.id = n; project.date = moment(project.modified).format('YYYY-MM-DD HH:mm A'); - for (var n in data.customMetadataColumns) { - var found = false; - for(var i = 0; i < project.userMetadata.length; i++) { - if (project.userMetadata[i].name === data.customMetadataColumns[n].name) { - found = true; - break; - } - if (!found) { - project.userMetadata.push({ - name: data.customMetadataColumns[n].name, - dispay: data.customMetadataColumns[n].display, - value: "" - }); + + if (typeof project.userMetadata !== "undefined") { + for (var n in data.customMetadataColumns) { + var found = false; + for(var i = 0; i < project.userMetadata.length; i++) { + if (project.userMetadata[i].name === data.customMetadataColumns[n].name) { + found = true; + break; + } + if (!found) { + project.userMetadata.push({ + name: data.customMetadataColumns[n].name, + dispay: data.customMetadataColumns[n].display, + value: "" + }); + } } } } diff --git a/main/webapp/modules/core/styles/index/open-project-ui.less b/main/webapp/modules/core/styles/index/open-project-ui.less index afddfe83b..af22da2fc 100644 --- a/main/webapp/modules/core/styles/index/open-project-ui.less +++ b/main/webapp/modules/core/styles/index/open-project-ui.less @@ -118,7 +118,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } #metadata-body td { - padding: 8px + padding: 1px } #metadata-body tr:nth-child(even) {background: #f2f2f2}