Commit 2a4572ab authored by Coung Ngo's avatar Coung Ngo Committed by Olena Horal-Koretska

Replace and remove CSS and remove helper methods

The issue header was converted from Haml to Vue and as part
of removing the associated `vue_issue_header` feature flag,
lots of unused code was removed. This is the last commit to
remove unused issue header code, and includes some CSS
refactorings to remove even more CSS.

https://gitlab.com/gitlab-org/gitlab/-/issues/276444
parent bf96df52
......@@ -31,7 +31,7 @@ const SUBMIT_ACTION_TEXT = {
const SUBMIT_BUTTON_CLASS = {
create: 'btn-success',
update: 'btn-success',
delete: 'btn-remove',
delete: 'btn-danger',
};
export default {
......
......@@ -422,7 +422,7 @@ export default {
</button>
<button
v-if="discussion.resolvable"
class="btn btn-nr btn-default gl-mr-3 js-comment-resolve-button"
class="btn btn-default gl-mr-3 js-comment-resolve-button"
@click.prevent="handleUpdate(true)"
>
{{ resolveButtonTitle }}
......
......@@ -166,8 +166,7 @@
line-height: $gl-btn-xs-line-height;
}
&.btn-success,
&.btn-register {
&.btn-success {
@include btn-green;
}
......@@ -176,7 +175,6 @@
@include btn-outline($white, $green-600, $green-500, $green-100, $green-700, $green-500, $green-200, $green-600, $green-800);
}
&.btn-remove,
&.btn-danger {
@include btn-outline($white, $red-500, $red-500, $red-100, $red-700, $red-500, $red-200, $red-600, $red-800);
}
......@@ -204,13 +202,7 @@
@include btn-outline($white, $orange-500, $orange-500, $orange-50, $orange-600, $orange-600, $orange-100, $orange-700, $orange-700);
}
&.btn-spam {
@include btn-outline($white, $red-500, $red-500, $red-100, $red-700, $red-500, $red-200, $red-600, $red-800);
}
&.btn-danger,
&.btn-remove,
&.btn-red {
&.btn-danger {
@include btn-red;
}
......@@ -218,11 +210,6 @@
float: right;
}
&.btn-reopen,
.btn-reopen-color {
/* should be same as parent class for now */
}
&.btn-grouped {
@include btn-with-margin;
}
......
......@@ -36,14 +36,6 @@
}
}
.btn-remove {
width: 100%;
@include media-breakpoint-up(sm) {
width: auto;
}
}
&.existing-title {
@include media-breakpoint-up(sm) {
float: left;
......
......@@ -977,12 +977,12 @@ body.navless {
border-color: #e3e3e3;
color: #303030;
}
.btn.btn-success, .btn.btn-register {
.btn.btn-success {
background-color: #108548;
border-color: #217645;
color: #fff;
}
.btn.btn-success:active, .btn.btn-success.active, .btn.btn-register:active, .btn.btn-register.active {
.btn.btn-success:active, .btn.btn-success.active {
box-shadow: rgba(0, 0, 0, 0.16);
background-color: #24663b;
border-color: #0d532a;
......
......@@ -32,14 +32,6 @@ module IssuesHelper
end
end
def issue_button_visibility(issue, closed)
return 'hidden' if issue_button_hidden?(issue, closed)
end
def issue_button_hidden?(issue, closed)
issue.closed? == closed || (!closed && issue.discussion_locked)
end
def confidential_icon(issue)
sprite_icon('eye-slash', css_class: 'gl-vertical-align-text-bottom') if issue.confidential?
end
......
- page_title _("Labels")
%div
= link_to new_admin_label_path, class: "float-right btn gl-button btn-nr btn-success" do
= link_to new_admin_label_path, class: "float-right btn gl-button btn-success" do
= _('New label')
%h3.page-title
= _('Labels')
......
......@@ -3,11 +3,6 @@
- @gfm_form = true
- content_for :note_actions do
- if can?(current_user, :update_issue, @issue)
= link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "gl-button btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
= link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "gl-button btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'
%section.issuable-discussion.js-vue-notes-event
#js-vue-notes{ data: { notes_data: notes_data(@issue).to_json,
noteable_data: serialize_issuable(@issue, with_blocking_issues: true),
......
......@@ -30,4 +30,4 @@
- if partial_exists? "registrations/welcome/button"
= render "registrations/welcome/button"
- else
= f.submit _('Get started!'), class: 'btn-register gl-button btn btn-block gl-mb-0 gl-p-3', data: { qa_selector: 'get_started_button' }
= f.submit _('Get started!'), class: 'btn-success gl-button btn btn-block gl-mb-0 gl-p-3', data: { qa_selector: 'get_started_button' }
......@@ -28,7 +28,7 @@
- if milestone.active?
= link_to _('Close milestone'), update_milestone_path(milestone, { state_event: :close }), method: :put, class: 'btn gl-button btn-grouped btn-close'
- else
= link_to _('Reopen milestone'), update_milestone_path(milestone, { state_event: :activate }), method: :put, class: 'btn gl-button btn-grouped btn-reopen'
= link_to _('Reopen milestone'), update_milestone_path(milestone, { state_event: :activate }), method: :put, class: 'btn gl-button btn-grouped'
= render 'shared/milestones/delete_button'
......
......@@ -59,6 +59,6 @@
- if can?(current_user, :admin_milestone, milestone)
- if milestone.closed?
= link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn gl-button btn-sm btn-grouped btn-reopen"
= link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn gl-button btn-sm btn-grouped"
- else
= link_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: "btn gl-button btn-warning-secondary btn-sm btn-grouped btn-close"
- noteable_name = @note.noteable.human_class_name
.float-left.btn-group.gl-mr-3.droplab-dropdown.comment-type-dropdown.js-comment-type-dropdown
%input.btn.btn-nr.btn-success.js-comment-button.js-comment-submit-button{ type: 'submit', value: _('Comment'), data: { qa_selector: 'comment_button' } }
%input.btn.btn-success.js-comment-button.js-comment-submit-button{ type: 'submit', value: _('Comment'), data: { qa_selector: 'comment_button' } }
- if @note.can_be_discussion_note?
= button_tag type: 'button', class: 'btn btn-nr dropdown-toggle btn-success js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do
= button_tag type: 'button', class: 'btn dropdown-toggle btn-success js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do
= sprite_icon('chevron-down')
%ul#resolvable-comment-menu.dropdown-menu.dropdown-open-top{ data: { dropdown: true } }
......
......@@ -9,6 +9,6 @@
.note-form-actions.clearfix
.settings-message.note-edit-warning.js-finish-edit-warning
= _("Finish editing this message first!")
= submit_tag _('Save comment'), class: 'btn btn-nr btn-success js-comment-save-button', data: { qa_selector: 'save_comment_button' }
%button.btn.btn-nr.btn-cancel.note-edit-cancel{ type: 'button' }
= submit_tag _('Save comment'), class: 'btn btn-success js-comment-save-button', data: { qa_selector: 'save_comment_button' }
%button.btn.btn-cancel.note-edit-cancel{ type: 'button' }
= _("Cancel")
......@@ -38,7 +38,5 @@
.note-form-actions.clearfix
= render partial: 'shared/notes/comment_button'
= yield(:note_actions)
%a.btn.btn-cancel.js-close-discussion-note-form.hide{ role: "button", data: { cancel_text: _("Cancel") } }
= _('Cancel')
......@@ -164,7 +164,7 @@ export default {
<gl-link
v-if="deployBoardData.abort_url"
:href="deployBoardData.abort_url"
class="btn btn-red btn-inverted"
class="btn btn-danger btn-inverted"
data-method="post"
rel="nofollow"
>{{ __('Abort') }}</gl-link
......
......@@ -36,7 +36,7 @@
= render 'user_info'
.submit-container
= f.submit _("Sign out & Register"), class: "btn-register btn qa-new-user-register-button", data: { qa_selector: 'sign_out_and_register_button' }
= f.submit _("Sign out & Register"), class: "btn-success btn qa-new-user-register-button", data: { qa_selector: 'sign_out_and_register_button' }
- else
.submit-container
= f.submit _("Register"), class: "btn-register btn qa-new-user-register-button"
= f.submit _("Register"), class: "btn-success btn qa-new-user-register-button"
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