From 80818318abd3567e98e92febbabf886d757479ed Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 27 Jan 2020 13:17:21 +0100 Subject: [PATCH] Added full active issue chart. --- .classpath | 1 + .../pages/CreatedClosedDiffChartView.java | 33 ++++--------------- .../agirstatool/core/pages/ProjectPage.java | 1 + .../agirstatool/core/pages/project.xhtml | 5 +-- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.classpath b/.classpath index e617e0c..58a0180 100644 --- a/.classpath +++ b/.classpath @@ -21,5 +21,6 @@ + diff --git a/src/org/april/agirstatool/core/pages/CreatedClosedDiffChartView.java b/src/org/april/agirstatool/core/pages/CreatedClosedDiffChartView.java index 6ee5346..87190c6 100644 --- a/src/org/april/agirstatool/core/pages/CreatedClosedDiffChartView.java +++ b/src/org/april/agirstatool/core/pages/CreatedClosedDiffChartView.java @@ -117,36 +117,15 @@ public class CreatedClosedDiffChartView { String result; - try + logger.debug("Building created/concluded chart view…"); + + if (project.hasIssue()) { - logger.debug("Building created/concluded chart view…"); - - if (project.hasIssue()) - { - String source = XidynUtils.load(AgirStatool.class.getResource("/org/april/agirstatool/core/pages/chartLineView.xhtml")); - String code = XidynUtils.extractBodyContent(source); - - code = code.replaceAll("myChart", "myChart_" + DigestUtils.md5Hex(title + "lineBar")); - - StringList labels = buildWeekLabels(project.issueStats().getFirstCreate().toLocalDate()); - code = code.replaceAll("labels: \\[.*\\]", "labels: " + AgirStatoolUtils.toJSonStrings(labels)); - - StringList values = project.issueStats().getWeekCreatedIssueCounts().toValueList(); - code = code.replaceAll("data: \\[.*\\]", "data: " + AgirStatoolUtils.toJSonNumbers(values)); - - values = project.issueStats().getWeekConcludedIssueCounts().toValueList(); - code = code.replaceAll("data: \\[.*\\] ", "data: " + AgirStatoolUtils.toJSonNumbers(values)); - - result = code.toString(); - } - else - { - result = "No issue."; - } + result = build(title, project, project.issueStats().getFirstCreate().toLocalDate(), LocalDate.now()); } - catch (IOException exception) + else { - throw new AgirStatoolException("Error building ProjectsRaw view: " + exception.getMessage(), exception); + result = "No issue."; } // diff --git a/src/org/april/agirstatool/core/pages/ProjectPage.java b/src/org/april/agirstatool/core/pages/ProjectPage.java index 26fc762..133615b 100644 --- a/src/org/april/agirstatool/core/pages/ProjectPage.java +++ b/src/org/april/agirstatool/core/pages/ProjectPage.java @@ -67,6 +67,7 @@ public class ProjectPage data.setContent("createdClosedPreviousYearChart", CreatedClosedCountChartView.buildPreviousYear("Created/closed last year Count", project)); data.setContent("created-ClosedPreviousYearChart", CreatedClosedDiffChartView.buildPreviousYear("Created-closed last year Count", project)); data.setContent("createdClosedFullChart", CreatedClosedCountChartView.buildFull("Created/closed Count", project)); + data.setContent("created-ClosedFullChart", CreatedClosedDiffChartView.buildFull("Created-closed Count", project)); data.setContent("issueRawChart", IssueStatChartView.build("Issue Raw Count", project)); data.setContent("issueGroupedChart", IssueStatChartView.buildGrouped("Issue Grouped Count", project)); diff --git a/src/org/april/agirstatool/core/pages/project.xhtml b/src/org/april/agirstatool/core/pages/project.xhtml index e569b3f..f0bddad 100644 --- a/src/org/april/agirstatool/core/pages/project.xhtml +++ b/src/org/april/agirstatool/core/pages/project.xhtml @@ -11,7 +11,7 @@ -
+

Agir Statoolv0.0.14 – Project n/a

@@ -39,7 +39,8 @@
CREATED-CLOSED PREVIOUS YEAR CHART
-
CREATED/CLOSED FULL CHART
+
CREATED/CLOSED FULL CHART
+
CREATED-CLOSED FULL CHART