Revert "Additional categories + fix project creation" (#591)

This reverts commit 62e86f9507.
This commit is contained in:
Geometrically
2022-08-02 20:28:43 -07:00
committed by GitHub
parent 62e86f9507
commit 848e26eec6
4 changed files with 21 additions and 131 deletions

View File

@@ -54,18 +54,16 @@
<label>
<span>
<h3>Type<span class="required">*</span></h3>
<span class="no-padding">The type of project your project is.</span>
<span class="no-padding">The type of project of your project.</span>
</span>
<Multiselect
v-model="projectType"
placeholder="Select one"
label="display"
:options="projectTypes"
:searchable="false"
:close-on-select="true"
:show-labels="false"
:allow-empty="false"
@input="setCategories"
/>
</label>
<label>
@@ -108,7 +106,11 @@
<multiselect
id="categories"
v-model="categories"
:options="selectableCategories"
:options="
$tag.categories
.filter((x) => x.project_type === projectType.toLowerCase())
.map((it) => it.name)
"
:custom-label="
(value) => value.charAt(0).toUpperCase() + value.slice(1)
"
@@ -123,44 +125,13 @@
:limit="6"
:hide-selected="true"
placeholder="Choose categories"
@input="setCategories"
/>
</label>
<label>
<span>
<h3>Additional Categories</h3>
<span class="no-padding">
Select more categories that will help others <br />
find your project. These are searchable, but not <br />
displayed in search.
</span>
</span>
<multiselect
id="additional_categories"
v-model="additional_categories"
:show-no-results="false"
:options="selectableAdditionalCategories"
:custom-label="
(value) => value.charAt(0).toUpperCase() + value.slice(1)
"
:loading="$tag.categories.length === 0"
:multiple="true"
:searchable="false"
:close-on-select="false"
:clear-on-select="false"
:show-labels="false"
:max="255"
:limit="6"
:hide-selected="true"
placeholder="Choose additional categories"
@input="setCategories"
/>
</label>
<label>
<span>
<h3>Vanity URL (slug)<span class="required">*</span></h3>
<span class="slug-description"
>https://modrinth.com/{{ projectType.id }}/{{
>https://modrinth.com/{{ projectType.toLowerCase() }}/{{
slug ? slug : 'your-slug'
}}
</span>
@@ -431,7 +402,9 @@
:options="
$tag.loaders
.filter((x) =>
x.supported_project_types.includes(projectType.id)
x.supported_project_types.includes(
projectType.toLowerCase()
)
)
.map((it) => it.name)
"
@@ -576,7 +549,10 @@
You may upload multiple files, but this should only be used for
cases like sources or Javadocs.
</span>
<p v-if="projectType.id === 'modpack'" aria-label="Warning">
<p
v-if="projectType.toLowerCase() === 'modpack'"
aria-label="Warning"
>
Modpack support is currently in alpha, and you may encounter
issues. Our documentation includes instructions on
<a
@@ -602,9 +578,9 @@
class="file-input"
multiple
:accept="
projectType.id === 'modpack'
projectType.toLowerCase() === 'modpack'
? '.mrpack,application/x-modrinth-modpack+zip'
: projectType.id === 'mod'
: projectType.toLowerCase() === 'mod'
? '.jar,application/java-archive'
: '*'
"
@@ -1161,7 +1137,6 @@ export default {
body: '',
versions: [],
categories: [],
additional_categories: [],
issues_url: null,
source_url: null,
wiki_url: null,
@@ -1170,27 +1145,8 @@ export default {
license: null,
license_url: null,
selectableCategories: [],
selectableAdditionalCategories: [],
projectTypes: [
{
display: 'Mod / Plugin',
id: 'mod',
},
{
display: 'Modpack',
id: 'modpack',
},
{
display: 'Resource Pack',
id: 'resourcepack',
},
],
projectType: {
display: 'Mod / Plugin',
id: 'mod',
},
projectTypes: ['Mod', 'Modpack'],
projectType: 'Mod',
sideTypes: ['Required', 'Optional', 'Unsupported'],
clientSideType: 'Required',
@@ -1215,9 +1171,6 @@ export default {
savingAsDraft: false,
}
},
fetch() {
this.setCategories()
},
watch: {
license(newValue, oldValue) {
if (newValue == null) {
@@ -1246,23 +1199,6 @@ export default {
})
},
methods: {
setCategories() {
this.selectableCategories = this.$tag.categories
.filter(
(x) =>
x.project_type === this.projectType.id &&
!this.additional_categories.includes(x.name)
)
.map((it) => it.name)
this.selectableAdditionalCategories = this.$tag.categories
.filter(
(x) =>
x.project_type === this.projectType.id &&
!this.categories.includes(x.name)
)
.map((it) => it.name)
},
checkFields() {
const reviewConditions = this.body !== '' && this.versions.length > 0
if (
@@ -1320,7 +1256,7 @@ export default {
'data',
JSON.stringify({
title: this.name,
project_type: this.projectType.id,
project_type: this.projectType.toLowerCase(),
slug: this.slug,
description: this.description,
body: this.body,
@@ -1333,7 +1269,6 @@ export default {
},
],
categories: this.categories,
additional_categories: this.additional_categories,
issues_url: this.issues_url ? this.issues_url : null,
source_url: this.source_url ? this.source_url : null,
wiki_url: this.wiki_url ? this.wiki_url : null,