feat(web): fix snippet publish copy

This commit is contained in:
JzoNg 2026-06-23 10:58:32 +08:00
parent f9bb24458d
commit cd2c40e7c0
25 changed files with 25 additions and 48 deletions

View File

@ -77,7 +77,7 @@ describe('useSnippetPublish', () => {
expect(updateSnippetDetail({ is_published: false })).toEqual({ is_published: true })
expect(mockSetPublishedAt).toHaveBeenCalledWith(1_712_345_678)
expect(mockResetWorkflowVersionHistory).toHaveBeenCalledTimes(1)
expect(toast.success).toHaveBeenCalledWith('snippet.saveSuccess')
expect(toast.success).toHaveBeenCalledWith('snippet.publishSuccess')
})
it('should not publish the snippet when checklist validation fails', async () => {

View File

@ -42,7 +42,7 @@ export const useSnippetPublish = ({
)
workflowStore.getState().setPublishedAt(publishedWorkflow.created_at)
resetWorkflowVersionHistory()
toast.success(t('saveSuccess'))
toast.success(t('publishSuccess'))
return true
}
catch (error) {

View File

@ -17,7 +17,7 @@
"editDialogTitle": "تحرير معلومات المقتطف",
"editDone": "تم تحديث معلومات المقتطف",
"editFailed": "فشل تحديث معلومات المقتطف",
"emptyGraphSaveError": "أضف عقدة واحدة على الأقل قبل الحفظ.",
"emptyGraphSaveError": "أضف عقدة واحدة على الأقل قبل النشر.",
"exportFailed": "فشل تصدير المقتطف.",
"importDSLFile": "استيراد ملف دي اس ال",
"importDialogTitle": "استيراد مقتطف",
@ -43,7 +43,6 @@
"publishFailed": "فشل نشر المقتطف",
"publishMenuCurrentDraft": "المسودة الحالية غير منشورة",
"publishSuccess": "تم نشر المقتطف",
"saveSuccess": "تم حفظ المقتطف",
"sectionOrchestrate": "نسق",
"testRunButton": "تشغيل تجريبي",
"typeLabel": "مقتطف",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Bearbeiten Sie die Snippet-Informationen",
"editDone": "Snippet-Informationen aktualisiert",
"editFailed": "Snippet-Informationen konnten nicht aktualisiert werden",
"emptyGraphSaveError": "Fügen Sie vor dem Speichern mindestens einen Knoten hinzu.",
"emptyGraphSaveError": "Fügen Sie vor dem Veröffentlichen mindestens einen Knoten hinzu.",
"exportFailed": "Der Export des Snippets ist fehlgeschlagen.",
"importDSLFile": "DSL-Datei importieren",
"importDialogTitle": "Snippet importieren",
@ -43,7 +43,6 @@
"publishFailed": "Snippet konnte nicht veröffentlicht werden",
"publishMenuCurrentDraft": "Aktueller Entwurf unveröffentlicht",
"publishSuccess": "Snippet veröffentlicht",
"saveSuccess": "Snippet gespeichert",
"sectionOrchestrate": "Orchestrieren",
"testRunButton": "Testlauf",
"typeLabel": "Ausschnitt",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Edit Snippet Info",
"editDone": "Snippet info updated",
"editFailed": "Failed to update snippet info",
"emptyGraphSaveError": "Add at least one node before saving.",
"emptyGraphSaveError": "Add at least one node before publishing.",
"exportFailed": "Export snippet failed.",
"importDSLFile": "Import DSL file",
"importDialogTitle": "Import Snippet",
@ -43,7 +43,6 @@
"publishFailed": "Failed to publish snippet",
"publishMenuCurrentDraft": "Current draft unpublished",
"publishSuccess": "Snippet published",
"saveSuccess": "Snippet saved",
"sectionOrchestrate": "Orchestrate",
"testRunButton": "Test run",
"typeLabel": "Snippet",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Editar información del fragmento",
"editDone": "Información del fragmento actualizada",
"editFailed": "No se pudo actualizar la información del fragmento",
"emptyGraphSaveError": "Agregue al menos un nodo antes de guardar.",
"emptyGraphSaveError": "Agregue al menos un nodo antes de publicar.",
"exportFailed": "Error al exportar el fragmento.",
"importDSLFile": "Importar archivo DSL",
"importDialogTitle": "Importar fragmento",
@ -43,7 +43,6 @@
"publishFailed": "No se pudo publicar el fragmento",
"publishMenuCurrentDraft": "Borrador actual inédito",
"publishSuccess": "Fragmento publicado",
"saveSuccess": "Fragmento guardado",
"sectionOrchestrate": "orquestar",
"testRunButton": "Ejecución de prueba",
"typeLabel": "Fragmento",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "ویرایش اطلاعات قطعه",
"editDone": "اطلاعات قطعه به‌روزرسانی شد",
"editFailed": "اطلاعات قطعه به‌روزرسانی نشد",
"emptyGraphSaveError": "قبل از ذخیره حداقل یک گره اضافه کنید.",
"emptyGraphSaveError": "قبل از انتشار حداقل یک گره اضافه کنید.",
"exportFailed": "قطعه صادر نشد.",
"importDSLFile": "فایل DSL را وارد کنید",
"importDialogTitle": "وارد کردن قطعه",
@ -43,7 +43,6 @@
"publishFailed": "انتشار قطعه ناموفق بود",
"publishMenuCurrentDraft": "پیش نویس فعلی منتشر نشده است",
"publishSuccess": "قطعه منتشر شد",
"saveSuccess": "قطعه ذخیره شد",
"sectionOrchestrate": "ارکستر کردن",
"testRunButton": "اجرای آزمایشی",
"typeLabel": "قطعه",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Modifier les informations sur l'extrait",
"editDone": "Informations sur l'extrait mises jour",
"editFailed": "Échec de la mise jour des informations sur l'extrait",
"emptyGraphSaveError": "Ajoutez au moins un nœud avant d'enregistrer.",
"emptyGraphSaveError": "Ajoutez au moins un nœud avant de publier.",
"exportFailed": "Échec de l'exportation de l'extrait.",
"importDSLFile": "Importer un fichier DSL",
"importDialogTitle": "Importer un extrait",
@ -43,7 +43,6 @@
"publishFailed": "Échec de la publication de l'extrait",
"publishMenuCurrentDraft": "Projet actuel non publié",
"publishSuccess": "Extrait publié",
"saveSuccess": "Extrait enregistré",
"sectionOrchestrate": "Orchestrer",
"testRunButton": "Exécution d'essai",
"typeLabel": "Extrait",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "स्निपेट जानकारी संपादित करें",
"editDone": "स्निपेट जानकारी अपडेट की गई",
"editFailed": "स्निपेट जानकारी अपडेट करने में विफल",
"emptyGraphSaveError": "सहेजने से पहले कम से कम एक नोड जोड़ें.",
"emptyGraphSaveError": "प्रकाशित करने से पहले कम से कम एक नोड जोड़ें.",
"exportFailed": "निर्यात स्निपेट विफल रहा.",
"importDSLFile": "डीएसएल फ़ाइल आयात करें",
"importDialogTitle": "स्निपेट आयात करें",
@ -43,7 +43,6 @@
"publishFailed": "स्निपेट प्रकाशित करने में विफल",
"publishMenuCurrentDraft": "वर्तमान मसौदा अप्रकाशित",
"publishSuccess": "स्निपेट प्रकाशित",
"saveSuccess": "स्निपेट सहेजा गया",
"sectionOrchestrate": "आर्केस्ट्रा",
"testRunButton": "टेस्ट रन",
"typeLabel": "स्निपेट",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Edit Info Cuplikan",
"editDone": "Info cuplikan diperbarui",
"editFailed": "Gagal memperbarui info cuplikan",
"emptyGraphSaveError": "Tambahkan setidaknya satu node sebelum menyimpan.",
"emptyGraphSaveError": "Tambahkan setidaknya satu node sebelum memublikasikan.",
"exportFailed": "Ekspor cuplikan gagal.",
"importDSLFile": "Impor berkas DSL",
"importDialogTitle": "Impor Cuplikan",
@ -43,7 +43,6 @@
"publishFailed": "Gagal memublikasikan cuplikan",
"publishMenuCurrentDraft": "Draf saat ini tidak dipublikasikan",
"publishSuccess": "Cuplikan diterbitkan",
"saveSuccess": "Cuplikan disimpan",
"sectionOrchestrate": "Mengatur",
"testRunButton": "Uji coba",
"typeLabel": "Cuplikan",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Modifica informazioni sullo snippet",
"editDone": "Informazioni sullo snippet aggiornate",
"editFailed": "Impossibile aggiornare le informazioni sullo snippet",
"emptyGraphSaveError": "Aggiungi almeno un nodo prima di salvare.",
"emptyGraphSaveError": "Aggiungi almeno un nodo prima di pubblicare.",
"exportFailed": "Esportazione dello snippet non riuscita.",
"importDSLFile": "Importa file DSL",
"importDialogTitle": "Importa snippet",
@ -43,7 +43,6 @@
"publishFailed": "Impossibile pubblicare lo snippet",
"publishMenuCurrentDraft": "Bozza attuale non pubblicata",
"publishSuccess": "Frammento pubblicato",
"saveSuccess": "Frammento salvato",
"sectionOrchestrate": "Orchestrare",
"testRunButton": "Prova di funzionamento",
"typeLabel": "Frammento",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "スニペット情 の編集",
"editDone": "スニペット情 が更新されました",
"editFailed": "スニペット情 の更新に失敗しました",
"emptyGraphSaveError": "保存する前に少なくとも 1 つのノードを追 してく さい。",
"emptyGraphSaveError": "公開する前に少なくとも 1 つのノードを追加してください。",
"exportFailed": "スニペットのエクスポートに失敗しました。",
"importDSLFile": "DSL ファイルをインポートする",
"importDialogTitle": "スニペットのインポート",
@ -43,7 +43,6 @@
"publishFailed": "スニペットの公開に失敗しました",
"publishMenuCurrentDraft": "現在のドラフトは未公開です",
"publishSuccess": "スニペットが公開されました",
"saveSuccess": "スニペットが保存されました",
"sectionOrchestrate": "オーケストレーション",
"testRunButton": "試運転",
"typeLabel": "スニペット",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "스니펫 보 편집",
"editDone": "스니펫 보가 업데이트되었습니다.",
"editFailed": "스니펫 보를 업데이트하지 못했습니다.",
"emptyGraphSaveError": "저장하기 전에 노드를 하나 이상 추가하십시오.",
"emptyGraphSaveError": "게시하기 전에 노드를 하나 이상 추가하세요.",
"exportFailed": "스니펫 내보내기에 실패했습니다.",
"importDSLFile": "DSL 파일 가 오기",
"importDialogTitle": "스니펫 가 오기",
@ -43,7 +43,6 @@
"publishFailed": "스니펫을 게시하지 못했습니다.",
"publishMenuCurrentDraft": "현재 초안이 게시되지 않았습니다.",
"publishSuccess": "스니펫이 게시되었습니다.",
"saveSuccess": "스니펫이 장되었습니다.",
"sectionOrchestrate": "오케스트 이션",
"testRunButton": "테스트 실행",
"typeLabel": "스니펫",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Fragmentinformatie bewerken",
"editDone": "Fragmentinformatie bijgewerkt",
"editFailed": "Kan fragmentinformatie niet updaten",
"emptyGraphSaveError": "Voeg ten minste één knooppunt toe voordat u opslaat.",
"emptyGraphSaveError": "Voeg ten minste één knooppunt toe voordat u publiceert.",
"exportFailed": "Het exporteren van het fragment is mislukt.",
"importDSLFile": "DSL-bestand importeren",
"importDialogTitle": "Fragment importeren",
@ -43,7 +43,6 @@
"publishFailed": "Kan fragment niet publiceren",
"publishMenuCurrentDraft": "Huidig concept niet gepubliceerd",
"publishSuccess": "Fragment gepubliceerd",
"saveSuccess": "Fragment opgeslagen",
"sectionOrchestrate": "Orkesteren",
"testRunButton": "Proefdraaien",
"typeLabel": "Fragment",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Edytuj informacje o fragmentach",
"editDone": "Zaktualizowano informacje o fragmencie",
"editFailed": "Nie udało się zaktualizować informacji o fragmencie",
"emptyGraphSaveError": "Przed zapisaniem dodaj co najmniej jeden węzeł.",
"emptyGraphSaveError": "Przed opublikowaniem dodaj co najmniej jeden węzeł.",
"exportFailed": "Nie udało się wyeksportować fragmentu.",
"importDSLFile": "Importuj plik DSL",
"importDialogTitle": "Importuj fragment",
@ -43,7 +43,6 @@
"publishFailed": "Nie udało się opublikować fragmentu",
"publishMenuCurrentDraft": "Aktualny projekt niepublikowany",
"publishSuccess": "Fragment opublikowany",
"saveSuccess": "Fragment został zapisany",
"sectionOrchestrate": "Orkiestrować",
"testRunButton": "Uruchomienie próbne",
"typeLabel": "Fragment",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Editar informações do snippet",
"editDone": "Informações do snippet atualizadas",
"editFailed": "Falha ao atualizar as informações do snippet",
"emptyGraphSaveError": "Adicione pelo menos um nó antes de salvar.",
"emptyGraphSaveError": "Adicione pelo menos um nó antes de publicar.",
"exportFailed": "Falha na exportação do snippet.",
"importDSLFile": "Importar arquivo DSL",
"importDialogTitle": "Fragmento de importação",
@ -43,7 +43,6 @@
"publishFailed": "Falha ao publicar o snippet",
"publishMenuCurrentDraft": "Rascunho atual não publicado",
"publishSuccess": "Trecho publicado",
"saveSuccess": "Fragmento salvo",
"sectionOrchestrate": "Orquestrar",
"testRunButton": "Execução de teste",
"typeLabel": "Trecho",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Editați informațiile fragmentului",
"editDone": "Informațiile despre fragment au fost actualizate",
"editFailed": "Nu s-au actualizat informațiile despre fragment",
"emptyGraphSaveError": "Adăugați cel puțin un nod înainte de a salva.",
"emptyGraphSaveError": "Adăugați cel puțin un nod înainte de a publica.",
"exportFailed": "Exportul fragmentului nu a reușit.",
"importDSLFile": "Importați fișierul DSL",
"importDialogTitle": "Importați fragment",
@ -43,7 +43,6 @@
"publishFailed": "Nu s-a putut publica fragmentul",
"publishMenuCurrentDraft": "Schița actuală nepublicată",
"publishSuccess": "Snippet publicat",
"saveSuccess": "Fragmentul a fost salvat",
"sectionOrchestrate": "Orchestrare",
"testRunButton": "Rulează testul",
"typeLabel": "Fragment",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Изменить информацию о фрагменте",
"editDone": "Информация о фрагменте обновлена.",
"editFailed": "Не удалось обновить информацию о фрагменте.",
"emptyGraphSaveError": "Перед сохранением добавьте хотя бы один узел.",
"emptyGraphSaveError": "Перед публикацией добавьте хотя бы один узел.",
"exportFailed": "Экспортировать фрагмент не удалось.",
"importDSLFile": "Импортировать DSL-файл",
"importDialogTitle": "Импортировать фрагмент",
@ -43,7 +43,6 @@
"publishFailed": "Не удалось опубликовать фрагмент.",
"publishMenuCurrentDraft": "Текущий проект не опубликован",
"publishSuccess": "Фрагмент опубликован.",
"saveSuccess": "Фрагмент сохранен.",
"sectionOrchestrate": "оркестровать",
"testRunButton": "Тестовый запуск",
"typeLabel": "Фрагмент",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Uredi informacije o izrezku",
"editDone": "Podatki o delčku so posodobljeni",
"editFailed": "Podatkov o delčku ni bilo mogoče posodobiti",
"emptyGraphSaveError": "Pred shranjevanjem dodajte vsaj eno vozlišče.",
"emptyGraphSaveError": "Pred objavo dodajte vsaj eno vozlišče.",
"exportFailed": "Izvoz delčka ni uspel.",
"importDSLFile": "Uvozi datoteko DSL",
"importDialogTitle": "Uvozi delček",
@ -43,7 +43,6 @@
"publishFailed": "Objava delčka ni uspela",
"publishMenuCurrentDraft": "Trenutni osnutek neobjavljen",
"publishSuccess": "Delček objavljen",
"saveSuccess": "Delček shranjen",
"sectionOrchestrate": "Orkestrirajte",
"testRunButton": "Testna vožnja",
"typeLabel": "Izrezek",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "แก้ไขข้อมูลตัวอย่าง",
"editDone": "อัปเดตข้อมูลตัวอย่างแล้ว",
"editFailed": "อัปเดตข้อมูลตัวอย่างไม่สำเร็จ",
"emptyGraphSaveError": "เพิ่มอย่างน้อยหนึ่งโหนดก่อนที่จะบันทึก",
"emptyGraphSaveError": "เพิ่มอย่างน้อยหนึ่งโหนดก่อนเผยแพร่",
"exportFailed": "ส่งออกข้อมูลโค้ดไม่สำเร็จ",
"importDSLFile": "นำเข้าไฟล์ DSL",
"importDialogTitle": "นำเข้าข้อมูลโค้ด",
@ -43,7 +43,6 @@
"publishFailed": "ไม่สามารถเผยแพร่ตัวอย่างได้",
"publishMenuCurrentDraft": "ฉบับร่างปัจจุบันไม่ได้เผยแพร่",
"publishSuccess": "เผยแพร่ตัวอย่างแล้ว",
"saveSuccess": "บันทึกตัวอย่างแล้ว",
"sectionOrchestrate": "เรียบเรียง",
"testRunButton": "ทดสอบการทำงาน",
"typeLabel": "ตัวอย่าง",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Parçacık Bilgilerini Düzenle",
"editDone": "Snippet bilgisi güncellendi",
"editFailed": "Snippet bilgileri güncellenemedi",
"emptyGraphSaveError": "Kaydetmeden önce en az bir düğüm ekleyin.",
"emptyGraphSaveError": "Yayınlamadan önce en az bir düğüm ekleyin.",
"exportFailed": "Snippet'i dışa aktarma başarısız oldu.",
"importDSLFile": "DSL dosyasını içe aktar",
"importDialogTitle": "Parçacığı İçe Aktar",
@ -43,7 +43,6 @@
"publishFailed": "Snippet yayınlanamadı",
"publishMenuCurrentDraft": "Mevcut taslak yayınlanmadı",
"publishSuccess": "Snippet yayınlandı",
"saveSuccess": "Snippet kaydedildi",
"sectionOrchestrate": "Yönetmek",
"testRunButton": "Test çalıştırması",
"typeLabel": "Parçacık",

View File

@ -17,7 +17,7 @@
"editDialogTitle": " едагувати інформацію про фрагмент",
"editDone": "Інформацію про фрагмент оновлено",
"editFailed": "Не вдалося оновити інформацію про фрагмент",
"emptyGraphSaveError": "Додайте принаймні один вузол перед збереженням.",
"emptyGraphSaveError": "Додайте принаймні один вузол перед публікацією.",
"exportFailed": "Не вдалося експортувати фрагмент.",
"importDSLFile": "Імпорт файлу DSL",
"importDialogTitle": "Імпорт фрагмента",
@ -43,7 +43,6 @@
"publishFailed": "Не вдалося опублікувати фрагмент",
"publishMenuCurrentDraft": "Поточна чернетка не опублікована",
"publishSuccess": "Фрагмент опубліковано",
"saveSuccess": "Фрагмент збережено",
"sectionOrchestrate": "Оркеструвати",
"testRunButton": "Тестовий запуск",
"typeLabel": "Фрагмент",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "Chỉnh sửa thông tin đoạn trích",
"editDone": "Thông tin đoạn trích đã được cập nhật",
"editFailed": "Không cập nhật được thông tin đoạn trích",
"emptyGraphSaveError": "Thêm ít nhất một nút trước khi lưu.",
"emptyGraphSaveError": "Thêm ít nhất một nút trước khi xuất bản.",
"exportFailed": "Xuất đoạn trích không thành công.",
"importDSLFile": "Nhập tệp DSL",
"importDialogTitle": "Nhập đoạn trích",
@ -43,7 +43,6 @@
"publishFailed": "Không thể xuất bản đoạn trích",
"publishMenuCurrentDraft": "Bản thảo hiện tại chưa được xuất bản",
"publishSuccess": "Đoạn trích được xuất bản",
"saveSuccess": "Đã lưu đoạn trích",
"sectionOrchestrate": "Điều phối",
"testRunButton": "Chạy thử",
"typeLabel": "Đoạn trích",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "编辑 Snippet 信息",
"editDone": "Snippet 信息已更新",
"editFailed": "更新 Snippet 信息失败",
"emptyGraphSaveError": "请至少添加一个节点后再保存。",
"emptyGraphSaveError": "请至少添加一个节点后再发布。",
"exportFailed": "导出 Snippet 失败。",
"importDSLFile": "导入 DSL 文件",
"importDialogTitle": "导入 Snippet",
@ -43,7 +43,6 @@
"publishFailed": "发布 Snippet 失败",
"publishMenuCurrentDraft": "当前草稿未发布",
"publishSuccess": "Snippet 已发布",
"saveSuccess": "Snippet 保存成功",
"sectionOrchestrate": "编排",
"testRunButton": "测试运行",
"typeLabel": "Snippet",

View File

@ -17,7 +17,7 @@
"editDialogTitle": "編輯片段訊息",
"editDone": "片段資訊已更新",
"editFailed": "無法更新片段訊息",
"emptyGraphSaveError": "保存前至少新增一個節點。",
"emptyGraphSaveError": "請至少新增一個節點後再發布。",
"exportFailed": "導出片段失敗。",
"importDSLFile": "導入 DSL 文件",
"importDialogTitle": "導入片段",
@ -43,7 +43,6 @@
"publishFailed": "無法發布片段",
"publishMenuCurrentDraft": "當前草案未發布",
"publishSuccess": "已發布片段",
"saveSuccess": "片段已儲存",
"sectionOrchestrate": "編排",
"testRunButton": "試運行",
"typeLabel": "片段",