mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
Add nag for custom license info. (#6564)
* add nag for custom license info * preppr
This commit is contained in:
@@ -202,6 +202,39 @@ export const coreNags: Nag[] = [
|
|||||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-project-settings-license',
|
shouldShow: (context: NagContext) => context.currentRoute !== 'type-project-settings-license',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'add-custom-license-details',
|
||||||
|
title: defineMessage({
|
||||||
|
id: 'nags.add-license-details.title',
|
||||||
|
defaultMessage: 'Add license details',
|
||||||
|
}),
|
||||||
|
description: (context: NagContext) => {
|
||||||
|
const { formatMessage } = useVIntl()
|
||||||
|
return formatMessage(
|
||||||
|
defineMessage({
|
||||||
|
id: 'nags.add-license-details.description',
|
||||||
|
defaultMessage: 'Add a valid URL and name or SPDX identifier for your custom license.',
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
type: formatProjectTypeSentence(formatMessage, context.project.project_type),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status: 'required',
|
||||||
|
shouldShow: (context: NagContext) =>
|
||||||
|
context.project.license.id === 'LicenseRef-' ||
|
||||||
|
((!context.project.license.url || context.project.license.url === '') &&
|
||||||
|
!context.projectV3?.minecraft_server &&
|
||||||
|
context.project.license.id !== 'LicenseRef-Unknown'),
|
||||||
|
link: {
|
||||||
|
path: 'settings/license',
|
||||||
|
title: defineMessage({
|
||||||
|
id: 'nags.settings.license.title',
|
||||||
|
defaultMessage: 'Visit license settings',
|
||||||
|
}),
|
||||||
|
shouldShow: (context: NagContext) => context.currentRoute !== 'type-project-settings-license',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'review-permissions',
|
id: 'review-permissions',
|
||||||
title: defineMessage({
|
title: defineMessage({
|
||||||
|
|||||||
@@ -17,6 +17,12 @@
|
|||||||
"nags.add-java-address.title": {
|
"nags.add-java-address.title": {
|
||||||
"defaultMessage": "Add a Java address"
|
"defaultMessage": "Add a Java address"
|
||||||
},
|
},
|
||||||
|
"nags.add-license-details.description": {
|
||||||
|
"defaultMessage": "Add a valid URL and name or SPDX identifier for your custom license."
|
||||||
|
},
|
||||||
|
"nags.add-license-details.title": {
|
||||||
|
"defaultMessage": "Add license details"
|
||||||
|
},
|
||||||
"nags.add-links-server.description": {
|
"nags.add-links-server.description": {
|
||||||
"defaultMessage": "Add any relevant links targeted outside of Modrinth, such as a website, store, or a Discord invite."
|
"defaultMessage": "Add any relevant links targeted outside of Modrinth, such as a website, store, or a Discord invite."
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user