Skip to content

Commit

Permalink
Merge branch 'eclipse-xpanse:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
WangLiNaruto authored Sep 20, 2024
2 parents 67ca097 + 43290bf commit 23283f7
Show file tree
Hide file tree
Showing 37 changed files with 2,611 additions and 2,778 deletions.
2 changes: 1 addition & 1 deletion openapi-ts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
client: 'fetch',
client: 'legacy/fetch',
input: 'src/xpanse-api/api.json',
output: {
format: 'prettier',
Expand Down
474 changes: 237 additions & 237 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
"type": "module",
"dependencies": {
"@ant-design/icons": "^5.4.0",
"@axa-fr/react-oidc": "^7.22.23",
"@hey-api/openapi-ts": "^0.52.11",
"@tanstack/react-query": "^5.52.1",
"antd": "^5.20.3",
"@axa-fr/react-oidc": "^7.22.24",
"@hey-api/openapi-ts": "^0.53.0",
"@tanstack/react-query": "^5.56.2",
"antd": "^5.20.6",
"echarts": "5.5.1",
"echarts-for-react": "^3.0.2",
"rc-field-form": "^2.4.0",
"rc-menu": "^9.15.1",
"rc-tabs": "^15.2.0",
"react": "^18.2.0",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.1",
"react-router-dom": "^6.26.2",
"react-timer-hook": "^3.0.7",
"yaml": "^2.5.0",
"yaml": "^2.5.1",
"zustand": "^4.5.5"
},
"scripts": {
Expand Down Expand Up @@ -100,18 +100,18 @@
]
},
"devDependencies": {
"@axa-fr/oidc-client": "^7.22.22",
"@axa-fr/oidc-client": "^7.22.24",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@tanstack/eslint-plugin-query": "^5.52.0",
"@tanstack/eslint-plugin-query": "^5.56.1",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.0",
"@types/react": "^18.3.4",
"@testing-library/react": "^16.0.1",
"@types/jest": "^29.5.13",
"@types/node": "^22.5.5",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.6.0",
"@vitejs/plugin-react": "^4.3.1",
"env-cmd": "^10.1.0",
"eslint": "^8.57.0",
Expand All @@ -120,19 +120,19 @@
"eslint-plugin-css-modules": "^2.12.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-require-explicit-generics": "^1.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"knip": "^5.27.4",
"knip": "^5.30.2",
"prettier": "3.3.3",
"prettier-plugin-organize-imports": "^4.0.0",
"release-it": "^17.6.0",
"ts-jest": "^29.2.5",
"typescript": "5.5.4",
"typescript": "5.6.2",
"uuid": "^10.0.0",
"vite": "^5.4.2"
"vite": "^5.4.6"
},
"overrides": {
"react-scripts": {
Expand Down
21 changes: 7 additions & 14 deletions src/components/content/catalog/services/details/ServiceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
* SPDX-FileCopyrightText: Huawei Inc.
*/

import { CloudUploadOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { Descriptions, Space, Tag } from 'antd';
import { GlobalOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { Descriptions, Tag } from 'antd';
import React from 'react';
import { createSearchParams, useNavigate } from 'react-router-dom';
import appStyles from '../../../../../styles/app.module.css';
import catalogStyles from '../../../../../styles/catalog.module.css';
import oclDisplayStyles from '../../../../../styles/ocl-display.module.css';
import {
DeployedService,
ServiceTemplateDetailVo,
category,
csp,
DeployedService,
serviceDeploymentState,
serviceRegistrationState,
ServiceTemplateDetailVo,
} from '../../../../../xpanse-api/generated';
import { useCurrentUserRoleStore } from '../../../../layouts/header/useCurrentRoleStore';
import { reportsRoute } from '../../../../utils/constants';
Expand All @@ -28,8 +27,8 @@ 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 { RegionText } from '../../../common/ocl/RegionText.tsx';
import useDeployedServicesByIsvQuery from '../../../deployedServices/myServices/query/useDeployedServiceByIsvQuery';
import { formatRegionInfo } from '../../../order/formDataHelpers/regionHelper.ts';
import { ShowIcon } from './ShowIcon';

function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDetailVo }): React.JSX.Element {
Expand Down Expand Up @@ -94,16 +93,10 @@ function ServiceDetail({ serviceDetails }: { serviceDetails: ServiceTemplateDeta
<>
<div className={catalogStyles.catalogDetailClass}>
<h3 className={catalogStyles.catalogDetailsH3}>
<CloudUploadOutlined />
<GlobalOutlined />
&nbsp;Available Regions
</h3>
<Space size={[0, 8]} wrap>
{serviceDetails.regions.map((region) => (
<Tag key={region.name} className={oclDisplayStyles.oclDisplayTag} color='orange'>
{formatRegionInfo(region, true)}
</Tag>
))}
</Space>
<RegionText regions={serviceDetails.regions} />
</div>
<h3 className={catalogStyles.catalogDetailsH3}>
<InfoCircleOutlined />
Expand Down
19 changes: 7 additions & 12 deletions src/components/content/common/ocl/DisplayOclData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
* SPDX-FileCopyrightText: Huawei Inc.
*/

import { GlobalOutlined } from '@ant-design/icons';
import { InfoCircleOutlined } from '@ant-design/icons/lib/icons';
import { Descriptions, Image, Tag, Tooltip, Typography } from 'antd';
import React from 'react';
import catalogStyles from '../../../../styles/catalog.module.css';
import oclDisplayStyles from '../../../../styles/ocl-display.module.css';
import { Ocl, serviceHostingType } from '../../../../xpanse-api/generated';
import { DeployedServicesHostingType } from '../../deployedServices/common/DeployedServicesHostingType';
import { formatRegionInfo } from '../../order/formDataHelpers/regionHelper.ts';
import { cspMap } from '../csp/CspLogo';
import { AgreementText } from './AgreementText';
import { BillingText } from './BillingText';
import { ContactDetailsShowType } from './ContactDetailsShowType';
import { ContactDetailsText } from './ContactDetailsText';
import { DeploymentText } from './DeploymentText';
import { FlavorsText } from './FlavorsText.tsx';
import { RegionText } from './RegionText.tsx';

function DisplayOclData({ ocl }: { ocl: Ocl }): React.JSX.Element | string {
const PLACE_HOLDER_UNKNOWN_VALUE: string = 'NOT PROVIDED';
Expand Down Expand Up @@ -66,17 +67,6 @@ function DisplayOclData({ ocl }: { ocl: Ocl }): React.JSX.Element | string {
</div>
<br />
</div>
<div>
<b>Available Regions</b>
<br />
{ocl.cloudServiceProvider.regions.map((region) => (
<Tag className={oclDisplayStyles.oclDisplayTag} color='orange' key={region.name}>
{formatRegionInfo(region, true)}
</Tag>
))}
<br />
<br />
</div>
<div>
<b>Service Hosted By</b>
<br />
Expand All @@ -90,6 +80,11 @@ function DisplayOclData({ ocl }: { ocl: Ocl }): React.JSX.Element | string {
</div>
</div>
<div>
<h3 className={catalogStyles.catalogDetailsH3}>
<GlobalOutlined />
&nbsp;Available Regions
</h3>
<RegionText regions={ocl.cloudServiceProvider.regions} />
<h3 className={catalogStyles.catalogDetailsH3}>
<InfoCircleOutlined />
&nbsp;Basic Information
Expand Down
70 changes: 70 additions & 0 deletions src/components/content/common/ocl/RegionText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: Huawei Inc.
*/

import { Table, TableProps, Tag } from 'antd';
import React from 'react';
import regionStyle from '../../../../styles/region-text.module.css';
import { Region } from '../../../../xpanse-api/generated';
import { GroupedRegionItem, groupedRegions } from '../../../utils/groupedRegions.tsx';

const columns: TableProps<GroupedRegionItem>['columns'] = [
{
title: 'Area',
dataIndex: 'area',
key: 'area',
render: (text) => <Tag color={'green'}>{text}</Tag>,
},
{
title: 'Region',
dataIndex: 'name',
key: 'region',
render: (_, { name }) => (
<>
{name.map((item) => {
return (
<Tag color={'blue'} key={item}>
{item}
</Tag>
);
})}
</>
),
},
{
title: 'Site',
dataIndex: 'site',
key: 'site',
render: (_, { site }) => (
<>
{site.map((item) => {
return (
<Tag color={'orange'} key={item}>
{item}
</Tag>
);
})}
</>
),
},
];

export function RegionText({ regions }: { regions: Region[] }): React.JSX.Element {
if (regions.length > 0) {
const groupedByAreaRegions = groupedRegions(regions);
return (
<div className={regionStyle.regionList}>
<Table
columns={columns}
dataSource={groupedByAreaRegions}
rowKey={'id'}
pagination={false}
bordered={true}
/>
</div>
);
}

return <></>;
}
Loading

0 comments on commit 23283f7

Please sign in to comment.