Skip to content

Commit

Permalink
fix: do not open the questionnaire after uninstalling the extension i…
Browse files Browse the repository at this point in the history
…f it is a subscription version (kubesphere#2824)

Signed-off-by: donniean <acmilank22@gmail.com>
  • Loading branch information
donniean authored Mar 8, 2024
1 parent 7d784b8 commit de6d8b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions packages/core/src/containers/Extensions/Manager/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { handleInstalled, handleUninstalled } from '../actions';
import { useLocalExtensionStatusItems } from '../hooks/useLocalExtensionStatusItems';
import { DetailActionButtons } from '../components/DetailActionButtons';
import { InstalledVersionWrapper } from './styles';
import { useMarketplaceConfigQuery } from '../../../../stores/marketplace';

export default function ExtensionsManagerDetail() {
const navigate = useNavigate();
Expand All @@ -46,6 +47,10 @@ export default function ExtensionsManagerDetail() {
const { isLocalInstalling, isLocalUpgrading, isLocalAnyUninstalling } =
formatLocalExtensionsStatus(localExtensionsStatus);

const { isLoading: isMarketplaceConfigQueryLoading, isOnline } = useMarketplaceConfigQuery({
isIgnoreErrorNotify: true,
});

const {
isLoading: isExtensionQueryLoading,
formattedExtension,
Expand Down Expand Up @@ -201,7 +206,9 @@ export default function ExtensionsManagerDetail() {
});
refetchExtension();
refetchInstallPlan();
window.open(EXTENSIONS_EVALUATION_PAGE_LINK, '_blank');
if (isOnline) {
window.open(EXTENSIONS_EVALUATION_PAGE_LINK, '_blank');
}
};

const handleForceDeleteInstallPlanSuccess = () => {
Expand Down Expand Up @@ -235,7 +242,11 @@ export default function ExtensionsManagerDetail() {

return (
<ExtensionDetail
isLoading={isExtensionQueryLoading || isExtensionDisplayVersionQueryLoading}
isLoading={
isMarketplaceConfigQueryLoading ||
isExtensionQueryLoading ||
isExtensionDisplayVersionQueryLoading
}
formattedExtension={formattedExtension}
formattedExtensionVersion={formattedExtensionVersion}
basicInfo={basicInfo}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ function Extensions() {
status: 'localUninstalling',
});
refetchExtensions();
window.open(EXTENSIONS_EVALUATION_PAGE_LINK, '_blank');
if (isOnline) {
window.open(EXTENSIONS_EVALUATION_PAGE_LINK, '_blank');
}
};

const handleForceDeleteInstallPlanSuccess = () => {
Expand Down

0 comments on commit de6d8b3

Please sign in to comment.