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
5d6103e2
Commit
5d6103e2
authored
Aug 02, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added constants for modal type
parent
bc827dfd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
app/assets/javascripts/ide/components/new_dropdown/index.vue
app/assets/javascripts/ide/components/new_dropdown/index.vue
+4
-2
app/assets/javascripts/ide/components/new_dropdown/modal.vue
app/assets/javascripts/ide/components/new_dropdown/modal.vue
+11
-8
app/assets/javascripts/ide/constants.js
app/assets/javascripts/ide/constants.js
+5
-0
No files found.
app/assets/javascripts/ide/components/new_dropdown/index.vue
View file @
5d6103e2
...
@@ -4,6 +4,7 @@ import icon from '~/vue_shared/components/icon.vue';
...
@@ -4,6 +4,7 @@ import icon from '~/vue_shared/components/icon.vue';
import
newModal
from
'
./modal.vue
'
;
import
newModal
from
'
./modal.vue
'
;
import
upload
from
'
./upload.vue
'
;
import
upload
from
'
./upload.vue
'
;
import
ItemButton
from
'
./button.vue
'
;
import
ItemButton
from
'
./button.vue
'
;
import
{
modalTypes
}
from
'
../../constants
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -54,6 +55,7 @@ export default {
...
@@ -54,6 +55,7 @@ export default {
this
.
dropdownOpen
=
!
this
.
dropdownOpen
;
this
.
dropdownOpen
=
!
this
.
dropdownOpen
;
},
},
},
},
modalTypes
,
};
};
</
script
>
</
script
>
...
@@ -104,7 +106,7 @@ export default {
...
@@ -104,7 +106,7 @@ export default {
class=
"d-flex"
class=
"d-flex"
icon=
"folder-new"
icon=
"folder-new"
icon-classes=
"mr-2"
icon-classes=
"mr-2"
@
click=
"createNewItem(
'tree'
)"
@
click=
"createNewItem(
$options.modalTypes.tree
)"
/>
/>
</li>
</li>
<li
class=
"divider"
></li>
<li
class=
"divider"
></li>
...
@@ -115,7 +117,7 @@ export default {
...
@@ -115,7 +117,7 @@ export default {
class=
"d-flex"
class=
"d-flex"
icon=
"pencil"
icon=
"pencil"
icon-classes=
"mr-2"
icon-classes=
"mr-2"
@
click=
"createNewItem(
'rename'
)"
@
click=
"createNewItem(
$options.modalTypes.rename
)"
/>
/>
</li>
</li>
<li>
<li>
...
...
app/assets/javascripts/ide/components/new_dropdown/modal.vue
View file @
5d6103e2
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
GlModal
from
'
~/vue_shared/components/gl_modal.vue
'
;
import
GlModal
from
'
~/vue_shared/components/gl_modal.vue
'
;
import
{
modalTypes
}
from
'
../../constants
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -16,7 +17,9 @@ export default {
...
@@ -16,7 +17,9 @@ export default {
...
mapState
([
'
entryModal
'
]),
...
mapState
([
'
entryModal
'
]),
entryName
:
{
entryName
:
{
get
()
{
get
()
{
if
(
this
.
entryModal
.
type
===
'
rename
'
)
return
this
.
name
||
this
.
entryModal
.
entry
.
name
;
if
(
this
.
entryModal
.
type
===
modalTypes
.
rename
)
{
return
this
.
name
||
this
.
entryModal
.
entry
.
name
;
}
return
this
.
name
||
(
this
.
entryModal
.
path
!==
''
?
`
${
this
.
entryModal
.
path
}
/`
:
''
);
return
this
.
name
||
(
this
.
entryModal
.
path
!==
''
?
`
${
this
.
entryModal
.
path
}
/`
:
''
);
},
},
...
@@ -25,19 +28,19 @@ export default {
...
@@ -25,19 +28,19 @@ export default {
},
},
},
},
modalTitle
()
{
modalTitle
()
{
if
(
this
.
entryModal
.
type
===
'
tree
'
)
{
if
(
this
.
entryModal
.
type
===
modalTypes
.
tree
)
{
return
__
(
'
Create new directory
'
);
return
__
(
'
Create new directory
'
);
}
else
if
(
this
.
entryModal
.
type
===
'
rename
'
)
{
}
else
if
(
this
.
entryModal
.
type
===
modalTypes
.
rename
)
{
return
this
.
entryModal
.
entry
.
type
===
'
tree
'
?
__
(
'
Rename folder
'
)
:
__
(
'
Rename file
'
);
return
this
.
entryModal
.
entry
.
type
===
modalTypes
.
tree
?
__
(
'
Rename folder
'
)
:
__
(
'
Rename file
'
);
}
}
return
__
(
'
Create new file
'
);
return
__
(
'
Create new file
'
);
},
},
buttonLabel
()
{
buttonLabel
()
{
if
(
this
.
entryModal
.
type
===
'
tree
'
)
{
if
(
this
.
entryModal
.
type
===
modalTypes
.
tree
)
{
return
__
(
'
Create directory
'
);
return
__
(
'
Create directory
'
);
}
else
if
(
this
.
entryModal
.
type
===
'
rename
'
)
{
}
else
if
(
this
.
entryModal
.
type
===
modalTypes
.
rename
)
{
return
this
.
entryModal
.
entry
.
type
===
'
tree
'
?
__
(
'
Rename folder
'
)
:
__
(
'
Rename file
'
);
return
this
.
entryModal
.
entry
.
type
===
modalTypes
.
tree
?
__
(
'
Rename folder
'
)
:
__
(
'
Rename file
'
);
}
}
return
__
(
'
Create file
'
);
return
__
(
'
Create file
'
);
...
@@ -46,7 +49,7 @@ export default {
...
@@ -46,7 +49,7 @@ export default {
methods
:
{
methods
:
{
...
mapActions
([
'
createTempEntry
'
,
'
renameEntry
'
]),
...
mapActions
([
'
createTempEntry
'
,
'
renameEntry
'
]),
submitForm
()
{
submitForm
()
{
if
(
this
.
entryModal
.
type
===
'
rename
'
)
{
if
(
this
.
entryModal
.
type
===
modalTypes
.
rename
)
{
this
.
renameEntry
({
this
.
renameEntry
({
path
:
this
.
entryModal
.
entry
.
path
,
path
:
this
.
entryModal
.
entry
.
path
,
name
:
this
.
entryName
,
name
:
this
.
entryName
,
...
...
app/assets/javascripts/ide/constants.js
View file @
5d6103e2
...
@@ -53,3 +53,8 @@ export const commitItemIconMap = {
...
@@ -53,3 +53,8 @@ export const commitItemIconMap = {
class
:
'
ide-file-deletion
'
,
class
:
'
ide-file-deletion
'
,
},
},
};
};
export
const
modalTypes
=
{
rename
:
'
rename
'
,
tree
:
'
tree
'
,
};
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