summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters/components/uninstall_application_button.vue
blob: ef4bcbe14dd48c10a7147a720ba06614311cad6d (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
<script>
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import { APPLICATION_STATUS } from '~/clusters/constants';

const { UPDATING, UNINSTALLING } = APPLICATION_STATUS;

export default {
  components: {
    LoadingButton,
  },
  props: {
    status: {
      type: String,
      required: true,
    },
  },
  computed: {
    disabled() {
      return [UNINSTALLING, UPDATING].includes(this.status);
    },
    loading() {
      return this.status === UNINSTALLING;
    },
    label() {
      return this.loading ? this.__('Uninstalling') : this.__('Uninstall');
    },
  },
};
</script>

<template>
  <loading-button :label="label" :disabled="disabled" :loading="loading" />
</template>