Skip to content
Merged
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
32 changes: 0 additions & 32 deletions .github/workflows/dependency-review.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🎫 Auto Release – MSK-Scripts/msk-shop
name: 🎫 Auto Release

on:
push:
Expand Down
35 changes: 0 additions & 35 deletions app/(app)/integrations/discord/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,41 +212,6 @@ export default async function DiscordIntegrationPage({
);
}

function Stat({
label,
value,
accent,
}: {
label: string;
value: number;
accent?: boolean;
}) {
return (
<div
className={`rounded-lg px-4 py-2.5 border min-w-[100px] ${
accent
? 'bg-[var(--success-soft)] border-[var(--success-line)]'
: 'bg-elev/50 border-line backdrop-blur-sm'
}`}
>
<div
className={`text-[10px] uppercase tracking-[0.15em] font-semibold ${
accent ? 'text-[var(--success)]' : 'text-subtle'
}`}
>
{label}
</div>
<div
className={`text-2xl font-bold font-mono tabular-nums mt-0.5 ${
accent ? 'text-[var(--success)]' : 'text-fg'
}`}
>
{value}
</div>
</div>
);
}

function ServerList({ servers }: { servers: GuildRow[] }) {
const active = servers.filter((s) => s.botPresent);
const inactive = servers.filter((s) => !s.botPresent);
Expand Down
2 changes: 1 addition & 1 deletion app/order/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default async function OrderCheckoutPage({ params }: Props) {
// PaymentIntent — wenn schon vorhanden, müssten wir ihn retrieven; für MVP
// legen wir bei jedem Page-Load ggf. neu an (idempotent über order_id metadata).
let clientSecret: string;
let stripeAccountId: string = guildRow.stripe_account_id as string;
const stripeAccountId: string = guildRow.stripe_account_id as string;
try {
const pi = await createConnectPaymentIntent({
amountCents: order.amount_cents as number,
Expand Down
9 changes: 0 additions & 9 deletions bot/src/events/channelMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getChannelMode } from '../db/channelModes.js';

const IMAGE_EXT = /\.(png|jpe?g|gif|webp|bmp|svg)$/i;
const VIDEO_EXT = /\.(mp4|mov|webm|mkv|avi|m4v)$/i;
const URL_REGEX = /\bhttps?:\/\/\S+\.\S+\b/i;

function hasImageAttachment(message: Message, allowVideos: boolean): boolean {
for (const a of message.attachments.values()) {
Expand All @@ -20,14 +19,6 @@ function hasImageAttachment(message: Message, allowVideos: boolean): boolean {
return false;
}

function hasNonImageContent(message: Message): boolean {
const text = message.content?.trim() ?? '';
if (text.length === 0) return false;
// Reiner Bild-URL als Text-Inhalt ist ok.
if (URL_REGEX.test(text) && IMAGE_EXT.test(text)) return false;
return true;
}

export function registerChannelMode(client: Client): void {
client.on(Events.MessageCreate, async (message: Message) => {
try {
Expand Down
6 changes: 0 additions & 6 deletions components/AutoModForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export function AutoModForm({ guildId, initial }: Props) {
>
<FilterCard
title="Link-Filter"
icon=""
active={blockLinks}
summary={blockLinks ? 'Links blockiert (außer Whitelist)' : 'Aus'}
>
Expand Down Expand Up @@ -115,7 +114,6 @@ export function AutoModForm({ guildId, initial }: Props) {

<FilterCard
title="Caps-Filter"
icon=""
active={capsEnabled}
summary={capsEnabled ? 'Großbuchstaben begrenzt' : 'Aus'}
>
Expand Down Expand Up @@ -147,7 +145,6 @@ export function AutoModForm({ guildId, initial }: Props) {

<FilterCard
title="Mention-Spam"
icon=""
active={mentionsEnabled}
summary={mentionsEnabled ? 'Mention-Limit aktiv' : 'Aus'}
>
Expand Down Expand Up @@ -179,7 +176,6 @@ export function AutoModForm({ guildId, initial }: Props) {

<FilterCard
title="Verbotene Wörter"
icon=""
active={bannedWordsCount > 0}
summary={
bannedWordsCount > 0
Expand Down Expand Up @@ -218,13 +214,11 @@ export function AutoModForm({ guildId, initial }: Props) {

function FilterCard({
title,
icon,
active,
summary,
children,
}: {
title: string;
icon: string;
active: boolean;
summary: string;
children: React.ReactNode;
Expand Down
8 changes: 0 additions & 8 deletions components/EmbedCreatorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,6 @@ function renderInlineMarkdown(text: string): string {

// ============== Components-Editor (Link-Buttons in ActionRows) ==============

const BUTTON_STYLE_CLASSES: Record<NonNullable<LinkButton['style']>, string> = {
primary: 'bg-[#5865F2] text-white',
secondary: 'bg-[#4E5058] text-white',
success: 'bg-[#248046] text-white',
danger: 'bg-[#DA373C] text-white',
link: 'bg-[#4E5058] text-white',
};

const ACTION_STYLE_CLASSES: Record<NonNullable<LinkButton['style']>, string> = {
primary: 'bg-[#5865F2] text-white',
secondary: 'bg-[#4E5058] text-white',
Expand Down
2 changes: 1 addition & 1 deletion components/ModuleOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export function ModuleOverview({ guildId, modules, premium = false }: Props) {

{filtered.length === 0 ? (
<div className="rounded-lg border border-dashed border-line-strong p-10 text-center text-sm text-subtle">
Kein Modul gefunden für „{query}".
Kein Modul gefunden für „{query}&quot;.
</div>
) : (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3">
Expand Down
26 changes: 16 additions & 10 deletions components/Phase2FinishForms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,24 @@ export function InviteTrackerForm({
}) {
const [enabled, setEnabled] = useState(initialEnabled);
const [rows, setRows] = useState<InviteLeaderRow[] | null>(null);
const [loading, setLoading] = useState(false);
const [pending, startTransition] = useTransition();
const [fetched, setFetched] = useState(false);
const [, startTransition] = useTransition();

// loading wird abgeleitet — kein synchrones setState im Effect.
const loading = enabled && !fetched;

useEffect(() => {
if (!enabled || rows !== null) return;
setLoading(true);
listInviteLeaderboard(guildId)
.then((r) => {
if (r.ok && r.rows) setRows(r.rows);
})
.finally(() => setLoading(false));
}, [enabled, rows, guildId]);
if (!enabled || fetched) return;
let active = true;
listInviteLeaderboard(guildId).then((r) => {
if (!active) return;
if (r.ok && r.rows) setRows(r.rows);
setFetched(true);
});
return () => {
active = false;
};
}, [enabled, fetched, guildId]);

const toggle = (next: boolean) => {
setEnabled(next);
Expand Down
39 changes: 28 additions & 11 deletions components/TicketsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1182,16 +1182,23 @@ function TicketListView({
status: 'open' | 'closed';
}) {
const [tickets, setTickets] = useState<TicketSummary[] | null>(null);
const [loading, setLoading] = useState(true);
const [loadedKey, setLoadedKey] = useState<string | null>(null);
const [viewingId, setViewingId] = useState<string | null>(null);

const key = `${guildId}:${status}`;
const loading = loadedKey !== key;

useEffect(() => {
setLoading(true);
let active = true;
listTicketsForGuild(guildId, status).then((r) => {
if (!active) return;
if (r.ok && r.tickets) setTickets(r.tickets);
setLoading(false);
setLoadedKey(key);
});
}, [guildId, status]);
return () => {
active = false;
};
}, [guildId, status, key]);

if (loading) {
return (
Expand Down Expand Up @@ -1273,14 +1280,19 @@ function TicketListView({

function FeedbackView({ guildId }: { guildId: string }) {
const [data, setData] = useState<{ feedback: TicketFeedbackRow[]; avg: number } | null>(null);
const [loading, setLoading] = useState(true);
const [loadedGuild, setLoadedGuild] = useState<string | null>(null);
const loading = loadedGuild !== guildId;

useEffect(() => {
setLoading(true);
let active = true;
listTicketFeedbackForGuild(guildId).then((r) => {
if (!active) return;
if (r.ok) setData({ feedback: r.feedback ?? [], avg: r.avgRating ?? 0 });
setLoading(false);
setLoadedGuild(guildId);
});
return () => {
active = false;
};
}, [guildId]);

if (loading) {
Expand All @@ -1294,7 +1306,7 @@ function FeedbackView({ guildId }: { guildId: string }) {
return (
<div className="rounded-xl border border-dashed border-line-strong p-10 text-center">
<div className="text-sm text-fg-soft">
Noch kein Feedback. Aktiviere es in einem Panel unter „Feedback".
Noch kein Feedback. Aktiviere es in einem Panel unter „Feedback&quot;.
</div>
</div>
);
Expand Down Expand Up @@ -1352,16 +1364,21 @@ function TranscriptViewer({
ticket?: TicketSummary;
messages?: TranscriptMessageAct[];
} | null>(null);
const [loading, setLoading] = useState(true);
const [loadedId, setLoadedId] = useState<string | null>(null);
const loading = loadedId !== ticketId;

useEffect(() => {
setLoading(true);
let active = true;
getTicketTranscript(guildId, ticketId).then((r) => {
if (!active) return;
if (r.ok) {
setData({ ticket: r.ticket, messages: r.messages });
}
setLoading(false);
setLoadedId(ticketId);
});
return () => {
active = false;
};
}, [guildId, ticketId]);

return (
Expand Down
Loading