Commit 054a9421 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

Closes gitlab-ce#21968

See merge request gitlab-org/gitlab-ee!7450
parents 3c77a0b5 930d16e1
...@@ -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');
......
...@@ -738,13 +738,13 @@ ...@@ -738,13 +738,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;
min-width: 0; min-width: 0;
...@@ -781,7 +781,7 @@ ...@@ -781,7 +781,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;
} }
} }
...@@ -814,7 +814,7 @@ ...@@ -814,7 +814,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)
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
<template> <template>
<div <div
:class="{ :class="{
'issue-info-container': !canReorder, 'issuable-info-container': !canReorder,
'card-body': canReorder, 'card-body': canReorder,
}" }"
class="flex" class="flex"
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
<div <div
:class="{ :class="{
'issue-token': isCondensed, 'issue-token': isCondensed,
'flex-row issue-info-container': !isCondensed, 'flex-row issuable-info-container': !isCondensed,
}" }"
> >
<component <component
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
:is="computedLinkElementType" :is="computedLinkElementType"
:class="{ :class="{
'issue-token-link': isCondensed, 'issue-token-link': isCondensed,
'issue-main-info': !isCondensed, 'issuable-main-info': !isCondensed,
}" }"
:href="computedPath" :href="computedPath"
:title="issueTitle" :title="issueTitle"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
.flex-row { .flex-row {
display: flex; display: flex;
&.issue-info-container { &.issuable-info-container {
padding-right: 0; padding-right: 0;
} }
} }
......
...@@ -31,11 +31,11 @@ $token-spacing-bottom: 0.5em; ...@@ -31,11 +31,11 @@ $token-spacing-bottom: 0.5em;
opacity: 0; opacity: 0;
} }
li .issue-info-container { li .issuable-info-container {
padding-left: $gl-padding; padding-left: $gl-padding;
} }
a.issue-main-info:hover { a.issuable-main-info:hover {
text-decoration: none; text-decoration: none;
.issue-token-title-text { .issue-token-title-text {
......
%li %li
.issue-box .issue-box
.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
= link_to epic.title, epic_path(epic) = link_to epic.title, epic_path(epic)
......
...@@ -17,9 +17,9 @@ describe('issueItem', () => { ...@@ -17,9 +17,9 @@ describe('issueItem', () => {
vm = mountComponent(IssueItem, props); vm = mountComponent(IssueItem, props);
}); });
it('contains issue-info-container class when canReorder is false', () => { it('contains issuable-info-container class when canReorder is false', () => {
expect(vm.canReorder).toEqual(false); expect(vm.canReorder).toEqual(false);
expect(vm.$el.querySelector('.issue-info-container')).toBeNull(); expect(vm.$el.querySelector('.issuable-info-container')).toBeNull();
}); });
it('renders displayReference', () => { it('renders displayReference', () => {
......
...@@ -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