Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Merge branch 'prod' of github.com:modrinth/knossos into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Prospector committed Apr 1, 2024
2 parents 6182d55 + ae2d83c commit 3623ade
Show file tree
Hide file tree
Showing 16 changed files with 1,569 additions and 313 deletions.
1,033 changes: 1,033 additions & 0 deletions components/ui/ModerationChecklist.vue

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion composables/date.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'

// eslint-disable-next-line import/no-named-as-default-member
dayjs.extend(relativeTime)

export const useCurrentDate = () => useState('currentDate', () => Date.now())
Expand Down
2 changes: 1 addition & 1 deletion helpers/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const acceptTeamInvite = async (teamId) => {
}
export const removeSelfFromTeam = async (teamId) => {
const auth = await useAuth()
await removeTeamMember(teamId, auth.user.id)
await removeTeamMember(teamId, auth.value.user.id)
}
export const removeTeamMember = async (teamId, userId) => {
await useBaseFetch(`team/${teamId}/members/${userId}`, {
Expand Down
501 changes: 329 additions & 172 deletions layouts/default.vue

Large diffs are not rendered by default.

111 changes: 105 additions & 6 deletions locales/en-US/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
"auth.sign-in.2fa.placeholder": {
"message": "Enter code..."
},
"auth.sign-in.action.sign-in": {
"message": "Sign in"
},
"auth.sign-in.additional-options": {
"message": "<forgot-password-link>Forgot password?</forgot-password-link> • <create-account-link>Create an account</create-account-link>"
},
Expand Down Expand Up @@ -107,9 +104,6 @@
"auth.sign-up.password.label": {
"message": "Password"
},
"auth.sign-up.sign-in-option.action": {
"message": "Sign in"
},
"auth.sign-up.sign-in-option.title": {
"message": "Already have an account?"
},
Expand Down Expand Up @@ -179,6 +173,9 @@
"button.continue": {
"message": "Continue"
},
"button.create-a-project": {
"message": "Create a project"
},
"button.edit": {
"message": "Edit"
},
Expand All @@ -188,6 +185,12 @@
"button.save-changes": {
"message": "Save changes"
},
"button.sign-in": {
"message": "Sign in"
},
"button.sign-out": {
"message": "Sign out"
},
"collection.button.delete-icon": {
"message": "Delete icon"
},
Expand Down Expand Up @@ -290,6 +293,9 @@
"label.created-ago": {
"message": "Created {ago}"
},
"label.dashboard": {
"message": "Dashboard"
},
"label.delete": {
"message": "Delete"
},
Expand All @@ -302,6 +308,12 @@
"label.followed-projects": {
"message": "Followed projects"
},
"label.moderation": {
"message": "Moderation"
},
"label.notifications": {
"message": "Notifications"
},
"label.password": {
"message": "Password"
},
Expand All @@ -314,6 +326,9 @@
"label.scopes": {
"message": "Scopes"
},
"label.settings": {
"message": "Settings"
},
"label.title": {
"message": "Title"
},
Expand All @@ -323,6 +338,90 @@
"label.visibility": {
"message": "Visibility"
},
"layout.action.change-theme": {
"message": "Change theme"
},
"layout.action.get-modrinth-app": {
"message": "Get Modrinth App"
},
"layout.avatar.alt": {
"message": "Your avatar"
},
"layout.banner.add-email.button": {
"message": "Visit account settings"
},
"layout.banner.add-email.title": {
"message": "For security purposes, please enter your email on Modrinth."
},
"layout.banner.staging.description": {
"message": "The staging environment is running on a copy of the production Modrinth database. This is used for testing and debugging purposes, and may be running in-development versions of the Modrinth backend or frontend newer than the production instance."
},
"layout.banner.staging.title": {
"message": "You’re viewing Modrinth’s staging environment."
},
"layout.banner.verify-email.action": {
"message": "Re-send verification email"
},
"layout.banner.verify-email.title": {
"message": "For security purposes, please verify your email address on Modrinth."
},
"layout.footer.company.careers": {
"message": "Careers"
},
"layout.footer.company.privacy": {
"message": "Privacy"
},
"layout.footer.company.rules": {
"message": "Rules"
},
"layout.footer.company.terms": {
"message": "Terms"
},
"layout.footer.company.title": {
"message": "Company"
},
"layout.footer.interact.title": {
"message": "Interact"
},
"layout.footer.legal-disclaimer": {
"message": "NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT."
},
"layout.footer.open-source": {
"message": "Modrinth is <github-link>open source</github-link>."
},
"layout.footer.resources.blog": {
"message": "Blog"
},
"layout.footer.resources.docs": {
"message": "Docs"
},
"layout.footer.resources.status": {
"message": "Status"
},
"layout.footer.resources.support": {
"message": "Support"
},
"layout.footer.resources.title": {
"message": "Resources"
},
"layout.label.visit-your-profile": {
"message": "Visit your profile"
},
"layout.menu-toggle.action": {
"message": "Toggle menu"
},
"layout.meta.description": {
"message": "Download Minecraft mods, plugins, datapacks, shaders, resourcepacks, and modpacks on Modrinth. Discover and publish projects on Modrinth with a modern, easy to use interface and API."
},
"layout.meta.og-description": {
"message": "Discover and publish Minecraft content!"
},
"layout.nav.home": {
"message": "Home"
},
"layout.nav.search": {
"message": "Search"
},
"notification.error.title": {
"message": "An error occurred"
},
Expand Down
79 changes: 17 additions & 62 deletions pages/[type]/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -367,37 +367,6 @@
</div>
</div>
</div>
<div
v-if="currentMember && project.moderator_message"
class="universal-card moderation-card"
>
<h2 class="card-header">Message from the moderators:</h2>
<div v-if="project.moderator_message.body">
<p v-if="project.moderator_message.message" class="mod-message__title">
{{ project.moderator_message.message }}
</p>
</div>
<div
class="markdown-body"
v-html="
renderString(
project.moderator_message.body
? project.moderator_message.body
: project.moderator_message.message
)
"
/>
<div class="buttons status-buttons">
<button
v-if="tags.approvedStatuses.includes(project.status)"
class="iconified-button"
@click="clearMessage"
>
<ClearIcon />
Clear message
</button>
</div>
</div>
</div>
<section class="normal-page__content">
<ProjectMemberHeader
Expand All @@ -415,10 +384,6 @@
:auth="auth"
:tags="tags"
/>
<MessageBanner v-else-if="project.status === 'withheld'" message-type="warning">
{{ project.title }} has been removed from search by Modrinth's moderators. Please use
{{ project.title }} at your own risk.
</MessageBanner>
<MessageBanner v-if="project.status === 'archived'" message-type="warning">
{{ project.title }} has been archived. {{ project.title }} will not receive any further
updates unless the author decides to unarchive the project.
Expand Down Expand Up @@ -465,7 +430,9 @@
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/moderation`,
shown: !!currentMember,
shown:
!!currentMember &&
(isRejected(project) || isUnderReview(project) || isStaff(auth.user)),
},
]"
/>
Expand Down Expand Up @@ -755,6 +722,11 @@
</div>
</div>
</div>
<ModerationChecklist
v-if="auth.user && tags.staffRoles.includes(auth.user.role) && showModerationChecklist"
:project="project"
:reset-project="resetProject"
/>
</div>
</template>
<script setup>
Expand All @@ -769,10 +741,12 @@ import {
Checkbox,
ChartIcon,
renderString,
isRejected,
isUnderReview,
isStaff,
} from 'omorphia'
import CrownIcon from '~/assets/images/utils/crown.svg'
import CalendarIcon from '~/assets/images/utils/calendar.svg'
import ClearIcon from '~/assets/images/utils/clear.svg'
import DownloadIcon from '~/assets/images/utils/download.svg'
import UpdateIcon from '~/assets/images/utils/updated.svg'
import QueuedIcon from '~/assets/images/utils/list-end.svg'
Expand Down Expand Up @@ -815,6 +789,7 @@ import Breadcrumbs from '~/components/ui/Breadcrumbs.vue'
import { userCollectProject } from '~/composables/user.js'
import CollectionCreateModal from '~/components/ui/CollectionCreateModal.vue'
import OrganizationIcon from '~/assets/images/utils/organization.svg'
import ModerationChecklist from '~/components/ui/ModerationChecklist.vue'
const data = useNuxtApp()
const route = useRoute()
Expand Down Expand Up @@ -1040,31 +1015,6 @@ if (!route.name.startsWith('type-id-settings')) {
const onUserCollectProject = useClientTry(userCollectProject)
async function clearMessage() {
startLoading()
try {
await useBaseFetch(`project/${project.value.id}`, {
method: 'PATCH',
body: {
moderation_message: null,
moderation_message_body: null,
},
})
project.value.moderator_message = null
} catch (err) {
data.$notify({
group: 'main',
title: 'An error occurred',
text: err.data.description,
type: 'error',
})
}
stopLoading()
}
async function setProcessing() {
startLoading()
Expand Down Expand Up @@ -1207,6 +1157,11 @@ async function copyId() {
}
const collapsedChecklist = ref(false)
const showModerationChecklist = ref(false)
if (process.client && history && history.state && history.state.showChecklist) {
showModerationChecklist.value = true
}
</script>
<style lang="scss" scoped>
.header {
Expand Down
22 changes: 15 additions & 7 deletions pages/[type]/[id]/moderation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@
in mind that larger projects, especially modpacks, may require more time to review.
Certain holidays or events may also lead to delays depending on moderator availability.
Modrinth's moderators will leave a message below if they have any questions or concerns
for you. If your review has taken more than 48 hours, check our Discord or social media
for you.
</p>
<p>
If your review has taken more than 48 hours, check our
<a
class="text-link"
href="https://support.modrinth.com/en/articles/8793355-modrinth-project-review-times"
target="_blank"
>
support article on review times
</a>
for moderation delays.
</p>
</div>
Expand Down Expand Up @@ -65,8 +75,9 @@
<h2>Messages</h2>
<p>
This is a private conversation thread with the Modrinth moderators. They may message you
with issues concerning this project. Additionally, you are welcome to start a discussion
here regarding this project and its status.
with issues concerning this project. This thread is only checked when you submit your
project for review. For additional inquiries, contact
<a href="https://support.modrinth.com">Modrinth support</a>.
</p>
<ConversationThread
v-if="thread"
Expand Down Expand Up @@ -128,10 +139,7 @@ async function setStatus(status) {
method: 'PATCH',
body: data,
})
await useBaseFetch(`thread/${props.project.thread_id}/read`, {
method: 'POST',
body: data,
})
const project = props.project
project.status = status
await props.resetProject()
Expand Down
8 changes: 2 additions & 6 deletions pages/auth/sign-in.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/>

<button class="btn btn-primary continue-btn" @click="begin2FASignIn">
{{ formatMessage(messages.signInButton) }} <RightArrowIcon />
{{ formatMessage(commonMessages.signInButton) }} <RightArrowIcon />
</button>
</template>
<template v-else>
Expand Down Expand Up @@ -84,7 +84,7 @@
<NuxtTurnstile ref="turnstile" v-model="token" class="turnstile" />

<button class="btn btn-primary continue-btn centered-btn" @click="beginPasswordSignIn()">
{{ formatMessage(messages.signInButton) }} <RightArrowIcon />
{{ formatMessage(commonMessages.signInButton) }} <RightArrowIcon />
</button>

<div class="auth-form__additional-options">
Expand Down Expand Up @@ -135,10 +135,6 @@ const messages = defineMessages({
id: 'auth.sign-in.password.label',
defaultMessage: 'Password',
},
signInButton: {
id: 'auth.sign-in.action.sign-in',
defaultMessage: 'Sign in',
},
signInWithLabel: {
id: 'auth.sign-in.sign-in-with',
defaultMessage: 'Sign in with',
Expand Down
Loading

0 comments on commit 3623ade

Please sign in to comment.