Skip to content

Commit efee30c

Browse files
committed
EDM-2290: Align to UX design
1 parent 8aaa102 commit efee30c

7 files changed

Lines changed: 159 additions & 100 deletions

File tree

libs/i18n/locales/en/translation.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,18 @@
345345
"Content is base64 encoded": "Content is base64 encoded",
346346
"Delete file": "Delete file",
347347
"Add file": "Add file",
348-
"Inline application": "Inline application",
349-
"Image based application": "Image based application",
350-
"Compose": "Compose",
351-
"Quadlet": "Quadlet",
348+
"Quadlet application": "Quadlet application",
349+
"Compose application": "Compose application",
352350
"Application {{ appNum }}": "Application {{ appNum }}",
353351
"Application type": "Application type",
354352
"Select an application type": "Select an application type",
355-
"Application format": "Application format",
356-
"Select an application format": "Select an application format",
353+
"Definition source": "Definition source",
354+
"Configuration Sources": "Configuration Sources",
355+
"OCI reference": "OCI reference",
356+
"Pull definitions from container registry (reusable, versioned).": "Pull definitions from container registry (reusable, versioned).",
357+
"Inline": "Inline",
358+
"Define application files directly in this interface (custom, one-off).": "Define application files directly in this interface (custom, one-off).",
359+
"OCI reference URL": "OCI reference URL",
357360
"Application name": "Application name",
358361
"The unique identifier for this application.": "The unique identifier for this application.",
359362
"If not specified, the image name will be used. Application name must be unique.": "If not specified, the image name will be used. Application name must be unique.",
@@ -362,6 +365,7 @@
362365
"Add an application variable": "Add an application variable",
363366
"Application workloads": "Application workloads",
364367
"Define the application workloads that shall run on the device.": "Define the application workloads that shall run on the device.",
368+
"Configure containerized applications and services that will run on your fleet devices. You can deploy single containers, Quadlet applications for advanced container orchestration or inline applications with custom files.": "Configure containerized applications and services that will run on your fleet devices. You can deploy single containers, Quadlet applications for advanced container orchestration or inline applications with custom files.",
365369
"Delete application": "Delete application",
366370
"Add application": "Add application",
367371
"(0777) Read, write, and execute permissions for all users.": "(0777) Read, write, and execute permissions for all users.",
@@ -433,8 +437,9 @@
433437
"The device will download and apply updates as soon as they are available.": "The device will download and apply updates as soon as they are available.",
434438
"Device alias": "Device alias",
435439
"Device labels": "Device labels",
440+
"Quadlet": "Quadlet",
441+
"Compose": "Compose",
436442
"Image based": "Image based",
437-
"Inline": "Inline",
438443
"Unnamed": "Unnamed",
439444
"Device fleet": "Device fleet",
440445
"Edge Manager will not manage system image": "Edge Manager will not manage system image",
@@ -667,7 +672,7 @@
667672
"Use alphanumeric characters, or underscore (_)": "Use alphanumeric characters, or underscore (_)",
668673
"Variable value is required.": "Variable value is required.",
669674
"Variable names of an application must be unique": "Variable names of an application must be unique",
670-
"Application type is required": "Application type is required",
675+
"Definition source is required": "Definition source is required",
671676
"Name is required for {{ appType }} applications.": "Name is required for {{ appType }} applications.",
672677
"Use lowercase alphanumeric characters, or dash (-). Must start and end with an alphanumeric character.": "Use lowercase alphanumeric characters, or dash (-). Must start and end with an alphanumeric character.",
673678
"File path is required": "File path is required",
@@ -679,6 +684,8 @@
679684
"Unsupported quadlet file type {{ extension }}. Supported types: {{ supportedTypes }}": "Unsupported quadlet file type {{ extension }}. Supported types: {{ supportedTypes }}",
680685
"Quadlet application must include at least one of the following file types: {{ supportedTypes }}": "Quadlet application must include at least one of the following file types: {{ supportedTypes }}",
681686
"Quadlet files must be at root level (no subdirectories)": "Quadlet files must be at root level (no subdirectories)",
687+
"Definition source must be image for this type of applications": "Definition source must be image for this type of applications",
688+
"Application type is required": "Application type is required",
682689
"Image is required.": "Image is required.",
683690
"Application image includes invalid characters.": "Application image includes invalid characters.",
684691
"Application name must be unique.": "Application name must be unique.",

libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { Bullseye } from '@patternfly/react-core';
2+
import { Bullseye, Label } from '@patternfly/react-core';
33
import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
44

55
import { DeviceApplicationStatus } from '@flightctl/types';
@@ -35,6 +35,7 @@ const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) =>
3535
<Th modifier="wrap">{t('Status')}</Th>
3636
<Th modifier="wrap">{t('Ready')}</Th>
3737
<Th modifier="wrap">{t('Restarts')}</Th>
38+
<Th modifier="wrap">{t('Type')}</Th>
3839
</Tr>
3940
</Thead>
4041
<Tbody>
@@ -43,6 +44,7 @@ const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) =>
4344
status: null,
4445
ready: '-',
4546
restarts: '-',
47+
appType: null,
4648
};
4749

4850
return (
@@ -53,6 +55,9 @@ const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) =>
5355
</Td>
5456
<Td dataLabel={t('Ready')}>{appDetails.ready}</Td>
5557
<Td dataLabel={t('Restarts')}>{appDetails.restarts}</Td>
58+
<Td dataLabel={t('Type')}>
59+
{appDetails.appType ? <Label variant="outline">{appDetails.appType}</Label> : '-'}
60+
</Td>
5661
</Tr>
5762
);
5863
})}

libs/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
GitConfigProviderSpec,
1111
HttpConfigProviderSpec,
1212
ImageMountVolumeProviderSpec,
13-
ImagePullPolicy,
1413
InlineApplicationProviderSpec,
1514
InlineConfigProviderSpec,
1615
KubernetesSecretProviderSpec,
@@ -231,21 +230,19 @@ export const toAPIApplication = (app: AppForm): ApplicationProviderSpec => {
231230
if (isImageAppForm(app)) {
232231
const data: ApplicationProviderSpec = {
233232
image: app.image,
233+
appType: app.appType,
234234
envVars,
235235
volumes,
236236
};
237237
if (app.name) {
238238
data.name = app.name;
239239
}
240-
if (app.appType) {
241-
data.appType = app.appType;
242-
}
243240
return data;
244241
}
245242

246243
return {
247244
name: app.name,
248-
appType: app.appType || AppType.AppTypeCompose,
245+
appType: app.appType,
249246
inline: app.files.map(
250247
(file): InlineApplicationFileFixed => ({
251248
path: file.path,
@@ -397,22 +394,24 @@ const getAppFormVariables = (app: ApplicationProviderSpecFixed) =>
397394
export const getApplicationValues = (deviceSpec?: DeviceSpec): AppForm[] => {
398395
const apps = deviceSpec?.applications || [];
399396
return apps.map((app) => {
397+
if (!app.appType) {
398+
throw new Error('Application appType is required');
399+
}
400400
if (isImageAppProvider(app)) {
401401
return {
402402
specType: AppSpecType.OCI_IMAGE,
403403
name: app.name || '',
404404
image: app.image,
405-
appType: app.appType,
405+
appType: app.appType as AppType.AppTypeCompose | AppType.AppTypeQuadlet,
406406
variables: getAppFormVariables(app),
407407
volumes: app.volumes || [],
408408
};
409409
}
410410

411-
// Inline applications can either be "Compose" or "Quadlet"
412411
const inlineApp = app as InlineApplicationProviderSpec;
413412
return {
414413
specType: AppSpecType.INLINE,
415-
appType: app.appType || AppType.AppTypeCompose,
414+
appType: app.appType,
416415
name: app.name || '',
417416
files: inlineApp.inline,
418417
variables: getAppFormVariables(app),

0 commit comments

Comments
 (0)