gitlab-org--gitlab-foss/app/assets/javascripts/environments/components/environment_actions.js.es6

50 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-11-16 06:23:36 -05:00
/*= require vue */
2016-11-09 10:22:11 -05:00
/* global Vue */
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
2016-11-09 12:36:42 -05:00
2016-11-09 10:22:11 -05:00
window.gl.environmentsList.ActionsComponent = Vue.component('actions-component', {
props: {
actions: {
type: Array,
required: false,
2016-11-09 12:36:42 -05:00
default: () => [],
},
2016-11-18 06:26:20 -05:00
2016-12-08 06:42:56 -05:00
playIconSvg: {
type: String,
required: false,
},
2016-11-09 10:22:11 -05:00
},
2016-11-09 12:36:42 -05:00
2016-11-09 10:22:11 -05:00
template: `
<div class="inline">
<div class="dropdown">
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
2016-12-09 05:14:00 -05:00
<span class="js-dropdown-play-icon-container" v-html="playIconSvg"></span>
<i class="fa fa-caret-down"></i>
2016-11-09 10:22:11 -05:00
</a>
2016-11-09 12:36:42 -05:00
2016-11-09 10:22:11 -05:00
<ul class="dropdown-menu dropdown-menu-align-right">
<li v-for="action in actions">
2016-11-18 06:08:12 -05:00
<a :href="action.play_path"
data-method="post"
rel="nofollow"
class="js-manual-action-link">
2016-12-08 07:06:49 -05:00
2016-12-09 05:14:00 -05:00
<span class="js-action-play-icon-container" v-html="playIconSvg"></span>
2016-12-08 07:06:49 -05:00
2016-11-21 06:45:22 -05:00
<span>
{{action.name}}
</span>
2016-11-09 10:22:11 -05:00
</a>
</li>
</ul>
</div>
</div>
2016-11-09 12:36:42 -05:00
`,
});
})();