-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
747 additions
and
780 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...ontent/common/deployedServiceDetailsByServiceIdQuery/useServiceDetailsByServiceIdQuery.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* SPDX-FileCopyrightText: Huawei Inc. | ||
*/ | ||
|
||
import { useQuery } from '@tanstack/react-query'; | ||
import { | ||
getSelfHostedServiceDetailsById, | ||
GetSelfHostedServiceDetailsByIdData, | ||
getVendorHostedServiceDetailsById, | ||
GetVendorHostedServiceDetailsByIdData, | ||
serviceHostingType, | ||
taskStatus, | ||
} from '../../../../xpanse-api/generated'; | ||
|
||
export function useServiceDetailsByServiceIdQuery( | ||
serviceId: string | undefined, | ||
currentServiceHostingType: string, | ||
currentMigrationTaskStatus: string | undefined | ||
) { | ||
return useQuery({ | ||
queryKey: ['getServiceDetailsById', serviceId, currentServiceHostingType], | ||
queryFn: () => { | ||
if (currentServiceHostingType === serviceHostingType.SELF.toString()) { | ||
const data: GetSelfHostedServiceDetailsByIdData = { | ||
serviceId: serviceId ?? '', | ||
}; | ||
return getSelfHostedServiceDetailsById(data); | ||
} else { | ||
const data: GetVendorHostedServiceDetailsByIdData = { | ||
serviceId: serviceId ?? '', | ||
}; | ||
return getVendorHostedServiceDetailsById(data); | ||
} | ||
}, | ||
enabled: | ||
serviceId !== undefined && | ||
(currentMigrationTaskStatus === taskStatus.SUCCESSFUL || currentMigrationTaskStatus === taskStatus.FAILED), | ||
staleTime: Infinity, | ||
gcTime: Infinity, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/components/content/order/recreate/RecreateOrderSubmitResult.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* SPDX-FileCopyrightText: Huawei Inc. | ||
*/ | ||
|
||
import { Alert } from 'antd'; | ||
import { StopwatchResult } from 'react-timer-hook'; | ||
import { ServiceProviderContactDetails } from '../../../../xpanse-api/generated'; | ||
|
||
import React from 'react'; | ||
import submitAlertStyles from '../../../../styles/submit-alert.module.css'; | ||
import { ContactDetailsShowType } from '../../common/ocl/ContactDetailsShowType'; | ||
import { ContactDetailsText } from '../../common/ocl/ContactDetailsText'; | ||
import DeploymentTimer from '../orderStatus/DeploymentTimer'; | ||
import OrderSubmitResultDetails from '../orderStatus/OrderSubmitResultDetails'; | ||
|
||
export const RecreateOrderSubmitResult = ({ | ||
msg, | ||
uuid, | ||
type, | ||
stopWatch, | ||
closeRecreateResultAlert, | ||
contactServiceDetails, | ||
}: { | ||
msg: string | React.JSX.Element; | ||
uuid: string; | ||
type: 'success' | 'error'; | ||
stopWatch: StopwatchResult; | ||
closeRecreateResultAlert: (arg: boolean) => void; | ||
contactServiceDetails: ServiceProviderContactDetails | undefined; | ||
}): React.JSX.Element => { | ||
const onClose = () => { | ||
closeRecreateResultAlert(true); | ||
}; | ||
|
||
return ( | ||
<div className={submitAlertStyles.submitAlertTip}> | ||
{' '} | ||
<Alert | ||
message={`Processing Status`} | ||
description={<OrderSubmitResultDetails msg={msg} uuid={uuid} />} | ||
showIcon | ||
closable={true} | ||
onClose={onClose} | ||
type={type} | ||
action={ | ||
<> | ||
{contactServiceDetails !== undefined ? ( | ||
<ContactDetailsText | ||
serviceProviderContactDetails={contactServiceDetails} | ||
showFor={ContactDetailsShowType.Order} | ||
/> | ||
) : ( | ||
<></> | ||
)} | ||
<DeploymentTimer stopWatch={stopWatch} /> | ||
</> | ||
} | ||
/>{' '} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.