2019-07-31 22:56:46 +05:30
< script >
import { GlModal } from '@gitlab/ui' ;
import { sprintf , s _ _ } from '~/locale' ;
import trackUninstallButtonClickMixin from 'ee_else_ce/clusters/mixins/track_uninstall_button_click' ;
2019-10-12 21:52:04 +05:30
import { HELM , INGRESS , CERT _MANAGER , PROMETHEUS , RUNNER , KNATIVE , JUPYTER } from '../constants' ;
2019-07-31 22:56:46 +05:30
const CUSTOM _APP _WARNING _TEXT = {
2019-10-12 21:52:04 +05:30
[ HELM ] : s _ _ (
'ClusterIntegration|The associated Tiller pod will be deleted and cannot be restored.' ,
) ,
2019-07-31 22:56:46 +05:30
[ INGRESS ] : s _ _ (
'ClusterIntegration|The associated load balancer and IP will be deleted and cannot be restored.' ,
) ,
[ CERT _MANAGER ] : s _ _ (
2019-10-12 21:52:04 +05:30
'ClusterIntegration|The associated private key will be deleted and cannot be restored.' ,
2019-07-31 22:56:46 +05:30
) ,
[ PROMETHEUS ] : s _ _ ( 'ClusterIntegration|All data will be deleted and cannot be restored.' ) ,
[ RUNNER ] : s _ _ ( 'ClusterIntegration|Any running pipelines will be canceled.' ) ,
2019-10-12 21:52:04 +05:30
[ KNATIVE ] : s _ _ (
'ClusterIntegration|The associated IP and all deployed services will be deleted and cannot be restored. Uninstalling Knative will also remove Istio from your cluster. This will not effect any other applications.' ,
) ,
2019-09-30 21:07:59 +05:30
[ JUPYTER ] : s _ _ (
'ClusterIntegration|All data not committed to GitLab will be deleted and cannot be restored.' ,
) ,
2019-07-31 22:56:46 +05:30
} ;
export default {
components : {
GlModal ,
} ,
mixins : [ trackUninstallButtonClickMixin ] ,
props : {
application : {
type : String ,
required : true ,
} ,
applicationTitle : {
type : String ,
required : true ,
} ,
} ,
computed : {
title ( ) {
return sprintf ( s _ _ ( 'ClusterIntegration|Uninstall %{appTitle}' ) , {
appTitle : this . applicationTitle ,
} ) ;
} ,
warningText ( ) {
return sprintf (
s _ _ ( 'ClusterIntegration|You are about to uninstall %{appTitle} from your cluster.' ) ,
{
appTitle : this . applicationTitle ,
} ,
) ;
} ,
customAppWarningText ( ) {
return CUSTOM _APP _WARNING _TEXT [ this . application ] ;
} ,
modalId ( ) {
return ` uninstall- ${ this . application } ` ;
} ,
} ,
methods : {
confirmUninstall ( ) {
this . trackUninstallButtonClick ( this . application ) ;
this . $emit ( 'confirm' ) ;
} ,
} ,
} ;
< / script >
< template >
< gl-modal
ok - variant = "danger"
cancel - variant = "light"
: ok - title = "title"
: modal - id = "modalId"
: title = "title"
@ ok = "confirmUninstall()"
> { { warningText } } { { customAppWarningText } } < / g l - m o d a l
>
< / template >