Skip to content

Commit

Permalink
Merge pull request #4141 from dlabrecq/tags
Browse files Browse the repository at this point in the history
Group-by should refresh with dateRange selection
  • Loading branch information
dlabrecq authored Dec 4, 2024
2 parents 085d3ee + 1e8432c commit 5b01c24
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/routes/components/groupBy/groupBy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { GroupByOrg } from './groupByOrg';
import { GroupBySelect } from './groupBySelect';

interface GroupByOwnProps extends RouterComponentProps, WrappedComponentProps {
dateRangeType?: string;
endDate?: string;
getIdKeyForGroupBy: (groupBy: Query['group_by']) => string;
groupBy?: string;
Expand Down Expand Up @@ -122,8 +123,12 @@ class GroupByBase extends React.Component<GroupByProps, GroupByState> {
}

public componentDidUpdate(prevProps: GroupByProps) {
const { groupBy, perspective } = this.props;
if (prevProps.groupBy !== groupBy || prevProps.perspective !== perspective) {
const { dateRangeType, groupBy, perspective } = this.props;
if (
prevProps.groupBy !== groupBy ||
prevProps.perspective !== perspective ||
prevProps.dateRangeType !== dateRangeType
) {
let options;
if (prevProps.perspective !== perspective) {
options = {
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/awsDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
<Flex style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<FlexItem>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/azureDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
<Flex>
<FlexItem style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/gcpDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
<Flex>
<FlexItem style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/ibmDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
<Flex>
<FlexItem style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/ociDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
<Flex>
<FlexItem style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/ocpDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, DetailsHeade
<Flex style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<FlexItem>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/details/rhelDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps> {
<Flex>
<FlexItem style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
<GroupBy
dateRangeType={currentDateRangeType}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
isDisabled={!showContent}
Expand Down
1 change: 1 addition & 0 deletions src/routes/explorer/explorerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ class ExplorerHeaderBase extends React.Component<ExplorerHeaderProps, ExplorerHe
<FlexItem>{this.getPerspective(noProviders)}</FlexItem>
<FlexItem>
<GroupBy
dateRangeType={dateRangeType}
endDate={endDate}
getIdKeyForGroupBy={getIdKeyForGroupBy}
groupBy={groupBy}
Expand Down

0 comments on commit 5b01c24

Please sign in to comment.