Skip to content

Commit

Permalink
refactor(table): sw-1537 migrate to pf composable table
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Sep 6, 2023
1 parent e30996c commit 5037019
Show file tree
Hide file tree
Showing 26 changed files with 1,940 additions and 1,317 deletions.
19 changes: 5 additions & 14 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,41 +221,32 @@
"header_Cores_OpenShift Container Platform": "Cores",
"header_Cores_OpenShift-metrics": "$t(curiosity-inventory.header_Cores_OpenShift Container Platform)",
"header_Cores_OpenShift-dedicated-metrics": "Core hours",
"header_core_hours": "Core hours",
"header_coreHours": "Core hours",
"header_displayName": "Name",
"header_display_name": "Name",
"header_display_name_rosa": "Name (control plane)",
"header_guests_display_name": "Guest name",
"header_hardwareType": "Type",
"header_instanceHours": "Instance hours",
"header_instance_hours": "Instance hours",
"header_Instance-hours": "Instance hours",
"header_Instance-hours_rosa": "Control plane hours",
"header_measurementType": "Type",
"header_measurement_type": "Type",
"header_number_of_guests": "Guests",
"header_inventory_id": "UUID",
"header_Sockets": "Sockets",
"header_Sockets_RHEL": "Capacity (sockets)",
"header_sockets": "Subscribed sockets",
"header_lastSeen": "Usage updated",
"header_last_seen": "Last seen",
"header_last_seen_RHEL": "Usage updated",
"header_next_event_date": "Next renewal",
"header_product_name": "Product",
"header_quantity": "Quantity",
"header_service_level": "Service level",
"header_Storage-gibibytes": "Data storage",
"header_Storage-gibibyte-months": "Data storage",
"header_subscriptions": "Sockets",
"header_subscriptions_cores": "Cores",
"header_subscriptions_sockets": "Sockets",
"header_subscriptions_Cores": "Cores",
"header_subscriptions_Sockets": "Sockets",
"header_subscription_type": "Subscription type",
"header_Transfer-gibibytes": "Data transfer",
"header_tooltip_Storage-gibibytes": "Measurements in binary gigabyte hours",
"header_tooltip_Storage-gibibyte-months": "Measurements in binary gigabyte months",
"header_tooltip_Transfer-gibibytes": "Measurements in binary gigabytes",
"guestsHeader_display_name": "Guest name",
"guestsHeader_inventory_id": "UUID",
"guestsHeader_last_seen": "Last seen",
"measurement_Cores": "{{total}} hours",
"measurement_Instance-hours": "{{total}} hours",
"measurement_Storage-gibibytes": "{{total}} GB hours",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`_InventoryListHelpers normalizeInventorySettings should return base graph settings: basic filters 1`] = `
{
"columnCountAndWidths": {
"count": 2,
"widths": [
undefined,
undefined,
],
},
"filters": [
{
"cell": [Function],
"header": [Function],
"lorem": "ipsum",
"metric": undefined,
"width": undefined,
},
{
"cell": [Function],
"dolor": "sit",
"header": [Function],
"metric": "dolorSit",
"width": undefined,
},
],
"settings": {},
}
`;

exports[`_InventoryListHelpers normalizeInventorySettings should return base graph settings: no filters 1`] = `
{
"columnCountAndWidths": {
"count": 0,
"widths": [],
},
"filters": [],
"settings": {},
}
`;

exports[`_InventoryListHelpers should have specific functions: inventoryListHelpers 1`] = `
{
"normalizeInventorySettings": [Function],
"parseInventoryResponse": [Function],
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { inventoryCardHelpers, normalizeInventorySettings } from '../_inventoryCardHelpers';

describe('_InventoryListHelpers', () => {
it('should have specific functions', () => {
expect(inventoryCardHelpers).toMatchSnapshot('inventoryListHelpers');
});

it('normalizeInventorySettings should return base graph settings', () => {
expect(normalizeInventorySettings()).toMatchSnapshot('no filters');

expect(
normalizeInventorySettings({
filters: [{ lorem: 'ipsum' }, { metric: 'dolorSit', dolor: 'sit' }],
productId: 'loremIpsumTest'
})
).toMatchSnapshot('basic filters');
});
});
Loading

0 comments on commit 5037019

Please sign in to comment.