feat: linked server instances (#5221)
* ping queue with tests * mc ping server info + timeout * sqlx prepare * tombi fmt * tombi fmt * allow querying server ping data * fix shear * wip: resolve comments with pings * Switch to Redis for server pings * tombi fmt * fix compile error * clear cache on project ping, add server store link * Schema changes * Improve server messages for app pinging * synthetic server project version for search indexing * wip: clean up server ping, background tasks * fix migration to sync with main, propagate background task errors * wip: server modpack content query, components in search * wip: massive component query refactor * fix more defaults stuff * sqlx * fix serde deser flatten * fix search indexing not showing fields * remove leftover prompt * fix import * add diff detection for version dependencies without version_id/project_id * move servers tab to end * hide app nav tabs if only one tab * fix undefined property * on click link for server side bar info * show recommended & supported versions for vanilla * fix how install.js installs instance with modpack content title instead of server project title and dont fetch icon when installing to existing instance * use large play button instance * show update success instead of launching right into the game * add global installing server project state * add comment * small change: open discover to modpack * implement ping server projects for latency in app * add projectV3 to nag context for moderation package * fix play server project button when instance is launched * add ping to project header * wip: server verified plays * server verified plays compiling * queue up server plays in batches * report server plays improved in frontend * fixes to tracking server joins * fix: server project detection to do loose null check * fix server projects showing license * fix empty server info card * fix server projects links title * Fix backend impl for server player count analytics * fix: allow for links to be set to empty * hook up server recent plays * cargo sqlx prepare * add project sidebar stories * feat: update project sidebar server info card to new design * update server project header and project card * feat: add hide label for project cards * feat: add tags sidebar card * small fix to keep color consistent * fix: remove required content tab from server project page * many small fixes * handle locking server instance content * fix hiding modal after saving server compatibility version * copy content card item and table from content tab update branch * fix nav tabs active tag * fix switching between server instance vs regular instance persisted invalid state * fix a lot of the bugginess of navtabs when theres hidden/shown tabs between instances. match frontend nav tabs * hook up backend searchfor frontend in websiet * fix: server project card tags * hook up search v3 in app backend for app frontend * Don't return missing components in project query * Add game versions to server filters * move reporting server joins to backend * send account UUID along with server play analytics * update java server ping schema * feat: implement use server search for search sorting and filter facets * pnpm prepr * fix game version filter facet * fix: allow java and bedrock addresses to be deleted * feat: hook up languages * Default deserialize `ProjectSerial` * feat: show server project tags * small fix on languages multi select * also default java server content * fix: update compatibility modal not closing after successful upload * remove play button in website discovery for servers * reenable fence in app backend * update online/offline tag * add online status indicator pulsing * revert pulsing * disable link for custom modpack project and show tooltip * change modpack to modded type * update ip address entire button to be clickable * polish server info card styles * make offline tag red and properly hook up online tag * move server related settings into own tab * fix setting project compatibility resets unsaved changes * fix javaServerPatchaData wiping content field * updates to compatibility card, add download button and display supported versions better * fix unsaved changes popup for tags * remove console.log * fix incorrect project type in projects in dashboard * fix: savable.ts to reset currentValues to data() after save * upload server banner as gallery image with title == "__mc_server_banner__" and filter it from frontend gallery * fix error handling and helper text copy * ensure gallery banners are filtered in app backend gallery display * add grouped filters for search * add query params for server search * feat: deep linking to open server project page then open install to play * fix search in app frontend * fix: server project showing offline * fix: profile create error app backend Here's what was happening and the fix: Root cause: In create.rs:107, profile_create assumed the icon_path parameter was always a local filename relative to the caches directory. It did caches_dir().join(icon) which produced a path like ...\caches\https://staging-cdn.modrinth.com/... — the colons in https:// are illegal in Windows paths (OS error 123). The frontend's installServerProject and createVanillaInstance in install.js:290 both pass project.icon_url (a full URL) directly as the icon parameter. Fix: Modified profile_create to detect when the icon parameter is a URL (starts with http:// or https://). When it is, it downloads the icon via fetch(), extracts the filename from the URL path, and passes the downloaded bytes and filename to set_icon() which hashes and caches it properly. The existing local-file path continues to work as before. * pass undefined instead of unknown for modpack content modal * fix: wrong way to determine offline status * delete required content page placeholder * fix: redirect running function instead of passing function * add in wiki page * fix diffs which have unknown project/filename * pnpm prepr * feat: add handling for "stop" instance state for server project card and page play button * fix updating modpack shouldn't launch right into game * small fix on external icon * fix refresh search causing infinite rerender i.e. maximum call stack size exceeded watch(route) → watch(() => [route.query.i, route.query.ai, route.path]) (line 102): The deep watch on the entire Vue Router route object was the most likely cause of the stack overflow. Vue Router's route object contains matched records with component definitions and other deeply nested structures. Deep-watching it triggers recursive traversal on every route change (including those from router.replace() inside refreshSearch()). Now it only watches the specific properties that updateInstanceContext() actually needs. ref → shallowRef for serverHits and serverPings (line 189-190): The v3 search results can be deeply nested objects (minecraft_java_server.ping.data, content, etc.). Using shallowRef prevents Vue from creating deep reactive proxies on these objects, which is consistent with how results already uses shallowRef on line 295. Re-entrance guard + try/catch on refreshSearch() (line 310): The watcher calls refreshSearch() without awaiting, so state changes during the async execution could trigger the watcher again, causing concurrent calls. The guard prevents overlapping calls, and the try/catch ensures loading.value = false is always reached (fixing the infinite loading). * don't require auth token for logging server play * fetch latest server player count from redis instead of search doc * remove components. in search facet * Category and search sort fixes * add logging for refreshSearch in browse.vue * fix: use windows.history.replace instead of router.replace due to vue production bug and remove logs * fix: server refresh search reactivity * fix: type errors * conquer the type errors in Browse.vue * update search input background * fix tags location * slight change to color * feat: add linked to modpack project for regular modpack instances * feat: installation tab updates * fix: copy ip missing hover effect * feat: implement category and countries negative filters * fix servers tab label in profile page * implement add server to instance * feat: implement allow editing server instances * update installation settings to handle vanilla server instance case * hide servers tab when installing content to instance * add sorting for user installed content to be top of list in content * update categories filters from one group filter card to separate filters cards * add active scale * fix offline server showing online * update language display * update tooltip * hide navtabs if theres only one tab * fix: modpack content name truncate in project card * feat: add server projects to moderation queue * update redirect middleware no longer needs projectV3 * update comment * fix: server tags labels * feat: add the mf icons finally * Revert "update redirect middleware no longer needs projectV3" This reverts commit 1289cb52869185abe1481dfb6b0c00c0233bf59e. * fix open in browser * revert any handling for handling base linked modpack content for content tab * update instance online players to be client ping * fix showing modpack/loader version for server instance in installation settings * server projects are not marked as modpacks * skip license check for server projects * feat: add the concept of linked worlds for server instances and keep in sync with server project * fix: router.push doesn't add history state, use nagivateTo instead * fix: get server modpack content wrong link * update some categories to default collapse * small fixes * optional languages & bedrock * move creator below tags * sort linked worlds to be first * add red orange and green ping variants * bring back content tab * add download button in required content in app * fix: server info card loading * fix: brief flash of normal project before server project stuff loads in * misc fixes * invalidate project v3 * fix unused imports * Quick pass for moderation related changes (#5429) * filter certain nags out from server projects. * move add-links nag to links.ts * first few server related nags * moderation checklist groundwork * Prevent undefined stage from appearing on servers. * add projectV3 to shouldShow callback * Filter buttons by server project type * fix, revert private use msg, adjust server & link nags * starting tags + servers msg * fix no projectV3 * fix: router.push doesn't add history state, use nagivateTo instead * Tags nag works with servers now * support servers' v3 exclusive links * reupload, and status messages + nag tweaks. * fixes * Update tags.vue warning for server projects. * don't suggest adding a bedrock IP * Tweak phrasing on servers alert msg --------- Signed-off-by: Truman Gao <106889354+tdgao@users.noreply.github.com> Co-authored-by: tdgao <mr.trumgao@gmail.com> Co-authored-by: Truman Gao <106889354+tdgao@users.noreply.github.com> * only show unique tags in project card * add projectV3 to cache purge * fix type: add projectV3 to cache purge * update caching behaviour for installing * max 3 plays per user * accept date_modified and date_created for sorting * add locking environment filter for server instance and update copy * custom pack button only shows when needed (#5444) * expose server pinging route to frontend * feat: add server field validation with pinging on unfocus * improve pinging logs * try another pinging crate * small fixes * prefill published project id for updating published project * fix running app bar for mac * cargo sqlx prepare * fix app login avatar * pnpm prepr * fix download menu for mac * FIX CI * fix lint errors * cargo fmt * fix toml * fix more lint * add server copy * more lint * fix any types * also ping unlisted and private servers * fix lint * remove option for showTypeSelector * fix cannot read user from undefined * pnpm prepr * update pinging to make it better * update copy * fix login cache issue * add project select default icon * fix: minecraft_java_server not redirecting * pnpm prepr * fix required content card in project page for custom modpack * fix app project cards custom modpacks * update pre-collapsed for app frontend * don't send server projects to discord webhook * add lock icon to linked world managed by server project * pnpm prepr * make automod msgs on server projects private * fix pagination for server projects tab * fix recent plays copy * fix sync linked world with server project * pnpm prepr * add 0.11.0 changelog * update date --------- Signed-off-by: Truman Gao <106889354+tdgao@users.noreply.github.com> Co-authored-by: aecsocket <aecsocket@tutanota.com> Co-authored-by: coolbot <76798835+coolbot100s@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
**Website:** %PROJECT_SITE_URL% \
|
||||
**Store:** %PROJECT_STORE_URL% \
|
||||
**Wiki:** %PROJECT_WIKI_URL% \
|
||||
**Discord:** %PROJECT_DISCORD_URL%
|
||||
@@ -0,0 +1,5 @@
|
||||
## Reuploads are forbidden
|
||||
|
||||
This server appears to have uploaded a Modpack by another creator.
|
||||
Per section 4 of %RULES%, we ask that you provide proof of your permission to distribute this pack on Modrinth.
|
||||
Either implicit permission abiding by the terms of the content's license(s) or explicit permission from the original creator of the pack.
|
||||
@@ -1,6 +1,6 @@
|
||||
## Private Use
|
||||
|
||||
Under normal circumstances, your project would be rejected due to the issues listed below.
|
||||
However, since your project is not intended for public use, these requirements will be waived and your project will be unlisted. This means it will remain accessible through a direct link without appearing in public search results, allowing you to share it privately.
|
||||
If you're okay with this, or submitted your project to be unlisted already, than no further action is necessary.
|
||||
Under normal circumstances, your project would be rejected due to the issues listed below.
|
||||
However, since your project is not intended for public use, these requirements will be waived and your project will be unlisted. This means it will remain accessible through a direct link without appearing in public search results, allowing you to share it privately.
|
||||
If you're okay with this, or submitted your project to be unlisted already, than no further action is necessary.
|
||||
If you would like to publish your project publicly, please address all moderation concerns before resubmitting this project.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
## Modded servers on Modrinth
|
||||
|
||||
Since your project is intended for use on a specific Minecraft server, we strongly recommend [listing your server with Modrinth](https://modrinth.com/discover/servers).
|
||||
|
||||
When creating a server project, you can connect it to any Modpack that already exists on Modrinth, or upload your content as a custom modpack.
|
||||
Adding a custom modpack to your server will save you time, only needing to manage one lightweight project page, and make finding, updating, and playing on your server much easier for your players.
|
||||
|
||||
We strongly encourage you to %LEARN_MORE_ABOUT_SERVERS_FLINK%.
|
||||
@@ -0,0 +1,7 @@
|
||||
## Insufficient Summary
|
||||
|
||||
Currently, your summary includes your server's Address, this is redundant information that should instead be appropriately listed in your server's %PROJECT_SETTINGS_FLINK%.
|
||||
|
||||
Your server's summary should provide a brief overview of your server that informs and entices players.
|
||||
|
||||
This is the first thing most people will see about your listing other than the Icon, so it's important it be accurate, reasonably detailed, and exciting.
|
||||
@@ -4,4 +4,4 @@ Per section 5.3 of %RULES%, your Summary can not be the same as your project's T
|
||||
|
||||
Your project summary should provide a brief overview of your project that informs and entices users.
|
||||
|
||||
This is the first thing most people will see about your mod other than the Logo, so it's important it be accurate, reasonably detailed, and exciting.
|
||||
This is the first thing most people will see about your mod other than the Icon, so it's important it be accurate, reasonably detailed, and exciting.
|
||||
|
||||
@@ -11,7 +11,8 @@ export default {
|
||||
// Replace me please.
|
||||
guidance_url:
|
||||
'https://www.notion.so/Content-Moderation-Cheat-Sheets-22d5ee711bf081a4920ef08879fe6bf5?source=copy_link#22d5ee711bf08116bd8bc1186f357062',
|
||||
shouldShow: (project: Labrinth.Projects.v2.Project) => project.project_type === 'modpack',
|
||||
shouldShow: (project: Labrinth.Projects.v2.Project, projectV3) =>
|
||||
project.project_type === 'modpack' && !projectV3?.minecraft_server,
|
||||
actions: [
|
||||
{
|
||||
id: 'button',
|
||||
|
||||
@@ -2,6 +2,13 @@ import type { Nag } from '../types/nags'
|
||||
import { coreNags } from './nags/core'
|
||||
import { descriptionNags } from './nags/description'
|
||||
import { linksNags } from './nags/links'
|
||||
import { serverProjectsNags } from './nags/server-projects'
|
||||
import { tagsNags } from './nags/tags'
|
||||
|
||||
export default [...coreNags, ...linksNags, ...descriptionNags, ...tagsNags] as Nag[]
|
||||
export default [
|
||||
...coreNags,
|
||||
...linksNags,
|
||||
...descriptionNags,
|
||||
...tagsNags,
|
||||
...serverProjectsNags,
|
||||
] as Nag[]
|
||||
|
||||
@@ -37,7 +37,8 @@ export const coreNags: Nag[] = [
|
||||
defaultMessage: 'At least one version is required for a project to be submitted for review.',
|
||||
}),
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => context.versions.length < 1,
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.versions.length < 1 && !context.projectV3?.minecraft_server,
|
||||
link: {
|
||||
path: 'settings/versions',
|
||||
title: defineMessage({
|
||||
@@ -147,6 +148,7 @@ export const coreNags: Nag[] = [
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) => {
|
||||
if (!!context.projectV3?.minecraft_server) return false
|
||||
const featuredGalleryImage = context.project.gallery?.find((img) => img.featured)
|
||||
return context.project?.gallery?.length === 0 || !featuredGalleryImage
|
||||
},
|
||||
@@ -159,58 +161,6 @@ export const coreNags: Nag[] = [
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-gallery',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-tags',
|
||||
title: defineMessage({
|
||||
id: 'nags.select-tags.title',
|
||||
defaultMessage: 'Select tags',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.select-tags.description',
|
||||
defaultMessage:
|
||||
'Select the tags that correctly apply to your project to help the right users find it.',
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.project.versions.length > 0 && context.project.categories.length < 1,
|
||||
link: {
|
||||
path: 'settings/tags',
|
||||
title: defineMessage({
|
||||
id: 'nags.settings.tags.title',
|
||||
defaultMessage: 'Visit tag settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-tags',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'add-links',
|
||||
title: defineMessage({
|
||||
id: 'nags.add-links.title',
|
||||
defaultMessage: 'Add external links',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.add-links.description',
|
||||
defaultMessage:
|
||||
'Add any relevant links targeted outside of Modrinth, such as source code, an issue tracker, or a Discord invite.',
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
!(
|
||||
context.project.issues_url ||
|
||||
context.project.source_url ||
|
||||
context.project.wiki_url ||
|
||||
context.project.discord_url ||
|
||||
context.project.donation_urls?.length
|
||||
),
|
||||
link: {
|
||||
path: 'settings/links',
|
||||
title: defineMessage({
|
||||
id: 'nags.settings.links.title',
|
||||
defaultMessage: 'Visit links settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-links',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-license',
|
||||
title: defineMessage({
|
||||
@@ -232,7 +182,8 @@ export const coreNags: Nag[] = [
|
||||
)
|
||||
},
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => context.project.license.id === 'LicenseRef-Unknown',
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.project.license.id === 'LicenseRef-Unknown' && !context.projectV3?.minecraft_server,
|
||||
link: {
|
||||
path: 'settings/license',
|
||||
title: defineMessage({
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './core'
|
||||
export * from './description'
|
||||
export * from './links'
|
||||
export * from './server-projects'
|
||||
export * from './tags'
|
||||
|
||||
@@ -66,6 +66,65 @@ export function isUncommonLicenseUrl(url: string | null): boolean {
|
||||
}
|
||||
|
||||
export const linksNags: Nag[] = [
|
||||
{
|
||||
id: 'add-links',
|
||||
title: defineMessage({
|
||||
id: 'nags.add-links.title',
|
||||
defaultMessage: 'Add external links',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.add-links.description',
|
||||
defaultMessage:
|
||||
'Add any relevant links targeted outside of Modrinth, such as source code, an issue tracker, or a Discord invite.',
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
!context.projectV3?.minecraft_server &&
|
||||
!(
|
||||
context.project.issues_url ||
|
||||
context.project.source_url ||
|
||||
context.project.wiki_url ||
|
||||
context.project.discord_url ||
|
||||
context.project.donation_urls?.length
|
||||
),
|
||||
link: {
|
||||
path: 'settings/links',
|
||||
title: defineMessage({
|
||||
id: 'nags.settings.links.title',
|
||||
defaultMessage: 'Visit links settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-links',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'add-links-server',
|
||||
title: defineMessage({
|
||||
id: 'nags.add-links-server.title',
|
||||
defaultMessage: 'Add external links',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.add-links-server.description',
|
||||
defaultMessage:
|
||||
'Add any relevant links targeted outside of Modrinth, such as a website, store, or a Discord invite.',
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) => {
|
||||
return !(
|
||||
context.projectV3?.link_urls?.site?.url ||
|
||||
context.projectV3?.link_urls?.store?.url ||
|
||||
context.projectV3?.link_urls?.discord?.url ||
|
||||
context.projectV3?.link_urls?.wiki?.url
|
||||
)
|
||||
},
|
||||
link: {
|
||||
path: 'settings/links',
|
||||
title: defineMessage({
|
||||
id: 'nags.settings.links.title',
|
||||
defaultMessage: 'Visit links settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-links',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'verify-external-links',
|
||||
title: defineMessage({
|
||||
@@ -109,7 +168,9 @@ export const linksNags: Nag[] = [
|
||||
shouldShow: (context: NagContext) =>
|
||||
isDiscordUrl(context.project.source_url ?? null) ||
|
||||
isDiscordUrl(context.project.issues_url ?? null) ||
|
||||
isDiscordUrl(context.project.wiki_url ?? null),
|
||||
isDiscordUrl(context.project.wiki_url ?? null) ||
|
||||
isDiscordUrl(context.projectV3?.link_urls?.site?.url ?? null) ||
|
||||
isDiscordUrl(context.projectV3?.link_urls?.store?.url ?? null),
|
||||
link: {
|
||||
path: 'settings/links',
|
||||
title: defineMessage({
|
||||
@@ -145,6 +206,8 @@ export const linksNags: Nag[] = [
|
||||
isLinkShortener(context.project.issues_url ?? null) ||
|
||||
isLinkShortener(context.project.wiki_url ?? null) ||
|
||||
isLinkShortener(context.project.discord_url ?? null) ||
|
||||
isLinkShortener(context.projectV3?.link_urls?.site?.url ?? null) ||
|
||||
isLinkShortener(context.projectV3?.link_urls?.store?.url ?? null) ||
|
||||
Boolean(context.project.license.url && isLinkShortener(context.project.license.url ?? null))
|
||||
)
|
||||
},
|
||||
|
||||
102
packages/moderation/src/data/nags/server-projects.ts
Normal file
102
packages/moderation/src/data/nags/server-projects.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import { defineMessage } from '@modrinth/ui'
|
||||
import type { Nag, NagContext } from '../../types/nags'
|
||||
|
||||
export const serverProjectsNags: Nag[] = [
|
||||
{
|
||||
id: 'select-country',
|
||||
title: defineMessage({
|
||||
id: 'nags.select-country.title',
|
||||
defaultMessage: 'Select a country',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.select-country.description',
|
||||
defaultMessage: 'Let players know what country your server is located in.',
|
||||
}),
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) =>
|
||||
!!context.projectV3?.minecraft_server && !context.projectV3?.minecraft_server.country,
|
||||
link: {
|
||||
path: 'settings/server',
|
||||
title: defineMessage({
|
||||
id: 'nags.server.title',
|
||||
defaultMessage: 'Visit server settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-server',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-language',
|
||||
title: defineMessage({
|
||||
id: 'nags.select-language.title',
|
||||
defaultMessage: 'Select a language',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.select-language.description',
|
||||
defaultMessage: 'List the language or languages supported by your server.',
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
!!context.projectV3?.minecraft_server &&
|
||||
context.projectV3?.minecraft_server?.languages?.length === 0,
|
||||
link: {
|
||||
path: 'settings/server',
|
||||
title: defineMessage({
|
||||
id: 'nags.server.title',
|
||||
defaultMessage: 'Visit server settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-server',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'add-java-address',
|
||||
title: defineMessage({
|
||||
id: 'nags.add-java-address.title',
|
||||
defaultMessage: 'Add a Java address',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.add-java-address.description',
|
||||
defaultMessage:
|
||||
'Add the IP address and port Java Edition players can use to join your server.',
|
||||
}),
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) =>
|
||||
!!context.projectV3?.minecraft_server && !context.projectV3?.minecraft_java_server?.address,
|
||||
link: {
|
||||
path: 'settings/server',
|
||||
title: defineMessage({
|
||||
id: 'nags.server.title',
|
||||
defaultMessage: 'Visit server settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-server',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-compatibility',
|
||||
title: defineMessage({
|
||||
id: 'nags.select-compatibility.title',
|
||||
defaultMessage: 'Select compatibility',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.select-compatibility.description',
|
||||
defaultMessage:
|
||||
'Select what versions your server supports, choose a Modpack, or upload your own.',
|
||||
}),
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => {
|
||||
if (
|
||||
context.projectV3?.minecraft_java_server?.content?.kind === 'vanilla' &&
|
||||
!context.projectV3?.minecraft_java_server?.content?.recommended_game_version
|
||||
)
|
||||
return true
|
||||
return false
|
||||
},
|
||||
link: {
|
||||
path: 'settings/server',
|
||||
title: defineMessage({
|
||||
id: 'nags.server.title',
|
||||
defaultMessage: 'Visit server settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-server',
|
||||
},
|
||||
},
|
||||
]
|
||||
@@ -6,6 +6,7 @@ import type { Nag, NagContext } from '../../types/nags'
|
||||
const allResolutionTags = ['8x-', '16x', '32x', '48x', '64x', '128x', '256x', '512x+']
|
||||
|
||||
const MAX_TAG_COUNT = 8
|
||||
const MAX_TAG_COUNT_SERVER = 18
|
||||
|
||||
function getCategories(
|
||||
project: Labrinth.Projects.v2.Project & { actualProjectType: string },
|
||||
@@ -23,6 +24,29 @@ function getCategories(
|
||||
}
|
||||
|
||||
export const tagsNags: Nag[] = [
|
||||
{
|
||||
id: 'select-tags',
|
||||
title: defineMessage({
|
||||
id: 'nags.select-tags.title',
|
||||
defaultMessage: 'Select tags',
|
||||
}),
|
||||
description: defineMessage({
|
||||
id: 'nags.select-tags.description',
|
||||
defaultMessage:
|
||||
'Select the tags that correctly apply to your project to help the right users find it.',
|
||||
}),
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.project.versions.length > 0 && context.project.categories.length < 1,
|
||||
link: {
|
||||
path: 'settings/tags',
|
||||
title: defineMessage({
|
||||
id: 'nags.settings.tags.title',
|
||||
defaultMessage: 'Visit tag settings',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-tags',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'too-many-tags',
|
||||
title: defineMessage({
|
||||
@@ -49,9 +73,49 @@ export const tagsNags: Nag[] = [
|
||||
},
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
if (context.projectV3?.minecraft_java_server) return false
|
||||
const tagCount =
|
||||
context.project.categories.length + (context.project.additional_categories?.length || 0)
|
||||
return tagCount > MAX_TAG_COUNT
|
||||
return tagCount > MAX_TAG_COUNT && !context.projectV3?.minecraft_server
|
||||
},
|
||||
link: {
|
||||
path: 'settings/tags',
|
||||
title: defineMessage({
|
||||
id: 'nags.edit-tags.title',
|
||||
defaultMessage: 'Edit tags',
|
||||
}),
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-tags',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'too-many-tags-server',
|
||||
title: defineMessage({
|
||||
id: 'nags.too-many-tags-server.title',
|
||||
defaultMessage: 'Select accurate tags',
|
||||
}),
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
const tagCount =
|
||||
context.project.categories.length + (context.project.additional_categories?.length || 0)
|
||||
const maxTagCount = MAX_TAG_COUNT_SERVER
|
||||
|
||||
return formatMessage(
|
||||
defineMessage({
|
||||
id: 'nags.too-many-tags-server.description',
|
||||
defaultMessage:
|
||||
"You've selected {tagCount, plural, one {# tag} other {# tags}}. Please reduce to {maxTagCount} or fewer to make sure your server appears in relevant search results.",
|
||||
}),
|
||||
{
|
||||
tagCount,
|
||||
maxTagCount,
|
||||
},
|
||||
)
|
||||
},
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const tagCount =
|
||||
context.project.categories.length + (context.project.additional_categories?.length || 0)
|
||||
return tagCount > MAX_TAG_COUNT_SERVER && context.projectV3?.minecraft_server != null
|
||||
},
|
||||
link: {
|
||||
path: 'settings/tags',
|
||||
|
||||
@@ -11,7 +11,8 @@ const environmentMultiple: Stage = {
|
||||
guidance_url: 'https://modrinth.com/legal/rules#miscellaneous',
|
||||
text: async () =>
|
||||
(await import('../../messages/checklist-text/environment/environment-multiple.md?raw')).default,
|
||||
shouldShow: (project, projectV3) => (projectV3?.environment?.length ?? 0) !== 1,
|
||||
shouldShow: (project, projectV3) =>
|
||||
(projectV3?.environment?.length ?? 0) !== 1 && !projectV3?.minecraft_server,
|
||||
actions: [
|
||||
{
|
||||
id: 'side_types_inaccurate',
|
||||
|
||||
@@ -11,7 +11,8 @@ const environment: Stage = {
|
||||
guidance_url: 'https://modrinth.com/legal/rules#miscellaneous',
|
||||
text: async () =>
|
||||
(await import('../../messages/checklist-text/environment/environment.md?raw')).default,
|
||||
shouldShow: (project, projectV3) => (projectV3?.environment?.length ?? 0) === 1,
|
||||
shouldShow: (project, projectV3) =>
|
||||
(projectV3?.environment?.length ?? 0) === 1 && !projectV3?.minecraft_server,
|
||||
actions: [
|
||||
{
|
||||
id: 'side_types_inaccurate',
|
||||
|
||||
@@ -17,6 +17,7 @@ const gallery: Stage = {
|
||||
weight: 900,
|
||||
suggestedStatus: 'flagged',
|
||||
severity: 'low',
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () => (await import('../messages/gallery/insufficient.md?raw')).default,
|
||||
} as ButtonAction,
|
||||
{
|
||||
|
||||
@@ -26,6 +26,9 @@ const licenseStage: Stage = {
|
||||
icon: BookTextIcon,
|
||||
guidance_url: 'https://modrinth.com/legal/rules#miscellaneous',
|
||||
navigate: '/settings/license',
|
||||
shouldShow(project, projectV3) {
|
||||
return !projectV3?.minecraft_server
|
||||
},
|
||||
actions: [
|
||||
{
|
||||
id: 'license_invalid_link',
|
||||
|
||||
@@ -9,18 +9,23 @@ const links: Stage = {
|
||||
icon: LinkIcon,
|
||||
guidance_url: 'https://modrinth.com/legal/rules',
|
||||
navigate: '/settings/links',
|
||||
shouldShow: (project) =>
|
||||
shouldShow: (project, projectV3) =>
|
||||
Boolean(
|
||||
project.issues_url ||
|
||||
project.source_url ||
|
||||
project.wiki_url ||
|
||||
project.discord_url ||
|
||||
projectV3?.link_urls?.site ||
|
||||
projectV3?.link_urls?.store ||
|
||||
project.donation_urls.length > 0,
|
||||
),
|
||||
text: async (project) => {
|
||||
let text = (await import('../messages/checklist-text/links/base.md?raw')).default
|
||||
text: async (project, projectV3) => {
|
||||
let text
|
||||
if (!!projectV3?.minecraft_server)
|
||||
text = (await import('../messages/checklist-text/links/server.md?raw')).default
|
||||
else text = (await import('../messages/checklist-text/links/base.md?raw')).default
|
||||
|
||||
if (project.donation_urls.length > 0) {
|
||||
if (project.donation_urls && project.donation_urls.length > 0) {
|
||||
text += (await import('../messages/checklist-text/links/donation/donations.md?raw')).default
|
||||
|
||||
for (const donation of project.donation_urls) {
|
||||
|
||||
@@ -16,12 +16,14 @@ const reupload: Stage = {
|
||||
weight: 1100,
|
||||
suggestedStatus: 'rejected',
|
||||
severity: 'high',
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () => (await import('../messages/reupload/reupload.md?raw')).default,
|
||||
disablesActions: [
|
||||
'reupload_unclear_fork',
|
||||
'reupload_insufficient_fork',
|
||||
'reupload_request_proof',
|
||||
'reupload_identity_verification',
|
||||
'reupload_request_proof_server',
|
||||
],
|
||||
relevantExtraInput: [
|
||||
{
|
||||
@@ -45,12 +47,14 @@ const reupload: Stage = {
|
||||
weight: 1100,
|
||||
suggestedStatus: 'rejected',
|
||||
severity: 'high',
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () => (await import('../messages/reupload/fork.md?raw')).default,
|
||||
disablesActions: [
|
||||
'reupload_reupload',
|
||||
'reupload_insufficient_fork',
|
||||
'reupload_request_proof',
|
||||
'reupload_identity_verification',
|
||||
'reupload_request_proof_server',
|
||||
],
|
||||
} as ButtonAction,
|
||||
{
|
||||
@@ -60,12 +64,14 @@ const reupload: Stage = {
|
||||
weight: 1100,
|
||||
suggestedStatus: 'rejected',
|
||||
severity: 'high',
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () => (await import('../messages/reupload/insufficient_fork.md?raw')).default,
|
||||
disablesActions: [
|
||||
'reupload_unclear_fork',
|
||||
'reupload_reupload',
|
||||
'reupload_request_proof',
|
||||
'reupload_identity_verification',
|
||||
'reupload_request_proof_server',
|
||||
],
|
||||
} as ButtonAction,
|
||||
{
|
||||
@@ -82,6 +88,7 @@ const reupload: Stage = {
|
||||
'reupload_unclear_fork',
|
||||
'reupload_insufficient_fork',
|
||||
'reupload_identity_verification',
|
||||
'reupload_request_proof_server',
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -91,6 +98,7 @@ const reupload: Stage = {
|
||||
weight: 1100,
|
||||
suggestedStatus: 'rejected',
|
||||
severity: 'high',
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () =>
|
||||
(await import('../messages/reupload/identity_verification.md?raw')).default,
|
||||
relevantExtraInput: [
|
||||
@@ -104,6 +112,27 @@ const reupload: Stage = {
|
||||
'reupload_reupload',
|
||||
'reupload_insufficient_fork',
|
||||
'reupload_request_proof',
|
||||
'reupload_request_proof_server',
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'reupload_request_proof_server',
|
||||
type: 'button',
|
||||
label: 'Custom modpack permissions',
|
||||
weight: 1100,
|
||||
suggestedStatus: 'rejected',
|
||||
severity: 'high',
|
||||
shouldShow: (project, projectV3) =>
|
||||
!!projectV3?.minecraft_server &&
|
||||
projectV3?.minecraft_java_server?.content?.kind === 'modpack' &&
|
||||
projectV3?.minecraft_java_server?.content?.['project_id'] === project.id,
|
||||
message: async () => (await import('../messages/reupload/custom_server.md?raw')).default,
|
||||
disablesActions: [
|
||||
'reupload_reupload',
|
||||
'reupload_unclear_fork',
|
||||
'reupload_insufficient_fork',
|
||||
'reupload_identity_verification',
|
||||
'reupload_request_proof',
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -40,8 +40,19 @@ const statusAlerts: Stage = {
|
||||
weight: -999999,
|
||||
suggestedStatus: 'flagged',
|
||||
disablesActions: ['status_corrections_applied', 'status_account_issues'],
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () => (await import('../messages/status-alerts/private.md?raw')).default,
|
||||
} as ButtonAction,
|
||||
{
|
||||
id: 'status_server_use',
|
||||
type: 'button',
|
||||
label: 'Server use',
|
||||
weight: -999999,
|
||||
suggestedStatus: 'flagged',
|
||||
disablesActions: ['status_corrections_applied', 'status_account_issues'],
|
||||
shouldShow: (project) => project.project_type === 'modpack',
|
||||
message: async () => (await import('../messages/status-alerts/serverpack.md?raw')).default,
|
||||
} as ButtonAction,
|
||||
{
|
||||
id: 'status_account_issues',
|
||||
type: 'button',
|
||||
@@ -95,6 +106,14 @@ const statusAlerts: Stage = {
|
||||
message: async () =>
|
||||
(await import('../messages/status-alerts/automod_confusion.md?raw')).default,
|
||||
} as ButtonAction,
|
||||
{
|
||||
id: 'status_serverpack',
|
||||
type: 'button',
|
||||
label: `Serverpack`,
|
||||
weight: -999999,
|
||||
shouldShow: (project) => project.project_type === 'modpack',
|
||||
message: async () => (await import('../messages/status-alerts/serverpack.md?raw')).default,
|
||||
} as ButtonAction,
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,16 @@ const summary: Stage = {
|
||||
severity: 'medium',
|
||||
message: async () => (await import('../messages/summary/non-english.md?raw')).default,
|
||||
} as ButtonAction,
|
||||
{
|
||||
id: 'summary_repeat_ip',
|
||||
type: 'button',
|
||||
label: 'Repeat of IP',
|
||||
weight: 303,
|
||||
suggestedStatus: 'flagged',
|
||||
severity: 'medium',
|
||||
shouldShow: (project, projectV3) => !!projectV3?.minecraft_server,
|
||||
message: async () => (await import('../messages/summary/repeat-ip.md?raw')).default,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ const titleSlug: Stage = {
|
||||
{
|
||||
label: 'Forked project',
|
||||
weight: 112,
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
message: async () =>
|
||||
(await import('../messages/title/similarities-fork.md?raw')).default,
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ const undefinedProjectStage: Stage = {
|
||||
icon: XIcon,
|
||||
guidance_url: 'https://modrinth.com/legal/rules#miscellaneous',
|
||||
navigate: '/versions',
|
||||
shouldShow: (project) => project.versions.length === 0,
|
||||
shouldShow: (project, projectV3) => project.versions.length === 0 && !projectV3?.minecraft_server,
|
||||
actions: [
|
||||
{
|
||||
id: 'undefined_no_versions',
|
||||
|
||||
@@ -9,6 +9,7 @@ const versions: Stage = {
|
||||
icon: VersionIcon,
|
||||
guidance_url: 'https://modrinth.com/legal/rules#miscellaneous',
|
||||
navigate: '/versions',
|
||||
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
|
||||
actions: [
|
||||
{
|
||||
id: 'versions_incorrect_additional',
|
||||
|
||||
Reference in New Issue
Block a user