From 7cc50c4ae6b33eed5bdbe639d7a8bda18c782b81 Mon Sep 17 00:00:00 2001 From: Asmaa Nabil Date: Tue, 7 Nov 2023 20:41:48 +0200 Subject: [PATCH] fix duplicate icons (#3846) * fix duplicate icons * policy icon size * fix audit icon size * update icon * refactor: refactor away from deprecated wait.Poll calls With the update, some other calls had to be updated: - `NewDiscoveryRESTMapper` expects an extra `HTTPClient` argument - `client` does not have `NewDelegatingClient` anymore, instead we can create the same resource with `client.New(...)` Resolves #3812 References: - https://github.com/weaveworks/weave-gitops/issues/3812 - https://github.com/kubernetes-sigs/controller-runtime/pull/2150 - https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0 Signed-off-by: Balazs Nadasdi * try to update github.com/fluxcd/pkg/runtime to the earliest version with updated controller-runtime Signed-off-by: Balazs Nadasdi * Cleanup datatable (#4091) * cleanup datatable * sort filtered items by `sortValue || value` * Update pkg/run/session/connect/connect.go Co-authored-by: Yiannis Triantafyllopoulos <8741709+yiannistri@users.noreply.github.com> * Refactoring Status column (#4098) * fix: Remove GitOps Run CLI commands * Replace the Sync/Suspend/Resume controls, used in the `SyncActions` and `CheckboxActions` components, with the new Sync/Suspend/Resume controls (the `SyncControl` component) (#4080) * Create the new `SyncControls` component for Sync/Suspend/Resume controls. * Move all components, related to syncing and suspending objects (existing `SyncActions` and `CheckboxActions` and new `SyncControls` and `ResumeIcon`), to the `Sync` folder. * Update the related UI snapshot. * Add `SyncControls` to exports. * Move custom actions to the start (left) of `SyncControls` buttons. * Re-arrange icons in `IconType` alphabetically. * add new svg icon as CLusterDiscovery icon * fix typo * update import order * build(deps): Bump google.golang.org/grpc from 1.51.0 to 1.56.3 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.51.0 to 1.56.3. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.51.0...v1.56.3) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production ... Signed-off-by: dependabot[bot] * build(deps): Bump github.com/weaveworks/tf-controller/api version * build(deps): Bump postcss from 8.4.21 to 8.4.31 in /website Bumps [postcss](https://github.com/postcss/postcss) from 8.4.21 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.21...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] * chore: Remove GitOps Run components * build(deps): Remove gitops bucket server from build * chore: Remove unused code previously used for GitOps Run * build(deps): Bump @babel/traverse from 7.20.13 to 7.23.2 in /website Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.13 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] * fix duplicate icons * remove extra space --------- Signed-off-by: Balazs Nadasdi Signed-off-by: dependabot[bot] Co-authored-by: Joshua Israel Co-authored-by: Balazs Nadasdi Co-authored-by: a.shabaan Co-authored-by: Yiannis Triantafyllopoulos <8741709+yiannistri@users.noreply.github.com> Co-authored-by: Luiz Filho Co-authored-by: yiannis Co-authored-by: opudrovs Co-authored-by: ahussein3 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ui/components/Icon.tsx | 5 ++- ui/components/NavIcons/PoliciesIcon.tsx | 39 ++++++++++++--------- ui/components/Policies/Utils/PolicyMode.tsx | 4 +-- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/ui/components/Icon.tsx b/ui/components/Icon.tsx index 8012463060..6636375320 100644 --- a/ui/components/Icon.tsx +++ b/ui/components/Icon.tsx @@ -24,7 +24,6 @@ import NavigateNextIcon from "@material-ui/icons/NavigateNext"; import PauseIcon from "@material-ui/icons/Pause"; import PersonIcon from "@material-ui/icons/Person"; import PlayIcon from "@material-ui/icons/PlayArrow"; -import Policy from "@material-ui/icons/Policy"; import Remove from "@material-ui/icons/Remove"; import RemoveCircleIcon from "@material-ui/icons/RemoveCircle"; import SaveAltIcon from "@material-ui/icons/SaveAlt"; @@ -266,10 +265,10 @@ function getIcon(i: IconType) { return PlayIcon; case IconType.PoliciesIcon: - return PoliciesIcon; + return () => ; case IconType.Policy: - return Policy; + return () => ; case IconType.PolicyConfigsIcon: return PolicyConfigsIcon; diff --git a/ui/components/NavIcons/PoliciesIcon.tsx b/ui/components/NavIcons/PoliciesIcon.tsx index 4461964d62..52c319dd41 100644 --- a/ui/components/NavIcons/PoliciesIcon.tsx +++ b/ui/components/NavIcons/PoliciesIcon.tsx @@ -1,31 +1,36 @@ import * as React from "react"; - -function PoliciesIcon() { +import { useTheme } from "styled-components"; +function PoliciesIcon({ filled }) { + const theme = useTheme(); return ( - + + - - - + + diff --git a/ui/components/Policies/Utils/PolicyMode.tsx b/ui/components/Policies/Utils/PolicyMode.tsx index 02212ec61e..0d7c9ac747 100644 --- a/ui/components/Policies/Utils/PolicyMode.tsx +++ b/ui/components/Policies/Utils/PolicyMode.tsx @@ -17,14 +17,14 @@ const PolicyMode = ({ modeName, showName = false }: Props) => { case "audit": mode = { name: "audit", - icon: , + icon: , }; break; case "admission": mode = { name: "enforce", icon: ( - + ), }; break;