Skip to content

Commit

Permalink
chore(build): npm updates, prettier formatting (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed May 20, 2020
1 parent af42952 commit 934f353
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 389 deletions.
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,29 @@
"test:local": "react-scripts test --env=jsdom --roots=./src"
},
"dependencies": {
"@patternfly/patternfly": "2.71.3",
"@patternfly/react-charts": "5.3.18",
"@patternfly/react-core": "3.153.3",
"@patternfly/react-icons": "3.15.15",
"@patternfly/react-styles": "3.7.12",
"@patternfly/react-tokens": "2.8.12",
"@redhat-cloud-services/frontend-components": "1.0.12",
"@redhat-cloud-services/frontend-components-notifications": "1.0.2",
"@redhat-cloud-services/frontend-components-utilities": "1.0.0",
"@patternfly/patternfly": "2.71.6",
"@patternfly/react-charts": "5.3.19",
"@patternfly/react-core": "3.153.13",
"@patternfly/react-icons": "3.15.16",
"@patternfly/react-styles": "3.7.13",
"@patternfly/react-tokens": "2.8.13",
"@redhat-cloud-services/frontend-components": "1.0.24",
"@redhat-cloud-services/frontend-components-notifications": "1.0.3",
"@redhat-cloud-services/frontend-components-utilities": "1.0.3",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"i18next": "^19.3.4",
"i18next": "^19.4.4",
"i18next-xhr-backend": "^3.2.2",
"js-cookie": "^2.2.1",
"locale-code": "^2.0.2",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"node-sass": "^4.13.1",
"moment": "^2.25.3",
"node-sass": "^4.14.1",
"numbro": "^2.2.0",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-i18next": "^11.3.4",
"react-i18next": "^11.4.0",
"react-redux": "^7.2.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
Expand All @@ -108,32 +108,32 @@
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"victory": "^34.1.3",
"victory-core": "^34.1.3",
"victory-legend": "^34.1.3"
"victory": "^34.2.0",
"victory-core": "^34.2.0",
"victory-legend": "^34.2.0"
},
"devDependencies": {
"apidoc-mock": "^3.0.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.4",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.10.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-jsdoc": "^22.1.0",
"eslint-plugin-jest": "^23.9.0",
"eslint-plugin-jsdoc": "^24.0.6",
"eslint-plugin-json": "^2.1.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^3.0.0",
"eslint-plugin-react-hooks": "^4.0.0",
"express": "^4.17.1",
"gettext-extractor": "^3.5.2",
"moxios": "^0.4.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"prettier": "^2.0.5",
"redux-mock-store": "^1.5.4",
"standard-version": "^7.1.0",
"standard-version": "^8.0.0",
"swagger-ui-express": "^4.1.4",
"yamljs": "^0.3.0"
},
Expand Down
12 changes: 2 additions & 10 deletions src/common/dateHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,8 @@ const getCurrentDate = () =>
* @returns {{endDate: Date, startDate: Date}}
*/
const setRangedDateTime = ({ date, subtract, measurement }) => ({
startDate: moment
.utc(date)
.startOf(measurement)
.subtract(subtract, measurement)
.toDate(),
endDate: moment
.utc(date)
.startOf(measurement)
.endOf('days')
.toDate()
startDate: moment.utc(date).startOf(measurement).subtract(subtract, measurement).toDate(),
endDate: moment.utc(date).startOf(measurement).endOf('days').toDate()
});

const defaultDateTime = setRangedDateTime({ date: getCurrentDate(), subtract: 30, measurement: 'days' });
Expand Down
10 changes: 2 additions & 8 deletions src/components/graphCard/__tests__/graphCardHelpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,8 @@ describe('GraphCardHelpers', () => {
const generatedTicks = [];

for (let i = 0; i <= endDateStartDateDiff; i++) {
const date = moment
.utc(startDate)
.add(i, momentGranularity)
.startOf(momentGranularity);

const previousDate = moment(date)
.subtract(1, momentGranularity)
.startOf(momentGranularity);
const date = moment.utc(startDate).add(i, momentGranularity).startOf(momentGranularity);
const previousDate = moment(date).subtract(1, momentGranularity).startOf(momentGranularity);

generatedTicks.push(
xAxisTickFormat({ date: date.toISOString(), granularity, tick: i, previousDate: previousDate.toISOString() })
Expand Down
5 changes: 1 addition & 4 deletions src/redux/selectors/graphCardSelectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ const graphCardSelector = createSelector([graphResponse], response => {

// Generate reflected graph data for number, undefined, and null
reportData.forEach((value, index) => {
const date = moment
.utc(value[rhsmApiTypes.RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES.DATE])
.startOf('day')
.toDate();
const date = moment.utc(value[rhsmApiTypes.RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES.DATE]).startOf('day').toDate();

const generateGraphData = ({ graphDataObj, keyPrefix = '', customValue = null }) => {
Object.keys(graphDataObj).forEach(graphDataObjKey => {
Expand Down
Loading

0 comments on commit 934f353

Please sign in to comment.