Skip to content

Commit

Permalink
refactor(toolbarFieldArchitecture): sw-748 remove component
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Apr 10, 2023
1 parent 21f458a commit fddee3b
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 659 deletions.
3 changes: 0 additions & 3 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@
"button_displayName": "Search button for name",
"clearFilters": "Reset filters",
"label": "",
"label_architecture": "",
"label_billing_provider": "",
"label_billing_provider_none": "None",
"label_billing_provider_aws": "Amazon Web Services",
Expand All @@ -242,7 +241,6 @@
"label_category_physical": "Physical",
"label_category_virtual": "Virtual",
"label_filter": "Filter by",
"label_filter_architecture": "Variant",
"label_filter_billing_provider": "Purchased through",
"label_filter_category": "Type",
"label_filter_granularity": "Granularity",
Expand Down Expand Up @@ -288,7 +286,6 @@
"placeholder_uom": "Select unit",
"placeholder_usage": "Select usage",
"placeholder_filter": "Filter by",
"placeholder_filter_architecture": "Filter by variant",
"placeholder_filter_billing_provider": "Filter by purchased through",
"placeholder_filter_category": "Filter by type",
"placeholder_filter_displayName": "Filter by name",
Expand Down
112 changes: 0 additions & 112 deletions src/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@
</dd>
<dt><a href="#Toolbar.module_ToolbarContext">ToolbarContext</a></dt>
<dd></dd>
<dt><a href="#Toolbar.module_ToolbarFieldArchitecture">ToolbarFieldArchitecture</a></dt>
<dd><p>A standalone Architecture select filter.</p>
</dd>
<dt><a href="#Toolbar.module_ToolbarFieldBillingProvider">ToolbarFieldBillingProvider</a></dt>
<dd><p>A standalone Billing Provider select filter.</p>
</dd>
Expand Down Expand Up @@ -6027,8 +6024,6 @@ Primary view toolbar.
<tr>
<td>ToolbarContext</td><td><code>module</code></td>
</tr><tr>
<td>ToolbarFieldArchitecture</td><td><code>module</code></td>
</tr><tr>
<td>ToolbarFieldBillingProvider</td><td><code>module</code></td>
</tr><tr>
<td>ToolbarFieldCategory</td><td><code>module</code></td>
Expand Down Expand Up @@ -6189,8 +6184,6 @@ Clear a specific toolbar category using a select component's OnSelect hook.
<tr>
<td>options</td><td><code>object</code></td>
</tr><tr>
<td>options.useArchitectureOnSelect</td><td><code>function</code></td>
</tr><tr>
<td>options.useBillingProviderOnSelect</td><td><code>function</code></td>
</tr><tr>
<td>options.useCategoryOnSelect</td><td><code>function</code></td>
Expand Down Expand Up @@ -6221,8 +6214,6 @@ Clear all available toolbar categories.
</tr><tr>
<td>options.useProductQuery</td><td><code>function</code></td>
</tr><tr>
<td>options.useArchitectureOnSelect</td><td><code>function</code></td>
</tr><tr>
<td>options.useSelectCategoryOnSelect</td><td><code>function</code></td>
</tr><tr>
<td>options.useBillingProviderOnSelect</td><td><code>function</code></td>
Expand Down Expand Up @@ -6259,109 +6250,6 @@ Return lists of item and secondary toolbar fields for display.
</tr> </tbody>
</table>

<a name="Toolbar.module_ToolbarFieldArchitecture"></a>

## ToolbarFieldArchitecture
A standalone Architecture select filter.


* [ToolbarFieldArchitecture](#Toolbar.module_ToolbarFieldArchitecture)
* [~useToolbarFieldOptions(options)](#Toolbar.module_ToolbarFieldArchitecture..useToolbarFieldOptions) ⇒ <code>function</code>
* [~useOnSelect(options)](#Toolbar.module_ToolbarFieldArchitecture..useOnSelect) ⇒ <code>function</code>
* [~ToolbarFieldArchitecture(props)](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture) ⇒ <code>React.ReactNode</code>
* [.propTypes](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture.propTypes) : <code>Object</code>
* [.defaultProps](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture.defaultProps) : <code>Object</code>

<a name="Toolbar.module_ToolbarFieldArchitecture..useToolbarFieldOptions"></a>

### ToolbarFieldArchitecture~useToolbarFieldOptions(options) ⇒ <code>function</code>
Generate select field options from config

**Kind**: inner method of [<code>ToolbarFieldArchitecture</code>](#Toolbar.module_ToolbarFieldArchitecture)
<table>
<thead>
<tr>
<th>Param</th><th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>options</td><td><code>object</code></td>
</tr><tr>
<td>options.useProduct</td><td><code>function</code></td>
</tr> </tbody>
</table>

<a name="Toolbar.module_ToolbarFieldArchitecture..useOnSelect"></a>

### ToolbarFieldArchitecture~useOnSelect(options) ⇒ <code>function</code>
On select update.

**Kind**: inner method of [<code>ToolbarFieldArchitecture</code>](#Toolbar.module_ToolbarFieldArchitecture)
<table>
<thead>
<tr>
<th>Param</th><th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>options</td><td><code>object</code></td>
</tr><tr>
<td>options.useDispatch</td><td><code>function</code></td>
</tr><tr>
<td>options.useProduct</td><td><code>function</code></td>
</tr> </tbody>
</table>

<a name="Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture"></a>

### ToolbarFieldArchitecture~ToolbarFieldArchitecture(props) ⇒ <code>React.ReactNode</code>
Display an architecture field with generated options.

**Kind**: inner method of [<code>ToolbarFieldArchitecture</code>](#Toolbar.module_ToolbarFieldArchitecture)
**Emits**: <code>event:onSelect</code>
<table>
<thead>
<tr>
<th>Param</th><th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>props</td><td><code>object</code></td>
</tr><tr>
<td>props.isFilter</td><td><code>boolean</code></td>
</tr><tr>
<td>props.position</td><td><code>string</code></td>
</tr><tr>
<td>props.t</td><td><code>function</code></td>
</tr><tr>
<td>props.useOnSelect</td><td><code>function</code></td>
</tr><tr>
<td>props.useProductToolbarQuery</td><td><code>function</code></td>
</tr><tr>
<td>props.useToolbarFieldOptions</td><td><code>function</code></td>
</tr> </tbody>
</table>


* [~ToolbarFieldArchitecture(props)](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture) ⇒ <code>React.ReactNode</code>
* [.propTypes](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture.propTypes) : <code>Object</code>
* [.defaultProps](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture.defaultProps) : <code>Object</code>

<a name="Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture.propTypes"></a>

#### ToolbarFieldArchitecture.propTypes : <code>Object</code>
Prop types.

**Kind**: static property of [<code>ToolbarFieldArchitecture</code>](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture)
<a name="Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture.defaultProps"></a>

#### ToolbarFieldArchitecture.defaultProps : <code>Object</code>
Default props.

**Kind**: static property of [<code>ToolbarFieldArchitecture</code>](#Toolbar.module_ToolbarFieldArchitecture..ToolbarFieldArchitecture)
<a name="Toolbar.module_ToolbarFieldBillingProvider"></a>

## ToolbarFieldBillingProvider
Expand Down
29 changes: 0 additions & 29 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,6 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
],
},
{
"file": "./src/components/toolbar/toolbarFieldArchitecture.js",
"keys": [
{
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['architecture', (type === '' && 'none')",
},
{
"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": [
Expand Down Expand Up @@ -437,10 +420,6 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['filter', RHSM_API_QUERY_SET_TYPES.VARIANT] })",
},
{
"key": "curiosity-toolbar.label",
"match": "translate('curiosity-toolbar.label', { context: ['filter', RHSM_API_QUERY_SET_TYPES.ARCHITECTURE] })",
},
{
"key": "curiosity-toolbar.placeholder",
"match": "t('curiosity-toolbar.placeholder', { context: ['filter'] })",
Expand Down Expand Up @@ -833,10 +812,6 @@ exports[`I18n Component should have locale keys that exist in the default langua
"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",
Expand Down Expand Up @@ -881,10 +856,6 @@ exports[`I18n Component should have locale keys that exist in the default langua
"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.label",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ exports[`ProductViewContext should apply hooks for retrieving specific api queri

exports[`ProductViewContext should apply hooks for retrieving specific config filters and settings: productConfig 1`] = `
{
"productArchitectures": undefined,
"productGroup": "loremIpsum",
"productId": "lorem",
"productLabel": "labelLorem",
Expand Down
6 changes: 2 additions & 4 deletions src/components/productView/productViewContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,11 @@ const useProductContext = ({
*
* @param {object} options
* @param {Function} options.useProductViewContext
* @returns {{productLabel, viewId, productId, productGroup, productVariants, productArchitectures}}
* @returns {{productLabel, viewId, productId, productGroup, productVariants}}
*/
const useProduct = ({ useProductViewContext: useAliasProductViewContext = useProductViewContext } = {}) => {
const { productArchitectures, productGroup, productId, productLabel, productVariants, viewId } =
useAliasProductViewContext();
const { productGroup, productId, productLabel, productVariants, viewId } = useAliasProductViewContext();
return {
productArchitectures,
productGroup,
productId,
productLabel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@

exports[`ToolbarContext should apply a hook for clearing a toolbar field through redux: clear single field 1`] = `
[
[
[
{
"type": "SET_QUERY_RESET_INVENTORY_LIST",
"viewId": undefined,
},
{
"filter": "architecture",
"type": "SET_QUERY",
"value": null,
"viewId": undefined,
},
],
],
[
[
{
Expand Down Expand Up @@ -93,20 +79,6 @@ exports[`ToolbarContext should apply a hook for clearing a toolbar field through

exports[`ToolbarContext should apply a hook for clearing specific active toolbar fields through redux: clear all fields 1`] = `
[
[
[
{
"type": "SET_QUERY_RESET_INVENTORY_LIST",
"viewId": undefined,
},
{
"filter": "architecture",
"type": "SET_QUERY",
"value": null,
"viewId": undefined,
},
],
],
[
[
{
Expand Down Expand Up @@ -179,20 +151,6 @@ exports[`ToolbarContext should apply a hook for clearing specific active toolbar
},
],
],
[
[
{
"type": "SET_QUERY_RESET_INVENTORY_LIST",
"viewId": undefined,
},
{
"filter": "architecture",
"type": "SET_QUERY",
"value": null,
"viewId": undefined,
},
],
],
[
[
{
Expand Down
Loading

0 comments on commit fddee3b

Please sign in to comment.