fix: deletion

This commit is contained in:
Arman
2023-12-07 13:30:01 +01:00
parent 8428c2db5c
commit 73750d00c4
6 changed files with 28 additions and 4 deletions
@@ -84,7 +84,10 @@
</svelte:fragment>
<svelte:fragment slot="actions">
<Button secondary on:click={() => (showDelete = true)}>Delete</Button>
<Button
disabled={$organization?.markedForDeletion}
secondary
on:click={() => (showDelete = true)}>Delete</Button>
</svelte:fragment>
</CardGrid>
{/if}
@@ -26,7 +26,7 @@
}
addNotification({
type: 'success',
message: `${$organization.name} has been deleted`
message: `${$organization.name} has been flagged for deletion`
});
await invalidate(Dependencies.ACCOUNT);
await invalidate(Dependencies.ORGANIZATION);
@@ -26,12 +26,21 @@
}
}
async function handleBefore() {
if (!$createOrganization.billingPlan) {
throw new Error('Please select a plan.');
}
if ($createOrganization.billingPlan === 'tier-0') {
$createOrganization.collaborators = [];
}
}
$: if ($createOrganization.billingPlan === 'tier-0') {
$createOrganizationFinalAction = 'Create organization';
}
</script>
<WizardStep>
<WizardStep beforeSubmit={handleBefore}>
<svelte:fragment slot="title">Confirm your details</svelte:fragment>
<svelte:fragment slot="subtitle">
Confirm the details of your new organization and start your free trial.
@@ -18,6 +18,7 @@
function addCollaborator() {
if (!email) return;
if ($createOrganization.collaborators.includes(email)) return;
$createOrganization.collaborators.push(email);
$createOrganization = $createOrganization;
email = '';
@@ -87,12 +87,21 @@
}
});
async function handleBefore() {
if (!$changeOrganizationTier.billingPlan) {
throw new Error('Please select a plan.');
}
if ($changeOrganizationTier.billingPlan === 'tier-0') {
$changeOrganizationTier.collaborators = [];
}
}
$: freePlan = $plansInfo.plans.find((p) => p.$id === 'tier-0');
$: proPlan = $plansInfo.plans.find((p) => p.$id === 'tier-1');
$: scalePlan = $plansInfo.plans.find((p) => p.$id === 'tier-2');
</script>
<WizardStep>
<WizardStep beforeSubmit={handleBefore}>
<svelte:fragment slot="title">Choose a plan</svelte:fragment>
<p class="body-text-1 u-bold common-section">Plan</p>
@@ -20,6 +20,8 @@
function addCollaborator() {
if (!email) return;
if ($changeOrganizationTier.collaborators.includes(email)) return;
$changeOrganizationTier.collaborators.push(email);
$changeOrganizationTier = $changeOrganizationTier;
email = '';