summaryrefslogtreecommitdiff
path: root/app/views/projects/environments
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-07 18:44:16 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-16 11:58:08 +0000
commit2207528c376f0c64469f077f82dfb49a3f7e7993 (patch)
treee092689e608657f2e0181446036abda67005cef4 /app/views/projects/environments
parent4ea04c4035368efa007abbf560e7ca6882a361b8 (diff)
downloadgitlab-ce-2207528c376f0c64469f077f82dfb49a3f7e7993.tar.gz
Uses vue computed data
Fixes some eslint errors Adds some documentation Improves data manipulation
Diffstat (limited to 'app/views/projects/environments')
-rw-r--r--app/views/projects/environments/components/_actions.html.haml6
-rw-r--r--app/views/projects/environments/components/_environment.html.haml4
-rw-r--r--app/views/projects/environments/components/_rollback.html.haml8
-rw-r--r--app/views/projects/environments/components/_stop.html.haml4
4 files changed, 11 insertions, 11 deletions
diff --git a/app/views/projects/environments/components/_actions.html.haml b/app/views/projects/environments/components/_actions.html.haml
index 82acda0de9c..a2c229f1315 100644
--- a/app/views/projects/environments/components/_actions.html.haml
+++ b/app/views/projects/environments/components/_actions.html.haml
@@ -1,13 +1,13 @@
- if can?(current_user, :create_deployment, @project)
- .inline{ "v-if" => "model.last_deployment && model.last_deployment.manual_actions && model.last_deployment.manual_actions.present"}
+ .inline{ "v-if" => "hasManualActions"}
.dropdown
%a.dropdown-new.btn.btn-default{type: "button", "data-toggle" => "dropdown"}
= custom_icon('icon_play')
= icon('caret-down')
%ul.dropdown-menu.dropdown-menu-align-right
- %li{ "v-for" => "action in model.last_deployment.manual_actions" }
- %a{ ":ref" => "'#{namespace_project_path(@project.namespace, @project)}/' + action.id + '/play'",
+ %li{ "v-for" => "action in manualActions" }
+ %a{ ":ref" => "action.play_url",
"data-method" => "post",
"rel" => "nofollow" }
diff --git a/app/views/projects/environments/components/_environment.html.haml b/app/views/projects/environments/components/_environment.html.haml
index 122cea2c3a4..2fecfd85f61 100644
--- a/app/views/projects/environments/components/_environment.html.haml
+++ b/app/views/projects/environments/components/_environment.html.haml
@@ -44,8 +44,8 @@
No deployments yet
%td
- %span{ "v-if" => "!isFolder && model.last_deployment" }
- {{model.last_deployment.created_at}}
+ %span.environment-created-date-timeago{ "v-if" => "!isFolder && model.last_deployment" }
+ {{createdDate}}
%td.hidden-xs
.pull-right{ "v-if" => "!isFolder" }
diff --git a/app/views/projects/environments/components/_rollback.html.haml b/app/views/projects/environments/components/_rollback.html.haml
index 2258f6ec32d..e3449c5515e 100644
--- a/app/views/projects/environments/components/_rollback.html.haml
+++ b/app/views/projects/environments/components/_rollback.html.haml
@@ -1,10 +1,10 @@
- if can?(current_user, :create_deployment, @project)
- %a.btn.btn-build{ "v-if" => "model.last_deployment && model.last_deployment.deployable",
- ":href" => "'#{namespace_project_builds_path(@project.namespace, @project)}/' + model.last_deployment.deployable.id + '/retry'",
+ %a.btn.btn-build{ "v-if" => "canRetry",
+ ":href" => "model.last_deployment.deployable.retry_url",
"data-method" => "post",
"rel" => "nofollow" }
- %span{ "v-if" => "model.last_deployment.last" }
+ %span{ "v-if" => "isLastDeployment" }
Re-deploy
- %span{ "v-if" => "!model.last_deployment.last" }
+ %span{ "v-if" => "!isLastDeployment" }
Rollback
diff --git a/app/views/projects/environments/components/_stop.html.haml b/app/views/projects/environments/components/_stop.html.haml
index 55cccf9e72e..a7100f15784 100644
--- a/app/views/projects/environments/components/_stop.html.haml
+++ b/app/views/projects/environments/components/_stop.html.haml
@@ -1,6 +1,6 @@
- if can?(current_user, :create_deployment, @project)
- .inline{ "v-if" => "model.stop_action" }
- %a.btn.stop-env-link{":href" => "'#{namespace_project_environments_path(@project.namespace, @project)}/' + model.id",
+ .inline{ "v-if" => "isStoppable" }
+ %a.btn.stop-env-link{":href" => "model.environment_url",
"method" => ":post",
"rel" => "nofollow",
"confirm" => "Are you sure you want to stop this environment?"}