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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
efc9408f
Commit
efc9408f
authored
May 15, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added description template selector
[ci skip]
parent
14387b49
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
15 deletions
+138
-15
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+7
-1
app/assets/javascripts/issue_show/components/fields/template.vue
...ets/javascripts/issue_show/components/fields/template.vue
+84
-0
app/assets/javascripts/issue_show/components/fields/title.vue
...assets/javascripts/issue_show/components/fields/title.vue
+29
-13
app/assets/javascripts/issue_show/components/title.vue
app/assets/javascripts/issue_show/components/title.vue
+7
-1
app/assets/javascripts/issue_show/index.js
app/assets/javascripts/issue_show/index.js
+4
-0
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+6
-0
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+1
-0
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
efc9408f
...
@@ -41,6 +41,11 @@ export default {
...
@@ -41,6 +41,11 @@ export default {
required
:
false
,
required
:
false
,
default
:
''
,
default
:
''
,
},
},
issuableTemplates
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
},
},
data
()
{
data
()
{
const
store
=
new
Store
({
const
store
=
new
Store
({
...
@@ -146,7 +151,8 @@ export default {
...
@@ -146,7 +151,8 @@ export default {
:show-form=
"showForm"
:show-form=
"showForm"
:issuable-ref=
"issuableRef"
:issuable-ref=
"issuableRef"
:title-html=
"state.titleHtml"
:title-html=
"state.titleHtml"
:title-text=
"state.titleText"
/>
:title-text=
"state.titleText"
:issuable-templates=
"issuableTemplates"
/>
<description-component
<description-component
v-if=
"state.descriptionHtml"
v-if=
"state.descriptionHtml"
:can-update=
"canUpdate"
:can-update=
"canUpdate"
...
...
app/assets/javascripts/issue_show/components/fields/template.vue
0 → 100644
View file @
efc9408f
<
script
>
export
default
{
props
:
{
issuableTemplates
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
},
mounted
()
{
return
new
gl
.
IssuableTemplateSelectors
();
},
};
</
script
>
<
template
>
<div
class=
"dropdown js-issuable-selector-wrap"
data-issuable-type=
"issue"
>
<button
class=
"dropdown-menu-toggle js-issuable-selector"
type=
"button"
:data-data=
"JSON.stringify(issuableTemplates)"
data-field-name=
"issuable_template"
data-selected=
"null"
data-project-path=
"gitlab-ce"
data-namespace-path=
"gitlab-org"
data-toggle=
"dropdown"
>
<span
class=
"dropdown-toggle-text "
>
Choose a template
</span>
<i
aria-hidden=
"true"
class=
"fa fa-chevron-down"
>
</i>
</button>
<div
class=
"dropdown-menu dropdown-select"
>
<div
class=
"dropdown-title"
>
Choose a template
<button
class=
"dropdown-title-button dropdown-menu-close"
aria-label=
"Close"
type=
"button"
>
<i
aria-hidden=
"true"
class=
"fa fa-times dropdown-menu-close-icon"
>
</i>
</button>
</div>
<div
class=
"dropdown-input"
>
<input
type=
"search"
class=
"dropdown-input-field"
placeholder=
"Filter"
autocomplete=
"off"
/>
<i
aria-hidden=
"true"
class=
"fa fa-search dropdown-input-search"
>
</i>
<i
role=
"button"
aria-hidden=
"true"
class=
"fa fa-times dropdown-input-clear js-dropdown-input-clear"
>
</i>
</div>
<div
class=
"dropdown-content "
>
</div>
<div
class=
"dropdown-footer"
>
<ul
class=
"dropdown-footer-list"
>
<li>
<a
class=
"no-template"
>
No template
</a>
</li>
<li>
<a
class=
"reset-template"
>
Reset template
</a>
</li>
</ul>
</div>
</div>
</div>
</
template
>
app/assets/javascripts/issue_show/components/fields/title.vue
View file @
efc9408f
<
script
>
<
script
>
import
descriptionTemplate
from
'
./template.vue
'
;
export
default
{
export
default
{
props
:
{
props
:
{
store
:
{
store
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
issuableTemplates
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
},
},
data
()
{
data
()
{
return
{
return
{
state
:
this
.
store
.
formState
,
state
:
this
.
store
.
formState
,
};
};
},
},
components
:
{
descriptionTemplate
,
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<fieldset>
<fieldset
class=
"row"
>
<label
<div
class=
"col-sm-4 col-lg-3"
>
class=
"sr-only"
<description-template
for=
"issue-title"
>
:issuable-templates=
"issuableTemplates"
/>
Title
</div>
</label>
<div
class=
"col-sm-8 col-lg-9"
>
<input
<label
id=
"issue-title"
class=
"sr-only"
class=
"form-control"
for=
"issue-title"
>
type=
"text"
Title
placeholder=
"Issue title"
</label>
aria-label=
"Issue title"
<input
v-model=
"state.title"
/>
id=
"issue-title"
class=
"form-control"
type=
"text"
placeholder=
"Issue title"
aria-label=
"Issue title"
v-model=
"state.title"
/>
</div>
</fieldset>
</fieldset>
</
template
>
</
template
>
app/assets/javascripts/issue_show/components/title.vue
View file @
efc9408f
...
@@ -35,6 +35,11 @@
...
@@ -35,6 +35,11 @@
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
issuableTemplates
:
{
type
:
Array
,
required
:
true
,
default
:
()
=>
[],
},
},
},
watch
:
{
watch
:
{
titleHtml
()
{
titleHtml
()
{
...
@@ -56,7 +61,8 @@
...
@@ -56,7 +61,8 @@
<div>
<div>
<title-field
<title-field
v-if=
"showForm"
v-if=
"showForm"
:store=
"store"
/>
:store=
"store"
:issuable-templates=
"issuableTemplates"
/>
<h2
<h2
v-else
v-else
class=
"title"
class=
"title"
...
...
app/assets/javascripts/issue_show/index.js
View file @
efc9408f
...
@@ -4,6 +4,8 @@ import issuableApp from './components/app.vue';
...
@@ -4,6 +4,8 @@ import issuableApp from './components/app.vue';
import
'
../vue_shared/vue_resource_interceptor
'
;
import
'
../vue_shared/vue_resource_interceptor
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
initialDataEl
=
document
.
getElementById
(
'
js-issuable-app-initial-data
'
);
const
initialData
=
JSON
.
parse
(
initialDataEl
.
innerHTML
.
replace
(
/"/g
,
'
"
'
));
$
(
'
.issuable-edit
'
).
on
(
'
click
'
,
(
e
)
=>
{
$
(
'
.issuable-edit
'
).
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -35,6 +37,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -35,6 +37,7 @@ document.addEventListener('DOMContentLoaded', () => {
initialTitle
:
issuableTitleElement
.
innerHTML
,
initialTitle
:
issuableTitleElement
.
innerHTML
,
initialDescriptionHtml
:
issuableDescriptionElement
?
issuableDescriptionElement
.
innerHTML
:
''
,
initialDescriptionHtml
:
issuableDescriptionElement
?
issuableDescriptionElement
.
innerHTML
:
''
,
initialDescriptionText
:
issuableDescriptionTextarea
?
issuableDescriptionTextarea
.
textContent
:
''
,
initialDescriptionText
:
issuableDescriptionTextarea
?
issuableDescriptionTextarea
.
textContent
:
''
,
issuableTemplates
:
initialData
.
templates
,
};
};
},
},
render
(
createElement
)
{
render
(
createElement
)
{
...
@@ -47,6 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -47,6 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
initialTitle
:
this
.
initialTitle
,
initialTitle
:
this
.
initialTitle
,
initialDescriptionHtml
:
this
.
initialDescriptionHtml
,
initialDescriptionHtml
:
this
.
initialDescriptionHtml
,
initialDescriptionText
:
this
.
initialDescriptionText
,
initialDescriptionText
:
this
.
initialDescriptionText
,
issuableTemplates
:
this
.
issuableTemplates
,
},
},
});
});
},
},
...
...
app/helpers/issuables_helper.rb
View file @
efc9408f
...
@@ -199,6 +199,12 @@ module IssuablesHelper
...
@@ -199,6 +199,12 @@ module IssuablesHelper
issuable_filter_params
.
any?
{
|
k
|
params
.
key?
(
k
)
}
issuable_filter_params
.
any?
{
|
k
|
params
.
key?
(
k
)
}
end
end
def
issuable_initial_data
(
issuable
)
{
templates:
issuable_templates
(
issuable
)
}.
to_json
end
private
private
def
sidebar_gutter_collapsed?
def
sidebar_gutter_collapsed?
...
...
app/views/projects/issues/show.html.haml
View file @
efc9408f
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
.issue-details.issuable-details
.issue-details.issuable-details
.detail-page-description.content-block
.detail-page-description.content-block
%script
#js-issuable-app-initial-data
{
type:
"application/json"
}=
issuable_initial_data
(
@issue
)
#js-issuable-app
{
"data"
=>
{
"endpoint"
=>
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
#js-issuable-app
{
"data"
=>
{
"endpoint"
=>
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
"can-update"
=>
can?
(
current_user
,
:update_issue
,
@issue
).
to_s
,
"can-update"
=>
can?
(
current_user
,
:update_issue
,
@issue
).
to_s
,
"can-destroy"
=>
can?
(
current_user
,
:destroy_issue
,
@issue
).
to_s
,
"can-destroy"
=>
can?
(
current_user
,
:destroy_issue
,
@issue
).
to_s
,
...
...
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