Skip to content

Commit 672fd98

Browse files
committed
Add integration status to details pages
https://issues.redhat.com/browse/COST-5386
1 parent 75a1a57 commit 672fd98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+566
-488
lines changed

locales/data.json

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@
152152
"value": "Back"
153153
}
154154
],
155+
"backToIntegrations": [
156+
{
157+
"type": 0,
158+
"value": "Back to integrations status"
159+
}
160+
],
155161
"breakdownBackToDetails": [
156162
{
157163
"options": {
@@ -10394,6 +10400,18 @@
1039410400
"value": "Integration"
1039510401
}
1039610402
],
10403+
"integrationsDetails": [
10404+
{
10405+
"type": 0,
10406+
"value": "Integrations details"
10407+
}
10408+
],
10409+
"integrationsStatus": [
10410+
{
10411+
"type": 0,
10412+
"value": "Integrations status"
10413+
}
10414+
],
1039710415
"lastProcessed": [
1039810416
{
1039910417
"type": 0,
@@ -11837,12 +11855,6 @@
1183711855
"value": "Rate must be a positive number"
1183811856
}
1183911857
],
11840-
"providerDetails": [
11841-
{
11842-
"type": 0,
11843-
"value": "Integrations details"
11844-
}
11845-
],
1184611858
"pvcTitle": [
1184711859
{
1184811860
"type": 0,
@@ -13589,6 +13601,12 @@
1358913601
"value": "vCPU"
1359013602
}
1359113603
],
13604+
"viewAll": [
13605+
{
13606+
"type": 0,
13607+
"value": "View all"
13608+
}
13609+
],
1359213610
"volumeTitle": [
1359313611
{
1359413612
"type": 0,

locales/translations.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"azureDetailsTitle": "Microsoft Azure Details",
2020
"azureOcpDashboardCostTitle": "Microsoft Azure filtered by OpenShift cost",
2121
"back": "Back",
22+
"backToIntegrations": "Back to integrations status",
2223
"breakdownBackToDetails": "{groupBy, select, account {Back to {value} account details} aws_category {Back to {value} cost category details} cluster {Back to {value} cluster details} gcp_project {Back to {value} GCP project details} node {Back to {value} node details} org_unit_id {Back to {value} organizational unit details} payer_tenant_id {Back to {value} account details} product_service {Back to {value} service details} project {Back to {value} project details} region {Back to {value} region details} resource_location {Back to {value} region details} service {Back to {value} service details} service_name {Back to {value} service details} subscription_guid {Back to {value} account details} tag {Back to {value} tag details} other {}}",
2324
"breakdownBackToDetailsAriaLabel": "Back to details",
2425
"breakdownBackToOptimizations": "Back to optimizations",
@@ -368,6 +369,8 @@
368369
"infrastructure": "Infrastructure",
369370
"instances": "Instances",
370371
"integration": "Integration",
372+
"integrationsDetails": "Integrations details",
373+
"integrationsStatus": "Integrations status",
371374
"lastProcessed": "Last processed",
372375
"lastUpdated": "Last updated",
373376
"learnMore": "Learn more",
@@ -508,7 +511,6 @@
508511
"priceListEmptyRateDesc": "To add rates to the price list, click on the \"Add\" rate button above.",
509512
"priceListNumberRate": "Rate must be a number",
510513
"priceListPosNumberRate": "Rate must be a positive number",
511-
"providerDetails": "Integrations details",
512514
"pvcTitle": "Persistent Volume Claims",
513515
"rate": "Rate",
514516
"rawCostDesc": "The costs reported by a cloud provider without any cost model calculations applied.",
@@ -635,6 +637,7 @@
635637
"valueUnits": "{value} {units}",
636638
"various": "Various",
637639
"vcpuTitle": "vCPU",
640+
"viewAll": "View all",
638641
"volumeTitle": "Volume",
639642
"workerUnallocated": "Worker unallocated",
640643
"workerUnallocatedDesc": "Distribute unused and non-reserved resource costs to projects",

src/locales/messages.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export default defineMessages({
101101
description: 'Back',
102102
id: 'back',
103103
},
104+
backToIntegrations: {
105+
defaultMessage: 'Back to integrations status',
106+
description: 'Back to integrations status',
107+
id: 'backToIntegrations',
108+
},
104109
breakdownBackToDetails: {
105110
defaultMessage:
106111
'{groupBy, select, ' +
@@ -2382,6 +2387,16 @@ export default defineMessages({
23822387
description: 'Integration',
23832388
id: 'integration',
23842389
},
2390+
integrationsDetails: {
2391+
defaultMessage: 'Integrations details',
2392+
description: 'Integrations details',
2393+
id: 'integrationsDetails',
2394+
},
2395+
integrationsStatus: {
2396+
defaultMessage: 'Integrations status',
2397+
description: 'Integrations status',
2398+
id: 'integrationsStatus',
2399+
},
23852400
lastProcessed: {
23862401
defaultMessage: 'Last processed',
23872402
description: 'Last processed',
@@ -3156,11 +3171,6 @@ export default defineMessages({
31563171
description: 'Rate must be a positive number',
31573172
id: 'priceListPosNumberRate',
31583173
},
3159-
providerDetails: {
3160-
defaultMessage: 'Integrations details',
3161-
description: 'Integrations details',
3162-
id: 'providerDetails',
3163-
},
31643174
pvcTitle: {
31653175
defaultMessage: 'Persistent Volume Claims',
31663176
description: 'Persistent Volume Claims',
@@ -3885,6 +3895,11 @@ export default defineMessages({
38853895
description: 'vCPU',
38863896
id: 'vcpuTitle',
38873897
},
3898+
viewAll: {
3899+
defaultMessage: 'View all',
3900+
description: 'View all',
3901+
id: 'viewAll',
3902+
},
38883903
volumeTitle: {
38893904
defaultMessage: 'Volume',
38903905
description: 'Volume',
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import global_spacer_xl from '@patternfly/react-tokens/dist/js/global_spacer_xl';
2+
import type React from 'react';
3+
4+
export const styles = {
5+
details: {
6+
marginBottom: global_spacer_xl.value,
7+
marginTop: global_spacer_xl.value,
8+
},
9+
} as { [className: string]: React.CSSProperties };

src/routes/components/page/noData/noDataState.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
Bullseye,
23
Button,
34
EmptyState,
45
EmptyStateBody,
@@ -13,6 +14,8 @@ import React from 'react';
1314
import type { WrappedComponentProps } from 'react-intl';
1415
import { injectIntl } from 'react-intl';
1516

17+
import { styles } from './noData.styles';
18+
1619
interface NoDataStateOwnProps {
1720
detailsComponent?: React.ReactNode;
1821
showReload?: boolean;
@@ -33,7 +36,7 @@ class NoDataStateBase extends React.Component<NoDataStateProps, any> {
3336
/>
3437
<EmptyStateBody>
3538
{intl.formatMessage(messages.noDataStateDesc, {
36-
status: detailsComponent,
39+
status: detailsComponent ? <Bullseye style={styles.details}>{detailsComponent}</Bullseye> : '',
3740
})}
3841
</EmptyStateBody>
3942
<EmptyStateFooter>

src/routes/details/awsDetails/awsDetails.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Loading } from 'routes/components/page/loading';
2020
import { NoData } from 'routes/components/page/noData';
2121
import { NoProviders } from 'routes/components/page/noProviders';
2222
import { NotAvailable } from 'routes/components/page/notAvailable';
23-
import { ProviderDetails } from 'routes/details/components/providerDetails';
23+
import { ProviderStatus } from 'routes/details/components/providerStatus';
2424
import { getIdKeyForGroupBy } from 'routes/utils/computedReport/getComputedAwsReportItems';
2525
import type { ComputedReportItem } from 'routes/utils/computedReport/getComputedReportItems';
2626
import { getUnsortedComputedReportItems } from 'routes/utils/computedReport/getComputedReportItems';
@@ -56,7 +56,6 @@ import { DetailsToolbar } from './detailsToolbar';
5656
interface AwsDetailsStateProps {
5757
costType: string;
5858
currency?: string;
59-
isAccountInfoDetailsToggleEnabled?: boolean;
6059
isAccountInfoEmptyStateToggleEnabled?: boolean;
6160
isCurrentMonthData?: boolean;
6261
isDetailsDateRangeToggleEnabled?: boolean;
@@ -216,15 +215,7 @@ class AwsDetails extends React.Component<AwsDetailsProps, AwsDetailsState> {
216215
};
217216

218217
private getTable = () => {
219-
const {
220-
isAccountInfoDetailsToggleEnabled,
221-
query,
222-
report,
223-
reportFetchStatus,
224-
reportQueryString,
225-
router,
226-
timeScopeValue,
227-
} = this.props;
218+
const { query, report, reportFetchStatus, reportQueryString, router, timeScopeValue } = this.props;
228219
const { isAllSelected, selectedItems } = this.state;
229220

230221
const groupById = getIdKeyForGroupBy(query.group_by);
@@ -247,7 +238,6 @@ class AwsDetails extends React.Component<AwsDetailsProps, AwsDetailsState> {
247238
groupByCostCategory={groupByCostCategory}
248239
groupByTagKey={groupByTagKey}
249240
groupByOrg={groupByOrg}
250-
isAccountInfoDetailsToggleEnabled={isAccountInfoDetailsToggleEnabled}
251241
isAllSelected={isAllSelected}
252242
isLoading={reportFetchStatus === FetchStatus.inProgress}
253243
onSelect={this.handleonSelect}
@@ -414,7 +404,7 @@ class AwsDetails extends React.Component<AwsDetailsProps, AwsDetailsState> {
414404
return (
415405
<NoData
416406
detailsComponent={
417-
isAccountInfoEmptyStateToggleEnabled ? <ProviderDetails providerType={ProviderType.aws} /> : undefined
407+
isAccountInfoEmptyStateToggleEnabled ? <ProviderStatus providerType={ProviderType.aws} /> : undefined
418408
}
419409
title={title}
420410
/>
@@ -534,7 +524,6 @@ const mapStateToProps = createMapStateToProps<AwsDetailsOwnProps, AwsDetailsStat
534524
return {
535525
costType,
536526
currency,
537-
isAccountInfoDetailsToggleEnabled: FeatureToggleSelectors.selectIsAccountInfoDetailsToggleEnabled(state),
538527
isAccountInfoEmptyStateToggleEnabled: FeatureToggleSelectors.selectIsAccountInfoEmptyStateToggleEnabled(state),
539528
isCurrentMonthData,
540529
isDetailsDateRangeToggleEnabled,

src/routes/details/awsDetails/detailsHeader.styles.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export const styles = {
2626
perspectiveContainer: {
2727
alignItems: 'unset',
2828
},
29+
status: {
30+
marginBottom: global_spacer_sm.var,
31+
},
2932
title: {
3033
paddingBottom: global_spacer_sm.var,
3134
},

src/routes/details/awsDetails/detailsHeader.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { CostType } from 'routes/components/costType';
1818
import { Currency } from 'routes/components/currency';
1919
import { DateRange } from 'routes/components/dateRange';
2020
import { GroupBy } from 'routes/components/groupBy';
21+
import { ProviderDetailsModal } from 'routes/details/components/providerStatus';
2122
import type { ComputedAwsReportItemsParams } from 'routes/utils/computedReport/getComputedAwsReportItems';
2223
import { getIdKeyForGroupBy } from 'routes/utils/computedReport/getComputedAwsReportItems';
2324
import { DateRangeType } from 'routes/utils/dateRange';
@@ -48,7 +49,8 @@ interface DetailsHeaderOwnProps {
4849
}
4950

5051
interface DetailsHeaderStateProps {
51-
isDetailsDateRangeToggleEnabled: boolean;
52+
isAccountInfoDetailsToggleEnabled?: boolean;
53+
isDetailsDateRangeToggleEnabled?: boolean;
5254
isExportsToggleEnabled?: boolean;
5355
providers: Providers;
5456
providersError: AxiosError;
@@ -112,6 +114,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
112114
currency,
113115
groupBy,
114116
intl,
117+
isAccountInfoDetailsToggleEnabled,
115118
isCurrentMonthData,
116119
isDetailsDateRangeToggleEnabled,
117120
isExportsToggleEnabled,
@@ -142,7 +145,14 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, any> {
142145
</Flex>
143146
<Flex justifyContent={{ default: 'justifyContentSpaceBetween' }} style={styles.perspectiveContainer}>
144147
<FlexItem>
145-
<Flex style={styles.perspective}>
148+
{isAccountInfoDetailsToggleEnabled && (
149+
<Flex>
150+
<FlexItem style={styles.status}>
151+
<ProviderDetailsModal providerType={ProviderType.aws} />
152+
</FlexItem>
153+
</Flex>
154+
)}
155+
<Flex style={isAccountInfoDetailsToggleEnabled ? undefined : styles.perspective}>
146156
<FlexItem>
147157
<GroupBy
148158
getIdKeyForGroupBy={getIdKeyForGroupBy}
@@ -206,6 +216,7 @@ const mapStateToProps = createMapStateToProps<DetailsHeaderOwnProps, DetailsHead
206216
);
207217

208218
return {
219+
isAccountInfoDetailsToggleEnabled: FeatureToggleSelectors.selectIsAccountInfoDetailsToggleEnabled(state),
209220
isDetailsDateRangeToggleEnabled: FeatureToggleSelectors.selectIsDetailsDateRangeToggleEnabled(state),
210221
isExportsToggleEnabled: FeatureToggleSelectors.selectIsExportsToggleEnabled(state),
211222
providers: filterProviders(providers, ProviderType.aws),

src/routes/details/awsDetails/detailsTable.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'routes/components/dataTable/dataTable.scss';
22

3-
import { ProviderType } from 'api/providers';
43
import type { Query } from 'api/queries/query';
54
import type { AwsReport } from 'api/reports/awsReports';
65
import { ReportPathsType, ReportType } from 'api/reports/report';
@@ -14,7 +13,6 @@ import { DataTable } from 'routes/components/dataTable';
1413
import { styles } from 'routes/components/dataTable/dataTable.styles';
1514
import { EmptyValueState } from 'routes/components/state/emptyValueState';
1615
import { Actions } from 'routes/details/components/actions';
17-
import { ProviderDetailsModal } from 'routes/details/components/providerDetails';
1816
import type { ComputedReportItem } from 'routes/utils/computedReport/getComputedReportItems';
1917
import { getUnsortedComputedReportItems } from 'routes/utils/computedReport/getComputedReportItems';
2018
import { getOrgBreakdownPath } from 'routes/utils/paths';
@@ -32,7 +30,6 @@ interface DetailsTableOwnProps extends RouterComponentProps, WrappedComponentPro
3230
groupByCostCategory?: string;
3331
groupByOrg?: string;
3432
groupByTagKey?: string;
35-
isAccountInfoDetailsToggleEnabled?: boolean;
3633
isAllSelected?: boolean;
3734
isLoading?: boolean;
3835
onSelect(items: ComputedReportItem[], isSelected: boolean);
@@ -86,7 +83,6 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
8683
groupByOrg,
8784
groupByTagKey,
8885
intl,
89-
isAccountInfoDetailsToggleEnabled,
9086
isAllSelected,
9187
query,
9288
report,
@@ -146,10 +142,6 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
146142
name: intl.formatMessage(messages.detailsResourceNames, { value: groupBy }),
147143
...(computedItems.length && { isSortable: true }),
148144
},
149-
{
150-
hidden: !(isGroupByAccount && isAccountInfoDetailsToggleEnabled),
151-
name: intl.formatMessage(messages.costModelsLastUpdated),
152-
},
153145
{
154146
name: intl.formatMessage(messages.monthOverMonthChange),
155147
},
@@ -211,17 +203,6 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
211203
</>
212204
),
213205
},
214-
{
215-
hidden: !(isGroupByAccount && isAccountInfoDetailsToggleEnabled),
216-
value: (
217-
<ProviderDetailsModal
218-
isLastUpdatedStatus
219-
isOverallStatus
220-
uuId={item.source_uuid?.[0]}
221-
providerType={ProviderType.aws}
222-
/>
223-
),
224-
},
225206
{ value: monthOverMonth },
226207
{ value: cost, style: styles.managedColumn },
227208
{ value: actions },

0 commit comments

Comments
 (0)