diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 422eb69aa..1a5d4402c 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -410,7 +410,7 @@ Initiating upload... src/app/app.component.ts - 288 + 289 @@ -719,7 +719,7 @@ An error occurred while saving settings. src/app/components/app-frame/app-frame.component.ts - 89 + 104 src/app/components/manage/settings/settings.component.ts @@ -730,7 +730,7 @@ An error occurred while saving update checking settings. src/app/components/app-frame/app-frame.component.ts - 222 + 237 @@ -1243,7 +1243,7 @@ src/app/components/dashboard/dashboard.component.html - 26 + 27 src/app/components/dashboard/widgets/widget-frame/widget-frame.component.html @@ -1890,21 +1890,21 @@ Apply src/app/components/common/filterable-dropdown/filterable-dropdown.component.html - 40 + 42 Click again to exclude items. src/app/components/common/filterable-dropdown/filterable-dropdown.component.html - 46 + 48 Not assigned src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts - 335 + 336 Filter drop down element to filter for documents with no correspondent/type/tag assigned @@ -2167,14 +2167,14 @@ Hello , welcome to Paperless-ngx src/app/components/dashboard/dashboard.component.ts - 36 + 23 Welcome to Paperless-ngx src/app/components/dashboard/dashboard.component.ts - 38 + 25 @@ -2357,35 +2357,35 @@ Paperless-ngx is running! src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html - 3 + 2 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. src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html - 4 + 3 More detail on how to use and configure Paperless-ngx is always available in the documentation. src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html - 5 + 4 Thanks for being a part of the Paperless-ngx community! src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html - 8 + 7 Start the tour src/app/components/dashboard/widgets/welcome-widget/welcome-widget.component.html - 9 + 8 @@ -2717,43 +2717,43 @@ Error retrieving metadata src/app/components/document-detail/document-detail.component.ts - 354 + 369 Error retrieving suggestions src/app/components/document-detail/document-detail.component.ts - 374 + 389 Document saved successfully. src/app/components/document-detail/document-detail.component.ts - 484 + 499 src/app/components/document-detail/document-detail.component.ts - 492 + 507 Error saving document src/app/components/document-detail/document-detail.component.ts - 497 + 512 src/app/components/document-detail/document-detail.component.ts - 542 + 557 Confirm delete src/app/components/document-detail/document-detail.component.ts - 571 + 586 src/app/components/manage/management-list/management-list.component.ts @@ -2764,35 +2764,35 @@ Do you really want to delete document ""? src/app/components/document-detail/document-detail.component.ts - 572 + 587 The files for this document will be deleted permanently. This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 573 + 588 Delete document src/app/components/document-detail/document-detail.component.ts - 575 + 590 Error deleting document: src/app/components/document-detail/document-detail.component.ts - 595,597 + 610,612 Redo OCR confirm src/app/components/document-detail/document-detail.component.ts - 618 + 633 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2803,14 +2803,14 @@ This operation will permanently redo OCR for this document. src/app/components/document-detail/document-detail.component.ts - 619 + 634 This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 620 + 635 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2841,7 +2841,7 @@ Proceed src/app/components/document-detail/document-detail.component.ts - 622 + 637 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2868,7 +2868,7 @@ Redo OCR operation will begin in the background. Close and re-open or reload this document after the operation has completed to see new content. src/app/components/document-detail/document-detail.component.ts - 630 + 645 @@ -2877,7 +2877,7 @@ )"/> src/app/components/document-detail/document-detail.component.ts - 641,643 + 656,658 @@ -5272,6 +5272,13 @@ 426 + + You can restart the tour from the settings page. + + src/app/services/settings.service.ts + 500 + + Information diff --git a/src-ui/src/app/app.component.ts b/src-ui/src/app/app.component.ts index e22098496..9d9f2c99c 100644 --- a/src-ui/src/app/app.component.ts +++ b/src-ui/src/app/app.component.ts @@ -2,7 +2,7 @@ import { SettingsService } from './services/settings.service' import { SETTINGS_KEYS } from './data/paperless-uisettings' import { Component, OnDestroy, OnInit, Renderer2 } from '@angular/core' import { Router } from '@angular/router' -import { Subscription } from 'rxjs' +import { Subscription, first } from 'rxjs' import { ConsumerStatusService } from './services/consumer-status.service' import { ToastService } from './services/toast.service' import { NgxFileDropEntry } from 'ngx-file-drop' @@ -240,13 +240,14 @@ export class AppComponent implements OnInit, OnDestroy { this.tourService.start$.subscribe(() => { this.renderer.addClass(document.body, 'tour-active') - }) - this.tourService.end$.subscribe(() => { - // animation time - setTimeout(() => { - this.renderer.removeClass(document.body, 'tour-active') - }, 500) + this.tourService.end$.pipe(first()).subscribe(() => { + this.settings.completeTour() + // animation time + setTimeout(() => { + this.renderer.removeClass(document.body, 'tour-active') + }, 500) + }) }) } diff --git a/src-ui/src/app/components/dashboard/dashboard.component.html b/src-ui/src/app/components/dashboard/dashboard.component.html index 5ddcada9d..f2dcf855e 100644 --- a/src-ui/src/app/components/dashboard/dashboard.component.html +++ b/src-ui/src/app/components/dashboard/dashboard.component.html @@ -21,22 +21,20 @@
- -
- Loading... -
- - - -
- - - - - +
+ +
+ Loading...
-
+ + +
+ + + +
+
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.` + ) + }) + } + } }