@apextelemed/partner-core 0.23.0-dev.83 → 0.23.0-dev.84
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/chunk/{5LMCRJ6Y.jsx → K4SFTGFZ.jsx} +85 -3
- package/dist/chunk/{W4HVE5RI.js → XB27METC.js} +251 -141
- package/dist/chunk/{W4HVE5RI.js.map → XB27METC.js.map} +1 -1
- package/dist/index/index.js +1 -1
- package/dist/index/index.jsx +1 -1
- package/dist/pages/index.js +1 -1
- package/dist/pages/index.jsx +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
MATCH_DEPENDENT_WARNINGS,
|
|
11
11
|
MATCH_HOW_LABEL,
|
|
12
12
|
ORPHAN_REASON,
|
|
13
|
+
PHONE_ERROR,
|
|
13
14
|
READINESS_LABEL,
|
|
14
15
|
SOURCE_FIELD_NOTE,
|
|
15
16
|
SUPPORT_CATEGORIES,
|
|
@@ -47,6 +48,7 @@ import {
|
|
|
47
48
|
isCatalogItemId,
|
|
48
49
|
isCssColorValue,
|
|
49
50
|
isImageAttachment,
|
|
51
|
+
isValidUsPhone,
|
|
50
52
|
lifecycleReason,
|
|
51
53
|
markEmailGateAnswered,
|
|
52
54
|
matchKey,
|
|
@@ -23543,7 +23545,7 @@ function TemplateRow(props) {
|
|
|
23543
23545
|
</div>
|
|
23544
23546
|
|
|
23545
23547
|
<div class="app-admin-btn-row">
|
|
23546
|
-
<button type="button" class="app-admin-btn app-admin-btn-sm" disabled={testing()} onClick={() => void sendTest()}>
|
|
23548
|
+
<button type="button" class="app-admin-btn app-admin-btn-sm" disabled={testing() || !props.canTest} onClick={() => void sendTest()}>
|
|
23547
23549
|
{testing() ? "Sending\u2026" : "Send test to my phone"}
|
|
23548
23550
|
</button>
|
|
23549
23551
|
</div>
|
|
@@ -23558,17 +23560,97 @@ function TemplateRow(props) {
|
|
|
23558
23560
|
</Show68>
|
|
23559
23561
|
</div>;
|
|
23560
23562
|
}
|
|
23563
|
+
function TestPhoneBlock(props) {
|
|
23564
|
+
const [value, setValue] = createSignal48("");
|
|
23565
|
+
const [saving, setSaving] = createSignal48(false);
|
|
23566
|
+
const [error, setError] = createSignal48("");
|
|
23567
|
+
const [note, setNote] = createSignal48(null);
|
|
23568
|
+
const [loaded] = createResource30(async () => {
|
|
23569
|
+
try {
|
|
23570
|
+
const res = await usersApi.getProfile();
|
|
23571
|
+
const raw = res.data?.phone;
|
|
23572
|
+
const phone = typeof raw === "string" ? raw : "";
|
|
23573
|
+
setValue(phone);
|
|
23574
|
+
props.onLoaded(phone);
|
|
23575
|
+
} catch {
|
|
23576
|
+
}
|
|
23577
|
+
return true;
|
|
23578
|
+
});
|
|
23579
|
+
const save = async () => {
|
|
23580
|
+
if (saving()) return;
|
|
23581
|
+
const phone = value().trim();
|
|
23582
|
+
setNote(null);
|
|
23583
|
+
if (!isValidUsPhone(phone)) {
|
|
23584
|
+
setError(PHONE_ERROR);
|
|
23585
|
+
return;
|
|
23586
|
+
}
|
|
23587
|
+
setError("");
|
|
23588
|
+
setSaving(true);
|
|
23589
|
+
try {
|
|
23590
|
+
await usersApi.updateProfile({ phone });
|
|
23591
|
+
props.onSaved(phone);
|
|
23592
|
+
setNote({ tone: "ok", text: "Saved to your account." });
|
|
23593
|
+
} catch (e) {
|
|
23594
|
+
setNote({ tone: "bad", text: e instanceof Error ? e.message : "Could not save your number." });
|
|
23595
|
+
} finally {
|
|
23596
|
+
setSaving(false);
|
|
23597
|
+
}
|
|
23598
|
+
};
|
|
23599
|
+
return <div class="app-admin-card-soft" data-testid="sms-test-phone" style={{ padding: "0.875rem", display: "grid", gap: "0.5rem" }}>
|
|
23600
|
+
<label class="app-admin-label" for="sms-test-phone-input" style={{ "font-size": "0.875rem", "font-weight": "600" }}>
|
|
23601
|
+
Your phone for test texts
|
|
23602
|
+
</label>
|
|
23603
|
+
<div style={muted3}>
|
|
23604
|
+
Test texts are sent to this number. It is the phone on your own account.
|
|
23605
|
+
</div>
|
|
23606
|
+
<div class="app-admin-btn-row">
|
|
23607
|
+
<input
|
|
23608
|
+
id="sms-test-phone-input"
|
|
23609
|
+
class="app-admin-input"
|
|
23610
|
+
type="tel"
|
|
23611
|
+
inputmode="tel"
|
|
23612
|
+
autocomplete="tel"
|
|
23613
|
+
placeholder="(555) 555-1234"
|
|
23614
|
+
value={value()}
|
|
23615
|
+
disabled={loaded.loading}
|
|
23616
|
+
onInput={(e) => {
|
|
23617
|
+
setValue(e.currentTarget.value);
|
|
23618
|
+
setError("");
|
|
23619
|
+
setNote(null);
|
|
23620
|
+
}}
|
|
23621
|
+
/>
|
|
23622
|
+
<button type="button" class="app-admin-btn app-admin-btn-sm" disabled={saving() || loaded.loading} onClick={() => void save()}>
|
|
23623
|
+
{saving() ? "Saving\u2026" : "Save"}
|
|
23624
|
+
</button>
|
|
23625
|
+
</div>
|
|
23626
|
+
<Show68 when={error()}>
|
|
23627
|
+
<div class="app-admin-notice" role="alert" style={{ color: "var(--app-admin-danger-fg)" }}>
|
|
23628
|
+
{error()}
|
|
23629
|
+
</div>
|
|
23630
|
+
</Show68>
|
|
23631
|
+
<Show68 when={note()}>
|
|
23632
|
+
{(r) => <div class="app-admin-notice" role="status" style={r().tone === "bad" ? { color: "var(--app-admin-danger-fg)" } : void 0}>
|
|
23633
|
+
{r().text}
|
|
23634
|
+
</div>}
|
|
23635
|
+
</Show68>
|
|
23636
|
+
</div>;
|
|
23637
|
+
}
|
|
23561
23638
|
function SmsTemplatesCard(props) {
|
|
23562
23639
|
const [data] = createResource30(async () => {
|
|
23563
23640
|
const res = await adminApi.getSmsTemplates();
|
|
23564
23641
|
props.onLoaded?.(res.templates);
|
|
23565
23642
|
return res;
|
|
23566
23643
|
});
|
|
23644
|
+
const [phone, setPhone] = createSignal48("");
|
|
23567
23645
|
const templates = () => data.error ? [] : data()?.templates ?? [];
|
|
23568
23646
|
return <SmsCard
|
|
23569
23647
|
title="What the texts say"
|
|
23570
23648
|
note="Every text below is sent automatically once texts are set up. The wording is fixed."
|
|
23571
23649
|
>
|
|
23650
|
+
<TestPhoneBlock onSaved={setPhone} onLoaded={setPhone} />
|
|
23651
|
+
<Show68 when={!isValidUsPhone(phone())}>
|
|
23652
|
+
<div style={muted3}>Save your phone number above to send a test.</div>
|
|
23653
|
+
</Show68>
|
|
23572
23654
|
<Show68 when={data.error}>
|
|
23573
23655
|
<div class="app-admin-notice" role="alert">
|
|
23574
23656
|
The texts could not be loaded. {data.error?.message}
|
|
@@ -23577,7 +23659,7 @@ function SmsTemplatesCard(props) {
|
|
|
23577
23659
|
<Show68 when={!data.error && data.loading}>
|
|
23578
23660
|
<LoadingSpinner />
|
|
23579
23661
|
</Show68>
|
|
23580
|
-
<For53 each={templates()}>{(t) => <TemplateRow template={t} />}</For53>
|
|
23662
|
+
<For53 each={templates()}>{(t) => <TemplateRow template={t} canTest={isValidUsPhone(phone())} />}</For53>
|
|
23581
23663
|
</SmsCard>;
|
|
23582
23664
|
}
|
|
23583
23665
|
|
|
@@ -28972,4 +29054,4 @@ export {
|
|
|
28972
29054
|
AffiliateForgotPassword,
|
|
28973
29055
|
AffiliateResetPassword
|
|
28974
29056
|
};
|
|
28975
|
-
//# sourceMappingURL=
|
|
29057
|
+
//# sourceMappingURL=K4SFTGFZ.jsx.map
|