Skip to content

Commit

Permalink
refactor(router): ent-4208 activate routeDetail context
Browse files Browse the repository at this point in the history
* config, product configs add product label
* config, routes productId for rhel archs
* router, hook, add routeDetail context provider
* hooks, passthrough for useRouteDetail
* productViews, apply useRouteDetail hook
  • Loading branch information
cdcabrera committed Oct 11, 2021
1 parent 7d0b416 commit b56e537
Show file tree
Hide file tree
Showing 30 changed files with 425 additions and 396 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
Array [
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel",
Expand All @@ -317,7 +317,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-arm",
Expand All @@ -326,7 +326,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-ibmpower",
Expand All @@ -335,7 +335,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-ibmz",
Expand All @@ -344,7 +344,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-x86",
Expand All @@ -371,7 +371,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "satellite",
Expand All @@ -380,7 +380,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "satellite-capsule",
Expand All @@ -389,7 +389,7 @@ exports[`Authentication Component should return a redirect on 418 error: 418 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "satellite-server",
Expand Down Expand Up @@ -448,7 +448,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
Array [
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel",
Expand All @@ -457,7 +457,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-arm",
Expand All @@ -466,7 +466,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-ibmpower",
Expand All @@ -475,7 +475,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-ibmz",
Expand All @@ -484,7 +484,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "rhel-x86",
Expand All @@ -511,7 +511,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "satellite",
Expand All @@ -520,7 +520,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "satellite-capsule",
Expand All @@ -529,7 +529,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err
},
Object {
"activateOnError": false,
"component": "productView/productViewDefault",
"component": "productView/productView",
"disabled": false,
"exact": true,
"id": "satellite-server",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ProductView Component should allow custom product views: custom graphCard, descriptions 1`] = `
exports[`ProductView Component should allow custom inventory displays via config: custom tabs, subscriptions table 1`] = `
<PageLayout
className=""
>
Expand Down Expand Up @@ -116,12 +116,25 @@ exports[`ProductView Component should allow custom product views: custom graphCa
viewId="dolor sit"
/>
</InventoryTab>
<InventoryTab
active={false}
key="inventory_subs_lorem ipsum"
title="t(curiosity-inventory.tabSubscriptions, {\\"context\\":\\"lorem ipsum\\"})"
>
<Connect(InventorySubscriptions)
filterInventoryData={Array []}
key="subs_lorem ipsum"
productId="lorem ipsum"
query={Object {}}
viewId="dolor sit"
/>
</InventoryTab>
</Connect(InventoryTabs)>
</PageSection>
</PageLayout>
`;

exports[`ProductView Component should allow custom product views: custom tabs, subscriptions table 1`] = `
exports[`ProductView Component should allow custom product views via props: custom graphCard, descriptions 1`] = `
<PageLayout
className=""
>
Expand All @@ -144,7 +157,11 @@ exports[`ProductView Component should allow custom product views: custom tabs, s
<PageToolbar
className=""
>
dolor sit
<Connect(Toolbar)
productId="lorem ipsum"
query={Object {}}
viewId="dolor sit"
/>
</PageToolbar>
<PageSection
className=""
Expand Down Expand Up @@ -182,7 +199,37 @@ exports[`ProductView Component should allow custom product views: custom tabs, s
productLabel="lorem ipsum product label"
query={Object {}}
viewId="dolor sit"
/>
>
<ToolbarFieldGranularity
options={
Array [
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"daily\\"})",
"value": "daily",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"weekly\\"})",
"value": "weekly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"monthly\\"})",
"value": "monthly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"quarterly\\"})",
"value": "quarterly",
},
]
}
t={[Function]}
value="daily"
viewId="dolor sit"
/>
</Connect(GraphCard)>
</PageSection>
<PageSection
className=""
Expand All @@ -203,25 +250,12 @@ exports[`ProductView Component should allow custom product views: custom tabs, s
viewId="dolor sit"
/>
</InventoryTab>
<InventoryTab
active={false}
key="inventory_subs_lorem ipsum"
title="t(curiosity-inventory.tabSubscriptions, {\\"context\\":\\"lorem ipsum\\"})"
>
<Connect(InventorySubscriptions)
filterInventoryData={Array []}
key="subs_lorem ipsum"
productId="lorem ipsum"
query={Object {}}
viewId="dolor sit"
/>
</InventoryTab>
</Connect(InventoryTabs)>
</PageSection>
</PageLayout>
`;

exports[`ProductView Component should allow custom product views: custom toolbar, toolbarGraph 1`] = `
exports[`ProductView Component should allow custom product views via props: custom toolbar, toolbarGraph 1`] = `
<PageLayout
className=""
>
Expand Down Expand Up @@ -286,7 +320,7 @@ exports[`ProductView Component should allow custom product views: custom toolbar
</PageLayout>
`;

exports[`ProductView Component should allow custom product views: custom toolbar, toolbarProduct 1`] = `
exports[`ProductView Component should allow custom product views via props: custom toolbar, toolbarProduct 1`] = `
<PageLayout
className=""
>
Expand Down Expand Up @@ -351,7 +385,7 @@ exports[`ProductView Component should allow custom product views: custom toolbar
</PageLayout>
`;

exports[`ProductView Component should render a non-connected component: non-connected 1`] = `
exports[`ProductView Component should render a basic component: basic 1`] = `
<PageLayout
className=""
>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ProductViewOpenShiftContainer Component should render a non-connected component: non-connected 1`] = `
exports[`ProductViewOpenShiftContainer Component should render a basic component: basic 1`] = `
<PageLayout
className=""
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,86 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ProductViewOpenShiftDedicated Component should render a non-connected component: non-connected 1`] = `
exports[`ProductViewOpenShiftDedicated Component should render a basic component: basic 1`] = `
<ProductView
routeDetail={
Object {
"pathParameter": "lorem ipsum",
"productConfig": Array [
Object {
"graphTallyQuery": Object {
"granularity": "daily",
},
"initialGraphFilters": Array [
Object {
"chartType": "line",
"color": "#06c",
"fill": "#8bc1f7",
"id": "coreHours",
"isStacked": false,
"stroke": "#06c",
"yAxisUseDataSet": true,
},
Object {
"chartType": "line",
"color": "#009596",
"fill": "#a2d9d9",
"id": "instanceHours",
"isStacked": false,
"stroke": "#009596",
"yAxisUseDataSet": true,
},
],
"initialGraphSettings": Object {
"actionDisplay": [Function],
},
"initialInventoryFilters": Array [
Object {
"cell": [Function],
"id": "displayName",
"isSortable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "coreHours",
"isSortable": true,
"isWrappable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "instanceHours",
"isSortable": true,
"isWrappable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "lastSeen",
"isSortable": true,
"isWrappable": true,
},
],
"initialToolbarFilters": undefined,
"inventoryHostsQuery": Object {
"dir": "desc",
"limit": 100,
"offset": 0,
"sort": "last_seen",
},
"productGroup": "OpenShift-dedicated-metrics",
"productId": "OpenShift-dedicated-metrics",
"query": Object {
"beginning": "2019-07-01T00:00:00.000Z",
"ending": "2019-07-31T23:59:59.999Z",
},
"viewId": "viewOpenShift-dedicated-metrics",
},
],
"productParameter": "lorem ipsum product label",
"viewParameter": "dolor sit",
}
}
t={[Function]}
toolbarGraph={
<ToolbarFieldRangedMonthly
Expand Down
Loading

0 comments on commit b56e537

Please sign in to comment.