Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(toolbarFieldArchitecture): sw-748 remove component, 2 of 2 #1097

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,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 @@ -238,7 +237,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 @@ -284,7 +282,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 @@ -6023,8 +6020,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 @@ -6185,8 +6180,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 @@ -6217,8 +6210,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 @@ -6255,109 +6246,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