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
f31327ce
Commit
f31327ce
authored
Nov 21, 2017
by
Clement Ho
Committed by
Filipa Lacerda
Nov 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable file attachments for epics
parent
d5bce647
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
3 deletions
+85
-3
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+6
-0
app/assets/javascripts/issue_show/components/fields/description.vue
.../javascripts/issue_show/components/fields/description.vue
+7
-1
app/assets/javascripts/issue_show/components/form.vue
app/assets/javascripts/issue_show/components/form.vue
+7
-1
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+6
-0
app/assets/javascripts/vue_shared/components/markdown/toolbar.vue
...ts/javascripts/vue_shared/components/markdown/toolbar.vue
+9
-1
changelogs/unreleased-ee/disable-attachment-epic.yml
changelogs/unreleased-ee/disable-attachment-epic.yml
+5
-0
ee/app/assets/javascripts/epics/epic_show/components/epic_show_app.vue
.../javascripts/epics/epic_show/components/epic_show_app.vue
+1
-0
spec/ee/spec/features/epics/update_epic_spec.rb
spec/ee/spec/features/epics/update_epic_spec.rb
+7
-0
spec/javascripts/vue_shared/components/markdown/toolbar_spec.js
...avascripts/vue_shared/components/markdown/toolbar_spec.js
+37
-0
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
f31327ce
...
@@ -34,6 +34,11 @@ export default {
...
@@ -34,6 +34,11 @@ export default {
required
:
false
,
required
:
false
,
default
:
true
,
default
:
true
,
},
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
issuableRef
:
{
issuableRef
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -234,6 +239,7 @@ export default {
...
@@ -234,6 +239,7 @@ export default {
:project-path=
"projectPath"
:project-path=
"projectPath"
:project-namespace=
"projectNamespace"
:project-namespace=
"projectNamespace"
:show-delete-button=
"showDeleteButton"
:show-delete-button=
"showDeleteButton"
:can-attach-file=
"canAttachFile"
/>
/>
<div
v-else
>
<div
v-else
>
<title-component
<title-component
...
...
app/assets/javascripts/issue_show/components/fields/description.vue
View file @
f31327ce
...
@@ -17,6 +17,11 @@
...
@@ -17,6 +17,11 @@
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
components
:
{
components
:
{
markdownField
,
markdownField
,
...
@@ -36,7 +41,8 @@
...
@@ -36,7 +41,8 @@
</label>
</label>
<markdown-field
<markdown-field
:markdown-preview-path=
"markdownPreviewPath"
:markdown-preview-path=
"markdownPreviewPath"
:markdown-docs-path=
"markdownDocsPath"
>
:markdown-docs-path=
"markdownDocsPath"
:can-attach-file=
"canAttachFile"
>
<textarea
<textarea
id=
"issue-description"
id=
"issue-description"
class=
"note-textarea js-gfm-input js-autosize markdown-area"
class=
"note-textarea js-gfm-input js-autosize markdown-area"
...
...
app/assets/javascripts/issue_show/components/form.vue
View file @
f31327ce
...
@@ -41,6 +41,11 @@
...
@@ -41,6 +41,11 @@
required
:
false
,
required
:
false
,
default
:
true
,
default
:
true
,
},
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
components
:
{
components
:
{
lockedWarning
,
lockedWarning
,
...
@@ -83,7 +88,8 @@
...
@@ -83,7 +88,8 @@
<description-field
<description-field
:form-state=
"formState"
:form-state=
"formState"
:markdown-preview-path=
"markdownPreviewPath"
:markdown-preview-path=
"markdownPreviewPath"
:markdown-docs-path=
"markdownDocsPath"
/>
:markdown-docs-path=
"markdownDocsPath"
:can-attach-file=
"canAttachFile"
/>
<edit-actions
<edit-actions
:form-state=
"formState"
:form-state=
"formState"
:can-destroy=
"canDestroy"
:can-destroy=
"canDestroy"
...
...
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
f31327ce
...
@@ -25,6 +25,11 @@
...
@@ -25,6 +25,11 @@
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
},
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -129,6 +134,7 @@
...
@@ -129,6 +134,7 @@
<markdown-toolbar
<markdown-toolbar
:markdown-docs-path=
"markdownDocsPath"
:markdown-docs-path=
"markdownDocsPath"
:quick-actions-docs-path=
"quickActionsDocsPath"
:quick-actions-docs-path=
"quickActionsDocsPath"
:can-attach-file=
"canAttachFile"
/>
/>
</div>
</div>
</div>
</div>
...
...
app/assets/javascripts/vue_shared/components/markdown/toolbar.vue
View file @
f31327ce
...
@@ -9,6 +9,11 @@
...
@@ -9,6 +9,11 @@
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
},
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
};
};
</
script
>
</
script
>
...
@@ -41,7 +46,10 @@
...
@@ -41,7 +46,10 @@
are supported
are supported
</
template
>
</
template
>
</div>
</div>
<span
class=
"uploading-container"
>
<span
v-if=
"canAttachFile"
class=
"uploading-container"
>
<span
class=
"uploading-progress-container hide"
>
<span
class=
"uploading-progress-container hide"
>
<i
<i
class=
"fa fa-file-image-o toolbar-button-icon"
class=
"fa fa-file-image-o toolbar-button-icon"
...
...
changelogs/unreleased-ee/disable-attachment-epic.yml
0 → 100644
View file @
f31327ce
---
title
:
Disable file attachments for epics
merge_request
:
author
:
type
:
fixed
ee/app/assets/javascripts/epics/epic_show/components/epic_show_app.vue
View file @
f31327ce
...
@@ -122,6 +122,7 @@
...
@@ -122,6 +122,7 @@
:project-namespace=
"projectNamespace"
:project-namespace=
"projectNamespace"
:show-inline-edit-button=
"true"
:show-inline-edit-button=
"true"
:show-delete-button=
"false"
:show-delete-button=
"false"
:can-attach-file=
"false"
/>
/>
</div>
</div>
<epic-sidebar
<epic-sidebar
...
...
spec/ee/spec/features/epics/update_epic_spec.rb
View file @
f31327ce
...
@@ -36,6 +36,13 @@ feature 'Update Epic', :js do
...
@@ -36,6 +36,13 @@ feature 'Update Epic', :js do
expect
(
find
(
'.issuable-details h2.title'
)).
to
have_content
(
'New epic title'
)
expect
(
find
(
'.issuable-details h2.title'
)).
to
have_content
(
'New epic title'
)
expect
(
find
(
'.issuable-details .description'
)).
to
have_content
(
'New epic description'
)
expect
(
find
(
'.issuable-details .description'
)).
to
have_content
(
'New epic description'
)
end
end
# File attachment feature is not implemented yet for epics
it
'cannot attach files'
do
find
(
'.btn-edit'
).
click
expect
(
page
).
not_to
have_selector
(
'.uploading-container .button-attach-file'
)
end
end
end
context
'when user with owner access displays the epic'
do
context
'when user with owner access displays the epic'
do
...
...
spec/javascripts/vue_shared/components/markdown/toolbar_spec.js
0 → 100644
View file @
f31327ce
import
Vue
from
'
vue
'
;
import
toolbar
from
'
~/vue_shared/components/markdown/toolbar.vue
'
;
import
mountComponent
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
toolbar
'
,
()
=>
{
let
vm
;
const
Toolbar
=
Vue
.
extend
(
toolbar
);
const
props
=
{
markdownDocsPath
:
''
,
};
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
user can attach file
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Toolbar
,
props
);
});
it
(
'
should render uploading-container
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.uploading-container
'
)).
not
.
toBeNull
();
});
});
describe
(
'
user cannot attach file
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Toolbar
,
Object
.
assign
({},
props
,
{
canAttachFile
:
false
,
}));
});
it
(
'
should not render uploading-container
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.uploading-container
'
)).
toBeNull
();
});
});
});
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