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
Léo-Paul Géneau
gitlab-ce
Commits
ed0a1818
Commit
ed0a1818
authored
Apr 17, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved external link into activity bar
fixed ide_tree_spec.js
parent
fda4128a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
103 deletions
+35
-103
app/assets/javascripts/ide/components/activity_bar.vue
app/assets/javascripts/ide/components/activity_bar.vue
+14
-7
app/assets/javascripts/ide/components/ide_external_links.vue
app/assets/javascripts/ide/components/ide_external_links.vue
+0
-34
app/assets/javascripts/ide/components/ide_tree.vue
app/assets/javascripts/ide/components/ide_tree.vue
+1
-1
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+0
-1
spec/javascripts/ide/components/ide_external_links_spec.js
spec/javascripts/ide/components/ide_external_links_spec.js
+0
-43
spec/javascripts/ide/components/ide_tree_spec.js
spec/javascripts/ide/components/ide_tree_spec.js
+19
-17
spec/javascripts/ide/mock_data.js
spec/javascripts/ide/mock_data.js
+1
-0
No files found.
app/assets/javascripts/ide/components/activity_bar.vue
View file @
ed0a1818
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
ExternalLinks
from
'
./ide_external_links.vue
'
;
import
{
ActivityBarViews
}
from
'
../stores/state
'
;
export
default
{
components
:
{
Icon
,
ExternalLinks
,
},
computed
:
{
...
mapGetters
([
'
currentProject
'
]),
...
mapState
([
'
currentActivityView
'
]),
goBackUrl
()
{
return
document
.
referrer
||
this
.
currentProject
.
web_url
;
},
},
methods
:
{
...
mapActions
([
'
updateActivityBarView
'
]),
...
...
@@ -23,11 +24,17 @@ export default {
<
template
>
<nav
class=
"ide-activity-bar"
>
<ul
class=
"list-unstyled"
>
<li>
<external-links
class=
"ide-activity-bar-link"
:project-url=
"currentProject.web_url"
/>
<li
v-once
>
<a
:href=
"goBackUrl"
class=
"ide-sidebar-link"
:aria-label=
"s__('IDE|Go back')"
>
<icon
:size=
"16"
name=
"go-back"
/>
</a>
</li>
<li>
<button
...
...
app/assets/javascripts/ide/components/ide_external_links.vue
deleted
100644 → 0
View file @
fda4128a
<
script
>
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
export
default
{
components
:
{
icon
,
},
props
:
{
projectUrl
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
goBackUrl
()
{
return
document
.
referrer
||
this
.
projectUrl
;
},
},
};
</
script
>
<
template
>
<a
:href=
"goBackUrl"
class=
"ide-sidebar-link"
:aria-label=
"s__('IDE|Go back')"
v-once
>
<icon
:size=
"16"
name=
"go-back"
/>
</a>
</
template
>
app/assets/javascripts/ide/components/ide_tree.vue
View file @
ed0a1818
...
...
@@ -23,7 +23,7 @@ export default {
<div
class=
"ide-file-list"
>
<template
v-if=
"
!currentTree ||
currentTree.loading"
>
<template
v-if=
"currentTree.loading"
>
<div
class=
"multi-file-loading-container"
v-for=
"n in 3"
...
...
app/assets/stylesheets/pages/repo.scss
View file @
ed0a1818
...
...
@@ -73,7 +73,6 @@
.ide-new-btn
{
display
:
none
;
margin-bottom
:
-4px
;
margin-right
:
-8px
;
}
&
:hover
,
...
...
spec/javascripts/ide/components/ide_external_links_spec.js
deleted
100644 → 0
View file @
fda4128a
import
Vue
from
'
vue
'
;
import
ideExternalLinks
from
'
~/ide/components/ide_external_links.vue
'
;
import
createComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
ide external links component
'
,
()
=>
{
let
vm
;
let
fakeReferrer
;
let
Component
;
const
fakeProjectUrl
=
'
/project/
'
;
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
ideExternalLinks
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
goBackUrl
'
,
()
=>
{
it
(
'
renders the Go Back link with the referrer when present
'
,
()
=>
{
fakeReferrer
=
'
/example/README.md
'
;
spyOnProperty
(
document
,
'
referrer
'
).
and
.
returnValue
(
fakeReferrer
);
vm
=
createComponent
(
Component
,
{
projectUrl
:
fakeProjectUrl
,
}).
$mount
();
expect
(
vm
.
goBackUrl
).
toEqual
(
fakeReferrer
);
});
it
(
'
renders the Go Back link with the project url when referrer is not present
'
,
()
=>
{
fakeReferrer
=
''
;
spyOnProperty
(
document
,
'
referrer
'
).
and
.
returnValue
(
fakeReferrer
);
vm
=
createComponent
(
Component
,
{
projectUrl
:
fakeProjectUrl
,
}).
$mount
();
expect
(
vm
.
goBackUrl
).
toEqual
(
fakeProjectUrl
);
});
});
});
spec/javascripts/ide/components/ide_tree_spec.js
View file @
ed0a1818
import
Vue
from
'
vue
'
;
import
IdeTree
from
'
~/ide/components/ide_tree.vue
'
;
import
createComponent
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
file
}
from
'
../helpers
'
;
import
store
from
'
~/ide/stores
'
;
import
{
createComponentWithStore
}
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
resetStore
,
file
}
from
'
../helpers
'
;
import
{
projectData
}
from
'
../mock_data
'
;
describe
(
'
IdeRepoTree
'
,
()
=>
{
let
vm
;
let
tree
;
beforeEach
(()
=>
{
const
IdeRepoTree
=
Vue
.
extend
(
IdeTree
);
tree
=
{
tree
:
[
file
()],
store
.
state
.
currentProjectId
=
'
abcproject
'
;
store
.
state
.
currentBranchId
=
'
master
'
;
store
.
state
.
projects
.
abcproject
=
Object
.
assign
({},
projectData
);
Vue
.
set
(
store
.
state
.
trees
,
'
abcproject/master
'
,
{
tree
:
[
file
(
'
fileName
'
)],
loading
:
false
,
};
vm
=
createComponent
(
IdeRepoTree
,
{
tree
,
});
vm
=
createComponentWithStore
(
IdeRepoTree
,
store
).
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders a sidebar
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.loading-file
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.file
'
)).
not
.
toBeNull
();
resetStore
(
vm
.
$store
);
});
it
(
'
renders
3 loading files if tree is
loading
'
,
done
=>
{
t
ree
.
loading
=
true
;
it
(
'
renders loading
'
,
done
=>
{
vm
.
currentT
ree
.
loading
=
true
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelectorAll
(
'
.multi-file-loading-container
'
).
length
).
toEqual
(
3
);
expect
(
vm
.
$el
.
querySelectorAll
(
'
.multi-file-loading-container
'
).
length
).
toBe
(
3
);
done
();
});
});
it
(
'
renders list of files
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
fileName
'
);
});
});
spec/javascripts/ide/mock_data.js
View file @
ed0a1818
...
...
@@ -5,6 +5,7 @@ export const projectData = {
web_url
:
''
,
avatar_url
:
''
,
path
:
''
,
name_with_namespace
:
'
namespace/abcproject
'
,
branches
:
{
master
:
{
treeId
:
'
abcproject/master
'
,
...
...
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