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
d2c573c3
Commit
d2c573c3
authored
Sep 15, 2020
by
Scott Stern
Committed by
Illya Klymov
Sep 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move issuable title to component
parent
ca0859c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
14 deletions
+61
-14
app/assets/javascripts/boards/components/issuable_title.vue
app/assets/javascripts/boards/components/issuable_title.vue
+21
-0
ee/app/assets/javascripts/boards/components/board_content_sidebar.vue
...s/javascripts/boards/components/board_content_sidebar.vue
+3
-7
ee/spec/frontend/boards/components/board_content_sidebar_spec.js
.../frontend/boards/components/board_content_sidebar_spec.js
+4
-7
spec/frontend/boards/components/issuable_title_spec.js
spec/frontend/boards/components/issuable_title_spec.js
+33
-0
No files found.
app/assets/javascripts/boards/components/issuable_title.vue
0 → 100644
View file @
d2c573c3
<
script
>
export
default
{
props
:
{
title
:
{
type
:
String
,
required
:
true
,
},
refPath
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
data-testid=
"issue-title"
>
<p
class=
"gl-font-weight-bold"
>
{{
title
}}
</p>
<p
class=
"gl-mb-0"
>
{{
refPath
}}
</p>
</div>
</
template
>
ee/app/assets/javascripts/boards/components/board_content_sidebar.vue
View file @
d2c573c3
...
@@ -4,12 +4,14 @@ import { GlDrawer } from '@gitlab/ui';
...
@@ -4,12 +4,14 @@ import { GlDrawer } from '@gitlab/ui';
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
{
contentTop
}
from
'
~/lib/utils/common_utils
'
;
import
{
contentTop
}
from
'
~/lib/utils/common_utils
'
;
import
IssuableAssignees
from
'
~/sidebar/components/assignees/issuable_assignees.vue
'
;
import
IssuableAssignees
from
'
~/sidebar/components/assignees/issuable_assignees.vue
'
;
import
IssuableTitle
from
'
~/boards/components/issuable_title.vue
'
;
export
default
{
export
default
{
headerHeight
:
`
${
contentTop
()}
px`
,
headerHeight
:
`
${
contentTop
()}
px`
,
components
:
{
components
:
{
IssuableAssignees
,
IssuableAssignees
,
GlDrawer
,
GlDrawer
,
IssuableTitle
,
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'
isSidebarOpen
'
,
'
getActiveIssue
'
]),
...
mapGetters
([
'
isSidebarOpen
'
,
'
getActiveIssue
'
]),
...
@@ -17,9 +19,6 @@ export default {
...
@@ -17,9 +19,6 @@ export default {
showSidebar
()
{
showSidebar
()
{
return
this
.
sidebarType
===
ISSUABLE
;
return
this
.
sidebarType
===
ISSUABLE
;
},
},
issueTitle
()
{
return
this
.
getActiveIssue
.
title
;
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
unsetActiveId
'
]),
...
mapActions
([
'
unsetActiveId
'
]),
...
@@ -35,10 +34,7 @@ export default {
...
@@ -35,10 +34,7 @@ export default {
@
close=
"unsetActiveId"
@
close=
"unsetActiveId"
>
>
<template
#header
>
<template
#header
>
<div
data-testid=
"issue-title"
>
<issuable-title
:ref-path=
"getActiveIssue.referencePath"
:title=
"getActiveIssue.title"
/>
<p
class=
"gl-font-weight-bold"
>
{{
issueTitle
}}
</p>
<p
class=
"gl-mb-0"
>
{{
getActiveIssue
.
referencePath
}}
</p>
</div>
</
template
>
</
template
>
<
template
>
<
template
>
...
...
ee/spec/frontend/boards/components/board_content_sidebar_spec.js
View file @
d2c573c3
...
@@ -3,6 +3,7 @@ import { GlDrawer } from '@gitlab/ui';
...
@@ -3,6 +3,7 @@ import { GlDrawer } from '@gitlab/ui';
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
BoardContentSidebar
from
'
ee_component/boards/components/board_content_sidebar.vue
'
;
import
BoardContentSidebar
from
'
ee_component/boards/components/board_content_sidebar.vue
'
;
import
IssuableAssignees
from
'
~/sidebar/components/assignees/issuable_assignees.vue
'
;
import
IssuableAssignees
from
'
~/sidebar/components/assignees/issuable_assignees.vue
'
;
import
IssuableTitle
from
'
~/boards/components/issuable_title.vue
'
;
import
{
createStore
}
from
'
~/boards/stores
'
;
import
{
createStore
}
from
'
~/boards/stores
'
;
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
import
{
ISSUABLE
}
from
'
~/boards/constants
'
;
...
@@ -22,7 +23,6 @@ describe('ee/BoardContentSidebar', () => {
...
@@ -22,7 +23,6 @@ describe('ee/BoardContentSidebar', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
store
=
createStore
();
store
=
createStore
();
store
.
state
.
sidebarType
=
ISSUABLE
;
store
.
state
.
sidebarType
=
ISSUABLE
;
store
.
state
.
activeId
=
1
;
store
.
state
.
issues
=
{
'
1
'
:
{
title
:
'
One
'
,
referencePath
:
'
path
'
,
assignees
:
[]
}
};
store
.
state
.
issues
=
{
'
1
'
:
{
title
:
'
One
'
,
referencePath
:
'
path
'
,
assignees
:
[]
}
};
store
.
state
.
activeId
=
'
1
'
;
store
.
state
.
activeId
=
'
1
'
;
...
@@ -31,6 +31,7 @@ describe('ee/BoardContentSidebar', () => {
...
@@ -31,6 +31,7 @@ describe('ee/BoardContentSidebar', () => {
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
wrapper
=
null
;
});
});
it
(
'
confirms we render GlDrawer
'
,
()
=>
{
it
(
'
confirms we render GlDrawer
'
,
()
=>
{
...
@@ -41,12 +42,8 @@ describe('ee/BoardContentSidebar', () => {
...
@@ -41,12 +42,8 @@ describe('ee/BoardContentSidebar', () => {
expect
(
wrapper
.
find
(
GlDrawer
).
props
(
'
open
'
)).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlDrawer
).
props
(
'
open
'
)).
toBe
(
true
);
});
});
it
(
'
renders a title of an issue in the sidebar
'
,
()
=>
{
it
(
'
finds IssuableTitle
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
[data-testid="issue-title"]
'
).
text
()).
toContain
(
'
One
'
);
expect
(
wrapper
.
find
(
IssuableTitle
).
text
()).
toContain
(
'
One
'
);
});
it
(
'
renders a referencePath of an issue in the sidebar
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
[data-testid="issue-title"]
'
).
text
()).
toContain
(
'
path
'
);
});
});
it
(
'
renders IssuableAssignees
'
,
()
=>
{
it
(
'
renders IssuableAssignees
'
,
()
=>
{
...
...
spec/frontend/boards/components/issuable_title_spec.js
0 → 100644
View file @
d2c573c3
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
IssuableTitle
from
'
~/boards/components/issuable_title.vue
'
;
describe
(
'
IssuableTitle
'
,
()
=>
{
let
wrapper
;
const
defaultProps
=
{
title
:
'
One
'
,
refPath
:
'
path
'
,
};
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
IssuableTitle
,
{
propsData
:
{
...
defaultProps
},
});
};
const
findIssueContent
=
()
=>
wrapper
.
find
(
'
[data-testid="issue-title"]
'
);
beforeEach
(()
=>
{
createComponent
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
it
(
'
renders a title of an issue in the sidebar
'
,
()
=>
{
expect
(
findIssueContent
().
text
()).
toContain
(
'
One
'
);
});
it
(
'
renders a referencePath of an issue in the sidebar
'
,
()
=>
{
expect
(
findIssueContent
().
text
()).
toContain
(
'
path
'
);
});
});
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