diff --git a/src-ui/src/app/components/dashboard/dashboard.component.ts b/src-ui/src/app/components/dashboard/dashboard.component.ts
index de3c5c969..2a7533808 100644
--- a/src-ui/src/app/components/dashboard/dashboard.component.ts
+++ b/src-ui/src/app/components/dashboard/dashboard.component.ts
@@ -2,6 +2,7 @@ import { Component } from '@angular/core'
import { SavedViewService } from 'src/app/services/rest/saved-view.service'
import { SettingsService } from 'src/app/services/settings.service'
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
+import { TourService } from 'ngx-ui-tour-ng-bootstrap'
@Component({
selector: 'app-dashboard',
@@ -11,7 +12,8 @@ import { ComponentWithPermissions } from '../with-permissions/with-permissions.c
export class DashboardComponent extends ComponentWithPermissions {
constructor(
public settingsService: SettingsService,
- public savedViewService: SavedViewService
+ public savedViewService: SavedViewService,
+ private tourService: TourService
) {
super()
}
@@ -23,4 +25,12 @@ export class DashboardComponent extends ComponentWithPermissions {
return $localize`Welcome to Paperless-ngx`
}
}
+
+ completeTour() {
+ if (this.tourService.getStatus() !== 0) {
+ this.tourService.end() // will call settingsService.completeTour()
+ } else {
+ this.settingsService.completeTour()
+ }
+ }
}
diff --git a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html
index f33e5621a..63532813f 100644
--- a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html
+++ b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html
@@ -1,5 +1,4 @@
-
-
+
Paperless-ngx is running! 🎉
You're ready to start uploading documents! Explore the various features of this web app on your own, or start a quick tour using the button below.
More detail on how to use and configure Paperless-ngx is always available in the documentation.
diff --git a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.ts
index 7a83780c3..d46a91e37 100644
--- a/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.ts
+++ b/src-ui/src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.ts
@@ -1,4 +1,4 @@
-import { Component } from '@angular/core'
+import { Component, EventEmitter, Output } from '@angular/core'
import { TourService } from 'ngx-ui-tour-ng-bootstrap'
@Component({
@@ -8,4 +8,7 @@ import { TourService } from 'ngx-ui-tour-ng-bootstrap'
})
export class WelcomeWidgetComponent {
constructor(public readonly tourService: TourService) {}
+
+ @Output()
+ dismiss: EventEmitter = new EventEmitter()
}
diff --git a/src-ui/src/app/data/paperless-uisettings.ts b/src-ui/src/app/data/paperless-uisettings.ts
index 4701a4300..c06aa405d 100644
--- a/src-ui/src/app/data/paperless-uisettings.ts
+++ b/src-ui/src/app/data/paperless-uisettings.ts
@@ -41,6 +41,7 @@ export const SETTINGS_KEYS = {
'general-settings:update-checking:backend-setting',
SAVED_VIEWS_WARN_ON_UNSAVED_CHANGE:
'general-settings:saved-views:warn-on-unsaved-change',
+ TOUR_COMPLETE: 'general-settings:tour-complete',
}
export const SETTINGS: PaperlessUiSetting[] = [
@@ -144,4 +145,9 @@ export const SETTINGS: PaperlessUiSetting[] = [
type: 'boolean',
default: true,
},
+ {
+ key: SETTINGS_KEYS.TOUR_COMPLETE,
+ type: 'boolean',
+ default: false,
+ },
]
diff --git a/src-ui/src/app/services/settings.service.ts b/src-ui/src/app/services/settings.service.ts
index 7b68a423a..207ccba56 100644
--- a/src-ui/src/app/services/settings.service.ts
+++ b/src-ui/src/app/services/settings.service.ts
@@ -484,7 +484,22 @@ export class SettingsService {
offerTour(): boolean {
return (
!this.savedViewService.loading &&
- this.savedViewService.dashboardViews.length == 0
+ this.savedViewService.dashboardViews.length == 0 &&
+ !this.get(SETTINGS_KEYS.TOUR_COMPLETE)
)
}
+
+ completeTour() {
+ const tourCompleted = this.get(SETTINGS_KEYS.TOUR_COMPLETE)
+ if (!tourCompleted) {
+ this.set(SETTINGS_KEYS.TOUR_COMPLETE, true)
+ this.storeSettings()
+ .pipe(first())
+ .subscribe(() => {
+ this.toastService.showInfo(
+ $localize`You can restart the tour from the settings page.`
+ )
+ })
+ }
+ }
}