]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Basic handling of non-AI response
authorshamoon <4887959+shamoon@users.noreply.github.com>
Wed, 23 Apr 2025 16:25:54 +0000 (09:25 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Wed, 2 Jul 2025 18:01:50 +0000 (11:01 -0700)
src-ui/src/app/components/common/suggestions-dropdown/suggestions-dropdown.component.html

index 7f0edca8f1d3df6908f21765cb5585ae760e6519..ac9d7c47e8fffd6c02707f9a7fdb35c797316a0e 100644 (file)
     </button>
 
     <div ngbDropdownMenu aria-labelledby="suggestionsDropdown" class="shadow suggestions-dropdown">
-        <div class="list-group list-group-flush small">
-          @if (suggestions?.suggested_tags.length > 0) {
-            <small class="list-group-item text-uppercase text-muted small">Tags</small>
-            @for (tag of suggestions.suggested_tags; track tag) {
-              <button type="button" class="list-group-item list-group-item-action bg-light" (click)="addTag.emit(tag)" i18n>{{ tag }}</button>
-            }
+      <div class="list-group list-group-flush small pb-0">
+        @if (!suggestions?.suggested_tags && !suggestions?.suggested_document_types && !suggestions?.suggested_correspondents) {
+          <div class="list-group-item text-muted fst-italic">
+            <small class="text-muted small fst-italic" i18n>No novel suggestions</small>
+          </div>
+        }
+        @if (suggestions?.suggested_tags?.length > 0) {
+          <small class="list-group-item text-uppercase text-muted small">Tags</small>
+          @for (tag of suggestions.suggested_tags; track tag) {
+            <button type="button" class="list-group-item list-group-item-action bg-light" (click)="addTag.emit(tag)" i18n>{{ tag }}</button>
           }
-          @if (suggestions?.suggested_document_types.length > 0) {
-            <div class="list-group-item text-uppercase text-muted small">Document Types</div>
-            @for (type of suggestions.suggested_document_types; track type) {
-              <button type="button" class="list-group-item list-group-item-action bg-light" (click)="addDocumentType.emit(type)" i18n>{{ type }}</button>
-            }
+        }
+        @if (suggestions?.suggested_document_types?.length > 0) {
+          <div class="list-group-item text-uppercase text-muted small">Document Types</div>
+          @for (type of suggestions.suggested_document_types; track type) {
+            <button type="button" class="list-group-item list-group-item-action bg-light" (click)="addDocumentType.emit(type)" i18n>{{ type }}</button>
           }
-          @if (suggestions?.suggested_correspondents.length > 0) {
-            <div class="list-group-item text-uppercase text-muted small">Correspondents</div>
-            @for (correspondent of suggestions.suggested_correspondents; track correspondent) {
-              <button type="button" class="list-group-item list-group-item-action bg-light" (click)="addCorrespondent.emit(correspondent)" i18n>{{ correspondent }}</button>
-            }
+        }
+        @if (suggestions?.suggested_correspondents?.length > 0) {
+          <div class="list-group-item text-uppercase text-muted small">Correspondents</div>
+          @for (correspondent of suggestions.suggested_correspondents; track correspondent) {
+            <button type="button" class="list-group-item list-group-item-action bg-light" (click)="addCorrespondent.emit(correspondent)" i18n>{{ correspondent }}</button>
           }
-        </div>
+        }
+      </div>
     </div>
   </div>
 </div>