You've already forked AstralRinth
forked from didirus/AstralRinth
Merge commit 'df1499047ccc8f39d756d5beba60651237aca1c0' into beta
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -100,7 +100,6 @@ import {
|
||||
ScaleIcon,
|
||||
} from "@modrinth/assets";
|
||||
import { defineMessages, useVIntl } from "@vintl/vintl";
|
||||
import { useLocalStorage } from "@vueuse/core";
|
||||
import ConfettiExplosion from "vue-confetti-explosion";
|
||||
import Fuse from "fuse.js";
|
||||
import ModerationQueueCard from "~/components/ui/moderation/ModerationQueueCard.vue";
|
||||
@@ -215,7 +214,7 @@ watch(
|
||||
},
|
||||
);
|
||||
|
||||
const currentFilterType = useLocalStorage("moderation-current-filter-type", () => "All projects");
|
||||
const currentFilterType = ref("All projects");
|
||||
const filterTypes: readonly string[] = readonly([
|
||||
"All projects",
|
||||
"Modpacks",
|
||||
@@ -226,7 +225,7 @@ const filterTypes: readonly string[] = readonly([
|
||||
"Shaders",
|
||||
]);
|
||||
|
||||
const currentSortType = useLocalStorage("moderation-current-sort-type", () => "Oldest");
|
||||
const currentSortType = ref("Oldest");
|
||||
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
|
||||
|
||||
const currentPage = ref(1);
|
||||
@@ -287,8 +286,10 @@ const typeFiltered = computed(() => {
|
||||
const projectType = filterMap[currentFilterType.value];
|
||||
if (!projectType) return baseFiltered.value;
|
||||
|
||||
return baseFiltered.value.filter((queueItem) =>
|
||||
queueItem.project.project_types.includes(projectType),
|
||||
return baseFiltered.value.filter(
|
||||
(queueItem) =>
|
||||
queueItem.project.project_types.length > 0 &&
|
||||
queueItem.project.project_types[0] === projectType,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
import { DropdownSelect, Button, Pagination } from "@modrinth/ui";
|
||||
import { XIcon, SearchIcon, SortAscIcon, SortDescIcon, FilterIcon } from "@modrinth/assets";
|
||||
import { defineMessages, useVIntl } from "@vintl/vintl";
|
||||
import { useLocalStorage } from "@vueuse/core";
|
||||
import type { Report } from "@modrinth/utils";
|
||||
import Fuse from "fuse.js";
|
||||
import type { ExtendedReport } from "@modrinth/moderation";
|
||||
@@ -170,10 +169,10 @@ watch(
|
||||
},
|
||||
);
|
||||
|
||||
const currentFilterType = useLocalStorage("moderation-reports-filter-type", () => "All");
|
||||
const currentFilterType = ref("All");
|
||||
const filterTypes: readonly string[] = readonly(["All", "Unread", "Read"]);
|
||||
|
||||
const currentSortType = useLocalStorage("moderation-reports-sort-type", () => "Oldest");
|
||||
const currentSortType = ref("Oldest");
|
||||
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
|
||||
|
||||
const currentPage = ref(1);
|
||||
|
||||
Reference in New Issue
Block a user