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
c4fea61f
Commit
c4fea61f
authored
May 15, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added inline confidential field
[ci skip]
parent
36df19e7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
1 deletion
+46
-1
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+17
-1
app/assets/javascripts/issue_show/components/fields/confidential_checkbox.vue
...ts/issue_show/components/fields/confidential_checkbox.vue
+23
-0
app/assets/javascripts/issue_show/index.js
app/assets/javascripts/issue_show/index.js
+3
-0
app/assets/javascripts/issue_show/stores/index.js
app/assets/javascripts/issue_show/stores/index.js
+1
-0
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+1
-0
spec/javascripts/issue_show/components/app_spec.js
spec/javascripts/issue_show/components/app_spec.js
+1
-0
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
c4fea61f
...
@@ -7,6 +7,7 @@ import Service from '../services/index';
...
@@ -7,6 +7,7 @@ import Service from '../services/index';
import
Store
from
'
../stores
'
;
import
Store
from
'
../stores
'
;
import
titleComponent
from
'
./title.vue
'
;
import
titleComponent
from
'
./title.vue
'
;
import
descriptionComponent
from
'
./description.vue
'
;
import
descriptionComponent
from
'
./description.vue
'
;
import
confidentialCheckbox
from
'
./fields/confidential_checkbox.vue
'
;
import
editActions
from
'
./edit_actions.vue
'
;
import
editActions
from
'
./edit_actions.vue
'
;
export
default
{
export
default
{
...
@@ -41,6 +42,10 @@ export default {
...
@@ -41,6 +42,10 @@ export default {
required
:
false
,
required
:
false
,
default
:
''
,
default
:
''
,
},
},
isConfidential
:
{
type
:
Boolean
,
required
:
true
,
},
},
},
data
()
{
data
()
{
const
store
=
new
Store
({
const
store
=
new
Store
({
...
@@ -67,12 +72,14 @@ export default {
...
@@ -67,12 +72,14 @@ export default {
descriptionComponent
,
descriptionComponent
,
titleComponent
,
titleComponent
,
editActions
,
editActions
,
confidentialCheckbox
,
},
},
methods
:
{
methods
:
{
openForm
()
{
openForm
()
{
this
.
showForm
=
true
;
this
.
showForm
=
true
;
this
.
store
.
formState
=
{
this
.
store
.
formState
=
{
title
:
this
.
state
.
titleText
,
title
:
this
.
state
.
titleText
,
confidential
:
this
.
isConfidential
,
};
};
},
},
closeForm
()
{
closeForm
()
{
...
@@ -80,7 +87,13 @@ export default {
...
@@ -80,7 +87,13 @@ export default {
},
},
updateIssuable
()
{
updateIssuable
()
{
this
.
service
.
updateIssuable
(
this
.
store
.
formState
)
this
.
service
.
updateIssuable
(
this
.
store
.
formState
)
.
then
(()
=>
{
.
then
((
res
)
=>
{
const
data
=
res
.
json
();
if
(
data
.
confidential
!==
this
.
isConfidential
)
{
location
.
reload
();
}
eventHub
.
$emit
(
'
close.form
'
);
eventHub
.
$emit
(
'
close.form
'
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -157,6 +170,9 @@ export default {
...
@@ -157,6 +170,9 @@ export default {
:description-text=
"state.descriptionText"
:description-text=
"state.descriptionText"
:updated-at=
"state.updatedAt"
:updated-at=
"state.updatedAt"
:task-status=
"state.taskStatus"
/>
:task-status=
"state.taskStatus"
/>
<confidential-checkbox
v-if=
"showForm"
:form-state=
"formState"
/>
<edit-actions
<edit-actions
v-if=
"canUpdate && showForm"
v-if=
"canUpdate && showForm"
:can-destroy=
"canDestroy"
/>
:can-destroy=
"canDestroy"
/>
...
...
app/assets/javascripts/issue_show/components/fields/confidential_checkbox.vue
0 → 100644
View file @
c4fea61f
<
script
>
export
default
{
props
:
{
formState
:
{
type
:
Object
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<fieldset
class=
"checkbox"
>
<label
for=
"issue_confidential"
>
<input
type=
"checkbox"
value=
"1"
id=
"issue_confidential"
v-model=
"formState.confidential"
/>
This issue is confidential and should only be visible to team members with at least Reporter access.
</label>
</fieldset>
</
template
>
app/assets/javascripts/issue_show/index.js
View file @
c4fea61f
...
@@ -25,6 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -25,6 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
canDestroy
,
canDestroy
,
endpoint
,
endpoint
,
issuableRef
,
issuableRef
,
isConfidential
,
}
=
issuableElement
.
dataset
;
}
=
issuableElement
.
dataset
;
return
{
return
{
...
@@ -35,6 +36,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -35,6 +36,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
:
''
,
isConfidential
:
gl
.
utils
.
convertPermissionToBoolean
(
isConfidential
),
};
};
},
},
render
(
createElement
)
{
render
(
createElement
)
{
...
@@ -47,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -47,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
initialTitle
:
this
.
initialTitle
,
initialTitle
:
this
.
initialTitle
,
initialDescriptionHtml
:
this
.
initialDescriptionHtml
,
initialDescriptionHtml
:
this
.
initialDescriptionHtml
,
initialDescriptionText
:
this
.
initialDescriptionText
,
initialDescriptionText
:
this
.
initialDescriptionText
,
isConfidential
:
this
.
isConfidential
,
},
},
});
});
},
},
...
...
app/assets/javascripts/issue_show/stores/index.js
View file @
c4fea61f
...
@@ -14,6 +14,7 @@ export default class Store {
...
@@ -14,6 +14,7 @@ export default class Store {
};
};
this
.
formState
=
{
this
.
formState
=
{
title
:
''
,
title
:
''
,
confidential
:
false
,
};
};
}
}
...
...
app/views/projects/issues/show.html.haml
View file @
c4fea61f
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
"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
,
"issuable-ref"
=>
@issue
.
to_reference
,
"issuable-ref"
=>
@issue
.
to_reference
,
"is-confidential"
=>
@issue
.
confidential
.
to_s
,
}
}
}
}
%h2
.title
=
markdown_field
(
@issue
,
:title
)
%h2
.title
=
markdown_field
(
@issue
,
:title
)
-
if
@issue
.
description
.
present?
-
if
@issue
.
description
.
present?
...
...
spec/javascripts/issue_show/components/app_spec.js
View file @
c4fea61f
...
@@ -35,6 +35,7 @@ describe('Issuable output', () => {
...
@@ -35,6 +35,7 @@ describe('Issuable output', () => {
initialDescriptionHtml
:
''
,
initialDescriptionHtml
:
''
,
initialDescriptionText
:
''
,
initialDescriptionText
:
''
,
showForm
:
false
,
showForm
:
false
,
isConfidential
:
false
,
},
},
}).
$mount
();
}).
$mount
();
});
});
...
...
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