summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_rollback.js
blob: a558dbe6d828e157d5362ae78e5b7bb86b85bc89 (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
/**
 * Renders Rollback or Re deploy button in environments table depending
 * of the provided property `isLastDeployment`
 */
export default {
  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>
  `,
};