Skip to content
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
3 changes: 3 additions & 0 deletions libs/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
"Device applications table": "Device applications table",
"Ready": "Ready",
"Restarts": "Restarts",
"Embedded": "Embedded",
"Yes": "Yes",
"No": "No",
"No applications found": "No applications found",
"Reason": "Reason",
"Message": "Message",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ type ApplicationsTableProps = {
specApps: string[];
};

const emptyAppDetails: Partial<DeviceApplicationStatus> = {
name: '',
ready: '-',
restarts: 0,
embedded: false,
};

const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) => {
const { t } = useTranslation();

Expand All @@ -36,16 +43,18 @@ const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) =>
<Th modifier="wrap">{t('Ready')}</Th>
<Th modifier="wrap">{t('Restarts')}</Th>
<Th modifier="wrap">{t('Type')}</Th>
<Th modifier="wrap">{t('Embedded')}</Th>
</Tr>
</Thead>
<Tbody>
{allAppNames.map((appName) => {
const appDetails = appsStatus.find((app) => app.name === appName) || {
status: null,
ready: '-',
restarts: '-',
appType: null,
};
const appDetails = appsStatus.find((app) => app.name === appName) || emptyAppDetails;
let embedded = '-';
if (appDetails.embedded === true) {
embedded = t('Yes');
} else if (appDetails.embedded === false) {
embedded = t('No');
}

return (
<Tr key={appName}>
Expand All @@ -58,6 +67,7 @@ const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) =>
<Td dataLabel={t('Type')}>
{appDetails.appType ? <Label variant="outline">{appDetails.appType}</Label> : '-'}
</Td>
<Td dataLabel={t('Embedded')}>{embedded}</Td>
</Tr>
);
})}
Expand Down
4 changes: 2 additions & 2 deletions libs/ui-components/src/utils/status/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ApplicationsSummaryStatusType as AppSummaryStatus,
} from '@flightctl/types';
import { StatusItem } from './common';
import AsleepIcon from '@patternfly/react-icons/dist/js/icons/asleep-icon';
import { ResourcesEmptyIcon } from '@patternfly/react-icons/dist/js/icons/resources-empty-icon';

export const getApplicationSummaryStatusItems = (t: TFunction): StatusItem<AppSummaryStatus>[] => [
{
Expand All @@ -28,7 +28,7 @@ export const getApplicationSummaryStatusItems = (t: TFunction): StatusItem<AppSu
id: AppSummaryStatus.ApplicationsSummaryStatusNoApplications,
label: t('No applications'),
level: 'info',
customIcon: AsleepIcon,
customIcon: ResourcesEmptyIcon,
},
{
id: AppSummaryStatus.ApplicationsSummaryStatusHealthy,
Expand Down