Commit 94a72ecf authored by Clement Ho's avatar Clement Ho

[skip ci] Convert previous .card to .board-card

parent ef05eda4
......@@ -77,7 +77,7 @@ export default {
<template>
<li
class="card"
class="board-card"
:class="{
'user-can-drag': !disabled && issue.id,
'is-disabled': disabled || !issue.id,
......
......@@ -92,7 +92,7 @@ export default {
<template>
<div class="board-new-issue-form">
<div class="card">
<div class="board-card">
<form @submit="submit($event)">
<div
class="flash-container"
......
......@@ -135,8 +135,8 @@ gl.issueBoards.IssueCardInner = Vue.extend({
},
template: `
<div>
<div class="card-header">
<h4 class="card-title">
<div class="board-card-header">
<h4 class="board-card-title">
<i
class="fa fa-eye-slash confidential-icon"
v-if="issue.confidential"
......@@ -147,13 +147,13 @@ gl.issueBoards.IssueCardInner = Vue.extend({
:href="issue.path"
:title="issue.title">{{ issue.title }}</a>
<span
class="card-number"
class="board-card-number"
v-if="issueId"
>
{{ issue.referencePath }}
</span>
</h4>
<div class="card-assignee">
<div class="board-card-assignee">
<user-avatar-link
v-for="(assignee, index) in issue.assignees"
:key="assignee.id"
......@@ -175,7 +175,7 @@ gl.issueBoards.IssueCardInner = Vue.extend({
</div>
</div>
<div
class="card-footer"
class="board-card-footer"
v-if="showLabelFooter"
>
<button
......
......@@ -15,7 +15,7 @@ body {
background-color: $white-light !important;
}
&.card-content {
&.board-card-content {
background-color: $gray-darker;
.content-wrapper {
......
......@@ -276,7 +276,7 @@
font-size: (26px / $issue-boards-font-size) * 1em;
}
.card {
.board-card {
position: relative;
padding: 11px 10px 11px $gl-padding;
background: $white-light;
......@@ -289,7 +289,7 @@
}
&.is-active,
&.is-active .card-assignee:hover a {
&.is-active .board-card-assignee:hover a {
background-color: $row-hover;
&:first-child:not(:only-child) {
......@@ -309,7 +309,7 @@
}
}
.card-title {
.board-card-title {
margin: 0 30px 0 0;
font-size: 1em;
line-height: inherit;
......@@ -321,11 +321,11 @@
}
}
.card-header {
.board-card-header {
display: flex;
min-height: 20px;
.card-assignee {
.board-card-assignee {
display: flex;
justify-content: flex-end;
position: absolute;
......@@ -396,7 +396,7 @@
}
}
.card-footer {
.board-card-footer {
margin: 0 0 5px;
.badge {
......@@ -405,7 +405,7 @@
}
}
.card-number {
.board-card-number {
font-size: 12px;
color: $gl-text-color-secondary;
}
......@@ -581,11 +581,11 @@
margin-right: -$gl-vert-padding;
overflow-y: scroll;
.card-parent {
.board-card-parent {
padding: 0 5px 5px;
}
.card {
.board-card {
border: 1px solid $border-gray-dark;
box-shadow: 0 1px 2px rgba($issue-boards-card-shadow, 0.3);
cursor: pointer;
......
......@@ -82,7 +82,7 @@ $space-between-cards: 8px;
.convdev-card-low {
border-top-color: $color-low-score;
.card-score-big {
.board-card-score-big {
background-color: $red-50;
}
}
......@@ -90,7 +90,7 @@ $space-between-cards: 8px;
.convdev-card-average {
border-top-color: $color-average-score;
.card-score-big {
.board-card-score-big {
background-color: $orange-50;
}
}
......@@ -98,7 +98,7 @@ $space-between-cards: 8px;
.convdev-card-high {
border-top-color: $color-high-score;
.card-score-big {
.board-card-score-big {
background-color: $green-50;
}
}
......@@ -119,7 +119,7 @@ $space-between-cards: 8px;
}
}
.card-scores {
.board-card-scores {
display: flex;
justify-content: space-around;
align-items: center;
......@@ -127,22 +127,22 @@ $space-between-cards: 8px;
line-height: 1;
}
.card-score {
.board-card-score {
color: $gl-text-color-secondary;
.card-score-name {
.board-card-score-name {
font-size: 13px;
margin-top: 4px;
}
}
.card-score-value {
.board-card-score-value {
font-size: 16px;
color: $gl-text-color;
font-weight: $gl-font-weight-normal;
}
.card-score-big {
.board-card-score-big {
border-top: 2px solid $border-color;
border-bottom: 1px solid $border-color;
font-size: 22px;
......@@ -150,7 +150,7 @@ $space-between-cards: 8px;
font-weight: $gl-font-weight-normal;
}
.card-buttons {
.board-card-buttons {
display: flex;
> * {
......
......@@ -5,18 +5,18 @@
= card.title
.text-light
= card.description
.card-scores
.card-score
.card-score-value
.board-card-scores
.board-card-score
.board-card-score-value
= format_score(card.instance_score)
.card-score-name You
.card-score
.card-score-value
.board-card-score-name You
.board-card-score
.board-card-score-value
= format_score(card.leader_score)
.card-score-name Lead
.card-score-big
.board-card-score-name Lead
.board-card-score-big
= number_to_percentage(card.percentage_score, precision: 1)
.card-buttons
.board-card-buttons
- if card.blog
%a{ href: card.blog }
= icon('info-circle', 'aria-hidden' => 'true')
......
......@@ -21,7 +21,7 @@
score
= link_to icon('question-circle', 'aria-hidden' => 'true'), help_page_path('user/admin_area/monitoring/convdev')
.convdev-cards.card-container
.convdev-cards.board-card-container
- @metric.cards.each do |card|
= render 'card', card: card
......
......@@ -3,7 +3,7 @@
- breadcrumb_title @issue.to_reference
- page_title "#{@issue.title} (#{@issue.to_reference})", "Issues"
- page_description @issue.description
- page_card_attributes @issue.card_attributes
- page_card_attributes @issue.board-card_attributes
- can_update_issue = can?(current_user, :update_issue, @issue)
- can_report_spam = @issue.submittable_as_spam_by?(current_user)
......
......@@ -4,7 +4,7 @@
- breadcrumb_title @merge_request.to_reference
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests"
- page_description @merge_request.description
- page_card_attributes @merge_request.card_attributes
- page_card_attributes @merge_request.board-card_attributes
.merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } }
= render "projects/merge_requests/mr_title"
......
......@@ -81,7 +81,7 @@ describe 'Issue Boards add issue modal', :js do
expect(page).to have_content('2')
end
expect(page).to have_selector('.card', count: 2)
expect(page).to have_selector('.board-card', count: 2)
end
end
......@@ -89,7 +89,7 @@ describe 'Issue Boards add issue modal', :js do
page.within('.add-issues-modal') do
click_link 'Selected issues'
expect(page).not_to have_selector('.card')
expect(page).not_to have_selector('.board-card')
end
end
......@@ -122,7 +122,7 @@ describe 'Issue Boards add issue modal', :js do
wait_for_requests
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
......@@ -133,7 +133,7 @@ describe 'Issue Boards add issue modal', :js do
wait_for_requests
expect(page).not_to have_selector('.card')
expect(page).not_to have_selector('.board-card')
expect(page).not_to have_content("You haven't added any issues to your project yet")
end
end
......@@ -142,7 +142,7 @@ describe 'Issue Boards add issue modal', :js do
context 'selecing issues' do
it 'selects single issue' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
page.within('.nav-links') do
expect(page).to have_content('Selected issues 1')
......@@ -152,7 +152,7 @@ describe 'Issue Boards add issue modal', :js do
it 'changes button text' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
expect(first('.add-issues-footer .btn')).to have_content('Add 1 issue')
end
......@@ -160,7 +160,7 @@ describe 'Issue Boards add issue modal', :js do
it 'changes button text with plural' do
page.within('.add-issues-modal') do
all('.card .card-number').each do |el|
all('.board-card .board-card-number').each do |el|
el.click
end
......@@ -170,11 +170,11 @@ describe 'Issue Boards add issue modal', :js do
it 'shows only selected issues on selected tab' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
click_link 'Selected issues'
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
......@@ -200,7 +200,7 @@ describe 'Issue Boards add issue modal', :js do
it 'selects all that arent already selected' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
expect(page).to have_selector('.is-active', count: 1)
......@@ -212,11 +212,11 @@ describe 'Issue Boards add issue modal', :js do
it 'unselects from selected tab' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
click_link 'Selected issues'
first('.card .card-number').click
first('.board-card .board-card-number').click
expect(page).not_to have_selector('.is-active')
end
......@@ -226,19 +226,19 @@ describe 'Issue Boards add issue modal', :js do
context 'adding issues' do
it 'adds to board' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
click_button 'Add 1 issue'
end
page.within(find('.board:nth-child(2)')) do
expect(page).to have_selector('.card')
expect(page).to have_selector('.board-card')
end
end
it 'adds to second list' do
page.within('.add-issues-modal') do
first('.card .card-number').click
first('.board-card .board-card-number').click
click_button planning.title
......@@ -248,7 +248,7 @@ describe 'Issue Boards add issue modal', :js do
end
page.within(find('.board:nth-child(3)')) do
expect(page).to have_selector('.card')
expect(page).to have_selector('.board-card')
end
end
end
......
......@@ -92,9 +92,9 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(page).to have_selector('.board', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.card')
expect(find('.board:nth-child(3)')).to have_selector('.card')
expect(find('.board:nth-child(4)')).to have_selector('.card')
expect(find('.board:nth-child(2)')).to have_selector('.board-card')
expect(find('.board:nth-child(3)')).to have_selector('.board-card')
expect(find('.board:nth-child(4)')).to have_selector('.board-card')
end
it 'shows description tooltip on list title' do
......@@ -120,9 +120,9 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 0)
expect(find('.board:nth-child(3)')).to have_selector('.card', count: 0)
expect(find('.board:nth-child(4)')).to have_selector('.card', count: 1)
expect(find('.board:nth-child(2)')).to have_selector('.board-card', count: 0)
expect(find('.board:nth-child(3)')).to have_selector('.board-card', count: 0)
expect(find('.board:nth-child(4)')).to have_selector('.board-card', count: 1)
end
it 'search list' do
......@@ -131,9 +131,9 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 1)
expect(find('.board:nth-child(3)')).to have_selector('.card', count: 0)
expect(find('.board:nth-child(4)')).to have_selector('.card', count: 0)
expect(find('.board:nth-child(2)')).to have_selector('.board-card', count: 1)
expect(find('.board:nth-child(3)')).to have_selector('.board-card', count: 0)
expect(find('.board:nth-child(4)')).to have_selector('.board-card', count: 0)
end
it 'allows user to delete board' do
......@@ -171,21 +171,21 @@ describe 'Issue Boards', :js do
page.within(find('.board:nth-child(2)')) do
expect(page.find('.board-header')).to have_content('58')
expect(page).to have_selector('.card', count: 20)
expect(page).to have_selector('.board-card', count: 20)
expect(page).to have_content('Showing 20 of 58 issues')
find('.board .board-list')
evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight")
wait_for_requests
expect(page).to have_selector('.card', count: 40)
expect(page).to have_selector('.board-card', count: 40)
expect(page).to have_content('Showing 40 of 58 issues')
find('.board .board-list')
evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight")
wait_for_requests
expect(page).to have_selector('.card', count: 58)
expect(page).to have_selector('.board-card', count: 58)
expect(page).to have_content('Showing all issues')
end
end
......@@ -204,7 +204,7 @@ describe 'Issue Boards', :js do
wait_for_board_cards(4, 2)
expect(find('.board:nth-child(2)')).not_to have_content(issue9.title)
expect(find('.board:nth-child(4)')).to have_selector('.card', count: 2)
expect(find('.board:nth-child(4)')).to have_selector('.board-card', count: 2)
expect(find('.board:nth-child(4)')).to have_content(issue9.title)
expect(find('.board:nth-child(4)')).not_to have_content(planning.title)
end
......@@ -242,7 +242,7 @@ describe 'Issue Boards', :js do
wait_for_board_cards(4, 1)
expect(find('.board:nth-child(3)')).to have_content(issue6.title)
expect(find('.board:nth-child(3)').all('.card').last).to have_content(development.title)
expect(find('.board:nth-child(3)').all('.board-card').last).to have_content(development.title)
end
it 'issue moves between lists' do
......@@ -253,7 +253,7 @@ describe 'Issue Boards', :js do
wait_for_board_cards(4, 1)
expect(find('.board:nth-child(2)')).to have_content(issue7.title)
expect(find('.board:nth-child(2)').all('.card').first).to have_content(planning.title)
expect(find('.board:nth-child(2)').all('.board-card').first).to have_content(planning.title)
end
it 'issue moves from closed' do
......@@ -425,12 +425,12 @@ describe 'Issue Boards', :js do
page.within(find('.board:nth-child(2)')) do
expect(page.find('.board-header')).to have_content('1')
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
page.within(find('.board:nth-child(3)')) do
expect(page.find('.board-header')).to have_content('0')
expect(page).to have_selector('.card', count: 0)
expect(page).to have_selector('.board-card', count: 0)
end
end
......@@ -460,19 +460,19 @@ describe 'Issue Boards', :js do
page.within(find('.board:nth-child(2)')) do
expect(page.find('.board-header')).to have_content('51')
expect(page).to have_selector('.card', count: 20)
expect(page).to have_selector('.board-card', count: 20)
expect(page).to have_content('Showing 20 of 51 issues')
find('.board .board-list')
evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight")
expect(page).to have_selector('.card', count: 40)
expect(page).to have_selector('.board-card', count: 40)
expect(page).to have_content('Showing 40 of 51 issues')
find('.board .board-list')
evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight")
expect(page).to have_selector('.card', count: 51)
expect(page).to have_selector('.board-card', count: 51)
expect(page).to have_content('Showing all issues')
end
end
......@@ -494,8 +494,8 @@ describe 'Issue Boards', :js do
it 'filters by clicking label button on issue' do
page.within(find('.board:nth-child(2)')) do
expect(page).to have_selector('.card', count: 8)
expect(find('.card', match: :first)).to have_content(bug.title)
expect(page).to have_selector('.board-card', count: 8)
expect(find('.board-card', match: :first)).to have_content(bug.title)
click_button(bug.title)
wait_for_requests
end
......@@ -512,13 +512,13 @@ describe 'Issue Boards', :js do
it 'removes label filter by clicking label button on issue' do
page.within(find('.board:nth-child(2)')) do
page.within(find('.card', match: :first)) do
page.within(find('.board-card', match: :first)) do
click_button(bug.title)
end
wait_for_requests
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
wait_for_requests
......@@ -589,7 +589,7 @@ describe 'Issue Boards', :js do
def wait_for_board_cards(board_number, expected_cards)
page.within(find(".board:nth-child(#{board_number})")) do
expect(page.find('.board-header')).to have_content(expected_cards.to_s)
expect(page).to have_selector('.card', count: expected_cards)
expect(page).to have_selector('.board-card', count: expected_cards)
end
end
......
......@@ -30,7 +30,7 @@ describe 'Issue Boards', :js do
it 'has un-ordered issue as last issue' do
page.within(find('.board:nth-child(2)')) do
expect(all('.card').last).to have_content(issue4.title)
expect(all('.board-card').last).to have_content(issue4.title)
end
end
......@@ -40,7 +40,7 @@ describe 'Issue Boards', :js do
wait_for_requests
page.within(find('.board:nth-child(2)')) do
expect(first('.card')).to have_content(issue4.title)
expect(first('.board-card')).to have_content(issue4.title)
end
end
end
......@@ -58,7 +58,7 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(first('.card')).to have_content(issue2.title)
expect(first('.board-card')).to have_content(issue2.title)
end
it 'moves from middle to bottom' do
......@@ -66,7 +66,7 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(all('.card').last).to have_content(issue2.title)
expect(all('.board-card').last).to have_content(issue2.title)
end
it 'moves from top to bottom' do
......@@ -74,7 +74,7 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(all('.card').last).to have_content(issue3.title)
expect(all('.board-card').last).to have_content(issue3.title)
end
it 'moves from bottom to top' do
......@@ -82,7 +82,7 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(first('.card')).to have_content(issue1.title)
expect(first('.board-card')).to have_content(issue1.title)
end
it 'moves from top to middle' do
......@@ -90,7 +90,7 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(first('.card')).to have_content(issue2.title)
expect(first('.board-card')).to have_content(issue2.title)
end
it 'moves from bottom to middle' do
......@@ -98,7 +98,7 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(all('.card').last).to have_content(issue2.title)
expect(all('.board-card').last).to have_content(issue2.title)
end
end
......@@ -121,11 +121,11 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 2)
expect(all('.board')[2]).to have_selector('.card', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.board-card', count: 2)
expect(all('.board')[2]).to have_selector('.board-card', count: 4)
page.within(all('.board')[2]) do
expect(first('.card')).to have_content(issue3.title)
expect(first('.board-card')).to have_content(issue3.title)
end
end
......@@ -134,11 +134,11 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 2)
expect(all('.board')[2]).to have_selector('.card', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.board-card', count: 2)
expect(all('.board')[2]).to have_selector('.board-card', count: 4)
page.within(all('.board')[2]) do
expect(all('.card').last).to have_content(issue3.title)
expect(all('.board-card').last).to have_content(issue3.title)
end
end
......@@ -147,11 +147,11 @@ describe 'Issue Boards', :js do
wait_for_requests
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 2)
expect(all('.board')[2]).to have_selector('.card', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.board-card', count: 2)
expect(all('.board')[2]).to have_selector('.board-card', count: 4)
page.within(all('.board')[2]) do
expect(all('.card')[1]).to have_content(issue3.title)
expect(all('.board-card')[1]).to have_content(issue3.title)
end
end
end
......
......@@ -38,7 +38,7 @@ describe 'Issue Boards add issue modal filtering', :js do
page.within('.add-issues-modal') do
wait_for_requests
expect(page).to have_selector('.card', count: 0)
expect(page).to have_selector('.board-card', count: 0)
click_button 'Cancel'
end
......@@ -48,7 +48,7 @@ describe 'Issue Boards add issue modal filtering', :js do
page.within('.add-issues-modal') do
wait_for_requests
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
......@@ -62,13 +62,13 @@ describe 'Issue Boards add issue modal filtering', :js do
page.within('.add-issues-modal') do
wait_for_requests
expect(page).to have_selector('.card', count: 0)
expect(page).to have_selector('.board-card', count: 0)
find('.clear-search').click
wait_for_requests
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
......@@ -90,7 +90,7 @@ describe 'Issue Boards add issue modal filtering', :js do
wait_for_requests
expect(page).to have_selector('.js-visual-token', text: user2.name)
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
end
......@@ -113,7 +113,7 @@ describe 'Issue Boards add issue modal filtering', :js do
wait_for_requests
expect(page).to have_selector('.js-visual-token', text: 'none')
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
......@@ -126,7 +126,7 @@ describe 'Issue Boards add issue modal filtering', :js do
wait_for_requests
expect(page).to have_selector('.js-visual-token', text: user2.name)
expect(page).to have_selector('.card', count: 1)
expect(page).to have_selector('.board-card', count: 1)
end
end
end
......@@ -148,7 +148,7 @@ describe 'Issue Boards add issue modal filtering', :js do
wait_for_requests