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
81c69c28
Commit
81c69c28
authored
May 17, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-edit-inline-confidential' into 'issue-edit-inline'
Issue edit inline confidential See merge request !11389
parents
4693aa9c
6963442d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
1 deletion
+68
-1
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+12
-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/components/form.vue
app/assets/javascripts/issue_show/components/form.vue
+4
-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
+24
-0
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
81c69c28
...
...
@@ -41,6 +41,10 @@ export default {
required
:
false
,
default
:
''
,
},
isConfidential
:
{
type
:
Boolean
,
required
:
true
,
},
markdownPreviewUrl
:
{
type
:
String
,
required
:
true
,
...
...
@@ -78,6 +82,7 @@ export default {
this
.
showForm
=
true
;
this
.
store
.
formState
=
{
title
:
this
.
state
.
titleText
,
confidential
:
this
.
isConfidential
,
description
:
this
.
state
.
descriptionText
,
};
},
...
...
@@ -86,7 +91,13 @@ export default {
},
updateIssuable
()
{
this
.
service
.
updateIssuable
(
this
.
store
.
formState
)
.
then
(()
=>
{
.
then
((
res
)
=>
{
const
data
=
res
.
json
();
if
(
data
.
confidential
!==
this
.
isConfidential
)
{
location
.
reload
();
}
eventHub
.
$emit
(
'
close.form
'
);
})
.
catch
(()
=>
{
...
...
app/assets/javascripts/issue_show/components/fields/confidential_checkbox.vue
0 → 100644
View file @
81c69c28
<
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/components/form.vue
View file @
81c69c28
...
...
@@ -2,6 +2,7 @@
import
titleField
from
'
./fields/title.vue
'
;
import
descriptionField
from
'
./fields/description.vue
'
;
import
editActions
from
'
./edit_actions.vue
'
;
import
confidentialCheckbox
from
'
./fields/confidential_checkbox.vue
'
;
export
default
{
props
:
{
...
...
@@ -26,6 +27,7 @@
titleField
,
descriptionField
,
editActions
,
confidentialCheckbox
,
},
};
</
script
>
...
...
@@ -34,6 +36,8 @@
<form>
<title-field
:form-state=
"formState"
/>
<confidential-checkbox
:form-state=
"formState"
/>
<description-field
:form-state=
"formState"
:markdown-preview-url=
"markdownPreviewUrl"
...
...
app/assets/javascripts/issue_show/index.js
View file @
81c69c28
...
...
@@ -25,6 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
canDestroy
,
endpoint
,
issuableRef
,
isConfidential
,
markdownPreviewUrl
,
markdownDocs
,
}
=
issuableElement
.
dataset
;
...
...
@@ -37,6 +38,7 @@ document.addEventListener('DOMContentLoaded', () => {
initialTitle
:
issuableTitleElement
.
innerHTML
,
initialDescriptionHtml
:
issuableDescriptionElement
?
issuableDescriptionElement
.
innerHTML
:
''
,
initialDescriptionText
:
issuableDescriptionTextarea
?
issuableDescriptionTextarea
.
textContent
:
''
,
isConfidential
:
gl
.
utils
.
convertPermissionToBoolean
(
isConfidential
),
markdownPreviewUrl
,
markdownDocs
,
};
...
...
@@ -51,6 +53,7 @@ document.addEventListener('DOMContentLoaded', () => {
initialTitle
:
this
.
initialTitle
,
initialDescriptionHtml
:
this
.
initialDescriptionHtml
,
initialDescriptionText
:
this
.
initialDescriptionText
,
isConfidential
:
this
.
isConfidential
,
markdownPreviewUrl
:
this
.
markdownPreviewUrl
,
markdownDocs
:
this
.
markdownDocs
,
},
...
...
app/assets/javascripts/issue_show/stores/index.js
View file @
81c69c28
...
...
@@ -14,6 +14,7 @@ export default class Store {
};
this
.
formState
=
{
title
:
''
,
confidential
:
false
,
description
:
''
,
};
}
...
...
app/views/projects/issues/show.html.haml
View file @
81c69c28
...
...
@@ -55,6 +55,7 @@
"can-update"
=>
can?
(
current_user
,
:update_issue
,
@issue
).
to_s
,
"can-destroy"
=>
can?
(
current_user
,
:destroy_issue
,
@issue
).
to_s
,
"issuable-ref"
=>
@issue
.
to_reference
,
"is-confidential"
=>
@issue
.
confidential
.
to_s
,
"markdown-preview-url"
=>
preview_markdown_path
(
@project
),
"markdown-docs"
=>
help_page_path
(
'user/markdown'
),
}
}
...
...
spec/javascripts/issue_show/components/app_spec.js
View file @
81c69c28
...
...
@@ -35,6 +35,7 @@ describe('Issuable output', () => {
initialDescriptionHtml
:
''
,
initialDescriptionText
:
''
,
showForm
:
false
,
isConfidential
:
false
,
},
}).
$mount
();
});
...
...
@@ -108,6 +109,29 @@ describe('Issuable output', () => {
});
});
it
(
'
reloads the page if the confidential status has changed
'
,
(
done
)
=>
{
spyOn
(
window
.
location
,
'
reload
'
);
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
resolve
({
json
()
{
return
{
confidential
:
true
,
};
},
});
}));
vm
.
updateIssuable
();
setTimeout
(()
=>
{
expect
(
window
.
location
.
reload
,
).
toHaveBeenCalled
();
done
();
});
});
it
(
'
closes form on error
'
,
(
done
)
=>
{
spyOn
(
window
,
'
Flash
'
).
and
.
callThrough
();
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
,
reject
)
=>
{
...
...
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