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
4f925cd5
Commit
4f925cd5
authored
Mar 29, 2018
by
Clement Ho
Committed by
Phil Hughes
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Harmonize can-attach-file to match CE
parent
d64dd2b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
1 deletion
+64
-1
app/assets/javascripts/issue_show/components/fields/description.vue
.../javascripts/issue_show/components/fields/description.vue
+6
-0
app/assets/javascripts/issue_show/components/form.vue
app/assets/javascripts/issue_show/components/form.vue
+6
-0
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
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/fields/description.vue
View file @
4f925cd5
...
...
@@ -20,6 +20,11 @@
type
:
String
,
required
:
true
,
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
enableAutocomplete
:
{
type
:
Boolean
,
required
:
false
,
...
...
@@ -42,6 +47,7 @@
<markdown-field
:markdown-preview-path=
"markdownPreviewPath"
:markdown-docs-path=
"markdownDocsPath"
:can-attach-file=
"canAttachFile"
:enable-autocomplete=
"enableAutocomplete"
>
<textarea
...
...
app/assets/javascripts/issue_show/components/form.vue
View file @
4f925cd5
...
...
@@ -48,6 +48,11 @@
required
:
false
,
default
:
true
,
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
enableAutocomplete
:
{
type
:
Boolean
,
required
:
false
,
...
...
@@ -92,6 +97,7 @@
:form-state=
"formState"
:markdown-preview-path=
"markdownPreviewPath"
:markdown-docs-path=
"markdownDocsPath"
:can-attach-file=
"canAttachFile"
:enable-autocomplete=
"enableAutocomplete"
/>
<edit-actions
...
...
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
4f925cd5
...
...
@@ -32,6 +32,11 @@
required
:
false
,
default
:
''
,
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
enableAutocomplete
:
{
type
:
Boolean
,
required
:
false
,
...
...
@@ -139,6 +144,7 @@
<markdown-toolbar
:markdown-docs-path=
"markdownDocsPath"
:quick-actions-docs-path=
"quickActionsDocsPath"
:can-attach-file=
"canAttachFile"
/>
</div>
</div>
...
...
app/assets/javascripts/vue_shared/components/markdown/toolbar.vue
View file @
4f925cd5
...
...
@@ -10,6 +10,11 @@
required
:
false
,
default
:
''
,
},
canAttachFile
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
computed
:
{
hasQuickActionsDocsPath
()
{
...
...
@@ -50,7 +55,10 @@
are supported
</
template
>
</div>
<span
class=
"uploading-container"
>
<span
v-if=
"canAttachFile"
class=
"uploading-container"
>
<span
class=
"uploading-progress-container hide"
>
<i
class=
"fa fa-file-image-o toolbar-button-icon"
...
...
spec/javascripts/vue_shared/components/markdown/toolbar_spec.js
0 → 100644
View file @
4f925cd5
import
Vue
from
'
vue
'
;
import
toolbar
from
'
~/vue_shared/components/markdown/toolbar.vue
'
;
import
mountComponent
from
'
spec/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