Org disabled frontend (#4424)

This commit is contained in:
Prospector
2025-09-25 18:55:57 -07:00
committed by GitHub
parent 4228a193e9
commit 2492b11ec0

View File

@@ -1,7 +1,14 @@
<template> <template>
<NewModal ref="modal" header="Creating an organization"> <NewModal ref="modal" header="Creating an organization">
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
<div class="flex flex-col gap-2"> <Admonition
v-if="disabled"
class="max-w-[30rem]"
:type="'info'"
header="Organization creation temporarily disabled"
body="Due to abuse, we've temporarily disabled the creation of new organizations. We're working hard to restore this feature, thank you for your patience."
/>
<div class="flex flex-col gap-2" :class="{ 'opacity-50': disabled }">
<label for="name"> <label for="name">
<span class="text-lg font-semibold text-contrast"> <span class="text-lg font-semibold text-contrast">
Name Name
@@ -15,10 +22,11 @@
maxlength="64" maxlength="64"
:placeholder="`Enter organization name...`" :placeholder="`Enter organization name...`"
autocomplete="off" autocomplete="off"
:disabled="disabled"
@input="updateSlug" @input="updateSlug"
/> />
</div> </div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2" :class="{ 'opacity-50': disabled }">
<label for="slug"> <label for="slug">
<span class="text-lg font-semibold text-contrast"> <span class="text-lg font-semibold text-contrast">
URL URL
@@ -33,11 +41,12 @@
type="text" type="text"
maxlength="64" maxlength="64"
autocomplete="off" autocomplete="off"
:disabled="disabled"
@input="setManualSlug" @input="setManualSlug"
/> />
</div> </div>
</div> </div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2" :class="{ 'opacity-50': disabled }">
<label for="additional-information" class="flex flex-col gap-1"> <label for="additional-information" class="flex flex-col gap-1">
<span class="text-lg font-semibold text-contrast"> <span class="text-lg font-semibold text-contrast">
Summary Summary
@@ -46,16 +55,21 @@
<span>A sentence or two that describes your organization.</span> <span>A sentence or two that describes your organization.</span>
</label> </label>
<div class="textarea-wrapper"> <div class="textarea-wrapper">
<textarea id="additional-information" v-model="description" maxlength="256" /> <textarea
id="additional-information"
v-model="description"
:disabled="disabled"
maxlength="256"
/>
</div> </div>
</div> </div>
<p class="m-0 max-w-[30rem]"> <p class="m-0 max-w-[30rem]" :class="{ 'opacity-50': disabled }">
You will be the owner of this organization, but you can invite other members and transfer You will be the owner of this organization, but you can invite other members and transfer
ownership at any time. ownership at any time.
</p> </p>
<div class="flex gap-2"> <div class="flex gap-2">
<ButtonStyled color="brand"> <ButtonStyled color="brand">
<button @click="createOrganization"> <button :disabled="disabled" @click="createOrganization">
<PlusIcon aria-hidden="true" /> <PlusIcon aria-hidden="true" />
Create organization Create organization
</button> </button>
@@ -73,7 +87,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { PlusIcon, XIcon } from '@modrinth/assets' import { PlusIcon, XIcon } from '@modrinth/assets'
import { ButtonStyled, injectNotificationManager, NewModal } from '@modrinth/ui' import { Admonition, ButtonStyled, injectNotificationManager, NewModal } from '@modrinth/ui'
import { ref } from 'vue' import { ref } from 'vue'
const router = useNativeRouter() const router = useNativeRouter()
@@ -85,6 +99,8 @@ const description = ref<string>('')
const manualSlug = ref<boolean>(false) const manualSlug = ref<boolean>(false)
const modal = ref<InstanceType<typeof NewModal>>() const modal = ref<InstanceType<typeof NewModal>>()
const disabled = ref(true)
async function createOrganization(): Promise<void> { async function createOrganization(): Promise<void> {
startLoading() startLoading()
try { try {