summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-03 20:45:30 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-03 20:45:30 -0400
commitef8ddb59c94e24383531e52371b70b595dff8e24 (patch)
tree6fb3884ab6345a5c06a146cb9d3a40cc37c8119a /app
parent8c07a0d03e64227c552f3b4530d3a1e1ba53402b (diff)
Convert user distribution chart to Vue.js component
Diffstat (limited to 'app')
-rw-r--r--app/Controller/AnalyticController.php4
-rw-r--r--app/ServiceProvider/RouteProvider.php2
-rw-r--r--app/Template/analytic/sidebar.php4
-rw-r--r--app/Template/analytic/user_distribution.php (renamed from app/Template/analytic/users.php)6
4 files changed, 6 insertions, 10 deletions
diff --git a/app/Controller/AnalyticController.php b/app/Controller/AnalyticController.php
index 1949b6b8..e12de0c7 100644
--- a/app/Controller/AnalyticController.php
+++ b/app/Controller/AnalyticController.php
@@ -99,11 +99,11 @@ class AnalyticController extends BaseController
*
* @access public
*/
- public function users()
+ public function userDistribution()
{
$project = $this->getProject();
- $this->response->html($this->helper->layout->analytic('analytic/users', array(
+ $this->response->html($this->helper->layout->analytic('analytic/user_distribution', array(
'project' => $project,
'metrics' => $this->userDistributionAnalytic->build($project['id']),
'title' => t('User repartition'),
diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php
index 580ed6e5..0d1a7931 100644
--- a/app/ServiceProvider/RouteProvider.php
+++ b/app/ServiceProvider/RouteProvider.php
@@ -110,7 +110,7 @@ class RouteProvider implements ServiceProviderInterface
// Analytics routes
$container['route']->addRoute('analytics/tasks/:project_id', 'AnalyticController', 'taskDistribution');
- $container['route']->addRoute('analytics/users/:project_id', 'AnalyticController', 'users');
+ $container['route']->addRoute('analytics/users/:project_id', 'AnalyticController', 'userDistribution');
$container['route']->addRoute('analytics/cfd/:project_id', 'AnalyticController', 'cfd');
$container['route']->addRoute('analytics/burndown/:project_id', 'AnalyticController', 'burndown');
$container['route']->addRoute('analytics/average-time-column/:project_id', 'AnalyticController', 'averageTimeByColumn');
diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php
index 1468cee5..ceb57fac 100644
--- a/app/Template/analytic/sidebar.php
+++ b/app/Template/analytic/sidebar.php
@@ -3,8 +3,8 @@
<li <?= $this->app->checkMenuSelection('AnalyticController', 'taskDistribution') ?>>
<?= $this->url->link(t('Task distribution'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->checkMenuSelection('AnalyticController', 'users') ?>>
- <?= $this->url->link(t('User repartition'), 'AnalyticController', 'users', array('project_id' => $project['id'])) ?>
+ <li <?= $this->app->checkMenuSelection('AnalyticController', 'userDistribution') ?>>
+ <?= $this->url->link(t('User repartition'), 'AnalyticController', 'userDistribution', array('project_id' => $project['id'])) ?>
</li>
<li <?= $this->app->checkMenuSelection('AnalyticController', 'cfd') ?>>
<?= $this->url->link(t('Cumulative flow diagram'), 'AnalyticController', 'cfd', array('project_id' => $project['id'])) ?>
diff --git a/app/Template/analytic/users.php b/app/Template/analytic/user_distribution.php
index 91bec11b..c3cf4961 100644
--- a/app/Template/analytic/users.php
+++ b/app/Template/analytic/user_distribution.php
@@ -5,9 +5,7 @@
<?php if (empty($metrics)): ?>
<p class="alert"><?= t('Not enough data to show the graph.') ?></p>
<?php else: ?>
- <section id="analytic-user-repartition">
-
- <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>'></div>
+ <chart-project-user-distribution :metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>'></chart-project-user-distribution>
<table class="table-striped">
<tr>
@@ -29,6 +27,4 @@
</tr>
<?php endforeach ?>
</table>
-
- </section>
<?php endif ?>