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
18599961
Commit
18599961
authored
Jun 12, 2019
by
Paul Slaughter
Committed by
Phil Hughes
Jun 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract ide_status_list from ide_status_bar
**Why?** The ide_status_list will be used and extended in EE.
parent
1e970f62
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
23 deletions
+124
-23
app/assets/javascripts/ide/components/ide.vue
app/assets/javascripts/ide/components/ide.vue
+1
-1
app/assets/javascripts/ide/components/ide_status_bar.vue
app/assets/javascripts/ide/components/ide_status_bar.vue
+3
-13
app/assets/javascripts/ide/components/ide_status_list.vue
app/assets/javascripts/ide/components/ide_status_list.vue
+23
-0
app/assets/stylesheets/page_bundles/ide.scss
app/assets/stylesheets/page_bundles/ide.scss
+6
-9
spec/frontend/ide/components/ide_status_list_spec.js
spec/frontend/ide/components/ide_status_list_spec.js
+91
-0
No files found.
app/assets/javascripts/ide/components/ide.vue
View file @
18599961
...
@@ -146,7 +146,7 @@ export default {
...
@@ -146,7 +146,7 @@ export default {
</div>
</div>
<component
:is=
"rightPaneComponent"
v-if=
"currentProjectId"
/>
<component
:is=
"rightPaneComponent"
v-if=
"currentProjectId"
/>
</div>
</div>
<ide-status-bar
:file=
"activeFile"
/>
<ide-status-bar
/>
<new-modal
/>
<new-modal
/>
</article>
</article>
</template>
</template>
app/assets/javascripts/ide/components/ide_status_bar.vue
View file @
18599961
<
script
>
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
IdeStatusList
from
'
ee_else_ce/ide/components/ide_status_list.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
timeAgoMixin
from
'
~/vue_shared/mixins/timeago
'
;
import
timeAgoMixin
from
'
~/vue_shared/mixins/timeago
'
;
...
@@ -12,18 +13,12 @@ export default {
...
@@ -12,18 +13,12 @@ export default {
icon
,
icon
,
userAvatarImage
,
userAvatarImage
,
CiIcon
,
CiIcon
,
IdeStatusList
,
},
},
directives
:
{
directives
:
{
tooltip
,
tooltip
,
},
},
mixins
:
[
timeAgoMixin
],
mixins
:
[
timeAgoMixin
],
props
:
{
file
:
{
type
:
Object
,
required
:
false
,
default
:
null
,
},
},
data
()
{
data
()
{
return
{
return
{
lastCommitFormatedAge
:
null
,
lastCommitFormatedAge
:
null
,
...
@@ -125,11 +120,6 @@ export default {
...
@@ -125,11 +120,6 @@ export default {
>
{{
lastCommitFormatedAge
}}
</time
>
{{
lastCommitFormatedAge
}}
</time
>
>
</div>
</div>
<div
v-if=
"file"
class=
"ide-status-file"
>
{{
file
.
name
}}
</div>
<ide-status-list
class=
"ml-auto"
/>
<div
v-if=
"file"
class=
"ide-status-file"
>
{{
file
.
eol
}}
</div>
<div
v-if=
"file && !file.binary"
class=
"ide-status-file"
>
{{
file
.
editorRow
}}
:
{{
file
.
editorColumn
}}
</div>
<div
v-if=
"file"
class=
"ide-status-file"
>
{{
file
.
fileLanguage
}}
</div>
</footer>
</footer>
</
template
>
</
template
>
app/assets/javascripts/ide/components/ide_status_list.vue
0 → 100644
View file @
18599961
<
script
>
import
{
mapGetters
}
from
'
vuex
'
;
export
default
{
computed
:
{
...
mapGetters
([
'
activeFile
'
]),
},
};
</
script
>
<
template
>
<div
class=
"ide-status-list d-flex"
>
<template
v-if=
"activeFile"
>
<div
class=
"ide-status-file"
>
{{
activeFile
.
name
}}
</div>
<div
class=
"ide-status-file"
>
{{
activeFile
.
eol
}}
</div>
<div
v-if=
"!activeFile.binary"
class=
"ide-status-file"
>
{{
activeFile
.
editorRow
}}
:
{{
activeFile
.
editorColumn
}}
</div>
<div
class=
"ide-status-file"
>
{{
activeFile
.
fileLanguage
}}
</div>
</
template
>
<slot></slot>
</div>
</template>
app/assets/stylesheets/page_bundles/ide.scss
View file @
18599961
...
@@ -396,10 +396,6 @@ $ide-commit-header-height: 48px;
...
@@ -396,10 +396,6 @@ $ide-commit-header-height: 48px;
font-size
:
inherit
;
font-size
:
inherit
;
}
}
>
div
+
div
{
padding-left
:
$gl-padding
;
}
svg
{
svg
{
vertical-align
:
sub
;
vertical-align
:
sub
;
}
}
...
@@ -410,13 +406,14 @@ $ide-commit-header-height: 48px;
...
@@ -410,13 +406,14 @@ $ide-commit-header-height: 48px;
}
}
}
}
.ide-status-list
{
>
div
+
div
{
padding-left
:
$gl-padding
;
}
}
.ide-status-file
{
.ide-status-file
{
text-align
:
right
;
text-align
:
right
;
.ide-status-branch
+
&
,
&
:first-child
{
margin-left
:
auto
;
}
}
}
// Not great, but this is to deal with our current output
// Not great, but this is to deal with our current output
.multi-file-preview-holder
{
.multi-file-preview-holder
{
...
...
spec/frontend/ide/components/ide_status_list_spec.js
0 → 100644
View file @
18599961
import
Vuex
from
'
vuex
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
IdeStatusList
from
'
~/ide/components/ide_status_list
'
;
const
TEST_FILE
=
{
name
:
'
lorem.md
'
,
eol
:
'
LF
'
,
editorRow
:
3
,
editorColumn
:
23
,
fileLanguage
:
'
markdown
'
,
};
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
describe
(
'
ide/components/ide_status_list
'
,
()
=>
{
let
activeFile
;
let
store
;
let
wrapper
;
const
createComponent
=
(
options
=
{})
=>
{
store
=
new
Vuex
.
Store
({
getters
:
{
activeFile
:
()
=>
activeFile
,
},
});
wrapper
=
shallowMount
(
localVue
.
extend
(
IdeStatusList
),
{
localVue
,
sync
:
false
,
store
,
...
options
,
});
};
beforeEach
(()
=>
{
activeFile
=
TEST_FILE
;
});
afterEach
(()
=>
{
wrapper
.
destroy
();
store
=
null
;
wrapper
=
null
;
});
const
getEditorPosition
=
file
=>
`
${
file
.
editorRow
}
:
${
file
.
editorColumn
}
`
;
describe
(
'
with regular file
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
it
(
'
shows file name
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
TEST_FILE
.
name
);
});
it
(
'
shows file eol
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
TEST_FILE
.
name
);
});
it
(
'
shows file editor position
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
getEditorPosition
(
TEST_FILE
));
});
it
(
'
shows file language
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
TEST_FILE
.
fileLanguage
);
});
});
describe
(
'
with binary file
'
,
()
=>
{
beforeEach
(()
=>
{
activeFile
.
binary
=
true
;
createComponent
();
});
it
(
'
does not show file editor position
'
,
()
=>
{
expect
(
wrapper
.
text
()).
not
.
toContain
(
getEditorPosition
(
TEST_FILE
));
});
});
it
(
'
adds slot as child of list
'
,
()
=>
{
createComponent
({
slots
:
{
default
:
[
'
<div class="js-test">Hello</div>
'
,
'
<div class="js-test">World</div>
'
],
},
});
expect
(
wrapper
.
find
(
'
.ide-status-list
'
).
findAll
(
'
.js-test
'
).
length
).
toEqual
(
2
);
});
});
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