Skip to content

Commit

Permalink
feat(rhsmServices,redux): ent-4366 tally refactor for metric id
Browse files Browse the repository at this point in the history
* build, joi schema validation for rhsm
* dotenv, tally endpoint for metric id
* locale, string key updates, match rhsm casing
* toolbarFields, string key updates
* redux, actions, selector, reducer, helpers, rhsm tally refactor, string keys
* services, config, apply schema validation, plus caching
* services, rhsm, breakout schemas, constants, ajax calls
* rhsmApiTypes, move towards constants under rhsm services
  • Loading branch information
cdcabrera committed Nov 3, 2021
1 parent 2e2e994 commit 3f01e69
Show file tree
Hide file tree
Showing 53 changed files with 2,810 additions and 448 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ REACT_APP_CONFIG_SERVICE_LOCALES_EXPIRE=604800000

REACT_APP_SERVICES_RHSM_VERSION=/api/rhsm-subscriptions/v1/version
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/
REACT_APP_SERVICES_RHSM_INVENTORY=/api/rhsm-subscriptions/v1/hosts/products/
REACT_APP_SERVICES_RHSM_INVENTORY_GUESTS=/api/rhsm-subscriptions/v1/hosts/{0}/guests
Expand Down
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ REACT_APP_ENV=development

REACT_APP_SERVICES_RHSM_VERSION=http://localhost:5000/api/rhsm-subscriptions/v1/version
REACT_APP_SERVICES_RHSM_REPORT=http://localhost:5000/api/rhsm-subscriptions/v1/tally/products/
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/
REACT_APP_SERVICES_RHSM_INVENTORY=http://localhost:5000/api/rhsm-subscriptions/v1/hosts/products/
REACT_APP_SERVICES_RHSM_INVENTORY_GUESTS=//localhost:5000/api/rhsm-subscriptions/v1/hosts/{0}/guests
Expand Down
2 changes: 2 additions & 0 deletions config/cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dismissable",
"fadein",
"flyout",
"gibibytes",
"generatedid",
"HHmmss",
"hoverable",
Expand Down Expand Up @@ -44,6 +45,7 @@
"redhat",
"reselect's",
"rhel",
"rhosak",
"rhsm",
"select's",
"spandx",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"test:local": "jest --roots=./src --watch"
},
"dependencies": {
"@joi/date": "^2.1.0",
"@patternfly/patternfly": "4.135.2",
"@patternfly/react-charts": "6.15.23",
"@patternfly/react-core": "4.157.3",
Expand All @@ -89,6 +90,7 @@
"classnames": "^2.3.1",
"i18next": "^20.4.0",
"i18next-xhr-backend": "^3.2.2",
"joi": "^17.4.2",
"js-cookie": "^3.0.1",
"locale-code": "^2.0.2",
"lodash": "^4.17.21",
Expand Down
14 changes: 7 additions & 7 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@
"placeholder_filter_sla": "Filter by SLA",
"placeholder_filter_uom": "Filter by unit",
"placeholder_filter_usage": "Filter by usage",
"granularity_daily": "Daily",
"granularity_weekly": "Weekly",
"granularity_monthly": "Monthly",
"granularity_quarterly": "Quarterly",
"granularity_Daily": "Daily",
"granularity_Weekly": "Weekly",
"granularity_Monthly": "Monthly",
"granularity_Quarterly": "Quarterly",
"granularityRangedMonthly": "{{context}}",
"granularityRangedMonthly_current": "This month",
"sla_none": "No SLA",
"sla_premium": "Premium",
"sla_self-support": "Self-Support",
"sla_standard": "Standard",
"sla_Premium": "Premium",
"sla_Self-Support": "Self-Support",
"sla_Standard": "Standard",
"uom_cores": "Cores",
"uom_sockets": "Sockets",
"usage_Development/Test": "Development/Test",
Expand Down
8 changes: 4 additions & 4 deletions src/common/__tests__/__snapshots__/dateHelpers.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -381,28 +381,28 @@ Object {
exports[`DateHelpers should return a predictable range based on granularity: granularity range of time 1`] = `
Array [
Object {
"granularity": "daily",
"granularity": "Daily",
"range": Object {
"endDate": 2019-07-20T23:59:59.999Z,
"startDate": 2019-06-20T00:00:00.000Z,
},
},
Object {
"granularity": "weekly",
"granularity": "Weekly",
"range": Object {
"endDate": 2019-07-14T23:59:59.999Z,
"startDate": 2019-04-21T00:00:00.000Z,
},
},
Object {
"granularity": "monthly",
"granularity": "Monthly",
"range": Object {
"endDate": 2019-07-01T23:59:59.999Z,
"startDate": 2018-07-01T00:00:00.000Z,
},
},
Object {
"granularity": "quarterly",
"granularity": "Quarterly",
"range": Object {
"endDate": 2019-07-01T23:59:59.999Z,
"startDate": 2016-07-01T00:00:00.000Z,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports[`GraphCardChart Component should render a basic component: basic 1`] = `
chartLegend={[Function]}
chartTooltip={[Function]}
dataSets={Array []}
key="chart_{\\"granularity\\":\\"daily\\"}"
key="chart_{\\"granularity\\":\\"Daily\\"}"
padding={
Object {
"bottom": 75,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ exports[`ProductView Component should allow custom inventory displays via config
Array [
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"daily\\"})",
"value": "daily",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Daily\\"})",
"value": "Daily",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"weekly\\"})",
"value": "weekly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Weekly\\"})",
"value": "Weekly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"monthly\\"})",
"value": "monthly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Monthly\\"})",
"value": "Monthly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"quarterly\\"})",
"value": "quarterly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Quarterly\\"})",
"value": "Quarterly",
},
]
}
Expand Down Expand Up @@ -258,23 +258,23 @@ exports[`ProductView Component should allow custom product views via props: cust
Array [
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"daily\\"})",
"value": "daily",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Daily\\"})",
"value": "Daily",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"weekly\\"})",
"value": "weekly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Weekly\\"})",
"value": "Weekly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"monthly\\"})",
"value": "monthly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Monthly\\"})",
"value": "Monthly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"quarterly\\"})",
"value": "quarterly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Quarterly\\"})",
"value": "Quarterly",
},
]
}
Expand Down Expand Up @@ -481,23 +481,23 @@ exports[`ProductView Component should render a basic component: basic 1`] = `
Array [
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"daily\\"})",
"value": "daily",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Daily\\"})",
"value": "Daily",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"weekly\\"})",
"value": "weekly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Weekly\\"})",
"value": "Weekly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"monthly\\"})",
"value": "monthly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Monthly\\"})",
"value": "Monthly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"quarterly\\"})",
"value": "quarterly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Quarterly\\"})",
"value": "Quarterly",
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Object {
exports[`ProductViewContext should apply a hook for retrieving product context: product context, uom filtering cores 1`] = `
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down Expand Up @@ -147,7 +147,7 @@ Object {
exports[`ProductViewContext should apply a hook for retrieving product context: product context, uom filtering sockets 1`] = `
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
value={
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down Expand Up @@ -209,7 +209,7 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
Object {
"beginning": "2019-06-20T00:00:00.000Z",
"ending": "2019-07-20T23:59:59.999Z",
"granularity": "daily",
"granularity": "Daily",
}
}
viewId="viewOpenShift Container Platform"
Expand Down Expand Up @@ -240,23 +240,23 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
Array [
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"daily\\"})",
"value": "daily",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Daily\\"})",
"value": "Daily",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"weekly\\"})",
"value": "weekly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Weekly\\"})",
"value": "Weekly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"monthly\\"})",
"value": "monthly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Monthly\\"})",
"value": "Monthly",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"quarterly\\"})",
"value": "quarterly",
"title": "t(curiosity-toolbar.granularity, {\\"context\\":\\"Quarterly\\"})",
"value": "Quarterly",
},
]
}
Expand Down Expand Up @@ -403,7 +403,7 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
value={
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down Expand Up @@ -505,7 +505,7 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
Object {
"beginning": "2019-07-01T00:00:00.000Z",
"ending": "2019-07-31T23:59:59.999Z",
"granularity": "daily",
"granularity": "Daily",
}
}
viewId="viewOpenShift-metrics"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Object {
"productConfig": Array [
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down Expand Up @@ -176,7 +176,7 @@ Object {
},
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down Expand Up @@ -258,7 +258,7 @@ exports[`Redirect Component should render a basic component: basic 1`] = `
"productConfig": Array [
Object {
"graphTallyQuery": Object {
"granularity": "daily",
"granularity": "Daily",
},
"initialGraphFilters": Array [
Object {
Expand Down
Loading

0 comments on commit 3f01e69

Please sign in to comment.