summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_rollback.js
blob: daf126eb4e81851033cb734243eee614af6f2c84 (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
/**
 * Renders Rollback or Re deploy button in environments table depending
 * of the provided property `isLastDeployment`
 */
const Vue = require('vue');

module.exports = 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>
  `,
});