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
d697b9c8
Commit
d697b9c8
authored
Oct 24, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds link to actions. Cleans spaces
parent
a265826e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
42 deletions
+51
-42
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+3
-4
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+14
-7
app/assets/stylesheets/pages/environments.scss
app/assets/stylesheets/pages/environments.scss
+0
-1
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+4
-3
app/views/projects/environments/components/_actions.html.haml
...views/projects/environments/components/_actions.html.haml
+4
-2
app/views/projects/environments/components/_environment.html.haml
...s/projects/environments/components/_environment.html.haml
+22
-22
app/views/projects/environments/components/_rollback.html.haml
...iews/projects/environments/components/_rollback.html.haml
+2
-2
app/views/projects/environments/components/_stop.html.haml
app/views/projects/environments/components/_stop.html.haml
+2
-1
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
d697b9c8
...
...
@@ -29,7 +29,7 @@
open: false
};
},
computed: {
/**
...
...
@@ -42,7 +42,7 @@
isFolder () {
return this.model.children && this.model.children.length ? true : false;
},
/**
* If an item is inside a folder structure will return true.
* Used for css purposes.
...
...
@@ -52,8 +52,7 @@
isChildren () {
return this.model['vue-isChildren'];
},
/**
* Counts the number of environments in each folder.
* Used to show a badge with the counter.
...
...
app/assets/javascripts/environments/stores/environmnets_store.js.es6
View file @
d697b9c8
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
gl.environmentsList.EnvironmentsStore = {
state: {},
create () {
this.state.environments = [];
},
/**
* In order to display a tree view we need to modify the received
* data in to a tree structure based on `environment_type`
...
...
@@ -87,15 +87,22 @@
return environmentsTree;
},
sortByName (a,b) {
/**
* Sorts the two objects provided by their name.
*
* @param {Object} a
* @param {Object} b
* @returns {Number}
*/
sortByName (a, b) {
const nameA = a.name.toUpperCase();
const nameB = b.name.toUpperCase();
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
...
...
app/assets/stylesheets/pages/environments.scss
View file @
d697b9c8
...
...
@@ -86,7 +86,6 @@
}
.table.ci-table.environments
{
.icon-container
{
width
:
20px
;
text-align
:
center
;
...
...
app/controllers/projects/environments_controller.rb
View file @
d697b9c8
...
...
@@ -75,11 +75,12 @@ class Projects::EnvironmentsController < Projects::ApplicationController
include:
{
last_deployment:
{
include:
{
user:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
}
user:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
deployable:
{
only:
[
:id
,
:name
,
:ref
,
:tag
]
}
},
methods:
[
:short_sha
,
:commit_title
,
:
deployable
,
:
commit
]
methods:
[
:short_sha
,
:commit_title
,
:commit
]
},
project:
{
methods:
[
:namespace
]}
project:
{
methods:
[
:namespace
]
}
}
)
end
...
...
app/views/projects/environments/components/_actions.html.haml
View file @
d697b9c8
...
...
@@ -7,8 +7,10 @@
%ul
.dropdown-menu.dropdown-menu-align-right
%li
{
"v-for"
=>
"action in model.last_deployment.manual_actions"
}
-# transform this = link_to [:play, @project.namespace.becomes(Namespace), @project, action] into href
%a
{
data:
{
"method"
=>
":post"
,
"rel"
=>
"nofollow"
}}
%a
{
":ref"
=>
"'#{namespace_project_path(@project.namespace, @project)}/' + action.id + '/play'"
,
"data-method"
=>
"post"
,
"rel"
=>
"nofollow"
}
=
custom_icon
(
'icon_play'
)
%span
{{action.name}}
\ No newline at end of file
app/views/projects/environments/components/_environment.html.haml
View file @
d697b9c8
%script
#environment-item-template
{
"type"
=>
"text/x-template"
}
%tr
%td
{
"v-bind:class"
=>
"{ 'children-row': isChildren}"
}
%td
{
"v-bind:class"
=>
"{ 'children-row': isChildren}"
}
%a
.environment-name
{
"v-if"
=>
"!isFolder"
,
":href"
=>
"'#{namespace_project_environments_path(@project.namespace, @project)}/' + model.id"
}
{{model.name}}
%span
.folder-name
{
"v-if"
=>
"isFolder"
,
"@click"
=>
"toggle"
}
%i
.folder-icon
{
"v-show"
=>
"open"
}
%i
.folder-icon
{
"v-show"
=>
"open"
}
=
icon
(
"caret-down"
)
%i
.folder-icon
{
"v-show"
=>
"!open"
}
%i
.folder-icon
{
"v-show"
=>
"!open"
}
=
icon
(
"caret-right"
)
{{model.name}}
%span
.badge
{{childrenCounter}}
%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
{{model.last_deployment.iid}}
%span
{
"v-if"
=>
"model.last_deployment.user"
}
%span
{
"v-if"
=>
"model.last_deployment.user"
}
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"
,
":alt"
=>
"model.last_deployment.user.username + 'avatar'"
,
":title"
=>
"model.last_deployment.user.username"
,
data:
{
container:
"body"
},
data:
{
container:
"body"
},
width:
20
,
height:
20
}
%td
%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.deployable.name}}
=
precede
"#"
do
{{model.last_deployment.deployable.id}}
%td
=
render
"projects/environments/components/commit"
%p
.commit-title
{
"v-if"
=>
"!isFolder && !model.last_deployment"
}
%p
.commit-title
{
"v-if"
=>
"!isFolder && !model.last_deployment"
}
No deployments yet
%td
%span
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
%span
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
{{model.last_deployment.created_at}}
%td
.hidden-xs
.pull-right
{
"v-if"
=>
"!isFolder"
}
.pull-right
{
"v-if"
=>
"!isFolder"
}
=
render
"projects/environments/components/external_url"
=
render
"projects/environments/components/actions"
=
render
"projects/environments/components/stop"
=
render
"projects/environments/components/rollback"
%tr
{
"v-if"
=>
"open && isFolder"
,
"is"
=>
"environment-item"
,
"v-for"
=>
"model in model.children"
,
":model"
=>
"model"
}
":model"
=>
"model"
}
app/views/projects/environments/components/_rollback.html.haml
View file @
d697b9c8
...
...
@@ -4,7 +4,7 @@
"data-method"
=>
"post"
,
"rel"
=>
"nofollow"
}
%span
{
"v-if"
=>
"model.last_deployment.last"
}
%span
{
"v-if"
=>
"model.last_deployment.last"
}
Re-deploy
%span
{
"v-if"
=>
"!model.last_deployment.last"
}
%span
{
"v-if"
=>
"!model.last_deployment.last"
}
Rollback
app/views/projects/environments/components/_stop.html.haml
View file @
d697b9c8
...
...
@@ -2,5 +2,6 @@
.inline
{
"v-if"
=>
"model.stop_action"
}
%a
.btn.stop-env-link
{
":href"
=>
"'#{namespace_project_environments_path(@project.namespace, @project)}/' + model.id"
,
"method"
=>
":post"
,
"rel"
=>
"nofollow"
,
"confirm"
=>
"Are you sure you want to stop this environment?"
}
"rel"
=>
"nofollow"
,
"confirm"
=>
"Are you sure you want to stop this environment?"
}
=
icon
(
"stop"
,
class:
"stop-env-icon"
)
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