summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_actions.js.es6
blob: d35a04419613e91943d3f8c485062076b044613f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*= 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: () => [],
      },

      playIconSvg: {
        type: String,
        required: false,
      },
    },

    template: `
      <div class="inline">
        <div class="dropdown">
          <a class="dropdown-new btn btn-default" data-toggle="dropdown">
            <span class="js-dropdown-play-icon-container" v-html='playIconSvg'></span>
            <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_path"
                data-method="post"
                rel="nofollow"
                class="js-manual-action-link">

                <span class="js-action-play-icon-container" v-html='playIconSvg'></span>

                <span>
                  {{action.name}}
                </span>
              </a>
            </li>
          </ul>
        </div>
      </div>
    `,
  });
})();