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

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 ? __('Uninstalling') : __('Uninstall');
    },
  },
};
</script>

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