1
1
import './breakdownHeader.scss' ;
2
2
3
3
import {
4
- Alert ,
5
- AlertActionCloseButton ,
4
+ Button ,
5
+ ButtonVariant ,
6
6
Chip ,
7
7
ChipGroup ,
8
8
Flex ,
9
9
FlexItem ,
10
+ Popover ,
10
11
Title ,
11
12
TitleSizes ,
12
13
} from '@patternfly/react-core' ;
13
14
import { AngleLeftIcon } from '@patternfly/react-icons/dist/esm/icons/angle-left-icon' ;
15
+ import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon' ;
14
16
import type { Query } from 'api/queries/query' ;
15
17
import type { Report } from 'api/reports/report' ;
16
18
import type { TagPathsType } from 'api/tags/tag' ;
@@ -68,15 +70,13 @@ interface BreakdownHeaderDispatchProps {
68
70
}
69
71
70
72
interface BreakdownHeaderState {
71
- showFilteredByAlert ?: boolean ;
73
+ // TBD...
72
74
}
73
75
74
76
type BreakdownHeaderProps = BreakdownHeaderOwnProps & BreakdownHeaderStateProps & WrappedComponentProps ;
75
77
76
78
class BreakdownHeader extends React . Component < BreakdownHeaderProps , any > {
77
- protected defaultState : BreakdownHeaderState = {
78
- showFilteredByAlert : true ,
79
- } ;
79
+ protected defaultState : BreakdownHeaderState = { } ;
80
80
public state : BreakdownHeaderState = { ...this . defaultState } ;
81
81
82
82
private getBackToLink = groupByKey => {
@@ -151,6 +151,20 @@ class BreakdownHeader extends React.Component<BreakdownHeaderProps, any> {
151
151
< Title headingLevel = "h2" size = { TitleSizes . md } style = { styles . filteredBy } >
152
152
{ intl . formatMessage ( messages . filteredBy ) }
153
153
</ Title >
154
+ < span style = { styles . infoIcon } >
155
+ < Popover
156
+ aria-label = { intl . formatMessage ( messages . overviewInfoArialLabel ) }
157
+ enableFlip
158
+ bodyContent = { < p > { intl . formatMessage ( messages . filteredByWarning ) } </ p > }
159
+ >
160
+ < Button
161
+ aria-label = { intl . formatMessage ( messages . overviewInfoButtonArialLabel ) }
162
+ variant = { ButtonVariant . plain }
163
+ >
164
+ < OutlinedQuestionCircleIcon />
165
+ </ Button >
166
+ </ Popover >
167
+ </ span >
154
168
{ filterChips }
155
169
</ div >
156
170
) ;
@@ -169,10 +183,6 @@ class BreakdownHeader extends React.Component<BreakdownHeaderProps, any> {
169
183
return cost ;
170
184
} ;
171
185
172
- private handleOnAlertClose = ( ) => {
173
- this . setState ( { showFilteredByAlert : false } ) ;
174
- } ;
175
-
176
186
public render ( ) {
177
187
const {
178
188
clusterInfoComponent,
@@ -194,7 +204,6 @@ class BreakdownHeader extends React.Component<BreakdownHeaderProps, any> {
194
204
tagPathsType,
195
205
title,
196
206
} = this . props ;
197
- const { showFilteredByAlert } = this . state ;
198
207
199
208
const filterByAccount = query && query . filter ? query . filter . account : undefined ;
200
209
const groupByCostCategory = getGroupByCostCategory ( query ) ;
@@ -286,15 +295,6 @@ class BreakdownHeader extends React.Component<BreakdownHeaderProps, any> {
286
295
</ div >
287
296
</ FlexItem >
288
297
</ Flex >
289
- { this . hasFilterBy ( ) && showFilteredByAlert && (
290
- < Alert
291
- actionClose = { < AlertActionCloseButton onClose = { this . handleOnAlertClose } /> }
292
- isInline
293
- style = { styles . filteredByWarning }
294
- title = { intl . formatMessage ( messages . filteredByWarning ) }
295
- variant = "info"
296
- />
297
- ) }
298
298
< div >
299
299
< div style = { styles . tabs } >
300
300
{ tabs }
0 commit comments