Compare commits
2 Commits
alex/labri
...
cal/fix-ja
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08b389eb9b | ||
|
|
d82515336c |
@@ -50,13 +50,35 @@
|
||||
</div>
|
||||
<div v-else-if="generatedMessage">
|
||||
<div>
|
||||
<ButtonStyled>
|
||||
<button class="mb-2" @click="useSimpleEditor = !useSimpleEditor">
|
||||
<template v-if="!useSimpleEditor">
|
||||
<ToggleLeftIcon aria-hidden="true" />
|
||||
Use simple mode
|
||||
</template>
|
||||
<template v-else>
|
||||
<ToggleRightIcon aria-hidden="true" />
|
||||
Use advanced mode
|
||||
</template>
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
<MarkdownEditor
|
||||
v-if="!useSimpleEditor"
|
||||
v-model="message"
|
||||
:max-height="400"
|
||||
placeholder="No message generated."
|
||||
:disabled="false"
|
||||
:heading-buttons="false"
|
||||
/>
|
||||
<textarea
|
||||
v-else
|
||||
v-model="message"
|
||||
type="text"
|
||||
class="bg-bg-input h-[400px] w-full rounded-lg border border-solid border-divider px-3 py-2 font-mono text-base"
|
||||
placeholder="No message generated."
|
||||
autocomplete="off"
|
||||
@input="persistState"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="isModpackPermissionsStage">
|
||||
@@ -324,6 +346,8 @@ import {
|
||||
CheckIcon,
|
||||
KeyboardIcon,
|
||||
EyeOffIcon,
|
||||
ToggleLeftIcon,
|
||||
ToggleRightIcon,
|
||||
} from "@modrinth/assets";
|
||||
import {
|
||||
checklist,
|
||||
@@ -368,7 +392,6 @@ import {
|
||||
type Stage,
|
||||
finalPermissionMessages,
|
||||
} from "@modrinth/moderation";
|
||||
import * as prettier from "prettier";
|
||||
import ModpackPermissionsFlow from "./ModpackPermissionsFlow.vue";
|
||||
import KeybindsModal from "./ChecklistKeybindsModal.vue";
|
||||
import { useModerationStore } from "~/store/moderation.ts";
|
||||
@@ -392,6 +415,7 @@ const isModpackPermissionsStage = computed(() => {
|
||||
return currentStageObj.value.id === "modpack-permissions";
|
||||
});
|
||||
|
||||
const useSimpleEditor = ref(false);
|
||||
const message = ref("");
|
||||
const generatedMessage = ref(false);
|
||||
const loadingMessage = ref(false);
|
||||
@@ -1118,19 +1142,7 @@ async function generateMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const formattedMessage = await prettier.format(fullMessage, {
|
||||
parser: "markdown",
|
||||
printWidth: 80,
|
||||
proseWrap: "always",
|
||||
tabWidth: 2,
|
||||
useTabs: false,
|
||||
});
|
||||
message.value = formattedMessage;
|
||||
} catch (formattingError) {
|
||||
console.warn("Failed to format markdown, using original:", formattingError);
|
||||
message.value = fullMessage;
|
||||
}
|
||||
message.value = fullMessage;
|
||||
|
||||
generatedMessage.value = true;
|
||||
} catch (error) {
|
||||
|
||||
@@ -512,7 +512,6 @@ pub async fn project_edit(
|
||||
moderation_message_body: v2_new_project.moderation_message_body,
|
||||
monetization_status: v2_new_project.monetization_status,
|
||||
side_types_migration_review_status: None, // Not to be exposed in v2
|
||||
loader_fields: HashMap::new(), // Loader fields are not a thing in v2
|
||||
};
|
||||
|
||||
// This returns 204 or failure so we don't need to do anything with it
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::database::redis::RedisPool;
|
||||
use crate::database::{self, models as db_models};
|
||||
use crate::file_hosting::{FileHost, FileHostPublicity};
|
||||
use crate::models;
|
||||
use crate::models::ids::{ProjectId, VersionId};
|
||||
use crate::models::ids::ProjectId;
|
||||
use crate::models::images::ImageContext;
|
||||
use crate::models::notifications::NotificationBody;
|
||||
use crate::models::pats::Scopes;
|
||||
@@ -250,8 +250,6 @@ pub struct EditProject {
|
||||
pub monetization_status: Option<MonetizationStatus>,
|
||||
pub side_types_migration_review_status:
|
||||
Option<SideTypesMigrationReviewStatus>,
|
||||
#[serde(flatten)]
|
||||
pub loader_fields: HashMap<String, serde_json::Value>,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
@@ -872,29 +870,6 @@ pub async fn project_edit(
|
||||
.await?;
|
||||
}
|
||||
|
||||
if !new_project.loader_fields.is_empty() {
|
||||
for version in db_models::DBVersion::get_many(
|
||||
&project_item.versions,
|
||||
&**pool,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
{
|
||||
super::versions::version_edit_helper(
|
||||
req.clone(),
|
||||
(VersionId::from(version.inner.id),),
|
||||
pool.clone(),
|
||||
redis.clone(),
|
||||
super::versions::EditVersion {
|
||||
fields: new_project.loader_fields.clone(),
|
||||
..Default::default()
|
||||
},
|
||||
session_queue.clone(),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
||||
// check new description and body for links to associated images
|
||||
// if they no longer exist in the description or body, delete them
|
||||
let checkable_strings: Vec<&str> =
|
||||
|
||||
@@ -169,6 +169,8 @@ import _TerminalSquareIcon from './icons/terminal-square.svg?component'
|
||||
import _TestIcon from './icons/test.svg?component'
|
||||
import _TextQuoteIcon from './icons/text-quote.svg?component'
|
||||
import _TimerIcon from './icons/timer.svg?component'
|
||||
import _ToggleLeftIcon from './icons/toggle-left.svg?component'
|
||||
import _ToggleRightIcon from './icons/toggle-right.svg?component'
|
||||
import _TransferIcon from './icons/transfer.svg?component'
|
||||
import _TrashIcon from './icons/trash.svg?component'
|
||||
import _TriangleAlertIcon from './icons/triangle-alert.svg?component'
|
||||
@@ -362,6 +364,8 @@ export const TerminalSquareIcon = _TerminalSquareIcon
|
||||
export const TestIcon = _TestIcon
|
||||
export const TextQuoteIcon = _TextQuoteIcon
|
||||
export const TimerIcon = _TimerIcon
|
||||
export const ToggleLeftIcon = _ToggleLeftIcon
|
||||
export const ToggleRightIcon = _ToggleRightIcon
|
||||
export const TransferIcon = _TransferIcon
|
||||
export const TrashIcon = _TrashIcon
|
||||
export const TriangleAlertIcon = _TriangleAlertIcon
|
||||
|
||||
1
packages/assets/icons/toggle-left.svg
Normal file
1
packages/assets/icons/toggle-left.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-toggle-left-icon lucide-toggle-left"><circle cx="9" cy="12" r="3"/><rect width="20" height="14" x="2" y="5" rx="7"/></svg>
|
||||
|
After Width: | Height: | Size: 324 B |
1
packages/assets/icons/toggle-right.svg
Normal file
1
packages/assets/icons/toggle-right.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-toggle-right-icon lucide-toggle-right"><circle cx="15" cy="12" r="3"/><rect width="20" height="14" x="2" y="5" rx="7"/></svg>
|
||||
|
After Width: | Height: | Size: 327 B |
Reference in New Issue
Block a user