@burdenoff/microfe-channel 2026.830.1 → 2026.1013.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.map +1 -1
- package/dist/channel/ChannelRoot.js +32 -35
- package/dist/channel/ChannelRoot.js.map +1 -1
- package/dist/channel/components/AdapterCredentialsForm.d.ts.map +1 -1
- package/dist/channel/components/AdapterCredentialsForm.js +52 -58
- package/dist/channel/components/AdapterCredentialsForm.js.map +1 -1
- package/dist/channel/components/FeatureNotEnabled.d.ts.map +1 -1
- package/dist/channel/components/FeatureNotEnabled.js +27 -22
- package/dist/channel/components/FeatureNotEnabled.js.map +1 -1
- package/dist/channel/components/MarkdownEditor.d.ts.map +1 -1
- package/dist/channel/components/MarkdownEditor.js +78 -77
- package/dist/channel/components/MarkdownEditor.js.map +1 -1
- package/dist/channel/components/PermissionGuard.d.ts.map +1 -1
- package/dist/channel/components/PermissionGuard.js +6 -9
- package/dist/channel/components/PermissionGuard.js.map +1 -1
- package/dist/channel/hooks/useTr.d.ts +17 -0
- package/dist/channel/hooks/useTr.d.ts.map +1 -0
- package/dist/channel/hooks/useTr.js +14 -0
- package/dist/channel/hooks/useTr.js.map +1 -0
- package/dist/channel/modules/channels/i18n.js +24 -24
- package/dist/channel/modules/channels/i18n.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js +2 -2
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +232 -226
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js +152 -146
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +112 -114
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.js +300 -269
- package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateConnectionPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js +108 -102
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.js +384 -343
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.js +170 -156
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/dist/channel/pages/ChannelLandingPage.d.ts.map +1 -1
- package/dist/channel/pages/ChannelLandingPage.js +47 -50
- package/dist/channel/pages/ChannelLandingPage.js.map +1 -1
- package/dist/translations/en.d.ts +271 -4
- package/dist/translations/en.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,393 +1,434 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { AlertCircle as
|
|
9
|
-
import { useNavigate as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { EmphasisPanel as
|
|
1
|
+
import { useTr as e } from "../../../hooks/useTr.js";
|
|
2
|
+
import { nativeImpact as t, nativeNotify as n } from "../../../../utils/nativeBridge.js";
|
|
3
|
+
import { useChannel as r, useChannels as i } from "../../../hooks/useChannels.js";
|
|
4
|
+
import { PermissionGuard as a } from "../../../components/PermissionGuard.js";
|
|
5
|
+
import { CHANNEL_PERMISSIONS as o } from "../../../constants/permissions.js";
|
|
6
|
+
import { MarkdownEditor as ee } from "../../../components/MarkdownEditor.js";
|
|
7
|
+
import { useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
8
|
+
import { AlertCircle as d, ArrowLeft as te, Bell as ne, Hash as re, Inbox as ie, Loader2 as f, Mail as p, MessageCircle as m, MessageSquare as h, Save as g, Send as _, Smartphone as v, Trash2 as y, Users as b } from "lucide-react";
|
|
9
|
+
import { useNavigate as x, useParams as S } from "react-router";
|
|
10
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
11
|
+
import { EmphasisPanel as ae, GlassCard as oe, PagePurpose as se } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/channel/modules/channels/pages/EditChannelPage.tsx
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
13
|
+
function E() {
|
|
14
|
+
let E = x(), { channelId: D } = S(), { channel: O, isLoading: ce, error: le } = r(D), { updateChannel: k, deleteChannel: A } = i(), j = e(), M = c(() => [
|
|
15
|
+
{
|
|
16
|
+
value: "EMAIL",
|
|
17
|
+
labelKey: "channel.platformLabel.email",
|
|
18
|
+
labelFallback: "Email",
|
|
19
|
+
descriptionKey: "channel.platformDescription.emailDescription",
|
|
20
|
+
descriptionFallback: "Send emails via various providers",
|
|
21
|
+
icon: p,
|
|
22
|
+
color: "text-status-info-text bg-status-info-bg-subtle border-status-info-border",
|
|
23
|
+
adapters: [
|
|
24
|
+
{
|
|
25
|
+
value: "AWS_SES",
|
|
26
|
+
labelKey: "channel.adapter.awsSes",
|
|
27
|
+
labelFallback: "AWS SES"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "MAILGUN",
|
|
31
|
+
labelKey: "channel.adapter.mailgun",
|
|
32
|
+
labelFallback: "Mailgun"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "POSTMARK",
|
|
36
|
+
labelKey: "channel.adapter.postmark",
|
|
37
|
+
labelFallback: "Postmark"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: "MANDRILL",
|
|
41
|
+
labelKey: "channel.adapter.mandrill",
|
|
42
|
+
labelFallback: "Mandrill"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
value: "RESEND",
|
|
46
|
+
labelKey: "channel.adapter.resend",
|
|
47
|
+
labelFallback: "Resend"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "AZURE_ACS",
|
|
51
|
+
labelKey: "channel.adapter.azureAcs",
|
|
52
|
+
labelFallback: "Azure Communication Services"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: "SMTP",
|
|
56
|
+
labelKey: "channel.adapter.smtp",
|
|
57
|
+
labelFallback: "Custom SMTP"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "SMS",
|
|
63
|
+
labelKey: "channel.platformLabel.sms",
|
|
64
|
+
labelFallback: "SMS",
|
|
65
|
+
descriptionKey: "channel.platformDescription.smsDescription",
|
|
66
|
+
descriptionFallback: "Send text messages",
|
|
67
|
+
icon: v,
|
|
68
|
+
color: "text-status-success-text bg-status-success-bg-subtle border-status-success-border/30",
|
|
69
|
+
adapters: [
|
|
70
|
+
{
|
|
71
|
+
value: "TWILIO_SMS",
|
|
72
|
+
labelKey: "channel.adapter.twilio",
|
|
73
|
+
labelFallback: "Twilio"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: "AWS_SNS",
|
|
77
|
+
labelKey: "channel.adapter.awsSns",
|
|
78
|
+
labelFallback: "AWS SNS"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
value: "VONAGE",
|
|
82
|
+
labelKey: "channel.adapter.vonage",
|
|
83
|
+
labelFallback: "Vonage"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: "PLIVO",
|
|
87
|
+
labelKey: "channel.adapter.plivo",
|
|
88
|
+
labelFallback: "Plivo"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: "MESSAGEBIRD",
|
|
92
|
+
labelKey: "channel.adapter.messagebird",
|
|
93
|
+
labelFallback: "MessageBird"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
value: "INFOBIP",
|
|
97
|
+
labelKey: "channel.adapter.infobip",
|
|
98
|
+
labelFallback: "Infobip"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: "PUSH",
|
|
104
|
+
labelKey: "channel.platformLabel.push",
|
|
105
|
+
labelFallback: "Push",
|
|
106
|
+
descriptionKey: "channel.platformDescription.pushDescription",
|
|
107
|
+
descriptionFallback: "Mobile & web push",
|
|
108
|
+
icon: ne,
|
|
109
|
+
color: "text-accent-purple bg-accent-purple-subtle border-accent-purple/30",
|
|
110
|
+
adapters: [
|
|
111
|
+
{
|
|
112
|
+
value: "FCM",
|
|
113
|
+
labelKey: "channel.adapter.fcm",
|
|
114
|
+
labelFallback: "Firebase Cloud Messaging"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
value: "APNS",
|
|
118
|
+
labelKey: "channel.adapter.apns",
|
|
119
|
+
labelFallback: "Apple Push Notification Service"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
value: "ONESIGNAL",
|
|
123
|
+
labelKey: "channel.adapter.onesignal",
|
|
124
|
+
labelFallback: "OneSignal"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
value: "EXPO",
|
|
128
|
+
labelKey: "channel.adapter.expo",
|
|
129
|
+
labelFallback: "Expo Push"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: "INAPP",
|
|
135
|
+
labelKey: "channel.platformLabel.inApp",
|
|
136
|
+
labelFallback: "In-App",
|
|
137
|
+
descriptionKey: "channel.platformDescription.inAppDescription",
|
|
138
|
+
descriptionFallback: "Internal in-app notifications",
|
|
139
|
+
icon: ie,
|
|
140
|
+
color: "text-status-warning-text bg-status-warning-bg-subtle border-status-warning-border/30",
|
|
141
|
+
adapters: [{
|
|
142
|
+
value: "INAPP_NATIVE",
|
|
143
|
+
labelKey: "channel.adapter.inAppNative",
|
|
144
|
+
labelFallback: "Native In-App"
|
|
145
|
+
}]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
value: "WHATSAPP",
|
|
149
|
+
labelKey: "channel.platformLabel.whatsapp",
|
|
150
|
+
labelFallback: "WhatsApp",
|
|
151
|
+
descriptionKey: "channel.platformDescription.whatsappDescription",
|
|
152
|
+
descriptionFallback: "WhatsApp Business messaging",
|
|
153
|
+
icon: h,
|
|
154
|
+
color: "text-status-success-text bg-status-success-bg-subtle border-status-success-border/30",
|
|
155
|
+
adapters: [{
|
|
156
|
+
value: "WHATSAPP_CLOUD",
|
|
157
|
+
labelKey: "channel.adapter.whatsappCloud",
|
|
158
|
+
labelFallback: "WhatsApp Cloud API"
|
|
159
|
+
}, {
|
|
160
|
+
value: "WHATSAPP_TWILIO",
|
|
161
|
+
labelKey: "channel.adapter.whatsappTwilio",
|
|
162
|
+
labelFallback: "WhatsApp via Twilio"
|
|
163
|
+
}]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
value: "SLACK",
|
|
167
|
+
labelKey: "channel.platformLabel.slack",
|
|
168
|
+
labelFallback: "Slack",
|
|
169
|
+
descriptionKey: "channel.platformDescription.slackDescription",
|
|
170
|
+
descriptionFallback: "Slack bot & channels",
|
|
171
|
+
icon: re,
|
|
172
|
+
color: "text-accent-purple bg-accent-purple-subtle border-accent-purple/30",
|
|
173
|
+
adapters: [{
|
|
174
|
+
value: "SLACK_BOT",
|
|
175
|
+
labelKey: "channel.adapter.slackBot",
|
|
176
|
+
labelFallback: "Slack Bot"
|
|
177
|
+
}]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
value: "TEAMS",
|
|
181
|
+
labelKey: "channel.platformLabel.teams",
|
|
182
|
+
labelFallback: "Teams",
|
|
183
|
+
descriptionKey: "channel.platformDescription.teamsDescription",
|
|
184
|
+
descriptionFallback: "Microsoft Teams",
|
|
185
|
+
icon: b,
|
|
186
|
+
color: "text-status-info-text bg-status-info-bg-subtle border-status-info-border",
|
|
187
|
+
adapters: [{
|
|
188
|
+
value: "TEAMS_BOT",
|
|
189
|
+
labelKey: "channel.adapter.teamsBot",
|
|
190
|
+
labelFallback: "Teams Bot"
|
|
191
|
+
}]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
value: "DISCORD",
|
|
195
|
+
labelKey: "channel.platformLabel.discord",
|
|
196
|
+
labelFallback: "Discord",
|
|
197
|
+
descriptionKey: "channel.platformDescription.discordDescription",
|
|
198
|
+
descriptionFallback: "Discord bots & webhooks",
|
|
199
|
+
icon: m,
|
|
200
|
+
color: "text-accent-indigo bg-accent-indigo-subtle border-accent-indigo/30",
|
|
201
|
+
adapters: [{
|
|
202
|
+
value: "DISCORD_BOT",
|
|
203
|
+
labelKey: "channel.adapter.discordBot",
|
|
204
|
+
labelFallback: "Discord Bot"
|
|
205
|
+
}]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
value: "WEBCHAT",
|
|
209
|
+
labelKey: "channel.platformLabel.webchat",
|
|
210
|
+
labelFallback: "Webchat",
|
|
211
|
+
descriptionKey: "channel.platformDescription.webchatDescription",
|
|
212
|
+
descriptionFallback: "Website live chat",
|
|
213
|
+
icon: h,
|
|
214
|
+
color: "text-accent-teal bg-accent-teal-subtle border-accent-teal/30",
|
|
215
|
+
adapters: [{
|
|
216
|
+
value: "WEBCHAT_NATIVE",
|
|
217
|
+
labelKey: "channel.adapter.webchatNative",
|
|
218
|
+
labelFallback: "Native Webchat"
|
|
219
|
+
}]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
value: "WEBHOOK",
|
|
223
|
+
labelKey: "channel.platformLabel.webhook",
|
|
224
|
+
labelFallback: "Webhook",
|
|
225
|
+
descriptionKey: "channel.platformDescription.webhookDescription",
|
|
226
|
+
descriptionFallback: "Generic HTTP webhook",
|
|
227
|
+
icon: _,
|
|
228
|
+
color: "text-text-secondary bg-bg-sunken/50 border-border-subtle",
|
|
229
|
+
adapters: [{
|
|
230
|
+
value: "WEBHOOK_HTTP",
|
|
231
|
+
labelKey: "channel.adapter.webhookHttp",
|
|
232
|
+
labelFallback: "HTTP Webhook"
|
|
233
|
+
}]
|
|
234
|
+
}
|
|
235
|
+
], []), N = c(() => [
|
|
236
|
+
{
|
|
237
|
+
value: 0,
|
|
238
|
+
label: j("channel.priorityLabel.lowest", "0 - Lowest")
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
value: 1,
|
|
242
|
+
label: j("channel.priorityLabel.low", "1 - Low")
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
value: 2,
|
|
246
|
+
label: j("channel.priorityLabel.normal", "2 - Normal")
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
value: 3,
|
|
250
|
+
label: j("channel.priorityLabel.high", "3 - High")
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
value: 4,
|
|
254
|
+
label: j("channel.priorityLabel.highest", "4 - Highest")
|
|
255
|
+
}
|
|
256
|
+
], [j]), [P, F] = u(""), [I, L] = u(""), [R, z] = u("AWS_SES"), [B, V] = u(2), [H, U] = u("INACTIVE"), [W, G] = u(!1), [K, q] = u(!1), [J, Y] = u(null), [X, Z] = u(!1), Q = l(null);
|
|
216
257
|
s(() => {
|
|
217
|
-
|
|
218
|
-
|
|
258
|
+
O && O.id !== Q.current && (Q.current = O.id, Promise.resolve().then(() => {
|
|
259
|
+
F(O.name || ""), L(O.description || ""), z(O.adapterType || "AWS_SES"), V(O.priority || 2), U(O.status || "INACTIVE");
|
|
219
260
|
}));
|
|
220
|
-
}, [
|
|
221
|
-
let
|
|
222
|
-
return
|
|
261
|
+
}, [O]);
|
|
262
|
+
let ue = O?.platform || "EMAIL", $ = M.find((e) => e.value === ue);
|
|
263
|
+
return ce ? /* @__PURE__ */ w("div", {
|
|
223
264
|
className: "flex items-center justify-center min-h-screen",
|
|
224
|
-
children: /* @__PURE__ */
|
|
225
|
-
}) :
|
|
265
|
+
children: /* @__PURE__ */ w(f, { className: "size-8 animate-spin text-text-secondary" })
|
|
266
|
+
}) : le || !O ? /* @__PURE__ */ T("div", {
|
|
226
267
|
className: "flex flex-col items-center justify-center min-h-screen gap-4",
|
|
227
268
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ w(d, { className: "size-12 text-status-error-text" }),
|
|
270
|
+
/* @__PURE__ */ w("h1", {
|
|
230
271
|
className: "text-xl font-semibold",
|
|
231
|
-
children:
|
|
272
|
+
children: j("channel.channelNotFound", "Channel not found")
|
|
232
273
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ w("button", {
|
|
234
275
|
type: "button",
|
|
235
|
-
onClick: () =>
|
|
276
|
+
onClick: () => E("../list"),
|
|
236
277
|
className: "text-primary hover:underline",
|
|
237
|
-
children:
|
|
278
|
+
children: j("channel.backToChannels", "Back to channels")
|
|
238
279
|
})
|
|
239
280
|
]
|
|
240
|
-
}) : /* @__PURE__ */
|
|
241
|
-
permission:
|
|
242
|
-
children: /* @__PURE__ */
|
|
281
|
+
}) : /* @__PURE__ */ w(a, {
|
|
282
|
+
permission: o.CHANNEL_UPDATE,
|
|
283
|
+
children: /* @__PURE__ */ T("div", {
|
|
243
284
|
className: "min-h-screen bg-bg-surface",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ w("div", {
|
|
245
286
|
className: "border-b bg-bg-surface",
|
|
246
|
-
children: /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ w("div", {
|
|
247
288
|
className: "container mx-auto px-6 py-4",
|
|
248
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ T("div", {
|
|
249
290
|
className: "flex items-center gap-4",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ w("button", {
|
|
251
292
|
type: "button",
|
|
252
|
-
onClick: () =>
|
|
293
|
+
onClick: () => E(`/channels/${D}`),
|
|
253
294
|
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
254
|
-
children: /* @__PURE__ */
|
|
255
|
-
}), /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ w(te, { className: "size-5 " })
|
|
296
|
+
}), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h1", {
|
|
256
297
|
className: "text-2xl font-bold",
|
|
257
|
-
children:
|
|
258
|
-
}), /* @__PURE__ */
|
|
298
|
+
children: j("channel.editChannel", "Edit Channel")
|
|
299
|
+
}), /* @__PURE__ */ w("p", {
|
|
259
300
|
className: "text-sm text-text-secondary",
|
|
260
|
-
children:
|
|
301
|
+
children: j("channel.updateChannelConfig", "Update channel configuration")
|
|
261
302
|
})] })]
|
|
262
303
|
})
|
|
263
304
|
})
|
|
264
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ w("div", {
|
|
265
306
|
className: "container mx-auto px-6 py-8 max-w-2xl",
|
|
266
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ T("div", {
|
|
267
308
|
className: "space-y-6",
|
|
268
309
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
icon: /* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ w(se, {
|
|
311
|
+
icon: /* @__PURE__ */ w(g, {
|
|
271
312
|
size: 15,
|
|
272
313
|
"aria-hidden": "true"
|
|
273
314
|
}),
|
|
274
|
-
children:
|
|
315
|
+
children: j("channel.editChannelPurpose", "Change how this channel behaves — its name, description, priority and status. The platform and provider stay fixed (they define what the channel is); to swap credentials use the channel's connection instead. Use this to rename a channel, bump its priority, or temporarily deactivate it without deleting it.")
|
|
275
316
|
}),
|
|
276
|
-
|
|
317
|
+
J && /* @__PURE__ */ T("div", {
|
|
277
318
|
className: "p-4 rounded-lg bg-status-error-bg/10 border border-status-error-border/20 flex items-center gap-3",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ w(d, { className: "size-5 text-status-error-text shrink-0" }), /* @__PURE__ */ w("p", {
|
|
279
320
|
className: "text-sm text-status-error-text",
|
|
280
|
-
children:
|
|
321
|
+
children: J
|
|
281
322
|
})]
|
|
282
323
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ T(oe, {
|
|
284
325
|
treatment: "insight",
|
|
285
326
|
className: "p-4 border-border-seam space-y-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ w("div", {
|
|
287
328
|
className: "flex items-center gap-2",
|
|
288
|
-
children: $ && /* @__PURE__ */
|
|
329
|
+
children: $ && /* @__PURE__ */ T(C, { children: [(() => {
|
|
289
330
|
let e = $.icon;
|
|
290
|
-
return /* @__PURE__ */
|
|
291
|
-
})(), /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ w(e, { className: "size-5 text-text-secondary" });
|
|
332
|
+
})(), /* @__PURE__ */ w("span", {
|
|
292
333
|
className: "font-medium",
|
|
293
|
-
children:
|
|
334
|
+
children: j($.labelKey, $.labelFallback)
|
|
294
335
|
})] })
|
|
295
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ w("p", {
|
|
296
337
|
className: "text-sm text-text-secondary",
|
|
297
|
-
children:
|
|
338
|
+
children: j("channel.platformLockedHint", "Platform cannot be changed after channel creation. Create a new channel to use a different platform.")
|
|
298
339
|
})]
|
|
299
340
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ T(ae, {
|
|
301
342
|
className: "p-5 space-y-6",
|
|
302
343
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ T("div", {
|
|
304
345
|
className: "space-y-2",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ T("label", {
|
|
306
347
|
className: "text-sm font-medium",
|
|
307
|
-
children: [
|
|
308
|
-
}), /* @__PURE__ */
|
|
309
|
-
"aria-label":
|
|
348
|
+
children: [j("channel.channelName", "Channel Name"), " *"]
|
|
349
|
+
}), /* @__PURE__ */ w("input", {
|
|
350
|
+
"aria-label": j("channel.editNamePlaceholder", "e.g., Production Email, Customer SMS"),
|
|
310
351
|
type: "text",
|
|
311
|
-
value:
|
|
312
|
-
onChange: (e) =>
|
|
313
|
-
placeholder:
|
|
352
|
+
value: P,
|
|
353
|
+
onChange: (e) => F(e.target.value),
|
|
354
|
+
placeholder: j("channel.editNamePlaceholder", "e.g., Production Email, Customer SMS"),
|
|
314
355
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
315
356
|
})]
|
|
316
357
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ T("div", {
|
|
318
359
|
className: "space-y-2",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ w("label", {
|
|
320
361
|
htmlFor: "channel-edit-description",
|
|
321
362
|
className: "text-sm font-medium",
|
|
322
|
-
children:
|
|
323
|
-
}), /* @__PURE__ */
|
|
363
|
+
children: j("channel.description", "Description")
|
|
364
|
+
}), /* @__PURE__ */ w(ee, {
|
|
324
365
|
id: "channel-edit-description",
|
|
325
|
-
value:
|
|
326
|
-
onChange:
|
|
327
|
-
"aria-label":
|
|
328
|
-
placeholder:
|
|
366
|
+
value: I,
|
|
367
|
+
onChange: L,
|
|
368
|
+
"aria-label": j("channel.editDescriptionPlaceholder", "Optional description for this channel"),
|
|
369
|
+
placeholder: j("channel.editDescriptionPlaceholder", "Optional description for this channel"),
|
|
329
370
|
rows: 3
|
|
330
371
|
})]
|
|
331
372
|
}),
|
|
332
|
-
$ && /* @__PURE__ */
|
|
373
|
+
$ && /* @__PURE__ */ T("div", {
|
|
333
374
|
className: "space-y-2",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ w("label", {
|
|
335
376
|
className: "text-sm font-medium",
|
|
336
|
-
children:
|
|
337
|
-
}), /* @__PURE__ */
|
|
338
|
-
value:
|
|
339
|
-
onChange: (e) =>
|
|
377
|
+
children: j("channel.adapterProvider", "Adapter / Provider")
|
|
378
|
+
}), /* @__PURE__ */ w("select", {
|
|
379
|
+
value: R,
|
|
380
|
+
onChange: (e) => z(e.target.value),
|
|
340
381
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
341
|
-
children: $.adapters.map((e) => /* @__PURE__ */
|
|
382
|
+
children: $.adapters.map((e) => /* @__PURE__ */ w("option", {
|
|
342
383
|
value: e.value,
|
|
343
|
-
children: e.
|
|
384
|
+
children: j(e.labelKey, e.labelFallback)
|
|
344
385
|
}, e.value))
|
|
345
386
|
})]
|
|
346
387
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ T("div", {
|
|
348
389
|
className: "grid grid-cols-2 gap-4",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ T("div", {
|
|
350
391
|
className: "space-y-2",
|
|
351
392
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ w("label", {
|
|
353
394
|
className: "text-sm font-medium",
|
|
354
|
-
children:
|
|
395
|
+
children: j("channel.priority", "Priority")
|
|
355
396
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
value:
|
|
358
|
-
onChange: (e) =>
|
|
397
|
+
/* @__PURE__ */ w("select", {
|
|
398
|
+
value: B,
|
|
399
|
+
onChange: (e) => V(Number(e.target.value)),
|
|
359
400
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
360
|
-
children:
|
|
401
|
+
children: N.map((e) => /* @__PURE__ */ w("option", {
|
|
361
402
|
value: e.value,
|
|
362
403
|
children: e.label
|
|
363
404
|
}, e.value))
|
|
364
405
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ w("p", {
|
|
366
407
|
className: "text-xs text-text-secondary",
|
|
367
|
-
children:
|
|
408
|
+
children: j("channel.priorityFailoverHint", "Higher priority channels are used first in failover")
|
|
368
409
|
})
|
|
369
410
|
]
|
|
370
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ T("div", {
|
|
371
412
|
className: "space-y-2",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ w("label", {
|
|
373
414
|
className: "text-sm font-medium",
|
|
374
|
-
children:
|
|
375
|
-
}), /* @__PURE__ */
|
|
376
|
-
value:
|
|
377
|
-
onChange: (e) =>
|
|
415
|
+
children: j("channel.status", "Status")
|
|
416
|
+
}), /* @__PURE__ */ T("select", {
|
|
417
|
+
value: H,
|
|
418
|
+
onChange: (e) => U(e.target.value),
|
|
378
419
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
379
420
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ w("option", {
|
|
381
422
|
value: "INACTIVE",
|
|
382
|
-
children:
|
|
423
|
+
children: j("channel.statusLabel.inactive", "Inactive")
|
|
383
424
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ w("option", {
|
|
385
426
|
value: "ACTIVE",
|
|
386
|
-
children:
|
|
427
|
+
children: j("channel.statusLabel.active", "Active")
|
|
387
428
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ w("option", {
|
|
389
430
|
value: "SUSPENDED",
|
|
390
|
-
children:
|
|
431
|
+
children: j("channel.statusLabel.suspended", "Suspended")
|
|
391
432
|
})
|
|
392
433
|
]
|
|
393
434
|
})]
|
|
@@ -395,80 +436,80 @@ function N() {
|
|
|
395
436
|
})
|
|
396
437
|
]
|
|
397
438
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ T("div", {
|
|
399
440
|
className: "flex items-center justify-between pt-6 border-t",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ w("div", { children: X ? /* @__PURE__ */ T("div", {
|
|
401
442
|
className: "flex items-center gap-2",
|
|
402
443
|
children: [
|
|
403
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ w("span", {
|
|
404
445
|
className: "text-sm text-text-secondary",
|
|
405
|
-
children:
|
|
446
|
+
children: j("channel.confirmDelete", "Confirm delete?")
|
|
406
447
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ T("button", {
|
|
408
449
|
type: "button",
|
|
409
450
|
onClick: async () => {
|
|
410
|
-
if (!(!
|
|
411
|
-
|
|
451
|
+
if (!(!D || !X)) {
|
|
452
|
+
t("medium"), q(!0);
|
|
412
453
|
try {
|
|
413
|
-
await
|
|
454
|
+
await A(D) ? (n("success"), E("../list")) : n("error");
|
|
414
455
|
} catch (e) {
|
|
415
|
-
|
|
456
|
+
n("error"), Y(e instanceof Error ? e.message : j("channel.deleteFailed", "Failed to delete channel")), q(!1);
|
|
416
457
|
}
|
|
417
458
|
}
|
|
418
459
|
},
|
|
419
|
-
disabled:
|
|
460
|
+
disabled: K,
|
|
420
461
|
className: "px-4 py-2 text-sm bg-status-error-bg text-status-error-text rounded-lg hover:bg-status-error-bg/90 transition-colors flex items-center gap-2",
|
|
421
|
-
children: [
|
|
462
|
+
children: [K ? /* @__PURE__ */ w(f, { className: "size-4 animate-spin" }) : /* @__PURE__ */ w(y, { className: "size-4 " }), j("channel.delete", "Delete")]
|
|
422
463
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ w("button", {
|
|
424
465
|
type: "button",
|
|
425
|
-
onClick: () =>
|
|
466
|
+
onClick: () => Z(!1),
|
|
426
467
|
className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-lg transition-colors",
|
|
427
|
-
children:
|
|
468
|
+
children: j("channel.cancel", "Cancel")
|
|
428
469
|
})
|
|
429
470
|
]
|
|
430
|
-
}) : /* @__PURE__ */
|
|
431
|
-
permission:
|
|
432
|
-
children: /* @__PURE__ */
|
|
471
|
+
}) : /* @__PURE__ */ w(a, {
|
|
472
|
+
permission: o.CHANNEL_DELETE,
|
|
473
|
+
children: /* @__PURE__ */ T("button", {
|
|
433
474
|
type: "button",
|
|
434
|
-
onClick: () =>
|
|
475
|
+
onClick: () => Z(!0),
|
|
435
476
|
className: "px-4 py-2 text-sm text-status-error-text hover:bg-status-error-bg/10 rounded-lg transition-colors flex items-center gap-2",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ w(y, { className: "size-4 " }), j("channel.deleteChannel", "Delete Channel")]
|
|
437
478
|
})
|
|
438
|
-
}) }), /* @__PURE__ */
|
|
479
|
+
}) }), /* @__PURE__ */ T("div", {
|
|
439
480
|
className: "flex items-center gap-3",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ w("button", {
|
|
441
482
|
type: "button",
|
|
442
|
-
onClick: () =>
|
|
483
|
+
onClick: () => E(`/channels/${D}`),
|
|
443
484
|
className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-lg transition-colors",
|
|
444
|
-
children:
|
|
445
|
-
}), /* @__PURE__ */
|
|
485
|
+
children: j("channel.cancel", "Cancel")
|
|
486
|
+
}), /* @__PURE__ */ T("button", {
|
|
446
487
|
type: "button",
|
|
447
488
|
onClick: async () => {
|
|
448
|
-
if (
|
|
449
|
-
if (!
|
|
450
|
-
|
|
489
|
+
if (D) {
|
|
490
|
+
if (!P.trim()) {
|
|
491
|
+
Y(j("channel.validation.nameRequired", "Channel name is required"));
|
|
451
492
|
return;
|
|
452
493
|
}
|
|
453
|
-
|
|
494
|
+
G(!0), Y(null);
|
|
454
495
|
try {
|
|
455
|
-
await
|
|
456
|
-
name:
|
|
457
|
-
description:
|
|
458
|
-
adapterType:
|
|
459
|
-
priority:
|
|
460
|
-
status:
|
|
461
|
-
}) ?
|
|
496
|
+
await k(D, {
|
|
497
|
+
name: P.trim(),
|
|
498
|
+
description: I.trim() || void 0,
|
|
499
|
+
adapterType: R,
|
|
500
|
+
priority: B,
|
|
501
|
+
status: H
|
|
502
|
+
}) ? E(`/channels/${D}`) : Y(j("channel.updateFailed", "Failed to update channel"));
|
|
462
503
|
} catch (e) {
|
|
463
|
-
|
|
504
|
+
Y(e instanceof Error ? e.message : j("channel.updateFailed", "Failed to update channel"));
|
|
464
505
|
} finally {
|
|
465
|
-
|
|
506
|
+
G(!1);
|
|
466
507
|
}
|
|
467
508
|
}
|
|
468
509
|
},
|
|
469
|
-
disabled:
|
|
510
|
+
disabled: W || !P.trim(),
|
|
470
511
|
className: "px-6 py-2 text-sm bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors flex items-center gap-2 disabled:opacity-50",
|
|
471
|
-
children: [
|
|
512
|
+
children: [W ? /* @__PURE__ */ w(f, { className: "size-4 animate-spin" }) : /* @__PURE__ */ w(g, { className: "size-4 " }), j("channel.saveChanges", "Save Changes")]
|
|
472
513
|
})]
|
|
473
514
|
})]
|
|
474
515
|
})
|
|
@@ -479,6 +520,6 @@ function N() {
|
|
|
479
520
|
});
|
|
480
521
|
}
|
|
481
522
|
//#endregion
|
|
482
|
-
export {
|
|
523
|
+
export { E as EditChannelPage };
|
|
483
524
|
|
|
484
525
|
//# sourceMappingURL=EditChannelPage.js.map
|