summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_rollback.js.es6
blob: b52298b4a88a88740478999960661e5887bdc056 (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
/*= require vue */
/* global Vue */

(() => {
  window.gl = window.gl || {};
  window.gl.environmentsList = window.gl.environmentsList || {};

  gl.environmentsList.RollbackComponent = Vue.component('rollback-component', {
    props: {
      retryUrl: {
        type: String,
        default: '',
      },

      isLastDeployment: {
        type: Boolean,
        default: true,
      },
    },

    template: `
      <a class="btn" :href="retryUrl" data-method="post" rel="nofollow">
        <span v-if="isLastDeployment">
          Re-deploy
        </span>
        <span v-else>
          Rollback
        </span>
      </a>
    `,
  });
})();