33 * Licensed under the MIT License. See LICENSE file in the project root for license information.
44 *-----------------------------------------------------------------------------------------------*/
55import { Autocomplete , Badge , Button , Card , InputLabel , Modal , TextField , ThemeProvider , Typography , darken , lighten , styled } from '@mui/material' ;
6+ import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline' ;
67import React from 'react' ;
78import clsx from 'clsx' ;
89import { CardTheme } from '../../common/cardItem.style' ;
910import '../app/cardItem.scss' ;
10- import { LoadScreen } from '../../common/loading' ;
1111import { Chart } from '../helmChartType' ;
1212import { VSCodeMessage } from '../vsCodeMessage' ;
1313import { DevFileProps } from './wrapperCardItem' ;
14+ import { LoadScreen } from '../../common/loading' ;
1415
1516export class CardItem extends React . Component < DevFileProps , {
1617 displayName : string ,
@@ -21,6 +22,7 @@ export class CardItem extends React.Component<DevFileProps, {
2122 loadScreen : boolean ,
2223 error : boolean ,
2324 errorMsg : string ,
25+ installed ?: boolean
2426 }
2527} > {
2628
@@ -98,12 +100,11 @@ export class CardItem extends React.Component<DevFileProps, {
98100 installResponse : {
99101 loadScreen : message . data . show ,
100102 error : message . data . isError ,
101- errorMsg : message . data . error || ''
103+ errorMsg : message . data . error || '' ,
104+ installed : message . data . isInstalled
102105 }
103106 } ) ;
104- if ( message . data . isError === false ) {
105- this . onCloseClick ( undefined , 'backdropClick' ) ;
106- } else if ( message . data . isError ) {
107+ if ( message . data . isError ) {
107108 this . props . helmEntry . isExpand = message . data . chartName === this . state . selectedVersion . name ? true : false ;
108109 }
109110 }
@@ -318,28 +319,32 @@ export class CardItem extends React.Component<DevFileProps, {
318319 </ Typography >
319320 </ div >
320321 </ div >
321- < div style = { { width : '50%' } } >
322- < Button
323- disabled = { this . handleDisable ( ) }
324- variant = 'outlined'
325- className = { this . props . cardItemStyle . helmInstallBtn }
326- onClick = { this . clickInstall }
327- style = { { float : 'right' , backgroundColor : this . handleDisable ( ) ? 'var(--vscode-button-secondaryBackground)' : '#EE0000' , textTransform : 'none' , color : this . props . themeKind <= 1 ? 'black' : 'white' } } >
328- < Typography variant = 'body2' >
329- Install
330- </ Typography >
331- </ Button >
322+ < div style = { { width : '50%' , display : 'flex' , flexDirection : 'row' } } >
323+ < div style = { { width : '85%' } } >
324+ {
325+ installResponse . loadScreen && < LoadScreen title = 'Installation in Progress' type = 'circle' />
326+ }
327+ </ div >
328+ < div style = { { float : 'right' } } >
329+ < Button
330+ disabled = { this . handleDisable ( ) || installResponse . installed }
331+ variant = 'outlined'
332+ className = { this . props . cardItemStyle . helmInstallBtn }
333+ onClick = { this . clickInstall }
334+ style = { { float : 'right' , backgroundColor : this . handleDisable ( ) || installResponse . installed ? 'var(--vscode-button-secondaryBackground)' : '#EE0000' , textTransform : 'none' , color : this . props . themeKind <= 1 ? 'black' : 'white' } }
335+ startIcon = { installResponse . installed ? < CheckCircleOutlineIcon /> : undefined } >
336+ < Typography variant = 'body2' >
337+ { ! installResponse . installed ? 'Install' : 'Installed' }
338+ </ Typography >
339+ </ Button >
340+ </ div >
332341 </ div >
333342 </ div >
334343 </ div >
335344 </ div >
336345 {
337346 versionCard
338347 }
339- {
340- installResponse . loadScreen ?
341- < LoadScreen title = 'Installing the Chart' /> : undefined
342- }
343348 </ Card >
344349 </ Modal > ;
345350
0 commit comments