From 04ec295c192b138010f778ef3ed71d65174eaa99 Mon Sep 17 00:00:00 2001 From: Jacek Kolasa Date: Tue, 23 Aug 2022 16:38:21 +0200 Subject: [PATCH] Remove protobuf notification (#440) * remove protobuf notification * 2.28.6 * fix warnings --- package-lock.json | 2 +- package.json | 2 +- src/components/header/index.js | 2 - src/components/header/protoBuf/dropdown.js | 15 ---- src/components/header/protoBuf/index.js | 83 ------------------- .../components/lib-charts/dygraph-chart.tsx | 3 +- src/domains/global/selectors.ts | 4 - 7 files changed, 3 insertions(+), 108 deletions(-) delete mode 100644 src/components/header/protoBuf/dropdown.js delete mode 100644 src/components/header/protoBuf/index.js diff --git a/package-lock.json b/package-lock.json index f11ba0eb..b7e9458f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@netdata/dashboard", - "version": "2.28.5", + "version": "2.28.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45d1d2ac..2fc7ab2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netdata/dashboard", - "version": "2.28.5", + "version": "2.28.6", "homepage": ".", "main": "./lib/src/index-npm.js", "files": [ diff --git a/src/components/header/index.js b/src/components/header/index.js index 3fc3a615..122dd9ea 100644 --- a/src/components/header/index.js +++ b/src/components/header/index.js @@ -3,7 +3,6 @@ import styled from "styled-components" import { Flex, Box } from "@netdata/netdata-ui" import Node from "./node" import Options from "./options" -import ProtoBuf from "./protoBuf" import Version from "./version" import GlobalControls from "./globalControls" import Alarms from "./alarms" @@ -35,7 +34,6 @@ const Header = () => ( - diff --git a/src/components/header/protoBuf/dropdown.js b/src/components/header/protoBuf/dropdown.js deleted file mode 100644 index 39f663bd..00000000 --- a/src/components/header/protoBuf/dropdown.js +++ /dev/null @@ -1,15 +0,0 @@ -import styled from "styled-components" -import { Flex } from "@netdata/netdata-ui" - -const Dropdown = styled(Flex).attrs({ - padding: [4], - background: "dropdown", - round: 1, - overflow: { vertical: "auto" }, - margin: [4, 0, 0], - width: 110, -})` - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); -` - -export default Dropdown diff --git a/src/components/header/protoBuf/index.js b/src/components/header/protoBuf/index.js deleted file mode 100644 index f2ed5d45..00000000 --- a/src/components/header/protoBuf/index.js +++ /dev/null @@ -1,83 +0,0 @@ -import styled from "styled-components" -import React, { useRef } from "react" -import { useMedia, useToggle } from "react-use" -import { Drop, Flex, Icon, Pill, Text } from "@netdata/netdata-ui" -import { useSelector } from "store/redux-separate-context" -import { selectLacksProtoBufSupport } from "domains/global/selectors" - -import Dropdown from "./dropdown" - -const PillContainer = styled(Flex)` - white-space: nowrap; -` - -const Link = styled(Text).attrs({ as: "a", color: "success", target: "_blank" })`` - -const breakpoint = "(min-width: 1400px)" - -const ProtoBuf = () => { - const [isOpen, toggle] = useToggle() - const lacksProtoBufSupport = useSelector(selectLacksProtoBufSupport) - - const ref = useRef() - - const isLargeEnough = useMedia(breakpoint) - - const close = () => { - toggle(false) - } - if (!lacksProtoBufSupport) return null - - return ( - - - - {isLargeEnough ? "NOT MONITORED IN CLOUD" : ""} - - - {ref.current && isOpen && ( - - - - - - - - - - - It will not be possible to monitor this node from Netdata Cloud after 1st of - March.

- This node does not have proto-buf support. In order to learn how to apply - proto-buf support to your nodes{" "} - - read our documentation. - -
-
If you are not interested in monitoring this node from Netdata Cloud, you - can{" "} - - unclaim it. - -
-
-
-
-
- )} -
- ) -} - -export default ProtoBuf diff --git a/src/domains/chart/components/lib-charts/dygraph-chart.tsx b/src/domains/chart/components/lib-charts/dygraph-chart.tsx index 6e0ea7f8..c82cd611 100644 --- a/src/domains/chart/components/lib-charts/dygraph-chart.tsx +++ b/src/domains/chart/components/lib-charts/dygraph-chart.tsx @@ -15,7 +15,6 @@ import { DygraphArea, NetdataDygraph } from "types/vendor-overrides" import { TimeRange } from "types/common" import { useDateTime } from "utils/date-time" import { debounce } from "utils/debounce" -import { hasHashParam } from "utils/hash-utils" import { selectCommonMin, @@ -748,7 +747,7 @@ export const DygraphChart = ({ const w = g.toDomCoords(g.xAxisRange()[1], null)[0] - axisAfterOffset // Percentage from the left. - return w == 0 ? 0 : x / w + return w === 0 ? 0 : x / w } const normalDef = diff --git a/src/domains/global/selectors.ts b/src/domains/global/selectors.ts index 89f69cab..a823bf09 100644 --- a/src/domains/global/selectors.ts +++ b/src/domains/global/selectors.ts @@ -90,10 +90,6 @@ export const selectIsCloudEnabled = createSelector( ) export const selectHasFetchedInfo = createSelector(selectRegistry, prop("hasFetchedInfo")) export const selectFullInfoPayload = createSelector(selectRegistry, prop("fullInfoPayload")) -export const selectLacksProtoBufSupport = createSelector( - selectFullInfoPayload, - info => info["agent-claimed"] && !info["aclk-ng-new-cloud-protocol"] -) export const selectHasStartedAlarms = createSelector( selectGlobal,