Commit 60099d90 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds environments actions component

parent 5cfc2d0c
/*= require vue
/* global Vue */
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList.ActionsComponent = Vue.component('actions-component', {
props: {
actions: {
type: Array,
required: false,
default: () => []
}
},
template: `
<div class="inline">
<div class="dropdown">
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
playIcon
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-menu-align-right">
<li v-for="action in actions">
<a :href="action.play_url" data-method="post" rel="nofollow">
icon play
<span>
{{action.name}}
</span>
</a>
</li>
</ul>
</div>
</div>
`
});
})();
\ No newline at end of file
/*= require vue_common_component/commit
/*= require timeago
/* globals Vue, timeago */
(() => {
......
......@@ -41,7 +41,9 @@ $(() => {
data: {
state: Store.state,
endpoint: environmentsListApp.dataset.endpoint,
endpoint: environmentsListApp.dataset.environmentsDataEndpoint,
canCreateDeployment: environmentsListApp.dataset.canCreateDeployment,
canReadEnvironment: environmentsListApp.dataset.canReadEnvironment,
loading: true,
visibility: 'available',
},
......
......@@ -5,7 +5,7 @@
- content_for :page_specific_javascripts do
= page_specific_javascript_tag("environments/environments_bundle.js")
#environments-list-view{ data: environments_list_data, class: container_class }
#environments-list-view{ data: { environments_data: environments_list_data, "can-create-deployment" => can?(current_user, :create_deployment, @environment), "can_read_environment" => can?(current_user, :read_environment, @project)}, class: container_class }
.top-area
%ul.nav-links{ "v-if" => "!loading" }
%li{class: ('active' if @scope.nil?)}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment