Commit graph

45 commits

Author SHA1 Message Date
Jyri-Petteri Paloposki
d4c9041ccd More code style fixes 2021-01-06 03:47:35 +02:00
Jyri-Petteri Paloposki
67a426a2e9 More code climate style fixes 2020-10-10 15:24:01 +03:00
Jyri-Petteri Paloposki
d8acf60049 Code style fixes 2020-10-10 05:14:24 +03:00
Jyri-Petteri Paloposki
80aad1b4f2 #1153: Remove unnecessary type change and test for stats chart templates and endpoints which were removed 2019-05-20 01:12:25 +03:00
Jyri-Petteri Paloposki
b7320a1de8 #1153: Perhaps the final deletion of the old Flash charts code 2019-05-19 18:40:23 +03:00
Jyri-Petteri Paloposki
b040dfce51 #1153: Final checks against the old code, fixed the last mistakes 2019-05-19 17:39:38 +03:00
Jyri-Petteri Paloposki
f9370a9a4a #1153: Fix whitespace issues caused by Vim misconfiguration 2019-05-19 16:51:26 +03:00
Jyri-Petteri Paloposki
0b326e17d8 #1153: Use translations properly, add missing labels, fix bugs and add links to charts 2019-05-19 16:40:00 +03:00
Jyri-Petteri Paloposki
f873a93eb3 #1153: Convert rest of the stats to use ChartJS 2019-05-19 13:04:33 +03:00
Jyri-Petteri Paloposki
dec82fd26c #1153: Change to using Chart.js with a basic RoR library instead of Chartkick because Chartkick doesn't support combo charts. 2019-05-17 22:49:21 +03:00
Jyri-Petteri Paloposki
c9cae9421a #1153: Few of the graphs converted to use Chartkick 2019-05-17 22:49:21 +03:00
Matt Rogers
500892e1a4 Fix the top 10 longest running projects list
Sorting by running time without a reverse takes the shortest running
projects.
2017-06-13 17:12:15 -05:00
Reinier Balt
405ad5a79f Fasterer: Enumerable#sort is slower
Enumerable#sort is slower than Enumerable#sort_by
2015-08-19 15:19:47 +02:00
Reinier Balt
e58379e81f This fixes failing tests when the timezone is different than utc
There were several problems:
* Time.now returns the systems time, not the users time
* fixtures do not translate dates from timezone to utc, but stores the
  date verbatim
* calling a controller will set the timezone to the preference of the
  current_user. So it could be changed while you do not realize this. I
  fixed the failing test, but problems could be elsewhere
2015-08-05 11:50:33 +02:00
Reinier Balt
2883d1b7f4 Statistics for longest running projects now includes completed and hidden projects. fixes #1725 2014-11-05 17:07:21 +01:00
Katrina Owen
a4ae0c03bf Fix failing tests 2013-03-18 21:54:19 -06:00
Katrina Owen
a690e4a4cd Extract methods in pie chart data model 2013-03-18 19:57:42 -06:00
Katrina Owen
961227da0c Extract pie chart data logic into model layer
Move most of the tests for this logic into the unit test layer.
2013-03-18 19:49:54 -06:00
Katrina Owen
3479585991 Use a more appropriate name for stats domain object 2013-03-05 07:49:44 -07:00
Katrina Owen
d5a555fbac Encapsulate dependencies of stats index page
This may be a bit extreme.

It's modeled after the ideal "rails way".

In the controller, we now know the name of a single resource. It
doesn't happen to be backed by a database table, but it does know all
about the task of collecting stats, leaving the controller concerned
with just munging params and rendering stuff.

I called the resource `IndexPage`, to avoid the temptation of trying to
reuse it, which can get pretty messy.

Later, if a better abstraction appears, it should be fairly painless to
alter.
2013-03-02 17:35:19 -07:00
Katrina Owen
615a9e46c9 Encapsulate counts and totals into a class.
Move queries out of the view and into the model layer.
2013-03-02 17:22:15 -07:00
Katrina Owen
6ccb9a81fb Group context-related pieces in a class 2013-03-02 17:21:03 -07:00
Katrina Owen
8b1f0a34a0 Group project-related stats into a class.
Reduce number of instance variables available to the views.
Replace raw SQL with AR-type query.
2013-03-02 17:12:14 -07:00
Katrina Owen
c4433a5ea9 Don't round in ttc.min_sec method
This fixes a bug where it would round 1.8 days up to
2 days, and still display the extra hours in addition.
2013-03-02 16:16:45 -05:00
Katrina Owen
03282638af Move calculation out of view 2013-03-02 16:16:45 -05:00
Katrina Owen
62336f94cd Move time to complete stats into separate class
This separates out the calculations from the queries so we can get
decent tests around them.
2013-03-02 16:16:45 -05:00
Katrina Owen
0ebb98d49f Encapsulate action stats
This gets rid of a bunch of instance variables in the view/controller
layer.
2013-03-02 16:16:45 -05:00
Matt Rogers
004339a2ca Merge pull request #164 from kytrinyx/adjust-font-size
Split up the font size calculation
2013-03-02 05:40:38 -08:00
Katrina Owen
1b7ed32024 Fold two more SQL queries into the query object 2013-03-02 07:54:13 -05:00
Katrina Owen
3f496db4b4 Split up the font size calculation
The font size is a view concern, but the relative size belongs in the
model layer.
2013-03-02 07:14:52 -05:00
Matt Rogers
3365b7e79f Merge pull request #162 from kytrinyx/projects-stats
Extract duplicate top projects query from stats controller
2013-03-01 21:58:34 -08:00
Katrina Owen
a23d2eb070 Extract duplicate context query from controller 2013-03-01 23:29:54 -05:00
Katrina Owen
6de4713d38 Extract top projects query object
This removed a bit of duplication from the stats controller.
2013-03-01 23:11:44 -05:00
Matt Rogers
f375c06964 Merge pull request #160 from kytrinyx/tag-counts
Extract duplicated query from stats controller
2013-03-01 18:52:52 -08:00
Katrina Owen
4dff7538ea Extract duplicated query
This includes a bit of a simplification which assumes that there aren't
any orphan taggings for a user.
2013-03-01 21:27:58 -05:00
Katrina Owen
0aa6ea183b Extract chart value object
This simplifies the views (slightly).
2013-03-01 20:38:24 -05:00
Katrina Owen
cd7a5e0866 Delete redundant casting in tag cloud 2013-03-01 16:12:00 -05:00
Katrina Owen
a13199cdda Add unit test for tag cloud 2013-03-01 16:03:35 -05:00
Katrina Owen
a81f5b76f3 Separate query from cloud
This will make testing easier
2013-03-01 13:14:27 -05:00
Katrina Owen
8f42b25e68 Use lowest tag count as minimum 2013-02-28 23:36:08 -05:00
Katrina Owen
d478efdd01 Move font calculation into tag cloud 2013-02-28 22:30:34 -05:00
Katrina Owen
61e04a8258 Extract methods in tag cloud
This gets rid of the compute method, and makes each value that got set
in it its own little method.
2013-02-28 21:53:19 -05:00
Katrina Owen
447178bd7d Collapse duplication in tag cloud model 2013-02-28 21:30:36 -05:00
Katrina Owen
edc793e703 Rename variables
The current user isn't necessarily current when it is in the model
layer.

The exposed attributes on the tag cloud no longer need to contain type
information.
2013-02-28 21:18:00 -05:00
Katrina Owen
8f6d57014a Extract tag cloud class from stats controller 2013-02-28 21:08:48 -05:00