Commit Graph

9520 Commits

Author SHA1 Message Date
Alberto
95f66aefe6 Merge pull request #2726 from consul/officing-no-vote
Officing not to vote
2018-07-05 17:07:10 +02:00
decabeza
2f922e1adb Adds button to officing voters if person decided not to vote 2018-07-05 14:12:22 +02:00
Alberto
e201de6ac9 Merge pull request #2725 from consul/officer-shifts
Officing sidebar menu
2018-07-05 11:08:42 +02:00
Alberto
f7cbe32163 Merge pull request #2724 from consul/a11y
A11y
2018-07-05 11:08:16 +02:00
decabeza
21f3d39c6a Removes poll budget creation on specs 2018-07-04 18:12:43 +02:00
decabeza
16ff5c4400 Hides sidebar menus if officer has no shifts assigned 2018-07-04 17:22:03 +02:00
decabeza
8900b1ffce Shows flag actions div only if user can hide 2018-07-04 17:14:29 +02:00
decabeza
abf0fe992e Removes tablist and tab roles 2018-07-04 17:14:24 +02:00
Raúl Fuentes
85f3f06255 Delete unused key 2018-07-04 12:32:52 +02:00
Raúl Fuentes
275f9ad812 Added new test to budget/investment/index, tested the combination between text search and any other option in the search form 2018-07-04 11:55:13 +02:00
Raúl Fuentes
ee19c2fef0 Fixed test for updated form 2018-07-04 11:55:13 +02:00
Raúl Fuentes
df899cde6e Fixed html, now it reflects the current search also added serach by name or id to the Budget::Invesment search function 2018-07-04 11:55:13 +02:00
Raúl Fuentes
4cd2f11723 Fixed test for the refactored form 2018-07-04 11:55:13 +02:00
Raúl Fuentes
c9f31b8e1e Refactor Admin::Budget::Investment search form to use one form tag 2018-07-04 11:55:13 +02:00
Arun Kumar
e4d5307c06 Add issue template 2018-07-04 02:50:16 -05:00
Javier Martín
b1996e5694 Check page between AJAX requests in proposals spec.
There was a flaky spec supporting proposals. It's hard to reproduce and
be sure about what was going on, so here is my best guess. Given the
code:

```
within(".proposals-list") { click_link proposal.title }
within("#proposal_#{proposal.id}_votes") { click_link('Support') }
```

The first clicked link generates an AJAX request. Usually, Capybara
would wait for the AJAX request to generate a "Support" link in the
element `#proposal_XX_votes`. However, there's already a
`#proposal_XX_votes` element with a "Support" link on the proposals
index page!

So Capybara doesn't have to wait for the AJAX request to finish before
clicking the "Support" link. From then on, anything can happen.

Another option that works:

```
within(".proposals-list") { click_link proposal.title }
within(".proposal-show #proposal_#{proposal.id}_votes") { click_link('Support') }
```

With this code, the link selector fails on the proposals index page, and
Capybara waits for the AJAX request to finish.

Related to issue #2558.
2018-07-04 00:00:51 +02:00
Javier Martín
37eaf29517 Fix flaky emails spec.
These tests were failing randomly because there is no guarantee
the methods `Budget#email_selected` and `Budget#email_unselected` will
always send the emails in the same order, because `investments.selected`
and `investments.unselected` don't necessarily return the records in the
order they were created.

Ordering by id is certainly not very elegant; however, ordering by
another field like `created_at` is dangerous because the record could be
created at (almost) the exact same time.

Related to issue #2446 and issue #2519.
2018-07-03 23:59:20 +02:00
Angel Perez
4a6313fed7 Add missing thead & tbody tags on moderation index views 2018-07-03 09:22:42 -04:00
Angel Perez
452d7dd252 Fix page entries information and filter positioning 2018-07-03 09:22:42 -04:00
Alberto
1de0cf083f Merge pull request #2717 from consul/allow-author-notifications-to-be-moderated
Allow author notifications to be moderated
2018-07-03 11:21:26 +02:00
Alberto
ff4c72987f Merge pull request #2716 from consul/admin-booths-menu
Adds ballot booths menu on admin
2018-07-03 11:20:42 +02:00
Alberto
27374d9899 Merge pull request #2715 from consul/manager-ui
Manager UI
2018-07-03 11:20:21 +02:00
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