Skip to content

Commit

Permalink
chore: 🔨 Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoval committed Jul 14, 2023
1 parent 7ccfbb1 commit 061e27b
Show file tree
Hide file tree
Showing 7 changed files with 1,172 additions and 453 deletions.
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@
"commit": "git-cz"
},
"dependencies": {
"@antv/g6": "^4.8.17",
"@antv/g6": "^4.8.19",
"@patternfly/patternfly": "^4.224.2",
"@patternfly/react-charts": "^6.94.19",
"@patternfly/react-core": "^4.276.8",
"@patternfly/react-icons": "^4.93.6",
"@patternfly/react-table": "^4.113.0",
"@patternfly/react-topology": "^4.93.5",
"@tanstack/react-query": "^4.29.19",
"axios": "^1.4.0",
"date-fns": "^2.30.0",
"framer-motion": "^10.12.18",
"framer-motion": "^10.12.20",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.10",
Expand All @@ -58,35 +59,35 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"circular-dependency-plugin": "^5.2.2",
"commitizen": "^4.3.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"cypress": "^12.16.0",
"cz-git": "^1.6.1",
"cypress": "^12.17.1",
"cz-git": "^1.7.0",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
"miragejs": "^0.1.47",
"prettier": "^2.8.8",
"prettier": "^3.0.0",
"start-server-and-test": "^2.0.0",
"style-loader": "^3.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"ts-prune": "^0.10.3",
"tsconfig-paths-webpack-plugin": "^4.0.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.1.6",
"webpack": "^5.88.1",
"webpack-bundle-analyzer": "^4.9.0",
Expand Down
13 changes: 8 additions & 5 deletions src/core/components/Graph/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ export const GraphController = {
},
// TODO: remove this function when Backend sanitize the old process pairs
sanitizeEdges: (nodes: GraphNode[], edges: GraphEdge[]) => {
const availableNodesMap = nodes.reduce((acc, node) => {
acc[node.id] = node.id;

return acc;
}, {} as Record<string, string>);
const availableNodesMap = nodes.reduce(
(acc, node) => {
acc[node.id] = node.id;

return acc;
},
{} as Record<string, string>
);

return edges.filter(({ source, target }) => availableNodesMap[source] && availableNodesMap[target]);
},
Expand Down
13 changes: 8 additions & 5 deletions src/pages/Addresses/components/ConnectionsByAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,14 @@ const ConnectionsByAddress: FC<ConnectionsByAddressProps> = function ({ addressI
const startTime = servers.reduce((acc, process) => Math.min(acc, process.startTime), 0);

if (isPrometheusActive && byteRates) {
const byteRatesMap = byteRates.reduce((acc, byteRate) => {
acc[`${byteRate.metric.destProcess}`] = Number(byteRate.value[1]);

return acc;
}, {} as Record<string, number>);
const byteRatesMap = byteRates.reduce(
(acc, byteRate) => {
acc[`${byteRate.metric.destProcess}`] = Number(byteRate.value[1]);

return acc;
},
{} as Record<string, number>
);
servers = servers.map((conn) => ({
...conn,
byteRate: byteRatesMap[`${conn.name}`] || 0
Expand Down
22 changes: 14 additions & 8 deletions src/pages/Addresses/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@ export const AddressesController = {
) => {
const tcpActiveFlowsMap =
tcpActiveFlows.length &&
tcpActiveFlows.reduce((acc, flow) => {
acc[flow.metric.address] = Number(flow.value[1]) / 2;
tcpActiveFlows.reduce(
(acc, flow) => {
acc[flow.metric.address] = Number(flow.value[1]) / 2;

return acc;
}, {} as Record<string, number>);
return acc;
},
{} as Record<string, number>
);

const httpTotalFlowsMap =
httpTotalFlows.length &&
httpTotalFlows?.reduce((acc, flow) => {
acc[flow.metric.address] = Number(flow.value[1]) / 2;
httpTotalFlows?.reduce(
(acc, flow) => {
acc[flow.metric.address] = Number(flow.value[1]) / 2;

return acc;
}, {} as Record<string, number>);
return acc;
},
{} as Record<string, number>
);

return addresses.map((address) => ({
...address,
Expand Down
24 changes: 15 additions & 9 deletions src/pages/Sites/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ const SitesController = {
bindLinksWithSiteIds: (sites: SiteResponse[], links: LinkResponse[], routers: RouterResponse[]): SiteWithLinks[] => {
// Creates a map of router ids to its site identity
// we use this object as a support to retrieve siteIds from router Ids
const routersMap = routers.reduce(function (acc, { identity, parent: siteId }) {
acc[identity] = siteId;
const routersMap = routers.reduce(
function (acc, { identity, parent: siteId }) {
acc[identity] = siteId;

return acc;
}, {} as Record<string, string>);
return acc;
},
{} as Record<string, string>
);

// This function extends each link by adding source and destination site ids connected
const linksExtended = links
Expand All @@ -38,11 +41,14 @@ const SitesController = {
// Map <source site Id: destination site Id> to assign to each site the sited Ids connected with him (destinations)
// Only outgoing links are stored.
// Instead Incoming links id are used to select the site
const linksExtendedMap = linksExtended.reduce(function (acc, { sourceSiteId, destinationSiteId }) {
(acc[sourceSiteId] = acc[sourceSiteId] || []).push(destinationSiteId);

return acc;
}, {} as Record<string, string[]>);
const linksExtendedMap = linksExtended.reduce(
function (acc, { sourceSiteId, destinationSiteId }) {
(acc[sourceSiteId] = acc[sourceSiteId] || []).push(destinationSiteId);

return acc;
},
{} as Record<string, string[]>
);

return sites.map((site) => ({
...site,
Expand Down
26 changes: 16 additions & 10 deletions src/pages/Topology/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,25 @@ export const TopologyController = {
latencyByProcessPairs?: PrometheusApiSingleResult[],
options?: { showLinkLabelReverse?: boolean; rotateLabel?: boolean }
): GraphEdge[] => {
const byteRateByProcessPairsMap = (byteRateByProcessPairs || []).reduce((acc, { metric, value }) => {
{
acc[`${metric.sourceProcess}${metric.destProcess}`] = Number(value[1]);
}
const byteRateByProcessPairsMap = (byteRateByProcessPairs || []).reduce(
(acc, { metric, value }) => {
{
acc[`${metric.sourceProcess}${metric.destProcess}`] = Number(value[1]);
}

return acc;
}, {} as Record<string, number>);
return acc;
},
{} as Record<string, number>
);

const latencyByProcessPairsMap = (latencyByProcessPairs || []).reduce((acc, { metric, value }) => {
acc[`${metric.sourceProcess}${metric.destProcess}`] = Number(value[1]);
const latencyByProcessPairsMap = (latencyByProcessPairs || []).reduce(
(acc, { metric, value }) => {
acc[`${metric.sourceProcess}${metric.destProcess}`] = Number(value[1]);

return acc;
}, {} as Record<string, number>);
return acc;
},
{} as Record<string, number>
);

return links.map((link) => {
const byterate = byteRateByProcessPairsMap[`${link.sourceName}${link.targetName}`];
Expand Down
Loading

0 comments on commit 061e27b

Please sign in to comment.