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
d773d574
Commit
d773d574
authored
Feb 25, 2021
by
Florie Guibert
Committed by
Kushal Pandya
Feb 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Epic board - Display epic reference on card
Rename issue_card_inner component to board_card_inner
parent
86c6c6a2
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
94 additions
and
92 deletions
+94
-92
app/assets/javascripts/boards/components/board_card.vue
app/assets/javascripts/boards/components/board_card.vue
+3
-3
app/assets/javascripts/boards/components/board_card_inner.vue
...assets/javascripts/boards/components/board_card_inner.vue
+43
-38
app/assets/javascripts/boards/components/board_card_layout_deprecated.vue
...cripts/boards/components/board_card_layout_deprecated.vue
+1
-2
app/assets/javascripts/boards/components/issue_card_inner_deprecated.vue
...scripts/boards/components/issue_card_inner_deprecated.vue
+3
-3
app/assets/javascripts/boards/components/modal/list.vue
app/assets/javascripts/boards/components/modal/list.vue
+3
-3
app/assets/javascripts/boards/mixins/board_card_inner.js
app/assets/javascripts/boards/mixins/board_card_inner.js
+1
-3
app/assets/stylesheets/page_bundles/boards.scss
app/assets/stylesheets/page_bundles/boards.scss
+1
-1
ee/app/assets/javascripts/boards/graphql/lists_epics.query.graphql
...sets/javascripts/boards/graphql/lists_epics.query.graphql
+2
-0
ee/app/assets/javascripts/boards/mixins/board_card_inner.js
ee/app/assets/javascripts/boards/mixins/board_card_inner.js
+4
-6
ee/spec/frontend/boards/board_card_inner_spec.js
ee/spec/frontend/boards/board_card_inner_spec.js
+4
-4
spec/frontend/boards/board_card_inner_spec.js
spec/frontend/boards/board_card_inner_spec.js
+25
-25
spec/frontend/boards/components/board_card_deprecated_spec.js
.../frontend/boards/components/board_card_deprecated_spec.js
+1
-1
spec/frontend/boards/components/board_card_layout_deprecated_spec.js
...nd/boards/components/board_card_layout_deprecated_spec.js
+1
-1
spec/frontend/boards/components/board_card_spec.js
spec/frontend/boards/components/board_card_spec.js
+2
-2
No files found.
app/assets/javascripts/boards/components/board_card.vue
View file @
d773d574
<
script
>
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
IssueCardInner
from
'
./issue
_card_inner.vue
'
;
import
BoardCardInner
from
'
./board
_card_inner.vue
'
;
export
default
{
export
default
{
name
:
'
BoardCard
'
,
name
:
'
BoardCard
'
,
components
:
{
components
:
{
Issue
CardInner
,
Board
CardInner
,
},
},
props
:
{
props
:
{
list
:
{
list
:
{
...
@@ -76,6 +76,6 @@ export default {
...
@@ -76,6 +76,6 @@ export default {
class="board-card gl-p-5 gl-rounded-base"
class="board-card gl-p-5 gl-rounded-base"
@mouseup="toggleIssue($event)"
@mouseup="toggleIssue($event)"
>
>
<
issue-card-inner
:list=
"list"
:issue
=
"issue"
:update-filters=
"true"
/>
<
board-card-inner
:list=
"list"
:item
=
"issue"
:update-filters=
"true"
/>
</li>
</li>
</
template
>
</
template
>
app/assets/javascripts/boards/components/
issue
_card_inner.vue
→
app/assets/javascripts/boards/components/
board
_card_inner.vue
View file @
d773d574
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
GlLabel
,
GlTooltipDirective
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLabel
,
GlTooltipDirective
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
issueCardInner
from
'
ee_else_ce/boards/mixins/issue
_card_inner
'
;
import
boardCardInner
from
'
ee_else_ce/boards/mixins/board
_card_inner
'
;
import
{
isScopedLabel
}
from
'
~/lib/utils/common_utils
'
;
import
{
isScopedLabel
}
from
'
~/lib/utils/common_utils
'
;
import
{
updateHistory
}
from
'
~/lib/utils/url_utility
'
;
import
{
updateHistory
}
from
'
~/lib/utils/url_utility
'
;
import
{
sprintf
,
__
,
n__
}
from
'
~/locale
'
;
import
{
sprintf
,
__
,
n__
}
from
'
~/locale
'
;
...
@@ -26,10 +26,10 @@ export default {
...
@@ -26,10 +26,10 @@ export default {
directives
:
{
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlTooltip
:
GlTooltipDirective
,
},
},
mixins
:
[
issue
CardInner
],
mixins
:
[
board
CardInner
],
inject
:
[
'
groupId
'
,
'
rootPath
'
,
'
scopedLabelsAvailable
'
],
inject
:
[
'
groupId
'
,
'
rootPath
'
,
'
scopedLabelsAvailable
'
],
props
:
{
props
:
{
i
ssue
:
{
i
tem
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
...
@@ -52,19 +52,19 @@ export default {
...
@@ -52,19 +52,19 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
...
mapState
([
'
isShowingLabels
'
]),
...
mapState
([
'
isShowingLabels
'
,
'
isEpicBoard
'
]),
cappedAssignees
()
{
cappedAssignees
()
{
// e.g. maxRender is 4,
// e.g. maxRender is 4,
// Render up to all 4 assignees if there are only 4 assigness
// Render up to all 4 assignees if there are only 4 assigness
// Otherwise render up to the limitBeforeCounter
// Otherwise render up to the limitBeforeCounter
if
(
this
.
i
ssue
.
assignees
.
length
<=
this
.
maxRender
)
{
if
(
this
.
i
tem
.
assignees
.
length
<=
this
.
maxRender
)
{
return
this
.
i
ssue
.
assignees
.
slice
(
0
,
this
.
maxRender
);
return
this
.
i
tem
.
assignees
.
slice
(
0
,
this
.
maxRender
);
}
}
return
this
.
i
ssue
.
assignees
.
slice
(
0
,
this
.
limitBeforeCounter
);
return
this
.
i
tem
.
assignees
.
slice
(
0
,
this
.
limitBeforeCounter
);
},
},
numberOverLimit
()
{
numberOverLimit
()
{
return
this
.
i
ssue
.
assignees
.
length
-
this
.
limitBeforeCounter
;
return
this
.
i
tem
.
assignees
.
length
-
this
.
limitBeforeCounter
;
},
},
assigneeCounterTooltip
()
{
assigneeCounterTooltip
()
{
const
{
numberOverLimit
,
maxCounter
}
=
this
;
const
{
numberOverLimit
,
maxCounter
}
=
this
;
...
@@ -79,31 +79,35 @@ export default {
...
@@ -79,31 +79,35 @@ export default {
return
`+
${
this
.
numberOverLimit
}
`
;
return
`+
${
this
.
numberOverLimit
}
`
;
},
},
shouldRenderCounter
()
{
shouldRenderCounter
()
{
if
(
this
.
i
ssue
.
assignees
.
length
<=
this
.
maxRender
)
{
if
(
this
.
i
tem
.
assignees
.
length
<=
this
.
maxRender
)
{
return
false
;
return
false
;
}
}
return
this
.
i
ssue
.
assignees
.
length
>
this
.
numberOverLimit
;
return
this
.
i
tem
.
assignees
.
length
>
this
.
numberOverLimit
;
},
},
issueId
()
{
itemPrefix
()
{
if
(
this
.
issue
.
iid
)
{
return
this
.
isEpicBoard
?
'
&
'
:
'
#
'
;
return
`#
${
this
.
issue
.
iid
}
`
;
},
itemId
()
{
if
(
this
.
item
.
iid
)
{
return
`
${
this
.
itemPrefix
}${
this
.
item
.
iid
}
`
;
}
}
return
false
;
return
false
;
},
},
showLabelFooter
()
{
showLabelFooter
()
{
return
this
.
isShowingLabels
&&
this
.
i
ssue
.
labels
.
find
(
this
.
showLabel
);
return
this
.
isShowingLabels
&&
this
.
i
tem
.
labels
.
find
(
this
.
showLabel
);
},
},
i
ssue
ReferencePath
()
{
i
tem
ReferencePath
()
{
const
{
referencePath
,
groupId
}
=
this
.
issue
;
const
{
referencePath
}
=
this
.
item
;
return
!
groupId
?
referencePath
.
split
(
'
#
'
)[
0
]
:
null
;
return
referencePath
.
split
(
this
.
itemPrefix
)[
0
]
;
},
},
orderedLabels
()
{
orderedLabels
()
{
return
sortBy
(
this
.
i
ssue
.
labels
.
filter
(
this
.
isNonListLabel
),
'
title
'
);
return
sortBy
(
this
.
i
tem
.
labels
.
filter
(
this
.
isNonListLabel
),
'
title
'
);
},
},
blockedLabel
()
{
blockedLabel
()
{
if
(
this
.
i
ssue
.
blockedByCount
)
{
if
(
this
.
i
tem
.
blockedByCount
)
{
return
n__
(
`Blocked by %d issue`
,
`Blocked by %d issues`
,
this
.
i
ssue
.
blockedByCount
);
return
n__
(
`Blocked by %d issue`
,
`Blocked by %d issues`
,
this
.
i
tem
.
blockedByCount
);
}
}
return
__
(
'
Blocked issue
'
);
return
__
(
'
Blocked issue
'
);
},
},
...
@@ -160,7 +164,7 @@ export default {
...
@@ -160,7 +164,7 @@ export default {
<div
class=
"gl-display-flex"
dir=
"auto"
>
<div
class=
"gl-display-flex"
dir=
"auto"
>
<h4
class=
"board-card-title gl-mb-0 gl-mt-0"
>
<h4
class=
"board-card-title gl-mb-0 gl-mt-0"
>
<gl-icon
<gl-icon
v-if=
"i
ssue
.blocked"
v-if=
"i
tem
.blocked"
v-gl-tooltip
v-gl-tooltip
name=
"issue-block"
name=
"issue-block"
:title=
"blockedLabel"
:title=
"blockedLabel"
...
@@ -169,7 +173,7 @@ export default {
...
@@ -169,7 +173,7 @@ export default {
data-testid=
"issue-blocked-icon"
data-testid=
"issue-blocked-icon"
/>
/>
<gl-icon
<gl-icon
v-if=
"i
ssue
.confidential"
v-if=
"i
tem
.confidential"
v-gl-tooltip
v-gl-tooltip
name=
"eye-slash"
name=
"eye-slash"
:title=
"__('Confidential')"
:title=
"__('Confidential')"
...
@@ -177,11 +181,11 @@ export default {
...
@@ -177,11 +181,11 @@ export default {
:aria-label=
"__('Confidential')"
:aria-label=
"__('Confidential')"
/>
/>
<a
<a
:href=
"i
ssue.path || issue
.webUrl || ''"
:href=
"i
tem.path || item
.webUrl || ''"
:title=
"i
ssue
.title"
:title=
"i
tem
.title"
class=
"js-no-trigger"
class=
"js-no-trigger"
@
mousemove
.
stop
@
mousemove
.
stop
>
{{
i
ssue
.
title
}}
</a
>
{{
i
tem
.
title
}}
</a
>
>
</h4>
</h4>
</div>
</div>
...
@@ -205,29 +209,30 @@ export default {
...
@@ -205,29 +209,30 @@ export default {
class=
"gl-display-flex align-items-start flex-wrap-reverse board-card-number-container gl-overflow-hidden js-board-card-number-container"
class=
"gl-display-flex align-items-start flex-wrap-reverse board-card-number-container gl-overflow-hidden js-board-card-number-container"
>
>
<span
<span
v-if=
"i
ssue
.referencePath"
v-if=
"i
tem
.referencePath"
class=
"board-card-number gl-overflow-hidden gl-display-flex gl-mr-3 gl-mt-3"
class=
"board-card-number gl-overflow-hidden gl-display-flex gl-mr-3 gl-mt-3"
:class=
"{ 'gl-font-base': isEpicBoard }"
>
>
<tooltip-on-truncate
<tooltip-on-truncate
v-if=
"i
ssue
ReferencePath"
v-if=
"i
tem
ReferencePath"
:title=
"i
ssue
ReferencePath"
:title=
"i
tem
ReferencePath"
placement=
"bottom"
placement=
"bottom"
class=
"board-i
ssue
-path gl-text-truncate gl-font-weight-bold"
class=
"board-i
tem
-path gl-text-truncate gl-font-weight-bold"
>
{{ i
ssue
ReferencePath }}
</tooltip-on-truncate
>
{{ i
tem
ReferencePath }}
</tooltip-on-truncate
>
>
#{{ issue.ii
d }}
{{ itemI
d }}
</span>
</span>
<span
class=
"board-info-items gl-mt-3 gl-display-inline-block"
>
<span
class=
"board-info-items gl-mt-3 gl-display-inline-block"
>
<issue-due-date
<issue-due-date
v-if=
"i
ssue
.dueDate"
v-if=
"i
tem
.dueDate"
:date=
"i
ssue
.dueDate"
:date=
"i
tem
.dueDate"
:closed=
"i
ssue.closed || Boolean(issue
.closedAt)"
:closed=
"i
tem.closed || Boolean(item
.closedAt)"
/>
/>
<issue-time-estimate
v-if=
"i
ssue.timeEstimate"
:estimate=
"issue
.timeEstimate"
/>
<issue-time-estimate
v-if=
"i
tem.timeEstimate"
:estimate=
"item
.timeEstimate"
/>
<issue-card-weight
<issue-card-weight
v-if=
"validIssueWeight"
v-if=
"validIssueWeight
(item)
"
:weight=
"i
ssue
.weight"
:weight=
"i
tem
.weight"
@
click=
"filterByWeight(i
ssue
.weight)"
@
click=
"filterByWeight(i
tem
.weight)"
/>
/>
</span>
</span>
</div>
</div>
...
...
app/assets/javascripts/boards/components/board_card_layout_deprecated.vue
View file @
d773d574
...
@@ -3,13 +3,12 @@ import { mapActions, mapGetters } from 'vuex';
...
@@ -3,13 +3,12 @@ import { mapActions, mapGetters } from 'vuex';
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
boardsStore
from
'
../stores/boards_store
'
;
import
boardsStore
from
'
../stores/boards_store
'
;
import
IssueCardInner
from
'
./issue_card_inner.vue
'
;
import
IssueCardInnerDeprecated
from
'
./issue_card_inner_deprecated.vue
'
;
import
IssueCardInnerDeprecated
from
'
./issue_card_inner_deprecated.vue
'
;
export
default
{
export
default
{
name
:
'
BoardCardLayout
'
,
name
:
'
BoardCardLayout
'
,
components
:
{
components
:
{
IssueCardInner
:
gon
.
features
?.
graphqlBoardLists
?
IssueCardInner
:
IssueCardInnerDeprecated
,
IssueCardInner
:
IssueCardInnerDeprecated
,
},
},
mixins
:
[
glFeatureFlagMixin
()],
mixins
:
[
glFeatureFlagMixin
()],
props
:
{
props
:
{
...
...
app/assets/javascripts/boards/components/issue_card_inner_deprecated.vue
View file @
d773d574
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
GlLabel
,
GlTooltipDirective
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLabel
,
GlTooltipDirective
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
mapState
}
from
'
vuex
'
;
import
{
mapState
}
from
'
vuex
'
;
import
issueCardInner
from
'
ee_else_ce/boards/mixins/issue
_card_inner
'
;
import
boardCardInner
from
'
ee_else_ce/boards/mixins/board
_card_inner
'
;
import
{
isScopedLabel
}
from
'
~/lib/utils/common_utils
'
;
import
{
isScopedLabel
}
from
'
~/lib/utils/common_utils
'
;
import
{
sprintf
,
__
,
n__
}
from
'
~/locale
'
;
import
{
sprintf
,
__
,
n__
}
from
'
~/locale
'
;
import
TooltipOnTruncate
from
'
~/vue_shared/components/tooltip_on_truncate.vue
'
;
import
TooltipOnTruncate
from
'
~/vue_shared/components/tooltip_on_truncate.vue
'
;
...
@@ -24,7 +24,7 @@ export default {
...
@@ -24,7 +24,7 @@ export default {
directives
:
{
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlTooltip
:
GlTooltipDirective
,
},
},
mixins
:
[
issue
CardInner
],
mixins
:
[
board
CardInner
],
inject
:
[
'
groupId
'
,
'
rootPath
'
],
inject
:
[
'
groupId
'
,
'
rootPath
'
],
props
:
{
props
:
{
issue
:
{
issue
:
{
...
@@ -207,7 +207,7 @@ export default {
...
@@ -207,7 +207,7 @@ export default {
/>
/>
<issue-time-estimate
v-if=
"issue.timeEstimate"
:estimate=
"issue.timeEstimate"
/>
<issue-time-estimate
v-if=
"issue.timeEstimate"
:estimate=
"issue.timeEstimate"
/>
<issue-card-weight
<issue-card-weight
v-if=
"validIssueWeight"
v-if=
"validIssueWeight
(issue)
"
:weight=
"issue.weight"
:weight=
"issue.weight"
@
click=
"filterByWeight(issue.weight)"
@
click=
"filterByWeight(issue.weight)"
/>
/>
...
...
app/assets/javascripts/boards/components/modal/list.vue
View file @
d773d574
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
import
IssueCardInner
from
'
../issue
_card_inner.vue
'
;
import
BoardCardInner
from
'
../board
_card_inner.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Issue
CardInner
,
Board
CardInner
,
GlIcon
,
GlIcon
,
},
},
props
:
{
props
:
{
...
@@ -126,7 +126,7 @@ export default {
...
@@ -126,7 +126,7 @@ export default {
class="board-card position-relative p-3 rounded"
class="board-card position-relative p-3 rounded"
@click="toggleIssue($event, issue)"
@click="toggleIssue($event, issue)"
>
>
<
issue-card-inner
:issue
=
"issue"
/>
<
board-card-inner
:item
=
"issue"
/>
<gl-icon
<gl-icon
v-if=
"issue.selected"
v-if=
"issue.selected"
:aria-label=
"'Issue #' + issue.id + ' selected'"
:aria-label=
"'Issue #' + issue.id + ' selected'"
...
...
app/assets/javascripts/boards/mixins/
issue
_card_inner.js
→
app/assets/javascripts/boards/mixins/
board
_card_inner.js
View file @
d773d574
export
default
{
export
default
{
computed
:
{
methods
:
{
validIssueWeight
()
{
validIssueWeight
()
{
return
false
;
return
false
;
},
},
},
methods
:
{
filterByWeight
()
{},
filterByWeight
()
{},
},
},
};
};
app/assets/stylesheets/page_bundles/boards.scss
View file @
d773d574
...
@@ -515,7 +515,7 @@
...
@@ -515,7 +515,7 @@
}
}
}
}
.board-i
ssue
-path.js-show-tooltip
{
.board-i
tem
-path.js-show-tooltip
{
cursor
:
help
;
cursor
:
help
;
}
}
...
...
ee/app/assets/javascripts/boards/graphql/lists_epics.query.graphql
View file @
d773d574
...
@@ -18,6 +18,8 @@ query ListEpics(
...
@@ -18,6 +18,8 @@ query ListEpics(
node
{
node
{
...
EpicNode
...
EpicNode
relativePosition
relativePosition
referencePath
:
reference
(
full
:
true
)
confidential
labels
{
labels
{
nodes
{
nodes
{
...
Label
...
Label
...
...
ee/app/assets/javascripts/boards/mixins/
issue
_card_inner.js
→
ee/app/assets/javascripts/boards/mixins/
board
_card_inner.js
View file @
d773d574
import
{
isNumber
}
from
'
lodash
'
;
import
{
isNumber
}
from
'
lodash
'
;
export
default
{
export
default
{
computed
:
{
methods
:
{
validIssueWeight
()
{
validIssueWeight
(
issue
)
{
if
(
this
.
issue
&&
isNumber
(
this
.
issue
.
weight
))
{
if
(
issue
&&
isNumber
(
issue
.
weight
))
{
return
this
.
issue
.
weight
>=
0
;
return
issue
.
weight
>=
0
;
}
}
return
false
;
return
false
;
},
},
},
methods
:
{
filterByWeight
(
weight
)
{
filterByWeight
(
weight
)
{
if
(
!
this
.
updateFilters
)
return
;
if
(
!
this
.
updateFilters
)
return
;
...
...
ee/spec/frontend/boards/
issue
_card_inner_spec.js
→
ee/spec/frontend/boards/
board
_card_inner_spec.js
View file @
d773d574
import
{
GlLabel
}
from
'
@gitlab/ui
'
;
import
{
GlLabel
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
IssueCardWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
import
IssueCardWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
import
IssueCardInner
from
'
~/boards/components/issue
_card_inner.vue
'
;
import
BoardCardInner
from
'
~/boards/components/board
_card_inner.vue
'
;
import
defaultStore
from
'
~/boards/stores
'
;
import
defaultStore
from
'
~/boards/stores
'
;
describe
(
'
Issue
card component
'
,
()
=>
{
describe
(
'
Board
card component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
issue
;
let
issue
;
let
list
;
let
list
;
const
createComponent
=
(
props
=
{},
store
=
defaultStore
)
=>
{
const
createComponent
=
(
props
=
{},
store
=
defaultStore
)
=>
{
wrapper
=
shallowMount
(
Issue
CardInner
,
{
wrapper
=
shallowMount
(
Board
CardInner
,
{
store
,
store
,
propsData
:
{
propsData
:
{
list
,
list
,
issue
,
i
tem
:
i
ssue
,
...
props
,
...
props
,
},
},
provide
:
{
provide
:
{
...
...
spec/frontend/boards/
issue
_card_inner_spec.js
→
spec/frontend/boards/
board
_card_inner_spec.js
View file @
d773d574
import
{
GlLabel
}
from
'
@gitlab/ui
'
;
import
{
GlLabel
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
range
}
from
'
lodash
'
;
import
{
range
}
from
'
lodash
'
;
import
IssueCardInner
from
'
~/boards/components/issue
_card_inner.vue
'
;
import
BoardCardInner
from
'
~/boards/components/board
_card_inner.vue
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
defaultStore
from
'
~/boards/stores
'
;
import
defaultStore
from
'
~/boards/stores
'
;
import
{
updateHistory
}
from
'
~/lib/utils/url_utility
'
;
import
{
updateHistory
}
from
'
~/lib/utils/url_utility
'
;
...
@@ -10,7 +10,7 @@ import { mockLabelList } from './mock_data';
...
@@ -10,7 +10,7 @@ import { mockLabelList } from './mock_data';
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
jest
.
mock
(
'
~/boards/eventhub
'
);
jest
.
mock
(
'
~/boards/eventhub
'
);
describe
(
'
Issue
card component
'
,
()
=>
{
describe
(
'
Board
card component
'
,
()
=>
{
const
user
=
{
const
user
=
{
id
:
1
,
id
:
1
,
name
:
'
testing 123
'
,
name
:
'
testing 123
'
,
...
@@ -31,11 +31,11 @@ describe('Issue card component', () => {
...
@@ -31,11 +31,11 @@ describe('Issue card component', () => {
let
list
;
let
list
;
const
createWrapper
=
(
props
=
{},
store
=
defaultStore
)
=>
{
const
createWrapper
=
(
props
=
{},
store
=
defaultStore
)
=>
{
wrapper
=
mount
(
Issue
CardInner
,
{
wrapper
=
mount
(
Board
CardInner
,
{
store
,
store
,
propsData
:
{
propsData
:
{
list
,
list
,
issue
,
i
tem
:
i
ssue
,
...
props
,
...
props
,
},
},
stubs
:
{
stubs
:
{
...
@@ -63,7 +63,7 @@ describe('Issue card component', () => {
...
@@ -63,7 +63,7 @@ describe('Issue card component', () => {
weight
:
1
,
weight
:
1
,
};
};
createWrapper
({
issue
,
list
});
createWrapper
({
i
tem
:
i
ssue
,
list
});
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -103,8 +103,8 @@ describe('Issue card component', () => {
...
@@ -103,8 +103,8 @@ describe('Issue card component', () => {
describe
(
'
confidential issue
'
,
()
=>
{
describe
(
'
confidential issue
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
confidential
:
true
,
confidential
:
true
,
},
},
});
});
...
@@ -119,8 +119,8 @@ describe('Issue card component', () => {
...
@@ -119,8 +119,8 @@ describe('Issue card component', () => {
describe
(
'
with avatar
'
,
()
=>
{
describe
(
'
with avatar
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
assignees
:
[
user
],
assignees
:
[
user
],
updateData
(
newData
)
{
updateData
(
newData
)
{
Object
.
assign
(
this
,
newData
);
Object
.
assign
(
this
,
newData
);
...
@@ -146,8 +146,8 @@ describe('Issue card component', () => {
...
@@ -146,8 +146,8 @@ describe('Issue card component', () => {
});
});
it
(
'
renders the avatar using avatarUrl property
'
,
async
()
=>
{
it
(
'
renders the avatar using avatarUrl property
'
,
async
()
=>
{
wrapper
.
props
(
'
i
ssue
'
).
updateData
({
wrapper
.
props
(
'
i
tem
'
).
updateData
({
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
assignees
:
[
assignees
:
[
{
{
id
:
'
1
'
,
id
:
'
1
'
,
...
@@ -172,8 +172,8 @@ describe('Issue card component', () => {
...
@@ -172,8 +172,8 @@ describe('Issue card component', () => {
global
.
gon
.
default_avatar_url
=
'
default_avatar
'
;
global
.
gon
.
default_avatar_url
=
'
default_avatar
'
;
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
assignees
:
[
assignees
:
[
{
{
id
:
1
,
id
:
1
,
...
@@ -201,8 +201,8 @@ describe('Issue card component', () => {
...
@@ -201,8 +201,8 @@ describe('Issue card component', () => {
describe
(
'
multiple assignees
'
,
()
=>
{
describe
(
'
multiple assignees
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
assignees
:
[
assignees
:
[
{
{
id
:
2
,
id
:
2
,
...
@@ -233,7 +233,7 @@ describe('Issue card component', () => {
...
@@ -233,7 +233,7 @@ describe('Issue card component', () => {
describe
(
'
more than three assignees
'
,
()
=>
{
describe
(
'
more than three assignees
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
{
assignees
}
=
wrapper
.
props
(
'
i
ssue
'
);
const
{
assignees
}
=
wrapper
.
props
(
'
i
tem
'
);
assignees
.
push
({
assignees
.
push
({
id
:
5
,
id
:
5
,
name
:
'
user5
'
,
name
:
'
user5
'
,
...
@@ -242,8 +242,8 @@ describe('Issue card component', () => {
...
@@ -242,8 +242,8 @@ describe('Issue card component', () => {
});
});
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
assignees
,
assignees
,
},
},
});
});
...
@@ -259,7 +259,7 @@ describe('Issue card component', () => {
...
@@ -259,7 +259,7 @@ describe('Issue card component', () => {
it
(
'
renders 99+ avatar counter
'
,
async
()
=>
{
it
(
'
renders 99+ avatar counter
'
,
async
()
=>
{
const
assignees
=
[
const
assignees
=
[
...
wrapper
.
props
(
'
i
ssue
'
).
assignees
,
...
wrapper
.
props
(
'
i
tem
'
).
assignees
,
...
range
(
5
,
103
).
map
((
i
)
=>
({
...
range
(
5
,
103
).
map
((
i
)
=>
({
id
:
i
,
id
:
i
,
name
:
'
name
'
,
name
:
'
name
'
,
...
@@ -268,8 +268,8 @@ describe('Issue card component', () => {
...
@@ -268,8 +268,8 @@ describe('Issue card component', () => {
})),
})),
];
];
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
assignees
,
assignees
,
},
},
});
});
...
@@ -283,7 +283,7 @@ describe('Issue card component', () => {
...
@@ -283,7 +283,7 @@ describe('Issue card component', () => {
describe
(
'
labels
'
,
()
=>
{
describe
(
'
labels
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
.
setProps
({
i
ssue
:
{
...
issue
,
labels
:
[
list
.
label
,
label1
]
}
});
wrapper
.
setProps
({
i
tem
:
{
...
issue
,
labels
:
[
list
.
label
,
label1
]
}
});
});
});
it
(
'
does not render list label but renders all other labels
'
,
()
=>
{
it
(
'
does not render list label but renders all other labels
'
,
()
=>
{
...
@@ -295,7 +295,7 @@ describe('Issue card component', () => {
...
@@ -295,7 +295,7 @@ describe('Issue card component', () => {
});
});
it
(
'
does not render label if label does not have an ID
'
,
async
()
=>
{
it
(
'
does not render label if label does not have an ID
'
,
async
()
=>
{
wrapper
.
setProps
({
i
ssue
:
{
...
issue
,
labels
:
[
label1
,
{
title
:
'
closed
'
}]
}
});
wrapper
.
setProps
({
i
tem
:
{
...
issue
,
labels
:
[
label1
,
{
title
:
'
closed
'
}]
}
});
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
...
@@ -307,8 +307,8 @@ describe('Issue card component', () => {
...
@@ -307,8 +307,8 @@ describe('Issue card component', () => {
describe
(
'
blocked
'
,
()
=>
{
describe
(
'
blocked
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
.
setProps
({
wrapper
.
setProps
({
i
ssue
:
{
i
tem
:
{
...
wrapper
.
props
(
'
i
ssue
'
),
...
wrapper
.
props
(
'
i
tem
'
),
blocked
:
true
,
blocked
:
true
,
},
},
});
});
...
...
spec/frontend/boards/components/board_card_deprecated_spec.js
View file @
d773d574
...
@@ -7,7 +7,7 @@ import { mount } from '@vue/test-utils';
...
@@ -7,7 +7,7 @@ import { mount } from '@vue/test-utils';
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
BoardCardDeprecated
from
'
~/boards/components/board_card_deprecated.vue
'
;
import
BoardCardDeprecated
from
'
~/boards/components/board_card_deprecated.vue
'
;
import
issueCardInner
from
'
~/boards/components/issue_card_inner.vue
'
;
import
issueCardInner
from
'
~/boards/components/issue_card_inner
_deprecated
.vue
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
store
from
'
~/boards/stores
'
;
import
store
from
'
~/boards/stores
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
...
...
spec/frontend/boards/components/board_card_layout_deprecated_spec.js
View file @
d773d574
...
@@ -11,7 +11,7 @@ import '~/boards/models/label';
...
@@ -11,7 +11,7 @@ import '~/boards/models/label';
import
'
~/boards/models/assignee
'
;
import
'
~/boards/models/assignee
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/list
'
;
import
BoardCardLayout
from
'
~/boards/components/board_card_layout_deprecated.vue
'
;
import
BoardCardLayout
from
'
~/boards/components/board_card_layout_deprecated.vue
'
;
import
issueCardInner
from
'
~/boards/components/issue_card_inner.vue
'
;
import
issueCardInner
from
'
~/boards/components/issue_card_inner
_deprecated
.vue
'
;
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
boardsVuexStore
from
'
~/boards/stores
'
;
import
boardsVuexStore
from
'
~/boards/stores
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
...
...
spec/frontend/boards/components/board_card_spec.js
View file @
d773d574
...
@@ -2,7 +2,7 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
...
@@ -2,7 +2,7 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
BoardCard
from
'
~/boards/components/board_card.vue
'
;
import
BoardCard
from
'
~/boards/components/board_card.vue
'
;
import
IssueCardInner
from
'
~/boards/components/issue
_card_inner.vue
'
;
import
BoardCardInner
from
'
~/boards/components/board
_card_inner.vue
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
import
{
mockLabelList
,
mockIssue
}
from
'
../mock_data
'
;
import
{
mockLabelList
,
mockIssue
}
from
'
../mock_data
'
;
...
@@ -38,7 +38,7 @@ describe('Board card layout', () => {
...
@@ -38,7 +38,7 @@ describe('Board card layout', () => {
wrapper
=
shallowMount
(
BoardCard
,
{
wrapper
=
shallowMount
(
BoardCard
,
{
localVue
,
localVue
,
stubs
:
{
stubs
:
{
Issue
CardInner
,
Board
CardInner
,
},
},
store
,
store
,
propsData
:
{
propsData
:
{
...
...
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