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
Léo-Paul Géneau
gitlab-ce
Commits
b219dcd0
Commit
b219dcd0
authored
Aug 11, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds confidential issue information
parent
a6445299
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
19 deletions
+71
-19
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+17
-9
app/assets/javascripts/notes/components/issue_note_form.vue
app/assets/javascripts/notes/components/issue_note_form.vue
+8
-1
app/assets/javascripts/vue_shared/components/issue/confidential_issue_warning.vue
...ue_shared/components/issue/confidential_issue_warning.vue
+16
-0
app/views/projects/_md_preview.html.haml
app/views/projects/_md_preview.html.haml
+0
-7
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+0
-2
spec/javascripts/notes/components/issue_comment_form_spec.js
spec/javascripts/notes/components/issue_comment_form_spec.js
+10
-0
spec/javascripts/vue_shared/components/issue/confidential_issue_warning_spec.js
...hared/components/issue/confidential_issue_warning_spec.js
+20
-0
No files found.
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
b219dcd0
...
@@ -3,13 +3,14 @@
...
@@ -3,13 +3,14 @@
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
markdownField
from
'
../../vue_shared/components/markdown/field.vue
'
;
import
issueNoteSignedOutWidget
from
'
./issue_note_signed_out_widget.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
*
as
constants
from
'
../constants
'
;
import
'
../../autosave
'
;
import
'
../../autosave
'
;
import
TaskList
from
'
../../task_list
'
;
import
TaskList
from
'
../../task_list
'
;
import
*
as
constants
from
'
../constants
'
;
import
eventHub
from
'
../event_hub
'
;
import
confidentialIssue
from
'
../../vue_shared/components/issue/confidential_issue_warning.vue
'
;
import
issueNoteSignedOutWidget
from
'
./issue_note_signed_out_widget.vue
'
;
import
markdownField
from
'
../../vue_shared/components/markdown/field.vue
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
export
default
{
export
default
{
name
:
'
issueCommentForm
'
,
name
:
'
issueCommentForm
'
,
...
@@ -25,9 +26,10 @@
...
@@ -25,9 +26,10 @@
};
};
},
},
components
:
{
components
:
{
userAvatarLink
,
confidentialIssue
,
markdownField
,
issueNoteSignedOutWidget
,
issueNoteSignedOutWidget
,
markdownField
,
userAvatarLink
,
},
},
watch
:
{
watch
:
{
note
(
newNote
)
{
note
(
newNote
)
{
...
@@ -88,6 +90,9 @@
...
@@ -88,6 +90,9 @@
endpoint
()
{
endpoint
()
{
return
this
.
getIssueData
.
create_note_path
;
return
this
.
getIssueData
.
create_note_path
;
},
},
isConfidentialIssue
()
{
return
this
.
getIssueData
.
confidential
;
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
...
mapActions
([
...
@@ -195,7 +200,7 @@
...
@@ -195,7 +200,7 @@
fieldName
:
'
note
'
,
fieldName
:
'
note
'
,
selector
:
'
.notes
'
,
selector
:
'
.notes
'
,
});
});
}
}
,
},
},
mounted
()
{
mounted
()
{
// jQuery is needed here because it is a custom event being dispatched with jQuery.
// jQuery is needed here because it is a custom event being dispatched with jQuery.
...
@@ -231,11 +236,14 @@
...
@@ -231,11 +236,14 @@
<form
<form
class=
"js-main-target-form timeline-content timeline-content-form common-note-form"
class=
"js-main-target-form timeline-content timeline-content-form common-note-form"
@
submit=
"handleSave(true)"
>
@
submit=
"handleSave(true)"
>
<confidentialIssue
v-if=
"isConfidentialIssue"
/>
<markdown-field
<markdown-field
:markdown-preview-url=
"markdownPreviewUrl"
:markdown-preview-url=
"markdownPreviewUrl"
:markdown-docs=
"markdownDocsUrl"
:markdown-docs=
"markdownDocsUrl"
:quick-actions-docs=
"quickActionsDocsUrl"
:quick-actions-docs=
"quickActionsDocsUrl"
:add-spacing-classes=
"false"
>
:add-spacing-classes=
"false"
:is-confidential-issue=
"isConfidentialIssue"
>
<textarea
<textarea
id=
"note-body"
id=
"note-body"
name=
"note[note]"
name=
"note[note]"
...
...
app/assets/javascripts/notes/components/issue_note_form.vue
View file @
b219dcd0
<
script
>
<
script
>
import
{
mapGetters
}
from
'
vuex
'
;
import
{
mapGetters
}
from
'
vuex
'
;
import
markdownField
from
'
../../vue_shared/components/markdown/field.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
confidentialIssue
from
'
../../vue_shared/components/issue/confidential_issue_warning.vue
'
;
import
markdownField
from
'
../../vue_shared/components/markdown/field.vue
'
;
export
default
{
export
default
{
name
:
'
issueNoteForm
'
,
props
:
{
props
:
{
noteBody
:
{
noteBody
:
{
type
:
String
,
type
:
String
,
...
@@ -37,6 +39,7 @@
...
@@ -37,6 +39,7 @@
};
};
},
},
components
:
{
components
:
{
confidentialIssue
,
markdownField
,
markdownField
,
},
},
computed
:
{
computed
:
{
...
@@ -64,6 +67,9 @@
...
@@ -64,6 +67,9 @@
isDisabled
()
{
isDisabled
()
{
return
!
this
.
note
.
length
||
this
.
isSubmitting
;
return
!
this
.
note
.
length
||
this
.
isSubmitting
;
},
},
isConfidentialIssue
()
{
return
this
.
getIssueDataByProp
(
'
confidential
'
);
},
},
},
methods
:
{
methods
:
{
handleUpdate
()
{
handleUpdate
()
{
...
@@ -116,6 +122,7 @@
...
@@ -116,6 +122,7 @@
<div
class=
"flash-container timeline-content"
></div>
<div
class=
"flash-container timeline-content"
></div>
<form
<form
class=
"edit-note common-note-form"
>
class=
"edit-note common-note-form"
>
<confidentialIssue
v-if=
"isConfidentialIssue"
/>
<markdown-field
<markdown-field
:markdown-preview-url=
"markdownPreviewUrl"
:markdown-preview-url=
"markdownPreviewUrl"
:markdown-docs=
"markdownDocsUrl"
:markdown-docs=
"markdownDocsUrl"
...
...
app/assets/javascripts/vue_shared/components/issue/confidential_issue_warning.vue
0 → 100644
View file @
b219dcd0
<
script
>
export
default
{
name
:
'
confidentialIssueWarning
'
,
};
</
script
>
<
template
>
<div
class=
"confidential-issue-warning"
>
<i
aria-hidden=
"true"
class=
"fa fa-eye-slash"
>
</i>
<span>
This is a confidential issue. Your comment will not be visible to the public.
</span>
</div>
</
template
>
app/views/projects/_md_preview.html.haml
View file @
b219dcd0
-
referenced_users
=
local_assigns
.
fetch
(
:referenced_users
,
nil
)
-
referenced_users
=
local_assigns
.
fetch
(
:referenced_users
,
nil
)
-
if
defined?
(
@issue
)
&&
@issue
.
confidential?
%li
.confidential-issue-warning
=
confidential_icon
(
@issue
)
%span
This is a confidential issue. Your comment will not be visible to the public.
-
else
%li
.confidential-issue-warning.not-confidential
.md-area
.md-area
.md-header
.md-header
%ul
.nav-links.clearfix
%ul
.nav-links.clearfix
...
...
app/views/projects/issues/_discussion.html.haml
View file @
b219dcd0
...
@@ -16,5 +16,3 @@
...
@@ -16,5 +16,3 @@
-
content_for
:page_specific_javascripts
do
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'notes'
=
webpack_bundle_tag
'notes'
=
render
"layouts/init_auto_complete"
spec/javascripts/notes/components/issue_comment_form_spec.js
View file @
b219dcd0
...
@@ -102,6 +102,16 @@ describe('issue_comment_form component', () => {
...
@@ -102,6 +102,16 @@ describe('issue_comment_form component', () => {
});
});
});
});
});
});
describe
(
'
issue is confidential
'
,
()
=>
{
it
(
'
shows information warning
'
,
(
done
)
=>
{
store
.
dispatch
(
'
setIssueData
'
,
Object
.
assign
(
issueDataMock
,
{
confidential
:
true
}));
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.confidential-issue-warning
'
)).
toBeDefined
();
done
();
});
});
});
});
});
describe
(
'
user is not logged in
'
,
()
=>
{
describe
(
'
user is not logged in
'
,
()
=>
{
...
...
spec/javascripts/vue_shared/components/issue/confidential_issue_warning_spec.js
0 → 100644
View file @
b219dcd0
import
Vue
from
'
vue
'
;
import
confidentialIssue
from
'
~/vue_shared/components/issue/confidential_issue_warning.vue
'
;
describe
(
'
Confidential Issue Warning Component
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
confidentialIssue
);
vm
=
new
Component
().
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
should render confidential issue warning information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
i
'
).
className
).
toEqual
(
'
fa fa-eye-slash
'
);
expect
(
vm
.
$el
.
querySelector
(
'
span
'
).
textContent
.
trim
()).
toEqual
(
'
This is a confidential issue. Your comment will not be visible to the public.
'
);
});
});
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