mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
handle known suspension states
This commit is contained in:
@@ -133,13 +133,32 @@
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="status === 'suspended' && suspension_reason" class="server-listing-notice">
|
||||
<div class="flex flex-row gap-2">
|
||||
Your server has been suspended:
|
||||
{{ suspension_reason }}. Please update your billing information or contact Modrinth Support
|
||||
for more information.
|
||||
<div
|
||||
v-else-if="status === 'suspended' && suspension_reason === 'paymentfailed'"
|
||||
class="server-listing-notice"
|
||||
>
|
||||
<div>
|
||||
Your subscription was cancelled<template v-if="cancellationDate">
|
||||
on
|
||||
<span class="font-medium text-contrast">
|
||||
{{ formatDate(cancellationDate) }}
|
||||
</span></template
|
||||
>
|
||||
due to payment failure.<template v-if="!isFilesExpired">
|
||||
Your files will be kept for <span class="font-medium text-red">30 days</span> and can be
|
||||
downloaded below before they're deleted.</template
|
||||
>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<ButtonStyled v-if="onDownloadBackup" type="outlined" circular>
|
||||
<button
|
||||
v-tooltip="'Download latest backup'"
|
||||
class="!border-surface-5"
|
||||
@click="onDownloadBackup"
|
||||
>
|
||||
<DownloadIcon />
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
<ButtonStyled type="outlined">
|
||||
<button
|
||||
v-tooltip="'Copy code to clipboard'"
|
||||
@@ -162,16 +181,16 @@
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="status === 'suspended'" class="server-listing-notice">
|
||||
<div class="flex flex-row gap-2">
|
||||
Your server has been suspended. Please update your billing information or contact Modrinth
|
||||
Support for more information.
|
||||
</div>
|
||||
<div
|
||||
v-else-if="status === 'suspended' && suspension_reason === 'moderated'"
|
||||
class="server-listing-notice"
|
||||
>
|
||||
<div>Your server has been suspended due to a moderation action.</div>
|
||||
<div class="flex gap-2">
|
||||
<ButtonStyled type="outlined">
|
||||
<button
|
||||
v-tooltip="'Copy code to clipboard'"
|
||||
class="!border-surface-5 w-28"
|
||||
class="!border-surface-5"
|
||||
@click="copyToClipboard(server_id)"
|
||||
>
|
||||
<template v-if="copied"> Copied <CheckIcon class="text-green" /> </template>
|
||||
@@ -183,10 +202,27 @@
|
||||
><MessagesSquareIcon /> Support
|
||||
</a>
|
||||
</ButtonStyled>
|
||||
<ButtonStyled color="brand">
|
||||
<AutoLink :to="`/settings/billing#server-${server_id}`">
|
||||
<CardIcon /> Manage billing
|
||||
</AutoLink>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="status === 'suspended'" class="server-listing-notice">
|
||||
<div>
|
||||
Your server has been suspended. Please contact Modrinth Support for more information.
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<ButtonStyled type="outlined">
|
||||
<button
|
||||
v-tooltip="'Copy code to clipboard'"
|
||||
class="!border-surface-5"
|
||||
@click="copyToClipboard(server_id)"
|
||||
>
|
||||
<template v-if="copied"> Copied <CheckIcon class="text-green" /> </template>
|
||||
<template v-else> Copy ID <CopyIcon /> </template>
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
<ButtonStyled>
|
||||
<a href="https://support.modrinth.com/en/" target="_blank"
|
||||
><MessagesSquareIcon /> Support
|
||||
</a>
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -135,19 +135,41 @@ export const SuspendedCancelledFilesExpired: Story = {
|
||||
},
|
||||
}
|
||||
|
||||
export const SuspendedWithReason: Story = {
|
||||
export const SuspendedPaymentFailed: Story = {
|
||||
args: {
|
||||
...baseServer,
|
||||
name: 'Minigames Network',
|
||||
status: 'suspended',
|
||||
suspension_reason: 'paymentfailed',
|
||||
cancellationDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
|
||||
onDownloadBackup: () => alert('Download backup clicked'),
|
||||
},
|
||||
}
|
||||
|
||||
export const SuspendedPaymentFailedFilesExpired: Story = {
|
||||
args: {
|
||||
...baseServer,
|
||||
name: 'Minigames Network',
|
||||
status: 'suspended',
|
||||
suspension_reason: 'paymentfailed',
|
||||
cancellationDate: new Date(2025, 1, 17).toISOString(),
|
||||
onDownloadBackup: null,
|
||||
},
|
||||
}
|
||||
|
||||
export const SuspendedModerated: Story = {
|
||||
args: {
|
||||
...baseServer,
|
||||
name: 'Banned Server',
|
||||
status: 'suspended',
|
||||
suspension_reason: 'moderated',
|
||||
},
|
||||
}
|
||||
|
||||
export const SuspendedGeneric: Story = {
|
||||
args: {
|
||||
...baseServer,
|
||||
name: 'Archive Server',
|
||||
name: 'Server with other suspension reason',
|
||||
status: 'suspended',
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user