Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/export-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Vybrat pracovní prostor pro export dokumentů z prostoru",
"SelectSpace": "Vybrat prostor",
"NoSelectedDocuments": "Žádné dokumenty nevybrány",
"NoDocumentsMatchedFilters": "Pro export nebyly nalezeny žádné dokumenty odpovídající aktuálním filtrům. Upravte filtry nebo výběr a zkuste to znovu.",
"RequestPermissionToImport": "Prosím, požádejte vlastníka cílového pracovního prostoru o povolení k importu dokumentů.",
"ExportOnlyEffective": "Exportovat pouze dokumenty s platným stavem",
"ExportFilterMode": "Dokumenty k exportu",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Arbeitsbereich zum Exportieren von Dokumenten aus dem Bereich auswählen",
"SelectSpace": "Bereich auswählen",
"NoSelectedDocuments": "Keine Dokumente ausgewählt",
"NoDocumentsMatchedFilters": "Es wurden keine Dokumente zum Export gefunden, die den aktuellen Filtern entsprechen. Passen Sie Ihre Filter oder Auswahl an und versuchen Sie es erneut.",
"RequestPermissionToImport": "Bitte fordern Sie die Berechtigung vom Eigentümer des Ziel-Arbeitsbereichs an, um Dokumente zu importieren.",
"ExportOnlyEffective": "Nur Dokumente mit wirksamem Status exportieren",
"ExportFilterMode": "Zu exportierende Dokumente",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Select workspace to export documents from space",
"SelectSpace": "Select space",
"NoSelectedDocuments": "No documents selected",
"NoDocumentsMatchedFilters": "No documents were found to export with the current filters. Try adjusting your filters or selection and try again.",
"RequestPermissionToImport": "Please request permission from the target workspace owner to import documents.",
"ExportOnlyEffective": "Export only documents with effective status",
"ExportFilterMode": "Documents to export",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Seleccionar espacio de trabajo para exportar documentos del espacio",
"SelectSpace": "Seleccionar espacio",
"NoSelectedDocuments": "No hay documentos seleccionados",
"NoDocumentsMatchedFilters": "No se encontraron documentos para exportar con los filtros actuales. Ajusta los filtros o la selección y vuelve a intentarlo.",
"RequestPermissionToImport": "Por favor, solicite permiso al propietario del espacio de trabajo de destino para importar documentos.",
"ExportOnlyEffective": "Exportar solo documentos con estado efectivo",
"ExportFilterMode": "Documentos a exportar",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Sélectionner l'espace de travail pour exporter les documents de l'espace",
"SelectSpace": "Sélectionner l'espace",
"NoSelectedDocuments": "Aucun document sélectionné",
"NoDocumentsMatchedFilters": "Aucun document à exporter ne correspond aux filtres actuels. Modifiez vos filtres ou votre sélection puis réessayez.",
"RequestPermissionToImport": "Veuillez demander l'autorisation au propriétaire de l'espace de travail cible pour importer des documents.",
"ExportOnlyEffective": "Exporter uniquement les documents avec statut effectif",
"ExportFilterMode": "Documents à exporter",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Seleziona spazio di lavoro per esportare documenti dallo spazio",
"SelectSpace": "Seleziona spazio",
"NoSelectedDocuments": "Nessun documento selezionato",
"NoDocumentsMatchedFilters": "Nessun documento da esportare corrisponde ai filtri attuali. Modifica i filtri o la selezione e riprova.",
"RequestPermissionToImport": "Si prega di richiedere l'autorizzazione al proprietario dello spazio di lavoro di destinazione per importare documenti.",
"ExportOnlyEffective": "Esporta solo documenti con stato effettivo",
"ExportFilterMode": "Documenti da esportare",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "スペースからドキュメントをエクスポートするワークスペースを選択",
"SelectSpace": "スペースを選択",
"NoSelectedDocuments": "ドキュメントが選択されていません",
"NoDocumentsMatchedFilters": "現在のフィルターではエクスポート対象のドキュメントが見つかりませんでした。フィルターまたは選択内容を変更して、もう一度お試しください。",
"RequestPermissionToImport": "ドキュメントをインポートするには、対象ワークスペースの所有者に許可をリクエストしてください。",
"ExportOnlyEffective": "有効なステータスのドキュメントのみエクスポート",
"ExportFilterMode": "エクスポートするドキュメント",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Selecionar espaço de trabalho para exportar documentos do espaço",
"SelectSpace": "Selecionar espaço",
"NoSelectedDocuments": "Nenhum documento selecionado",
"NoDocumentsMatchedFilters": "Nenhum documento foi encontrado para exportação com os filtros atuais. Ajuste os filtros ou a seleção e tente novamente.",
"RequestPermissionToImport": "Por favor, solicite permissão ao proprietário do espaço de trabalho de destino para importar documentos.",
"SkipDeletedObsolete": "Pular documentos arquivados ou obsoletos",
"ExportOnlyEffective": "Exportar apenas documentos com status efetivo",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Selecionar espaço de trabalho para exportar documentos do espaço",
"SelectSpace": "Selecionar espaço",
"NoSelectedDocuments": "Nenhum documento selecionado",
"NoDocumentsMatchedFilters": "Nenhum documento foi encontrado para exportação com os filtros atuais. Ajuste os filtros ou a seleção e tente novamente.",
"RequestPermissionToImport": "Por favor, solicite permissão ao proprietário do espaço de trabalho de destino para importar documentos.",
"ExportOnlyEffective": "Exportar apenas documentos com status efetivo",
"ExportFilterMode": "Documentos a exportar",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Выбрать рабочее пространство для экспорта документов из пространства",
"SelectSpace": "Выбрать пространство",
"NoSelectedDocuments": "Документы не выбраны",
"NoDocumentsMatchedFilters": "Не удалось найти документы для экспорта с текущими фильтрами. Измените фильтры или выбор и попробуйте снова.",
"RequestPermissionToImport": "Пожалуйста, запросите разрешение у владельца рабочего пространства, куда вы хотите экспортировать документы.",
"ExportOnlyEffective": "Экспортировать только документы с действующим статусом",
"ExportFilterMode": "Документы для экспорта",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "Alanın belgelerini dışa aktarmak için çalışma alanı seç",
"SelectSpace": "Alan seç",
"NoSelectedDocuments": "Seçili belge yok",
"NoDocumentsMatchedFilters": "Geçerli filtrelerle dışa aktarılacak belge bulunamadı. Filtreleri veya seçimi düzenleyip tekrar deneyin.",
"RequestPermissionToImport": "Belgeleri içe aktarmak için lütfen hedef çalışma alanı sahibinden izin isteyin.",
"ExportOnlyEffective": "Yalnızca geçerli durumdaki belgeleri dışa aktar",
"ExportFilterMode": "Dışa aktarılacak belgeler",
Expand Down
1 change: 1 addition & 0 deletions plugins/export-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"SelectWorkspaceToExportSpace": "选择工作区以从空间导出文档",
"SelectSpace": "选择空间",
"NoSelectedDocuments": "未选择文档",
"NoDocumentsMatchedFilters": "使用当前筛选条件未找到可导出的文档。请调整筛选条件或选择后重试。",
"RequestPermissionToImport": "请向目标工作区所有者请求导入文档的权限。",
"ExportOnlyEffective": "仅导出具有有效状态的文档",
"ExportFilterMode": "要导出的文档",
Expand Down
22 changes: 21 additions & 1 deletion plugins/export-resources/src/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,23 @@ export async function exportToWorkspace (

if (!res.ok) {
let errorMessage = 'Unknown error occurred'
let noDocuments = false
try {
const errorData = await res.json()
errorMessage = errorData.message ?? errorData.error ?? `HTTP ${res.status}: ${res.statusText}`
if (res.status === 400 && errorMessage === 'No documents found to export') {
noDocuments = true
}
} catch {
errorMessage = `HTTP ${res.status}: ${res.statusText}`
}
console.error('Export request failed:', errorMessage)
await showFailureNotification(errorMessage)

if (noDocuments) {
await showNoDocumentsNotification()
} else {
await showFailureNotification(errorMessage)
}
return
}

Expand All @@ -117,6 +126,17 @@ export async function exportToWorkspace (
}
}

async function showNoDocumentsNotification (): Promise<void> {
const lang = getCurrentLanguage()
addNotification(
await translate(plugin.string.ExportToWorkspaceFailed, {}, lang),
await translate(plugin.string.NoDocumentsMatchedFilters, {}, lang),
ExportNotification,
undefined,
NotificationSeverity.Error
)
}

async function showFailureNotification (errorDetails?: string): Promise<void> {
const lang = getCurrentLanguage()
const message =
Expand Down
1 change: 1 addition & 0 deletions plugins/export-resources/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default mergeIds(exportId, exportPlugin, {
SelectWorkspaceToExportSpace: '' as IntlString,
SelectSpace: '' as IntlString,
NoSelectedDocuments: '' as IntlString,
NoDocumentsMatchedFilters: '' as IntlString,
RequestPermissionToImport: '' as IntlString,
ExportOnlyEffective: '' as IntlString,
ExportFilterMode: '' as IntlString,
Expand Down
6 changes: 5 additions & 1 deletion services/export/pod-export/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,11 @@ export function createServer (

const exportResult: ExportResult = await exporter.export(options)

if (exportResult.success && exportResult.exportedCount > 0) {
if (exportResult.exportedCount === 0) {
res.status(400).send({ message: 'No documents found to export' })
}

if (exportResult.success) {
await sendExportCompletionNotification(
measureCtx,
targetTxOps,
Expand Down
Loading