Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
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
19 changes: 17 additions & 2 deletions Composer/packages/client/src/recoilModel/dispatchers/provision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export const provisionDispatcher = () => {
type: 'success',
};
};
const getProvisionPartialSuccessNotification = (value: string): CardProps => {
return {
title: formatMessage('Provision partially completed'),
description: formatMessage('{msg}', { msg: value }),
type: 'warning',
};
};
const getProvisionFailureNotification = (value: string): CardProps => {
return {
title: formatMessage('Provision failure'),
Expand Down Expand Up @@ -115,7 +122,11 @@ export const provisionDispatcher = () => {
isCleanTimer = false;
try {
const response = await httpClient.get(`/provision/${projectId}/status/${targetType}/${targetName}/${jobId}`);
if (response.data?.status === 200 && response.data.config && response.data.config != {}) {
if (
(response.data?.status === 200 || response.data?.status === 206) &&
response.data.config &&
response.data.config != {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use lodash isEmpty({})

) {
// delete provisionStatus
callbackHelpers.set(provisionStatusState(projectId), (status) => {
const newStatus = { ...status };
Expand Down Expand Up @@ -143,7 +154,11 @@ export const provisionDispatcher = () => {
subscriptionId: response.data.config.subscriptionId,
});

notification = getProvisionSuccessNotification(response.data.message);
if (response.data?.status === 200) {
notification = getProvisionSuccessNotification(response.data.message);
} else {
notification = getProvisionPartialSuccessNotification(response.data.message);
}
isCleanTimer = true;
} else {
if (response.data.status !== 500) {
Expand Down
Loading