From 73fd06778643106a33ef856e18afd9c51e477fbb Mon Sep 17 00:00:00 2001 From: Sakshyam Shah Date: Mon, 16 Dec 2024 14:17:54 -0500 Subject: [PATCH] [v17] render AWS account icon for Identity Center account app (#50284) * aws account icon for identity center account app * remove svg class --- .../design/src/ResourceIcon/assets/aws-account.svg | 6 ++++++ web/packages/design/src/ResourceIcon/icons.ts | 2 ++ web/packages/design/src/ResourceIcon/resourceIconSpecs.ts | 1 + .../components/UnifiedResources/shared/guessAppIcon.ts | 7 ++++++- 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 web/packages/design/src/ResourceIcon/assets/aws-account.svg diff --git a/web/packages/design/src/ResourceIcon/assets/aws-account.svg b/web/packages/design/src/ResourceIcon/assets/aws-account.svg new file mode 100644 index 0000000000000..7495e38130bd0 --- /dev/null +++ b/web/packages/design/src/ResourceIcon/assets/aws-account.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/web/packages/design/src/ResourceIcon/icons.ts b/web/packages/design/src/ResourceIcon/icons.ts index 8595076221a6c..69656120a82b8 100644 --- a/web/packages/design/src/ResourceIcon/icons.ts +++ b/web/packages/design/src/ResourceIcon/icons.ts @@ -47,6 +47,7 @@ import auth0Light from './assets/auth0-light.svg'; import avalara from './assets/avalara.svg'; import awsDark from './assets/aws-dark.svg'; import awsLight from './assets/aws-light.svg'; +import awsAccount from './assets/aws-account.svg'; import azure from './assets/azure.svg'; import bill from './assets/bill.svg'; import bonusly from './assets/bonusly.svg'; @@ -333,6 +334,7 @@ export { avalara, awsDark, awsLight, + awsAccount, azure, bill, bonusly, diff --git a/web/packages/design/src/ResourceIcon/resourceIconSpecs.ts b/web/packages/design/src/ResourceIcon/resourceIconSpecs.ts index 80007e3a1e4c8..17ffe26bbdaeb 100644 --- a/web/packages/design/src/ResourceIcon/resourceIconSpecs.ts +++ b/web/packages/design/src/ResourceIcon/resourceIconSpecs.ts @@ -59,6 +59,7 @@ export const resourceIconSpecs = { auth0: { dark: i.auth0Dark, light: i.auth0Light }, avalara: forAllThemes(i.avalara), aws: { dark: i.awsDark, light: i.awsLight }, + awsaccount: forAllThemes(i.awsAccount), azure: forAllThemes(i.azure), bill: forAllThemes(i.bill), diff --git a/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts b/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts index b49ffc816da0d..6124b7edc67ed 100644 --- a/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts +++ b/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts @@ -22,10 +22,12 @@ import { iconNames, } from 'design/ResourceIcon'; +import { AppSubKind } from 'teleport/services/apps'; + import { UnifiedResourceApp } from '../types'; export function guessAppIcon(resource: UnifiedResourceApp): ResourceIconName { - const { awsConsole = false, name, friendlyName, labels } = resource; + const { awsConsole = false, name, friendlyName, labels, subKind } = resource; // Label matching takes precedence and we can assume it can be a direct lookup // since we expect a certain format. @@ -41,6 +43,9 @@ export function guessAppIcon(resource: UnifiedResourceApp): ResourceIconName { if (awsConsole) { return 'aws'; } + if (subKind === AppSubKind.AwsIcAccount) { + return 'awsaccount'; + } const app = { name: withoutWhiteSpaces(name)?.toLocaleLowerCase(),