Skip to content

Commit

Permalink
DEV clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Mar 6, 2023
1 parent def9b3b commit c6f981a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
1 change: 0 additions & 1 deletion src/components/graphCard/graphCardContext.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
import React, { useContext, useMemo } from 'react';
import { useShallowCompareEffect } from 'react-use';
import { ToolbarItem } from '@patternfly/react-core';
Expand Down
27 changes: 3 additions & 24 deletions src/components/productView/productViewContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,37 +233,16 @@ const useProductContext = ({
const applyUomFilter = useCallback(() => {
if (productContextFilterUom === true) {
const filterFilters = ({ id, metric, isOptional }) => {
/*
if (Array.isArray(filters)) {
const test = filters.filter(filterFilters);
console.log('>>>>>>>>>>> filter filters', test);
return test;
}
*/

if (!isOptional) {
return true;
}
return new RegExp(uomFilter, 'i').test(metric) || new RegExp(uomFilter, 'i').test(id);
};

/*
const isGraphFiltersNested = initialGraphFilters.find(({ filters }) => Array.isArray(filters));
let updatedGraphFilters;
if (isGraphFiltersNested) {
updatedGraphFilters = _cloneDeep(initialGraphFilters).map(({ filters, ...rest }) => ({
...rest,
filters: filters.filter(filterFilters)
}));
} else {
updatedGraphFilters = initialGraphFilters.filter(filterFilters);
}
*/
/**
* Allowing nested filters with beside normal filters means we take the quick
* path, just run the loop twice. And we make sure to set "isOptional" false when it
* comes to nested filters in the event someone combined a config setting.
* Allowing nested filters beside normal filters we take the quick path, just run the loop twice.
* Make sure to set "isOptional" false when it comes to nested filters in the event someone
* combined a config setting in the subsequent loop.
*/
const updatedGraphFilters = _cloneDeep(initialGraphFilters)
.map(({ filters, ...rest }) => ({
Expand Down
12 changes: 0 additions & 12 deletions src/styles/_usage-graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,8 @@
&-usage-graph {
box-shadow: none !important;
background-color: var(--pf-global--BackgroundColor--100);
/*
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
margin-left: var(--pf-global--spacer--md);
margin-right: var(--pf-global--spacer--md);
*/
margin-top: var(--pf-global--spacer--md);

&:first-child {
// margin-top: inherit;
}

&:last-child {
margin-bottom: var(--pf-global--spacer--md);
}
Expand Down

0 comments on commit c6f981a

Please sign in to comment.