From 2a2e8773f509492ef708d892f66814a53f75d726 Mon Sep 17 00:00:00 2001 From: swaroopar Date: Mon, 27 May 2024 05:06:44 +0000 Subject: [PATCH 1/3] fix result messages Signed-off-by: swaroopar --- .../catalog/services/unregister/UnregisterResult.tsx | 8 ++++---- .../content/review/ApproveOrRejectServiceTemplate.tsx | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/content/catalog/services/unregister/UnregisterResult.tsx b/src/components/content/catalog/services/unregister/UnregisterResult.tsx index 2582b14a6..b57b9138e 100644 --- a/src/components/content/catalog/services/unregister/UnregisterResult.tsx +++ b/src/components/content/catalog/services/unregister/UnregisterResult.tsx @@ -35,8 +35,8 @@ export function UnregisterResult({ if (useUnregisterRequestState[0].status === 'success') { return ( ) : ( Date: Mon, 27 May 2024 05:06:56 +0000 Subject: [PATCH 2/3] fix style Signed-off-by: swaroopar --- src/components/content/review/ServiceReviewsDetails.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/content/review/ServiceReviewsDetails.tsx b/src/components/content/review/ServiceReviewsDetails.tsx index 847050e2b..0d469e88d 100644 --- a/src/components/content/review/ServiceReviewsDetails.tsx +++ b/src/components/content/review/ServiceReviewsDetails.tsx @@ -107,8 +107,6 @@ export const ServiceReviewsDetails = ({ {currentServiceTemplateVo.name} -
-
Cloud Service Provider From 49360ad78a757b9898c34013b6577646547fe873 Mon Sep 17 00:00:00 2001 From: swaroopar Date: Mon, 27 May 2024 06:01:57 +0000 Subject: [PATCH 3/3] remove duplicate serviceRegistrationStatus component Signed-off-by: swaroopar --- .../services/details/ServiceDetail.tsx | 4 +- .../details/ServiceRegistrationStatus.tsx | 46 ------------------- .../ServiceTemplateRegisterStatus.tsx | 12 +++-- .../content/review/ServiceReviews.tsx | 7 +-- 4 files changed, 13 insertions(+), 56 deletions(-) delete mode 100644 src/components/content/catalog/services/details/ServiceRegistrationStatus.tsx rename src/components/content/{review => common/catalog}/ServiceTemplateRegisterStatus.tsx (88%) diff --git a/src/components/content/catalog/services/details/ServiceDetail.tsx b/src/components/content/catalog/services/details/ServiceDetail.tsx index 3265d287c..1166bd076 100644 --- a/src/components/content/catalog/services/details/ServiceDetail.tsx +++ b/src/components/content/catalog/services/details/ServiceDetail.tsx @@ -10,6 +10,7 @@ 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'; @@ -17,7 +18,6 @@ import { ContactDetailsShowType } from '../../../common/ocl/ContactDetailsShowTy 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 { @@ -56,7 +56,7 @@ function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDeta {serviceDetails.namespace} - + {serviceDetails.deployment.credentialType} diff --git a/src/components/content/catalog/services/details/ServiceRegistrationStatus.tsx b/src/components/content/catalog/services/details/ServiceRegistrationStatus.tsx deleted file mode 100644 index e9448e788..000000000 --- a/src/components/content/catalog/services/details/ServiceRegistrationStatus.tsx +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * SPDX-FileCopyrightText: Huawei Inc. - */ - -import { CheckCircleOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; -import { Tag } from 'antd'; -import React from 'react'; -import catalogStyles from '../../../../../styles/catalog.module.css'; -import { ServiceTemplateDetailVo } from '../../../../../xpanse-api/generated'; -import serviceRegistrationState = ServiceTemplateDetailVo.serviceRegistrationState; - -export function ServiceRegistrationStatus({ - serviceStatus, -}: { - serviceStatus: ServiceTemplateDetailVo.serviceRegistrationState; -}): React.JSX.Element { - switch (serviceStatus) { - case serviceRegistrationState.APPROVED: - return ( - } color='success' className={catalogStyles.catalogServiceStatusSize}> - {serviceStatus.valueOf()} - - ); - case ServiceTemplateDetailVo.serviceRegistrationState.APPROVAL_PENDING: - return ( - } - color='orange' - className={catalogStyles.catalogServiceStatusSize} - > - {serviceStatus.valueOf()} - - ); - default: - return ( - } - color='warning' - className={catalogStyles.catalogServiceStatusSize} - > - {serviceStatus as string} - - ); - } -} diff --git a/src/components/content/review/ServiceTemplateRegisterStatus.tsx b/src/components/content/common/catalog/ServiceTemplateRegisterStatus.tsx similarity index 88% rename from src/components/content/review/ServiceTemplateRegisterStatus.tsx rename to src/components/content/common/catalog/ServiceTemplateRegisterStatus.tsx index ee6e60c8f..38f571f25 100644 --- a/src/components/content/review/ServiceTemplateRegisterStatus.tsx +++ b/src/components/content/common/catalog/ServiceTemplateRegisterStatus.tsx @@ -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 ( diff --git a/src/components/content/review/ServiceReviews.tsx b/src/components/content/review/ServiceReviews.tsx index da135a191..f2cb4493a 100644 --- a/src/components/content/review/ServiceReviews.tsx +++ b/src/components/content/review/ServiceReviews.tsx @@ -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 { @@ -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) => ( + + ), }, { title: 'Deployer Type',