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
e4ff8dd2
Commit
e4ff8dd2
authored
Oct 20, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recursive component
parent
96152f17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
95 deletions
+41
-95
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+5
-6
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+1
-1
app/views/projects/environments/components/_environment.html.haml
...s/projects/environments/components/_environment.html.haml
+33
-83
app/views/projects/environments/index.html.haml
app/views/projects/environments/index.html.haml
+2
-5
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
e4ff8dd2
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
*
*
* Used in a hierarchical structure to show folders with children
* Used in a hierarchical structure to show folders with children
* in a table.
* in a table.
* Based on [Tree View](https://vuejs.org/examples/tree-view.html)
* Recursive component based on [Tree View](https://vuejs.org/examples/tree-view.html)
* The template used in this Component is non recursive.
*
*
* See this [issue](https://gitlab.com/gitlab-org/gitlab-ce/issues/22539)
* See this [issue](https://gitlab.com/gitlab-org/gitlab-ce/issues/22539)
* for more information.
* for more information.
...
@@ -17,7 +16,7 @@
...
@@ -17,7 +16,7 @@
window.gl = window.gl || {};
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList = window.gl.environmentsList || {};
gl.environmentsList.EnvironmentItem = Vue.
extend(
{
gl.environmentsList.EnvironmentItem = Vue.
component("environment-item",
{
template: '#environment-item-template',
template: '#environment-item-template',
...
@@ -25,7 +24,7 @@
...
@@ -25,7 +24,7 @@
model: Object
model: Object
},
},
data
: function
() {
data () {
return {
return {
open: false
open: false
};
};
...
@@ -40,7 +39,7 @@
...
@@ -40,7 +39,7 @@
*
*
* @returns {Number} The length of the children array
* @returns {Number} The length of the children array
*/
*/
isFolder
: function
() {
isFolder () {
return this.model.children && this.model.children.length
return this.model.children && this.model.children.length
}
}
},
},
...
@@ -50,7 +49,7 @@
...
@@ -50,7 +49,7 @@
/**
/**
* Toggles the visibility of a folders' children.
* Toggles the visibility of a folders' children.
*/
*/
toggle
: function
() {
toggle () {
if (this.isFolder) {
if (this.isFolder) {
this.open = !this.open;
this.open = !this.open;
}
}
...
...
app/assets/javascripts/environments/environments_bundle.js.es6
View file @
e4ff8dd2
...
@@ -20,7 +20,7 @@ $(() => {
...
@@ -20,7 +20,7 @@ $(() => {
el: '#environments-list-view',
el: '#environments-list-view',
components: {
components: {
'
environment-
item': gl.environmentsList.EnvironmentItem
'item': gl.environmentsList.EnvironmentItem
},
},
data: {
data: {
...
...
app/views/projects/environments/components/_environment.html.haml
View file @
e4ff8dd2
%script
#environment-item-template
{
"type"
=>
"text/x-template"
}
%script
#environment-item-template
{
"type"
=>
"text/x-template"
}
%tr
.environment
%tr
%td
.folder-name
{
"@click"
=>
"toggle"
}
%td
.folder-name
%a
{
"v-if"
=>
"!isFolder"
,
%a
{
"v-if"
=>
"!isFolder"
,
":href"
=>
"'#{namespace_project_environments_path(@project.namespace, @project)}/' + model.id"
}
":href"
=>
"'#{namespace_project_environments_path(@project.namespace, @project)}/' + model.id"
}
{{model.name}}
{{model.name}}
%span
{
"v-if"
=>
"isFolder"
,
"@click"
=>
"toggle"
}
%span
{
"v-if"
=>
"isFolder"
}
%i
.folder-icon
{
"v-show"
=>
"open"
}
%i
.folder-icon
{
"v-show"
=>
"open"
}
=
icon
(
"caret-down"
)
=
icon
(
"caret-down"
)
%i
.folder-icon
{
"v-show"
=>
"!open"
}
=
icon
(
"caret-right"
)
%i
.folder-icon
{
"v-show"
=>
"!open"
}
=
icon
(
"caret-right"
)
{{model.name}}
{{model.name}}
%td
.deployment-column
%td
.deployment-column
%span
{
"v-if"
=>
"!isFolder && model.last_deployment && model.last_deployment.iid"
}
%span
{
"v-if"
=>
"!isFolder && model.last_deployment && model.last_deployment.iid"
}
=
precede
'#'
do
=
precede
"#"
do
{{model.last_deployment.iid}}
{{model.last_deployment.iid}}
%span
{
"v-if"
=>
"model.last_deployment.user"
}
%span
{
"v-if"
=>
"model.last_deployment.user"
}
by
by
%a
{
":href"
=>
"'/' + model.last_deployment.user.username"
}
%a
{
":href"
=>
"'/' + model.last_deployment.user.username"
}
%img
.avatar.has_tooltip.s20
{
":src"
=>
"model.last_deployment.user.avatar_url"
,
%img
.avatar.has-tooltip.s20
{
":src"
=>
"model.last_deployment.user.avatar_url"
,
":alt"
=>
"model.last_deployment.user.username + 'avatar'"
,
":alt"
=>
"model.last_deployment.user.username + ' avatar'"
,
":title"
=>
"model.last_deployment.user.username"
,
":title"
=>
"model.last_deployment.user.username"
,
data:
{
container:
'body'
},
data:
{
container:
"body"
},
width:
20
,
height:
20
}
width:
20
,
height:
20
}
%td
%td
%a
.build-link
{
"v-if"
=>
"!isFolder && model.last_deployment && model.last_deployment.deployable"
,
%a
.build-link
{
"v-if"
=>
"!isFolder && model.last_deployment && model.last_deployment.deployable"
,
":href"
=>
"'#{namespace_project_builds_path(@project.namespace, @project)}/' + model.last_deployment.deployable.id"
}
":href"
=>
"'#{namespace_project_builds_path(@project.namespace, @project)}/' + model.last_deployment.deployable.id"
}
{{model.last_deployment.deploy
a
ble.name}}
{{model.last_deployment.deployble.name}}
=
precede
'#'
do
=
precede
"#"
do
({{model.last_deployment.deployable.id}})
{{model.last_deployment.deployable.id}}
%td
%td
%a
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
%a
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
-# = render "projects/deployments/commit", deployment: "{{model.last_deployment}}"
commit message goes here
%p
.commit-title
{
"v-if"
=>
"!isFolder && !model.last_deployment"
}
%p
.commit-title
{
"v-if"
=>
"!isFolder && !model.last_deployment"
}
No deployments yet
No deployments yet
%td
%td
%span
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
%span
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
{{model.last_deployment.created_at}}
{{model.last_deployment.created_at}}
%td
.hidden-xs
%td
.hidden-xs
.pull-right
{
"v-if"
=>
"!isFolder"
}
.pull-right
{
"v-if"
=>
"!isFolder"
}
-# = render "projects/environments/external_url", environment: "{{model}}"
actions will go here
-# = render "projects/deployments/actions", deployment: "{{model.last_deployment}}"
-# = render "projects/environments/stop", environment: "{{model}}"
%tr
{
"v-if"
=>
"open && isFolder"
,
"is"
=>
"environment-item"
,
"v-for"
=>
"model in model.children"
,
":model"
=>
"model"
}
-# = render "projects/deployments/rollback", deployment: "{{model.last_deployment}}"
%tr
{
"v-show"
=>
"open"
,
"v-if"
=>
"isFolder"
,
"v-for"
=>
"child in model.children"
,
":model"
=>
"child"
}
%td
%a
.children-name
{
":href"
=>
"'#{namespace_project_environments_path(@project.namespace, @project)}/' + child.id"
}
{{child.name}}
%td
.deployment-column
%span
{
"v-if"
=>
"child.last_deployment && child.last_deployment.iid"
}
=
precede
'#'
do
{{child.last_deployment.iid}}
%span
{
"v-if"
=>
"child.last_deployment.user"
}
by
%a
{
":href"
=>
"'/' + child.last_deployment.user.username"
}
%img
.avatar.has-tooltip.s20
{
":src"
=>
"child.last_deployment.user.avatar_url"
,
":alt"
=>
"child.last_deployment.user.username + ' avatar'"
,
":title"
=>
"child.last_deployment.user.username"
,
data:
{
container:
'body'
},
width:
20
,
height:
20
}
%td
%a
.build-link
{
"v-if"
=>
"child.last_deployment && child.last_deployment.deployable"
,
":href"
=>
"'#{namespace_project_builds_path(@project.namespace, @project)}/' + child.last_deployment.deployable.id"
}
{{child.last_deployment.deployable.name}}
=
precede
'#'
do
({{child.last_deployment.deployable.id}})
%td
%a
{
"v-if"
=>
"child.last_deployment"
}
-# = render "projects/deployments/commit", deployment: "{{child.last_deployment}}"
%p
.commit-title
{
"v-if"
=>
"!child.last_deployment"
}
No deployments yet
%td
%span
{
"v-if"
=>
"child.last_deployment"
}
{{child.last_deployment.created_at}}
%td
.hidden-xs
.pull-right
-# = render "projects/environments/external_url", environment: "{{child}}"
-# = render "projects/deployments/actions", deployment: "{{child.last_deployment}}"
-# = render "projects/environments/stop", environment: "{{child}}"
-# = render "projects/deployments/rollback", deployment: "{{child.last_deployment}}"
app/views/projects/environments/index.html.haml
View file @
e4ff8dd2
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
=
link_to
new_namespace_project_environment_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create'
do
=
link_to
new_namespace_project_environment_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create'
do
New environment
New environment
.table-holder
{
"v-if"
=>
"!loading && state.environments
.length
"
}
.table-holder
{
"v-if"
=>
"!loading && state.environments"
}
%table
.table.ci-table.environments
%table
.table.ci-table.environments
%thead
%thead
%th
Environment
%th
Environment
...
@@ -51,9 +51,6 @@
...
@@ -51,9 +51,6 @@
%th
%th
%th
.hidden-xs
%th
.hidden-xs
%tbody
%tbody
%tr
{
"is"
=>
"environment-item"
,
%tr
{
"is"
=>
"environment-item"
,
"v-for"
=>
"model in state.environments"
,
":model"
=>
"model"
}
"inline-template"
=>
true
,
"v-for"
=>
"environment in state.environments"
,
":model"
=>
"environment"
}
=
render
"projects/environments/components/environment"
=
render
"projects/environments/components/environment"
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