Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: remove the application thumbnail #106

Merged
merged 1 commit into from
Feb 10, 2025
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
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