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
fa42efde
Commit
fa42efde
authored
Mar 02, 2018
by
André Luís
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Go Back link to WebIDE
parent
de645911
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
18 deletions
+127
-18
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+30
-18
ee/app/assets/javascripts/ide/components/ide_external_links.vue
.../assets/javascripts/ide/components/ide_external_links.vue
+43
-0
ee/app/assets/javascripts/ide/components/ide_project_tree.vue
...pp/assets/javascripts/ide/components/ide_project_tree.vue
+5
-0
ee/changelogs/unreleased/4592-go-back-option-ide.yml
ee/changelogs/unreleased/4592-go-back-option-ide.yml
+6
-0
spec/javascripts/ide/components/ide_external_links_spec.js
spec/javascripts/ide/components/ide_external_links_spec.js
+43
-0
No files found.
app/assets/stylesheets/pages/repo.scss
View file @
fa42efde
...
...
@@ -596,11 +596,6 @@
padding-bottom
:
0
;
}
.multi-file-commit-panel
.multi-file-commit-panel-inner-scroll
{
max-height
:
calc
(
100vh
-
#{
$header-height
+
$context-header-height
}
);
min-height
:
calc
(
100vh
-
#{
$header-height
+
$context-header-height
}
);
}
&
.flash-shown
{
.content-wrapper
{
margin-top
:
0
;
...
...
@@ -609,10 +604,11 @@
.ide-view
{
height
:
calc
(
100vh
-
#{
$header-height
+
$flash-height
}
);
}
}
.multi-file-commit-panel
.multi-file-commit-panel-inner-scroll
{
max-height
:
calc
(
100vh
-
#{
$header-height
+
$flash-height
+
$context-header-height
}
);
min-height
:
calc
(
100vh
-
#{
$header-height
+
$flash-height
+
$context-header-height
}
)
;
.projects-sidebar
{
.multi-file-commit-panel-inner-scroll
{
flex
:
1
;
}
}
}
...
...
@@ -632,11 +628,6 @@
height
:
calc
(
100vh
-
#{
$header-height
+
$performance-bar-height
}
);
}
.multi-file-commit-panel
.multi-file-commit-panel-inner-scroll
{
max-height
:
calc
(
100vh
-
#{
$header-height
+
$performance-bar-height
+
60
}
);
min-height
:
calc
(
100vh
-
#{
$header-height
+
$performance-bar-height
+
60
}
);
}
&
.flash-shown
{
.content-wrapper
{
margin-top
:
0
;
...
...
@@ -645,11 +636,6 @@
.ide-view
{
height
:
calc
(
100vh
-
#{
$header-height
+
$performance-bar-height
+
$flash-height
}
);
}
.multi-file-commit-panel
.multi-file-commit-panel-inner-scroll
{
max-height
:
calc
(
100vh
-
#{
$header-height
+
$performance-bar-height
+
$flash-height
+
$context-header-height
}
);
min-height
:
calc
(
100vh
-
#{
$header-height
+
$performance-bar-height
+
$flash-height
+
$context-header-height
}
);
}
}
}
...
...
@@ -684,3 +670,29 @@
.ide-commit-new-branch
{
margin-left
:
25px
;
}
.ide-external-links
{
p
{
margin
:
0
;
}
}
.ide-sidebar-link
{
padding
:
$gl-padding-8
$gl-padding
;
background
:
$indigo-700
;
color
:
$white-light
;
text-decoration
:
none
;
display
:
flex
;
align-items
:
center
;
&
:focus
,
&
:hover
{
color
:
$white-light
;
text-decoration
:
underline
;
background
:
$indigo-500
;
}
&
:active
{
background
:
$indigo-800
;
}
}
ee/app/assets/javascripts/ide/components/ide_external_links.vue
0 → 100644
View file @
fa42efde
<
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
>
<nav
class=
"ide-external-links"
v-once
>
<p>
<a
:href=
"goBackUrl"
class=
"ide-sidebar-link"
>
<icon
:size=
"16"
class=
"append-right-8"
name=
"go-back"
/>
<span
class=
"ide-external-links-text"
>
{{
s__
(
'
Go back
'
)
}}
</span>
</a>
</p>
</nav>
</
template
>
ee/app/assets/javascripts/ide/components/ide_project_tree.vue
View file @
fa42efde
<
script
>
import
projectAvatarImage
from
'
~/vue_shared/components/project_avatar/image.vue
'
;
import
branchesTree
from
'
./ide_project_branches_tree.vue
'
;
import
externalLinks
from
'
./ide_external_links.vue
'
;
export
default
{
components
:
{
branchesTree
,
externalLinks
,
projectAvatarImage
,
},
props
:
{
...
...
@@ -37,6 +39,9 @@ export default {
</div>
</a>
</div>
<external-links
:project-url=
"project.web_url"
/>
<div
class=
"multi-file-commit-panel-inner-scroll"
>
<branches-tree
v-for=
"branch in project.branches"
...
...
ee/changelogs/unreleased/4592-go-back-option-ide.yml
0 → 100644
View file @
fa42efde
---
title
:
Add a Go back button to WebIDE to allow returning to where it was launched
from
merge_request
:
author
:
type
:
added
spec/javascripts/ide/components/ide_external_links_spec.js
0 → 100644
View file @
fa42efde
import
Vue
from
'
vue
'
;
import
ideExternalLinks
from
'
ee/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
);
});
});
});
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