Skip to content

Commit

Permalink
Remove is_author variable from request_decision_component
Browse files Browse the repository at this point in the history
After moving out some of the authorization logic from
the view component the variable is not longer needed.
  • Loading branch information
krauselukas committed Mar 14, 2024
1 parent 285a60f commit f37741f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/api/app/components/request_decision_component.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
class RequestDecisionComponent < ApplicationComponent
def initialize(bs_request:, action:, is_target_maintainer:, is_author:)
def initialize(bs_request:, action:, is_target_maintainer:)
super

@bs_request = bs_request
@is_target_maintainer = is_target_maintainer
@action = action
@is_author = is_author
end

def render?
Expand Down
1 change: 0 additions & 1 deletion src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ def handle_notification
end

def prepare_request_data
@is_author = @bs_request.creator == User.possibly_nobody.login
@is_target_maintainer = @bs_request.is_target_maintainer?(User.session)
@my_open_reviews = ReviewsFinder.new(@bs_request.reviews).open_reviews_for_user(User.session).reject(&:staging_project?)

Expand Down
4 changes: 1 addition & 3 deletions src/api/app/views/webui/request/beta_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@
setInterval(updateChartBuildResults, 60000);

= render AccordionReviewsComponent.new(@request_reviews, @bs_request)
= render RequestDecisionComponent.new(bs_request: @bs_request, action: @action,
is_target_maintainer: @is_target_maintainer,
is_author: @is_author)
= render RequestDecisionComponent.new(bs_request: @bs_request, action: @action, is_target_maintainer: @is_target_maintainer)
= render DeleteConfirmationDialogComponent.new(modal_id: 'delete-comment-modal',
method: :delete,
options: { modal_title: 'Delete comment?', remote: true })
Expand Down

0 comments on commit f37741f

Please sign in to comment.