@burdenoff/microfe-channel 2026.1013.2 → 2026.1114.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channel/ChannelRoot.d.ts +0 -2
- package/dist/channel/ChannelRoot.js +9 -6
- package/dist/channel/ChannelRoot.js.map +1 -1
- package/dist/channel/ChannelRoutes.d.ts +1 -2
- package/dist/channel/ChannelRoutes.js +5 -6
- package/dist/channel/ChannelRoutes.js.map +1 -1
- package/dist/channel/components/AdapterCredentialsForm.d.ts +2 -4
- package/dist/channel/components/AdapterCredentialsForm.js +1 -2
- package/dist/channel/components/AdapterCredentialsForm.js.map +1 -1
- package/dist/channel/components/FeatureNotEnabled.d.ts +1 -2
- package/dist/channel/components/FeatureNotEnabled.js +1 -2
- package/dist/channel/components/FeatureNotEnabled.js.map +1 -1
- package/dist/channel/components/MarkdownEditor.d.ts +1 -2
- package/dist/channel/components/MarkdownEditor.js +2 -5
- package/dist/channel/components/MarkdownEditor.js.map +1 -1
- package/dist/channel/components/PermissionGuard.d.ts +0 -2
- package/dist/channel/components/PermissionGuard.js +1 -2
- package/dist/channel/components/PermissionGuard.js.map +1 -1
- package/dist/channel/config/adapterCredentials.d.ts +0 -2
- package/dist/channel/config/adapterCredentials.js +3 -7
- package/dist/channel/config/adapterCredentials.js.map +1 -1
- package/dist/channel/constants/permissions.d.ts +0 -1
- package/dist/channel/constants/permissions.js +1 -2
- package/dist/channel/constants/permissions.js.map +1 -1
- package/dist/channel/graphql/global-client.d.ts +0 -2
- package/dist/channel/graphql/global-client.js +5 -6
- package/dist/channel/graphql/global-client.js.map +1 -1
- package/dist/channel/hooks/useChannelOrgSettings.d.ts +0 -2
- package/dist/channel/hooks/useChannelOrgSettings.js +20 -21
- package/dist/channel/hooks/useChannelOrgSettings.js.map +1 -1
- package/dist/channel/hooks/useChannelSubscription.d.ts +0 -1
- package/dist/channel/hooks/useChannelSubscription.js +7 -12
- package/dist/channel/hooks/useChannelSubscription.js.map +1 -1
- package/dist/channel/hooks/useChannels.d.ts +20 -30
- package/dist/channel/hooks/useChannels.js +100 -101
- package/dist/channel/hooks/useChannels.js.map +1 -1
- package/dist/channel/hooks/useTr.d.ts +0 -1
- package/dist/channel/hooks/useTr.js +1 -2
- package/dist/channel/hooks/useTr.js.map +1 -1
- package/dist/channel/index.d.ts +0 -1
- package/dist/channel/index.js +3 -2
- package/dist/channel/modules/channels/hooks/useExport.d.ts +0 -2
- package/dist/channel/modules/channels/hooks/useExport.js +77 -80
- package/dist/channel/modules/channels/hooks/useExport.js.map +1 -1
- package/dist/channel/modules/channels/i18n.d.ts +0 -2
- package/dist/channel/modules/channels/i18n.js +1 -2
- package/dist/channel/modules/channels/i18n.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js +10 -11
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js +400 -401
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +8 -7
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js +5 -10
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelsListPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ChannelsListPage.js +287 -288
- package/dist/channel/modules/channels/pages/ChannelsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +11 -12
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js +1 -2
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/CreateChannelPage.js +4 -5
- package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateConnectionPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js +37 -38
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +7 -12
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/EditChannelPage.js +105 -103
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditConnectionPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/EditConnectionPage.js +22 -23
- package/dist/channel/modules/channels/pages/EditConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/SendMessagePage.js +180 -187
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.d.ts +1 -2
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js +144 -149
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
- package/dist/channel/pages/ChannelLandingPage.d.ts +1 -2
- package/dist/channel/pages/ChannelLandingPage.js +20 -21
- package/dist/channel/pages/ChannelLandingPage.js.map +1 -1
- package/dist/channel/providers/ChannelProvider.d.ts +0 -2
- package/dist/channel/providers/ChannelProvider.js +1 -2
- package/dist/channel/providers/ChannelProvider.js.map +1 -1
- package/dist/channel/types/index.d.ts +0 -2
- package/dist/channel/utils/shellBridge.d.ts +0 -1
- package/dist/channel/utils/shellBridge.js +1 -2
- package/dist/channel/utils/shellBridge.js.map +1 -1
- package/dist/dev/App.d.ts +1 -2
- package/dist/dev/main.d.ts +0 -2
- package/dist/generated/global-operations.d.ts +885 -336
- package/dist/generated/global-operations.js +2 -3
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +4 -2
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/translations/en.d.ts +0 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +65 -43
- package/dist/channel/ChannelRoot.d.ts.map +0 -1
- package/dist/channel/ChannelRoutes.d.ts.map +0 -1
- package/dist/channel/components/AdapterCredentialsForm.d.ts.map +0 -1
- package/dist/channel/components/FeatureNotEnabled.d.ts.map +0 -1
- package/dist/channel/components/MarkdownEditor.d.ts.map +0 -1
- package/dist/channel/components/PermissionGuard.d.ts.map +0 -1
- package/dist/channel/config/adapterCredentials.d.ts.map +0 -1
- package/dist/channel/constants/permissions.d.ts.map +0 -1
- package/dist/channel/graphql/global-client.d.ts.map +0 -1
- package/dist/channel/hooks/useChannelOrgSettings.d.ts.map +0 -1
- package/dist/channel/hooks/useChannelSubscription.d.ts.map +0 -1
- package/dist/channel/hooks/useChannels.d.ts.map +0 -1
- package/dist/channel/hooks/useTr.d.ts.map +0 -1
- package/dist/channel/index.d.ts.map +0 -1
- package/dist/channel/modules/channels/hooks/useExport.d.ts.map +0 -1
- package/dist/channel/modules/channels/i18n.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ChannelsListPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/CreateConnectionPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/EditConnectionPage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.d.ts.map +0 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.d.ts.map +0 -1
- package/dist/channel/pages/ChannelLandingPage.d.ts.map +0 -1
- package/dist/channel/providers/ChannelProvider.d.ts.map +0 -1
- package/dist/channel/types/index.d.ts.map +0 -1
- package/dist/channel/utils/shellBridge.d.ts.map +0 -1
- package/dist/dev/App.d.ts.map +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/translations/en.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1,130 +1,124 @@
|
|
|
1
1
|
import { useTr as e } from "../../../hooks/useTr.js";
|
|
2
2
|
import { useChannel as t } from "../../../providers/ChannelProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { useChannels as n } from "../../../hooks/useChannels.js";
|
|
4
|
+
import { PLATFORM_I18N as r, translateLabel as i } from "../i18n.js";
|
|
5
|
+
import { getGlobalChannelClient as ee } from "../../../graphql/global-client.js";
|
|
6
|
+
import { useSendNotificationMutation as te } from "../../../../generated/global-operations.js";
|
|
7
|
+
import { NotificationChannel as a, NotificationPriority as o } from "../../../../generated/global-types.js";
|
|
8
|
+
import { PermissionGuard as s } from "../../../components/PermissionGuard.js";
|
|
9
|
+
import { CHANNEL_PERMISSIONS as ne } from "../../../constants/permissions.js";
|
|
10
10
|
import { MarkdownEditor as re } from "../../../components/MarkdownEditor.js";
|
|
11
|
-
import { useCallback as c, useRef as
|
|
12
|
-
import { AlertCircle as
|
|
13
|
-
import { useNavigate as
|
|
11
|
+
import { useCallback as c, useRef as l, useState as u } from "react";
|
|
12
|
+
import { AlertCircle as d, ArrowLeft as ie, Bell as f, CheckCircle2 as p, Hash as m, Loader2 as h, Mail as g, MessageCircle as _, MessageSquare as v, Plus as y, Send as b, Smartphone as x, Users as S, X as C, XCircle as ae } from "lucide-react";
|
|
13
|
+
import { useNavigate as oe } from "react-router";
|
|
14
14
|
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
15
15
|
import { EmphasisPanel as se, GlassCard as D, IllustratedEmptyState as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
|
|
16
|
-
|
|
16
|
+
// src/channel/modules/channels/pages/SendMessagePage.tsx
|
|
17
17
|
var A = {
|
|
18
|
-
EMAIL:
|
|
19
|
-
SMS:
|
|
20
|
-
PUSH:
|
|
21
|
-
WHATSAPP:
|
|
22
|
-
SLACK:
|
|
23
|
-
TEAMS:
|
|
24
|
-
DISCORD:
|
|
25
|
-
INAPP:
|
|
26
|
-
WEBCHAT:
|
|
27
|
-
WEBHOOK:
|
|
18
|
+
EMAIL: g,
|
|
19
|
+
SMS: x,
|
|
20
|
+
PUSH: f,
|
|
21
|
+
WHATSAPP: v,
|
|
22
|
+
SLACK: m,
|
|
23
|
+
TEAMS: S,
|
|
24
|
+
DISCORD: _,
|
|
25
|
+
INAPP: f,
|
|
26
|
+
WEBCHAT: v,
|
|
27
|
+
WEBHOOK: b
|
|
28
28
|
};
|
|
29
29
|
function j() {
|
|
30
|
-
let
|
|
31
|
-
if (!
|
|
30
|
+
let f = oe(), { channels: m } = n(), { organizationId: g, authToken: _, apiGatewayUrl: v } = t(), x = e(), S = ee(v, _, g), [j, { loading: M }] = te({ client: S }), [N, P] = u(""), [F, ce] = u("EMAIL"), [I, L] = u([]), le = l(0), [R, z] = u(""), [B, V] = u(""), [H, U] = u(""), [W, G] = u(""), [K, ue] = u(o.Medium), [q, J] = u(null), [Y, X] = u(null), Z = m.filter((e) => e.platform === F), de = c(() => {
|
|
31
|
+
if (!R.trim()) return;
|
|
32
32
|
let e = {
|
|
33
33
|
id: `r-${++le.current}`,
|
|
34
|
-
address:
|
|
35
|
-
name:
|
|
34
|
+
address: R.trim(),
|
|
35
|
+
name: B.trim() || void 0
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
|
|
40
|
-
}, []),
|
|
41
|
-
|
|
42
|
-
}, []),
|
|
43
|
-
if (!
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
Y(null), q(null);
|
|
56
|
-
try {
|
|
57
|
-
let e = p.find((e) => e.id === M);
|
|
58
|
-
if (!e) {
|
|
59
|
-
Y(y("channel.error.channelNotFound", "Selected channel not found"));
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
let t = P === "INAPP" ? ne.InApp : P;
|
|
63
|
-
q(await Promise.all(F.map(async (n) => {
|
|
64
|
-
let r = {};
|
|
65
|
-
switch (P) {
|
|
66
|
-
case "EMAIL":
|
|
67
|
-
r.email = n.address;
|
|
68
|
-
break;
|
|
69
|
-
case "SMS":
|
|
70
|
-
case "WHATSAPP":
|
|
71
|
-
r.phoneNumber = n.address;
|
|
72
|
-
break;
|
|
73
|
-
case "PUSH":
|
|
74
|
-
r.pushToken = n.address;
|
|
75
|
-
break;
|
|
76
|
-
case "SLACK":
|
|
77
|
-
r.slackUserId = n.address;
|
|
78
|
-
break;
|
|
79
|
-
case "TEAMS":
|
|
80
|
-
r.teamsUserId = n.address;
|
|
81
|
-
break;
|
|
82
|
-
case "WEBHOOK":
|
|
83
|
-
r.webhookUrl = n.address;
|
|
84
|
-
break;
|
|
85
|
-
default: r.email = n.address;
|
|
37
|
+
L((t) => [...t, e]), z(""), V("");
|
|
38
|
+
}, [R, B]), fe = c((e) => {
|
|
39
|
+
L((t) => t.filter((t) => t.id !== e));
|
|
40
|
+
}, []), pe = c(() => {
|
|
41
|
+
J(null), X(null), U(""), G(""), L([]);
|
|
42
|
+
}, []), me = async () => {
|
|
43
|
+
if (!N) X(x("channel.validation.selectChannel", "Please select a channel"));
|
|
44
|
+
else if (I.length === 0) X(x("channel.validation.addRecipient", "Please add at least one recipient"));
|
|
45
|
+
else if (!W.trim()) X(x("channel.validation.enterMessage", "Please enter a message"));
|
|
46
|
+
else {
|
|
47
|
+
X(null), J(null);
|
|
48
|
+
try {
|
|
49
|
+
let e = m.find((e) => e.id === N);
|
|
50
|
+
if (!e) {
|
|
51
|
+
X(x("channel.error.channelNotFound", "Selected channel not found"));
|
|
52
|
+
return;
|
|
86
53
|
}
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
54
|
+
let t = F === "INAPP" ? a.InApp : F, n = await Promise.all(I.map(async (n) => {
|
|
55
|
+
let r = {};
|
|
56
|
+
switch (F) {
|
|
57
|
+
case "EMAIL":
|
|
58
|
+
r.email = n.address;
|
|
59
|
+
break;
|
|
60
|
+
case "SMS":
|
|
61
|
+
case "WHATSAPP":
|
|
62
|
+
r.phoneNumber = n.address;
|
|
63
|
+
break;
|
|
64
|
+
case "PUSH":
|
|
65
|
+
r.pushToken = n.address;
|
|
66
|
+
break;
|
|
67
|
+
case "SLACK":
|
|
68
|
+
r.slackUserId = n.address;
|
|
69
|
+
break;
|
|
70
|
+
case "TEAMS":
|
|
71
|
+
r.teamsUserId = n.address;
|
|
72
|
+
break;
|
|
73
|
+
case "WEBHOOK":
|
|
74
|
+
r.webhookUrl = n.address;
|
|
75
|
+
break;
|
|
76
|
+
default: r.email = n.address;
|
|
96
77
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
78
|
+
let i = {
|
|
79
|
+
channelId: e.id,
|
|
80
|
+
platform: t,
|
|
81
|
+
notification: {
|
|
82
|
+
body: W,
|
|
83
|
+
channel: t,
|
|
84
|
+
recipient: r,
|
|
85
|
+
subject: F === "EMAIL" ? H : void 0,
|
|
86
|
+
priority: K
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
let e = await j({ variables: { input: i } });
|
|
91
|
+
if (e.data?.triggerNotification) {
|
|
92
|
+
let t = e.data.triggerNotification, r = t.status === "FAILED" || t.triggerStatus === "FAILED", i = t.errorMessage || t.errorCode;
|
|
93
|
+
return {
|
|
94
|
+
recipientId: n.id,
|
|
95
|
+
success: !r,
|
|
96
|
+
messageId: t.id,
|
|
97
|
+
error: r ? i ? x("channel.deliveryFailedWithDetail", "Delivery failed: {{detail}}", { detail: i }) : x("channel.deliveryFailed", "Delivery failed") : void 0
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
recipientId: n.id,
|
|
102
|
+
success: !1,
|
|
103
|
+
error: e.error?.message || x("channel.sendNotificationFailed", "Failed to send notification")
|
|
104
|
+
};
|
|
105
|
+
} catch (e) {
|
|
102
106
|
return {
|
|
103
107
|
recipientId: n.id,
|
|
104
|
-
success: !
|
|
105
|
-
|
|
106
|
-
error: r ? i ? y("channel.deliveryFailedWithDetail", "Delivery failed: {{detail}}", { detail: i }) : y("channel.deliveryFailed", "Delivery failed") : void 0
|
|
108
|
+
success: !1,
|
|
109
|
+
error: e instanceof Error ? e.message : x("channel.sendNotificationFailed", "Failed to send notification")
|
|
107
110
|
};
|
|
108
111
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
recipientId: n.id,
|
|
117
|
-
success: !1,
|
|
118
|
-
error: e instanceof Error ? e.message : y("channel.sendNotificationFailed", "Failed to send notification")
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
})));
|
|
122
|
-
} catch (e) {
|
|
123
|
-
Y(e instanceof Error ? e.message : y("channel.messageSendFailed", "Failed to send message"));
|
|
112
|
+
}));
|
|
113
|
+
J(n);
|
|
114
|
+
} catch (e) {
|
|
115
|
+
let t = e instanceof Error ? e.message : x("channel.messageSendFailed", "Failed to send message");
|
|
116
|
+
X(t);
|
|
117
|
+
}
|
|
124
118
|
}
|
|
125
|
-
}, Q =
|
|
126
|
-
return /* @__PURE__ */ T(
|
|
127
|
-
permission:
|
|
119
|
+
}, Q = q?.filter((e) => e.success).length ?? 0, $ = q?.filter((e) => !e.success).length ?? 0;
|
|
120
|
+
return /* @__PURE__ */ T(s, {
|
|
121
|
+
permission: ne.CHANNEL_DELIVERY_SEND,
|
|
128
122
|
children: /* @__PURE__ */ E("div", {
|
|
129
123
|
className: "min-h-screen bg-bg-surface",
|
|
130
124
|
children: [/* @__PURE__ */ T("div", {
|
|
@@ -135,41 +129,41 @@ function j() {
|
|
|
135
129
|
className: "flex items-center gap-4",
|
|
136
130
|
children: [/* @__PURE__ */ T("button", {
|
|
137
131
|
type: "button",
|
|
138
|
-
onClick: () =>
|
|
132
|
+
onClick: () => f("/channels/list"),
|
|
139
133
|
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
140
|
-
children: /* @__PURE__ */ T(
|
|
134
|
+
children: /* @__PURE__ */ T(ie, { className: "size-5 " })
|
|
141
135
|
}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
|
|
142
136
|
className: "text-2xl font-bold",
|
|
143
|
-
children:
|
|
137
|
+
children: x("channel.sendMessage", "Send Message")
|
|
144
138
|
}), /* @__PURE__ */ T("p", {
|
|
145
139
|
className: "text-sm text-text-secondary",
|
|
146
|
-
children:
|
|
140
|
+
children: x("channel.sendMessageSubtitle", "Send notifications through configured channels")
|
|
147
141
|
})] })]
|
|
148
142
|
})
|
|
149
143
|
})
|
|
150
144
|
}), /* @__PURE__ */ E("div", {
|
|
151
145
|
className: "container mx-auto px-6 py-8 max-w-3xl space-y-6",
|
|
152
146
|
children: [/* @__PURE__ */ T(k, {
|
|
153
|
-
icon: /* @__PURE__ */ T(
|
|
147
|
+
icon: /* @__PURE__ */ T(b, {
|
|
154
148
|
size: 15,
|
|
155
149
|
"aria-hidden": "true"
|
|
156
150
|
}),
|
|
157
|
-
children:
|
|
158
|
-
}),
|
|
151
|
+
children: x("channel.sendMessagePurpose", "Compose and fire off a one-off notification through any configured channel — handy for testing a freshly set-up channel, sending a quick announcement, or reproducing a delivery problem. Pick the platform and channel, add one or more recipients, write your message, and send; you will get a per-recipient success/failure breakdown so you know exactly what got through.")
|
|
152
|
+
}), q === null ? /* @__PURE__ */ E("div", {
|
|
159
153
|
className: "space-y-6",
|
|
160
154
|
children: [
|
|
161
|
-
|
|
155
|
+
Y && /* @__PURE__ */ E("div", {
|
|
162
156
|
className: "p-4 rounded-lg bg-status-error-bg/10 border border-status-error-border/20 flex items-center gap-3",
|
|
163
|
-
children: [/* @__PURE__ */ T(
|
|
157
|
+
children: [/* @__PURE__ */ T(d, { className: "size-5 text-status-error-text shrink-0" }), /* @__PURE__ */ T("p", {
|
|
164
158
|
className: "text-sm text-status-error-text",
|
|
165
|
-
children:
|
|
159
|
+
children: Y
|
|
166
160
|
})]
|
|
167
161
|
}),
|
|
168
162
|
/* @__PURE__ */ E("div", {
|
|
169
163
|
className: "space-y-3",
|
|
170
164
|
children: [/* @__PURE__ */ T("label", {
|
|
171
165
|
className: "text-sm font-medium",
|
|
172
|
-
children:
|
|
166
|
+
children: x("channel.platform", "Platform")
|
|
173
167
|
}), /* @__PURE__ */ T("div", {
|
|
174
168
|
className: "flex flex-wrap gap-2",
|
|
175
169
|
children: [
|
|
@@ -181,16 +175,16 @@ function j() {
|
|
|
181
175
|
"TEAMS",
|
|
182
176
|
"WEBHOOK"
|
|
183
177
|
].map((e) => {
|
|
184
|
-
let t = A[e] ||
|
|
178
|
+
let t = A[e] || b;
|
|
185
179
|
return /* @__PURE__ */ E("button", {
|
|
186
180
|
type: "button",
|
|
187
181
|
onClick: () => {
|
|
188
|
-
ce(e),
|
|
182
|
+
ce(e), P("");
|
|
189
183
|
},
|
|
190
|
-
className: `px-4 py-2 rounded-lg border flex items-center gap-2 transition-all ${
|
|
184
|
+
className: `px-4 py-2 rounded-lg border flex items-center gap-2 transition-all ${F === e ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface hover:bg-bg-sunken border-border-subtle"}`,
|
|
191
185
|
children: [/* @__PURE__ */ T(t, { className: "size-4 " }), /* @__PURE__ */ T("span", {
|
|
192
186
|
className: "text-sm",
|
|
193
|
-
children:
|
|
187
|
+
children: i(e, r, x)
|
|
194
188
|
})]
|
|
195
189
|
}, e);
|
|
196
190
|
})
|
|
@@ -200,31 +194,31 @@ function j() {
|
|
|
200
194
|
className: "space-y-2",
|
|
201
195
|
children: [/* @__PURE__ */ E("label", {
|
|
202
196
|
className: "text-sm font-medium",
|
|
203
|
-
children: [
|
|
204
|
-
}),
|
|
197
|
+
children: [x("channel.channel", "Channel"), " *"]
|
|
198
|
+
}), Z.length === 0 ? /* @__PURE__ */ T("div", {
|
|
205
199
|
className: "rounded-lg border border-dashed",
|
|
206
200
|
children: /* @__PURE__ */ T(O, {
|
|
207
201
|
illustration: "empty-data",
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
202
|
+
title: x("channel.noPlatformChannels", "No {{platform}} channels configured", { platform: i(F, r, x) }),
|
|
203
|
+
description: x("channel.noPlatformChannelsHint", "Create a channel for this platform to be able to send through it."),
|
|
210
204
|
action: /* @__PURE__ */ E("button", {
|
|
211
205
|
type: "button",
|
|
212
|
-
onClick: () =>
|
|
206
|
+
onClick: () => f("./create"),
|
|
213
207
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
214
|
-
children: [/* @__PURE__ */ T(
|
|
208
|
+
children: [/* @__PURE__ */ T(y, {
|
|
215
209
|
className: "size-4",
|
|
216
210
|
"aria-hidden": "true"
|
|
217
|
-
}),
|
|
211
|
+
}), x("channel.createChannel", "Create Channel")]
|
|
218
212
|
})
|
|
219
213
|
})
|
|
220
214
|
}) : /* @__PURE__ */ E("select", {
|
|
221
|
-
value:
|
|
222
|
-
onChange: (e) =>
|
|
215
|
+
value: N,
|
|
216
|
+
onChange: (e) => P(e.target.value),
|
|
223
217
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
224
218
|
children: [/* @__PURE__ */ T("option", {
|
|
225
219
|
value: "",
|
|
226
|
-
children:
|
|
227
|
-
}),
|
|
220
|
+
children: x("channel.selectChannel", "Select a channel...")
|
|
221
|
+
}), Z.map((e) => /* @__PURE__ */ E("option", {
|
|
228
222
|
value: e.id,
|
|
229
223
|
children: [
|
|
230
224
|
e.name,
|
|
@@ -240,40 +234,40 @@ function j() {
|
|
|
240
234
|
children: [
|
|
241
235
|
/* @__PURE__ */ T("label", {
|
|
242
236
|
className: "text-sm font-medium",
|
|
243
|
-
children:
|
|
237
|
+
children: x("channel.recipients", "Recipients")
|
|
244
238
|
}),
|
|
245
239
|
/* @__PURE__ */ E("div", {
|
|
246
240
|
className: "flex gap-2",
|
|
247
241
|
children: [
|
|
248
242
|
/* @__PURE__ */ T("input", {
|
|
249
|
-
"aria-label":
|
|
243
|
+
"aria-label": F === "EMAIL" ? x("channel.recipientPlaceholder.email", "email@example.com") : x("channel.recipientPlaceholder.phone", "+1234567890"),
|
|
250
244
|
type: "text",
|
|
251
|
-
value:
|
|
252
|
-
onChange: (e) =>
|
|
253
|
-
placeholder:
|
|
245
|
+
value: R,
|
|
246
|
+
onChange: (e) => z(e.target.value),
|
|
247
|
+
placeholder: F === "EMAIL" ? x("channel.recipientPlaceholder.email", "email@example.com") : x("channel.recipientPlaceholder.phone", "+1234567890"),
|
|
254
248
|
className: "flex-1 px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
255
249
|
}),
|
|
256
250
|
/* @__PURE__ */ T("input", {
|
|
257
|
-
"aria-label":
|
|
251
|
+
"aria-label": x("channel.nameOptional", "Name (optional)"),
|
|
258
252
|
type: "text",
|
|
259
|
-
value:
|
|
260
|
-
onChange: (e) =>
|
|
261
|
-
placeholder:
|
|
253
|
+
value: B,
|
|
254
|
+
onChange: (e) => V(e.target.value),
|
|
255
|
+
placeholder: x("channel.nameOptional", "Name (optional)"),
|
|
262
256
|
className: "w-full sm:w-48 px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
263
257
|
}),
|
|
264
258
|
/* @__PURE__ */ E("button", {
|
|
265
259
|
type: "button",
|
|
266
|
-
onClick:
|
|
267
|
-
disabled: !
|
|
260
|
+
onClick: de,
|
|
261
|
+
disabled: !R.trim(),
|
|
268
262
|
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 flex items-center gap-2",
|
|
269
|
-
children: [/* @__PURE__ */ T(
|
|
263
|
+
children: [/* @__PURE__ */ T(y, { className: "size-4 " }), x("channel.add", "Add")]
|
|
270
264
|
})
|
|
271
265
|
]
|
|
272
266
|
}),
|
|
273
|
-
|
|
267
|
+
I.length > 0 ? /* @__PURE__ */ T(D, {
|
|
274
268
|
treatment: "plain",
|
|
275
269
|
className: "border-border-seam rounded-lg p-0 divide-y divide-[var(--color-border-seam)] overflow-hidden",
|
|
276
|
-
children:
|
|
270
|
+
children: I.map((e) => /* @__PURE__ */ E("div", {
|
|
277
271
|
className: "p-3 flex items-center justify-between",
|
|
278
272
|
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
279
273
|
className: "text-sm font-medium",
|
|
@@ -283,15 +277,15 @@ function j() {
|
|
|
283
277
|
children: e.name
|
|
284
278
|
})] }), /* @__PURE__ */ T("button", {
|
|
285
279
|
type: "button",
|
|
286
|
-
onClick: () =>
|
|
280
|
+
onClick: () => fe(e.id),
|
|
287
281
|
className: "p-1 hover:bg-bg-sunken rounded transition-colors",
|
|
288
|
-
children: /* @__PURE__ */ T(
|
|
282
|
+
children: /* @__PURE__ */ T(C, { className: "size-4 text-text-secondary" })
|
|
289
283
|
})]
|
|
290
284
|
}, e.id))
|
|
291
285
|
}) : /* @__PURE__ */ T(O, {
|
|
292
286
|
illustration: "empty-people",
|
|
293
|
-
title:
|
|
294
|
-
description:
|
|
287
|
+
title: x("channel.noRecipientsYet", "No recipients added yet"),
|
|
288
|
+
description: x("channel.addRecipientsHint", "Add one or more recipients above to send this message to.")
|
|
295
289
|
})
|
|
296
290
|
]
|
|
297
291
|
}),
|
|
@@ -300,21 +294,21 @@ function j() {
|
|
|
300
294
|
children: [
|
|
301
295
|
/* @__PURE__ */ E("label", {
|
|
302
296
|
className: "text-sm font-medium",
|
|
303
|
-
children: [
|
|
297
|
+
children: [x("channel.messageContent", "Message Content"), " *"]
|
|
304
298
|
}),
|
|
305
|
-
|
|
306
|
-
"aria-label":
|
|
299
|
+
F === "EMAIL" && /* @__PURE__ */ T("input", {
|
|
300
|
+
"aria-label": x("channel.subject", "Subject"),
|
|
307
301
|
type: "text",
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
310
|
-
placeholder:
|
|
302
|
+
value: H,
|
|
303
|
+
onChange: (e) => U(e.target.value),
|
|
304
|
+
placeholder: x("channel.subject", "Subject"),
|
|
311
305
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
312
306
|
}),
|
|
313
307
|
/* @__PURE__ */ T(re, {
|
|
314
|
-
value:
|
|
315
|
-
onChange:
|
|
316
|
-
"aria-label":
|
|
317
|
-
placeholder:
|
|
308
|
+
value: W,
|
|
309
|
+
onChange: G,
|
|
310
|
+
"aria-label": x("channel.messagePlaceholder", "Enter your message..."),
|
|
311
|
+
placeholder: x("channel.messagePlaceholder", "Enter your message..."),
|
|
318
312
|
rows: 6
|
|
319
313
|
})
|
|
320
314
|
]
|
|
@@ -323,35 +317,35 @@ function j() {
|
|
|
323
317
|
className: "space-y-2",
|
|
324
318
|
children: [/* @__PURE__ */ T("label", {
|
|
325
319
|
className: "text-sm font-medium",
|
|
326
|
-
children:
|
|
320
|
+
children: x("channel.priority", "Priority")
|
|
327
321
|
}), /* @__PURE__ */ T("div", {
|
|
328
322
|
className: "flex gap-2",
|
|
329
323
|
children: [
|
|
330
324
|
{
|
|
331
|
-
value:
|
|
325
|
+
value: o.Low,
|
|
332
326
|
key: "channel.priorityLabel.low",
|
|
333
327
|
fallback: "Low"
|
|
334
328
|
},
|
|
335
329
|
{
|
|
336
|
-
value:
|
|
330
|
+
value: o.Medium,
|
|
337
331
|
key: "channel.priorityLabel.normal",
|
|
338
332
|
fallback: "Medium"
|
|
339
333
|
},
|
|
340
334
|
{
|
|
341
|
-
value:
|
|
335
|
+
value: o.High,
|
|
342
336
|
key: "channel.priorityLabel.high",
|
|
343
337
|
fallback: "High"
|
|
344
338
|
},
|
|
345
339
|
{
|
|
346
|
-
value:
|
|
340
|
+
value: o.Urgent,
|
|
347
341
|
key: "channel.priorityLabel.urgent",
|
|
348
342
|
fallback: "Urgent"
|
|
349
343
|
}
|
|
350
344
|
].map((e) => /* @__PURE__ */ T("button", {
|
|
351
345
|
type: "button",
|
|
352
346
|
onClick: () => ue(e.value),
|
|
353
|
-
className: `px-4 py-2 rounded-lg border text-sm transition-all ${
|
|
354
|
-
children:
|
|
347
|
+
className: `px-4 py-2 rounded-lg border text-sm transition-all ${K === e.value ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface hover:bg-bg-sunken border-border-subtle"}`,
|
|
348
|
+
children: x(e.key, e.fallback)
|
|
355
349
|
}, e.value))
|
|
356
350
|
})]
|
|
357
351
|
}),
|
|
@@ -359,16 +353,16 @@ function j() {
|
|
|
359
353
|
className: "flex justify-end pt-4",
|
|
360
354
|
children: /* @__PURE__ */ T("button", {
|
|
361
355
|
type: "button",
|
|
362
|
-
onClick:
|
|
363
|
-
disabled:
|
|
356
|
+
onClick: me,
|
|
357
|
+
disabled: M || !N || I.length === 0 || !W.trim(),
|
|
364
358
|
className: "px-6 py-3 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 flex items-center gap-2",
|
|
365
|
-
children:
|
|
366
|
-
/* @__PURE__ */ T(
|
|
367
|
-
|
|
359
|
+
children: M ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(h, { className: "size-5 animate-spin" }), x("channel.sending", "Sending...")] }) : /* @__PURE__ */ E(w, { children: [
|
|
360
|
+
/* @__PURE__ */ T(b, { className: "size-5 " }),
|
|
361
|
+
x("channel.sendTo", "Send to"),
|
|
368
362
|
" ",
|
|
369
|
-
|
|
363
|
+
I.length,
|
|
370
364
|
" ",
|
|
371
|
-
|
|
365
|
+
I.length === 1 ? x("channel.recipient", "recipient") : x("channel.recipients", "recipients")
|
|
372
366
|
] })
|
|
373
367
|
})
|
|
374
368
|
})
|
|
@@ -379,32 +373,32 @@ function j() {
|
|
|
379
373
|
className: "p-4 flex items-center justify-between",
|
|
380
374
|
children: [/* @__PURE__ */ E("div", {
|
|
381
375
|
className: "flex items-center gap-4",
|
|
382
|
-
children: [$ === 0 ? /* @__PURE__ */ T(
|
|
376
|
+
children: [$ === 0 ? /* @__PURE__ */ T(p, { className: "size-8 text-status-success-text" }) : /* @__PURE__ */ T(d, { className: "size-8 text-status-warning-text" }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
|
|
383
377
|
className: "text-lg font-semibold",
|
|
384
|
-
children: $ === 0 ?
|
|
378
|
+
children: $ === 0 ? x("channel.allMessagesSent", "All messages sent!") : `${Q} of ${I.length} sent`
|
|
385
379
|
}), /* @__PURE__ */ E("p", {
|
|
386
380
|
className: "text-sm text-text-secondary",
|
|
387
381
|
children: [
|
|
388
382
|
Q,
|
|
389
383
|
" ",
|
|
390
|
-
|
|
384
|
+
x("channel.successful", "successful"),
|
|
391
385
|
", ",
|
|
392
386
|
$,
|
|
393
387
|
" ",
|
|
394
|
-
|
|
388
|
+
x("channel.failed", "failed")
|
|
395
389
|
]
|
|
396
390
|
})] })]
|
|
397
391
|
}), /* @__PURE__ */ T("button", {
|
|
398
392
|
type: "button",
|
|
399
|
-
onClick:
|
|
393
|
+
onClick: pe,
|
|
400
394
|
className: "px-4 py-2 rounded-lg border hover:bg-bg-sunken transition-colors",
|
|
401
|
-
children:
|
|
395
|
+
children: x("channel.sendAnother", "Send Another")
|
|
402
396
|
})]
|
|
403
397
|
}), /* @__PURE__ */ T(D, {
|
|
404
398
|
treatment: "plain",
|
|
405
399
|
className: "border-border-seam rounded-lg p-0 divide-y divide-[var(--color-border-seam)] overflow-hidden",
|
|
406
|
-
children:
|
|
407
|
-
let t =
|
|
400
|
+
children: q.map((e) => {
|
|
401
|
+
let t = I.find((t) => t.id === e.recipientId);
|
|
408
402
|
return /* @__PURE__ */ E("div", {
|
|
409
403
|
className: "p-4 flex items-center justify-between",
|
|
410
404
|
children: [/* @__PURE__ */ E("div", { children: [
|
|
@@ -424,7 +418,7 @@ function j() {
|
|
|
424
418
|
className: "text-xs text-status-error-text",
|
|
425
419
|
children: e.error
|
|
426
420
|
})
|
|
427
|
-
] }), e.success ? /* @__PURE__ */ T(
|
|
421
|
+
] }), e.success ? /* @__PURE__ */ T(p, { className: "size-5 text-status-success-text" }) : /* @__PURE__ */ T(ae, { className: "size-5 text-status-error-text" })]
|
|
428
422
|
}, e.recipientId);
|
|
429
423
|
})
|
|
430
424
|
})]
|
|
@@ -433,7 +427,6 @@ function j() {
|
|
|
433
427
|
})
|
|
434
428
|
});
|
|
435
429
|
}
|
|
436
|
-
//#endregion
|
|
437
430
|
export { j as SendMessagePage };
|
|
438
431
|
|
|
439
432
|
//# sourceMappingURL=SendMessagePage.js.map
|