Skip to content

Commit

Permalink
fix(config): sw-2932 ansible, on-demand graph displays (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Sep 20, 2024
1 parent 1f677a4 commit e65c091
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 11 deletions.
5 changes: 2 additions & 3 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@
"label_Instance-hours": "Instance hours",
"label_Instance-hours_on-demand": "$t(curiosity-graph.label_Cores_on-demand)",
"label_Instance-hours_prepaid": "$t(curiosity-graph.label_Cores_prepaid)",
"label_Instance-hours_prepaid_ansible-aap-managed": "Infrastructure hours",
"label_Managed-nodes_on-demand": "Monthly On-Demand",
"label_Managed-nodes_prepaid": "Managed nodes",
"label_Managed-nodes_on-demand": "$t(curiosity-graph.label_Cores_on-demand)",
"label_Managed-nodes_prepaid": "$t(curiosity-graph.label_Cores_prepaid)",
"label_Sockets": "Sockets",
"label_Sockets_cloud": "Public cloud",
"label_Sockets_hypervisor": "Hypervisor",
Expand Down
38 changes: 34 additions & 4 deletions src/config/__tests__/__snapshots__/product.config.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,6 @@ exports[`Product specific configurations should apply graph filters and settings
"header": [Function],
},
],
"chartType": "line",
"color": "#06c",
"fill": "#8bc1f7",
"groupMetric": [
Expand All @@ -1821,7 +1820,7 @@ exports[`Product specific configurations should apply graph filters and settings
"metric": undefined,
"metrics": [
{
"chartType": "line",
"chartType": "area",
"color": "#06c",
"fill": "#8bc1f7",
"id": "Managed-nodes_prepaid_ansible-aap-managed",
Expand All @@ -1836,6 +1835,22 @@ exports[`Product specific configurations should apply graph filters and settings
"stroke": "#06c",
"strokeWidth": 2,
},
{
"chartType": "area",
"color": "#f0ab00",
"fill": "#f0ab00",
"id": "Managed-nodes_on-demand_ansible-aap-managed",
"isCapacity": false,
"isStacked": true,
"isThreshold": false,
"isToolbarFilter": false,
"metric": "Managed-nodes",
"query": {
"billing_category": "on-demand",
},
"stroke": "#f0ab00",
"strokeWidth": 2,
},
{
"chartType": "threshold",
"id": "threshold_Managed-nodes_ansible-aap-managed",
Expand Down Expand Up @@ -1876,7 +1891,6 @@ exports[`Product specific configurations should apply graph filters and settings
"header": [Function],
},
],
"chartType": "line",
"color": "#06c",
"fill": "#8bc1f7",
"groupMetric": [
Expand All @@ -1889,7 +1903,7 @@ exports[`Product specific configurations should apply graph filters and settings
"metric": undefined,
"metrics": [
{
"chartType": "line",
"chartType": "area",
"color": "#06c",
"fill": "#8bc1f7",
"id": "Instance-hours_prepaid_ansible-aap-managed",
Expand All @@ -1904,6 +1918,22 @@ exports[`Product specific configurations should apply graph filters and settings
"stroke": "#06c",
"strokeWidth": 2,
},
{
"chartType": "area",
"color": "#f0ab00",
"fill": "#f0ab00",
"id": "Instance-hours_on-demand_ansible-aap-managed",
"isCapacity": false,
"isStacked": true,
"isThreshold": false,
"isToolbarFilter": false,
"metric": "Instance-hours",
"query": {
"billing_category": "on-demand",
},
"stroke": "#f0ab00",
"strokeWidth": 2,
},
{
"chartType": "threshold",
"id": "threshold_Instance-hours_ansible-aap-managed",
Expand Down
26 changes: 22 additions & 4 deletions src/config/product.ansible.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import {
chart_color_blue_100 as chartColorBlueLight,
chart_color_blue_300 as chartColorBlueDark
chart_color_blue_300 as chartColorBlueDark,
chart_color_gold_400 as chartColorGoldDark,
chart_color_gold_400 as chartColorGoldLight
} from '@patternfly/react-tokens';
import { Button } from '@patternfly/react-core';
import { DateFormat } from '@redhat-cloud-services/frontend-components/DateFormat';
Expand Down Expand Up @@ -63,7 +65,7 @@ const productLabel = RHSM_API_PATH_PRODUCT_TYPES.ANSIBLE;
* initialInventoryFilters: Array}}
*/
const config = {
aliases: [],
aliases: ['ansible'],
productGroup,
productId,
productLabel,
Expand Down Expand Up @@ -102,11 +104,19 @@ const config = {
fill: chartColorBlueLight.value,
stroke: chartColorBlueDark.value,
color: chartColorBlueDark.value,
chartType: ChartTypeVariant.line,
query: {
[RHSM_API_QUERY_SET_TYPES.BILLING_CATEGORY]: CATEGORY_TYPES.PREPAID
}
},
{
metric: RHSM_API_PATH_METRIC_TYPES.MANAGED_NODES,
fill: chartColorGoldLight.value,
stroke: chartColorGoldDark.value,
color: chartColorGoldDark.value,
query: {
[RHSM_API_QUERY_SET_TYPES.BILLING_CATEGORY]: CATEGORY_TYPES.ON_DEMAND
}
},
{
metric: RHSM_API_PATH_METRIC_TYPES.MANAGED_NODES,
chartType: ChartTypeVariant.threshold
Expand All @@ -120,11 +130,19 @@ const config = {
fill: chartColorBlueLight.value,
stroke: chartColorBlueDark.value,
color: chartColorBlueDark.value,
chartType: ChartTypeVariant.line,
query: {
[RHSM_API_QUERY_SET_TYPES.BILLING_CATEGORY]: CATEGORY_TYPES.PREPAID
}
},
{
metric: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS,
fill: chartColorGoldLight.value,
stroke: chartColorGoldDark.value,
color: chartColorGoldDark.value,
query: {
[RHSM_API_QUERY_SET_TYPES.BILLING_CATEGORY]: CATEGORY_TYPES.ON_DEMAND
}
},
{
metric: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS,
chartType: ChartTypeVariant.threshold
Expand Down
11 changes: 11 additions & 0 deletions tests/__snapshots__/dist.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ exports[`Build distribution should have a predictable ephemeral navigation based
],
"productVariants": [],
},
{
"coverage": "FALSE",
"path": "/ansible",
"productGroup": [
"ansible-aap-managed",
],
"productId": [
"ansible-aap-managed",
],
"productVariants": [],
},
{
"coverage": "TRUE",
"path": "/openshift",
Expand Down

0 comments on commit e65c091

Please sign in to comment.