BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9e74d936
Commit
9e74d936
authored
Jul 31, 2017
by
Filipa Lacerda
Committed by
Grzegorz Bizon
Aug 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds folder_path to frontend
parent
54ede0b8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
environment.vue
...ssets/javascripts/environments/components/environment.vue
+5
-8
environment_item.vue
.../javascripts/environments/components/environment_item.vue
+1
-10
environment_entity.rb
app/serializers/environment_entity.rb
+4
-0
29943-environment-folder.yml
changelogs/unreleased/29943-environment-folder.yml
+4
-0
environment_entity_spec.rb
spec/serializers/environment_entity_spec.rb
+4
-0
No files found.
app/assets/javascripts/environments/components/environment.vue
View file @
9e74d936
...
...
@@ -111,11 +111,11 @@ export default {
},
methods
:
{
toggleFolder
(
folder
,
folderUrl
)
{
toggleFolder
(
folder
)
{
this
.
store
.
toggleFolder
(
folder
);
if
(
!
folder
.
isOpen
)
{
this
.
fetchChildEnvironments
(
folder
,
folderUrl
,
true
);
this
.
fetchChildEnvironments
(
folder
,
true
);
}
},
...
...
@@ -143,10 +143,10 @@ export default {
.
catch
(
this
.
errorCallback
);
},
fetchChildEnvironments
(
folder
,
folderUrl
,
showLoader
=
false
)
{
fetchChildEnvironments
(
folder
,
showLoader
=
false
)
{
this
.
store
.
updateEnvironmentProp
(
folder
,
'isLoadingFolderContent'
,
showLoader
);
this
.
service
.
getFolderContent
(
folder
Url
)
this
.
service
.
getFolderContent
(
folder
.
folder_path
)
.
then
(
resp
=>
resp
.
json
())
.
then
(
response
=>
this
.
store
.
setfolderContent
(
folder
,
response
.
environments
))
.
then
(()
=>
this
.
store
.
updateEnvironmentProp
(
folder
,
'isLoadingFolderContent'
,
false
))
...
...
@@ -174,10 +174,7 @@ export default {
const
openFolders
=
this
.
store
.
getOpenFolders
();
if
(
openFolders
.
length
)
{
openFolders
.
forEach
((
folder
)
=>
{
// TODO - Move this to the backend
const
folderUrl
=
`
${
window
.
location
.
pathname
}
/folders/
${
folder
.
folderName
}
`
;
return
this
.
fetchChildEnvironments
(
folder
,
folderUrl
);
return
this
.
fetchChildEnvironments
(
folder
);
});
}
},
...
...
app/assets/javascripts/environments/components/environment_item.vue
View file @
9e74d936
...
...
@@ -410,20 +410,11 @@ export default {
this
.
hasStopAction
||
this
.
canRetry
;
},
/**
* Constructs folder URL based on the current location and the folder id.
*
* @return {String}
*/
folderUrl
()
{
return
`
${
window
.
location
.
pathname
}
/folders/
${
this
.
model
.
folderName
}
`
;
},
},
methods
:
{
onClickFolder
()
{
eventHub
.
$emit
(
'toggleFolder'
,
this
.
model
,
this
.
folderUrl
);
eventHub
.
$emit
(
'toggleFolder'
,
this
.
model
);
},
},
};
...
...
app/serializers/environment_entity.rb
View file @
9e74d936
...
...
@@ -26,5 +26,9 @@ class EnvironmentEntity < Grape::Entity
terminal_project_environment_path
(
environment
.
project
,
environment
)
end
expose
:folder_path
do
|
environment
|
# folder_project_environments_path(environment.project, environment)
end
expose
:created_at
,
:updated_at
end
changelogs/unreleased/29943-environment-folder.yml
0 → 100644
View file @
9e74d936
---
title
:
Adds folder_path in API response
merge_request
:
author
:
spec/serializers/environment_entity_spec.rb
View file @
9e74d936
...
...
@@ -16,6 +16,10 @@ describe EnvironmentEntity do
expect
(
subject
).
to
include
(
:id
,
:name
,
:state
,
:environment_path
)
end
it
'exposes folder path'
do
expect
(
subject
).
to
include
(
:folder_path
)
end
context
'metrics disabled'
do
before
do
allow
(
environment
).
to
receive
(
:has_metrics?
).
and_return
(
false
)
...
...
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