From 473199d525748636f4dffd906c9944fa3c92d8a2 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Wed, 6 Nov 2019 16:45:53 +0000 Subject: [PATCH 01/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 741077f..a5f0b7f 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByCompany'); + var canvas = document.getElementById('issueByType'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { @@ -450,4 +450,4 @@ $(document).ready(function () { }); - \ No newline at end of file + From 9d348294f1e1a89aa4f91df1aaef4b8df8e9ffa1 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Wed, 6 Nov 2019 16:48:19 +0000 Subject: [PATCH 02/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index a5f0b7f..3bf5c32 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByType'); + var canvas = document.getElementById('issueByCompany'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { From 182fede1c00966bbe84156e5a793b8cdac340f37 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Wed, 6 Nov 2019 16:57:11 +0000 Subject: [PATCH 03/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 458 +++++++++++++++++++++++++++++- 1 file changed, 446 insertions(+), 12 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 3bf5c32..ff6f419 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -1,6 +1,7 @@ //have to define global handlers of chart、、becausecontext.clearRectdoesnotclear你thelastgraphics - + //sort the nodes of the timeliner according to the sequence of time. + var overallStatusPie = null; var issueByCompanyBar = null; var issueByRootCauseBar = null; @@ -9,445 +10,878 @@ var issueByWeekDueBar = null; function sortOnKeys(dict) { var sorted = []; + for (var key in dict) { + sorted[sorted.length] = key; + } + sorted.sort(); + + var tempDict = {}; + for (var i = 0; i < sorted.length; i++) { + tempDict[sorted[i]] = dict[sorted[i]]; + } + + return tempDict; + } + + var Months = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' + ]; + + function random_rgba() { + var o = Math.round, r = Math.random, s = 255; + return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + 0.5 + ')'; + } + + function refreshIssueOverview(overview){ + + var labels=[],dataTotals=[];colors=[]; + for(var status in overview){ + labels.push(status); + dataTotals.push(overview[status]); + colors.push(random_rgba()) + } + + var chartData = { + datasets: [{ + data: dataTotals, + backgroundColor: colors + }], + labels: labels + }; + + var config = { + type: 'pie', + data: chartData, + options: { + responsive: true, + maintainAspectRatio: false, + + title: { + display: true, + text: 'Overall Status' + }, + tooltips: { + mode: 'index', + intersect: true + }, + legend: { + display: true + }, + plugins: { + datalabels: { + display: true, + align: 'center', + anchor: 'center' + } + } + } + }; + + + var canvas = document.getElementById('issueOverview'); + var ctx = canvas.getContext('2d'); + + overallStatusPie = new Chart(ctx, config); + overallStatusPie.update(); + + } + + function refreshModelvsProjectView(modelvsproj){ + + var config = { + type: 'doughnut', + data: { + datasets: [{ + data: [ + modelvsproj.model, + modelvsproj.notmodel + ], + backgroundColor: [ + window.chartColors.yellow, + window.chartColors.green + ], + label: 'Dataset 1' + }], + labels: [ + 'Model Issue', + 'Project Issue' + ] + }, + options: { + responsive: true, + maintainAspectRatio: false, + + title: { + display: true, + text: 'Model Issue vs Project Issue' + }, + legend: { + display: true, + position:'bottom' + } + } + }; + + + var canvas = document.getElementById('issueModelvsProj'); + var ctx = canvas.getContext('2d'); + + issueByRootCauseBar = new Chart(ctx, config); + issueByRootCauseBar.update(); + + } + + function refreshRootcause(rootcause){ + + var labels=[],dataTotals=[];colors=[]; + for(var cause in rootcause){ + labels.push(cause); + dataTotals.push(rootcause[cause]); + colors.push(random_rgba()) + } + + var chartData = { + datasets: [{ + data: dataTotals, + backgroundColor: colors + }], + labels: labels + }; + + var config = { + type: 'doughnut', + data: chartData, + options: { + responsive: true, + maintainAspectRatio: false, + + title: { + display: true, + text: 'Root Cause' + }, + tooltips: { + mode: 'index', + intersect: true + }, + legend: { + display: true + }, + plugins: { + datalabels: { + display: true, + align: 'center', + anchor: 'center' + } + } + } + }; + + + + + var canvas = document.getElementById('issueModelvsProj'); + var ctx = canvas.getContext('2d'); + + issueByRootCauseBar = new Chart(ctx, config); + issueByRootCauseBar.update(); + } -function refreshIssuebyCompany(company){ + + +function refreshIssuebyType(company){ + + var labels=[],dataTotals=[];colors=[]; + for(var com in company){ + labels.push(com); + dataTotals.push(company[com].total); + colors.push(random_rgba()) + } + + var chartData = { + datasets: [{ + data: dataTotals, + backgroundColor: colors + }], + labels: labels + }; - var canvas = document.getElementById('issueByCompany'); + + + + var canvas = document.getElementById('issueByType'); + var ctx = canvas.getContext('2d'); + - issueByCompanyBar = new Chart(ctx, { + + issueByTypeBar = new Chart(ctx, { + type: 'horizontalBar', + data: chartData, + options: { + responsive: true, + maintainAspectRatio: true, + title: { + display: true, - text: 'Open Issue by Company' + + text: 'Open Issue by Type' + }, + tooltips: { + mode: 'index', + intersect: true + }, + legend: { + display: false + } + } + }); - issueByCompanyBar.update(); + + issueByTypeBar.update(); + + } + + function refreshWeekDue(weekdue){ + + weekdue = sortOnKeys(weekdue); + + var labels=[],dataTotal=[],dataClosed=[]; + for(var due_date in weekdue){ + labels.push(Months[new Date(Number(due_date)).getMonth()]+' ' + + new Date(Number(due_date)).getDate()); + dataTotal.push(weekdue[due_date].dueissue); + dataClosed.push(weekdue[due_date].isclosed); + } + + var chartData = { + labels: labels, + datasets: [{ + type: 'bar', + label: 'Due', + backgroundColor: window.chartColors.red, + data: dataTotal, + borderColor: 'white', + borderWidth: 2 + }, { + type: 'bar', + label: 'Closed', + backgroundColor: window.chartColors.green, + data:dataClosed + }] + }; + + + + var canvas = document.getElementById('issueWeekDue'); + var ctx = canvas.getContext('2d'); + + issueByWeekDueBar = new Chart(ctx, { + type: 'bar', + data: chartData, + options: { + maintainAspectRatio: false, + responsive: true, + title: { + display: true, + text: 'Number of Issues Due This Week' + }, + legend: { + display: true, + position:'top' + }, + tooltips: { + mode: 'index', + intersect: true + }, + scales: { + yAxes: [{ + ticks: { + stepSize: 1 + } + }] + } + } + }); + issueByWeekDueBar.update(); + + } + + function destoryAllViews(){ + if(issueByWeekDueBar) + issueByWeekDueBar.destroy(); + if(issueByRootCauseBar) + issueByRootCauseBar.destroy(); + if(issueByRootCauseBar) + issueByRootCauseBar.destroy(); + if(overallStatusPie) + overallStatusPie.destroy(); - if(issueByCompanyBar) - issueByCompanyBar.destroy(); + + if(issueByTypeBar) + + issueByTypeBar.destroy(); + } + function checkIssueStatJob(jobId){ + jQuery.ajax({ + url: '/api/forge/issuereport/checkjob', + contentType: 'application/json', + type: 'GET', + dataType: 'json', + data: { + 'jobId': jobId + }, + success: function (res) { + switch(res.status) + { + case 'working': + setTimeout (function () { checkIssueStatJob (jobId) ; }, 2000) ; + break; + case 'done': + destoryAllViews(); + $('#loader_stats').css({ display: "none" }); + if($('#radioDocIssue_report').is(":checked") ) + { + $.get('/api/forge/issuereport/get_docissue',function(res){ + var docIssues = JSON.parse(res); + refreshIssueOverview(docIssues.overview); + refreshModelvsProjectView(docIssues.modelvsproj); - refreshIssuebyCompany(docIssues.company); + + refreshIssuebyType(docIssues.type); + refreshWeekDue(docIssues.weekdue); + }); + }else{ + $.get('/api/forge/issuereport/get_fieldissue',function(res){ + var fieldIssues = JSON.parse(res); + refreshIssueOverview(fieldIssues.overview); + refreshRootcause(fieldIssues.rootcause); - refreshIssuebyCompany(fieldIssues.company); + + refreshIssuebyType(fieldIssues.Type); + refreshWeekDue(fieldIssues.weekdue); + }); + } + break; + default: + $('#loader_stats').css({ display: "none" }); + + } + }, + error: function (res) { + $('#loader_stats').css({ display: "none" }); + alert('get status job failed!'); + } + }); + } + + function refreshDashboard(projectHref,isRefresh=true){ + + var date_input = new Date($("#oneWeekDueIssueDate").val()); + var weekDueStart = date_input.getFullYear() + +'-' + (date_input.getMonth() +1) + + '-' +date_input.getDate(); + + jQuery.ajax({ + url: '/api/forge/issuereport/startjob', + contentType: 'application/json', + type: 'GET', + dataType: 'json', + data: { + 'projectHref': projectHref, + 'weekDueStart':weekDueStart, + 'isDocIssue':$('#radioDocIssue_report').is(":checked"), + 'isRefresh':isRefresh + }, + success: function (res) { + $('#loader_stats').css({ display: "block" }); + checkIssueStatJob(res.jobId); + }, + error: function (res) { + alert('get issues failed:'); + } + }); + } + + + $(document).ready(function () { + $('#oneWeekDueIssueDate').datepicker('setDate',new Date()); + $('#oneWeekDueIssueDate').datepicker({autoclose: true}); + + $('#oneWeekDueIssueDate').change(function () { + if($('#labelProjectHref').text() == ''){ + alert('please select one project!'); + return; + } + destoryAllViews(); + + var projectHref = $('#labelProjectHref').text(); + if(issueByWeekDueBar){ + //update with existing data only + refreshDashboard(projectHref,false) + }else{ + //refresh all data + refreshDashboard(projectHref,true); + } + }); + + $('#radioFieldIssue_report').click(function () { + $("#radioFieldIssue_report").prop("checked", true); + $("#radioDocIssue_report").prop("checked", false); + + destoryAllViews(); + var projectHref = $('#labelProjectHref').text(); + refreshDashboard(projectHref,false); + }); + $('#radioDocIssue_report').click(function () { + $("#radioDocIssue_report").prop("checked", true); + $("#radioFieldIssue_report").prop("checked", false); + + destoryAllViews(); + var projectHref = $('#labelProjectHref').text(); + refreshDashboard(projectHref,false); + }); + + $('#btnRefresh').click(function () { + + if($('#labelProjectHref').text() == ''){ + alert('please select one project!'); + return; + } + destoryAllViews(); + var projectHref = $('#labelProjectHref').text(); + refreshDashboard(projectHref,true); + }); - - }); + From 2daaf8f32208c881c727281127865ae46622efc2 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Wed, 6 Nov 2019 17:04:38 +0000 Subject: [PATCH 04/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 459 +----------------------------- 1 file changed, 12 insertions(+), 447 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index ff6f419..1c1af36 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -1,7 +1,6 @@ //have to define global handlers of chart、、becausecontext.clearRectdoesnotclear你thelastgraphics - + //sort the nodes of the timeliner according to the sequence of time. - var overallStatusPie = null; var issueByCompanyBar = null; var issueByRootCauseBar = null; @@ -10,878 +9,444 @@ var issueByWeekDueBar = null; function sortOnKeys(dict) { var sorted = []; - for (var key in dict) { - sorted[sorted.length] = key; - } - sorted.sort(); - - var tempDict = {}; - for (var i = 0; i < sorted.length; i++) { - tempDict[sorted[i]] = dict[sorted[i]]; - } - - return tempDict; - } - - var Months = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December' - ]; - - function random_rgba() { - var o = Math.round, r = Math.random, s = 255; - return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + 0.5 + ')'; - } - - function refreshIssueOverview(overview){ - - var labels=[],dataTotals=[];colors=[]; - for(var status in overview){ - labels.push(status); - dataTotals.push(overview[status]); - colors.push(random_rgba()) - } - - var chartData = { - datasets: [{ - data: dataTotals, - backgroundColor: colors - }], - labels: labels - }; - - var config = { - type: 'pie', - data: chartData, - options: { - responsive: true, - maintainAspectRatio: false, - - title: { - display: true, - text: 'Overall Status' - }, - tooltips: { - mode: 'index', - intersect: true - }, - legend: { - display: true - }, - plugins: { - datalabels: { - display: true, - align: 'center', - anchor: 'center' - } - } - } - }; - - - var canvas = document.getElementById('issueOverview'); - var ctx = canvas.getContext('2d'); - - overallStatusPie = new Chart(ctx, config); - overallStatusPie.update(); - - } - - function refreshModelvsProjectView(modelvsproj){ - - var config = { - type: 'doughnut', - data: { - datasets: [{ - data: [ - modelvsproj.model, - modelvsproj.notmodel - ], - backgroundColor: [ - window.chartColors.yellow, - window.chartColors.green - ], - label: 'Dataset 1' - }], - labels: [ - 'Model Issue', - 'Project Issue' - ] - }, - options: { - responsive: true, - maintainAspectRatio: false, - - title: { - display: true, - text: 'Model Issue vs Project Issue' - }, - legend: { - display: true, - position:'bottom' - } - } - }; - - - var canvas = document.getElementById('issueModelvsProj'); - var ctx = canvas.getContext('2d'); - - issueByRootCauseBar = new Chart(ctx, config); - issueByRootCauseBar.update(); - - } - - function refreshRootcause(rootcause){ - - var labels=[],dataTotals=[];colors=[]; - for(var cause in rootcause){ - labels.push(cause); - dataTotals.push(rootcause[cause]); - colors.push(random_rgba()) - } - - var chartData = { - datasets: [{ - data: dataTotals, - backgroundColor: colors - }], - labels: labels - }; - - var config = { - type: 'doughnut', - data: chartData, - options: { - responsive: true, - maintainAspectRatio: false, - - title: { - display: true, - text: 'Root Cause' - }, - tooltips: { - mode: 'index', - intersect: true - }, - legend: { - display: true - }, - plugins: { - datalabels: { - display: true, - align: 'center', - anchor: 'center' - } - } - } - }; - - - - - var canvas = document.getElementById('issueModelvsProj'); - var ctx = canvas.getContext('2d'); - - issueByRootCauseBar = new Chart(ctx, config); - issueByRootCauseBar.update(); - } - - -function refreshIssuebyType(company){ - +function refreshIssuebyCompany(company){ - var labels=[],dataTotals=[];colors=[]; - for(var com in company){ - labels.push(com); - dataTotals.push(company[com].total); - colors.push(random_rgba()) - } - - var chartData = { - datasets: [{ - data: dataTotals, - backgroundColor: colors - }], - labels: labels - }; - - - - var canvas = document.getElementById('issueByType'); - + var canvas = document.getElementById('issueByCompany'); var ctx = canvas.getContext('2d'); - - - issueByTypeBar = new Chart(ctx, { - + issueByCompanyBar = new Chart(ctx, { type: 'horizontalBar', - data: chartData, - options: { - responsive: true, - maintainAspectRatio: true, - title: { - display: true, - - text: 'Open Issue by Type' - + text: 'Open Issue by Company' }, - tooltips: { - mode: 'index', - intersect: true - }, - legend: { - display: false - } - } - }); - - issueByTypeBar.update(); - - + issueByCompanyBar.update(); } - - function refreshWeekDue(weekdue){ - - weekdue = sortOnKeys(weekdue); - - var labels=[],dataTotal=[],dataClosed=[]; - for(var due_date in weekdue){ - labels.push(Months[new Date(Number(due_date)).getMonth()]+' ' + - new Date(Number(due_date)).getDate()); - dataTotal.push(weekdue[due_date].dueissue); - dataClosed.push(weekdue[due_date].isclosed); - } - - var chartData = { - labels: labels, - datasets: [{ - type: 'bar', - label: 'Due', - backgroundColor: window.chartColors.red, - data: dataTotal, - borderColor: 'white', - borderWidth: 2 - }, { - type: 'bar', - label: 'Closed', - backgroundColor: window.chartColors.green, - data:dataClosed - }] - }; - - - - var canvas = document.getElementById('issueWeekDue'); - var ctx = canvas.getContext('2d'); - - issueByWeekDueBar = new Chart(ctx, { - type: 'bar', - data: chartData, - options: { - maintainAspectRatio: false, - responsive: true, - title: { - display: true, - text: 'Number of Issues Due This Week' - }, - legend: { - display: true, - position:'top' - }, - tooltips: { - mode: 'index', - intersect: true - }, - scales: { - yAxes: [{ - ticks: { - stepSize: 1 - } - }] - } - } - }); - issueByWeekDueBar.update(); - - } - - function destoryAllViews(){ - if(issueByWeekDueBar) - issueByWeekDueBar.destroy(); - if(issueByRootCauseBar) - issueByRootCauseBar.destroy(); - if(issueByRootCauseBar) - issueByRootCauseBar.destroy(); - if(overallStatusPie) - overallStatusPie.destroy(); - - if(issueByTypeBar) - - issueByTypeBar.destroy(); - + if(issueByCompanyBar) + issueByCompanyBar.destroy(); } - function checkIssueStatJob(jobId){ - jQuery.ajax({ - url: '/api/forge/issuereport/checkjob', - contentType: 'application/json', - type: 'GET', - dataType: 'json', - data: { - 'jobId': jobId - }, - success: function (res) { - switch(res.status) - { - case 'working': - setTimeout (function () { checkIssueStatJob (jobId) ; }, 2000) ; - break; - case 'done': - destoryAllViews(); - $('#loader_stats').css({ display: "none" }); - if($('#radioDocIssue_report').is(":checked") ) - { - $.get('/api/forge/issuereport/get_docissue',function(res){ - var docIssues = JSON.parse(res); - refreshIssueOverview(docIssues.overview); - refreshModelvsProjectView(docIssues.modelvsproj); - - refreshIssuebyType(docIssues.type); - + refreshIssuebyCompany(docIssues.company); refreshWeekDue(docIssues.weekdue); - }); - }else{ - $.get('/api/forge/issuereport/get_fieldissue',function(res){ - var fieldIssues = JSON.parse(res); - refreshIssueOverview(fieldIssues.overview); - refreshRootcause(fieldIssues.rootcause); - - refreshIssuebyType(fieldIssues.Type); - + refreshIssuebyCompany(fieldIssues.company); refreshWeekDue(fieldIssues.weekdue); - }); - } - break; - default: - $('#loader_stats').css({ display: "none" }); - - } - }, - error: function (res) { - $('#loader_stats').css({ display: "none" }); - alert('get status job failed!'); - } - }); - } - - function refreshDashboard(projectHref,isRefresh=true){ - - var date_input = new Date($("#oneWeekDueIssueDate").val()); - var weekDueStart = date_input.getFullYear() - +'-' + (date_input.getMonth() +1) - + '-' +date_input.getDate(); - - jQuery.ajax({ - url: '/api/forge/issuereport/startjob', - contentType: 'application/json', - type: 'GET', - dataType: 'json', - data: { - 'projectHref': projectHref, - 'weekDueStart':weekDueStart, - 'isDocIssue':$('#radioDocIssue_report').is(":checked"), - 'isRefresh':isRefresh - }, - success: function (res) { - $('#loader_stats').css({ display: "block" }); - checkIssueStatJob(res.jobId); - }, - error: function (res) { - alert('get issues failed:'); - } - }); - } - - - $(document).ready(function () { - $('#oneWeekDueIssueDate').datepicker('setDate',new Date()); - $('#oneWeekDueIssueDate').datepicker({autoclose: true}); - - $('#oneWeekDueIssueDate').change(function () { - if($('#labelProjectHref').text() == ''){ - alert('please select one project!'); - return; - } - destoryAllViews(); - - var projectHref = $('#labelProjectHref').text(); - if(issueByWeekDueBar){ - //update with existing data only - refreshDashboard(projectHref,false) - }else{ - //refresh all data - refreshDashboard(projectHref,true); - } - }); - - $('#radioFieldIssue_report').click(function () { - $("#radioFieldIssue_report").prop("checked", true); - $("#radioDocIssue_report").prop("checked", false); - - destoryAllViews(); - var projectHref = $('#labelProjectHref').text(); - refreshDashboard(projectHref,false); - }); - $('#radioDocIssue_report').click(function () { - $("#radioDocIssue_report").prop("checked", true); - $("#radioFieldIssue_report").prop("checked", false); - - destoryAllViews(); - var projectHref = $('#labelProjectHref').text(); - refreshDashboard(projectHref,false); - }); - - $('#btnRefresh').click(function () { - - if($('#labelProjectHref').text() == ''){ - alert('please select one project!'); - return; - } - destoryAllViews(); - var projectHref = $('#labelProjectHref').text(); - refreshDashboard(projectHref,true); - }); + + }); - - From 30052eb317752488c1662da839aca8b7574323a3 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 10:18:28 +0000 Subject: [PATCH 05/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 1c1af36..9707cfa 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByCompany'); + var canvas = document.getElementById('issueByAssignedTo'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { @@ -225,7 +225,7 @@ function refreshIssuebyCompany(company){ maintainAspectRatio: true, title: { display: true, - text: 'Open Issue by Company' + text: 'Open Issue by Company/AK Change Assigned To' }, tooltips: { mode: 'index', From 1b0cf6c673ae5cbef2d413c6f9ed4a863419af2b Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 10:22:20 +0000 Subject: [PATCH 06/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 9707cfa..6a2b015 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByAssignedTo'); + var canvas = document.getElementById('issueByCompany'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { From be5b049d188933e4eb237aaef34207b8904260e6 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 10:31:46 +0000 Subject: [PATCH 07/31] Update bim.issues.endpoint.report.js --- server/endpoints/bim.issues.endpoint.report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index 098559e..8b0d3b0 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -19,14 +19,14 @@ var field_issue_stats_json = null; function resetStats(){ doc_issue_stats_json = {overview:{}, modelvsproj:{}, - company:{}, + Assigned_to:{}, weekdue:{} }; field_issue_stats_json = {overview:{}, modelvsproj:{}, rootcause:{}, type:{}, - company:{}, + Assignedto:{}, weekdue:{} }; } @@ -225,4 +225,4 @@ function issueByType(type,containerId,issue_stats_json){ issue_stats_json.type[typeStr] = 1; } -module.exports = router \ No newline at end of file +module.exports = router From df4d5028afb6d5a11718de55f05a61c8ae82dd9e Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 10:50:01 +0000 Subject: [PATCH 08/31] Update bim.issues.endpoint.report.js --- server/endpoints/bim.issues.endpoint.report.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index 8b0d3b0..698e15f 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -19,14 +19,14 @@ var field_issue_stats_json = null; function resetStats(){ doc_issue_stats_json = {overview:{}, modelvsproj:{}, - Assigned_to:{}, + Company:{}, weekdue:{} }; field_issue_stats_json = {overview:{}, modelvsproj:{}, rootcause:{}, type:{}, - Assignedto:{}, + Company:{}, weekdue:{} }; } @@ -139,6 +139,11 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, issueWeekDue({due_date:eachIssue.attributes.due_date, isclosed:eachIssue.attributes.status=='closed'}, weekDueStart,issue_stats_json); + + issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); + issueByType(eachIssue.attributes.issue_type, + containerId,issue_stats_json); + } if(!isDocIssue) { @@ -147,6 +152,7 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, containerId,issue_stats_json); } + }); } From 81ebae49608d2068e427813b44c5f2e9055329c1 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 10:51:31 +0000 Subject: [PATCH 09/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 6a2b015..bc3196c 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByCompany'); + var canvas = document.getElementById('issueByType'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { From 18c939fab61ccd3503bd5a14c1cc612691db11e1 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 10:59:54 +0000 Subject: [PATCH 10/31] Update bim.issues.endpoint.report.js --- server/endpoints/bim.issues.endpoint.report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index 698e15f..e128bbc 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -140,8 +140,8 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, isclosed:eachIssue.attributes.status=='closed'}, weekDueStart,issue_stats_json); - issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); - issueByType(eachIssue.attributes.issue_type, + issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); + issueByType(eachIssue.attributes.issue_type, containerId,issue_stats_json); } From 2a4081535382eadc2454d6f5d84e86e2c64013f9 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 11:01:18 +0000 Subject: [PATCH 11/31] Update bim.issues.endpoint.report.js --- server/endpoints/bim.issues.endpoint.report.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index e128bbc..8ca7ed1 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -139,11 +139,7 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, issueWeekDue({due_date:eachIssue.attributes.due_date, isclosed:eachIssue.attributes.status=='closed'}, weekDueStart,issue_stats_json); - - issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); - issueByType(eachIssue.attributes.issue_type, - containerId,issue_stats_json); - } + if(!isDocIssue) { From 922f37f6dfd450b6edc8fb30f249caa610d065aa Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 11:03:39 +0000 Subject: [PATCH 12/31] Update bim.issues.endpoint.report.js --- server/endpoints/bim.issues.endpoint.report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index 8ca7ed1..0a99d67 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -141,8 +141,8 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, weekDueStart,issue_stats_json); - if(!isDocIssue) - { +# if(!isDocIssue) + # { issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); issueByType(eachIssue.attributes.issue_type, containerId,issue_stats_json); From fa6534aa9d90e443ec82b7d84a7f88a8435fd4a6 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 11:05:20 +0000 Subject: [PATCH 13/31] Update bim.issues.endpoint.report.js --- server/endpoints/bim.issues.endpoint.report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index 0a99d67..1bfd54c 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -141,8 +141,8 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, weekDueStart,issue_stats_json); -# if(!isDocIssue) - # { + if(!isDocIssue) + { issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); issueByType(eachIssue.attributes.issue_type, containerId,issue_stats_json); From 13e3208b9549e8b6f2313e599578344a6b2120be Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:41:41 +0000 Subject: [PATCH 14/31] Add files via upload --- server/bim.database.js | 22 +++++ server/config.js | 201 +++++++++++++++++++++-------------------- server/utility.js | 66 ++++++++++---- 3 files changed, 173 insertions(+), 116 deletions(-) diff --git a/server/bim.database.js b/server/bim.database.js index a96f06a..54a0bfb 100755 --- a/server/bim.database.js +++ b/server/bim.database.js @@ -44,6 +44,8 @@ module.exports = { bimDatabase[hubId].projects[projectId].photoFolderId = null; bimDatabase[hubId].projects[projectId].fieldRootcauses = null; bimDatabase[hubId].projects[projectId].fieldIssueTypes = null; + bimDatabase[hubId].projects[projectId].companies = null; + bimDatabase[hubId].projects[projectId].roles = null; } }, refreshProjectInfo:function(hubId,projectId,v){ @@ -68,6 +70,10 @@ module.exports = { bimDatabase[hubId].projects[projectId].fieldIssueTypes = v.fieldIssueTypes; if(v.projectName) bimDatabase[hubId].projects[projectId].projectName = v.projectName; + if(v.companies) + bimDatabase[hubId].projects[projectId].companies = v.companies; + if(v.roles) + bimDatabase[hubId].projects[projectId].roles = v.roles; } }, getProjectRootContents:function(hubId,projectId){ @@ -126,6 +132,22 @@ module.exports = { } } }, + getCompaniesByContainer:function(containerId){ + for(var hubId in bimDatabase){ + for(var projectId in bimDatabase[hubId].projects){ + if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId) + return bimDatabase[hubId].projects[projectId].companies; + } + } + }, + getRolesByContainer:function(containerId){ + for(var hubId in bimDatabase){ + for(var projectId in bimDatabase[hubId].projects){ + if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId) + return bimDatabase[hubId].projects[projectId].roles; + } + } + }, refreshDumpIssue:function(containerId,_json,isDoc){ if(containerId in bimDatabase) isDoc?bimDatabase[containerId].doc_all_issue_json = _json: diff --git a/server/config.js b/server/config.js index 600ea01..7304bb1 100755 --- a/server/config.js +++ b/server/config.js @@ -16,15 +16,15 @@ // UNINTERRUPTED OR ERROR FREE. ///////////////////////////////////////////////////////////////////// -'use strict'; +'use strict'; module.exports = { // this this callback URL when creating your client ID and secret //set enviroment variables or hard-code here - callbackURL: process.env.FORGE_CALLBACK_URL || - '/api/forge/callback/oauth', + callbackURL: process.env.FORGE_CALLBACK_URL || + '/api/forge/callback/oauth', // set enviroment variables or hard-code here //apply your Forge client credential @@ -34,131 +34,136 @@ module.exports = { client_secret: process.env.FORGE_CLIENT_SECRET || '' }, - //input your website url such as //http://mywebsite.com/webhook/itemAdded - webhookCallBackURL: process.env.FORGE_WEBHOOK_URL + '/webhook/itemAdded' || - '/webhook/itemAdded', + webhookCallBackURL: process.env.FORGE_WEBHOOK_URL + '/webhook/itemAdded' || + '/webhook/itemAdded', //input your own link for posting message to your own Slack channel //check the Slack help: //https://api.slack.com/tutorials/slack-apps-hello-world - slackPostMessageURL:process.env.SLACK_POST_MESSAGE_URL || '', + slackPostMessageURL: process.env.SLACK_POST_MESSAGE_URL || '', scope: { // scope for user 3-legged token scopeUserServer: ['data:read', 'data:write', 'data:create'], //scope for account Project ,Design Automation,2-legged token scopeAdmin: ['data:read', - 'data:write', - 'data:create', - 'data:search', - 'account:read', - 'code:all'], + 'data:write', + 'data:create', + 'data:search', + 'account:read', + 'code:all'], //scope for load forge viewer only, 3-legged token scopeUserClient: ['viewables:read'] }, //some endpoints have not been packaged with Forge SDK //most endpoints of Issue API use the same kind of header - + //some endpoints have not been packaged with Forge SDK //most endpoints of Issue API use the same kind of header - - hqv1: { - userprofile_useratme: 'https://developer.api.autodesk.com/userprofile/v1/users/@me' + + hqv1: { + userprofile_useratme: 'https://developer.api.autodesk.com/userprofile/v1/users/@me', + getCompanies: function (account_id, project_id) { + return 'https://developer.api.autodesk.com/hq/v1/accounts/' + account_id + '/projects/' + project_id + '/companies' }, - //Issue API v1 - fieldissuev1: { - - basedUrl: 'https://developer.api.autodesk.com/issues/v1/containers/', - httpHeaders: function (access_token) { - return { - Authorization: 'Bearer ' + access_token, - 'Content-Type': 'application/vnd.api+json' - } - }, - getIssues: function (containerId, filter = '') { - return this.basedUrl + containerId + '/quality-issues' + filter; - }, - getComments: function (containerId, issueId) { - return this.basedUrl + containerId + '/quality-issues/' + issueId + '/comments'; - }, - getAttachments: function (containerId, issueId) { - return this.basedUrl + containerId + '/quality-issues/' + issueId + '/attachments' - }, - getOneIssue: function (containerId, issueId) { - return this.basedUrl + containerId + '/quality-issues/' + issueId; - }, - createComments: function(containerId) { - return this.basedUrl + containerId + '/comments'; - }, - createAttachments: function (containerId) { - return this.basedUrl + containerId + '/attachments';; - }, - getFieldIssueType:function(containerId){ - return this.basedUrl + containerId + '/issue-types';; - }, - getFieldRootCause:function(containerId){ - return this.basedUrl + containerId + '/root-causes';; + getRoles: function (account_id, project_id) { + return 'https://developer.api.autodesk.com/hq/v2/accounts/' + account_id + '/projects/' + project_id + '/industry_roles' + } + }, + //Issue API v1 + fieldissuev1: { + + basedUrl: 'https://developer.api.autodesk.com/issues/v1/containers/', + httpHeaders: function (access_token) { + return { + Authorization: 'Bearer ' + access_token, + 'Content-Type': 'application/vnd.api+json' } }, - - //when v2 is released, will replace with those new endpoints. - fieldissuev2: { - // + getIssues: function (containerId, filter = '') { + return this.basedUrl + containerId + '/quality-issues' + filter; + }, + getComments: function (containerId, issueId) { + return this.basedUrl + containerId + '/quality-issues/' + issueId + '/comments'; }, + getAttachments: function (containerId, issueId) { + return this.basedUrl + containerId + '/quality-issues/' + issueId + '/attachments' + }, + getOneIssue: function (containerId, issueId) { + return this.basedUrl + containerId + '/quality-issues/' + issueId; + }, + createComments: function (containerId) { + return this.basedUrl + containerId + '/comments'; + }, + createAttachments: function (containerId) { + return this.basedUrl + containerId + '/attachments';; + }, + getFieldIssueType: function (containerId) { + return this.basedUrl + containerId + '/ng-issue-types?include=subtypes' + }, + getFieldRootCause: function (containerId) { + return this.basedUrl + containerId + '/root-causes';; + } + }, - //Design Automation V2 - dav2:{ - - createWorkItem:function(){ - return 'https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems' - } + //when v2 is released, will replace with those new endpoints. + fieldissuev2: { + // + }, + + //Design Automation V2 + dav2: { + + createWorkItem: function () { + return 'https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems' + } + }, + //Design Automation V3 + dav3: { + + createWorkItem: function () { + return 'https://developer.api.autodesk.com/da/us-east/v3/workitems' }, - //Design Automation V3 - dav3:{ - - createWorkItem:function(){ - return 'https://developer.api.autodesk.com/da/us-east/v3/workitems' - }, - getWorkItemStatus:function(id){ - return 'https://developer.api.autodesk.com/da/us-east/v3/workitems/'+id - }, - dwgToPDFActName:'' + getWorkItemStatus: function (id) { + return 'https://developer.api.autodesk.com/da/us-east/v3/workitems/' + id }, - webhook:{ - httpHeaders: function (access_token) { - return { - Authorization: 'Bearer ' + access_token, - 'Content-Type': 'application/json' - } - }, - getWebhook:function(system,event){ - return 'https://developer.api.autodesk.com/webhooks/v1/systems/'+ + dwgToPDFActName: '' + }, + webhook: { + httpHeaders: function (access_token) { + return { + Authorization: 'Bearer ' + access_token, + 'Content-Type': 'application/json' + } + }, + getWebhook: function (system, event) { + return 'https://developer.api.autodesk.com/webhooks/v1/systems/' + system + - '/events/'+ - event+ - '/hooks'; - }, - createWebhook:function(system,event){ - return 'https://developer.api.autodesk.com/webhooks/v1/systems/'+ + '/events/' + + event + + '/hooks'; + }, + createWebhook: function (system, event) { + return 'https://developer.api.autodesk.com/webhooks/v1/systems/' + system + - '/events/'+ - event+ - '/hooks'; - }, - patchWebhook:function(system,event,hookId){ - return 'https://developer.api.autodesk.com/webhooks/v1/systems/'+ + '/events/' + + event + + '/hooks'; + }, + patchWebhook: function (system, event, hookId) { + return 'https://developer.api.autodesk.com/webhooks/v1/systems/' + system + - '/events/'+ - event+ - '/hooks/'+ - hookId; - }, - deleteWebHook:function(){ + '/events/' + + event + + '/hooks/' + + hookId; + }, + deleteWebHook: function () { - } } - + } + }; diff --git a/server/utility.js b/server/utility.js index ba4a613..24c1c0e 100755 --- a/server/utility.js +++ b/server/utility.js @@ -22,17 +22,7 @@ var fs = require('fs'); var path = require('path'); var bimDatabase = require('./bim.database'); - -//currently, BIM 360 Issue API does not have endpoint to tell the -//enum of Role. Hard-code a few of them -const docIssueRoleEnum = { - '7462015': 'IT', - '7462022': 'Designer', - '7462019':'Engineer' , - '7462020':'Project Engineer', - '7462012':'Project Manager', - '7462016':'Skeduler' -} + var dir = __dirname + '/downloads'; if (!fs.existsSync(dir)) { @@ -67,7 +57,7 @@ module.exports = { .replace(/\//g, '0'); // replace '/' with '0' }, - checkAssignTo:function(hubId, + checkAssignTo:function(hubId,containerId, assigned_to_type, assigned_to){ switch(assigned_to_type){ @@ -75,10 +65,10 @@ module.exports = { return this.findUserName(hubId,assigned_to) break; case 'role': - return parseInt(assigned_to)!=NaN?docIssueRoleEnum[assigned_to]:assigned_to + return this.findRoleById(containerId,assigned_to) break; case 'company': - return '' + return this.findCompanyById(containerId,assigned_to) break; } }, @@ -116,20 +106,60 @@ module.exports = { return '' }, - findIssueType:function(containerId,typeKey) { + findIssueType:function(containerId,id) { var fieldIssueTypes = bimDatabase.getIssueTypesByContainer(containerId); if(fieldIssueTypes){ - var foundtype = fieldIssueTypes.filter(function(item){ return item.attributes.key === typeKey; }) + var foundtype = fieldIssueTypes.filter(function(item){ return item.id === id; }) if(foundtype && foundtype.length && foundtype.length > 0) - return foundtype[0].attributes.title; + return foundtype[0].title; else return '' } else return '' }, - + + findSubIssueType:function(containerId,id) { + var fieldIssueTypes = bimDatabase.getIssueTypesByContainer(containerId); + var subtypeStr = '' + + if(fieldIssueTypes){ + for(var index in fieldIssueTypes){ + var oneTypeColl = fieldIssueTypes[index] + var foundtype = oneTypeColl.subtypes.filter(function(item){ return item.id === id; }) + if(foundtype && foundtype.length && foundtype.length > 0){ + subtypeStr = foundtype[0].title + break + } + } + } + return subtypeStr + }, + findCompanyById:function(containerId,id) { + var companies = bimDatabase.getCompaniesByContainer(containerId); + if(companies){ + var foundtype = companies.filter(function(item){ return item.id === id; }) + if(foundtype && foundtype.length && foundtype.length > 0) + return foundtype[0].name; + else + return '' + } + else + return '' + }, + findRoleById:function(containerId,member_group_id) { + var roles = bimDatabase.getRolesByContainer(containerId); + if(roles){ + var foundtype = roles.filter(function(item){ return item.member_group_id === member_group_id; }) + if(foundtype && foundtype.length && foundtype.length > 0) + return foundtype[0].name; + else + return '' + } + else + return '' + }, prepareItemForTree:function(_id, _text, _type, _children, _fileType, _fileName) { return { id: _id, From f7cb0482c850d35d769a225c24c0b2297d478f33 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:42:19 +0000 Subject: [PATCH 15/31] Add files via upload --- server/services/dm.hubs.services.js | 67 ++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/server/services/dm.hubs.services.js b/server/services/dm.hubs.services.js index 4b2df92..8de7c74 100755 --- a/server/services/dm.hubs.services.js +++ b/server/services/dm.hubs.services.js @@ -125,13 +125,78 @@ function getHQUsersList(input,allUsers,pageOffset){ }); } + +function getProjectCompanies(input){ + + return new Promise(function(resolve,reject){ + + var accountId = input.hubId.replace('b.','') + var projectId = input.projectId.replace('b.','') + + request({ + url: config.hqv1.getCompanies(accountId,projectId), + method: "GET", + headers: { + 'Authorization': 'Bearer ' + input.adminToken.credentials.access_token + } + }, function (error, response, body) { + + if (error != null) { + console.log('get companies failed!'); + reject({error:error}); + + }else if(body.errors != null){ + reject({error:body.errors}); + } + else{ + console.log('get companies succeeded!'); + var json = JSON.parse(body); + resolve({companies:json}); + } + }) + }) +} + + +function getProjectRoles(input){ + + return new Promise(function(resolve,reject){ + + var accountId = input.hubId.replace('b.','') + var projectId = input.projectId.replace('b.','') + + request({ + url: config.hqv1.getRoles(accountId,projectId), + method: "GET", + headers: { + 'Authorization': 'Bearer ' + input.credentials.access_token + } + }, function (error, response, body) { + + if (error != null) { + console.log('get roles failed!'); + reject({error:error}); + + }else if(body.errors != null){ + reject({error:body.errors}); + } + else{ + console.log('get roles succeeded!'); + var json = JSON.parse(body); + resolve({roles:json}); + } + }) + }) +} module.exports = { getHubs:getHubs, getUserProfile:getUserProfile, - getHQUsersList:getHQUsersList + getHQUsersList:getHQUsersList, + getProjectCompanies:getProjectCompanies, + getProjectRoles:getProjectRoles } From 871257fed083914fac4c9fdaad27de4a531217ab Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:42:52 +0000 Subject: [PATCH 16/31] Add files via upload --- server/endpoints/bim.issues.endpoint.csv.js | 5 ++++- .../endpoints/bim.issues.endpoint.report.js | 19 ++++++++++++------- server/endpoints/dm.endpoints.js | 18 +++++++++++++++--- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/server/endpoints/bim.issues.endpoint.csv.js b/server/endpoints/bim.issues.endpoint.csv.js index 22af7d8..9d59d4a 100755 --- a/server/endpoints/bim.issues.endpoint.csv.js +++ b/server/endpoints/bim.issues.endpoint.csv.js @@ -146,6 +146,7 @@ router.get('/issuecsv/startjob',jsonParser, function (req, res) { if(!input.isDocIssue){ header.push({id: 'rootcause', title: 'Root Cause'}) header.push({id: 'issuetype', title: 'Issue Type'}), + header.push({id: 'subissuetype', title: 'Sub Issue Type'}), header.push({id: 'associateChecklist', title: 'Associated to checklist?'}) //check custom fields if(input.withCustomFields && input.allIssues[0].attributes.custom_attributes){ @@ -167,6 +168,7 @@ router.get('/issuecsv/startjob',jsonParser, function (req, res) { location:eachIssue.attributes.location_description, status:eachIssue.attributes.status, assigned_to: utility.checkAssignTo(input.hubId, + input.containerId, eachIssue.attributes.assigned_to_type, eachIssue.attributes.assigned_to), assignee_type:eachIssue.attributes.assigned_to_type, @@ -188,7 +190,8 @@ router.get('/issuecsv/startjob',jsonParser, function (req, res) { if(!input.isDocIssue){ thisRecord.rootcause = eachIssue.attributes.root_cause; - thisRecord.issuetype = utility.findIssueType(input.containerId,eachIssue.attributes.issue_type); + thisRecord.issuetype = utility.findIssueType(input.containerId,eachIssue.attributes.ng_issue_type_id); + thisRecord.subissuetype = utility.findSubIssueType(input.containerId,eachIssue.attributes.ng_issue_subtype_id); thisRecord.associateChecklist = 'NO'; if(input.withCustomFields && eachIssue.attributes.custom_attributes){ var customFields = eachIssue.attributes.custom_attributes; diff --git a/server/endpoints/bim.issues.endpoint.report.js b/server/endpoints/bim.issues.endpoint.report.js index 1bfd54c..d0ecc2e 100755 --- a/server/endpoints/bim.issues.endpoint.report.js +++ b/server/endpoints/bim.issues.endpoint.report.js @@ -19,14 +19,14 @@ var field_issue_stats_json = null; function resetStats(){ doc_issue_stats_json = {overview:{}, modelvsproj:{}, - Company:{}, + company:{}, weekdue:{} }; field_issue_stats_json = {overview:{}, modelvsproj:{}, rootcause:{}, type:{}, - Company:{}, + company:{}, weekdue:{} }; } @@ -139,16 +139,16 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId, issueWeekDue({due_date:eachIssue.attributes.due_date, isclosed:eachIssue.attributes.status=='closed'}, weekDueStart,issue_stats_json); - - if(!isDocIssue) + if(!isDocIssue) { issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json); - issueByType(eachIssue.attributes.issue_type, + issueByType(eachIssue.attributes.ng_issue_type_id, containerId,issue_stats_json); + issueBySubType(eachIssue.attributes.ng_issue_subtype_id, + containerId,issue_stats_json); } - }); } @@ -227,4 +227,9 @@ function issueByType(type,containerId,issue_stats_json){ issue_stats_json.type[typeStr] = 1; } -module.exports = router +function issueBySubType(type,containerId,issue_stats_json){ + var typeStr = utility.findSubIssueType(containerId,type) + //TODO +} + +module.exports = router \ No newline at end of file diff --git a/server/endpoints/dm.endpoints.js b/server/endpoints/dm.endpoints.js index 9b4da56..0e10fc1 100755 --- a/server/endpoints/dm.endpoints.js +++ b/server/endpoints/dm.endpoints.js @@ -201,6 +201,17 @@ function getAllProjectContent(projects,userServerToken) { bimDatabase.refreshProjectInfo(hubId,projectId, {rootFolderContents:result.contents}) + return hubsServices.getProjectCompanies(subInput); + }) + .then(function (result) { + console.log('refreshing companies of one project') + bimDatabase.refreshProjectInfo(hubId,projectId,{companies:result.companies }) + return hubsServices.getProjectRoles(subInput); + }) + .then(function (result) { + console.log('refreshing roles of one project') + bimDatabase.refreshProjectInfo(hubId,projectId,{roles:result.roles }) + subInput.oAuth = subInput.userServerToken.oAuth; subInput.credentials = subInput.userServerToken.credentials; return bimIssuesServicesRead.getFieldIssueTypes(subInput); @@ -213,9 +224,10 @@ function getAllProjectContent(projects,userServerToken) { }) .then(function (result) { console.log('refreshing field root causes of one project') - bimDatabase.refreshProjectInfo(hubId,projectId,{fieldIssueTypes:result.fieldRootcauses }) - console.log('one project dump succeeded!'); - }) + bimDatabase.refreshProjectInfo(hubId,projectId,{fieldRootcauses:result.fieldRootcauses }) + console.log('one project dump succeeded!'); + + }) .catch(function (error) { console.log('one project dump failed!'); }); From f2e7feb4ef3466a8e786e15834d8e6bfc16f4c39 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:45:12 +0000 Subject: [PATCH 17/31] Add files via upload --- www/js/forge.bim.issues.basic.js | 511 +++++++++++++++++++----------- www/js/forge.bim.issues.report.js | 5 +- 2 files changed, 332 insertions(+), 184 deletions(-) diff --git a/www/js/forge.bim.issues.basic.js b/www/js/forge.bim.issues.basic.js index a901bf5..f1f776e 100755 --- a/www/js/forge.bim.issues.basic.js +++ b/www/js/forge.bim.issues.basic.js @@ -1,202 +1,349 @@ -const global_oAuth = new oAuth() -const global_dmProjects = new DMProjects() -const global_msSet = new MSSet() -const global_clashRawView= new ClashRawView() -const global_clashBreakdownView= new ClashBreakdownView() -const global_clashMatrixView= new ClashMatrixView() -const global_ClashPDF = new ClashPDF() -const global_forgeViewer= new ForgeViewer() -const global_navHelp= new NavHelp() -const global_Utility = new Utility() +///////////////////////////////////////////////////////////////////// +// Copyright (c) Autodesk, Inc. All rights reserved +// Written by Forge Partner Development +// +// Permission to use, copy, modify, and distribute this software in +// object code form for any purpose and without fee is hereby granted, +// provided that the above copyright notice appears in all copies and +// that both that copyright notice and the limited warranty and +// restricted rights notice below appear in all supporting +// documentation. +// +// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. +// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF +// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. +// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE +// UNINTERRUPTED OR ERROR FREE. +///////////////////////////////////////////////////////////////////// + -$(document).ready(function () { +function prepareBIMIssuesTree(projetId) { + var thisIssueTree = $('#issuetree').jstree(true); + if(thisIssueTree) { thisIssueTree.destroy(); } - - $('#iconlogin').click(global_oAuth.forgeSignIn); + $('#issuetree').jstree({ + 'core': { + 'themes': {"icons": true}, + 'data': { + "url": '/api/forge/issuebasic/getTreeNode', + "dataType": "json", + "multiple": false, + "cache": false, + "data": function (node) { + $('#issuetree').jstree(true).toggle_node(node); + if(node.id == '#') + { + var date_input = new Date($("#issuedate").val()); + var one_day_late = date_input; + due_date = date_input.getFullYear() + +'-' + (date_input.getMonth() +1) + + '-' +date_input.getDate(); - var currentToken = global_oAuth.getForgeToken(); + + one_day_late.setDate(date_input.getDate() + 1); + one_day_late = one_day_late.getFullYear() + +'-' + (one_day_late.getMonth() +1) + + '-' +one_day_late.getDate(); + return {"id": node.id, + "projectId":projetId, + "filter":{one_day_late:one_day_late, + due_date:due_date}}; + } + else + return {"id": node.id,"type":node.type,"data":node.data}; - if (currentToken === '') - $('#signInButton').click(global_oAuth.forgeSignIn); - else { - (async()=>{ - let profile = await global_oAuth.getForgeUserProfile() - - $('#signInProfileImage').removeClass(); - $('#signInProfileImage').html('') - $('#signInButtonText').text(profile.name); - $('#signInButtonText').attr('title', 'Click to Sign Out'); - $('#signInButton').click(global_oAuth.forgeLogoff); - - let r = await global_dmProjects.refreshBIMHubs() - if(!r) - return + }, + "success": function (node) { + } + } + }, + 'types': { + 'default': { + 'icon': 'glyphicon glyphicon-question-sign' + }, + '#': { + 'icon': 'glyphicon glyphicon-user' + }, + 'comments': { + 'icon': 'glyphicon glyphicon-comment' + }, + 'attachments': { + 'icon': 'glyphicon glyphicon-save-file' + }, + 'attributes': { + 'icon': 'glyphicon glyphicon-option-horizontal' + }, + 'quality_issues': { + 'icon': 'glyphicon glyphicon-check' + }, + 'commentscoll': { + 'icon': 'glyphicon glyphicon-align-justify' + }, + 'attachmentscoll': { + 'icon': 'glyphicon glyphicon-download' + }, + 'attributescoll': { + 'icon': 'glyphicon glyphicon-list' + }, + 'commentsdata': { + 'icon': 'glyphicon glyphicon-option-horizontal' + }, + 'pushpin': { + 'icon': 'glyphicon glyphicon-eye-open' + }, + 'pushpindata': { + 'icon': 'glyphicon glyphicon-option-horizontal' + } + }, + "plugins": + ["types", "state", "sort"] + }).bind("activate_node.jstree", function (evt, data) { + + $('#labelIssueHref').text(''); + $('#labelPushpinParam').text(''); + + if(data != null && data.node != null && data.node.type == 'issues'){ + //issue + $('#labelIssueHref').text(data.node.id); + } + //pushpin + else if (data != null && data.node != null && data.node.type == 'pushpin') { - //delegate the event when one hub is selected - delegateHubSelection() - //delegate the event when one project is selected - delegateProjectSelection() - //delegate the event when one modelset is selected - delegateModelsetSelection() - //delegate the event when one table item is selected - delegateBreakdownModelChange() - //delegate the event when search items within breakdown list - delegateBreakdownSearch() - //delegate event when refresh MC icon is clicked - delegateRefreshMC() - //delegate event when refresh Clash icon is clicked - delegateRefreshClash() - // - delegateExportPDF() - })() - } - //initialize the helps - global_navHelp.init() - -}); - -function delegateHubSelection(){ - $(document).on('click', '#hubs_list a', function(e) { - $('#hub_dropdown_title').html($(this).html()); - const hub_id_without_b = $(this).attr('id') - const hub_id_with_b = 'b.' + hub_id_without_b - global_dmProjects.refreshProjects(hub_id_with_b) - $('#hubs_list .active').removeClass('active'); - $(this).toggleClass('active') + var nodeData = data.node.data; + + var pushpin_svg = { + object_id:nodeData.attributes.pushpin_attributes.object_id, + location:nodeData.attributes.pushpin_attributes.location, + viewerState:nodeData.attributes.pushpin_attributes.viewer_state, + title: nodeData.attributes.title, + id:nodeData.id, + type:nodeData.type, + status:nodeData.attributes.status + } + $('#labelPushpinParam').text(JSON.stringify(pushpin_svg)); + + launchViewer(nodeData.attributes.pushpin_attributes.viewer_state.seedURN); + } + else if (data != null && data.node != null && data.node.type == 'attachments') { + //attachment + window.location = '/issuebasic/getAttachment?url='+data.node.id +'&name='+data.node.text; + } + else{ + + } }); } + -function delegateProjectSelection(){ - $(document).on('click', '#projects_list a', function(e) { - $('#project_dropdown_title').html($(this).html()); - const proj_id_without_b = $(this).attr('id') - global_msSet.refreshModelSets(proj_id_without_b) +function createNewIssue(){ - $('#projects_list .active').removeClass('active'); - $(this).toggleClass('active') - }); -} + if($('#labelProjectHref').text() == ''){ + alert('please select one project!'); + return; + } -function delegateModelsetSelection(){ - $(document).on('click', '#modelsetList .list-group-item', function(e) { - $('#modelsetList .active').removeClass('active') - $(this).toggleClass('active') - - const mc_containter_id = $('#projects_list .active').attr('id') - const ms_id = $(this).attr("id"); - const ms_v_id = $(this).find("span")[0].innerHTML.replace('v-',''); - - (async(mc_containter_id,ms_id,ms_v_id)=>{ - - $('#clashviewSpinner').css({ display: "block" }) - $('#forgeSpinner').css({ display: "block" }) - - //refresh clash data - let r = await global_msSet.refreshOneModelset(mc_containter_id,ms_id,ms_v_id) - if(r) - r = await global_clashRawView.getRawData(mc_containter_id,ms_id,ms_v_id) - if(r) - r = await global_clashMatrixView.produceClashMatrixTable(mc_containter_id,ms_id,ms_v_id) - if(r) - r = await global_clashBreakdownView.initBreakdownList(mc_containter_id,ms_id,ms_v_id) - if(r) - global_forgeViewer.launchViewer(global_msSet._docsMap) - - $('#clashviewSpinner').css({ display: "none" }) - $('#forgeSpinner').css({ display: "none" }) + if($('#newIssueTitle').val() == ''){ + alert('please input issue title!'); + return; + } + + var date_input = new Date($("#newIssueDueDate").val()); + var due_date = date_input.getFullYear() + +'-' + (date_input.getMonth() +1) + + '-' +date_input.getDate(); + - })(mc_containter_id,ms_id,ms_v_id) - }) + jQuery.ajax({ + url: '/api/forge/issuebasic/createIssues', + contentType: 'application/json', + type: 'POST', + dataType: 'json', + data: JSON.stringify({ + 'title': $('#newIssueTitle').val(), + 'desc': 'a test to create issue from app', + 'status': 'open', + 'assigned_to': '7462015', + "assigned_to_type": "role", + "due_date":due_date, + "project_href": $('#labelProjectHref').text() + }), + success: function (res) { + $('#issuetree').jstree(true).refresh(); + }, + error: function (res) { + $('#issuetree').jstree(true).refresh(); + } + }); } -function delegateBreakdownModelChange(){ - $(document).on('click', '#models_list .dropdown-item', function(e) { - const docName = $(this).html() - $('#models_dropdown_title').html(docName); - global_clashBreakdownView.produceBreakdownView(docName) - }) +function createNewComments(){ + + if($('#issuetree').jstree("get_selected", true)== null || + $('#issuetree').jstree("get_selected", true).length== 0){ + alert('please select one issue!'); + return; + } + if($('#newCommentBody').val() == ''){ + alert('please input comment body!'); + return; + } + + var issue_href = $('#issuetree').jstree("get_selected", true)[0].id; + var href = decodeURIComponent(issue_href); + var params = href.split('/'); + var containerId = params[params.length - 3]; + + var issueId = params[params.length - 1]; + + jQuery.ajax({ + url: '/api/forge/issuebasic/createIssuesComments', + contentType: 'application/json', + type: 'POST', + dataType: 'json', + data: JSON.stringify({ + 'issueId': issueId, + 'body': $('#newCommentBody').val(), + "containerId": containerId + }), + success: function (res) { + $('#issuetree').jstree(true).refresh(); + }, + error: function (res) { + alert('create comments failed!'); + $('#issuetree').jstree(true).refresh(); + } + }); } - -function delegateExportPDF(){ - $(document).on('click', '#btnExportPDF', function(e) { - - const mc_containter_id = $('#projects_list .active').attr('id'); - if(!mc_containter_id) return - const ms_id = $('#modelsetList .active').attr("id"); - if(!ms_id) return - const ms_v_id = $('#modelsetList .active').find("span")[0].innerHTML.replace('v-',''); - if(!ms_v_id) return - - var checked_clashes = []; - $("#breakdownTree").jstree("get_checked",true).forEach(item=>{ - if(item.data && item.data.clashes && item.data.level == 3){ - checked_clashes = checked_clashes.concat(item.data.clashes) - } - }) - if(checked_clashes.length > 30){ - alert('To have better export performance, please select no more than 30 clashes!') - }else{ - (async(mc_containter_id,ms_id,ms_v_id)=>{ - //add spinning - var exportbtn = $('#btnExportPDF') - let i = document.createElement("i") - i.classList.add('spinner-border') - i.classList.add('spinner-border-sm') - exportbtn.append(i) - $('#btnExportPDF').contents().filter(function() { - return this.nodeType == 3 && this.textContent.trim(); - })[0].textContent = 'Exporting...' - exportbtn.prop('disabled', true); - - await global_ClashPDF.exportPDF(mc_containter_id,ms_id,ms_v_id,checked_clashes) - - //remove spinning - exportbtn.prop('disabled', false); - exportbtn.remove(i) - $('#btnExportPDF').contents().filter(function() { - return this.nodeType == 3 && this.textContent.trim(); - })[0].textContent = 'Exporting...' - exportbtn.text('Export PDF') - - })(mc_containter_id,ms_id,ms_v_id) - } - }) -} -function delegateRefreshMC(){ - $(document).on('click', '#btnRefreshMC', function(e) { - const proj_id_without_b = $('#projects_list .active').attr('id'); - if(proj_id_without_b) - global_msSet.refreshModelSets(proj_id_without_b) - }) -} +function attachLocalFile2Issue(){ -function delegateBreakdownSearch(){ - $(document).on('keyup','#search-input',function(e){ - var searchString = $(this).val(); - $('#breakdownTree').jstree('search', searchString); - }) + if($('#issuetree').jstree("get_selected", true)== null || + $('#issuetree').jstree("get_selected", true).length== 0){ + alert('please select one issue!'); + return; + } + + + var attachment_name = $('#photoname').val(); + if(attachment_name == undefined || + attachment_name == ''){ + alert('please select a photo!'); + return; + } + + var issue_href = $('#issuetree').jstree("get_selected", true)[0].id; + var href = decodeURIComponent(issue_href); + var params = href.split('/'); + var containerId = params[params.length - 3]; + + var issueId = params[params.length - 1]; + + + jQuery.ajax({ + url: '/api/forge/issuebasic/createIssueAttachment', + contentType: 'application/json', + type: 'POST', + dataType: 'json', + data: JSON.stringify({ + 'issue_id': issueId, + 'containerId':containerId, + 'attachment_name':attachment_name, + "project_href": $('#labelProjectHref').text() + }), + success: function (res) { + $('#issuetree').jstree(true).refresh(); + }, + error: function (res) { + alert('attach local file to issue failed!'); + $('#issuetree').jstree(true).refresh(); + } + }); } -function delegateRefreshClash(){ - $(document).on('click', '#btnRefreshClash', function(e) { - const mc_containter_id = $('#projects_list .active').attr('id'); - const ms_id = $('#modelsetList .active').attr("id"); - const ms_v_id = $('#modelsetList .active').find("span")[0].innerHTML.replace('v-',''); - //refresh clash data - - (async(mc_containter_id,ms_id,ms_v_id)=>{ - //refresh clash data - let r = await global_msSet.refreshOneModelset(mc_containter_id,ms_id,ms_v_id) - if(r) - r = await global_clashRawView.produceClashRawTable(mc_containter_id,ms_id,ms_v_id,true) - if(r) - global_forgeViewer.launchViewer(global_msSet._docsMap) - - })(mc_containter_id,ms_id,ms_v_id) - - }) - -} +function selectLocalFile(evt){ + var tgt = evt.target || window.event.srcElement, + files = tgt.files; + + // FileReader support + if (FileReader && files && files.length) { + var fr = new FileReader(); + fr.onload = function () { + //display the image in the image box + //document.getElementById('outImage').src = fr.result; + } + fr.readAsDataURL(files[0]); + + //temperorily diable attach image button until the + //image is uploaded to server. + $('#btnAddIssueAttachment').prop('disabled', true); + + uploadPhoto(files[0]); + $('#photoname').val(files[0].name); + } + else { + // Not supported + alert('not supported!'); + } +} + +function uploadPhoto(file){ + + //upload file to storage firstly + var formData = new FormData(); + formData.append('uploads[]', file, file.name); + + + $.ajax({ + url: '/api/forge/issuebasic/uploadphoto', + type: 'POST', + data: formData, + processData: false, + contentType: false, + success: function(data){ + console.log('upload successful!\n' + data); + //now we can attach image + $('#btnAddIssueAttachment').prop('disabled', false); + }, + xhr: function() { + // create an XMLHttpRequest + var xhr = new XMLHttpRequest(); + // listen to the 'progress' event + xhr.upload.addEventListener('progress', function(evt) { + + if (evt.lengthComputable) { + } + + }, false); + return xhr; + } + }); +} + +$(document).ready(function () { + + $('#issuedate').datepicker('setDate',new Date()); + $('#issuedate').datepicker({autoclose: true}); + + $('#issuedate').change(function () { + var thisIssueTree = $('#issuetree').jstree(true); + if(thisIssueTree) + thisIssueTree.refresh(); + }); + $('#btnCreateIssue').click(function(rvt){ + createNewIssue(); + }); + $('#btnAddIssueComment').click(function(rvt){ + createNewComments(); + }); + + $('#btnAddIssueAttachment').click(function(rvt){ + attachLocalFile2Issue(); + }) + + $('#selectlocalphoto').on('change', function(evt){ + selectLocalFile(evt); + }) + +}); \ No newline at end of file diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index bc3196c..741077f 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByType'); + var canvas = document.getElementById('issueByCompany'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { @@ -225,7 +225,7 @@ function refreshIssuebyCompany(company){ maintainAspectRatio: true, title: { display: true, - text: 'Open Issue by Company/AK Change Assigned To' + text: 'Open Issue by Company' }, tooltips: { mode: 'index', @@ -450,3 +450,4 @@ $(document).ready(function () { }); + \ No newline at end of file From e58990f604b37d5f9479a8702b004c8408217f44 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:45:44 +0000 Subject: [PATCH 18/31] Add files via upload --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index bfe609a..5bbb0ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -485,9 +485,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "media-typer": { "version": "0.3.0", diff --git a/package.json b/package.json index 91ce725..64f998c 100755 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "forge-apis": "0.4.1", "formidable": "^1.2.1", "isomorphic-fetch": "^2.2.1", - "lodash": "^4.17.11", + "lodash": ">4.17.13", "moment": "2.19.3", "octicons": "^8.0.0", "popper.js": "^1.14.3", From 6aa572c49dd20731e15b410ccc2b7fc205666985 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:54:33 +0000 Subject: [PATCH 19/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 741077f..723f7fb 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByCompany'); + var canvas = document.getElementById('issueByIssueType'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { @@ -450,4 +450,4 @@ $(document).ready(function () { }); - \ No newline at end of file + From afbc31b037e21920c9c4e477c78558d2f10e70d0 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 16:57:37 +0000 Subject: [PATCH 20/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 723f7fb..de93c11 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,7 +214,7 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issueByIssueType'); + var canvas = document.getElementById('issuetype'); var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { From 50404b2096af969fc9ae41374c52cbdcdf9d003e Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 17:03:34 +0000 Subject: [PATCH 21/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index de93c11..209143a 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -215,7 +215,7 @@ function refreshIssuebyCompany(company){ var canvas = document.getElementById('issuetype'); - var ctx = canvas.getContext('2d'); + #var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { type: 'horizontalBar', From e81f72ec79ba0c4dd08379996a3bdc7c596a2c63 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 17:10:05 +0000 Subject: [PATCH 22/31] Add files via upload --- www/js/forge.bim.issues.report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 209143a..741077f 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -214,8 +214,8 @@ function refreshIssuebyCompany(company){ }; - var canvas = document.getElementById('issuetype'); - #var ctx = canvas.getContext('2d'); + var canvas = document.getElementById('issueByCompany'); + var ctx = canvas.getContext('2d'); issueByCompanyBar = new Chart(ctx, { type: 'horizontalBar', @@ -450,4 +450,4 @@ $(document).ready(function () { }); - + \ No newline at end of file From 5562334d942f539fb05665d44a2d2b80acce314a Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 17:13:04 +0000 Subject: [PATCH 23/31] Update forge.bim.issues.report.js --- www/js/forge.bim.issues.report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index 741077f..b55d128 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -133,7 +133,7 @@ function refreshModelvsProjectView(modelvsproj){ }; - var canvas = document.getElementById('issueModelvsProj'); + var canvas = document.getElementById('issuetype'); var ctx = canvas.getContext('2d'); issueByRootCauseBar = new Chart(ctx, config); @@ -167,7 +167,7 @@ function refreshRootcause(rootcause){ title: { display: true, - text: 'Root Cause' + text: 'Root Cause issue type test ak' }, tooltips: { mode: 'index', @@ -450,4 +450,4 @@ $(document).ready(function () { }); - \ No newline at end of file + From 51d92ff75b0e079afc796e1b315e7432a5c74d71 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Mon, 11 Nov 2019 17:17:10 +0000 Subject: [PATCH 24/31] Update index.html --- www/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/index.html b/www/index.html index c219c4c..55ba3a6 100755 --- a/www/index.html +++ b/www/index.html @@ -178,7 +178,7 @@

Issue Status

- +
From 0610960156ccf45826ad849fa09858400fa6d229 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 10:39:30 +0000 Subject: [PATCH 25/31] Update bim.database.js --- server/bim.database.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/bim.database.js b/server/bim.database.js index 54a0bfb..4f25dbf 100755 --- a/server/bim.database.js +++ b/server/bim.database.js @@ -46,6 +46,7 @@ module.exports = { bimDatabase[hubId].projects[projectId].fieldIssueTypes = null; bimDatabase[hubId].projects[projectId].companies = null; bimDatabase[hubId].projects[projectId].roles = null; + bimDatabase[hubId].projects[projectId].issuetype = null; } }, refreshProjectInfo:function(hubId,projectId,v){ @@ -68,6 +69,8 @@ module.exports = { bimDatabase[hubId].projects[projectId].fieldRootcauses = v.fieldRootcauses; if(v.fieldIssueTypes) bimDatabase[hubId].projects[projectId].fieldIssueTypes = v.fieldIssueTypes; + if(v.issuetype) + bimDatabase[hubId].projects[projectId].IssueType = v.issuetype; if(v.projectName) bimDatabase[hubId].projects[projectId].projectName = v.projectName; if(v.companies) @@ -137,6 +140,14 @@ module.exports = { for(var projectId in bimDatabase[hubId].projects){ if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId) return bimDatabase[hubId].projects[projectId].companies; + } + } + }, + getissuetypeByContainer:function(containerId){ + for(var hubId in bimDatabase){ + for(var projectId in bimDatabase[hubId].projects){ + if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId) + return bimDatabase[hubId].projects[projectId].issuetype; } } }, From 89b701731cee3f07fc948d092e74656087554325 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 10:56:33 +0000 Subject: [PATCH 26/31] Add files via upload --- www/js/forge.bim.issues.report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/forge.bim.issues.report.js b/www/js/forge.bim.issues.report.js index b55d128..741077f 100755 --- a/www/js/forge.bim.issues.report.js +++ b/www/js/forge.bim.issues.report.js @@ -133,7 +133,7 @@ function refreshModelvsProjectView(modelvsproj){ }; - var canvas = document.getElementById('issuetype'); + var canvas = document.getElementById('issueModelvsProj'); var ctx = canvas.getContext('2d'); issueByRootCauseBar = new Chart(ctx, config); @@ -167,7 +167,7 @@ function refreshRootcause(rootcause){ title: { display: true, - text: 'Root Cause issue type test ak' + text: 'Root Cause' }, tooltips: { mode: 'index', @@ -450,4 +450,4 @@ $(document).ready(function () { }); - + \ No newline at end of file From fb429e6c51468dab8dcb9b614603a1dc07e15dfe Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 11:04:03 +0000 Subject: [PATCH 27/31] Add files via upload --- server/bim.database.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/server/bim.database.js b/server/bim.database.js index 4f25dbf..54a0bfb 100755 --- a/server/bim.database.js +++ b/server/bim.database.js @@ -46,7 +46,6 @@ module.exports = { bimDatabase[hubId].projects[projectId].fieldIssueTypes = null; bimDatabase[hubId].projects[projectId].companies = null; bimDatabase[hubId].projects[projectId].roles = null; - bimDatabase[hubId].projects[projectId].issuetype = null; } }, refreshProjectInfo:function(hubId,projectId,v){ @@ -69,8 +68,6 @@ module.exports = { bimDatabase[hubId].projects[projectId].fieldRootcauses = v.fieldRootcauses; if(v.fieldIssueTypes) bimDatabase[hubId].projects[projectId].fieldIssueTypes = v.fieldIssueTypes; - if(v.issuetype) - bimDatabase[hubId].projects[projectId].IssueType = v.issuetype; if(v.projectName) bimDatabase[hubId].projects[projectId].projectName = v.projectName; if(v.companies) @@ -140,14 +137,6 @@ module.exports = { for(var projectId in bimDatabase[hubId].projects){ if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId) return bimDatabase[hubId].projects[projectId].companies; - } - } - }, - getissuetypeByContainer:function(containerId){ - for(var hubId in bimDatabase){ - for(var projectId in bimDatabase[hubId].projects){ - if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId) - return bimDatabase[hubId].projects[projectId].issuetype; } } }, From ce647d445d1684ed0c148c72cfaa8cbf62c7b341 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 11:04:40 +0000 Subject: [PATCH 28/31] Add files via upload From 8f05a3cbdcc5ec7f22b1f189ce02ebe2e06745bb Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 11:05:25 +0000 Subject: [PATCH 29/31] Add files via upload From 6a13b2c7e8e1c0180f964ee91f164962c6b8ad4d Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 11:08:49 +0000 Subject: [PATCH 30/31] Add files via upload From 57dee55fcaa87dea04d9804af6bc458f9dbfa8f5 Mon Sep 17 00:00:00 2001 From: Agkdesign Date: Tue, 12 Nov 2019 11:10:50 +0000 Subject: [PATCH 31/31] Add files via upload