Skip to content

Commit

Permalink
[fix] add cloud icon behind name instead of basic info in resource de…
Browse files Browse the repository at this point in the history
…tail (#82)

* fix(resource-detail): fix crash when there's no ancestors

* fix(resource-detail): place cloud icon before name
  • Loading branch information
sijav authored Jan 24, 2024
1 parent 937b5f1 commit 7709390
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 44 deletions.
32 changes: 16 additions & 16 deletions src/locales/de-DE/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ msgstr "In wenigen Minuten bis zum ersten Ergebnis"
msgid "Access to your account is broken"
msgstr "Der Zugriff auf Ihr Konto ist unterbrochen"

#: src/pages/panel/inventory/ResourceDetail.tsx:219
#: src/pages/panel/inventory/ResourceDetail.tsx:213
msgid "Account"
msgstr "Konto"

Expand Down Expand Up @@ -119,7 +119,7 @@ msgstr "Konten hinzugefügt"
msgid "Advanced integration for top-tier security needs and IaC support."
msgstr "Erweiterte Integration für höchste Sicherheitsanforderungen und IaC-Unterstützung."

#: src/pages/panel/inventory/ResourceDetail.tsx:228
#: src/pages/panel/inventory/ResourceDetail.tsx:222
msgid "Age"
msgstr "Alter"

Expand Down Expand Up @@ -186,7 +186,7 @@ msgstr "AWS Marketplace wurde erfolgreich abonniert"
msgid "Basic asset inventory"
msgstr "Grundlegende Vermögensinventur"

#: src/pages/panel/inventory/ResourceDetail.tsx:195
#: src/pages/panel/inventory/ResourceDetail.tsx:198
msgid "Basic Information"
msgstr "Grundinformation"

Expand Down Expand Up @@ -235,7 +235,7 @@ msgstr "Wählen Sie Arbeitsbereich"
#: src/pages/panel/accounts/AccountsTableRecentlyAdded.tsx:36
#: src/pages/panel/accounts/AccountsTableUnconfigured.tsx:36
#: src/pages/panel/home/AccountCard.tsx:33
#: src/pages/panel/inventory/ResourceDetail.tsx:206
#: src/pages/panel/inventory/ResourceDetail.tsx:209
msgid "Cloud"
msgstr "Cloud"

Expand Down Expand Up @@ -286,7 +286,7 @@ msgstr "In die Zwischenablage kopiert!"
msgid "Copy"
msgstr "Kopieren"

#: src/pages/panel/inventory/ResourceDetail.tsx:222
#: src/pages/panel/inventory/ResourceDetail.tsx:216
msgid "Created Time"
msgstr "Erstellte Zeit"

Expand Down Expand Up @@ -352,7 +352,7 @@ msgstr "Deploy Stack"
msgid "Description"
msgstr "Beschreibung"

#: src/pages/panel/inventory/ResourceDetail.tsx:289
#: src/pages/panel/inventory/ResourceDetail.tsx:283
msgid "Details"
msgstr "Einzelheiten"

Expand Down Expand Up @@ -498,7 +498,7 @@ msgstr "Wie repariert man"
#: src/pages/panel/accounts/AccountsTableRecentlyAdded.tsx:39
#: src/pages/panel/accounts/AccountsTableUnconfigured.tsx:39
#: src/pages/panel/home/AccountCard.tsx:30
#: src/pages/panel/inventory/ResourceDetail.tsx:203
#: src/pages/panel/inventory/ResourceDetail.tsx:206
msgid "ID"
msgstr "ID"

Expand Down Expand Up @@ -545,7 +545,7 @@ msgstr "Externen Benutzer einladen"
msgid "Invites"
msgstr "Lädt ein"

#: src/pages/panel/inventory/ResourceDetail.tsx:202
#: src/pages/panel/inventory/ResourceDetail.tsx:205
msgid "Kind"
msgstr "Art"

Expand Down Expand Up @@ -607,7 +607,7 @@ msgstr "Am meisten verbesserte Ressourcen"
#: src/pages/panel/accounts/AccountsTableItem.tsx:42
#: src/pages/panel/accounts/AccountsTableRecentlyAdded.tsx:42
#: src/pages/panel/accounts/AccountsTableUnconfigured.tsx:42
#: src/pages/panel/inventory/ResourceDetail.tsx:204
#: src/pages/panel/inventory/ResourceDetail.tsx:207
#: src/pages/panel/workspace-settings-external-directory/AddExternalDirectory.tsx:42
#: src/pages/panel/workspace-settings-external-directory/AddExternalDirectory.tsx:46
#: src/pages/panel/workspace-settings-external-directory/WorkspaceSettingsExternalDirectoryPage.tsx:20
Expand Down Expand Up @@ -677,7 +677,7 @@ msgstr "Hoppla! Etwas ist schief gelaufen."
msgid "Open drawer"
msgstr "Öffene die Schublade"

#: src/pages/panel/inventory/ResourceDetail.tsx:237
#: src/pages/panel/inventory/ResourceDetail.tsx:231
msgid "Open resource {name} in AWS Console"
msgstr "Öffnen Sie die Ressource {name} in der AWS-Konsole"

Expand Down Expand Up @@ -760,7 +760,7 @@ msgstr "Kürzlich hinzugefügte Konten"
msgid "Regenerate"
msgstr "Regenerieren"

#: src/pages/panel/inventory/ResourceDetail.tsx:220
#: src/pages/panel/inventory/ResourceDetail.tsx:214
msgid "Region"
msgstr "Region"

Expand Down Expand Up @@ -805,7 +805,7 @@ msgstr "Scanfrequenz"
msgid "Secure read-only access"
msgstr "Sicherer Lesezugriff"

#: src/pages/panel/inventory/ResourceDetail.tsx:309
#: src/pages/panel/inventory/ResourceDetail.tsx:303
msgid "Security Issues"
msgstr "Sicherheitsprobleme"

Expand All @@ -822,8 +822,8 @@ msgstr "Sicherheitsbewertung"
msgid "Security Tier"
msgstr "Sicherheitsstufe"

#: src/pages/panel/inventory/ResourceDetail.tsx:248
#: src/pages/panel/inventory/ResourceDetail.tsx:259
#: src/pages/panel/inventory/ResourceDetail.tsx:242
#: src/pages/panel/inventory/ResourceDetail.tsx:253
msgid "See this Resource in AWS Console"
msgstr "Sehen Sie sich diese Ressource in der AWS-Konsole an"

Expand Down Expand Up @@ -871,7 +871,7 @@ msgid "Successfully invited {email}"
msgstr "{email} erfolgreich eingeladen"

#: src/pages/panel/inventory/InventoryTagAutoComplete.tsx:86
#: src/pages/panel/inventory/ResourceDetail.tsx:275
#: src/pages/panel/inventory/ResourceDetail.tsx:269
msgid "Tags"
msgstr "Stichworte"

Expand All @@ -895,7 +895,7 @@ msgstr "Hiermit wird ein CloudFormation-Stack bereitgestellt, der eine neue IAM
msgid "Tier"
msgstr "Stufe"

#: src/pages/panel/inventory/ResourceDetail.tsx:254
#: src/pages/panel/inventory/ResourceDetail.tsx:248
msgid "To access this resource, please ensure that you are logged into the AWS account: {account}"
msgstr "Um auf diese Ressource zuzugreifen, stellen Sie bitte sicher, dass Sie beim AWS-Konto angemeldet sind: {account}"

Expand Down
32 changes: 16 additions & 16 deletions src/locales/en-US/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ msgstr "A few minutes to first results"
msgid "Access to your account is broken"
msgstr "Access to your account is broken"

#: src/pages/panel/inventory/ResourceDetail.tsx:219
#: src/pages/panel/inventory/ResourceDetail.tsx:213
msgid "Account"
msgstr "Account"

Expand Down Expand Up @@ -119,7 +119,7 @@ msgstr "Added accounts"
msgid "Advanced integration for top-tier security needs and IaC support."
msgstr "Advanced integration for top-tier security needs and IaC support."

#: src/pages/panel/inventory/ResourceDetail.tsx:228
#: src/pages/panel/inventory/ResourceDetail.tsx:222
msgid "Age"
msgstr "Age"

Expand Down Expand Up @@ -186,7 +186,7 @@ msgstr "AWS Marketplace has been successfully subscribed"
msgid "Basic asset inventory"
msgstr "Basic asset inventory"

#: src/pages/panel/inventory/ResourceDetail.tsx:195
#: src/pages/panel/inventory/ResourceDetail.tsx:198
msgid "Basic Information"
msgstr "Basic Information"

Expand Down Expand Up @@ -235,7 +235,7 @@ msgstr "Choose Workspace"
#: src/pages/panel/accounts/AccountsTableRecentlyAdded.tsx:36
#: src/pages/panel/accounts/AccountsTableUnconfigured.tsx:36
#: src/pages/panel/home/AccountCard.tsx:33
#: src/pages/panel/inventory/ResourceDetail.tsx:206
#: src/pages/panel/inventory/ResourceDetail.tsx:209
msgid "Cloud"
msgstr "Cloud"

Expand Down Expand Up @@ -286,7 +286,7 @@ msgstr "Copied to Clipboard!"
msgid "Copy"
msgstr "Copy"

#: src/pages/panel/inventory/ResourceDetail.tsx:222
#: src/pages/panel/inventory/ResourceDetail.tsx:216
msgid "Created Time"
msgstr "Created Time"

Expand Down Expand Up @@ -352,7 +352,7 @@ msgstr "Deploy Stack"
msgid "Description"
msgstr "Description"

#: src/pages/panel/inventory/ResourceDetail.tsx:289
#: src/pages/panel/inventory/ResourceDetail.tsx:283
msgid "Details"
msgstr "Details"

Expand Down Expand Up @@ -498,7 +498,7 @@ msgstr "How to fix"
#: src/pages/panel/accounts/AccountsTableRecentlyAdded.tsx:39
#: src/pages/panel/accounts/AccountsTableUnconfigured.tsx:39
#: src/pages/panel/home/AccountCard.tsx:30
#: src/pages/panel/inventory/ResourceDetail.tsx:203
#: src/pages/panel/inventory/ResourceDetail.tsx:206
msgid "ID"
msgstr "ID"

Expand Down Expand Up @@ -545,7 +545,7 @@ msgstr "Invite External User"
msgid "Invites"
msgstr "Invites"

#: src/pages/panel/inventory/ResourceDetail.tsx:202
#: src/pages/panel/inventory/ResourceDetail.tsx:205
msgid "Kind"
msgstr "Kind"

Expand Down Expand Up @@ -607,7 +607,7 @@ msgstr "Most Improved Resources"
#: src/pages/panel/accounts/AccountsTableItem.tsx:42
#: src/pages/panel/accounts/AccountsTableRecentlyAdded.tsx:42
#: src/pages/panel/accounts/AccountsTableUnconfigured.tsx:42
#: src/pages/panel/inventory/ResourceDetail.tsx:204
#: src/pages/panel/inventory/ResourceDetail.tsx:207
#: src/pages/panel/workspace-settings-external-directory/AddExternalDirectory.tsx:42
#: src/pages/panel/workspace-settings-external-directory/AddExternalDirectory.tsx:46
#: src/pages/panel/workspace-settings-external-directory/WorkspaceSettingsExternalDirectoryPage.tsx:20
Expand Down Expand Up @@ -677,7 +677,7 @@ msgstr "Oops! Something went wrong."
msgid "Open drawer"
msgstr "Open drawer"

#: src/pages/panel/inventory/ResourceDetail.tsx:237
#: src/pages/panel/inventory/ResourceDetail.tsx:231
msgid "Open resource {name} in AWS Console"
msgstr "Open resource {name} in AWS Console"

Expand Down Expand Up @@ -760,7 +760,7 @@ msgstr "Recently added accounts"
msgid "Regenerate"
msgstr "Regenerate"

#: src/pages/panel/inventory/ResourceDetail.tsx:220
#: src/pages/panel/inventory/ResourceDetail.tsx:214
msgid "Region"
msgstr "Region"

Expand Down Expand Up @@ -805,7 +805,7 @@ msgstr "Scan frequency"
msgid "Secure read-only access"
msgstr "Secure read-only access"

#: src/pages/panel/inventory/ResourceDetail.tsx:309
#: src/pages/panel/inventory/ResourceDetail.tsx:303
msgid "Security Issues"
msgstr "Security Issues"

Expand All @@ -822,8 +822,8 @@ msgstr "Security Score"
msgid "Security Tier"
msgstr "Security Tier"

#: src/pages/panel/inventory/ResourceDetail.tsx:248
#: src/pages/panel/inventory/ResourceDetail.tsx:259
#: src/pages/panel/inventory/ResourceDetail.tsx:242
#: src/pages/panel/inventory/ResourceDetail.tsx:253
msgid "See this Resource in AWS Console"
msgstr "See this Resource in AWS Console"

Expand Down Expand Up @@ -871,7 +871,7 @@ msgid "Successfully invited {email}"
msgstr "Successfully invited {email}"

#: src/pages/panel/inventory/InventoryTagAutoComplete.tsx:86
#: src/pages/panel/inventory/ResourceDetail.tsx:275
#: src/pages/panel/inventory/ResourceDetail.tsx:269
msgid "Tags"
msgstr "Tags"

Expand All @@ -895,7 +895,7 @@ msgstr "This will deploy a CloudFormation stack that creates a new IAM role in y
msgid "Tier"
msgstr "Tier"

#: src/pages/panel/inventory/ResourceDetail.tsx:254
#: src/pages/panel/inventory/ResourceDetail.tsx:248
msgid "To access this resource, please ensure that you are logged into the AWS account: {account}"
msgstr "To access this resource, please ensure that you are logged into the AWS account: {account}"

Expand Down
17 changes: 5 additions & 12 deletions src/pages/panel/inventory/ResourceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
AccordionDetails,
AccordionSummary,
Alert,
Box,
Button,
Divider,
Grid,
Expand Down Expand Up @@ -178,7 +177,10 @@ export const ResourceDetail = ({ detail, onClose }: ResourceDetailProps) => {
p={1}
boxShadow={1}
>
<Box flex={1}>{typeof selectedRow.row['name'] === 'object' ? '' : selectedRow.row['name']}</Box>
<Stack direction="row" alignItems="center" gap={1} flex={1}>
{cloud !== '-' ? <CloudAvatar cloud={cloud} /> : null}
{typeof selectedRow.row['name'] === 'object' ? '' : selectedRow.row['name']}
</Stack>
<IconButton onClick={onClose}>
<CloseIcon />
</IconButton>
Expand All @@ -204,16 +206,7 @@ export const ResourceDetail = ({ detail, onClose }: ResourceDetailProps) => {
<GridItem property={<Trans>Name</Trans>} value={name} />
<GridItem
property={<Trans>Cloud</Trans>}
value={
cloud !== '-' ? (
<Stack direction="row" spacing={2} alignItems="center">
<CloudAvatar cloud={cloud} />
<Typography>{cloud.toUpperCase()}</Typography>
</Stack>
) : (
'-'
)
}
value={cloud !== '-' ? <Typography>{cloud.toUpperCase()}</Typography> : '-'}
isReactNode={cloud !== '-'}
/>
<GridItem property={<Trans>Account</Trans>} value={account} />
Expand Down

0 comments on commit 7709390

Please sign in to comment.