From 2093bbfd13c81a22d41de11325db3dd51a446b73 Mon Sep 17 00:00:00 2001 From: afsuyadi Date: Thu, 18 Jun 2026 09:19:32 +0700 Subject: [PATCH 1/2] fix(organisation): disable delete button when active subscription exists --- .../tabs/general-tab/sections/DeleteOrganisation.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx b/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx index 1d8f9fb8eae7..0df04d24783e 100644 --- a/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx +++ b/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx @@ -53,7 +53,11 @@ export const DeleteOrganisation = ({ data-test='delete-org-btn' onClick={handleDelete} theme='danger' - disabled={isLoading} + disabled={ + isLoading || + (organisation.subscription.plan !== null && + organisation.subscription.cancellation_date === null) + } > {isLoading ? 'Deleting...' : 'Delete Organisation'} From ae1ed566586277aed8206b7c0b7b3ea8264c0a3b Mon Sep 17 00:00:00 2001 From: afsuyadi Date: Tue, 23 Jun 2026 19:10:03 +0700 Subject: [PATCH 2/2] fix(organisation): modify condition based on code review --- .../tabs/general-tab/sections/DeleteOrganisation.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx b/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx index 0df04d24783e..f35b3ad90fc9 100644 --- a/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx +++ b/frontend/web/components/pages/organisation-settings/tabs/general-tab/sections/DeleteOrganisation.tsx @@ -1,5 +1,6 @@ import React from 'react' import { useHistory } from 'react-router-dom' +import { planNames } from 'common/utils/utils' import { Organisation } from 'common/types/responses' import { useDeleteOrganisationWithToast } from 'components/pages/organisation-settings/hooks' import ConfirmRemoveOrganisation from 'components/modals/ConfirmRemoveOrganisation' @@ -55,8 +56,9 @@ export const DeleteOrganisation = ({ theme='danger' disabled={ isLoading || - (organisation.subscription.plan !== null && - organisation.subscription.cancellation_date === null) + (Utils.getPlanName(organisation.subscription?.plan ?? '') !== + planNames.free && + !organisation.subscription?.cancellation_date) } > {isLoading ? 'Deleting...' : 'Delete Organisation'}