Skip to content

Commit

Permalink
refactor(rhsmServices): sw-870 remove, replace hosts refs (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera authored Aug 15, 2023
1 parent fc74595 commit 3ac52e5
Show file tree
Hide file tree
Showing 38 changed files with 55 additions and 2,484 deletions.
3 changes: 0 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ REACT_APP_UI_DISABLED_TOOLBAR=false
REACT_APP_UI_DISABLED_TOOLBAR_GROUP_VARIANT=false
REACT_APP_UI_DISABLED_GRAPH=false
REACT_APP_UI_DISABLED_TABLE=false
REACT_APP_UI_DISABLED_TABLE_HOSTS=false
REACT_APP_UI_DISABLED_TABLE_INSTANCES=false
REACT_APP_UI_DISABLED_TABLE_SUBSCRIPTIONS=false
REACT_APP_UI_LOGGER_ID=curiosity
Expand All @@ -40,8 +39,6 @@ REACT_APP_SERVICES_RHSM_REPORT=/api/rhsm-subscriptions/v1/tally/products/
REACT_APP_SERVICES_RHSM_TALLY=/api/rhsm-subscriptions/v1/tally/products/{0}/{1}
REACT_APP_SERVICES_RHSM_CAPACITY=/api/rhsm-subscriptions/v1/capacity/products/{0}/{1}
REACT_APP_SERVICES_RHSM_CAPACITY_DEPRECATED=/api/rhsm-subscriptions/v1/capacity/products/
REACT_APP_SERVICES_RHSM_INVENTORY=/api/rhsm-subscriptions/v1/hosts/products/
REACT_APP_SERVICES_RHSM_INVENTORY_GUESTS=/api/rhsm-subscriptions/v1/hosts/{0}/guests
REACT_APP_SERVICES_RHSM_INVENTORY_INSTANCES=/api/rhsm-subscriptions/v1/instances/products/
REACT_APP_SERVICES_RHSM_INVENTORY_INSTANCES_GUESTS=/api/rhsm-subscriptions/v1/instances/{0}/guests
REACT_APP_SERVICES_RHSM_INVENTORY_SUBSCRIPTIONS=/api/rhsm-subscriptions/v1/subscriptions/products/
Expand Down
2 changes: 0 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ REACT_APP_SERVICES_RHSM_REPORT=http://localhost:5000/api/rhsm-subscriptions/v1/t
REACT_APP_SERVICES_RHSM_TALLY=http://localhost:5000/api/rhsm-subscriptions/v1/tally/products/{0}/{1}
REACT_APP_SERVICES_RHSM_CAPACITY=http://localhost:5000/api/rhsm-subscriptions/v1/capacity/products/{0}/{1}
REACT_APP_SERVICES_RHSM_CAPACITY_DEPRECATED=http://localhost:5000/api/rhsm-subscriptions/v1/capacity/products/
REACT_APP_SERVICES_RHSM_INVENTORY=http://localhost:5000/api/rhsm-subscriptions/v1/hosts/products/
REACT_APP_SERVICES_RHSM_INVENTORY_GUESTS=http://localhost:5000/api/rhsm-subscriptions/v1/hosts/{0}/guests
REACT_APP_SERVICES_RHSM_INVENTORY_INSTANCES=http://localhost:5000/api/rhsm-subscriptions/v1/instances/products/
REACT_APP_SERVICES_RHSM_INVENTORY_INSTANCES_GUESTS=http://localhost:5000/api/rhsm-subscriptions/v1/instances/{0}/guests
REACT_APP_SERVICES_RHSM_INVENTORY_SUBSCRIPTIONS=http://localhost:5000/api/rhsm-subscriptions/v1/subscriptions/products/
Expand Down
4 changes: 0 additions & 4 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@
"cardHeading": "Current systems",
"tabHeading": "Inventory tabs",
"tabSubHeading": "Tab {{count}}",
"tabHosts": "Current systems",
"tabHosts_OpenShift-dedicated-metrics": "Current instances",
"tabHosts_OpenShift-dedicated-metrics_one": "{{count}} instance",
"tabHosts_OpenShift-dedicated-metrics_other": "{{count}} instances",
"tabInstances": "Current monthly instances",
"tabInstances_RHEL": "Current instances",
"tabInstances_RHEL for ARM": "$t(curiosity-inventory.tabInstances_RHEL)",
Expand Down
8 changes: 0 additions & 8 deletions src/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ Download the debug log file.
* [~UI_DISABLED_GRAPH](#Helpers.module_General..UI_DISABLED_GRAPH) : <code>boolean</code>
* [~UI_DISABLED_NOTIFICATIONS](#Helpers.module_General..UI_DISABLED_NOTIFICATIONS) : <code>boolean</code>
* [~UI_DISABLED_TABLE](#Helpers.module_General..UI_DISABLED_TABLE) : <code>boolean</code>
* [~UI_DISABLED_TABLE_HOSTS](#Helpers.module_General..UI_DISABLED_TABLE_HOSTS) : <code>boolean</code>
* [~UI_DISABLED_TABLE_INSTANCES](#Helpers.module_General..UI_DISABLED_TABLE_INSTANCES) : <code>boolean</code>
* [~UI_DISABLED_TABLE_SUBSCRIPTIONS](#Helpers.module_General..UI_DISABLED_TABLE_SUBSCRIPTIONS) : <code>boolean</code>
* [~UI_DISABLED_TOOLBAR](#Helpers.module_General..UI_DISABLED_TOOLBAR) : <code>boolean</code>
Expand Down Expand Up @@ -317,13 +316,6 @@ See dotenv config files for activation.
Disable the inventory/table aspect of the UI.
See dotenv config files for activation.

**Kind**: inner constant of [<code>General</code>](#Helpers.module_General)
<a name="Helpers.module_General..UI_DISABLED_TABLE_HOSTS"></a>

### General~UI\_DISABLED\_TABLE\_HOSTS : <code>boolean</code>
Disable the current hosts inventory/table aspect of the UI.
See dotenv config files for activation.

**Kind**: inner constant of [<code>General</code>](#Helpers.module_General)
<a name="Helpers.module_General..UI_DISABLED_TABLE_INSTANCES"></a>

Expand Down
3 changes: 0 additions & 3 deletions src/common/__tests__/__snapshots__/helpers.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ exports[`Helpers should expose a window object: limited window object 1`] = `
"UI_DISABLED_GRAPH": false,
"UI_DISABLED_NOTIFICATIONS": false,
"UI_DISABLED_TABLE": false,
"UI_DISABLED_TABLE_HOSTS": false,
"UI_DISABLED_TABLE_INSTANCES": false,
"UI_DISABLED_TABLE_SUBSCRIPTIONS": false,
"UI_DISABLED_TOOLBAR": false,
Expand Down Expand Up @@ -65,7 +64,6 @@ exports[`Helpers should expose a window object: window object 1`] = `
"UI_DISABLED_GRAPH": false,
"UI_DISABLED_NOTIFICATIONS": false,
"UI_DISABLED_TABLE": false,
"UI_DISABLED_TABLE_HOSTS": false,
"UI_DISABLED_TABLE_INSTANCES": false,
"UI_DISABLED_TABLE_SUBSCRIPTIONS": false,
"UI_DISABLED_TOOLBAR": false,
Expand Down Expand Up @@ -124,7 +122,6 @@ exports[`Helpers should have specific functions: helpers 1`] = `
"UI_DISABLED_GRAPH": false,
"UI_DISABLED_NOTIFICATIONS": false,
"UI_DISABLED_TABLE": false,
"UI_DISABLED_TABLE_HOSTS": false,
"UI_DISABLED_TABLE_INSTANCES": false,
"UI_DISABLED_TABLE_SUBSCRIPTIONS": false,
"UI_DISABLED_TOOLBAR": false,
Expand Down
9 changes: 0 additions & 9 deletions src/common/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,6 @@ const UI_DISABLED_NOTIFICATIONS = process.env.REACT_APP_UI_DISABLED_NOTIFICATION
*/
const UI_DISABLED_TABLE = process.env.REACT_APP_UI_DISABLED_TABLE === 'true';

/**
* Disable the current hosts inventory/table aspect of the UI.
* See dotenv config files for activation.
*
* @type {boolean}
*/
const UI_DISABLED_TABLE_HOSTS = process.env.REACT_APP_UI_DISABLED_TABLE_HOSTS === 'true';

/**
* Disable the current instances inventory/table aspect of the UI.
* See dotenv config files for activation.
Expand Down Expand Up @@ -456,7 +448,6 @@ const helpers = {
UI_DISABLED_GRAPH,
UI_DISABLED_NOTIFICATIONS,
UI_DISABLED_TABLE,
UI_DISABLED_TABLE_HOSTS,
UI_DISABLED_TABLE_INSTANCES,
UI_DISABLED_TABLE_SUBSCRIPTIONS,
UI_DISABLED_TOOLBAR,
Expand Down
143 changes: 3 additions & 140 deletions src/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@
<dt><a href="#i18n.module_i18nHelpers">i18nHelpers</a></dt>
<dd></dd>
<dt><a href="#Components.module_InventoryCard">InventoryCard</a></dt>
<dd><p>Instances, Hosts, and Subscriptions base inventory card.</p>
<dd><p>Instances, and Subscriptions base inventory card.</p>
</dd>
<dt><a href="#InventoryCard.module_InventoryCardContext">InventoryCardContext</a></dt>
<dd></dd>
<dt><a href="#InventoryCard.module_InventoryCardHelpers">InventoryCardHelpers</a></dt>
<dd></dd>
<dt><a href="#InventoryCard.module_InventoryCardHosts">InventoryCardHosts</a></dt>
<dd></dd>
<dt><a href="#Components.module_InventoryCardSubscriptions">InventoryCardSubscriptions</a></dt>
<dd></dd>
<dt><a href="#InventoryCardSubscriptions.module_InventoryCardSubscriptionsContext">InventoryCardSubscriptionsContext</a></dt>
Expand Down Expand Up @@ -2833,7 +2831,7 @@ Apply string replacements against a component, HOC.
<a name="Components.module_InventoryCard"></a>

## InventoryCard
Instances, Hosts, and Subscriptions base inventory card.
Instances, and Subscriptions base inventory card.

**Properties**

Expand All @@ -2848,8 +2846,6 @@ Instances, Hosts, and Subscriptions base inventory card.
<td>InventoryCardContext</td><td><code>module</code></td>
</tr><tr>
<td>InventoryCardHelpers</td><td><code>module</code></td>
</tr><tr>
<td>InventoryCardHosts</td><td><code>module</code></td>
</tr> </tbody>
</table>

Expand Down Expand Up @@ -2922,44 +2918,11 @@ Default props.
## InventoryCardContext

* [InventoryCardContext](#InventoryCard.module_InventoryCardContext)
* [~useGetHostsInventory(options)](#InventoryCard.module_InventoryCardContext..useGetHostsInventory) ⇒ <code>Object</code>
* [~useGetInstancesInventory(options)](#InventoryCard.module_InventoryCardContext..useGetInstancesInventory) ⇒ <code>Object</code>
* [~useOnPageInstances(options)](#InventoryCard.module_InventoryCardContext..useOnPageInstances) ⇒ <code>function</code>
* [~useOnColumnSortHosts(options)](#InventoryCard.module_InventoryCardContext..useOnColumnSortHosts) ⇒ <code>function</code>
* [~useOnColumnSortInstances(options)](#InventoryCard.module_InventoryCardContext..useOnColumnSortInstances) ⇒ <code>function</code>
* ["onPage" (params)](#event_onPage) ⇒ <code>void</code>
* ["onColumnSort" (_data, params)](#event_onColumnSort) ⇒ <code>void</code>
* ["onColumnSort" (_data, params)](#event_onColumnSort) ⇒ <code>void</code>

<a name="InventoryCard.module_InventoryCardContext..useGetHostsInventory"></a>

### InventoryCardContext~useGetHostsInventory(options) ⇒ <code>Object</code>
Combined Redux RHSM Actions, getHostsInventory, and inventory selector response.

**Kind**: inner method of [<code>InventoryCardContext</code>](#InventoryCard.module_InventoryCardContext)
<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.isDisabled</td><td><code>boolean</code></td>
</tr><tr>
<td>options.getInventory</td><td><code>function</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><tr>
<td>options.useProductInventoryQuery</td><td><code>function</code></td>
</tr><tr>
<td>options.useSelectorsResponse</td><td><code>function</code></td>
</tr> </tbody>
</table>

<a name="InventoryCard.module_InventoryCardContext..useGetInstancesInventory"></a>

Expand Down Expand Up @@ -3013,30 +2976,6 @@ An onPage callback for instances inventory.
</tr> </tbody>
</table>

<a name="InventoryCard.module_InventoryCardContext..useOnColumnSortHosts"></a>

### InventoryCardContext~useOnColumnSortHosts(options) ⇒ <code>function</code>
An onColumnSort callback for hosts inventory.

**Kind**: inner method of [<code>InventoryCardContext</code>](#InventoryCard.module_InventoryCardContext)
<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.sortColumns</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="InventoryCard.module_InventoryCardContext..useOnColumnSortInstances"></a>

### InventoryCardContext~useOnColumnSortInstances(options) ⇒ <code>function</code>
Expand Down Expand Up @@ -3085,30 +3024,6 @@ On event update state for instances inventory.

<a name="event_onColumnSort"></a>

### "onColumnSort" (_data, params) ⇒ <code>void</code>
On event update state for hosts inventory.

**Kind**: event emitted by [<code>InventoryCardContext</code>](#InventoryCard.module_InventoryCardContext)
<table>
<thead>
<tr>
<th>Param</th><th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>_data</td><td><code>*</code></td>
</tr><tr>
<td>params</td><td><code>object</code></td>
</tr><tr>
<td>params.direction</td><td><code>string</code></td>
</tr><tr>
<td>params.id</td><td><code>string</code></td>
</tr> </tbody>
</table>

<a name="event_onColumnSort"></a>

### "onColumnSort" (_data, params) ⇒ <code>void</code>
On event update state for instances inventory.

Expand Down Expand Up @@ -3289,58 +3204,6 @@ Parse and return formatted/filtered table cells, and apply table filters.
</tr> </tbody>
</table>

<a name="InventoryCard.module_InventoryCardHosts"></a>

## InventoryCardHosts

* [InventoryCardHosts](#InventoryCard.module_InventoryCardHosts)
* <del>[~InventoryCardHosts(props)](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts) ⇒ <code>React.ReactNode</code></del>
* [.propTypes](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts.propTypes) : <code>Object</code>
* [.defaultProps](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts.defaultProps) : <code>Object</code>

<a name="InventoryCard.module_InventoryCardHosts..InventoryCardHosts"></a>

### <del>InventoryCardHosts~InventoryCardHosts(props) ⇒ <code>React.ReactNode</code></del>
***Deprecated***

A hosts' system inventory component.

**Kind**: inner method of [<code>InventoryCardHosts</code>](#InventoryCard.module_InventoryCardHosts)
<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.isDisabled</td><td><code>boolean</code></td>
</tr><tr>
<td>props.useGetInventory</td><td><code>function</code></td>
</tr><tr>
<td>props.useOnColumnSort</td><td><code>function</code></td>
</tr> </tbody>
</table>


* <del>[~InventoryCardHosts(props)](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts) ⇒ <code>React.ReactNode</code></del>
* [.propTypes](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts.propTypes) : <code>Object</code>
* [.defaultProps](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts.defaultProps) : <code>Object</code>

<a name="InventoryCard.module_InventoryCardHosts..InventoryCardHosts.propTypes"></a>

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

**Kind**: static property of [<code>InventoryCardHosts</code>](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts)
<a name="InventoryCard.module_InventoryCardHosts..InventoryCardHosts.defaultProps"></a>

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

**Kind**: static property of [<code>InventoryCardHosts</code>](#InventoryCard.module_InventoryCardHosts..InventoryCardHosts)
<a name="Components.module_InventoryCardSubscriptions"></a>

## InventoryCardSubscriptions
Expand Down Expand Up @@ -4992,7 +4855,7 @@ Return guests inventory configuration.
<a name="ProductView.module_ProductViewContext..useProductInventoryHostsConfig"></a>

### ProductViewContext~useProductInventoryHostsConfig(options) ⇒ <code>Object</code>
Return hosts inventory configuration.
Return inventory configuration.

**Kind**: inner method of [<code>ProductViewContext</code>](#ProductView.module_ProductViewContext)
<table>
Expand Down
Loading

0 comments on commit 3ac52e5

Please sign in to comment.