Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous Release 1.6.0 #511

Merged
merged 30 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fcdcd45
make some changes regarding what rights media editors have
fosterfarrell9 Apr 10, 2023
a0befa0
fix typos
fosterfarrell9 Apr 10, 2023
5e11404
restrict access for editors of old lectures
fosterfarrell9 Apr 23, 2023
ff7ca56
Merge branch 'mampf-next' into restrict_editor_access
Splines Apr 28, 2023
ace66cb
make some changes suggested by referee
fosterfarrell9 Apr 28, 2023
9fefc79
make changes to meet referee requests
fosterfarrell9 May 5, 2023
b119ec9
Merge pull request #492 from MaMpf-HD/main
Splines May 6, 2023
1fda243
improve comments on editor methods
fosterfarrell9 May 6, 2023
fa08f8c
merge mampf-next and fix conflict
fosterfarrell9 May 6, 2023
f4baf2b
restore missing view
fosterfarrell9 May 6, 2023
6e28d5d
Fix stale? method not found
Splines May 6, 2023
7f751a2
restrict routes for stale editors
fosterfarrell9 May 7, 2023
3275eb2
Merge branch 'restrict_editor_access' of https://github.com/MaMpf-HD/…
fosterfarrell9 May 7, 2023
4abf4bd
fix broken create lecture action
fosterfarrell9 May 7, 2023
d00d5af
Update rubocop version (#494)
Splines May 11, 2023
5f7c956
Enforce rubocop layout rules (#495)
Splines May 11, 2023
1982f28
Fix scope of .new-comment CSS class (#499)
Splines May 11, 2023
202635f
merge mampf-next and fix merge conflict
fosterfarrell9 May 11, 2023
3fc077f
Fix ghost links in nested tabs (#500)
Splines May 15, 2023
6ecf8a4
Merge pull request #452 from MaMpf-HD/restrict_editor_access
fosterfarrell9 May 15, 2023
38a4812
refactor user controller and views
fosterfarrell9 May 15, 2023
eb7e7b4
restore previous behaviour of media search
fosterfarrell9 May 15, 2023
765c2f7
enforce rubocop rules
fosterfarrell9 May 15, 2023
5fce924
make count faster
fosterfarrell9 May 15, 2023
1c7e0d1
Fix flickering for quiz previews (#502)
Splines May 15, 2023
4ad473f
enforce rubocop recommendation
fosterfarrell9 May 15, 2023
c083e5f
Merge pull request #505 from MaMpf-HD/refactor/admin-user-views
fosterfarrell9 May 16, 2023
cb40501
add linebreak in if statement
fosterfarrell9 May 17, 2023
3774442
Merge pull request #506 from MaMpf-HD/fix/restore-media-search-behaviour
fosterfarrell9 May 17, 2023
cb46762
Use default version of commontator gem instead of own fork (#509)
fosterfarrell9 May 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ Style/RedundantFreeze:
Style/SymbolProc:
Enabled: true

Style/SymbolArray:
Enabled: false

# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true
Expand Down Expand Up @@ -321,4 +324,18 @@ Performance/DeletePrefix:
Enabled: true

Performance/DeleteSuffix:
Enabled: true
Enabled: true

Metrics/ModuleLength:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/MethodLength:
Exclude:
- 'app/abilities/**/*'

Metrics/AbcSize:
Exclude:
- 'app/abilities/**/*'
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ gem "sidekiq-cron", "~> 1.1"
gem "faraday", "~> 1.8"
gem "globalize"
gem "globalize-accessors"
gem "commontator",
git: "https://github.com/MaMpf-HD/commontator.git",
branch: "main"
gem "commontator"
gem "acts_as_votable"
gem "sprockets-rails",
git: "https://github.com/rails/sprockets-rails",
Expand All @@ -120,7 +118,7 @@ group :development, :docker_development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "rubocop", "~> 0.93", require: false
gem "rubocop", "~> 1.50", require: false
gem "rubocop-packaging", require: false
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
Expand Down
38 changes: 17 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
GIT
remote: https://github.com/MaMpf-HD/commontator.git
revision: 38b25d2f3f4e4e2d1a0a7b608f04c579a93125f9
branch: main
specs:
commontator (7.0.0)
rails (>= 6.0)
sprockets-rails
will_paginate

GIT
remote: https://github.com/rails/sprockets-rails
revision: 73e7351abff3506f6dca6b2da8abedfd5c7c0d77
Expand Down Expand Up @@ -174,6 +164,10 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
commontator (7.0.0)
rails (>= 6.0)
sprockets-rails
will_paginate
concurrent-ruby (1.2.2)
connection_pool (2.4.0)
content_disposition (1.0.0)
Expand Down Expand Up @@ -304,6 +298,7 @@ GEM
js-routes (1.4.9)
railties (>= 4)
sprockets-rails
json (2.6.3)
jsonapi-renderer (0.2.2)
kaminari (1.2.2)
activesupport (>= 4.1.0)
Expand Down Expand Up @@ -377,7 +372,7 @@ GEM
options (2.3.2)
orm_adapter (0.5.0)
pairing_heap (3.0.0)
parallel (1.22.1)
parallel (1.23.0)
parser (3.2.2.0)
ast (~> 2.4.1)
pdf-reader (2.11.0)
Expand Down Expand Up @@ -458,7 +453,7 @@ GEM
ffi (~> 1.0)
redis-client (0.14.1)
connection_pool
regexp_parser (2.7.0)
regexp_parser (2.8.0)
request_store (1.5.1)
rack (>= 1.4)
responders (3.1.0)
Expand Down Expand Up @@ -499,15 +494,16 @@ GEM
rspec-mocks (~> 3.11)
rspec-support (~> 3.11)
rspec-support (3.12.0)
rubocop (0.93.1)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
parser (>= 3.2.1.0)
rubocop-packaging (0.5.1)
Expand Down Expand Up @@ -629,7 +625,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
unicode-display_width (2.4.2)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.0)
Expand Down Expand Up @@ -672,7 +668,7 @@ DEPENDENCIES
cancancan
clipboard-rails
coffee-rails (~> 5.0.0)
commontator!
commontator
coveralls
cypress-on-rails (~> 1.0)
dalli (>= 2.7)
Expand Down Expand Up @@ -718,7 +714,7 @@ DEPENDENCIES
rgl
rqrcode
rspec-rails
rubocop (~> 0.93)
rubocop (~> 1.50)
rubocop-packaging
rubocop-performance
rubocop-rails
Expand Down
2 changes: 1 addition & 1 deletion app/abilities/administration_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
user.admin?
end
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/announcement_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(user)

can :create, Announcement do |announcement|
user.admin? ||
(announcement.lecture.present? && user.can_edit?(announcement.lecture))
(announcement.lecture.present? && user.can_edit?(announcement.lecture))
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/answer_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def initialize(user)

can :update_answer_box, Answer
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/assignment_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def initialize(user)
assignment.lecture.present? && user.can_edit?(assignment.lecture)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/chapter_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def initialize(user)
chapter.lecture.present? && user.can_edit?(chapter.lecture)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/course_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def initialize(user)
!user.generic? || course.subscribed_by?(user)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/division_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/erdbeere_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
!user.generic?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/interaction_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/item_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ def initialize(user)

can [:create, :update, :edit, :destroy], Item do |item|
(item.medium.nil? && !user.generic?) ||
(item.medium && user.can_edit?(item.medium))
(item.medium && user.can_edit?(item.medium))
end

can :display, Item
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/lecture_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialize(user)
end

can :subscribe_page, Lecture do |lecture|
lecture.published? || !user.generic?
lecture.published? || user.active_teachable_editor?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/lesson_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
user.can_edit?(lesson)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/main_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ class MainAbility
def initialize(user)
can :start, :main
end
end
end
8 changes: 4 additions & 4 deletions app/abilities/medium_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def initialize(user)
can [:index, :new, :search], Medium

can [:show, :show_comments], Medium do |medium|
medium.visible_for_user?(user) &&
!(medium.sort.in?(['Question', 'Remark']) && !user.can_edit?(medium))
medium.visible_for_user?(user) &&
!(medium.sort.in?(['Question', 'Remark']) && !user.can_edit?(medium))
end

can :inspect, Medium do |medium|
Expand Down Expand Up @@ -39,7 +39,7 @@ def initialize(user)
# guest users can play/display media when their release status 'all'
can [:play, :display, :geogebra], Medium do |medium|
(!user.new_record? && medium.visible_for_user?(user)) ||
medium.free?
medium.free?
end

can :update_tags, Medium do |medium|
Expand All @@ -50,4 +50,4 @@ def initialize(user)
!user.new_record?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/notification_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def initialize(user)
notification.recipient == user
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/profile_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
:toggle_thread_subscription, :subscribe_lecture, :unsubscribe_lecture,
:star_lecture, :unstar_lecture, :show_accordion, :request_data], :profile
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/program_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/question_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def initialize(user)
user.can_edit?(question)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/quiz_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def initialize(user)
quiz && user.can_edit?(quiz.becomes(Medium))
end
end
end
end
4 changes: 2 additions & 2 deletions app/abilities/quiz_certificate_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(user)
can :claim, QuizCertificate

can :validate, QuizCertificate do
user.tutor? || !user.generic?
user.tutor? || user.can_edit_teachables?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/referral_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def initialize(user)
!user.generic? || user.media_editor?
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/remark_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.can_edit?(remark)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/search_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def initialize(user)

can :index, :search
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/section_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def initialize(user)
user.can_edit?(section.lecture)
end
end
end
end
2 changes: 1 addition & 1 deletion app/abilities/subject_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def initialize(user)
user.admin?
end
end
end
end
6 changes: 3 additions & 3 deletions app/abilities/submission_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def initialize(user)
end

can [:show_manuscript, :show_correction], Submission do |submission|
user.in?(submission.users) || user.in?(submission.tutorial.tutors) ||
user.in?(submission.tutorial.lecture.editors) ||
user == submission.tutorial.lecture.teacher
user.in?(submission.users) || user.in?(submission.tutorial.tutors) ||
user.in?(submission.tutorial.lecture.editors) ||
user == submission.tutorial.lecture.teacher
end
end
end
1 change: 0 additions & 1 deletion app/abilities/tag_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ def initialize(user)
end
end
end

2 changes: 1 addition & 1 deletion app/abilities/term_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def initialize(user)
user.admin?
end
end
end
end
Loading
Loading