Skip to content

Commit

Permalink
[GEN-1967]: fix sources drawer data (amir notes) (#1964)
Browse files Browse the repository at this point in the history
This pull request includes changes to the
`frontend/webapp/containers/main/sources/source-drawer-container/build-card.ts`
and
`frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx`
files to improve the handling of K8s resource names and programming
languages in the UI.

Improvements to K8s resource handling:

*
[`frontend/webapp/containers/main/sources/source-drawer-container/build-card.ts`](diffhunk://#diff-cb6d6db1043b26cf6943287238629b963a8cf5b97491e3814c2cd52454cc7e1dL6-R11):
Removed unnecessary destructuring of `instrumentedApplicationDetails`
and added a tooltip to the `name` field in the data card.

Enhancements to programming language display:

*
[`frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx`](diffhunk://#diff-ce146776b402d3e7c41f2ebb82b32a2b8636ec73200d70a6f30f0f08dc1da6d0L90-R94):
Updated the subtitle to display 'Node.js' for JavaScript workloads and
improved the formatting of the runtime version display.
  • Loading branch information
BenElferink authored Dec 10, 2024
1 parent c3eb411 commit 99cdc01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ import type { K8sActualSource } from '@/types';
import { DataCardRow } from '@/reuseable-components';

const buildCard = (source: K8sActualSource) => {
const { name, kind, namespace, instrumentedApplicationDetails } = source;
const { containerName, language } = instrumentedApplicationDetails?.containers?.[0] || {};
const { name, kind, namespace } = source;

const arr: DataCardRow[] = [
{ title: DISPLAY_TITLES.NAMESPACE, value: namespace },
{ title: DISPLAY_TITLES.KIND, value: kind },
{ title: DISPLAY_TITLES.CONTAINER_NAME, value: containerName },
{ title: DISPLAY_TITLES.NAME, value: name },
{ title: DISPLAY_TITLES.LANGUAGE, value: language },
{ title: DISPLAY_TITLES.NAME, value: name, tooltip: 'K8s resource name' },
];

return arr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ const renderValue = (type: DataCardRow['type'], value: DataCardRow['value']) =>
});

return (
<DataTab title={containerName} subTitle={`${capitalizeFirstLetter(language)} • Runtime: ${runtimeVersion}`} logo={getProgrammingLanguageIcon(language)}>
<DataTab
title={containerName}
subTitle={`${language === WORKLOAD_PROGRAMMING_LANGUAGES.JAVASCRIPT ? 'Node.js' : capitalizeFirstLetter(language)} • Runtime Version: ${runtimeVersion}`}
logo={getProgrammingLanguageIcon(language)}
>
<InstrumentStatus language={language} />
</DataTab>
);
Expand Down

0 comments on commit 99cdc01

Please sign in to comment.