Commit graph

711 commits

Author SHA1 Message Date
Andrew Kvalheim
b565be2f46 Correct assumption of survey start and end dates
The logic used for the `:reply` ability incompletely duplicated that of
`Survey#active?` and incorrectly assumed that surveys always have start
and end dates.

Resolves:

    Failures:

      1) Survey as an attendee respond to a survey during registration
         Failure/Error: survey.start_date > Time.current || survey.end_date < Time.current

         ActionView::Template::Error:
           undefined method `>' for nil:NilClass

                 survey.start_date > Time.current || survey.end_date < Time.current
                                   ^
         # ./app/models/ability.rb:126:in `block in signed_in'
         # ./app/views/surveys/show.html.haml:28:in `block in _app_views_surveys_show_html_haml___3404959267043700678_138180'
         # ./app/views/surveys/show.html.haml:19:in `_app_views_surveys_show_html_haml___3404959267043700678_138180'

    Failed examples:

    rspec ./spec/features/surveys_spec.rb:37 # Survey as an attendee respond to a survey during registration
2022-03-16 14:12:01 -07:00
Andrew Kvalheim
c052516009 Grant conference organizers permission to manage surveys
Resolves:

    Failures:

      1) Survey as an organizer create a survey
         Failure/Error: click_link 'New'

         Capybara::ElementNotFound:
           Unable to find link "New"
         # ./spec/features/surveys_spec.rb:18:in `block (3 levels) in <top (required)>'

    Failed examples:

    rspec ./spec/features/surveys_spec.rb:15 # Survey as an organizer create a survey
2022-03-16 13:37:00 -07:00
Henne Vogelsang
5c7c75b53c
Merge pull request #2962 from AndrewKvalheim/countries-4.2
Update venue country name for Countries 4.2
2022-03-08 13:21:45 +01:00
Andrew Kvalheim
e2bc6fc1c7 Fix bug in which role assignments aren’t tracked in version history
Resolves failing test `spec/features/versions_spec.rb:344`:

    1) Version display changes in users_role for conference role
       Failure/Error: expect(page).to have_text("added role cfp with ID #{user_role.id} to user #{user.name} in conference #{conference.short_title}")
         expected to find text "added role cfp with ID 2 to user name2 in conference fr_GAQ" in "OSEM\nname1\nAll Conferences\nOrganizations\nRevision History\nAll Conferences\nRevision History\nLog of changes made to conferences and associated resources\nShow\n10\n25\n50\n100\nAll\nentries\nSearch:\nID Description Actions\n18\nname2 signed up less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n17\nSomeone (probably via the console) updated is admin of user name1 less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n16\nname1 signed up less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n15\nSomeone (probably via the console) created new cfp for events in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n14\nSomeone (probably via the console) created new role volunteers_coordinator in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n13\nSomeone (probably via the console) created new role info_desk in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n12\nSomeone (probably via the console) created new role cfp in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n11\nSomeone (probably via the console) created new role organizer in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n10\nSomeone (probably via the console) created new difficulty level Hard in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n9\nSomeone (probably via the console) created new difficulty level Medium in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\nShowing 1 to 10 of 16 entries\nFirst\nPrevious\n1\n2\nNext\nLast\nThis tool is free software, released under the MIT license. You can run, copy, distribute, study, change and improve it. The source code and the developers are on GitHub."
       # ./spec/features/versions_spec.rb:350:in `block (2 levels) in <top (required)>'
2022-03-06 23:38:42 -08:00
Andrew Kvalheim
a179609773 Update venue country name for Countries 4.2
Resolves:

    DEPRECATION WARNING: The Country#name method has been deprecated.
    Please use Country#iso_short_name instead or refer to the README
    file for more information on this change.

Details: https://github.com/countries/countries/blob/v4.2.2/README.markdown#upgrading-to-42-and-5x
2022-03-06 23:05:29 -08:00
Henne Vogelsang
85dae98a76
👋 update_attributes
You served us well...
2022-02-23 14:36:05 +01:00
Henne Vogelsang
5c5374252c
Fix HasManyThroughOrderErrors 2022-02-23 14:36:05 +01:00
Henne Vogelsang
9aee02ecb9
Include helper that provides number_with_precision 2021-08-18 15:36:54 +02:00
Stella Rouzi
ee5274b352 Fix JS error when saving survey_question 2021-03-07 07:32:52 +02:00
Espartaco Palma
fd2635509f
Introducing delegation for city and country name (Conference - Venue
Using ActiveSupport delegate macro.
2021-03-06 19:06:36 +01:00
James Mason
7a04f3582f
Remove travel schedule from registration
(cherry picked from commit d18cc02f0185df39bb4213d8a63a955dfb433dcb)
Re: https://github.com/openSUSE/osem/issues/2333
2021-03-06 04:09:02 +01:00
Tymm Schmitke
aa99f909a6 Add uniqueness tests for Event scope on Vote model with User association 2020-05-19 22:24:37 -04:00
Henne Vogelsang
1ce66a55bc
Merge pull request #2596 from snpd25/branch1
Supports talks without speakers
2019-10-31 12:52:20 +01:00
Stella Rouzi
8cf9c15a46 Revert change of active user definition
Closes #2560

Active users are needed for selectize, and the active definition changed to show recent users in #2297

This reverts that change, and provides
* active scope (user not disabled)
* recent scope (for use in #2297 changes, ie user distribution)
2019-10-24 18:34:12 +03:00
snpd
997dc668e0 Supports talks without speakers
Admins may want to have discussions or any other general activity
that does not have any particular speaker. Thus, speaker validation
is removed.

Closes https://github.com/openSUSE/osem/issues/2520
2019-10-23 14:50:28 +05:30
Henne Vogelsang
c5ad9525ed
Merge pull request #2551 from esparta/using_polimorfic_for_not_signed_abilities
Improve overall performance on not_signed abilities
2019-07-17 16:20:02 +02:00
Espartaco Palma
6421916784
Avoid the use of :pluck on not_signed abilities
When using :pluck, ActiveRecord trigger the query immediately.
The above is a behavior we probably want to avoid, because
implies a query to the database regarless of the role or
permission.

** Before

    osem_1      | 07:39:11 web.1    | Started GET "/" for 172.20.0.1 at 2019-07-1207:39:11 +0000
    osem_1      | 07:39:11 web.1    |    (0.3ms)  SELECT
    "conferences"."custom_domain" FROM "conferences" WHERE
     ("conferences"."custom_domain" IS NOT NULL) ORDER BY start_date DESC
    osem_1      | 07:39:11 web.1    | Processing by ConferencesController#index as HTML
    osem_1      | 07:39:11 web.1    |    (1.3ms)  SELECT "events"."id" FROM
    "events" WHERE "events"."state" = $ 1  [["state", "confirmed"]]
    osem_1      | 07:39:11 web.1    |   ↳ app/models/ability.rb:39:in `not_signed_in'
    osem_1      | 07:39:11 web.1    |   Rendering layouts/application.html.haml
    osem_1      | 07:39:11 web.1    |   Rendering conferences/index.html.haml within layouts/application

** After

    osem_1      | 07:43:18 web.1    | Started GET "/" for 172.20.0.1 at 2019-07-1207:43:18 +0000
    osem_1      | 07:43:19 web.1    |    (0.2ms)  SELECT
    "conferences"."custom_domain" FROM "conferences" WHERE
     ("conferences"."custom_domain" IS NOT NULL) ORDER BY start_date DESC
    osem_1      | 07:43:19 web.1    | Processing by ConferencesController#index as HTML
    osem_1      | 07:43:19 web.1    |   Rendering layouts/application.html.haml
    osem_1      | 07:43:19 web.1    |   Rendering conferences/index.html.haml  within layouts/application
2019-07-16 22:24:20 -07:00
Ana María Martínez Gómez
014ff1acc3
Use new changed? Rails method
`attribute_changed?` inside of after callbacks has changed his
behaviour. The new return value will reflect the behavior of calling the
method after `save` returned. To maintain the current behavior, I have
`saved_change_to_attribute?` instead.
2019-07-17 00:13:24 +02:00
Ana María Martínez Gómez
085e33f495
Use url instead object in image_tag
Before Rails 5.2, it was possible to pass an uploader object to
`image_tag` and Rails guessed the url. With Rails 5.2 this is not
possible anymore.
2019-07-17 00:13:24 +02:00
Ana María Martínez Gómez
af1d5e4a3b
Do no use string in if conditional
Passing string to be evaluated in :if and :unless conditional options is
not supported. Pass a symbol for an instance method, or a lambda, proc
or block, instead.
2019-07-17 00:13:24 +02:00
Ana María Martínez Gómez
47ce659a2f
Merge pull request #2374 from openSUSE/depfu/update/shoulda-matchers-4.0.1
Update shoulda-matchers: 3.1.2 → 4.0.1 (major)
2019-06-03 09:23:52 +02:00
Henne Vogelsang
e6049adc52
Fix gigitty link
The modal didn't really work on mobiles. On mobiles you also need the schedule
link because it's hard to point your mobile to a QR code on your mobile...
2019-05-24 15:19:37 +02:00
Ana María Martínez Gómez
7473e889ee
Define ticket_purchases before through association
In the User model, a has_many :through association
'User#physical_tickets' which goes through 'User#ticket_purchases' was
defined before the through association was defined. This doesn't work in
Rails 5.1.
2019-05-05 09:40:50 +02:00
Ana María Martínez Gómez
a8d2f8caa4
Drop halt_callback_chains_on_return_false
ActiveSupport.halt_callback_chains_on_return_false= is deprecated and
will be removed in Rails 5.2. Stop using it and return `throw(:abort)`
instead in the callbacks which need it.
2019-05-05 09:40:49 +02:00
Ana María Martínez Gómez
b3716985f0
Stop using reload argument in associations
Deprecated force reload argument in association readers is deprecated
and has been removed in Rails 5.1:

09cac8c67a
2019-05-05 09:40:09 +02:00
Ana María Martínez Gómez
ca574ae2af
Fix failing validation in Registration
In the conference is not set, validation that the call for paper is
accepted breaks. This made the conference association test failing.
2019-03-27 10:22:07 +01:00
ibrahimelbanna
dc77795f95 Adding time zone validation to conference model 2019-03-17 00:03:42 +02:00
Henne Vogelsang
455fc0a270
Make it possible to view Surveys in ichain mode
This is not ichain specific.
2019-03-08 14:39:39 +01:00
Henne Vogelsang
1a1da83bf2
Document the ichain specific ability 2019-03-08 14:39:39 +01:00
Henne Vogelsang
b57c771d3e
Allow viewing the schedule/events in ichain mode
This abilit is not specific to one mode.
2019-03-08 14:39:39 +01:00
Henne Vogelsang
bec13df131 Adopt more specs to the shoulda-matchers update 2019-02-19 20:50:09 +01:00
James Mason
072116fffe Enable registration to proceed without requiring a ticket.
Requiring a ticket after registration is convoluted; while it may be neccesary
for some workflows, it definitely isn't for others, and the core of osem
doesn't need it... so let's make it optional.
2019-02-16 00:53:40 +01:00
Henne Vogelsang
a4d7a1a771 Change initial state to new
The initial state needs to be one that is part of the machine.
See the transition README.md
2019-02-15 17:09:03 +01:00
Henne Vogelsang
334f84179f Use deliver_later in devise
Do not send devise mails directly in the request but through the
delayed jobs.
2019-02-01 01:00:56 +01:00
Henne Vogelsang
0f5181ccf4 Introduces New Installation Page
If there are no users signed up and no conferences we show a page
informing people what they need to do.
2019-02-01 01:00:56 +01:00
James Mason
516e53d9df Use chartkick globally
* Clean up legacy charting imports
* Update existing donut and line charts
* Create helpers for parsing out existing chart data
* Move chart partials to a more common path
2018-12-30 16:57:22 -08:00
James Mason
43bef689fc Rubocop autocorrections 2018-11-16 09:06:05 -08:00
James Mason
b11001cdba Every campaign has an end.
Drop ahoy, because it's more trouble than it's worth. This means dropping
visits, campaigns, targets.

Campaigns are better run to analytics, such as:
* https://matomo.org/docs/tracking-campaigns/
* https://matomo.org/docs/tracking-goals-web-analytics/
* https://support.google.com/analytics/answer/1012040?hl=en
2018-10-16 21:34:04 +02:00
Henne Vogelsang
fb2612ecaf Simplify set_week callbacks
Changes to :week are already ignored py paper_trail. No need to wrap this in a
`without_versioning`. Also drop the reader in `Registration` and the tests. Why
write this into the DB but never read it again? Why test standard
ruby/activerecord stuff.
2018-09-04 21:12:46 +02:00
James Mason
64ceaf50f4 Update Admin user datatables to use AJAX 2018-08-30 16:50:42 +02:00
Stella Rouzi
9908f88570 Add survey with target after_event 2018-07-03 08:46:15 +03:00
Stella Rouzi
683f62a27c Add more options for surveys
* Survey period constraints
* Add abilities
* Enforce required questions
* Update survey_submssion updated_at
* Do a full match of possible answer and user reply
2018-07-03 08:46:15 +03:00
Stella Rouzi
c278e547ce Add survey related tests 2018-07-03 08:46:15 +03:00
Stella Rouzi
9f3c0eff5d Add surveys; custom generated by admins
Available during registration or after conference

Co-authored-by: Shyukri <shshyukriev@suse.com>
Co-authored-by: Henne <hvogel@opensuse.org>
Co-authored-by: Moises <mdeniz@suse.com>
2018-07-03 08:46:15 +03:00
Stella Rouzi
3bb73f27cf Fix ahoy tracking and visits 2018-07-02 09:42:40 -06:00
James Mason
24396d35c2 Use Ruby safe navigation over Rails try
re: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/SafeNavigation
2018-06-01 09:15:57 -07:00
Stella Rouzi
d01d15ba5e Update paper_trail, show ticket price with currency in versions 2018-06-01 09:05:21 -07:00
Zach Kemp
3f2f35283c improve template readability 2018-05-09 10:07:08 -07:00
Zach Kemp
7d5d935a65 optimize queries 2018-05-09 10:07:08 -07:00
James Mason
6d31dfeef4 Add frozen_string_literal magic comment
re: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FrozenStringLiteralComment
2018-05-09 06:54:26 -07:00