Commit Graph

10 Commits

Author SHA1 Message Date
Javi Martín
02825c22fe Include stat graphs JavaScript in all admin stats actions
Since the main stats index loads this JavaScript using
`"data-turbolinks-track" => "reload"`, going from the stats index to a
section that doesn't include this JavaScript did the strange effect
Turbolinks does in these situations: it first loaded the page using an
AJAX request and, after getting the contents of the page, it reloaded it
in order to apply the changes in the included JavaScript.

This behavior was a bit confusing, particularly when browsing to a
section of the admin stats, clicking the browser's back button to go
back to the stats index, the going to another section, ...

One of the admin stats tests was failing sometimes with this message:

```
  1) Stats Budget investments Supporting phase Number of users and
     supports in investment projects
     Failure/Error: raise ex, cause: cause

     Selenium::WebDriver::Error::UnknownError:
       unknown error: unhandled inspector error:
         {"code":-32000,"message":"Node with given id does not belong to the document"}
         (Session info: chrome=129.0.6668.89)
```

This was probably caused by the mentioned Turbolinks behavior that loads
the page twice. It's possible that Selenium was somehow checking the
node related to the first request when the second request had finished.

Avoiding that double request solves the issue.
2024-11-08 19:54:29 +01:00
Javi Martín
772be11525 Fix budget investments chart in admin stats
The JavaScript required to display the chart wasn't loaded on the admin
stats page.

We're not adding a test because we're going to move the budgets graph to
a different page on the pull request containing this commit.

Note we're changing the "Go back" link, since using a turbolinks refresh
broke this link when using the Chromium browser. Besides, there was an
inconsistency where some of the "Go back" links in admin stats pointed
to the admin stats page but other links pointed to `:back`.
2024-05-09 14:28:31 +02:00
Javi Martín
c62da726b8 Apply SpaceAroundErbTag ERB Lint rule 2019-09-10 20:02:15 +02:00
rgarcia
e3eb87addb checks for deleted proposals 2019-01-04 15:25:13 +01:00
decabeza
98961748ad replaces more old back link partial to new back_link_to helper 2017-07-27 00:26:39 +02:00
rgarcia
1f7e86e206 fixes specs 2016-06-20 22:06:49 +02:00
rgarcia
b7e3129ec1 uses more efficient count 2016-06-16 18:35:34 +02:00
Alberto Garcia Cabeza
352f3fa2f9 Resolves conflicts and improves styles for stats 2016-06-16 18:07:13 +02:00
rgarcia
f9a2f5d5dc adds specs for stats 2016-06-16 17:59:56 +02:00
rgarcia
0abc9c8376 adds stats for direct messages and proposal notifications 2016-06-16 17:42:16 +02:00