From e7f7d9e64e05b51294a2b76a22c367df16cf35bf Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Wed, 5 Nov 2025 13:58:28 -0800
Subject: [PATCH] Use titles not IDs
---
.../share-bundle-dialog.component.html | 4 ++--
.../share-bundle-dialog.component.ts | 22 +++++++++----------
.../share-bundle-manage-dialog.component.ts | 4 ----
.../bulk-editor/bulk-editor.component.ts | 10 ++++-----
4 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.html b/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.html
index ed0360ad1..0c9c95bf0 100644
--- a/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.html
+++ b/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.html
@@ -12,9 +12,9 @@
@if (documentPreview.length > 0) {
- @for (docId of documentPreview; track docId) {
+ @for (doc of documentPreview; track doc.id) {
-
-
{{ docId }}
+ {{ doc.title | documentTitle }}
}
@if (selectionCount > documentPreview.length) {
diff --git a/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.ts b/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.ts
index 484f5af15..330baec22 100644
--- a/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.ts
+++ b/src-ui/src/app/components/common/share-bundle-dialog/share-bundle-dialog.component.ts
@@ -3,6 +3,7 @@ import { CommonModule } from '@angular/common'
import { Component, Input, inject } from '@angular/core'
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
+import { Document } from 'src/app/data/document'
import {
SHARE_BUNDLE_FILE_VERSION_LABELS,
SHARE_BUNDLE_STATUS_LABELS,
@@ -14,6 +15,7 @@ import {
FileVersion,
SHARE_LINK_EXPIRATION_OPTIONS,
} from 'src/app/data/share-link'
+import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
import { FileSizePipe } from 'src/app/pipes/file-size.pipe'
import { ToastService } from 'src/app/services/toast.service'
import { environment } from 'src/environments/environment'
@@ -27,17 +29,19 @@ import { ConfirmDialogComponent } from '../confirm-dialog/confirm-dialog.compone
ReactiveFormsModule,
NgxBootstrapIconsModule,
FileSizePipe,
+ DocumentTitlePipe,
],
+ providers: [],
})
export class ShareBundleDialogComponent extends ConfirmDialogComponent {
private formBuilder = inject(FormBuilder)
private clipboard = inject(Clipboard)
private toastService = inject(ToastService)
- private _documentIds: number[] = []
+ private _documents: Document[] = []
selectionCount = 0
- documentPreview: number[] = []
+ documentPreview: Document[] = []
form: FormGroup = this.formBuilder.group({
shareArchiveVersion: [true],
expirationDays: [7],
@@ -59,20 +63,16 @@ export class ShareBundleDialogComponent extends ConfirmDialogComponent {
}
@Input()
- set documentIds(ids: number[]) {
- this._documentIds = ids ?? []
- this.selectionCount = this._documentIds.length
- this.documentPreview = this._documentIds.slice(0, 10)
- }
-
- get documentIds(): number[] {
- return this._documentIds
+ set documents(docs: Document[]) {
+ this._documents = docs.concat()
+ this.selectionCount = this._documents.length
+ this.documentPreview = this._documents.slice(0, 10)
}
submit() {
if (this.createdBundle) return
this.payload = {
- document_ids: this.documentIds,
+ document_ids: this._documents.map((doc) => doc.id),
file_version: this.form.value.shareArchiveVersion
? FileVersion.Archive
: FileVersion.Original,
diff --git a/src-ui/src/app/components/common/share-bundle-manage-dialog/share-bundle-manage-dialog.component.ts b/src-ui/src/app/components/common/share-bundle-manage-dialog/share-bundle-manage-dialog.component.ts
index e431ea280..a59b9144b 100644
--- a/src-ui/src/app/components/common/share-bundle-manage-dialog/share-bundle-manage-dialog.component.ts
+++ b/src-ui/src/app/components/common/share-bundle-manage-dialog/share-bundle-manage-dialog.component.ts
@@ -84,10 +84,6 @@ export class ShareBundleManageDialogComponent
super.ngOnDestroy()
}
- fetchBundles(): void {
- this.triggerRefresh(false)
- }
-
getShareUrl(bundle: ShareBundleSummary): string {
const apiURL = new URL(environment.apiBaseUrl)
return `${apiURL.origin}${apiURL.pathname.replace(/\/api\/$/, '/share/')}${
diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts
index 1e1a1369a..1e82d612e 100644
--- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts
+++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts
@@ -918,15 +918,15 @@ export class BulkEditorComponent
size: 'lg',
})
const dialog = modal.componentInstance as ShareBundleDialogComponent
- dialog.documentIds = Array.from(this.list.selected)
+ const selectedDocuments = this.list.documents.filter((d) =>
+ this.list.selected.has(d.id)
+ )
+ dialog.documents = selectedDocuments
dialog.confirmClicked
.pipe(takeUntil(this.unsubscribeNotifier))
.subscribe(() => {
const payload = dialog.payload
- if (!payload || !payload.document_ids.length) {
- this.toastService.showInfo(
- $localize`No documents selected for sharing.`
- )
+ if (!payload) {
return
}
dialog.loading = true