@ozguraltan/strapi-content-input 1.0.23 → 1.0.25
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/README.md +5 -3
- package/dist/admin/{AnalyticsHubPage-K_trli5i.js → AnalyticsHubPage-0fb7chuv.js} +372 -7
- package/dist/admin/{AnalyticsHubPage-Dvpx3KsP.mjs → AnalyticsHubPage-BO6Lg1qh.mjs} +372 -7
- package/dist/admin/{ContentInputField-C2kmtUwD.mjs → ContentInputField-C-fh5qGC.mjs} +64 -19
- package/dist/admin/{ContentInputField-CjxYYEps.js → ContentInputField-CnVzTBNf.js} +64 -19
- package/dist/admin/{SurveyWidgetEditor-DOYxWop9.js → SurveyWidgetEditor-DNDtKbmo.js} +3069 -318
- package/dist/admin/{SurveyWidgetEditor-DMWOkHUt.mjs → SurveyWidgetEditor-DdZBpfbS.mjs} +3070 -320
- package/dist/admin/{index-B9C8Qrfd.js → index--fSIDKkt.js} +2 -2
- package/dist/admin/{index-AePRA0IB.mjs → index-BdrFmPg5.mjs} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/widgets/SurveyTransferCleanupModal.d.ts +35 -0
- package/dist/admin/src/components/widgets/surveyStepTreeOps.d.ts +54 -0
- package/dist/server/index.js +616 -25
- package/dist/server/index.mjs +616 -25
- package/dist/server/src/controllers/ci-survey.d.ts +4 -0
- package/dist/server/src/controllers/index.d.ts +4 -0
- package/dist/server/src/index.d.ts +46 -1
- package/dist/server/src/services/ci-form.d.ts +5 -1
- package/dist/server/src/services/ci-survey.d.ts +37 -0
- package/dist/server/src/services/index.d.ts +42 -1
- package/dist/server/src/utils/demoSeedState.d.ts +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -289,7 +289,7 @@ The **`survey`** widget provides a full-featured survey, NPS, and quick-poll pla
|
|
|
289
289
|
### 5.1 Three Display Modes (`displayMode`)
|
|
290
290
|
1. **`quick_poll` (Quick Poll):** Compact single-card poll for 1-click voting and instant live `%` bar feedback.
|
|
291
291
|
2. **`single_page` (Single-Page Survey):** Classic multi-question vertical survey form on one page.
|
|
292
|
-
3. **`multi_step` (Multi-Step Wizard):** Typeform-style step-by-step wizard (`steps[]`) with animated progress bar, per-step validation before advancing, and Back/Next navigation.
|
|
292
|
+
3. **`multi_step` (Multi-Step Wizard & Collapsible Accordion Studio):** Typeform-style step-by-step wizard (`steps[]`) with animated progress bar, per-step validation before advancing, and Back/Next navigation. Inside **Survey Studio**, wizard steps are organized as **collapsible Accordion categories** with fixed **`EN` / `TR` / `DE` locale badges** (2-column responsive grid), optional localized **`step.description`** subtitles, and two-level **HTML5 Drag & Drop**: reorder entire step categories among themselves, reorder questions within a step, or drag questions (and palette question types) across different step categories (`auto-expand` on hover + automatic `stepId` & canonical order sync).
|
|
293
293
|
|
|
294
294
|
### 5.2 Supported 13 Question & Item Types
|
|
295
295
|
| Question Type | Key Options & Capabilities | Analytics Visualization |
|
|
@@ -345,7 +345,9 @@ Reporting is available in **two places** inside Strapi Admin:
|
|
|
345
345
|
2. **Inline `Survey Studio Modal` -> `Tab 2: Live Flow Preview & Simulator` & `Tab 4: Analytics & Reports`:**
|
|
346
346
|
- **`Tab 2: Live Flow Preview & Simulator` (`SurveyLivePreviewPane`):** Interactive sandbox inside the Survey Studio modal (works directly against unsaved `draft` state without polluting live analytics DB) with **Desktop / Tablet / Mobile** viewport switcher, **Strapi `i18n` test locale** switcher, full multi-step wizard & validation testing across all 13 question types, **Reset Flow**, and a real-time **Skip Logic Visibility & JSON Payload Inspector**.
|
|
347
347
|
- **`Tab 4: Analytics & Reports`:** View live charts for the selected survey directly inside the Content Manager page editor.
|
|
348
|
-
3. **Rich Seed Dataset
|
|
348
|
+
3. **Rich Seed Dataset + Safe Demo Cleanup & Portable `.ci-survey.json` Export/Import:**
|
|
349
|
+
- **Portable Survey Bundles (`.ci-survey.json`):** Export a single survey or all surveys in one package (`GET /content-input/surveys/bundle/export?target=all|<slug>&mode=structure|full`) as either **Structure Only** (`0` responses — ideal for staging-to-prod templates; secrets like `recaptchaSecretKey` and `mailConfig` are automatically stripped) or **Structure + Response Data** (full backup). Revive any `.ci-survey.json` package via `POST /content-input/surveys/bundle/import` with interactive **Duplicate (`_copy`) vs Overwrite** conflict resolution and optional **Include Responses** toggle so all NPS gauges, 30-day trends, and `.xlsx` reports restore 1:1.
|
|
350
|
+
- **Safe Dummy Data Cleanup & Persistent Seed Guard:** Purge ONLY the built-in `showcase_*` demo surveys (`525` sample responses) and `showcase_contact_form` (`20` sample submissions) via **Purge Demo Data** (`POST /content-input/surveys/purge-demo`) without touching custom user surveys/forms. A persistent `strapi.store` flag (`demo_seed_state.cleared = true`, or `CI_DISABLE_DEMO_SEED=true` in `.env`) prevents demo records from auto-seeding again across reloads or restarts until **Restore Sample Data** is explicitly clicked. Individual surveys also support **Clear Responses Only** (`DELETE /content-input/surveys/:id/responses`) to reset test votes to `0` before launch.
|
|
349
351
|
|
|
350
352
|
---
|
|
351
353
|
|
|
@@ -573,7 +575,7 @@ export default () => ({
|
|
|
573
575
|
1. **3 Farklı Görünüm Modu (`displayMode`):**
|
|
574
576
|
- `quick_poll`: Tek kartta hızlı oylama ve oy sonrası anlık `%` çubuk grafiği.
|
|
575
577
|
- `single_page`: Tüm soruların tek sayfada alt alta yer aldığı klasik anket düzeni.
|
|
576
|
-
- `multi_step`: Adım çubuklu, ilerleme yüzdeli, her adımda validasyon yapan **Çok Adımlı Sihirbaz (Wizard)** modu.
|
|
578
|
+
- `multi_step`: Adım çubuklu, ilerleme yüzdeli, her adımda validasyon yapan **Çok Adımlı Sihirbaz (Wizard)** modu. **Anket Stüdyosu** içinde her adım katlanabilir bir **Akordiyon Kategori** olarak listelenir; hem kategoriler kendi aralarında sürükle-bırak ile sıralanabilir hem de sorular kendi kategorisi içinde veya farklı kategoriler arasında sürüklenerek taşınabilir (`stepId` ve genel soru sırası otomatik senkronize edilir).
|
|
577
579
|
2. **13 Soru ve Öğe Tipi:**
|
|
578
580
|
- Seçimli tipler: `single_choice` (Tekli Seçim + `"Diğer"` açık uçlu seçenek + şık karıştırma), `multiple_choice` (Çoklu Seçim + `minSelections`/`maxSelections`), `dropdown` (Açılır Liste), `image_choice` (Strapi Medya Kütüphanesi görselli kart seçimi).
|
|
579
581
|
- Ölçek, Matris ve Sıralama: `nps` (`0–10` Net Promoter Score), `star_rating` (`1–5` / `1–10` Yıldız), `likert_scale` (`1–5` / `1–7` Katılım Ölçeği — sadece uç etiketler veya Strapi `i18n` dilleri kadar her puana özel `scaleLabels` + tek tık hazır şablonlar), `matrix_single` (Satır × Sütun değerlendirme tablosu), `ranking` (Sürükle-bırak öncelik sıralama ve **Borda Puanlama**).
|
|
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
6
|
const XLSXNs = require("xlsx");
|
|
7
|
-
const index = require("./index
|
|
8
|
-
const SurveyWidgetEditor = require("./SurveyWidgetEditor-
|
|
7
|
+
const index = require("./index--fSIDKkt.js");
|
|
8
|
+
const SurveyWidgetEditor = require("./SurveyWidgetEditor-DNDtKbmo.js");
|
|
9
9
|
function _interopNamespace(e) {
|
|
10
10
|
if (e && e.__esModule) return e;
|
|
11
11
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -48,6 +48,11 @@ const AnalyticsHubPage = () => {
|
|
|
48
48
|
const [studioTarget, setStudioTarget] = React.useState(
|
|
49
49
|
() => SurveyWidgetEditor.createBlankSurveyDraft(uiLocale)
|
|
50
50
|
);
|
|
51
|
+
const [exportModalOpen, setExportModalOpen] = React.useState(false);
|
|
52
|
+
const [exportDefaultScope, setExportDefaultScope] = React.useState("single");
|
|
53
|
+
const [importModalOpen, setImportModalOpen] = React.useState(false);
|
|
54
|
+
const [cleanupAction, setCleanupAction] = React.useState(null);
|
|
55
|
+
const [hubNotice, setHubNotice] = React.useState("");
|
|
51
56
|
const [forms, setForms] = React.useState([]);
|
|
52
57
|
const [selectedFormSlug, setSelectedFormSlug] = React.useState("all");
|
|
53
58
|
const [submissions, setSubmissions] = React.useState([]);
|
|
@@ -95,6 +100,9 @@ const AnalyticsHubPage = () => {
|
|
|
95
100
|
await loadSurveys();
|
|
96
101
|
if (section === "forms") await loadFormsAndSubmissions();
|
|
97
102
|
setAnalyticsRefreshKey((k) => k + 1);
|
|
103
|
+
setHubNotice(
|
|
104
|
+
tr ? "Örnek anketler ve form verileri başarıyla geri yüklendi." : "Sample surveys and form submissions restored."
|
|
105
|
+
);
|
|
98
106
|
} catch {
|
|
99
107
|
} finally {
|
|
100
108
|
setReseeding(false);
|
|
@@ -265,6 +273,86 @@ const AnalyticsHubPage = () => {
|
|
|
265
273
|
]
|
|
266
274
|
}
|
|
267
275
|
),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
277
|
+
"button",
|
|
278
|
+
{
|
|
279
|
+
type: "button",
|
|
280
|
+
onClick: () => setImportModalOpen(true),
|
|
281
|
+
style: {
|
|
282
|
+
padding: "8px 12px",
|
|
283
|
+
borderRadius: 8,
|
|
284
|
+
border: "1px solid rgba(56, 189, 248, 0.5)",
|
|
285
|
+
background: "rgba(14, 165, 233, 0.16)",
|
|
286
|
+
color: "#e0f2fe",
|
|
287
|
+
fontSize: 11.5,
|
|
288
|
+
fontWeight: 700,
|
|
289
|
+
cursor: "pointer",
|
|
290
|
+
display: "inline-flex",
|
|
291
|
+
alignItems: "center",
|
|
292
|
+
gap: 6
|
|
293
|
+
},
|
|
294
|
+
title: tr ? "JSON (.ci-survey.json) paketinden anket yapısını ve/veya yanıtlarını canlandırır" : "Import survey structure and/or responses from a .ci-survey.json bundle",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "upload_file", size: 15, color: "#7dd3fc" }),
|
|
297
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "JSON İçe Aktar" : "Import JSON" })
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
302
|
+
"button",
|
|
303
|
+
{
|
|
304
|
+
type: "button",
|
|
305
|
+
disabled: surveys.length === 0,
|
|
306
|
+
onClick: () => {
|
|
307
|
+
setExportDefaultScope("all");
|
|
308
|
+
setExportModalOpen(true);
|
|
309
|
+
},
|
|
310
|
+
style: {
|
|
311
|
+
padding: "8px 12px",
|
|
312
|
+
borderRadius: 8,
|
|
313
|
+
border: "1px solid rgba(52, 211, 153, 0.45)",
|
|
314
|
+
background: "rgba(16, 185, 129, 0.16)",
|
|
315
|
+
color: "#d1fae5",
|
|
316
|
+
fontSize: 11.5,
|
|
317
|
+
fontWeight: 700,
|
|
318
|
+
opacity: surveys.length === 0 ? 0.55 : 1,
|
|
319
|
+
cursor: surveys.length === 0 ? "not-allowed" : "pointer",
|
|
320
|
+
display: "inline-flex",
|
|
321
|
+
alignItems: "center",
|
|
322
|
+
gap: 6
|
|
323
|
+
},
|
|
324
|
+
title: tr ? "Anketleri sadece yapı veya yapı + veri olarak .ci-survey.json paketine aktarır" : "Export surveys as structure-only or structure + data (.ci-survey.json)",
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "download", size: 15, color: "#6ee7b7" }),
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Yedekle / Dışa Aktar" : "Export Bundle" })
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
332
|
+
"button",
|
|
333
|
+
{
|
|
334
|
+
type: "button",
|
|
335
|
+
onClick: () => setCleanupAction("purge-demo"),
|
|
336
|
+
style: {
|
|
337
|
+
padding: "8px 12px",
|
|
338
|
+
borderRadius: 8,
|
|
339
|
+
border: "1px solid rgba(251, 146, 60, 0.48)",
|
|
340
|
+
background: "rgba(234, 88, 12, 0.18)",
|
|
341
|
+
color: "#ffedd5",
|
|
342
|
+
fontSize: 11.5,
|
|
343
|
+
fontWeight: 700,
|
|
344
|
+
cursor: "pointer",
|
|
345
|
+
display: "inline-flex",
|
|
346
|
+
alignItems: "center",
|
|
347
|
+
gap: 6
|
|
348
|
+
},
|
|
349
|
+
title: tr ? "Sadece yerleşik örnek (showcase_*) anket/form verilerini siler; kendi anketlerinize dokunmaz" : "Removes built-in showcase_* demo surveys & form submissions without touching your custom surveys",
|
|
350
|
+
children: [
|
|
351
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "delete_sweep", size: 15, color: "#fdba74" }),
|
|
352
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Dummy Veriyi Temizle" : "Purge Demo Data" })
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
),
|
|
268
356
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
269
357
|
"button",
|
|
270
358
|
{
|
|
@@ -284,10 +372,10 @@ const AnalyticsHubPage = () => {
|
|
|
284
372
|
alignItems: "center",
|
|
285
373
|
gap: 6
|
|
286
374
|
},
|
|
287
|
-
title: tr ? "Örnek analiz veri kümesini (525 anket yanıtı + 20 form başvurusu) yeniler" : "
|
|
375
|
+
title: tr ? "Örnek analiz veri kümesini (525 anket yanıtı + 20 form başvurusu) geri yükler / yeniler" : "Restores or refreshes the 525-response correlated analytics dataset",
|
|
288
376
|
children: [
|
|
289
377
|
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "refresh", size: 15, color: "#38bdf8" }),
|
|
290
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: reseeding ? "..." : tr ? "Örnek Veriyi
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: reseeding ? "..." : tr ? "Örnek Veriyi Geri Yükle" : "Restore Sample Data" })
|
|
291
379
|
]
|
|
292
380
|
}
|
|
293
381
|
),
|
|
@@ -431,6 +519,46 @@ const AnalyticsHubPage = () => {
|
|
|
431
519
|
]
|
|
432
520
|
}
|
|
433
521
|
),
|
|
522
|
+
hubNotice && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
523
|
+
"div",
|
|
524
|
+
{
|
|
525
|
+
style: {
|
|
526
|
+
margin: "14px 28px 0",
|
|
527
|
+
padding: "10px 16px",
|
|
528
|
+
borderRadius: 9,
|
|
529
|
+
background: "#ecfdf5",
|
|
530
|
+
border: "1px solid #6ee7b7",
|
|
531
|
+
color: "#065f46",
|
|
532
|
+
fontSize: 12.5,
|
|
533
|
+
fontWeight: 700,
|
|
534
|
+
display: "flex",
|
|
535
|
+
alignItems: "center",
|
|
536
|
+
justifyContent: "space-between",
|
|
537
|
+
gap: 12
|
|
538
|
+
},
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
541
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "check_circle", size: 18, color: "#059669" }),
|
|
542
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: hubNotice })
|
|
543
|
+
] }),
|
|
544
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
545
|
+
"button",
|
|
546
|
+
{
|
|
547
|
+
type: "button",
|
|
548
|
+
onClick: () => setHubNotice(""),
|
|
549
|
+
style: {
|
|
550
|
+
border: "none",
|
|
551
|
+
background: "transparent",
|
|
552
|
+
color: "#065f46",
|
|
553
|
+
fontSize: 16,
|
|
554
|
+
cursor: "pointer"
|
|
555
|
+
},
|
|
556
|
+
children: "×"
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
),
|
|
434
562
|
section === "colors" ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "22px 28px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
435
563
|
"div",
|
|
436
564
|
{
|
|
@@ -443,7 +571,99 @@ const AnalyticsHubPage = () => {
|
|
|
443
571
|
},
|
|
444
572
|
children: /* @__PURE__ */ jsxRuntime.jsx(SurveyWidgetEditor.ColorCodesManager, { locale: uiLocale })
|
|
445
573
|
}
|
|
446
|
-
) }) : section === "surveys" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
574
|
+
) }) : section === "surveys" ? surveys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "36px 28px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
575
|
+
"div",
|
|
576
|
+
{
|
|
577
|
+
style: {
|
|
578
|
+
maxWidth: 640,
|
|
579
|
+
margin: "0 auto",
|
|
580
|
+
padding: "38px 32px",
|
|
581
|
+
borderRadius: 14,
|
|
582
|
+
background: "#ffffff",
|
|
583
|
+
border: "1px solid #cbd5e1",
|
|
584
|
+
textAlign: "center",
|
|
585
|
+
boxShadow: "0 6px 20px rgba(15, 23, 42, 0.04)"
|
|
586
|
+
},
|
|
587
|
+
children: [
|
|
588
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "poll", size: 40, color: "#2563eb" }),
|
|
589
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { margin: "12px 0 6px", fontSize: 18, fontWeight: 800, color: "#0f172a" }, children: tr ? "Henüz Kayıtlı Anket Bulunmuyor" : "No Surveys Found Yet" }),
|
|
590
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 20px", fontSize: 13, color: "#64748b", lineHeight: 1.55 }, children: tr ? "Sıfırdan yeni bir kurumsal anket veya oylama oluşturabilir, daha önce dışa aktardığınız bir .ci-survey.json paketini canlandırabilir ya da yerleşik örnek verileri geri yükleyebilirsiniz." : "Create a brand-new survey from scratch, revive an exported .ci-survey.json package, or restore the sample showcase dataset." }),
|
|
591
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
592
|
+
"div",
|
|
593
|
+
{
|
|
594
|
+
style: {
|
|
595
|
+
display: "flex",
|
|
596
|
+
alignItems: "center",
|
|
597
|
+
justifyContent: "center",
|
|
598
|
+
flexWrap: "wrap",
|
|
599
|
+
gap: 10
|
|
600
|
+
},
|
|
601
|
+
children: [
|
|
602
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
603
|
+
"button",
|
|
604
|
+
{
|
|
605
|
+
type: "button",
|
|
606
|
+
onClick: () => {
|
|
607
|
+
setStudioTarget(SurveyWidgetEditor.createBlankSurveyDraft(uiLocale));
|
|
608
|
+
setStudioInitialTab("builder");
|
|
609
|
+
setStudioOpen(true);
|
|
610
|
+
},
|
|
611
|
+
style: {
|
|
612
|
+
padding: "9px 16px",
|
|
613
|
+
borderRadius: 8,
|
|
614
|
+
border: "none",
|
|
615
|
+
background: "#2563eb",
|
|
616
|
+
color: "#ffffff",
|
|
617
|
+
fontSize: 12.5,
|
|
618
|
+
fontWeight: 700,
|
|
619
|
+
cursor: "pointer"
|
|
620
|
+
},
|
|
621
|
+
children: tr ? "+ Yeni Anket Oluştur" : "+ Create New Survey"
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
625
|
+
"button",
|
|
626
|
+
{
|
|
627
|
+
type: "button",
|
|
628
|
+
onClick: () => setImportModalOpen(true),
|
|
629
|
+
style: {
|
|
630
|
+
padding: "9px 16px",
|
|
631
|
+
borderRadius: 8,
|
|
632
|
+
border: "1px solid #2563eb",
|
|
633
|
+
background: "#eff6ff",
|
|
634
|
+
color: "#1d4ed8",
|
|
635
|
+
fontSize: 12.5,
|
|
636
|
+
fontWeight: 700,
|
|
637
|
+
cursor: "pointer"
|
|
638
|
+
},
|
|
639
|
+
children: tr ? "JSON Paketinden İçe Aktar" : "Import from JSON Bundle"
|
|
640
|
+
}
|
|
641
|
+
),
|
|
642
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
643
|
+
"button",
|
|
644
|
+
{
|
|
645
|
+
type: "button",
|
|
646
|
+
disabled: reseeding,
|
|
647
|
+
onClick: handleReseedDemo,
|
|
648
|
+
style: {
|
|
649
|
+
padding: "9px 14px",
|
|
650
|
+
borderRadius: 8,
|
|
651
|
+
border: "1px solid #cbd5e1",
|
|
652
|
+
background: "#f8fafc",
|
|
653
|
+
color: "#334155",
|
|
654
|
+
fontSize: 12,
|
|
655
|
+
fontWeight: 600,
|
|
656
|
+
cursor: "pointer"
|
|
657
|
+
},
|
|
658
|
+
children: tr ? "Örnek Verileri Geri Yükle" : "Restore Sample Data"
|
|
659
|
+
}
|
|
660
|
+
)
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
)
|
|
664
|
+
]
|
|
665
|
+
}
|
|
666
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
447
667
|
"div",
|
|
448
668
|
{
|
|
449
669
|
style: {
|
|
@@ -482,7 +702,7 @@ const AnalyticsHubPage = () => {
|
|
|
482
702
|
cursor: "pointer",
|
|
483
703
|
display: "flex",
|
|
484
704
|
flexDirection: "column",
|
|
485
|
-
gap:
|
|
705
|
+
gap: 5
|
|
486
706
|
},
|
|
487
707
|
children: [
|
|
488
708
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -514,6 +734,7 @@ const AnalyticsHubPage = () => {
|
|
|
514
734
|
}
|
|
515
735
|
),
|
|
516
736
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 13, fontWeight: 700, color: "#0f172a" }, children: SurveyWidgetEditor.pickTextForLocale(srv.titleI18n, uiLocale, srv.title) }),
|
|
737
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 10.5, color: "#64748b" }, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: srv.slug }) }),
|
|
517
738
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
518
739
|
"div",
|
|
519
740
|
{
|
|
@@ -613,7 +834,90 @@ const AnalyticsHubPage = () => {
|
|
|
613
834
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Anket Akışını Önizle & Test Et" : "Preview & Test Survey Flow" })
|
|
614
835
|
]
|
|
615
836
|
}
|
|
616
|
-
)
|
|
837
|
+
),
|
|
838
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 5 }, children: [
|
|
839
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
840
|
+
"button",
|
|
841
|
+
{
|
|
842
|
+
type: "button",
|
|
843
|
+
onClick: () => {
|
|
844
|
+
setExportDefaultScope("single");
|
|
845
|
+
setExportModalOpen(true);
|
|
846
|
+
},
|
|
847
|
+
title: tr ? "Seçili anketi Yapı veya Yapı + Veri olarak dışa aktar" : "Export selected survey (Structure or Full)",
|
|
848
|
+
style: {
|
|
849
|
+
padding: "7px 6px",
|
|
850
|
+
borderRadius: 7,
|
|
851
|
+
border: "1px solid #cbd5e1",
|
|
852
|
+
background: "#f8fafc",
|
|
853
|
+
color: "#0f172a",
|
|
854
|
+
fontSize: 10.5,
|
|
855
|
+
fontWeight: 700,
|
|
856
|
+
cursor: "pointer",
|
|
857
|
+
display: "inline-flex",
|
|
858
|
+
alignItems: "center",
|
|
859
|
+
justifyContent: "center",
|
|
860
|
+
gap: 4
|
|
861
|
+
},
|
|
862
|
+
children: [
|
|
863
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "download", size: 14, color: "#2563eb" }),
|
|
864
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Dışa Aktar" : "Export" })
|
|
865
|
+
]
|
|
866
|
+
}
|
|
867
|
+
),
|
|
868
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
869
|
+
"button",
|
|
870
|
+
{
|
|
871
|
+
type: "button",
|
|
872
|
+
onClick: () => setCleanupAction("clear-responses"),
|
|
873
|
+
title: tr ? "Anket yapısını koruyarak sadece yanıtları sıfırlar (0 yapar)" : "Clear all responses for this survey while keeping its structure",
|
|
874
|
+
style: {
|
|
875
|
+
padding: "7px 6px",
|
|
876
|
+
borderRadius: 7,
|
|
877
|
+
border: "1px solid #fcd34d",
|
|
878
|
+
background: "#fffbeb",
|
|
879
|
+
color: "#92400e",
|
|
880
|
+
fontSize: 10.5,
|
|
881
|
+
fontWeight: 700,
|
|
882
|
+
cursor: "pointer",
|
|
883
|
+
display: "inline-flex",
|
|
884
|
+
alignItems: "center",
|
|
885
|
+
justifyContent: "center",
|
|
886
|
+
gap: 4
|
|
887
|
+
},
|
|
888
|
+
children: [
|
|
889
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "restart_alt", size: 14, color: "#d97706" }),
|
|
890
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Yanıt 0'la" : "Reset" })
|
|
891
|
+
]
|
|
892
|
+
}
|
|
893
|
+
),
|
|
894
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
895
|
+
"button",
|
|
896
|
+
{
|
|
897
|
+
type: "button",
|
|
898
|
+
onClick: () => setCleanupAction("delete-survey"),
|
|
899
|
+
title: tr ? "Bu anketi ve tüm yanıtlarını kalıcı olarak siler" : "Delete this survey and all its responses",
|
|
900
|
+
style: {
|
|
901
|
+
padding: "7px 6px",
|
|
902
|
+
borderRadius: 7,
|
|
903
|
+
border: "1px solid #fecaca",
|
|
904
|
+
background: "#fef2f2",
|
|
905
|
+
color: "#991b1b",
|
|
906
|
+
fontSize: 10.5,
|
|
907
|
+
fontWeight: 700,
|
|
908
|
+
cursor: "pointer",
|
|
909
|
+
display: "inline-flex",
|
|
910
|
+
alignItems: "center",
|
|
911
|
+
justifyContent: "center",
|
|
912
|
+
gap: 4
|
|
913
|
+
},
|
|
914
|
+
children: [
|
|
915
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "delete", size: 14, color: "#dc2626" }),
|
|
916
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Sil" : "Delete" })
|
|
917
|
+
]
|
|
918
|
+
}
|
|
919
|
+
)
|
|
920
|
+
] })
|
|
617
921
|
] })
|
|
618
922
|
]
|
|
619
923
|
}
|
|
@@ -811,6 +1115,67 @@ const AnalyticsHubPage = () => {
|
|
|
811
1115
|
setAnalyticsRefreshKey((k) => k + 1);
|
|
812
1116
|
}
|
|
813
1117
|
}
|
|
1118
|
+
),
|
|
1119
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1120
|
+
SurveyWidgetEditor.SurveyExportModal,
|
|
1121
|
+
{
|
|
1122
|
+
open: exportModalOpen,
|
|
1123
|
+
uiLocale,
|
|
1124
|
+
targetSurvey: currentSurvey,
|
|
1125
|
+
allowAllSurveys: true,
|
|
1126
|
+
defaultScope: exportDefaultScope,
|
|
1127
|
+
totalSurveysCount: surveys.length,
|
|
1128
|
+
onClose: () => setExportModalOpen(false)
|
|
1129
|
+
}
|
|
1130
|
+
),
|
|
1131
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1132
|
+
SurveyWidgetEditor.SurveyImportModal,
|
|
1133
|
+
{
|
|
1134
|
+
open: importModalOpen,
|
|
1135
|
+
uiLocale,
|
|
1136
|
+
existingSlugs: surveys.map((s) => s.slug),
|
|
1137
|
+
onClose: () => setImportModalOpen(false),
|
|
1138
|
+
onImported: async (res) => {
|
|
1139
|
+
await loadSurveys();
|
|
1140
|
+
if (res.importedSurveys?.[0]?.slug) {
|
|
1141
|
+
setSelectedSurveySlug(res.importedSurveys[0].slug);
|
|
1142
|
+
}
|
|
1143
|
+
setAnalyticsRefreshKey((k) => k + 1);
|
|
1144
|
+
setHubNotice(
|
|
1145
|
+
tr ? `${res.importedCount} anket ve ${res.importedResponsesCount} yanıt başarıyla içe aktarıldı!` : `Successfully imported ${res.importedCount} survey(s) and ${res.importedResponsesCount} response(s)!`
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
),
|
|
1150
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1151
|
+
SurveyWidgetEditor.SurveyCleanupConfirmModal,
|
|
1152
|
+
{
|
|
1153
|
+
open: Boolean(cleanupAction),
|
|
1154
|
+
action: cleanupAction,
|
|
1155
|
+
uiLocale,
|
|
1156
|
+
targetSurvey: currentSurvey,
|
|
1157
|
+
onClose: () => setCleanupAction(null),
|
|
1158
|
+
onCompleted: async (act, payload) => {
|
|
1159
|
+
await loadSurveys();
|
|
1160
|
+
if (section === "forms" || act === "purge-demo") {
|
|
1161
|
+
await loadFormsAndSubmissions();
|
|
1162
|
+
}
|
|
1163
|
+
setAnalyticsRefreshKey((k) => k + 1);
|
|
1164
|
+
if (act === "purge-demo") {
|
|
1165
|
+
setHubNotice(
|
|
1166
|
+
tr ? `Dummy veriler temizlendi (${payload?.deletedSurveys || 0} örnek anket, ${payload?.deletedSurveyResponses || 0} örnek yanıt, ${payload?.deletedForms || 0} örnek form silindi).` : `Demo data purged (${payload?.deletedSurveys || 0} demo surveys, ${payload?.deletedSurveyResponses || 0} demo responses, ${payload?.deletedForms || 0} demo forms removed).`
|
|
1167
|
+
);
|
|
1168
|
+
} else if (act === "clear-responses") {
|
|
1169
|
+
setHubNotice(
|
|
1170
|
+
tr ? `Seçili anketin ${payload?.deletedCount || 0} yanıtı sıfırlandı.` : `Cleared ${payload?.deletedCount || 0} response(s) from the selected survey.`
|
|
1171
|
+
);
|
|
1172
|
+
} else if (act === "delete-survey") {
|
|
1173
|
+
setHubNotice(
|
|
1174
|
+
tr ? "Anket ve bağlı yanıtları kalıcı olarak silindi." : "Survey and its responses were permanently deleted."
|
|
1175
|
+
);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
814
1179
|
)
|
|
815
1180
|
]
|
|
816
1181
|
}
|