BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
49ce7af5
Commit
49ce7af5
authored
May 18, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-description-on-page' into '9-2-stable'
Initial render of issue title & description See merge request !11491
parents
a975cb8d
042f0a30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
index.js
app/assets/javascripts/issue_show/index.js
+4
-0
issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+12
-4
show.html.haml
app/views/projects/issues/show.html.haml
+5
-0
issue_title_description_spec.js
spec/javascripts/issue_show/issue_title_description_spec.js
+5
-0
No files found.
app/assets/javascripts/issue_show/index.js
View file @
49ce7af5
...
...
@@ -4,6 +4,8 @@ import '../vue_shared/vue_resource_interceptor';
(()
=>
{
const
issueTitleData
=
document
.
querySelector
(
'.issue-title-data'
).
dataset
;
const
initialTitle
=
document
.
querySelector
(
'.js-issue-title'
).
innerHTML
;
const
initialDescription
=
document
.
querySelector
(
'.js-issue-description'
);
const
{
canUpdateTasksClass
,
endpoint
,
isEdited
}
=
issueTitleData
;
const
vm
=
new
Vue
({
...
...
@@ -13,6 +15,8 @@ import '../vue_shared/vue_resource_interceptor';
canUpdateTasksClass
,
endpoint
,
isEdited
,
initialTitle
,
initialDescription
:
initialDescription
?
initialDescription
.
innerHTML
:
''
,
},
}),
});
...
...
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
49ce7af5
...
...
@@ -20,6 +20,14 @@ export default {
default
:
false
,
required
:
false
,
},
initialTitle
:
{
type
:
String
,
required
:
true
,
},
initialDescription
:
{
type
:
String
,
required
:
true
,
},
},
data
()
{
const
resource
=
new
Service
(
this
.
$http
,
this
.
endpoint
);
...
...
@@ -39,17 +47,17 @@ export default {
poll
,
apiData
:
{},
tasks
:
'0 of 0'
,
title
:
null
,
title
:
this
.
initialTitle
,
titleText
:
''
,
titleFlag
:
{
pre
:
tru
e
,
pre
:
fals
e
,
pulse
:
false
,
},
description
:
null
,
description
:
this
.
initialDescription
,
descriptionText
:
''
,
descriptionChange
:
false
,
descriptionFlag
:
{
pre
:
tru
e
,
pre
:
fals
e
,
pulse
:
false
,
},
titleEl
:
document
.
querySelector
(
'title'
),
...
...
app/views/projects/issues/show.html.haml
View file @
49ce7af5
...
...
@@ -56,6 +56,11 @@
"is-edited"
:
@issue
.
is_edited?
,
}
}
.issue-title-entrypoint
%h2
.title.js-issue-title
=
markdown_field
(
@issue
,
:title
)
-
if
@issue
.
description
.
present?
.description
{
class:
can?
(
current_user
,
:update_issue
,
@issue
)
?
'js-task-list-container'
:
''
}
.wiki.js-issue-description
=
markdown_field
(
@issue
,
:description
)
%textarea
.hidden.js-task-list-field
=
@issue
.
description
#merge-requests
{
data:
{
url:
referenced_merge_requests_namespace_project_issue_url
(
@project
.
namespace
,
@project
,
@issue
)
}
}
// This element is filled in using JavaScript.
...
...
spec/javascripts/issue_show/issue_title_description_spec.js
View file @
49ce7af5
...
...
@@ -40,9 +40,14 @@ describe('Issue Title', () => {
propsData
:
{
canUpdateIssue
:
'.css-stuff'
,
endpoint
:
'/gitlab-org/gitlab-shell/issues/9/rendered_title'
,
initialTitle
:
'test'
,
initialDescription
:
'testing'
,
},
}).
$mount
();
expect
(
issueShowComponent
.
$el
.
querySelector
(
'.title'
).
innerHTML
).
toContain
(
'test'
);
expect
(
issueShowComponent
.
$el
.
querySelector
(
'.wiki'
).
innerHTML
).
toContain
(
'testing'
);
setTimeout
(()
=>
{
const
editedText
=
issueShowComponent
.
$el
.
querySelector
(
'.edited-text'
);
...
...
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