Skip to content

Commit

Permalink
refactor(inventoryCard): ent-4572 class, function conversion (#857)
Browse files Browse the repository at this point in the history
* locale, disabled tab string
* guestsList, class to func, deprecated guests
* guestsListContext, hooks for selectors, action
* inventoryCard, class to func
* inventoryCardContext, hooks for selectors, action
* inventorySubscriptions, class to func, alias inventoryCard
* inventorySubscriptionsContext, hooks for selectors, action
* productViews, component prop drill, config clean up
* productViewContext, activate guests config
* useReactRedux, expand base redux hooks
* viewReducer, guests query and types
* selectors, remove unused instances, subscriptions
* rhsmConstants, expand for guests, number_of_guests
* rhsmSchemas, guests, subscriptions added
* rhsmTransformers, instances number_of_guests added
  • Loading branch information
cdcabrera committed Mar 8, 2022
1 parent e633b5b commit 273ca42
Show file tree
Hide file tree
Showing 62 changed files with 3,092 additions and 2,958 deletions.
2 changes: 1 addition & 1 deletion public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"tabHosts_OpenShift-dedicated-metrics_other": "{{count}} instances",
"tabInstances": "Current monthly instances",
"tabSubscriptions": "Current subscriptions",
"tab_disabled": "The {{tabName}} display is currently disabled.",
"tab_disabled": "The inventory display is currently disabled.",
"tableAriaLabel": "{{appName}} systems inventory table.",
"tableSummary": "A generated table with one level of column headers.",
"tableEmptyInventoryTitle": "No results found",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`GuestsList Component should handle multiple display states: fulfilled 1`] = `
<div
className="fadein "
>
<div
className="curiosity-table-scroll"
style={
Object {
"height": "84px",
}
}
>
<div
className="curiosity-table-scroll-list__no-scroll"
onScroll={[Function]}
>
<Table
ariaLabel={null}
borders={false}
className="curiosity-guests-list"
columnHeaders={
Array [
"t(curiosity-inventory.header, {\\"context\\":\\"lorem\\"})",
"t(curiosity-inventory.header, {\\"context\\":\\"dolor\\"})",
]
}
isHeader={true}
rows={
Array [
Object {
"cells": Array [
"ipsum",
"sit",
],
},
]
}
summary={null}
t={[Function]}
variant="compact"
/>
</div>
</div>
</div>
`;

exports[`GuestsList Component should handle multiple display states: initial pending 1`] = `
<div
className="fadein "
>
<Loader
skeletonProps={
Object {
"size": "sm",
}
}
tableProps={
Object {
"borders": false,
"className": "curiosity-guests-list",
"colCount": 1,
"colWidth": Array [],
"rowCount": 1,
"variant": "compact",
}
}
variant="table"
/>
</div>
`;

exports[`GuestsList Component should handle multiple display states: paged pending 1`] = `
<div
className="fadein "
>
<div
className="curiosity-table-scroll"
style={
Object {
"height": "84px",
}
}
>
<div
className="curiosity-table-scroll-list__no-scroll"
onScroll={[Function]}
>
<div
className="curiosity-table-scroll-loader__custom"
>
<Loader
skeletonProps={
Object {
"size": "sm",
}
}
tableProps={
Object {
"borders": false,
"colCount": 1,
"colWidth": Array [],
"rowCount": 0,
"variant": "compact",
}
}
variant="table"
/>
</div>
</div>
</div>
</div>
`;

exports[`GuestsList Component should handle updating paging state: state 1`] = `
Object {
"initialState": Object {
"currentPage": 0,
"limit": 100,
"previousData": Array [],
},
"scrollComplete": Object {
"currentPage": 1,
"limit": 100,
"previousData": Array [
Object {
"dolor": "sit",
"lorem": "ipsum",
},
],
},
"scrollProgress": Object {
"currentPage": 0,
"limit": 100,
"previousData": Array [],
},
}
`;

exports[`GuestsList Component should handle variations in data: filtered data 1`] = `
<div
className="fadein "
>
<div
className="curiosity-table-scroll"
style={
Object {
"height": "126px",
}
}
>
<div
className="curiosity-table-scroll-list__no-scroll"
onScroll={[Function]}
>
<Table
ariaLabel={null}
borders={false}
className="curiosity-guests-list"
columnHeaders={
Array [
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"lorem\\"})",
"transforms": Array [],
},
]
}
isHeader={true}
rows={
Array [
Object {
"cells": Array [
Object {
"title": "ipsum",
},
],
},
Object {
"cells": Array [
Object {
"title": "amet",
},
],
},
]
}
summary={null}
t={[Function]}
variant="compact"
/>
</div>
</div>
</div>
`;

exports[`GuestsList Component should handle variations in data: variable data 1`] = `
<div
className="fadein "
>
<div
className="curiosity-table-scroll"
style={
Object {
"height": "126px",
}
}
>
<div
className="curiosity-table-scroll-list__no-scroll"
onScroll={[Function]}
>
<Table
ariaLabel={null}
borders={false}
className="curiosity-guests-list"
columnHeaders={
Array [
"t(curiosity-inventory.header, {\\"context\\":\\"lorem\\"})",
"t(curiosity-inventory.header, {\\"context\\":\\"dolor\\"})",
]
}
isHeader={true}
rows={
Array [
Object {
"cells": Array [
"ipsum",
"sit",
],
},
Object {
"cells": Array [
"amet",
"amet",
],
},
]
}
summary={null}
t={[Function]}
variant="compact"
/>
</div>
</div>
</div>
`;

exports[`GuestsList Component should render a non-connected component: non-connected 1`] = `
<div
className="fadein "
>
<div
className="curiosity-table-scroll"
style={
Object {
"height": "42px",
}
}
>
<div
className="curiosity-table-scroll-list__no-scroll"
onScroll={[Function]}
/>
</div>
</div>
`;
Loading

0 comments on commit 273ca42

Please sign in to comment.