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
e5cd65a4
Commit
e5cd65a4
authored
Oct 18, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed new file/directory modal using methods that no longer exist
[ci skip]
parent
caee9d58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
46 deletions
+47
-46
app/assets/javascripts/repo/components/new_dropdown/index.vue
...assets/javascripts/repo/components/new_dropdown/index.vue
+34
-35
app/assets/javascripts/repo/components/new_dropdown/modal.vue
...assets/javascripts/repo/components/new_dropdown/modal.vue
+12
-10
app/assets/javascripts/repo/components/repo_tab.vue
app/assets/javascripts/repo/components/repo_tab.vue
+1
-1
No files found.
app/assets/javascripts/repo/components/new_dropdown/index.vue
View file @
e5cd65a4
...
@@ -24,43 +24,42 @@
...
@@ -24,43 +24,42 @@
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"breadcrumb repo-breadcrumb"
>
<div>
<div
class=
"dropdown"
>
<ul
class=
"breadcrumb repo-breadcrumb"
>
<button
<li
class=
"dropdown"
>
type=
"button"
<button
class=
"btn btn-default dropdown-toggle add-to-tree"
type=
"button"
data-toggle=
"dropdown"
class=
"btn btn-default dropdown-toggle add-to-tree"
data-target=
".add-to-tree-dropdown"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-plus"
aria-hidden=
"true"
>
>
</i>
<i
</button>
class=
"fa fa-plus"
</div>
aria-hidden=
"true"
<div
class=
"add-to-tree-dropdown"
>
<ul
class=
"dropdown-menu"
>
<li>
<a
href=
"#"
role=
"button"
@
click.prevent=
"createNewItem('blob')"
>
>
{{
__
(
'
New file
'
)
}}
</i>
</a>
</button>
</li>
<ul
class=
"dropdown-menu"
>
<li>
<li>
<a
<a
href=
"#"
href=
"#"
role=
"button"
role=
"button"
@
click.prevent=
"createNewItem('tree')"
@
click.prevent=
"createNewItem('blob')"
>
>
{{
__
(
'
New directory
'
)
}}
{{
__
(
'
New file
'
)
}}
</a>
</a>
</li>
</li>
</ul>
<li>
</div>
<a
href=
"#"
role=
"button"
@
click.prevent=
"createNewItem('tree')"
>
{{
__
(
'
New directory
'
)
}}
</a>
</li>
</ul>
</li>
</ul>
<new-modal
<new-modal
v-if=
"openModal"
v-if=
"openModal"
:type=
"modalType"
:type=
"modalType"
...
...
app/assets/javascripts/repo/components/new_dropdown/modal.vue
View file @
e5cd65a4
...
@@ -24,12 +24,13 @@
...
@@ -24,12 +24,13 @@
if
(
this
.
entryName
===
''
)
return
;
if
(
this
.
entryName
===
''
)
return
;
const
fileName
=
this
.
type
===
'
tree
'
?
'
.gitkeep
'
:
this
.
entryName
;
const
fileName
=
this
.
type
===
'
tree
'
?
'
.gitkeep
'
:
this
.
entryName
;
let
tree
=
null
;
let
tree
=
RepoStore
;
if
(
this
.
type
===
'
tree
'
)
{
if
(
this
.
type
===
'
tree
'
)
{
tree
=
RepoHelper
.
serialize
Tree
(
{
tree
=
RepoHelper
.
serialize
RepoEntity
(
'
tree
'
,
{
name
:
this
.
entryName
,
name
:
this
.
entryName
,
path
:
this
.
entryName
,
path
:
this
.
entryName
,
icon
:
'
folder
'
,
tempFile
:
true
,
tempFile
:
true
,
});
});
RepoStore
.
files
.
push
(
tree
);
RepoStore
.
files
.
push
(
tree
);
...
@@ -37,17 +38,14 @@
...
@@ -37,17 +38,14 @@
RepoHelper
.
setDirectoryOpen
(
tree
,
tree
.
name
);
RepoHelper
.
setDirectoryOpen
(
tree
,
tree
.
name
);
}
}
const
file
=
RepoHelper
.
serialize
Blob
(
{
const
file
=
RepoHelper
.
serialize
RepoEntity
(
'
blob
'
,
{
name
:
fileName
,
name
:
fileName
,
path
:
tree
?
`
${
tree
}
/
${
fileName
}
`
:
fileName
,
path
:
tree
.
path
?
`
${
tree
.
path
}
/
${
fileName
}
`
:
fileName
,
icon
:
'
file-text-o
'
,
tempFile
:
true
,
tempFile
:
true
,
});
}
,
(
this
.
type
===
'
tree
'
?
tree
.
level
+
1
:
0
)
);
if
(
tree
)
{
tree
.
files
.
push
(
file
);
RepoStore
.
addFilesToDirectory
(
tree
,
RepoStore
.
files
,
[
file
]);
}
else
{
RepoStore
.
addFilesToDirectory
(
tree
,
RepoStore
.
files
,
[...
RepoStore
.
files
,
file
]);
}
RepoHelper
.
setFile
(
file
,
file
);
RepoHelper
.
setFile
(
file
,
file
);
RepoStore
.
editMode
=
true
;
RepoStore
.
editMode
=
true
;
...
@@ -82,6 +80,9 @@
...
@@ -82,6 +80,9 @@
return
__
(
'
File name
'
);
return
__
(
'
File name
'
);
},
},
},
},
mounted
()
{
this
.
$refs
.
fieldName
.
focus
();
},
};
};
</
script
>
</
script
>
...
@@ -107,6 +108,7 @@
...
@@ -107,6 +108,7 @@
type=
"text"
type=
"text"
class=
"form-control"
class=
"form-control"
v-model=
"entryName"
v-model=
"entryName"
ref=
"fieldName"
/>
/>
</div>
</div>
</fieldset>
</fieldset>
...
...
app/assets/javascripts/repo/components/repo_tab.vue
View file @
e5cd65a4
...
@@ -30,7 +30,7 @@ const RepoTab = {
...
@@ -30,7 +30,7 @@ const RepoTab = {
Store
.
setActiveFiles
(
file
);
Store
.
setActiveFiles
(
file
);
},
},
closeTab
(
file
)
{
closeTab
(
file
)
{
if
(
file
.
changed
)
return
;
if
(
file
.
changed
||
file
.
tempFile
)
return
;
Store
.
removeFromOpenedFiles
(
file
);
Store
.
removeFromOpenedFiles
(
file
);
},
},
...
...
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