Commit Graph

11202 Commits

Author SHA1 Message Date
Javier Martín
f2ef27d3ae Always set Globalize.locale after I18n.locale.
The test "Budget Investments Show milestones" was failing in certain
cases where `Globalize.locale` had been changed in a previous test.

Since having different values in `Globalize.locale` and `I18n.locale`
has proven to be an issue on the test enviroment, this commit also
changes application code in order to avoid similar situations on
production.

See issue #2718.
2018-07-03 00:52:20 +02:00
Javier Martín
54c82a53d7 Precompile CKEditor plugins in use.
As stated in #1196, compiling everything related to CKEditor made
compilations slower. However, not compiling any plugins meant Travis had
to compile them while running a test. It often resulted in a test
failing because the time Travis took to compile the plugins the
application uses exceeded Capybara's wait time.
2018-07-02 18:39:13 +02:00
iagirre
894c5d1eca Fix restore notifications from admins page
The restore feature was not working properly. When pushed, the button
was removing the notification from the admins panel, but it was not
restoring in the proposal.

I added an `after_restore` function (that I missed in the first PR)
so that the notification is unmarked as moderated.
2018-07-02 18:19:49 +02:00
iagirre
0fb7d13229 Add admin UI to Restore/Confirm moderation of notifications
Add the admin UI needed to restore the hidden proposal notifications
when hidden by moderator. The admin can restore them or confirm
the moderation made by moderator, just like proposals.
2018-07-02 18:19:19 +02:00
iagirre
88a8aaa083 Add hide button in the user interface
The little menu with the hide notification link and block user link
has been added to each proposal notification.

JS for adding the fade efect has also been added.
2018-07-02 18:19:08 +02:00
iagirre
8dadb228f1 Add specs to test the prop. notifications hide action
Specs that test if the proposal notifications hide action works.
It also tests if the admin part works (mark as reviewed, ignore them, etc.)
2018-07-02 18:18:05 +02:00
iagirre
12ccf466f9 Add the index to moderate the notifications
Add the index for moderating the notifications. The tranlations needed
have also been added, along with the JS to make it disappear at that moment.
2018-07-02 18:18:01 +02:00
iagirre
f58bc5d886 Add the menu entry for prop. notifications
A new menu for the sidebar has been added, so that the moderator
can access to the index from the menu.
2018-07-02 18:17:56 +02:00
iagirre
21b1d00205 Add backend for the moderators
Add new routes for the proposal notifications edition and
abilities to let moderators edit it (mark as ignored, hide, etc.).

The notifications are not flaggable because they doesn't work like that,
but in a similar way. The moderator/administrator is in charge of hidding
them through the UI, so the normal users don't flag it as inappropriate.

New controller Moderation::ProposalNotification to manage the moderators
work.
2018-07-02 18:17:45 +02:00
iagirre
7982574993 Add migration to generate new columns
The migration to generate the columns needed for the feature.
There are three new columns:

moderated: a boolean that, when true, it means a moderator has
hidden a proposal notification. The notification is hidden immediately
and it's shown in the moderators proposal notifications index.

hidden_at: used by acts_as_paranoid to hide the notification from the list.
It's like deleting it, but without deleting definitely from DB.

ignored_at: used to mark as a notification as ignored, so that it will
appear in marked as reviewed and not in the pending list. WARNING! this
doesn't mean that it will disappear from the 'All' filter.
2018-07-02 18:06:19 +02:00
decabeza
0a58e72edb Adds ballot booths menu on admin 2018-07-02 17:57:27 +02:00
decabeza
b4b2688e08 Updates texts on specs 2018-07-02 17:41:53 +02:00
decabeza
2e8fe65b3d Cleans and improves management views layout 2018-07-02 17:41:39 +02:00
decabeza
d936a8348e Updates management i18n 2018-07-02 17:41:34 +02:00
decabeza
3b9b9c5c8f Updates styles for management section 2018-07-02 17:41:29 +02:00
decabeza
57a0aaba97 Reorganizes manager menu and creates helper 2018-07-02 17:41:22 +02:00
Angel Perez
8a46afeedc Fix string literal warning for admin menu 2018-07-02 09:30:21 -04:00
Javier Martín
e655c3c958 Fix suggestions keyup timeout.
The browser was generating one AJAX request per keystroke, ignoring the
timeout. The clearTimeout() function needs to be called with the ID
value returned by setTimeout().
2018-06-28 21:06:32 +02:00
Alberto
cd15e3f23a Merge pull request #2706 from consul/milestone_status
Investment milestone's project status
2018-06-28 11:34:06 +02:00
decabeza
d683a6cd6b Adds styles to budget investment milestone status and fixes spec 2018-06-27 19:28:43 +02:00
María Checa
fb5b993920 Add Budget::Investment::Statuses tests 2018-06-27 18:34:02 +02:00
María Checa
a4cda8a9f6 Add new translations 2018-06-27 18:32:54 +02:00
María Checa
7ef77f55a4 Change public investment milestones timeline 2018-06-27 18:31:54 +02:00
María Checa
a5d0c2f6c8 Changed Budget::Investment::Milestone views 2018-06-27 18:23:34 +02:00
María Checa
551e2bb1c4 Changed Budget::Investment::Milestones model
Added relation with Status and set condition to validate milestone's description presence if there's no status set.
2018-06-27 18:19:33 +02:00
María Checa
29dadc91ac Change Budget::Investment::Milestones controller
Added `:status_id` to valid params and new method to get all statuses defined for the budget.
2018-06-27 18:19:29 +02:00
María Checa
7deded142f Add Budget::Investment::Status migration 2018-06-27 18:19:22 +02:00
Alberto
3e7a53b2c7 Merge pull request #2705 from consul/budget_statuses
Budget statuses
2018-06-27 18:18:13 +02:00
María Checa
9eefcafcfb Add Budget::Investment::Status to dev_seeds 2018-06-27 16:49:27 +02:00
María Checa
e8e9fcd0da Add Budget::Investment::Statuses tests 2018-06-27 16:45:58 +02:00
María Checa
564d1b32e2 Add new translations 2018-06-27 16:45:53 +02:00
María Checa
3a163b39c8 Add Budget::Investment::Statuses views 2018-06-27 16:45:44 +02:00
María Checa
2cb59260e9 Add Budget::Investment::Statuses controller and routes 2018-06-27 16:44:58 +02:00
María Checa
87b13bab72 Add Budget::Investment::Statuses model 2018-06-27 16:44:48 +02:00
María Checa
28bb32a085 Add Budget::Investment::Status migration 2018-06-27 16:44:40 +02:00
Alberto
6ec11371a3 Merge pull request #2702 from consul/fix_valuation_heading_filters
Fix valuation heading filters
2018-06-27 16:43:25 +02:00
Bertocq
4329fab627 Group Index scenarios at Valuation Investments spec
Grouping scenarios makes it easier to follow the spec and to know where
to put a new scenario
2018-06-27 14:34:28 +02:00
Bertocq
3e75bd4dfd Fix Valuation Investment index heading filters
Why:

Heading filter where not being correctly displayed

How:

Increasing scenario to cover all possible combinations, and fixing the
heading_filters method of the Valuation Budget Investment Controller to
correctly:
  * Find how many investments the valuator can access
  * Count investments for each heading
2018-06-27 14:30:09 +02:00
Alberto
06831f4fc9 Merge pull request #2699 from consul/polls-concerns-behaves-like-notifiable-in-app
Flaky spec: Polls Concerns behaves like notifiable in-app Multiple users commented on my notifiable
2018-06-27 14:02:19 +02:00
Raimond Garcia
1411e8c52a Merge pull request #2701 from consul/gemfile
Regenerate Gemfile.lock
2018-06-27 13:34:45 +02:00
rgarcia
0117a8257b Regenerate Gemfile.lock 2018-06-27 13:07:52 +02:00
iagirre
271c1595ba Changed the way the notifications page is accessed. Instead of doing it through UI, after the notifications are created the test goes directly to the notifications page (after login in the user). To check if the notification icon is correctly shown, a new test has been created that only does that. 2018-06-26 17:35:42 +02:00
Javier Martín
0cf50d8116 Rename partial to diable animations in tests.
With this name, it's easier to understand what it does.
2018-06-26 16:04:13 +02:00
Javier Martín
a972e7b978 Don't use CSS animations when testing.
Just like jQuery animations, they can make tests fail when using
Capybara.
2018-06-24 02:51:52 +02:00
Javier Martín
9198b1af03 Skip jQuery animations in all layouts when testing. 2018-06-24 02:50:25 +02:00
Javier Martín
6e4f697cea Extract partial with common <head> tags. 2018-06-24 02:43:59 +02:00
Javier Martín
6245942196 Don't use jQuery animations in tests.
There's a flaky test creating a group for a budget which takes place
because toggling a form using jQuery sometimes results in the button not
being correctly clicked by Capybara.

Checking the page with `expect(page).to have_button 'Create group'`
before clicking the button doesn't solve the problem; it looks like in
those cases Capybara waits for AJAX requests but not for JavaScript
animations.

See also issue #2573.
2018-06-23 19:58:20 +02:00
Alberto
24e4f027b1 Merge pull request #2694 from consul/homepage-design
Homepage design
2018-06-22 18:40:20 +02:00
decabeza
de6d919ff0 Fixes scss lint warning 2018-06-22 18:01:39 +02:00
decabeza
6477983a85 Adds card hover effect 2018-06-22 18:01:28 +02:00