Adds link to actions. Cleans spaces
This commit is contained in:
parent
a265826e01
commit
d697b9c86d
|
@ -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.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
(() => {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
}
|
||||
|
||||
.table.ci-table.environments {
|
||||
|
||||
.icon-container {
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}}
|
|
@ -1,62 +1,62 @@
|
|||
%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" }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue