From f55257a110df8bdb7d678bfb367c96478a212992 Mon Sep 17 00:00:00 2001
From: Yassine Bounekhla <56373201+rudream@users.noreply.github.com>
Date: Tue, 21 Jan 2025 10:21:33 -0500
Subject: [PATCH] update process-icons script to delete stale Icons (#51245)
---
.../design/src/Icon/Icons/CSSVisa.tsx | 33 ------
.../design/src/Icon/Icons/Equalizer.tsx | 42 -------
.../src/Icon/Icons/EqualizerVertical.tsx | 51 ---------
.../design/src/Icon/Icons/Fingerprint.tsx | 103 ------------------
.../design/src/Icon/Icons/Hometemp.tsx | 37 -------
.../design/src/Icon/Icons/InfoFilled.tsx | 33 ------
.../design/src/Icon/Icons/MobileCamera.tsx | 67 ------------
web/packages/design/src/Icon/Icons/Person.tsx | 37 -------
.../design/src/Icon/Icons/PersonAdd.tsx | 38 -------
web/packages/design/src/Icon/script/script.js | 8 ++
.../teleport/src/DeviceTrust/EmptyList.tsx | 13 ++-
11 files changed, 17 insertions(+), 445 deletions(-)
delete mode 100644 web/packages/design/src/Icon/Icons/CSSVisa.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/Equalizer.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/EqualizerVertical.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/Fingerprint.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/Hometemp.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/InfoFilled.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/MobileCamera.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/Person.tsx
delete mode 100644 web/packages/design/src/Icon/Icons/PersonAdd.tsx
diff --git a/web/packages/design/src/Icon/Icons/CSSVisa.tsx b/web/packages/design/src/Icon/Icons/CSSVisa.tsx
deleted file mode 100644
index 01a5c148e061c..0000000000000
--- a/web/packages/design/src/Icon/Icons/CSSVisa.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function CSSVisa({ size = 24, color, ...otherProps }: IconProps) {
- return (
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/Equalizer.tsx b/web/packages/design/src/Icon/Icons/Equalizer.tsx
deleted file mode 100644
index 9d7acaff68376..0000000000000
--- a/web/packages/design/src/Icon/Icons/Equalizer.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function Equalizer({ size = 24, color, ...otherProps }: IconProps) {
- return (
-
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/EqualizerVertical.tsx b/web/packages/design/src/Icon/Icons/EqualizerVertical.tsx
deleted file mode 100644
index 7f113fdbf2505..0000000000000
--- a/web/packages/design/src/Icon/Icons/EqualizerVertical.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function EqualizerVertical({
- size = 24,
- color,
- ...otherProps
-}: IconProps) {
- return (
-
-
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/Fingerprint.tsx b/web/packages/design/src/Icon/Icons/Fingerprint.tsx
deleted file mode 100644
index 6ed2278a6d6b0..0000000000000
--- a/web/packages/design/src/Icon/Icons/Fingerprint.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-/* MIT License
-
-Copyright (c) 2020 Phosphor Icons
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-*/
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function Fingerprint({ size = 24, color, ...otherProps }: IconProps) {
- return (
-
-
-
-
-
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/Hometemp.tsx b/web/packages/design/src/Icon/Icons/Hometemp.tsx
deleted file mode 100644
index a05c80d7e06b1..0000000000000
--- a/web/packages/design/src/Icon/Icons/Hometemp.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { SVGIcon, SVGIconProps } from 'design/SVGIcon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function Home({ size = 24, fill, ...otherProps }: SVGIconProps) {
- return (
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/InfoFilled.tsx b/web/packages/design/src/Icon/Icons/InfoFilled.tsx
deleted file mode 100644
index 3dafd7bd73f36..0000000000000
--- a/web/packages/design/src/Icon/Icons/InfoFilled.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { SVGIcon, SVGIconProps } from 'design/SVGIcon';
-
-export function InfoFilled({ size = 24, fill }: SVGIconProps) {
- return (
-
-
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/MobileCamera.tsx b/web/packages/design/src/Icon/Icons/MobileCamera.tsx
deleted file mode 100644
index 90b141468ea83..0000000000000
--- a/web/packages/design/src/Icon/Icons/MobileCamera.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-/* MIT License
-
-Copyright (c) 2020 Phosphor Icons
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-*/
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function MobileCamera({ size = 24, color, ...otherProps }: IconProps) {
- return (
-
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/Person.tsx b/web/packages/design/src/Icon/Icons/Person.tsx
deleted file mode 100644
index 8347867a5a595..0000000000000
--- a/web/packages/design/src/Icon/Icons/Person.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function Person({ size = 24, color, ...otherProps }: IconProps) {
- return (
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/Icons/PersonAdd.tsx b/web/packages/design/src/Icon/Icons/PersonAdd.tsx
deleted file mode 100644
index 5f10a67bc2ca0..0000000000000
--- a/web/packages/design/src/Icon/Icons/PersonAdd.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Teleport
- * Copyright (C) 2023 Gravitational, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { Icon, IconProps } from '../Icon';
-
-/*
-
-THIS FILE IS GENERATED. DO NOT EDIT.
-
-*/
-
-export function PersonAdd({ size = 24, color, ...otherProps }: IconProps) {
- return (
-
-
-
-
- );
-}
diff --git a/web/packages/design/src/Icon/script/script.js b/web/packages/design/src/Icon/script/script.js
index 892025e94a7b5..2c7bd08de515e 100644
--- a/web/packages/design/src/Icon/script/script.js
+++ b/web/packages/design/src/Icon/script/script.js
@@ -77,6 +77,14 @@ function processSVGFiles() {
return;
}
+ // Before generating Icon components, delete all the existing ones. This is to prevent Icon components for now-deleted SVG files from persisting.
+ const iconComponentsDir = path.join(basePath, '/Icons/');
+ const files = fs.readdirSync(iconComponentsDir);
+ for (const file of files) {
+ const filePath = path.join(iconComponentsDir, file);
+ fs.unlinkSync(filePath);
+ }
+
svgFiles.forEach(svgFile => {
const svgFilePath = path.join(svgAssetsPath, svgFile);
createIconComponent(svgFilePath);
diff --git a/web/packages/teleport/src/DeviceTrust/EmptyList.tsx b/web/packages/teleport/src/DeviceTrust/EmptyList.tsx
index 3b2dcc43a6e0b..95c6fb3fa323b 100644
--- a/web/packages/teleport/src/DeviceTrust/EmptyList.tsx
+++ b/web/packages/teleport/src/DeviceTrust/EmptyList.tsx
@@ -34,8 +34,13 @@ import {
Text,
} from 'design';
import Table from 'design/DataTable';
-import { Cross, FingerprintSimple, Password, UsbDrive } from 'design/Icon';
-import { MobileCamera } from 'design/Icon/Icons/MobileCamera';
+import {
+ Cross,
+ DeviceMobileCamera,
+ FingerprintSimple,
+ Password,
+ UsbDrive,
+} from 'design/Icon';
import {
DetailsTab,
FeatureContainer,
@@ -163,7 +168,7 @@ export const EmptyList = ({
-
+
@@ -397,7 +402,7 @@ const AccessDeniedCard = () => {
border-radius: ${p => p.theme.radii[3]}px;
`}
>
-
+