Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d9f5af79
Commit
d9f5af79
authored
Jul 01, 2020
by
Simon Knox
Committed by
Kushal Pandya
Jul 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove sfc_issue_boards feature flag and friends
Delete now-unused HAML templates
parent
74448448
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
4 additions
and
625 deletions
+4
-625
.haml-lint_todo.yml
.haml-lint_todo.yml
+0
-2
app/assets/javascripts/boards/components/board.js
app/assets/javascripts/boards/components/board.js
+0
-192
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/index.js
+1
-9
app/controllers/groups/boards_controller.rb
app/controllers/groups/boards_controller.rb
+0
-1
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+0
-1
app/views/shared/boards/_show.html.haml
app/views/shared/boards/_show.html.haml
+0
-1
app/views/shared/boards/components/_board.html.haml
app/views/shared/boards/components/_board.html.haml
+0
-82
ee/app/assets/javascripts/boards/components/board.js
ee/app/assets/javascripts/boards/components/board.js
+0
-60
ee/app/views/shared/boards/_board_promotion_state.html.haml
ee/app/views/shared/boards/_board_promotion_state.html.haml
+0
-1
ee/app/views/shared/boards/components/_list_milestone.html.haml
.../views/shared/boards/components/_list_milestone.html.haml
+0
-1
ee/app/views/shared/boards/components/_list_settings.html.haml
...p/views/shared/boards/components/_list_settings.html.haml
+0
-10
ee/app/views/shared/boards/components/_list_weight.html.haml
ee/app/views/shared/boards/components/_list_weight.html.haml
+0
-5
qa/qa/page/component/issue_board/show.rb
qa/qa/page/component/issue_board/show.rb
+0
-5
spec/frontend/boards/issue_card_spec.js
spec/frontend/boards/issue_card_spec.js
+1
-1
spec/frontend/vue_shared/components/issue/issue_assignees_spec.js
...ntend/vue_shared/components/issue/issue_assignees_spec.js
+1
-1
spec/frontend/vue_shared/components/issue/issue_milestone_spec.js
...ntend/vue_shared/components/issue/issue_milestone_spec.js
+1
-1
spec/javascripts/boards/components/board_spec.js
spec/javascripts/boards/components/board_spec.js
+0
-251
spec/javascripts/boards/mock_data.js
spec/javascripts/boards/mock_data.js
+0
-1
No files found.
.haml-lint_todo.yml
View file @
d9f5af79
...
...
@@ -280,7 +280,6 @@ linters:
-
"
app/views/shared/_no_password.html.haml"
-
"
app/views/shared/_ping_consent.html.haml"
-
"
app/views/shared/_project_limit.html.haml"
-
"
app/views/shared/boards/components/_board.html.haml"
-
"
app/views/shared/boards/components/_sidebar.html.haml"
-
"
app/views/shared/boards/components/sidebar/_due_date.html.haml"
-
"
app/views/shared/boards/components/sidebar/_labels.html.haml"
...
...
@@ -372,7 +371,6 @@ linters:
-
"
ee/app/views/projects/services/gitlab_slack_application/_slack_integration_form.html.haml"
-
"
ee/app/views/projects/settings/slacks/edit.html.haml"
-
"
ee/app/views/shared/_mirror_update_button.html.haml"
-
"
ee/app/views/shared/boards/components/_list_weight.html.haml"
-
"
ee/app/views/shared/epic/_search_bar.html.haml"
-
"
ee/app/views/shared/issuable/_approvals.html.haml"
-
"
ee/app/views/shared/issuable/_board_create_list_dropdown.html.haml"
...
...
app/assets/javascripts/boards/components/board.js
deleted
100644 → 0
View file @
74448448
import
$
from
'
jquery
'
;
import
Sortable
from
'
sortablejs
'
;
import
Vue
from
'
vue
'
;
import
{
GlButtonGroup
,
GlDeprecatedButton
,
GlLabel
,
GlTooltip
}
from
'
@gitlab/ui
'
;
import
isWipLimitsOn
from
'
ee_else_ce/boards/mixins/is_wip_limits
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
AccessorUtilities
from
'
../../lib/utils/accessor
'
;
import
BoardBlankState
from
'
./board_blank_state.vue
'
;
import
BoardDelete
from
'
./board_delete
'
;
import
BoardList
from
'
./board_list.vue
'
;
import
IssueCount
from
'
./issue_count.vue
'
;
import
boardsStore
from
'
../stores/boards_store
'
;
import
{
getBoardSortableDefaultOptions
,
sortableEnd
}
from
'
../mixins/sortable_default_options
'
;
import
{
ListType
}
from
'
../constants
'
;
import
{
isScopedLabel
}
from
'
~/lib/utils/common_utils
'
;
/**
* Please don't edit this file, have a look at:
* ./board_column.vue
* https://gitlab.com/gitlab-org/gitlab/-/issues/212300
*
* This file here will be deleted soon
* @deprecated
*/
export
default
Vue
.
extend
({
components
:
{
BoardBlankState
,
BoardDelete
,
BoardList
,
Icon
,
GlButtonGroup
,
IssueCount
,
GlDeprecatedButton
,
GlLabel
,
GlTooltip
,
},
directives
:
{
Tooltip
,
},
mixins
:
[
isWipLimitsOn
],
props
:
{
list
:
{
type
:
Object
,
default
:
()
=>
({}),
required
:
false
,
},
disabled
:
{
type
:
Boolean
,
required
:
true
,
},
issueLinkBase
:
{
type
:
String
,
required
:
true
,
},
rootPath
:
{
type
:
String
,
required
:
true
,
},
boardId
:
{
type
:
String
,
required
:
true
,
},
// Does not do anything but is used
// to support the API of the new board_column.vue
canAdminList
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
data
()
{
return
{
detailIssue
:
boardsStore
.
detail
,
filter
:
boardsStore
.
filter
,
};
},
computed
:
{
isLoggedIn
()
{
return
Boolean
(
gon
.
current_user_id
);
},
showListHeaderButton
()
{
return
(
!
this
.
disabled
&&
this
.
list
.
type
!==
ListType
.
closed
&&
this
.
list
.
type
!==
ListType
.
blank
);
},
issuesTooltip
()
{
const
{
issuesSize
}
=
this
.
list
;
return
sprintf
(
__
(
'
%{issuesSize} issues
'
),
{
issuesSize
});
},
// Only needed to make karma pass.
weightCountToolTip
()
{},
// eslint-disable-line vue/return-in-computed-property
caretTooltip
()
{
return
this
.
list
.
isExpanded
?
s__
(
'
Boards|Collapse
'
)
:
s__
(
'
Boards|Expand
'
);
},
isNewIssueShown
()
{
return
this
.
list
.
type
===
ListType
.
backlog
||
this
.
showListHeaderButton
;
},
isSettingsShown
()
{
return
(
this
.
list
.
type
!==
ListType
.
backlog
&&
this
.
showListHeaderButton
&&
this
.
list
.
isExpanded
&&
this
.
isWipLimitsOn
);
},
showBoardListAndBoardInfo
()
{
return
this
.
list
.
type
!==
ListType
.
blank
&&
this
.
list
.
type
!==
ListType
.
promotion
;
},
uniqueKey
()
{
// eslint-disable-next-line @gitlab/require-i18n-strings
return
`boards.
${
this
.
boardId
}
.
${
this
.
list
.
type
}
.
${
this
.
list
.
id
}
`
;
},
},
watch
:
{
filter
:
{
handler
()
{
this
.
list
.
page
=
1
;
this
.
list
.
getIssues
(
true
).
catch
(()
=>
{
// TODO: handle request error
});
},
deep
:
true
,
},
},
mounted
()
{
const
instance
=
this
;
const
sortableOptions
=
getBoardSortableDefaultOptions
({
disabled
:
this
.
disabled
,
group
:
'
boards
'
,
draggable
:
'
.is-draggable
'
,
handle
:
'
.js-board-handle
'
,
onEnd
(
e
)
{
sortableEnd
();
const
sortable
=
this
;
if
(
e
.
newIndex
!==
undefined
&&
e
.
oldIndex
!==
e
.
newIndex
)
{
const
order
=
sortable
.
toArray
();
const
list
=
boardsStore
.
findList
(
'
id
'
,
parseInt
(
e
.
item
.
dataset
.
id
,
10
));
instance
.
$nextTick
(()
=>
{
boardsStore
.
moveList
(
list
,
order
);
});
}
},
});
Sortable
.
create
(
this
.
$el
.
parentNode
,
sortableOptions
);
},
created
()
{
if
(
this
.
list
.
isExpandable
&&
AccessorUtilities
.
isLocalStorageAccessSafe
()
&&
!
this
.
isLoggedIn
)
{
const
isCollapsed
=
localStorage
.
getItem
(
`
${
this
.
uniqueKey
}
.expanded`
)
===
'
false
'
;
this
.
list
.
isExpanded
=
!
isCollapsed
;
}
},
methods
:
{
showScopedLabels
(
label
)
{
return
boardsStore
.
scopedLabels
.
enabled
&&
isScopedLabel
(
label
);
},
showNewIssueForm
()
{
this
.
$refs
[
'
board-list
'
].
showIssueForm
=
!
this
.
$refs
[
'
board-list
'
].
showIssueForm
;
},
toggleExpanded
()
{
if
(
this
.
list
.
isExpandable
)
{
this
.
list
.
isExpanded
=
!
this
.
list
.
isExpanded
;
if
(
AccessorUtilities
.
isLocalStorageAccessSafe
()
&&
!
this
.
isLoggedIn
)
{
localStorage
.
setItem
(
`
${
this
.
uniqueKey
}
.expanded`
,
this
.
list
.
isExpanded
);
}
if
(
this
.
isLoggedIn
)
{
this
.
list
.
update
();
}
// When expanding/collapsing, the tooltip on the caret button sometimes stays open.
// Close all tooltips manually to prevent dangling tooltips.
$
(
'
.tooltip
'
).
tooltip
(
'
hide
'
);
}
},
},
template
:
'
#js-board-template
'
,
});
app/assets/javascripts/boards/index.js
View file @
d9f5af79
...
...
@@ -80,15 +80,7 @@ export default () => {
el
:
$boardApp
,
components
:
{
BoardContent
,
Board
:
()
=>
window
?.
gon
?.
features
?.
sfcIssueBoards
?
import
(
'
ee_else_ce/boards/components/board_column.vue
'
)
:
/**
* Please have a look at, we are moving to the SFC soon:
* https://gitlab.com/gitlab-org/gitlab/-/issues/212300
* @deprecated
*/
import
(
'
ee_else_ce/boards/components/board
'
),
Board
:
()
=>
import
(
'
ee_else_ce/boards/components/board_column.vue
'
),
BoardSidebar
,
BoardAddIssuesModal
,
BoardSettingsSidebar
:
()
=>
...
...
app/controllers/groups/boards_controller.rb
View file @
d9f5af79
...
...
@@ -8,7 +8,6 @@ class Groups::BoardsController < Groups::ApplicationController
before_action
:assign_endpoint_vars
before_action
do
push_frontend_feature_flag
(
:multi_select_board
,
default_enabled:
true
)
push_frontend_feature_flag
(
:sfc_issue_boards
,
default_enabled:
true
)
push_frontend_feature_flag
(
:boards_with_swimlanes
,
group
,
default_enabled:
false
)
end
...
...
app/controllers/projects/boards_controller.rb
View file @
d9f5af79
...
...
@@ -9,7 +9,6 @@ class Projects::BoardsController < Projects::ApplicationController
before_action
:assign_endpoint_vars
before_action
do
push_frontend_feature_flag
(
:multi_select_board
,
default_enabled:
true
)
push_frontend_feature_flag
(
:sfc_issue_boards
,
default_enabled:
true
)
end
private
...
...
app/views/shared/boards/_show.html.haml
View file @
d9f5af79
...
...
@@ -13,7 +13,6 @@
-
content_for
:page_specific_javascripts
do
-# haml-lint:disable InlineJavaScript
%script
#js-board-template
{
type:
"text/x-template"
}=
render
"shared/boards/components/board"
%script
#js-board-modal-filter
{
type:
"text/x-template"
}=
render
"shared/issuable/search_bar"
,
type: :boards_modal
,
show_sorting_dropdown:
false
%script
#js-board-promotion
{
type:
"text/x-template"
}=
render_if_exists
"shared/promotions/promote_issue_board"
...
...
app/views/shared/boards/components/_board.html.haml
deleted
100644 → 0
View file @
74448448
-# Please have a look at app/assets/javascripts/boards/components/board_column.vue
This haml file is deprecated and will be deleted soon, please change the Vue app
https://gitlab.com/gitlab-org/gitlab/-/issues/212300
.board.h-100.px-2.align-top.ws-normal
{
":class"
=>
'
{
"is-draggable"
:
!
list
.
preset
,
"is-expandable"
:
list
.
isExpandable
,
"is-collapsed"
:
!
list
.
isExpanded
,
"board-type-assignee"
:
list
.
type
===
"assignee"
}
'
,
":data-id"
=>
"list.id"
,
data:
{
qa_selector:
"board_list"
}
}
.board-inner.d-flex.flex-column.position-relative.h-100.rounded
%header
.board-header
{
":class"
=>
'
{
"has-border"
:
list
.
label
&&
list
.
label
.
color
,
"position-relative"
:
list
.
isExpanded
,
"position-absolute position-top-0 position-left-0 w-100 h-100"
:
!
list
.
isExpanded
}
'
,
":style"
=>
"{ borderTopColor: (list.label && list.label.color ? list.label.color : null) }"
,
data:
{
qa_selector:
"board_list_header"
}
}
%h3
.board-title.m-0.d-flex.js-board-handle
{
":class"
=>
'
{
"user-can-drag"
:
(
!
disabled
&&
!
list
.
preset
),
"border-bottom-0"
:
!
list
.
isExpanded
}
'
}
.board-title-caret.no-drag
{
"v-if"
:
"list.isExpandable"
,
"aria-hidden"
:
"true"
,
":aria-label"
:
"caretTooltip"
,
":title"
:
"caretTooltip"
,
"v-tooltip"
:
""
,
data:
{
placement:
"bottom"
},
"@click"
:
"toggleExpanded"
}
%i
.fa.fa-fw
{
":class"
:
'
{
"fa-caret-right"
:
list
.
isExpanded
,
"fa-caret-down"
:
!
list
.
isExpanded
}
'
}
=
render_if_exists
"shared/boards/components/list_milestone"
%a
.user-avatar-link.js-no-trigger
{
"v-if"
:
"list.type ===
\"
assignee
\"
"
,
":href"
:
"list.assignee.path"
}
-# haml-lint:disable AltText
%img
.avatar.s20.has-tooltip
{
height:
"20"
,
width:
"20"
,
":src"
:
"list.assignee.avatar"
,
":alt"
:
"list.assignee.name"
}
.board-title-text
%span
.board-title-main-text.block-truncated
{
"v-if"
:
"list.type !==
\"
label
\"
"
,
":title"
=>
'((list.label && list.label.description) || list.title || "")'
,
data:
{
container:
"body"
},
":class"
:
"{ 'has-tooltip': !['backlog', 'closed'].includes(list.type), 'd-block': list.type === 'milestone' }"
}
{{ list.title }}
%span
.board-title-sub-text.prepend-left-5.has-tooltip
{
"v-if"
:
"list.type ===
\"
assignee
\"
"
,
":title"
=>
'(list.assignee && list.assignee.username || "")'
}
@{{ list.assignee.username }}
%gl-label
{
"v-if"
=>
" list.type ===
\"
label
\"
"
,
":background-color"
=>
"list.label.color"
,
":title"
=>
"list.label.title"
,
":description"
=>
"list.label.description"
,
"tooltipPlacement"
=>
"bottom"
,
":size"
=>
'(!list.isExpanded ? "sm" : "")'
,
":scoped"
=>
"showScopedLabels(list.label)"
}
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
%board-delete
{
"inline-template"
=>
true
,
":list"
=>
"list"
,
"v-if"
=>
"!list.preset && list.id"
}
%button
.board-delete.no-drag.p-0.border-0.has-tooltip.float-right
{
type:
"button"
,
title:
_
(
"Delete list"
),
":class"
:
"{ 'd-none': !list.isExpanded }"
,
"aria-label"
=>
_
(
"Delete list"
),
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
.issue-count-badge.pr-0.no-drag.text-secondary
{
"v-if"
=>
"showBoardListAndBoardInfo"
}
%span
.d-inline-flex
%gl-tooltip
{
":target"
=>
"() => $refs.issueCount"
,
":title"
=>
"issuesTooltip"
}
%span
.issue-count-badge-count
{
"ref"
=>
"issueCount"
}
%icon
.mr-1
{
name:
"issues"
}
%issue-count
{
":maxIssueCount"
=>
"list.maxIssueCount"
,
":issuesSize"
=>
"list.issuesSize"
}
=
render_if_exists
"shared/boards/components/list_weight"
%gl-button-group
.board-list-button-group.pl-2
{
"v-if"
=>
"isNewIssueShown || isSettingsShown"
}
%gl-deprecated-button
.issue-count-badge-add-button.no-drag
{
type:
"button"
,
"@click"
=>
"showNewIssueForm"
,
"v-if"
=>
"isNewIssueShown"
,
":class"
:
"{ 'd-none': !list.isExpanded, 'rounded-right': isNewIssueShown && !isSettingsShown }"
,
"aria-label"
=>
_
(
"New issue"
),
"ref"
=>
"newIssueBtn"
}
=
icon
(
"plus"
)
%gl-tooltip
{
":target"
=>
"() => $refs.newIssueBtn"
}
=
_
(
"New Issue"
)
=
render_if_exists
'shared/boards/components/list_settings'
%board-list
{
"v-if"
=>
"showBoardListAndBoardInfo"
,
":list"
=>
"list"
,
":issues"
=>
"list.issues"
,
":loading"
=>
"list.loading"
,
":disabled"
=>
"disabled"
,
":issue-link-base"
=>
"issueLinkBase"
,
":root-path"
=>
"rootPath"
,
":groupId"
=>
((
current_board_parent
.
id
if
@group
)
||
'null'
),
"ref"
=>
"board-list"
}
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
%board-blank-state
{
"v-if"
=>
'list.id == "blank"'
}
=
render_if_exists
'shared/boards/board_promotion_state'
ee/app/assets/javascripts/boards/components/board.js
deleted
100644 → 0
View file @
74448448
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
boardPromotionState
from
'
ee/boards/components/board_promotion_state
'
;
import
{
GlTooltip
}
from
'
@gitlab/ui
'
;
import
Board
from
'
~/boards/components/board
'
;
import
{
__
,
sprintf
,
s__
}
from
'
~/locale
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
/**
* Please have a look at:
* ./board_column.vue
* https://gitlab.com/gitlab-org/gitlab/-/issues/212300
* @deprecated
*/
export
default
Board
.
extend
({
data
()
{
return
{
weightFeatureAvailable
:
boardsStore
.
weightFeatureAvailable
,
};
},
components
:
{
GlTooltip
,
boardPromotionState
,
},
computed
:
{
...
mapState
([
'
activeListId
'
]),
issuesTooltip
()
{
const
{
issuesSize
,
maxIssueCount
}
=
this
.
list
;
if
(
maxIssueCount
>
0
)
{
return
sprintf
(
__
(
'
%{issuesSize} issues with a limit of %{maxIssueCount}
'
),
{
issuesSize
,
maxIssueCount
,
});
}
// TODO: Remove this pattern.
return
Board
.
options
.
computed
.
issuesTooltip
.
call
(
this
);
},
weightCountToolTip
()
{
const
{
totalWeight
}
=
this
.
list
;
if
(
this
.
weightFeatureAvailable
)
{
return
sprintf
(
s__
(
'
%{totalWeight} total weight
'
),
{
totalWeight
});
}
return
null
;
},
},
methods
:
{
...
mapActions
([
'
setActiveListId
'
]),
openSidebarSettings
()
{
// If no list is opened, close all sidebars first
if
(
!
this
.
activeListId
)
{
eventHub
.
$emit
(
'
sidebar.closeAll
'
);
}
this
.
setActiveListId
(
this
.
list
.
id
);
},
},
});
ee/app/views/shared/boards/_board_promotion_state.html.haml
deleted
100644 → 0
View file @
74448448
%board-promotion-state
{
"v-if"
=>
'list.id == "promotion"'
}
ee/app/views/shared/boards/components/_list_milestone.html.haml
deleted
100644 → 0
View file @
74448448
=
content_tag
(
:span
,
sprite_icon
(
'timer'
,
size:
16
),
{
"v-if"
:
"list.milestone"
,
"aria-hidden"
:
"true"
,
"class"
:
"append-right-5 milestone-icon"
})
ee/app/views/shared/boards/components/_list_settings.html.haml
deleted
100644 → 0
View file @
74448448
-
if
current_board_parent
.
feature_available?
(
:wip_limits
)
%gl-deprecated-button
.no-drag.rounded-right
{
type:
"button"
,
"@click"
=>
"openSidebarSettings"
,
"v-if"
=>
"isSettingsShown"
,
"aria-label"
=>
_
(
"List settings"
),
"ref"
=>
"settingsBtn"
,
"title"
=>
_
(
"List settings"
)
}
=
sprite_icon
(
"settings"
)
%gl-tooltip
{
":target"
=>
"() => $refs.settingsBtn"
}
=
_
(
"List settings"
)
ee/app/views/shared/boards/components/_list_weight.html.haml
deleted
100644 → 0
View file @
74448448
-
if
(
@group
||
@project
)
&
.
feature_available?
(
:issue_weights
)
%gl-tooltip
{
":target"
=>
"() => $refs.weightTooltip"
,
":title"
=>
"weightCountToolTip"
}
%span
.d-inline-flex.ml-2
{
"ref"
=>
"weightTooltip"
}
%icon
.mr-1
{
name:
"weight"
}
{{ list.totalWeight }}
qa/qa/page/component/issue_board/show.rb
View file @
d9f5af79
...
...
@@ -39,11 +39,6 @@ module QA
element
:boards_list
end
view
'app/views/shared/boards/components/_board.html.haml'
do
element
:board_list
element
:board_list_header
end
view
'app/assets/javascripts/boards/toggle_focus.js'
do
element
:focus_mode_button
end
...
...
spec/frontend/boards/issue_card_spec.js
View file @
d9f5af79
...
...
@@ -6,7 +6,7 @@ import '~/boards/models/assignee';
import
'
~/boards/models/issue
'
;
import
'
~/boards/models/list
'
;
import
IssueCardInner
from
'
~/boards/components/issue_card_inner.vue
'
;
import
{
listObj
}
from
'
.
./../javascripts/boards
/mock_data
'
;
import
{
listObj
}
from
'
./mock_data
'
;
import
store
from
'
~/boards/stores
'
;
import
{
GlLabel
}
from
'
@gitlab/ui
'
;
...
...
spec/frontend/vue_shared/components/issue/issue_assignees_spec.js
View file @
d9f5af79
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
UserAvatarLink
from
'
~/vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
IssueAssignees
from
'
~/vue_shared/components/issue/issue_assignees.vue
'
;
import
{
mockAssigneesList
}
from
'
../../../../javascripts
/boards/mock_data
'
;
import
{
mockAssigneesList
}
from
'
jest
/boards/mock_data
'
;
const
TEST_CSS_CLASSES
=
'
test-classes
'
;
const
TEST_MAX_VISIBLE
=
4
;
...
...
spec/frontend/vue_shared/components/issue/issue_milestone_spec.js
View file @
d9f5af79
...
...
@@ -4,7 +4,7 @@ import { shallowMount } from '@vue/test-utils';
import
IssueMilestone
from
'
~/vue_shared/components/issue/issue_milestone.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
mockMilestone
}
from
'
../../../../javascripts
/boards/mock_data
'
;
import
{
mockMilestone
}
from
'
jest
/boards/mock_data
'
;
const
createComponent
=
(
milestone
=
mockMilestone
)
=>
{
const
Component
=
Vue
.
extend
(
IssueMilestone
);
...
...
spec/javascripts/boards/components/board_spec.js
deleted
100644 → 0
View file @
74448448
import
Vue
from
'
vue
'
;
import
Board
from
'
~/boards/components/board
'
;
import
List
from
'
~/boards/models/list
'
;
describe
(
'
Board component
'
,
()
=>
{
let
vm
;
const
createComponent
=
({
gon
=
{},
collapsed
=
false
,
listType
=
'
backlog
'
}
=
{})
=>
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
gon
,
'
current_user_id
'
))
{
window
.
gon
=
gon
;
}
else
{
window
.
gon
=
{};
}
const
el
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
el
);
vm
=
new
Board
({
propsData
:
{
boardId
:
'
1
'
,
disabled
:
false
,
issueLinkBase
:
'
/
'
,
rootPath
:
'
/
'
,
list
:
new
List
({
id
:
1
,
position
:
0
,
title
:
'
test
'
,
list_type
:
listType
,
collapsed
,
}),
},
}).
$mount
(
el
);
};
const
setUpTests
=
(
done
,
opts
=
{})
=>
{
loadFixtures
(
'
boards/show.html
'
);
createComponent
(
opts
);
Vue
.
nextTick
(
done
);
};
const
cleanUpTests
=
spy
=>
{
if
(
spy
)
{
spy
.
calls
.
reset
();
}
vm
.
$destroy
();
// remove the component from the DOM
document
.
querySelector
(
'
.board
'
).
remove
();
localStorage
.
removeItem
(
`
${
vm
.
uniqueKey
}
.expanded`
);
};
describe
(
'
List
'
,
()
=>
{
it
(
'
board is expandable when list type is closed
'
,
()
=>
{
expect
(
new
List
({
id
:
1
,
list_type
:
'
closed
'
}).
isExpandable
).
toBe
(
true
);
});
it
(
'
board is expandable when list type is label
'
,
()
=>
{
expect
(
new
List
({
id
:
1
,
list_type
:
'
closed
'
}).
isExpandable
).
toBe
(
true
);
});
it
(
'
board is not expandable when list type is blank
'
,
()
=>
{
expect
(
new
List
({
id
:
1
,
list_type
:
'
blank
'
}).
isExpandable
).
toBe
(
false
);
});
});
describe
(
'
when clicking the header
'
,
()
=>
{
beforeEach
(
done
=>
{
setUpTests
(
done
);
});
afterEach
(()
=>
{
cleanUpTests
();
});
it
(
'
does not collapse
'
,
done
=>
{
vm
.
list
.
isExpanded
=
true
;
vm
.
$el
.
querySelector
(
'
.board-header
'
).
click
();
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
is-collapsed
'
)).
toBe
(
false
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
when clicking the collapse icon
'
,
()
=>
{
beforeEach
(
done
=>
{
setUpTests
(
done
);
});
afterEach
(()
=>
{
cleanUpTests
();
});
it
(
'
collapses
'
,
done
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.board-title-caret
'
).
click
();
})
.
then
(()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
is-collapsed
'
)).
toBe
(
true
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
when clicking the expand icon
'
,
()
=>
{
beforeEach
(
done
=>
{
setUpTests
(
done
);
});
afterEach
(()
=>
{
cleanUpTests
();
});
it
(
'
expands
'
,
done
=>
{
vm
.
list
.
isExpanded
=
false
;
Vue
.
nextTick
()
.
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.board-title-caret
'
).
click
();
})
.
then
(()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
is-collapsed
'
)).
toBe
(
false
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
when collapsed is false
'
,
()
=>
{
beforeEach
(
done
=>
{
setUpTests
(
done
);
});
afterEach
(()
=>
{
cleanUpTests
();
});
it
(
'
is expanded when collapsed is false
'
,
()
=>
{
expect
(
vm
.
list
.
isExpanded
).
toBe
(
true
);
expect
(
vm
.
$el
.
classList
.
contains
(
'
is-collapsed
'
)).
toBe
(
false
);
});
});
describe
(
'
when list type is blank
'
,
()
=>
{
beforeEach
(
done
=>
{
setUpTests
(
done
,
{
listType
:
'
blank
'
});
});
afterEach
(()
=>
{
cleanUpTests
();
});
it
(
'
does not render add issue button when list type is blank
'
,
done
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.issue-count-badge-add-button
'
)).
toBeNull
();
done
();
});
});
});
describe
(
'
when list type is backlog
'
,
()
=>
{
beforeEach
(
done
=>
{
setUpTests
(
done
);
});
afterEach
(()
=>
{
cleanUpTests
();
});
it
(
'
board is expandable
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
is-expandable
'
)).
toBe
(
true
);
});
});
describe
(
'
when logged in
'
,
()
=>
{
let
spy
;
beforeEach
(
done
=>
{
spy
=
spyOn
(
List
.
prototype
,
'
update
'
);
setUpTests
(
done
,
{
gon
:
{
current_user_id
:
1
}
});
});
afterEach
(()
=>
{
cleanUpTests
(
spy
);
});
it
(
'
calls list update
'
,
done
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.board-title-caret
'
).
click
();
})
.
then
(()
=>
{
expect
(
vm
.
list
.
update
).
toHaveBeenCalledTimes
(
1
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
when logged out
'
,
()
=>
{
let
spy
;
beforeEach
(
done
=>
{
spy
=
spyOn
(
List
.
prototype
,
'
update
'
);
setUpTests
(
done
,
{
collapsed
:
false
});
});
afterEach
(()
=>
{
cleanUpTests
(
spy
);
});
// can only be one or the other cant toggle window.gon.current_user_id states.
it
(
'
clicking on the caret does not call list update
'
,
done
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.board-title-caret
'
).
click
();
})
.
then
(()
=>
{
expect
(
vm
.
list
.
update
).
toHaveBeenCalledTimes
(
0
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
sets expanded to be the opposite of its value when toggleExpanded is called
'
,
done
=>
{
const
expanded
=
true
;
vm
.
list
.
isExpanded
=
expanded
;
vm
.
toggleExpanded
();
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
vm
.
list
.
isExpanded
).
toBe
(
!
expanded
);
expect
(
localStorage
.
getItem
(
`
${
vm
.
uniqueKey
}
.expanded`
)).
toBe
(
String
(
!
expanded
));
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
does render add issue button
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.issue-count-badge-add-button
'
)).
not
.
toBeNull
();
});
});
});
spec/javascripts/boards/mock_data.js
deleted
100644 → 0
View file @
74448448
export
*
from
'
../../frontend/boards/mock_data
'
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment