Revert "Additional categories + fix project creation" (#591)
This reverts commit 62e86f95076929907c4326a8b8ced482313e9854.
This commit is contained in:
parent
62e86f9507
commit
848e26eec6
@ -155,11 +155,6 @@ export default {
|
||||
component: resolve(__dirname, 'pages/search/modpacks.vue'),
|
||||
name: 'modpacks',
|
||||
},
|
||||
{
|
||||
path: '/resourcepacks',
|
||||
component: resolve(__dirname, 'pages/search/resourcepacks.vue'),
|
||||
name: 'resourcepacks',
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
@ -314,7 +309,7 @@ export default {
|
||||
},
|
||||
hooks: {
|
||||
render: {
|
||||
routeDone(url, result, context) {
|
||||
routeDone(url) {
|
||||
setTimeout(() => {
|
||||
axios
|
||||
.post(
|
||||
@ -328,12 +323,6 @@ export default {
|
||||
{
|
||||
headers: {
|
||||
'Modrinth-Admin': process.env.ARIADNE_ADMIN_KEY || 'feedbeef',
|
||||
'User-Agent':
|
||||
context.req.rawHeaders[
|
||||
context.req.rawHeaders.findIndex(
|
||||
(x) => x === 'User-Agent'
|
||||
) + 1
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -267,7 +267,7 @@
|
||||
:icon-url="result.icon_url"
|
||||
:client-side="result.client_side"
|
||||
:server-side="result.server_side"
|
||||
:categories="result.display_categories"
|
||||
:categories="result.categories"
|
||||
/>
|
||||
<div v-if="results && results.length === 0" class="no-results">
|
||||
<p>No results found for your query!</p>
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ResourcePacks',
|
||||
asyncData(ctx) {
|
||||
ctx.params.projectType = 'resourcepack'
|
||||
},
|
||||
head: {
|
||||
title: 'Resource Packs - Modrinth',
|
||||
meta: [
|
||||
{
|
||||
hid: 'apple-mobile-web-app-title',
|
||||
name: 'apple-mobile-web-app-title',
|
||||
content: 'Resource Packs - Modrinth',
|
||||
},
|
||||
{
|
||||
hid: 'og:title',
|
||||
name: 'og:title',
|
||||
content: 'Resource Packs - Modrinth',
|
||||
},
|
||||
{
|
||||
hid: 'og:url',
|
||||
name: 'og:url',
|
||||
content: `https://modrinth.com/resourcepacks`,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
Loading…
x
Reference in New Issue
Block a user