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
d75ca922
Commit
d75ca922
authored
Jun 26, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
use pre-existing components for title and description
parent
5495454c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
70 deletions
+70
-70
app/assets/javascripts/ide/components/merge_requests/info.vue
...assets/javascripts/ide/components/merge_requests/info.vue
+14
-14
app/assets/javascripts/issue_show/components/title.vue
app/assets/javascripts/issue_show/components/title.vue
+56
-56
No files found.
app/assets/javascripts/ide/components/merge_requests/info.vue
View file @
d75ca922
...
@@ -3,6 +3,8 @@ import { mapGetters } from 'vuex';
...
@@ -3,6 +3,8 @@ import { mapGetters } from 'vuex';
import
Icon
from
'
../../../vue_shared/components/icon.vue
'
;
import
Icon
from
'
../../../vue_shared/components/icon.vue
'
;
import
timeago
from
'
../../../vue_shared/mixins/timeago
'
;
import
timeago
from
'
../../../vue_shared/mixins/timeago
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
import
TitleComponent
from
'
../../../issue_show/components/title.vue
'
;
import
DescriptionComponent
from
'
../../../issue_show/components/description.vue
'
;
const
states
=
{
const
states
=
{
open
:
'
open
'
,
open
:
'
open
'
,
...
@@ -15,6 +17,8 @@ export default {
...
@@ -15,6 +17,8 @@ export default {
},
},
components
:
{
components
:
{
Icon
,
Icon
,
TitleComponent
,
DescriptionComponent
,
},
},
mixins
:
[
timeago
],
mixins
:
[
timeago
],
computed
:
{
computed
:
{
...
@@ -72,20 +76,16 @@ export default {
...
@@ -72,20 +76,16 @@ export default {
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"detail-page-description"
>
<div
class=
"issuable-details"
>
<h2
class=
"title"
>
<title-component
{{
currentMergeRequest
.
title
}}
:issuable-ref=
"currentMergeRequest.iid"
</h2>
:title-html=
"currentMergeRequest.title"
<div
:title-text=
"currentMergeRequest.title"
v-if=
"currentMergeRequest.description"
/>
class=
"description"
<description-component
>
:description-html=
"currentMergeRequest.description"
<div
class=
"wiki"
>
:description-text=
"currentMergeRequest.description"
<p
dir=
"auto"
>
/>
{{
currentMergeRequest
.
description
}}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
app/assets/javascripts/issue_show/components/title.vue
View file @
d75ca922
<
script
>
<
script
>
import
animateMixin
from
'
../mixins/animate
'
;
import
animateMixin
from
'
../mixins/animate
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
{
spriteIcon
}
from
'
../../lib/utils/common_utils
'
;
import
{
spriteIcon
}
from
'
../../lib/utils/common_utils
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
tooltip
,
tooltip
,
},
mixins
:
[
animateMixin
],
props
:
{
issuableRef
:
{
type
:
[
String
,
Number
],
required
:
true
,
},
},
mixins
:
[
animateMixin
],
canUpdate
:
{
props
:
{
required
:
false
,
issuableRef
:
{
type
:
Boolean
,
type
:
String
,
default
:
false
,
required
:
true
,
},
canUpdate
:
{
required
:
false
,
type
:
Boolean
,
default
:
false
,
},
titleHtml
:
{
type
:
String
,
required
:
true
,
},
titleText
:
{
type
:
String
,
required
:
true
,
},
showInlineEditButton
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
},
data
()
{
titleHtml
:
{
return
{
type
:
String
,
preAnimation
:
false
,
required
:
true
,
pulseAnimation
:
false
,
titleEl
:
document
.
querySelector
(
'
title
'
),
};
},
},
computed
:
{
titleText
:
{
pencilIcon
()
{
type
:
String
,
return
spriteIcon
(
'
pencil
'
,
'
link-highlight
'
);
required
:
true
,
},
},
},
watch
:
{
showInlineEditButton
:
{
titleHtml
()
{
type
:
Boolean
,
this
.
setPageTitle
();
required
:
false
,
this
.
animateChange
();
default
:
false
,
},
},
},
methods
:
{
},
setPageTitle
()
{
data
()
{
const
currentPageTitleScope
=
this
.
titleEl
.
innerText
.
split
(
'
·
'
);
return
{
currentPageTitleScope
[
0
]
=
`
${
this
.
titleText
}
(
${
this
.
issuableRef
}
) `
;
preAnimation
:
false
,
this
.
titleEl
.
textContent
=
currentPageTitleScope
.
join
(
'
·
'
);
pulseAnimation
:
false
,
},
titleEl
:
document
.
querySelector
(
'
title
'
),
edit
()
{
};
eventHub
.
$emit
(
'
open.form
'
);
},
},
computed
:
{
pencilIcon
()
{
return
spriteIcon
(
'
pencil
'
,
'
link-highlight
'
);
},
},
};
},
watch
:
{
titleHtml
()
{
this
.
setPageTitle
();
this
.
animateChange
();
},
},
methods
:
{
setPageTitle
()
{
const
currentPageTitleScope
=
this
.
titleEl
.
innerText
.
split
(
'
·
'
);
currentPageTitleScope
[
0
]
=
`
${
this
.
titleText
}
(
${
this
.
issuableRef
}
) `
;
this
.
titleEl
.
textContent
=
currentPageTitleScope
.
join
(
'
·
'
);
},
edit
()
{
eventHub
.
$emit
(
'
open.form
'
);
},
},
};
</
script
>
</
script
>
<
template
>
<
template
>
...
...
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