Commit d6598845 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Merge branch 'dz-issue-css-classes' into 'master'

Rename some css classes that are shared between issues and mrs

See merge request gitlab-org/gitlab-ce!21856
parents a4a7c531 ead82fc8
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}, },
getSelectedIssues() { getSelectedIssues() {
return this.issues.has('.selected_issue:checked'); return this.issues.has('.selected-issuable:checked');
}, },
getLabelsFromSelection() { getLabelsFromSelection() {
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
getOriginalCommonIds() { getOriginalCommonIds() {
const labelIds = []; const labelIds = [];
this.getElement('.selected_issue:checked').each((i, el) => { this.getElement('.selected-issuable:checked').each((i, el) => {
labelIds.push(this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels')); labelIds.push(this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels'));
}); });
return _.intersection.apply(this, labelIds); return _.intersection.apply(this, labelIds);
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
// From issuable's initial bulk selection // From issuable's initial bulk selection
getOriginalMarkedIds() { getOriginalMarkedIds() {
const labelIds = []; const labelIds = [];
this.getElement('.selected_issue:checked').each((i, el) => { this.getElement('.selected-issuable:checked').each((i, el) => {
labelIds.push(this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels')); labelIds.push(this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels'));
}); });
return _.intersection.apply(this, labelIds); return _.intersection.apply(this, labelIds);
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
let issuableLabels = []; let issuableLabels = [];
// Collect unique label IDs for all checked issues // Collect unique label IDs for all checked issues
this.getElement('.selected_issue:checked').each((i, el) => { this.getElement('.selected-issuable:checked').each((i, el) => {
issuableLabels = this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels'); issuableLabels = this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels');
issuableLabels.forEach((labelId) => { issuableLabels.forEach((labelId) => {
// Store unique IDs // Store unique IDs
......
...@@ -30,7 +30,7 @@ export default class IssuableBulkUpdateSidebar { ...@@ -30,7 +30,7 @@ export default class IssuableBulkUpdateSidebar {
this.$otherFilters = $('.issues-other-filters'); this.$otherFilters = $('.issues-other-filters');
this.$checkAllContainer = $('.check-all-holder'); this.$checkAllContainer = $('.check-all-holder');
this.$issueChecks = $('.issue-check'); this.$issueChecks = $('.issue-check');
this.$issuesList = $('.selected_issue'); this.$issuesList = $('.selected-issuable');
this.$issuableIdsInput = $('#update_issuable_ids'); this.$issuableIdsInput = $('#update_issuable_ids');
} }
...@@ -55,7 +55,7 @@ export default class IssuableBulkUpdateSidebar { ...@@ -55,7 +55,7 @@ export default class IssuableBulkUpdateSidebar {
} }
updateFormState() { updateFormState() {
const noCheckedIssues = !$('.selected_issue:checked').length; const noCheckedIssues = !$('.selected-issuable:checked').length;
this.toggleSubmitButtonDisabled(noCheckedIssues); this.toggleSubmitButtonDisabled(noCheckedIssues);
this.updateSelectedIssuableIds(); this.updateSelectedIssuableIds();
...@@ -123,7 +123,7 @@ export default class IssuableBulkUpdateSidebar { ...@@ -123,7 +123,7 @@ export default class IssuableBulkUpdateSidebar {
} }
static getCheckedIssueIds() { static getCheckedIssueIds() {
const $checkedIssues = $('.selected_issue:checked'); const $checkedIssues = $('.selected-issuable:checked');
if ($checkedIssues.length > 0) { if ($checkedIssues.length > 0) {
return $.map($checkedIssues, value => $(value).data('id')); return $.map($checkedIssues, value => $(value).data('id'));
......
...@@ -449,11 +449,11 @@ export default class LabelsSelect { ...@@ -449,11 +449,11 @@ export default class LabelsSelect {
} }
bindEvents() { bindEvents() {
return $('body').on('change', '.selected_issue', this.onSelectCheckboxIssue); return $('body').on('change', '.selected-issuable', this.onSelectCheckboxIssue);
} }
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
onSelectCheckboxIssue() { onSelectCheckboxIssue() {
if ($('.selected_issue:checked').length) { if ($('.selected-issuable:checked').length) {
return; return;
} }
return $('.issues-bulk-update .labels-filter .dropdown-toggle-text').text('Label'); return $('.issues-bulk-update .labels-filter .dropdown-toggle-text').text('Label');
......
...@@ -726,13 +726,13 @@ ...@@ -726,13 +726,13 @@
display: flex; display: flex;
} }
.issue-info-container { .issuable-info-container {
-webkit-flex: 1; -webkit-flex: 1;
flex: 1; flex: 1;
display: flex; display: flex;
padding-right: $gl-padding; padding-right: $gl-padding;
.issue-main-info { .issuable-main-info {
flex: 1 auto; flex: 1 auto;
margin-right: 10px; margin-right: 10px;
} }
...@@ -768,7 +768,7 @@ ...@@ -768,7 +768,7 @@
margin-bottom: 10px; margin-bottom: 10px;
min-width: 15px; min-width: 15px;
.selected_issue { .selected-issuable {
vertical-align: text-top; vertical-align: text-top;
} }
} }
...@@ -800,7 +800,7 @@ ...@@ -800,7 +800,7 @@
} }
.issuable-list li, .issuable-list li,
.issue-info-container .controls { .issuable-info-container .controls {
.avatar-counter { .avatar-counter {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
......
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
.issue-info-container { .issuable-info-container {
-webkit-flex: 1; -webkit-flex: 1;
flex: 1; flex: 1;
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
.issue-box .issue-box
- if @can_bulk_update - if @can_bulk_update
.issue-check.hidden .issue-check.hidden
= check_box_tag dom_id(issue, "selected"), nil, false, 'data-id' => issue.id, class: "selected_issue" = check_box_tag dom_id(issue, "selected"), nil, false, 'data-id' => issue.id, class: "selected-issuable"
.issue-info-container .issuable-info-container
.issue-main-info .issuable-main-info
.issue-title.title .issue-title.title
%span.issue-title-text %span.issue-title-text
- if issue.confidential? - if issue.confidential?
......
%li{ id: dom_id(merge_request), class: mr_css_classes(merge_request), data: { labels: merge_request.label_ids, id: merge_request.id } } %li{ id: dom_id(merge_request), class: mr_css_classes(merge_request), data: { labels: merge_request.label_ids, id: merge_request.id } }
- if @can_bulk_update - if @can_bulk_update
.issue-check.hidden .issue-check.hidden
= check_box_tag dom_id(merge_request, "selected"), nil, false, 'data-id' => merge_request.id, class: "selected_issue" = check_box_tag dom_id(merge_request, "selected"), nil, false, 'data-id' => merge_request.id, class: "selected-issuable"
.issue-info-container .issuable-info-container
.issue-main-info .issuable-main-info
.merge-request-title.title .merge-request-title.title
%span.merge-request-title-text %span.merge-request-title-text
= link_to merge_request.title, merge_request_path(merge_request) = link_to merge_request.title, merge_request_path(merge_request)
......
...@@ -265,7 +265,7 @@ describe 'Filter issues', :js do ...@@ -265,7 +265,7 @@ describe 'Filter issues', :js do
context 'issue label clicked' do context 'issue label clicked' do
it 'filters and displays in search bar' do it 'filters and displays in search bar' do
find('.issues-list .issue .issue-main-info .issuable-info a .badge', text: multiple_words_label.title).click find('.issues-list .issue .issuable-main-info .issuable-info a .badge', text: multiple_words_label.title).click
expect_issues_list_count(1) expect_issues_list_count(1)
expect_tokens([label_token("\"#{multiple_words_label.title}\"")]) expect_tokens([label_token("\"#{multiple_words_label.title}\"")])
......
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