Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
7 changes: 7 additions & 0 deletions packages/moderation/src/data/messages/summary/repeat-ip.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion packages/moderation/src/data/modpack-permissions-stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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',
Expand Down
3 changes: 2 additions & 1 deletion packages/moderation/src/data/nags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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[]
33 changes: 2 additions & 31 deletions packages/moderation/src/data/nags/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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({
Expand Down Expand Up @@ -182,35 +182,6 @@ export const coreNags: Nag[] = [
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({
Expand All @@ -232,7 +203,7 @@ 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({
Expand Down
2 changes: 2 additions & 0 deletions packages/moderation/src/data/nags/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export * from './core'
export * from './description'
export * from './links'
export * from './server-projects'
export * from './tags'

39 changes: 36 additions & 3 deletions packages/moderation/src/data/nags/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@ 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: 'verify-external-links',
title: defineMessage({
Expand All @@ -80,6 +110,7 @@ export const linksNags: Nag[] = [
status: 'warning',
shouldShow: (context: NagContext) => {
return (
!context.projectV3.minecraft_server &&
!isCommonUrl(context.project.source_url ?? null, commonLinkDomains.source) ||
!isCommonUrl(context.project.issues_url ?? null, commonLinkDomains.issues) ||
!isCommonUrl(context.project.discord_url ?? null, commonLinkDomains.discord)
Expand Down Expand Up @@ -107,9 +138,10 @@ export const linksNags: Nag[] = [
}),
status: 'required',
shouldShow: (context: NagContext) =>
isDiscordUrl(context.project.source_url ?? null) ||
isDiscordUrl(context.project.issues_url ?? null) ||
isDiscordUrl(context.project.wiki_url ?? null),
!context.projectV3.minecraft_server &&
isDiscordUrl(context.project.source_url ?? null) ||
isDiscordUrl(context.project.issues_url ?? null) ||
isDiscordUrl(context.project.wiki_url ?? null),
link: {
path: 'settings/links',
title: defineMessage({
Expand Down Expand Up @@ -141,6 +173,7 @@ export const linksNags: Nag[] = [
}

return (
!context.projectV3.minecraft_server &&
isLinkShortener(context.project.source_url ?? null) ||
isLinkShortener(context.project.issues_url ?? null) ||
isLinkShortener(context.project.wiki_url ?? null) ||
Expand Down
147 changes: 147 additions & 0 deletions packages/moderation/src/data/nags/server-projects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@

import { defineMessage } from '@modrinth/ui'
import type { Nag, NagContext } from '../../types/nags'

export const serverProjectsNags: Nag[] = [

/*
{
id: 'add-banner',
title: defineMessage({
id: 'nags.add-banner.title',
defaultMessage: 'Add a banner',
}),
description: defineMessage({
id: 'nags.add-banner.description',
defaultMessage:
"Add your server's banner.",
}),
status: 'suggestion',
shouldShow: (context: NagContext) => !!context.projectV3.minecraft_server && !context.projectV3.banner_url,
link: {
path: 'settings',
title: defineMessage({
id: 'nags.settings.title',
defaultMessage: 'Visit general settings',
}),
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
},
},
*/
{
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',
title: defineMessage({
id: 'nags.settings.title',
defaultMessage: 'Visit general settings',
}),
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
},
},
/*
{
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,
link: {
path: 'settings',
title: defineMessage({
id: 'nags.settings.title',
defaultMessage: 'Visit general settings',
}),
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
},
},
*/
{
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',
title: defineMessage({
id: 'nags.settings.title',
defaultMessage: 'Visit general settings',
}),
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
},
},
{
id: 'add-bedrock-address',
title: defineMessage({
id: 'nags.add-bedrock-address.title',
defaultMessage: 'Add a Bedrock address',
}),
description: defineMessage({
id: 'nags.add-bedrock-address.description',
defaultMessage:
"If your server supports connections from Bedrock Edition players, add the IP address and port they can use to join.",
}),
status: 'suggestion',
shouldShow: (context: NagContext) => !!context.projectV3.minecraft_server && !context.projectV3.minecraft_bedrock_server?.address,
link: {
path: 'settings',
title: defineMessage({
id: 'nags.settings.title',
defaultMessage: 'Visit general settings',
}),
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
},
},
/*
{
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) => !!context.projectV3.minecraft_server,
link: {
path: 'settings',
title: defineMessage({
id: 'nags.settings.title',
defaultMessage: 'Visit general settings',
}),
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
},
},
*/

]

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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',
Expand Down
7 changes: 5 additions & 2 deletions packages/moderation/src/data/stages/license.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BookTextIcon } from '@modrinth/assets'
import { BookTextIcon } from '@modrinth/assets';

import type { Stage } from '../../types/stage'
import type { Stage } from '../../types/stage';

const licensesNotRequiringSource: string[] = [
'LicenseRef-All-Rights-Reserved',
Expand All @@ -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',
Expand Down
26 changes: 15 additions & 11 deletions packages/moderation/src/data/stages/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,25 @@ const links: Stage = {
project.discord_url ||
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) {
text += (await import('../messages/checklist-text/links/donation/donations.md?raw')).default
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) {
text += (await import(`../messages/checklist-text/links/donation/donation.md?raw`)).default
.replace('{URL}', donation.url)
.replace('{PLATFORM}', donation.platform)
}
for (const donation of project.donation_urls) {
text += (await import(`../messages/checklist-text/links/donation/donation.md?raw`)).default
.replace('{URL}', donation.url)
.replace('{PLATFORM}', donation.platform)
}
}

return text
},
return text
},
actions: [
{
id: 'links_misused',
Expand Down
1 change: 1 addition & 0 deletions packages/moderation/src/data/stages/reupload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const reupload: Stage = {
id: 'reupload',
icon: CopyrightIcon,
guidance_url: 'https://modrinth.com/legal/rules',
shouldShow: (project, projectV3) => !projectV3?.minecraft_server,
actions: [
{
id: 'reupload_reupload',
Expand Down
1 change: 1 addition & 0 deletions packages/moderation/src/data/stages/status-alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const statusAlerts: Stage = {
weight: -999999,
suggestedStatus: 'flagged',
disablesActions: ['status_corrections_applied', 'status_account_issues'],
//TODO: don't show if this is a server
message: async () => (await import('../messages/status-alerts/private.md?raw')).default,
} as ButtonAction,
{
Expand Down
Loading
Loading