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
21ed2da0
Commit
21ed2da0
authored
Sep 06, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed double scroll
improved variable & prop names
parent
3f650038
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
16 deletions
+17
-16
app/assets/javascripts/ide/components/file_templates/bar.vue
app/assets/javascripts/ide/components/file_templates/bar.vue
+6
-6
app/assets/javascripts/ide/components/file_templates/dropdown.vue
...ts/javascripts/ide/components/file_templates/dropdown.vue
+5
-5
app/assets/stylesheets/page_bundles/ide.scss
app/assets/stylesheets/page_bundles/ide.scss
+1
-2
spec/javascripts/ide/components/file_templates/bar_spec.js
spec/javascripts/ide/components/file_templates/bar_spec.js
+4
-2
spec/javascripts/ide/components/file_templates/dropdown_spec.js
...avascripts/ide/components/file_templates/dropdown_spec.js
+1
-1
No files found.
app/assets/javascripts/ide/components/file_templates/bar.vue
View file @
21ed2da0
...
...
@@ -27,14 +27,14 @@ export default {
'
undoFileTemplate
'
,
]),
setInitialType
()
{
const
t
ype
=
this
.
templateTypes
.
find
(
t
=>
t
.
name
===
this
.
activeFile
.
name
);
const
initialTemplateT
ype
=
this
.
templateTypes
.
find
(
t
=>
t
.
name
===
this
.
activeFile
.
name
);
if
(
t
ype
)
{
this
.
setSelectedTemplateType
(
t
ype
);
if
(
initialTemplateT
ype
)
{
this
.
setSelectedTemplateType
(
initialTemplateT
ype
);
}
},
selectTemplateType
(
type
)
{
this
.
setSelectedTemplateType
(
type
);
selectTemplateType
(
t
emplateT
ype
)
{
this
.
setSelectedTemplateType
(
t
emplateT
ype
);
},
selectTemplate
(
template
)
{
this
.
fetchTemplate
(
template
);
...
...
@@ -60,7 +60,7 @@ export default {
<dropdown
v-if=
"showTemplatesDropdown"
:label=
"__('Choose a template...')"
:
async
=
"true"
:
is-async-data
=
"true"
:searchable=
"true"
:title=
"__('File templates')"
class=
"mr-2"
...
...
app/assets/javascripts/ide/components/file_templates/dropdown.vue
View file @
21ed2da0
...
...
@@ -24,7 +24,7 @@ export default {
required
:
false
,
default
:
null
,
},
async
:
{
isAsyncData
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
...
...
@@ -43,14 +43,14 @@ export default {
computed
:
{
...
mapState
(
'
fileTemplates
'
,
[
'
templates
'
,
'
isLoading
'
]),
outputData
()
{
return
(
this
.
async
?
this
.
templates
:
this
.
data
).
filter
(
t
=>
{
return
(
this
.
isAsyncData
?
this
.
templates
:
this
.
data
).
filter
(
t
=>
{
if
(
!
this
.
searchable
)
return
true
;
return
t
.
name
.
toLowerCase
().
indexOf
(
this
.
search
.
toLowerCase
())
>=
0
;
});
},
showLoading
()
{
return
this
.
async
?
this
.
isLoading
:
false
;
return
this
.
isAsyncData
?
this
.
isLoading
:
false
;
},
},
mounted
()
{
...
...
@@ -62,7 +62,7 @@ export default {
methods
:
{
...
mapActions
(
'
fileTemplates
'
,
[
'
fetchTemplateTypes
'
]),
fetchTemplatesIfAsync
()
{
if
(
this
.
async
)
{
if
(
this
.
isAsyncData
)
{
this
.
fetchTemplateTypes
();
}
},
...
...
@@ -79,7 +79,7 @@ export default {
:toggle-text=
"label"
data-display=
"static"
/>
<div
class=
"dropdown-menu"
>
<div
class=
"dropdown-menu
pb-0
"
>
<div
v-if=
"title"
class=
"dropdown-title ml-0 mr-0"
...
...
app/assets/stylesheets/page_bundles/ide.scss
View file @
21ed2da0
...
...
@@ -1452,8 +1452,7 @@ $ide-tree-text-start: $ide-activity-bar-width + $ide-tree-padding;
min-width
:
180px
;
}
.dropdown-
menu
{
.dropdown-
content
{
max-height
:
222px
;
overflow
:
hidden
;
}
}
spec/javascripts/ide/components/file_templates/bar_spec.js
View file @
21ed2da0
...
...
@@ -98,14 +98,16 @@ describe('IDE file templates bar component', () => {
});
it
(
'
calls setSelectedTemplateType if activeFile name matches a template
'
,
done
=>
{
const
fileName
=
'
.gitlab-ci.yml
'
;
spyOn
(
vm
,
'
setSelectedTemplateType
'
);
vm
.
$store
.
state
.
openFiles
[
0
].
name
=
'
.gitlab-ci.yml
'
;
vm
.
$store
.
state
.
openFiles
[
0
].
name
=
fileName
;
vm
.
setInitialType
();
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
setSelectedTemplateType
).
toHaveBeenCalledWith
({
name
:
'
.gitlab-ci.yml
'
,
name
:
fileName
,
key
:
'
gitlab_ci_ymls
'
,
});
...
...
spec/javascripts/ide/components/file_templates/dropdown_spec.js
View file @
21ed2da0
...
...
@@ -28,7 +28,7 @@ describe('IDE file templates dropdown component', () => {
describe
(
'
async
'
,
()
=>
{
beforeEach
(()
=>
{
vm
.
async
=
true
;
vm
.
isAsyncData
=
true
;
});
it
(
'
calls async store method on Bootstrap dropdown event
'
,
()
=>
{
...
...
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