Commit 98daab5b authored by Bryce Johnson's avatar Bryce Johnson

Remove approval_pending, use approved?

parent b317ba8a
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('merge_request_widget/widget_bundle.js')
- approval_pending = @merge_request.requires_approve? && !@merge_request.approved?
#merge-request-widget-app.mr-state-widget{ 'data-endpoint'=> merge_request_path(@merge_request), 'data-approval-pending' => approval_pending }
#merge-request-widget-app.mr-state-widget{ 'data-endpoint'=> merge_request_path(@merge_request), 'data-approval-pending' => !@merge_request.approved? ? 'true': 'false' }
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
-# After conflicts are resolved, the user is redirected back to the MR page.
......
......@@ -2,7 +2,6 @@
= page_specific_javascript_tag('merge_request_widget/ci_bundle.js')
- status_class = @pipeline ? " ci-#{@pipeline.status}" : nil
- approval_pending = @merge_request.requires_approve? && !@merge_request.approved?
= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-quick-submit js-requires-input' } do |f|
= hidden_field_tag :authenticity_token, form_authenticity_token
......@@ -12,10 +11,10 @@
.accept-action
- if @pipeline && @pipeline.active?
%span.btn-group
= button_tag class: "btn btn-create js-merge-button merge_when_build_succeeds", disabled: approval_pending, ":disabled" => "disableAcceptance" do
= button_tag class: "btn btn-create js-merge-button merge_when_build_succeeds", disabled: !merge_request.approved?, ":disabled" => "disableAcceptance" do
Merge When Pipeline Succeeds
- unless @project.only_allow_merge_if_build_succeeds?
= button_tag class: "btn btn-success dropdown-toggle", 'data-toggle' => 'dropdown', disabled: approval_pending, ":disabled" => "disableAcceptance" do
= button_tag class: "btn btn-success dropdown-toggle", 'data-toggle' => 'dropdown', disabled: !merge_request.approved?, ":disabled" => "disableAcceptance" do
= icon('caret-down')
%span.sr-only
Select Merge Moment
......@@ -29,7 +28,7 @@
= icon('warning fw')
Merge Immediately
- else
= f.button class: "btn btn-create btn-grouped js-merge-button accept_merge_request #{status_class}", disabled: approval_pending, ":disabled" => "disableAcceptance" do
= f.button class: "btn btn-create btn-grouped js-merge-button accept_merge_request #{status_class}", disabled: !merge_request.approved?, ":disabled" => "disableAcceptance" do
Accept Merge Request
- if @merge_request.force_remove_source_branch?
.accept-control
......
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('merge_request_widget/ci_bundle.js')
- approval_pending = @merge_request.requires_approve? && !@merge_request.approved?
- if @merge_request.rebase_in_progress? || (defined?(rebase_in_progress) && rebase_in_progress)
%h4.rebase-in-progress
= icon("spinner spin")
......@@ -23,7 +21,7 @@
= hidden_field_tag :authenticity_token, form_authenticity_token
.accept-merge-holder.clearfix.js-toggle-container
.accept-action
= f.button class: "btn btn-reopen js-rebase-button", disabled: approval_pending, ":disabled" => "disableAcceptance" do
= f.button class: "btn btn-reopen js-rebase-button", disabled: !merge_request.approved?, ":disabled" => "disableAcceptance" do
Rebase onto #{@merge_request.target_branch}
.accept-control
Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment