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
b82b1667
Commit
b82b1667
authored
Feb 12, 2019
by
Sam Bigelow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont show file template options for new directory
parent
a1215556
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
app/assets/javascripts/ide/components/new_dropdown/modal.vue
app/assets/javascripts/ide/components/new_dropdown/modal.vue
+10
-4
changelogs/unreleased/57544-web-ide-new-directory-dialog-shows-file-templates.yml
...544-web-ide-new-directory-dialog-shows-file-templates.yml
+5
-0
spec/javascripts/ide/components/new_dropdown/modal_spec.js
spec/javascripts/ide/components/new_dropdown/modal_spec.js
+9
-0
No files found.
app/assets/javascripts/ide/components/new_dropdown/modal.vue
View file @
b82b1667
...
@@ -51,8 +51,11 @@ export default {
...
@@ -51,8 +51,11 @@ export default {
return
__
(
'
Create file
'
);
return
__
(
'
Create file
'
);
},
},
isCreatingNew
()
{
isCreatingNewFile
()
{
return
this
.
entryModal
.
type
!==
modalTypes
.
rename
;
return
this
.
entryModal
.
type
===
'
blob
'
;
},
placeholder
()
{
return
this
.
isCreatingNewFile
?
'
dir/file_name
'
:
'
dir/
'
;
},
},
},
},
methods
:
{
methods
:
{
...
@@ -107,9 +110,12 @@ export default {
...
@@ -107,9 +110,12 @@ export default {
v-model=
"entryName"
v-model=
"entryName"
type=
"text"
type=
"text"
class=
"form-control qa-full-file-path"
class=
"form-control qa-full-file-path"
placeholder=
"/dir/file_name
"
:placeholder=
"placeholder
"
/>
/>
<ul
v-if=
"isCreatingNew"
class=
"prepend-top-default list-inline qa-template-list"
>
<ul
v-if=
"isCreatingNewFile"
class=
"file-templates prepend-top-default list-inline qa-template-list"
>
<li
v-for=
"(template, index) in templateTypes"
:key=
"index"
class=
"list-inline-item"
>
<li
v-for=
"(template, index) in templateTypes"
:key=
"index"
class=
"list-inline-item"
>
<button
<button
type=
"button"
type=
"button"
...
...
changelogs/unreleased/57544-web-ide-new-directory-dialog-shows-file-templates.yml
0 → 100644
View file @
b82b1667
---
title
:
Do not show file templates when creating a new directory in WebIDE
merge_request
:
!25119
author
:
type
:
fixed
spec/javascripts/ide/components/new_dropdown/modal_spec.js
View file @
b82b1667
...
@@ -41,6 +41,15 @@ describe('new file modal component', () => {
...
@@ -41,6 +41,15 @@ describe('new file modal component', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.label-bold
'
).
textContent
.
trim
()).
toBe
(
'
Name
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.label-bold
'
).
textContent
.
trim
()).
toBe
(
'
Name
'
);
});
});
it
(
`
${
type
===
'
tree
'
?
'
does not show
'
:
'
shows
'
}
file templates`
,
()
=>
{
const
templateFilesEl
=
vm
.
$el
.
querySelector
(
'
.file-templates
'
);
if
(
type
===
'
tree
'
)
{
expect
(
templateFilesEl
).
toBeNull
();
}
else
{
expect
(
templateFilesEl
instanceof
Element
).
toBeTruthy
();
}
});
describe
(
'
createEntryInStore
'
,
()
=>
{
describe
(
'
createEntryInStore
'
,
()
=>
{
it
(
'
$emits create
'
,
()
=>
{
it
(
'
$emits create
'
,
()
=>
{
spyOn
(
vm
,
'
createTempEntry
'
);
spyOn
(
vm
,
'
createTempEntry
'
);
...
...
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