Skip to content

Commit

Permalink
remove duplicate serviceRegistrationStatus component
Browse files Browse the repository at this point in the history
Signed-off-by: swaroopar <[email protected]>
  • Loading branch information
swaroopar committed May 27, 2024
1 parent d79ad17 commit 49360ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import appStyles from '../../../../../styles/app.module.css';
import catalogStyles from '../../../../../styles/catalog.module.css';
import oclDisplayStyles from '../../../../../styles/ocl-display.module.css';
import { ServiceTemplateDetailVo } from '../../../../../xpanse-api/generated';
import { ServiceTemplateRegisterStatus } from '../../../common/catalog/ServiceTemplateRegisterStatus.tsx';
import { ApiDoc } from '../../../common/doc/ApiDoc';
import { AgreementText } from '../../../common/ocl/AgreementText';
import { BillingText } from '../../../common/ocl/BillingText';
import { ContactDetailsShowType } from '../../../common/ocl/ContactDetailsShowType';
import { ContactDetailsText } from '../../../common/ocl/ContactDetailsText';
import { DeploymentText } from '../../../common/ocl/DeploymentText';
import { FlavorsText } from '../../../common/ocl/FlavorsText';
import { ServiceRegistrationStatus } from './ServiceRegistrationStatus';
import { ShowIcon } from './ShowIcon';

function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDetailVo }): React.JSX.Element {
Expand Down Expand Up @@ -56,7 +56,7 @@ function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDeta
<Tag color='cyan'>{serviceDetails.namespace}</Tag>
</Descriptions.Item>
<Descriptions.Item label='Status'>
<ServiceRegistrationStatus serviceStatus={serviceDetails.serviceRegistrationState} />
<ServiceTemplateRegisterStatus serviceRegistrationState={serviceDetails.serviceRegistrationState} />
</Descriptions.Item>
<Descriptions.Item label='CredentialType'>{serviceDetails.deployment.credentialType}</Descriptions.Item>
<Descriptions.Item label='Deployment'>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, SyncOutlined } from '@ant-design/icons';
import { Tag } from 'antd';
import React from 'react';
import serviceReviewStyles from '../../../styles/service-review.module.css';
import { ServiceTemplateDetailVo } from '../../../xpanse-api/generated';
import serviceReviewStyles from '../../../../styles/service-review.module.css';
import { ServiceTemplateDetailVo } from '../../../../xpanse-api/generated';

export function ServiceTemplateRegisterStatus(
serviceRegistrationState: ServiceTemplateDetailVo.serviceRegistrationState
): React.JSX.Element {
export function ServiceTemplateRegisterStatus({
serviceRegistrationState,
}: {
serviceRegistrationState: ServiceTemplateDetailVo.serviceRegistrationState;
}): React.JSX.Element {
switch (serviceRegistrationState) {
case ServiceTemplateDetailVo.serviceRegistrationState.APPROVAL_PENDING:
return (
Expand Down
7 changes: 4 additions & 3 deletions src/components/content/review/ServiceReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import React, { useState } from 'react';
import serviceReviewStyles from '../../../styles/service-review.module.css';
import tableStyles from '../../../styles/table.module.css';
import { Deployment, ServiceTemplateDetailVo } from '../../../xpanse-api/generated';
import { ServiceTemplateRegisterStatus } from '../common/catalog/ServiceTemplateRegisterStatus.tsx';
import GetServiceTemplatesListError from './GetServiceTemplatesListError';
import { ServiceReviewsDetails } from './ServiceReviewsDetails';
import { ServiceTemplateRegisterStatus } from './ServiceTemplateRegisterStatus';
import useListAllServiceTemplatesQuery from './query/useListAllServiceTemplatesQuery';

export default function ServiceReviews(): React.JSX.Element {
Expand Down Expand Up @@ -234,8 +234,9 @@ export default function ServiceReviews(): React.JSX.Element {
onFilter: (value: React.Key | boolean, record) =>
record.serviceRegistrationState.startsWith(value.toString()),
align: 'left',
render: (serviceRegistrationState: ServiceTemplateDetailVo.serviceRegistrationState) =>
ServiceTemplateRegisterStatus(serviceRegistrationState),
render: (serviceRegistrationState: ServiceTemplateDetailVo.serviceRegistrationState) => (
<ServiceTemplateRegisterStatus serviceRegistrationState={serviceRegistrationState} />
),
},
{
title: 'Deployer Type',
Expand Down

0 comments on commit 49360ad

Please sign in to comment.