Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render AWS account icon for Identity Center account app #50256

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/packages/design/src/ResourceIcon/assets/aws-account.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions web/packages/design/src/ResourceIcon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -333,6 +334,7 @@ export {
avalara,
awsDark,
awsLight,
awsAccount,
azure,
bill,
bonusly,
Expand Down
1 change: 1 addition & 0 deletions web/packages/design/src/ResourceIcon/resourceIconSpecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(),
Expand Down
Loading