Javi Martín
2153bd9e98
Add tests for current/expired/recounting polls
...
We didn't have model tests for some of these scopes, and neither scope
tests nor instance method tests covered edge cases like the current
date.
2022-09-14 15:14:23 +02:00
Javi Martín
bd85a09d32
Group poll scopes tests together
...
We're also using the convention of using a `.` to describe class
methods.
2022-09-14 15:14:23 +02:00
Javi Martín
90d5759c23
Show the precise ending time unless it's midnight
...
The reason why we were displaying the ending date as "one second before
the actual ending" was that, when seeing that a phase ends at a date
like "2000-12-31 00:00", we might end up thinking that the phase will
finished at the midnight between December 31st and January the 1st,
while it actually ends at the midnight between December the 30th and
December the 31st.
This is particularly important because we use a date field to select the
date of a phase and if select December the 31st, it will be stored in
the database as "2000-12-31 00:00". So, instead, in this case we display
"2000-12-30 23:59", which is less confusing.
But now we're going to add support for setting a time on polls, which
means a certain poll might end at 15:30. In this case, displaying that
it ends at 15:29 doesn't make much sense.
2022-09-14 15:14:23 +02:00
Javi Martín
7227815a16
Split duration component in two
...
We were displaying dates in two different formats in the same component,
leading to strange hacks like manually calling the `call` method or not
being able to use `render_inline` in the tests.
Since we're going to reuse one of these formats outside the budgets
section, we're splitting the component. We're also removing the
mentioned hacks.
2022-09-14 15:14:23 +02:00
Javi Martín
67d13d2899
Show the time when a poll starts and ends
...
This is consistent with the way we show the duration of a budget and its
phases. Since budgets are the section with the most recent changes in
the admin area, we're using it as a reference.
Note that, unlike budgets (which are shown to finish at the beginning of
their ending day), a poll has always been considered to finish at the
end of their ending day, so we're showing it this way.
We're also solving a minor usability issue. While it's pretty intuitive
that a poll starting on a certain date will start at the beginning of
the day, a poll ending on a certain date isn't clear about when it
finishes exactly: is it at the beginning of the day, or at the end of
the day?
So now we're making this point clear.
2022-09-14 15:14:23 +02:00
Sebastia
eaafc7a438
Merge pull request #4990 from consul/improve-polls
...
Refactor admin poll section
2022-09-14 15:13:33 +02:00
taitus
86ff4eeff9
Add consistency to back_links
...
In some cases (e.g. after editing or creating a resource
with errors) the default back_link did not redirect to the
expected page.
Now we force the back_links to the index pages, so we
always get the desired redirect.
2022-09-14 14:56:27 +02:00
taitus
2d353ba893
Remove unused routes related to documents
...
These routes aren't used since commits (2993ef8707 , 88a7a29d27 )
In parallel while these routes were being removed, the route file
was being split into different files, and they were included again
in the commit 1cd47da9d4 .
2022-09-14 14:45:37 +02:00
taitus
83e0d4c6b7
Add load_and_authorize_resource to images controller
2022-09-14 14:45:37 +02:00
taitus
99495a21d2
Add load_and_authorize_resource to videos controller
2022-09-14 14:45:36 +02:00
taitus
b17b03099c
Load videos through answer in all actions
2022-09-14 14:45:36 +02:00
taitus
919534fbc5
Unify with the rest of application destroy method in videos controller
2022-09-14 14:45:36 +02:00
taitus
1ec793863b
Add missing system specs for poll question answer videos
...
Minor change for replace @video.answer_id to @video.answer.
2022-09-14 14:45:35 +02:00
taitus
3d1a9501aa
Remove unused resource controller methods
...
These methods aren't necessary since commit 71601bd3f .
2022-09-14 14:45:35 +02:00
Julian Herrero
24276a201e
Remove useless answers show view
...
Until now, in order to edit an answer, we had to click on its title on
the table and then on the "Edit answer" link.
That was tedious and different from what we usually do in the admin
section. Furthermore, the code for the answers table was written twice
and when we modified it we forgot to update the one in the `show`
action, meaning the table here provided less information than the
information present in the answers tables.
Co-Authored-By: Javi Martín <javim@elretirao.net >
2022-09-14 14:45:35 +02:00
Javi Martín
78ed5a8bfc
Use caption instead of tr to label the answers table
...
We might change the style of this caption or remove it completely in the
future. In the meantime, we use the right HTML tag for the task to give
information regarding what the table is about, and that tag is
`<caption>`.
2022-09-14 14:45:35 +02:00
taitus
ec861ca8e6
Extract documents action from Answer controller
...
This way we have a controller just to manage
Poll::Question::Answer related documents in the
same way we have for videos and images.
2022-09-14 14:45:34 +02:00
taitus
cb2958e1b0
Add load_and_authorize_resource to answers controller
2022-09-14 14:45:34 +02:00
taitus
405b37f605
Load answer through question in answers controller
...
We are simplifying the load answer and we can remove the ambiguous
hidden field from answer form.
2022-09-14 14:45:33 +02:00
taitus
01005b50cb
Load question from load_and_authorize_resource in answers controller
2022-09-14 14:45:33 +02:00
taitus
8b4cd13675
Unify with the rest of application destroy method in questions controller
...
We also add a missing translation.
2022-09-14 11:37:21 +02:00
taitus
ad9362399e
After destroy question redirect to his poll show page
...
After removing a question from a poll it makes more sense to redirect to
your own poll show page in order to manage their questions.
Currently it is redirecting to the questions index page where all the
questions from all the polls are displayed and takes you completely out
of the context of the poll you are in.
In the future we will remove this index question page.
2022-09-14 11:37:20 +02:00
taitus
cc4b22ee37
Use resource from load_and_authorize_resource in admin polls controller
2022-09-09 11:01:55 +02:00
taitus
38b6cf36a2
Remove unused add_question action from admin polls controller
...
Since commit adf18ee756 this action no longer makes sense.
2022-09-07 14:25:15 +02:00
taitus
5011d4745b
Remove related code for unused actions from admin polls controller
...
Actions :search_booths and :search_officers in admin polls controller
are moved to other controllers since commit 20e31133a for
:search_booths and commit 19ec7f93b for :search_officers.
This then allows us to remove the code that references these actions in
the controller and in the administrator abilities.
2022-09-07 13:41:26 +02:00
Alex
40886704bb
Update kanban.yml
...
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com >
2022-08-29 20:07:04 +01:00
Javi Martín
b9d63bc2ab
Merge pull request #4971 from consul/dependabot/bundler/master/ahoy_matey-4.1.0
...
Bump ahoy_matey from 3.2.0 to 4.1.0
2022-08-27 00:35:47 +02:00
dependabot[bot]
0502c55b77
Bump ahoy_matey from 3.2.0 to 4.1.0
...
Bumps [ahoy_matey](https://github.com/ankane/ahoy ) from 3.2.0 to 4.1.0.
- [Release notes](https://github.com/ankane/ahoy/releases )
- [Changelog](https://github.com/ankane/ahoy/blob/master/CHANGELOG.md )
- [Commits](https://github.com/ankane/ahoy/compare/v3.2.0...v4.1.0 )
---
updated-dependencies:
- dependency-name: ahoy_matey
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-27 00:19:04 +02:00
Javi Martín
0ab11f73f7
Merge pull request #4968 from consul/dependabot/bundler/master/uuidtools-2.2.0
...
Bump uuidtools from 2.1.5 to 2.2.0
2022-08-27 00:16:52 +02:00
dependabot[bot]
827d32ae9e
Bump uuidtools from 2.1.5 to 2.2.0
...
Bumps [uuidtools](https://github.com/sporkmonger/uuidtools ) from 2.1.5 to 2.2.0.
- [Release notes](https://github.com/sporkmonger/uuidtools/releases )
- [Changelog](https://github.com/sporkmonger/uuidtools/blob/main/CHANGELOG )
- [Commits](https://github.com/sporkmonger/uuidtools/commits )
---
updated-dependencies:
- dependency-name: uuidtools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-27 00:01:35 +02:00
Javi Martín
5c986097c6
Merge pull request #4966 from consul/dependabot/bundler/master/devise-4.8.1
...
Bump devise from 4.8.0 to 4.8.1
2022-08-26 23:54:34 +02:00
dependabot[bot]
1a37b7b905
Bump devise from 4.8.0 to 4.8.1
...
Bumps [devise](https://github.com/heartcombo/devise ) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/heartcombo/devise/releases )
- [Changelog](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md )
- [Commits](https://github.com/heartcombo/devise/compare/v4.8.0...v4.8.1 )
---
updated-dependencies:
- dependency-name: devise
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 23:39:03 +02:00
Javi Martín
899b0db904
Merge pull request #4972 from consul/dependabot/bundler/master/pronto-rubocop-0.11.2
...
Bump pronto-rubocop from 0.11.1 to 0.11.2
2022-08-26 23:38:24 +02:00
dependabot[bot]
9bd9a94f39
Bump pronto-rubocop from 0.11.1 to 0.11.2
...
Bumps [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop ) from 0.11.1 to 0.11.2.
- [Release notes](https://github.com/mmozuras/pronto-rubocop/releases )
- [Commits](https://github.com/mmozuras/pronto-rubocop/compare/v0.11.1...v0.11.2 )
---
updated-dependencies:
- dependency-name: pronto-rubocop
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 23:19:10 +02:00
Javi Martín
40d1395f1b
Merge pull request #4973 from consul/dependabot/bundler/master/savon-2.13.0
...
Bump savon from 2.12.1 to 2.13.0
2022-08-26 23:18:15 +02:00
dependabot[bot]
385e1136b3
Bump savon from 2.12.1 to 2.13.0
...
Bumps [savon](https://github.com/savonrb/savon ) from 2.12.1 to 2.13.0.
- [Release notes](https://github.com/savonrb/savon/releases )
- [Changelog](https://github.com/savonrb/savon/blob/master/CHANGELOG.md )
- [Commits](https://github.com/savonrb/savon/compare/v2.12.1...v2.13.0 )
---
updated-dependencies:
- dependency-name: savon
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 22:48:17 +02:00
Javi Martín
1663eb9892
Merge pull request #4975 from consul/dependabot/bundler/master/cancancan-3.4.0
...
Bump cancancan from 3.3.0 to 3.4.0
2022-08-26 22:46:08 +02:00
dependabot[bot]
3f7b3ae319
Bump cancancan from 3.3.0 to 3.4.0
...
Bumps [cancancan](https://github.com/CanCanCommunity/cancancan ) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/CanCanCommunity/cancancan/releases )
- [Changelog](https://github.com/CanCanCommunity/cancancan/blob/develop/CHANGELOG.md )
- [Commits](https://github.com/CanCanCommunity/cancancan/compare/3.3.0...3.4.0 )
---
updated-dependencies:
- dependency-name: cancancan
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 22:31:39 +02:00
Javi Martín
7a85953ae0
Merge pull request #4929 from consul/dependabot/bundler/master/omniauth-2.1.0
...
Bump omniauth from 2.0.4 to 2.1.0
2022-08-26 20:10:53 +02:00
Javi Martín
3790aaa4e4
Merge pull request #4954 from consul/dependabot/bundler/master/omniauth-rails_csrf_protection-1.0.1
...
Bump omniauth-rails_csrf_protection from 1.0.0 to 1.0.1
2022-08-26 20:10:07 +02:00
Javi Martín
a49ddf2628
Merge pull request #4957 from consul/dependabot/bundler/master/graphiql-rails-1.8.0
...
Bump graphiql-rails from 1.7.0 to 1.8.0
2022-08-26 20:02:57 +02:00
dependabot[bot]
1cb44fc17c
Bump omniauth from 2.0.4 to 2.1.0
...
Bumps [omniauth](https://github.com/omniauth/omniauth ) from 2.0.4 to 2.1.0.
- [Release notes](https://github.com/omniauth/omniauth/releases )
- [Commits](https://github.com/omniauth/omniauth/compare/v2.0.4...v2.1.0 )
---
updated-dependencies:
- dependency-name: omniauth
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 19:54:46 +02:00
dependabot[bot]
4675cabe9a
Bump omniauth-rails_csrf_protection from 1.0.0 to 1.0.1
...
Bumps [omniauth-rails_csrf_protection](https://github.com/cookpad/omniauth-rails_csrf_protection ) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/cookpad/omniauth-rails_csrf_protection/releases )
- [Commits](https://github.com/cookpad/omniauth-rails_csrf_protection/compare/v1.0.0...v1.0.1 )
---
updated-dependencies:
- dependency-name: omniauth-rails_csrf_protection
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 19:52:31 +02:00
dependabot[bot]
7734b29257
Bump graphiql-rails from 1.7.0 to 1.8.0
...
Bumps [graphiql-rails](https://github.com/rmosolgo/graphiql-rails ) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/rmosolgo/graphiql-rails/releases )
- [Changelog](https://github.com/rmosolgo/graphiql-rails/blob/master/changelog.md )
- [Commits](https://github.com/rmosolgo/graphiql-rails/compare/v1.7.0...v1.8.0 )
---
updated-dependencies:
- dependency-name: graphiql-rails
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 19:16:46 +02:00
Javi Martín
95b188b275
Merge pull request #4952 from consul/dependabot/bundler/master/globalize-6.2.1
...
Bump globalize from 6.0.1 to 6.2.1
2022-08-26 18:54:50 +02:00
Javi Martín
26e989dd6b
Merge pull request #4949 from consul/dependabot/bundler/master/web-console-4.2.0
...
Bump web-console from 4.0.4 to 4.2.0
2022-08-26 18:50:52 +02:00
Javi Martín
57926b3388
Merge pull request #4951 from consul/dependabot/bundler/master/delayed_job_active_record-4.1.7
...
Bump delayed_job_active_record from 4.1.6 to 4.1.7
2022-08-26 18:44:04 +02:00
dependabot[bot]
3ea8b59058
Bump globalize from 6.0.1 to 6.2.1
...
Bumps [globalize](https://github.com/globalize/globalize ) from 6.0.1 to 6.2.1.
- [Release notes](https://github.com/globalize/globalize/releases )
- [Changelog](https://github.com/globalize/globalize/blob/main/CHANGELOG.md )
- [Commits](https://github.com/globalize/globalize/commits/v6.2.1 )
---
updated-dependencies:
- dependency-name: globalize
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 18:37:32 +02:00
dependabot[bot]
b039eaf004
Bump web-console from 4.0.4 to 4.2.0
...
Bumps [web-console](https://github.com/rails/web-console ) from 4.0.4 to 4.2.0.
- [Release notes](https://github.com/rails/web-console/releases )
- [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown )
- [Commits](https://github.com/rails/web-console/compare/v4.0.4...v4.2.0 )
---
updated-dependencies:
- dependency-name: web-console
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 18:29:15 +02:00
dependabot[bot]
fde6b007f9
Bump delayed_job_active_record from 4.1.6 to 4.1.7
...
Bumps [delayed_job_active_record](https://github.com/collectiveidea/delayed_job_active_record ) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/collectiveidea/delayed_job_active_record/releases )
- [Commits](https://github.com/collectiveidea/delayed_job_active_record/compare/v4.1.6...v4.1.7 )
---
updated-dependencies:
- dependency-name: delayed_job_active_record
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-08-26 18:27:00 +02:00