Skip to content

Commit

Permalink
refactor(config): sw-630 architectures, variants as filters
Browse files Browse the repository at this point in the history
* locale, toolbar string context
* productViewContext, hook, expose all queries
* toolbar, generic chip display, filtering
* toolbarContext, remove redundant hook
* toolbarFields, string context updates
* toolbarFieldsArchitecture, Variant, add
* config, rhel, satellite architectures, variants
* viewReducer, types, generic queries
* rhsmServices, emulated archs, variants filter
  • Loading branch information
cdcabrera committed Dec 5, 2022
1 parent 2871a53 commit 2c996c8
Show file tree
Hide file tree
Showing 43 changed files with 1,353 additions and 324 deletions.
73 changes: 43 additions & 30 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,48 @@
"measurementType_virtualized": "Virtual"
},
"curiosity-toolbar": {
"category": "Filter by",
"category_billing_provider": "Purchased through",
"category_granularity": "Granularity",
"category_rangedMonthly": "Monthly",
"category_sla": "SLA",
"category_uom": "Unit of measure",
"category_usage": "Usage",
"clearFilters": "Reset filters",
"button_displayName": "Search button for name",
"clearFilters": "Reset filters",
"label": "",
"label_architecture": "",
"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": "None",
"label_billing_provider_aws": "Amazon Web Services",
"label_billing_provider_azure": "Microsoft Azure",
"label_billing_provider_gcp": "Google Cloud Platform",
"label_billing_provider_oracle": "Oracle Cloud Infrastructure",
"label_billing_provider_red hat": "Red Hat Marketplace",
"label_category": "Filter by",
"label_category_architecture": "Architecture",
"label_category_billing_provider": "Purchased through",
"label_category_granularity": "Granularity",
"label_category_rangedMonthly": "Monthly",
"label_category_sla": "SLA",
"label_category_uom": "Unit of measure",
"label_category_usage": "Usage",
"label_category_variant": "Product",
"label_granularity_Daily": "Daily",
"label_granularity_Weekly": "Weekly",
"label_granularity_Monthly": "Monthly",
"label_granularity_Quarterly": "Quarterly",
"label_granularityRangedMonthly": "{{context}}",
"label_granularityRangedMonthly_current": "This month",
"label_sla_none": "No SLA",
"label_sla_Premium": "Premium",
"label_sla_Self-Support": "Self-Support",
"label_sla_Standard": "Standard",
"label_uom_cores": "Cores",
"label_uom_sockets": "Sockets",
"label_usage_Development/Test": "Development/Test",
"label_usage_Disaster Recovery": "Disaster Recovery",
"label_usage_Production": "Production",
"label_usage_unspecified": "Unspecified",
"label_variant_": "",
"label_variant_Satellite Capsule": "Satellite Capsule",
"label_variant_Satellite Server": "Satellite Server",
"placeholder": "Select",
"placeholder_billing_provider": "Select purchased through",
"placeholder_granularity": "Select date range",
Expand All @@ -281,35 +314,15 @@
"placeholder_uom": "Select unit",
"placeholder_usage": "Select usage",
"placeholder_filter": "Filter by",
"placeholder_filter_architecture": "Filter by architecture",
"placeholder_filter_billing_provider": "Filter by purchased through",
"placeholder_filter_displayName": "Filter by name",
"placeholder_filter_granularity": "Filter by date",
"placeholder_filter_rangedMonthly": "Filter by month",
"placeholder_filter_sla": "Filter by SLA",
"placeholder_filter_uom": "Filter by unit",
"placeholder_filter_usage": "Filter by usage",
"billing_provider": "None",
"billing_provider_aws": "Amazon Web Services",
"billing_provider_azure": "Microsoft Azure",
"billing_provider_gcp": "Google Cloud Platform",
"billing_provider_oracle": "Oracle Cloud Infrastructure",
"billing_provider_red hat": "Red Hat Marketplace",
"granularity_Daily": "Daily",
"granularity_Weekly": "Weekly",
"granularity_Monthly": "Monthly",
"granularity_Quarterly": "Quarterly",
"granularityRangedMonthly": "{{context}}",
"granularityRangedMonthly_current": "This month",
"sla_none": "No SLA",
"sla_Premium": "Premium",
"sla_Self-Support": "Self-Support",
"sla_Standard": "Standard",
"uom_cores": "Cores",
"uom_sockets": "Sockets",
"usage_Development/Test": "Development/Test",
"usage_Disaster Recovery": "Disaster Recovery",
"usage_Production": "Production",
"usage_unspecified": "Unspecified"
"placeholder_filter_variant": "Filter by product"
},
"curiosity-optin": {
"buttonActivate": "Activate {{appName}}",
Expand Down
154 changes: 128 additions & 26 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -331,18 +331,39 @@ exports[`I18n Component should generate a predictable locale key output snapshot
{
"file": "./src/components/toolbar/toolbar.js",
"keys": [
{
"key": "curiosity-toolbar.label",
"match": "t('curiosity-toolbar.label', { context: [value, categoryValue] })",
},
{
"key": "curiosity-toolbar.clearFilters",
"match": "t('curiosity-toolbar.clearFilters')",
},
],
},
{
"file": "./src/components/toolbar/toolbarFieldArchitecture.js",
"keys": [
{
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['architecture', (type === '' && 'unspecified')",
},
{
"key": "curiosity-toolbar.placeholder",
"match": "t('curiosity-toolbar.placeholder', { context: [isFilter && 'filter', 'architecture'] })",
},
{
"key": "curiosity-toolbar.placeholder",
"match": "t('curiosity-toolbar.placeholder', { context: [isFilter && 'filter', 'architecture'] })",
},
],
},
{
"file": "./src/components/toolbar/toolbarFieldBillingProvider.js",
"keys": [
{
"key": "curiosity-toolbar.billing_provider",
"match": "translate('curiosity-toolbar.billing_provider', { context: (type === '' && 'none')",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['billing_provider', (type === '' && 'none')",
},
{
"key": "",
Expand Down Expand Up @@ -371,8 +392,8 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"file": "./src/components/toolbar/toolbarFieldGranularity.js",
"keys": [
{
"key": "curiosity-toolbar.granularity",
"match": "translate('curiosity-toolbar.granularity', { context: type })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['granularity', type] })",
},
{
"key": "",
Expand Down Expand Up @@ -401,28 +422,36 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"keys": [
{
"key": "curiosity-toolbar.category",
"match": "translate('curiosity-toolbar.category', { context: RHSM_API_QUERY_SET_TYPES.GRANULARITY })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.GRANULARITY] })",
},
{
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', 'rangedMonthly'] })",
},
{
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.UOM] })",
},
{
"key": "curiosity-toolbar.category",
"match": "translate('curiosity-toolbar.category', { context: 'rangedMonthly' })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.BILLING_PROVIDER] })",
},
{
"key": "curiosity-toolbar.category",
"match": "translate('curiosity-toolbar.category', { context: RHSM_API_QUERY_SET_TYPES.UOM })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.SLA] })",
},
{
"key": "curiosity-toolbar.category",
"match": "translate('curiosity-toolbar.category', { context: RHSM_API_QUERY_SET_TYPES.BILLING_PROVIDER })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.USAGE] })",
},
{
"key": "curiosity-toolbar.category",
"match": "translate('curiosity-toolbar.category', { context: RHSM_API_QUERY_SET_TYPES.SLA })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.VARIANT] })",
},
{
"key": "curiosity-toolbar.category",
"match": "translate('curiosity-toolbar.category', { context: RHSM_API_QUERY_SET_TYPES.USAGE })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['category', RHSM_API_QUERY_SET_TYPES.ARCHITECTURE] })",
},
{
"key": "curiosity-toolbar.placeholder_filter",
Expand All @@ -438,8 +467,8 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"file": "./src/components/toolbar/toolbarFieldSla.js",
"keys": [
{
"key": "curiosity-toolbar.sla",
"match": "translate('curiosity-toolbar.sla', { context: (type === '' && 'none')",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['sla', (type === '' && 'none')",
},
{
"key": "",
Expand All @@ -455,8 +484,8 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"file": "./src/components/toolbar/toolbarFieldUom.js",
"keys": [
{
"key": "curiosity-toolbar.uom",
"match": "translate('curiosity-toolbar.uom', { context: type })",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['uom', type] })",
},
{
"key": "",
Expand All @@ -472,8 +501,8 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"file": "./src/components/toolbar/toolbarFieldUsage.js",
"keys": [
{
"key": "curiosity-toolbar.usage",
"match": "translate('curiosity-toolbar.usage', { context: (type === '' && 'unspecified')",
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['usage', (type === '' && 'unspecified')",
},
{
"key": "",
Expand All @@ -485,6 +514,23 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
],
},
{
"file": "./src/components/toolbar/toolbarFieldVariant.js",
"keys": [
{
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['variant', (type === '' && 'unspecified')",
},
{
"key": "curiosity-toolbar.placeholder",
"match": "t('curiosity-toolbar.placeholder', { context: [isFilter && 'filter', 'variant'] })",
},
{
"key": "curiosity-toolbar.placeholder",
"match": "t('curiosity-toolbar.placeholder', { context: [isFilter && 'filter', 'variant'] })",
},
],
},
{
"file": "./src/config/product.openshiftContainer.js",
"keys": [
Expand Down Expand Up @@ -719,25 +765,81 @@ exports[`I18n Component should generate a predictable locale key output snapshot

exports[`I18n Component should have locale keys that exist in the default language JSON: missing locale keys 1`] = `
[
{
"file": "./src/common/dateHelpers.js",
"key": "curiosity-toolbar.granularityRangedMonthly",
},
{
"file": "./src/common/dateHelpers.js",
"key": "curiosity-toolbar.granularityRangedMonthly",
},
{
"file": "./src/components/inventoryCard/inventoryCard.js",
"key": "curiosity-inventory.tab",
},
{
"file": "./src/components/toolbar/toolbar.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldArchitecture.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldBillingProvider.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldGranularity.js",
"key": "curiosity-toolbar.granularity",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSelectCategory.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldSla.js",
"key": "curiosity-toolbar.sla",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldUom.js",
"key": "curiosity-toolbar.uom",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldUsage.js",
"key": "curiosity-toolbar.usage",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/components/toolbar/toolbarFieldVariant.js",
"key": "curiosity-toolbar.label",
},
{
"file": "./src/config/product.openshiftContainer.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ exports[`ProductView Component should allow custom inventory displays via config
hardFilterReset={false}
isDisabled={false}
t={[Function]}
useProductToolbarQuery={[Function]}
useSelectCategoryOptions={[Function]}
useToolbarFieldClear={[Function]}
useToolbarFieldClearAll={[Function]}
useToolbarFieldQueries={[Function]}
useToolbarSecondaryFields={[Function]}
/>
</PageToolbar>
Expand Down Expand Up @@ -138,10 +138,10 @@ exports[`ProductView Component should allow custom product views via props: cust
hardFilterReset={false}
isDisabled={false}
t={[Function]}
useProductToolbarQuery={[Function]}
useSelectCategoryOptions={[Function]}
useToolbarFieldClear={[Function]}
useToolbarFieldClearAll={[Function]}
useToolbarFieldQueries={[Function]}
useToolbarSecondaryFields={[Function]}
/>
</PageToolbar>
Expand Down Expand Up @@ -214,10 +214,10 @@ exports[`ProductView Component should allow custom product views via props: cust
hardFilterReset={false}
isDisabled={false}
t={[Function]}
useProductToolbarQuery={[Function]}
useSelectCategoryOptions={[Function]}
useToolbarFieldClear={[Function]}
useToolbarFieldClearAll={[Function]}
useToolbarFieldQueries={[Function]}
useToolbarSecondaryFields={[Function]}
/>
</PageToolbar>
Expand Down Expand Up @@ -290,10 +290,10 @@ exports[`ProductView Component should render a basic component: basic 1`] = `
hardFilterReset={false}
isDisabled={false}
t={[Function]}
useProductToolbarQuery={[Function]}
useSelectCategoryOptions={[Function]}
useToolbarFieldClear={[Function]}
useToolbarFieldClearAll={[Function]}
useToolbarFieldQueries={[Function]}
useToolbarSecondaryFields={[Function]}
/>
</PageToolbar>
Expand Down
Loading

0 comments on commit 2c996c8

Please sign in to comment.