Skip to content

Commit

Permalink
fix(config): sw-748 rhel products to variant filter (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Apr 21, 2023
1 parent 2fd13cc commit 88bfcb8
Show file tree
Hide file tree
Showing 26 changed files with 774 additions and 46 deletions.
9 changes: 4 additions & 5 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@
"clearFilters": "Reset filters",
"label": "",
"label_architecture": "",
"label_architecture_none": "None",
"label_architecture_RHEL for ARM": "ARM",
"label_architecture_RHEL for IBM Power": "IBM Power",
"label_architecture_RHEL for IBM z": "IBM z",
"label_architecture_RHEL for x86": "x86",
"label_billing_provider": "",
"label_billing_provider_none": "None",
"label_billing_provider_aws": "Amazon Web Services",
Expand Down Expand Up @@ -275,6 +270,10 @@
"label_usage_Production": "Production",
"label_variant": "",
"label_variant_none": "None",
"label_variant_RHEL for ARM": "ARM",
"label_variant_RHEL for IBM Power": "IBM Power",
"label_variant_RHEL for IBM z": "IBM z",
"label_variant_RHEL for x86": "x86",
"label_variant_Satellite Capsule": "Satellite Capsule",
"label_variant_Satellite Server": "Satellite Server",
"placeholder": "Select",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ exports[`RouterContext should apply a hook for useRouteDetail: route details, cl
"productPath",
"productDisplay",
"viewId",
"productArchitectures",
"productVariants",
"query",
"graphTallyQuery",
"inventoryHostsQuery",
Expand Down Expand Up @@ -108,7 +108,7 @@ exports[`RouterContext should apply a hook for useRouteDetail: route details, ma
"productPath",
"productDisplay",
"viewId",
"productArchitectures",
"productVariants",
"query",
"graphTallyQuery",
"inventoryHostsQuery",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallow } from 'enzyme';
import { ToolbarFieldArchitecture, useToolbarFieldOptions, useOnSelect } from '../toolbarFieldArchitecture';
import { store } from '../../../redux/store';
import {
RHSM_API_PATH_PRODUCT_ARCHITECTURE_RHEL_TYPES as RHEL_TYPES,
RHSM_API_PATH_PRODUCT_VARIANT_RHEL_TYPES as RHEL_TYPES,
RHSM_API_QUERY_SET_TYPES
} from '../../../services/rhsm/rhsmConstants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallow } from 'enzyme';
import { ToolbarFieldVariant, useToolbarFieldOptions, useOnSelect } from '../toolbarFieldVariant';
import { store } from '../../../redux/store';
import {
RHSM_API_PATH_PRODUCT_ARCHITECTURE_RHEL_TYPES as RHEL_TYPES,
RHSM_API_PATH_PRODUCT_VARIANT_RHEL_TYPES as RHEL_TYPES,
RHSM_API_QUERY_SET_TYPES
} from '../../../services/rhsm/rhsmConstants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,64 @@ exports[`Product OpenShift Container config should apply guest inventory configu
}
`;

exports[`Product OpenShift Container config should apply guest inventory configuration: filtered, NOT authorized 1`] = `
{
"cells": [
{
"title": "lorem",
},
{
"title": "lorem inventory id",
},
{
"title": <DateFormat
date="2022-01-01T00:00:00.000Z"
/>,
},
],
"columnHeaders": [
{
"title": "t(curiosity-inventory.header, {"context":"guestsDisplayName"})",
"transforms": [],
},
{
"title": "t(curiosity-inventory.header, {"context":"inventoryId"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header, {"context":"lastSeen"})",
"transforms": [
[Function],
],
},
],
"data": {
"displayName": {
"title": "t(curiosity-inventory.header, {"context":"displayName"})",
"value": "lorem",
},
"inventoryId": {
"title": "t(curiosity-inventory.header, {"context":"inventoryId"})",
"value": "lorem inventory id",
},
"lastSeen": {
"title": "t(curiosity-inventory.header, {"context":"lastSeen"})",
"value": "2022-01-01T00:00:00.000Z",
},
"loremIpsum": {
"title": "t(curiosity-inventory.header, {"context":"loremIpsum"})",
"value": "hello world",
},
"subscriptionManagerId": {
"title": "t(curiosity-inventory.header, {"context":"subscriptionManagerId"})",
"value": "lorem subscription id",
},
},
}
`;

exports[`Product OpenShift Container config should apply guest inventory configuration: filtered, authorized 1`] = `
{
"cells": [
Expand Down Expand Up @@ -369,6 +427,85 @@ exports[`Product OpenShift Container config should apply hosts inventory configu
}
`;

exports[`Product OpenShift Container config should apply hosts inventory configuration: filtered, NOT authorized 1`] = `
{
"cells": [
{
"title": <React.Fragment>
lorem
t(curiosity-inventory.label, {"context":"numberOfGuests","count":3}, [object Object])
</React.Fragment>,
},
{
"title": 100,
},
{
"title": 20,
},
{
"title": <DateFormat
date="2022-01-01T00:00:00.000Z"
/>,
},
],
"columnHeaders": [
{
"title": "t(curiosity-inventory.header_display, {"context":"name"})",
"transforms": [],
},
{
"title": "t(curiosity-inventory.header, {"context":"sockets"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header, {"context":"cores"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header_last, {"context":"seen"})",
"transforms": [
[Function],
],
},
],
"data": {
"cores": {
"title": "t(curiosity-inventory.header, {"context":"cores"})",
"value": 20,
},
"display_name": {
"title": "t(curiosity-inventory.header_display, {"context":"name"})",
"value": "lorem",
},
"inventory_id": {
"title": "t(curiosity-inventory.header_inventory, {"context":"id"})",
"value": "XXXX-XXXX-XXXXX-XXXXX",
},
"last_seen": {
"title": "t(curiosity-inventory.header_last, {"context":"seen"})",
"value": "2022-01-01T00:00:00.000Z",
},
"loremIpsum": {
"title": "t(curiosity-inventory.header, {"context":"loremIpsum"})",
"value": "hello world",
},
"number_of_guests": {
"title": "t(curiosity-inventory.header_number_of, {"context":"guests"})",
"value": 3,
},
"sockets": {
"title": "t(curiosity-inventory.header, {"context":"sockets"})",
"value": 100,
},
},
}
`;

exports[`Product OpenShift Container config should apply hosts inventory configuration: filtered, authorized 1`] = `
{
"cells": [
Expand Down Expand Up @@ -860,3 +997,11 @@ exports[`Product OpenShift Container config should apply subscriptions inventory
},
}
`;

exports[`Product OpenShift Container config should apply toolbar configuration: filters 1`] = `
[
{
"id": "sla",
},
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,5 @@ exports[`Product OpenShift Dedicated config should apply hosts inventory configu
},
}
`;

exports[`Product OpenShift Dedicated config should apply toolbar configuration: filters 1`] = `undefined`;
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,5 @@ exports[`Product OpenShift Metrics config should apply hosts inventory configura
},
}
`;

exports[`Product OpenShift Metrics config should apply toolbar configuration: filters 1`] = `undefined`;
13 changes: 13 additions & 0 deletions src/config/__tests__/__snapshots__/product.rhacs.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@ exports[`Product RHACS config should apply subscriptions inventory configuration
}
`;

exports[`Product RHACS config should apply toolbar configuration: filters 1`] = `
[
{
"id": "billing_provider",
},
{
"id": "rangedMonthly",
"isSecondary": true,
"position": "right",
},
]
`;

exports[`Product RHACS config should handle a custom yAxisTickFormat for floating points: yAxisTickFormat 1`] = `
{
"0.00001345": "0.00001",
Expand Down
Loading

0 comments on commit 88bfcb8

Please sign in to comment.