]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Tweak: add saved views hint to dashboard 9362/head
authorshamoon <4887959+shamoon@users.noreply.github.com>
Tue, 11 Mar 2025 07:34:17 +0000 (00:34 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Tue, 11 Mar 2025 07:37:07 +0000 (00:37 -0700)
src-ui/messages.xlf
src-ui/src/app/components/dashboard/dashboard.component.html
src-ui/src/app/components/dashboard/dashboard.component.spec.ts
src-ui/src/app/components/dashboard/dashboard.component.ts

index 2f6a515bec7fc6adcb1f21e37755fcc920d485ff..67e8be0fca11f0438bb1a1042bb2b8c9d0dfdf50 100644 (file)
           <context context-type="linenumber">43</context>
         </context-group>
       </trans-unit>
+      <trans-unit id="4524189418954028091" datatype="html">
+        <source>Hint: saved views can be created from the <x id="START_LINK" ctype="x-a" equiv-text="&lt;a routerLink=&quot;/documents&quot;&gt;"/>documents list<x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/></source>
+        <context-group purpose="location">
+          <context context-type="sourcefile">src/app/components/dashboard/dashboard.component.html</context>
+          <context context-type="linenumber">42</context>
+        </context-group>
+      </trans-unit>
       <trans-unit id="6581372518205328477" datatype="html">
         <source>Hello <x id="PH" equiv-text="this.settingsService.displayName"/>, welcome to <x id="PH_1" equiv-text="environment.appTitle"/></source>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/components/dashboard/dashboard.component.ts</context>
-          <context context-type="linenumber">57</context>
+          <context context-type="linenumber">61</context>
         </context-group>
       </trans-unit>
       <trans-unit id="2901300640157872718" datatype="html">
         <source>Welcome to <x id="PH" equiv-text="environment.appTitle"/></source>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/components/dashboard/dashboard.component.ts</context>
-          <context context-type="linenumber">59</context>
+          <context context-type="linenumber">63</context>
         </context-group>
       </trans-unit>
       <trans-unit id="1325877348738783391" datatype="html">
         <source>Dashboard updated</source>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/components/dashboard/dashboard.component.ts</context>
-          <context context-type="linenumber">90</context>
+          <context context-type="linenumber">94</context>
         </context-group>
       </trans-unit>
       <trans-unit id="3214475953924351473" datatype="html">
         <source>Error updating dashboard</source>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/components/dashboard/dashboard.component.ts</context>
-          <context context-type="linenumber">93</context>
+          <context context-type="linenumber">97</context>
         </context-group>
       </trans-unit>
       <trans-unit id="2946624699882754313" datatype="html">
index 99c725802217b48a487d7bcd0d1702251ec51325..c42fc82ebd17b26b211ec54f78811883b1551cd6 100644 (file)
       }
 
       <ng-container *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.SavedView }">
+        @if (!settingsService.offerTour() && savedViewService.allViews.length === 0) {
+          <div class="col">
+            <div class="card shadow-sm bg-light opacity-50">
+              <div class="card-body">
+                <div class="text-center">
+                  <p class="mb-0 fst-italic"><i-bs name="info-circle" class="me-2"></i-bs><ng-container i18n>Hint: saved views can be created from the <a routerLink="/documents">documents list</a></ng-container></p>
+                </div>
+              </div>
+            </div>
+          </div>
+        }
         @for (v of dashboardViews; track v.id) {
           <div class="col">
             <pngx-saved-view-widget
index 2ff5eab789ab11e2af6acfc5b318c974d12e3402..31f4379e87aeb65bbc88395567424abcd68db7a3 100644 (file)
@@ -105,6 +105,7 @@ describe('DashboardComponent', () => {
                 results: saved_views,
               }),
             dashboardViews: saved_views.filter((v) => v.show_on_dashboard),
+            allViews: saved_views,
           },
         },
         provideHttpClient(withInterceptorsFromDi()),
index 94637ba0f9f3d80671f57ccc94785a8e8ce7104f..5a0f6c69d1bd38a8b15576a585b4eec33474f346 100644 (file)
@@ -6,6 +6,8 @@ import {
   moveItemInArray,
 } from '@angular/cdk/drag-drop'
 import { Component } from '@angular/core'
+import { RouterModule } from '@angular/router'
+import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
 import { TourNgBootstrapModule, TourService } from 'ngx-ui-tour-ng-bootstrap'
 import { SavedView } from 'src/app/data/saved-view'
 import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
@@ -35,6 +37,8 @@ import { WelcomeWidgetComponent } from './widgets/welcome-widget/welcome-widget.
     IfPermissionsDirective,
     DragDropModule,
     TourNgBootstrapModule,
+    NgxBootstrapIconsModule,
+    RouterModule,
   ],
 })
 export class DashboardComponent extends ComponentWithPermissions {