From 1405bcab9ed6dd24a8bb807eabeb9af3695f5fc9 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sun, 17 Feb 2019 08:28:32 -0500 Subject: [PATCH] Created more robust checks for if the organizations exists. --- public/OrgRepoGraph.html | 3 ++- public/js/createOrgInfo.js | 3 ++- public/js/createOrgTable.js | 5 ++++- public/js/profileGen.js | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/OrgRepoGraph.html b/public/OrgRepoGraph.html index f2f225a..7ef464c 100644 --- a/public/OrgRepoGraph.html +++ b/public/OrgRepoGraph.html @@ -100,7 +100,8 @@ createOrgInfo(orgname, 'organizationInfo') } - if(findGetParameter("name") !== null) { + if(findGetParameter("name") !== null) + { createGraphs(findGetParameter("name")) } diff --git a/public/js/createOrgInfo.js b/public/js/createOrgInfo.js index 8b224fc..00564bc 100644 --- a/public/js/createOrgInfo.js +++ b/public/js/createOrgInfo.js @@ -15,6 +15,7 @@ function createOrgInfo(orgName, container) { $("#" + container).html(html); $('#dataTable').DataTable(); }, function(error) { - console.log("Unable to load table data"); + alert("Organization Does Not Exist"); + window.location.href = "./GraphGenerator.html"; }); } \ No newline at end of file diff --git a/public/js/createOrgTable.js b/public/js/createOrgTable.js index 321818f..5a1d5cf 100644 --- a/public/js/createOrgTable.js +++ b/public/js/createOrgTable.js @@ -52,7 +52,10 @@ function createOrgTable(orgName, tableContainer) } $("#" + tableContainer).html(html); - $('#dataTable').DataTable(); + + $(document).ready(function() { + $('#dataTable').DataTable(); + } ); }).catch(function(error) { //console.log("Unable to create table"); diff --git a/public/js/profileGen.js b/public/js/profileGen.js index 8e6f972..41e2cef 100644 --- a/public/js/profileGen.js +++ b/public/js/profileGen.js @@ -49,7 +49,8 @@ function profileGen(username, container) $("#"+container).html(html); }) }, () => { - console.error("error getting user info"); + alert("User Does Not Exist"); + window.location.href = "./GraphGenerator.html"; }); }