Skip to content

Commit

Permalink
Merge pull request #106 from ralphbean/no-thumbnail
Browse files Browse the repository at this point in the history
feat!: remove the application thumbnail
  • Loading branch information
sahil143 authored Feb 10, 2025
2 parents 29cfa26 + 678576d commit d21f491
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 83 deletions.
4 changes: 0 additions & 4 deletions src/components/ApplicationDetails/ApplicationHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import * as React from 'react';
import { Flex, FlexItem, Text } from '@patternfly/react-core';
import { ApplicationKind } from '../../types';
import { ApplicationThumbnail } from '../ApplicationThumbnail';

export const ApplicationHeader: React.FC<
React.PropsWithChildren<{ application: ApplicationKind }>
> = ({ application }) => {
return (
<Flex>
<FlexItem>
<ApplicationThumbnail application={application} />
</FlexItem>
<FlexItem alignSelf={{ default: 'alignSelfCenter' }}>
<Text component="h1" data-test="details__title">
{application?.spec?.displayName || ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,4 @@ describe('ApplicationHeader', () => {
);
expect(screen.getByText('Application 1')).toBeInTheDocument();
});

it('should show application health status and thumbnail in the header', () => {
render(
<ApplicationHeader
application={
{
metadata: { name: 'application-1', annotations: {} },
spec: { displayName: 'Application 1' },
} as ApplicationKind
}
/>,
);
expect(screen.getByAltText('Application thumbnail')).toBeInTheDocument();
});
});
48 changes: 0 additions & 48 deletions src/components/ApplicationThumbnail.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import { Flex, FlexItem, FormSection } from '@patternfly/react-core';
import { useFormikContext } from 'formik';
import { InputField } from 'formik-pf';
import { ApplicationThumbnail } from '../../ApplicationThumbnail';
import { ImportFormValues } from '../type';

const ApplicationSection: React.FunctionComponent<React.PropsWithChildren<unknown>> = () => {
Expand All @@ -12,9 +11,6 @@ const ApplicationSection: React.FunctionComponent<React.PropsWithChildren<unknow

return (
<Flex>
<FlexItem>
<ApplicationThumbnail annotationValue={0} />
</FlexItem>
<FlexItem flex={{ default: 'flex_1' }}>
<FormSection>
<InputField
Expand Down
9 changes: 0 additions & 9 deletions src/utils/__tests__/create-utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { omit } from 'lodash-es';
import { THUMBNAIL_ANNOTATION } from '../../components/ApplicationThumbnail';
import { linkSecretToServiceAccount } from '../../components/Secrets/utils/service-account-utils';
import { k8sCreateResource, k8sUpdateResource } from '../../k8s/k8s-fetch';
import { SecretModel } from '../../models';
Expand Down Expand Up @@ -32,20 +31,12 @@ jest.mock('../../components/Secrets/utils/service-account-utils', () => {
const createResourceMock = k8sCreateResource as jest.Mock;
const linkSecretToServiceAccountMock = linkSecretToServiceAccount as jest.Mock;

jest.mock('../../components/ApplicationThumbnail', () => {
const actual = jest.requireActual('../../components/ApplicationThumbnail');
return { ...actual, getRandomSvgNumber: () => 7 };
});

const mockApplicationRequestData = {
apiVersion: `${ApplicationModel.apiGroup}/${ApplicationModel.apiVersion}`,
kind: ApplicationModel.kind,
metadata: {
name: 'test-application',
namespace: 'test-ns',
annotations: {
[THUMBNAIL_ANNOTATION]: '7',
},
},
spec: {
displayName: 'test-application',
Expand Down
4 changes: 0 additions & 4 deletions src/utils/create-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isEqual, isNumber } from 'lodash-es';
import { v4 as uuidv4 } from 'uuid';
import { getRandomSvgNumber, THUMBNAIL_ANNOTATION } from '../components/ApplicationThumbnail';
import {
getAnnotationForSecret,
getLabelsForSecret,
Expand Down Expand Up @@ -61,9 +60,6 @@ export const createApplication = (
metadata: {
name: application,
namespace,
annotations: {
[THUMBNAIL_ANNOTATION]: getRandomSvgNumber().toString(),
},
},
spec: {
displayName: application,
Expand Down

0 comments on commit d21f491

Please sign in to comment.