You've already forked AstralRinth
forked from didirus/AstralRinth
feat: introduce dependency injection framework (#4091)
* feat: migrate frontend notifications to dependency injection based notificaton manager * fix: lint * fix: issues * fix: compile error + notif binding issue * refactor: move org context to new DI setup * feat: migrate app notifications to DI + frontend styling * fix: sidebar issues * fix: dont use delete in computed * fix: import and prop issue * refactor: move handleError to main notification manager class * fix: lint & build * fix: merge issues * fix: lint issues * fix: lint issues --------- Signed-off-by: IMB11 <hendersoncal117@gmail.com> Signed-off-by: Cal H. <hendersoncal117@gmail.com>
This commit is contained in:
@@ -105,24 +105,25 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ChevronRightIcon,
|
||||
CheckIcon,
|
||||
XIcon,
|
||||
AsteriskIcon,
|
||||
LightBulbIcon,
|
||||
TriangleAlertIcon,
|
||||
CheckIcon,
|
||||
ChevronRightIcon,
|
||||
DropdownIcon,
|
||||
SendIcon,
|
||||
LightBulbIcon,
|
||||
ScaleIcon,
|
||||
InfoIcon,
|
||||
SendIcon,
|
||||
TriangleAlertIcon,
|
||||
XIcon,
|
||||
} from "@modrinth/assets";
|
||||
import { acceptTeamInvite, removeTeamMember } from "~/helpers/teams.js";
|
||||
import { nags } from "@modrinth/moderation";
|
||||
import { ButtonStyled } from "@modrinth/ui";
|
||||
import { useVIntl, defineMessages, type MessageDescriptor } from "@vintl/vintl";
|
||||
import type { Nag, NagContext, NagStatus } from "@modrinth/moderation";
|
||||
import { nags } from "@modrinth/moderation";
|
||||
import { ButtonStyled, injectNotificationManager } from "@modrinth/ui";
|
||||
import type { Project, User, Version } from "@modrinth/utils";
|
||||
import { defineMessages, useVIntl, type MessageDescriptor } from "@vintl/vintl";
|
||||
import type { Component } from "vue";
|
||||
import { acceptTeamInvite, removeTeamMember } from "~/helpers/teams.js";
|
||||
|
||||
const { addNotification } = injectNotificationManager();
|
||||
|
||||
interface Tags {
|
||||
rejectedStatuses: string[];
|
||||
@@ -433,14 +434,12 @@ async function acceptInvite(): Promise<void> {
|
||||
await acceptTeamInvite(props.project.team);
|
||||
await updateMembers();
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.success),
|
||||
text: formatMessage(messages.successJoin),
|
||||
type: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.error),
|
||||
text: formatMessage(messages.errorJoin),
|
||||
type: "error",
|
||||
@@ -456,14 +455,12 @@ async function declineInvite(): Promise<void> {
|
||||
await removeTeamMember(props.project.team, props.auth.user.id);
|
||||
await updateMembers();
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.success),
|
||||
text: formatMessage(messages.successDecline),
|
||||
type: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.error),
|
||||
text: formatMessage(messages.errorDecline),
|
||||
type: "error",
|
||||
|
||||
Reference in New Issue
Block a user