@@ -2,79 +2,37 @@ import { ArrowDownIcon, ArrowUpIcon } from '@heroicons/react/solid';
2
2
import React , { memo , Component } from 'react' ;
3
3
import { Summary } from "./capacitor/Summary"
4
4
import GitopsStatus from './gitopsStatus' ;
5
- import DeployPanelTabs from '../deployPanel/deployPanelTabs' ;
6
- import { DeployStatusTab } from '../../components/deployStatus/deployStatus' ;
7
5
import {
8
6
ACTION_TYPE_OPEN_DEPLOY_PANEL ,
9
7
ACTION_TYPE_CLOSE_DEPLOY_PANEL
10
8
} from '../../redux/redux' ;
11
9
12
- const defaultTabs = [
13
- { name : 'Gitops Status' , current : true } ,
14
- { name : 'Deploy Status' , current : false } ,
15
- ]
16
-
17
- const deployTabOpen = [
18
- { name : 'Gitops Status' , current : false } ,
19
- { name : 'Deploy Status' , current : true } ,
20
- ]
21
-
22
10
const Footer = memo ( class Footer extends Component {
23
11
constructor ( props ) {
24
12
super ( props ) ;
25
13
let reduxState = this . props . store . getState ( ) ;
26
14
27
15
this . state = {
28
- fluxStates : reduxState . fluxState ,
29
16
fluxEvents : reduxState . fluxEvents ,
30
17
selectedTab : "Kustomizations" ,
31
- targetReference : {
32
- objectNs : "" ,
33
- objectName : "" ,
34
- objectKind : "" ,
35
- } ,
36
- tabs : defaultTabs ,
37
- runningDeploys : reduxState . runningDeploys ,
38
- scmUrl : reduxState . settings . scmUrl ,
39
- envs : reduxState . envs ,
18
+ targetReference : { objectNs : "" , objectName : "" , objectKind : "" } ,
40
19
connectedAgents : reduxState . connectedAgents ,
41
20
gitopsCommits : reduxState . gitopsCommits ,
42
21
deployPanelOpen : reduxState . deployPanelOpen ,
43
- imageBuildLogs : reduxState . imageBuildLogs ,
44
- runningDeployId : "" ,
45
22
} ;
46
23
47
24
this . props . store . subscribe ( ( ) => {
48
25
let reduxState = this . props . store . getState ( ) ;
49
- this . setState ( ( prevState ) => {
50
- let runningDeployId = "" ;
51
- if ( reduxState . runningDeploys . length !== 0 ) {
52
- runningDeployId = reduxState . runningDeploys [ 0 ] . trackingId
53
- }
54
-
55
- return {
26
+ this . setState ( {
56
27
fluxEvents : reduxState . fluxEvents ,
57
- runningDeploys : reduxState . runningDeploys ,
58
- scmUrl : reduxState . settings . scmUrl ,
59
- envs : reduxState . envs ,
60
28
connectedAgents : reduxState . connectedAgents ,
61
- tabs : prevState . runningDeployId !== runningDeployId ? deployTabOpen : prevState . tabs ,
62
- imageBuildLogs : reduxState . imageBuildLogs ,
63
- runningDeployId : runningDeployId ,
64
29
gitopsCommits : reduxState . gitopsCommits ,
65
30
deployPanelOpen : reduxState . deployPanelOpen ,
66
- }
67
- } )
68
-
69
- if ( this . logsEndRef . current ) {
70
- this . logsEndRef . current . scrollIntoView ( ) ;
71
- }
31
+ } )
72
32
} ) ;
73
33
74
34
this . handleToggle = this . handleToggle . bind ( this )
75
35
this . handleNavigationSelect = this . handleNavigationSelect . bind ( this )
76
- this . switchTab = this . switchTab . bind ( this )
77
- this . logsEndRef = React . createRef ( ) ;
78
36
}
79
37
80
38
handleToggle ( ) {
@@ -92,28 +50,11 @@ const Footer = memo(class Footer extends Component {
92
50
} )
93
51
}
94
52
95
- switchTab ( tab ) {
96
- let gitopsStatus = true ;
97
- let deployStatus = false ;
98
-
99
- if ( tab === "Deploy Status" ) {
100
- gitopsStatus = false ;
101
- deployStatus = true ;
102
- }
103
-
104
- this . setState ( {
105
- tabs : [
106
- { name : 'Gitops Status' , current : gitopsStatus } ,
107
- { name : 'Deploy Status' , current : deployStatus } ,
108
- ]
109
- } ) ;
110
- }
111
-
112
53
render ( ) {
113
54
const { gimletClient, store } = this . props ;
114
- const { connectedAgents, fluxEvents, selectedTab, targetReference, tabs , runningDeploys , envs , scmUrl , gitopsCommits , imageBuildLogs , deployPanelOpen } = this . state ;
55
+ const { connectedAgents, fluxEvents, selectedTab, targetReference, deployPanelOpen } = this . state ;
115
56
116
- if ( ! envs || Object . keys ( envs ) . length === 0 ) {
57
+ if ( ! connectedAgents || Object . keys ( connectedAgents ) . length === 0 ) {
117
58
return null
118
59
}
119
60
@@ -138,11 +79,8 @@ const Footer = memo(class Footer extends Component {
138
79
</ div >
139
80
{ deployPanelOpen &&
140
81
< div className = 'no-doc-scroll h-full overscroll-contain' >
141
- < div className = "px-6" >
142
- { DeployPanelTabs ( tabs , this . switchTab ) }
143
- </ div >
144
- { tabs [ 0 ] . current ? < GitopsStatus connectedAgents = { connectedAgents } fluxEvents = { fluxEvents } handleNavigationSelect = { this . handleNavigationSelect } selectedTab = { selectedTab } gimletClient = { gimletClient } store = { store } targetReference = { targetReference } /> : null }
145
- { tabs [ 1 ] . current ? < DeployStatusTab runningDeploys = { runningDeploys } scmUrl = { scmUrl } gitopsCommits = { gitopsCommits } envs = { envs } imageBuildLogs = { imageBuildLogs } logsEndRef = { this . logsEndRef } /> : null }
82
+ < GitopsStatus connectedAgents = { connectedAgents } fluxEvents = { fluxEvents } handleNavigationSelect = { this . handleNavigationSelect } selectedTab = { selectedTab } gimletClient = { gimletClient } store = { store } targetReference = { targetReference } />
83
+ { /* {tabs[1].current ? <DeployStatusTab runningDeploys={runningDeploys} scmUrl={scmUrl} gitopsCommits={gitopsCommits} envs={envs} imageBuildLogs={imageBuildLogs} logsEndRef={this.logsEndRef} /> : null } */ }
146
84
</ div >
147
85
}
148
86
</ div >
0 commit comments