fix tour placement issues, basic offerTour method

This commit is contained in:
Michael Shamoon 2022-09-22 00:07:41 -07:00
parent 5e45b1f230
commit 0e03633ed0
6 changed files with 17 additions and 10 deletions

View File

@ -121,6 +121,7 @@ export class AppComponent implements OnInit, OnDestroy {
anchorId: 'tour.dashboard', anchorId: 'tour.dashboard',
content: $localize`The dashboard can be used to show saved views, such as an 'Inbox'. Those settings are found under Settings > Saved Views once you have created some.`, content: $localize`The dashboard can be used to show saved views, such as an 'Inbox'. Those settings are found under Settings > Saved Views once you have created some.`,
route: '/dashboard', route: '/dashboard',
placement: 'bottom',
}, },
{ {
anchorId: 'tour.upload-widget', anchorId: 'tour.upload-widget',
@ -130,20 +131,20 @@ export class AppComponent implements OnInit, OnDestroy {
{ {
anchorId: 'tour.documents', anchorId: 'tour.documents',
content: $localize`The documents list shows all of your documents and allows for filtering as well as bulk-editing. There are three different view styles: list, small cards and large cards. A list of documents currently opened for editing is shown in the sidebar.`, content: $localize`The documents list shows all of your documents and allows for filtering as well as bulk-editing. There are three different view styles: list, small cards and large cards. A list of documents currently opened for editing is shown in the sidebar.`,
route: '/documents', route: '/documents?sort=created&reverse=1&page=1',
delayAfterNavigation: 500, delayAfterNavigation: 500,
placement: 'bottom', placement: 'bottom',
}, },
{ {
anchorId: 'tour.documents-filter-editor', anchorId: 'tour.documents-filter-editor',
content: $localize`The filtering tools allow you to quickly find documents using various searches, dates, tags, etc.`, content: $localize`The filtering tools allow you to quickly find documents using various searches, dates, tags, etc.`,
route: '/documents', route: '/documents?sort=created&reverse=1&page=1',
placement: 'bottom', placement: 'bottom',
}, },
{ {
anchorId: 'tour.documents-views', anchorId: 'tour.documents-views',
content: $localize`Any combination of filters can be saved as a 'view' which can then be displayed on the dashboard and / or sidebar.`, content: $localize`Any combination of filters can be saved as a 'view' which can then be displayed on the dashboard and / or sidebar.`,
route: '/documents', route: '/documents?sort=created&reverse=1&page=1',
}, },
{ {
anchorId: 'tour.tags', anchorId: 'tour.tags',

View File

@ -19,7 +19,9 @@
</svg> </svg>
</app-page-header> </app-page-header>
<div class='row'> <div tourAnchor="tour.dashboard"></div>
<div class="row">
<div class="col-lg-8"> <div class="col-lg-8">
<ng-container *ngIf="savedViewService.loading"> <ng-container *ngIf="savedViewService.loading">
<div class="spinner-border spinner-border-sm me-2" role="status"></div> <div class="spinner-border spinner-border-sm me-2" role="status"></div>

View File

@ -1,4 +1,4 @@
<ngb-alert type="primary" [dismissible]="false" tourAnchor="tour.dashboard"> <ngb-alert type="primary" [dismissible]="false">
<!-- [dismissible]="isFinished(status)" (closed)="dismiss(status)" --> <!-- [dismissible]="isFinished(status)" (closed)="dismiss(status)" -->
<h4 class="alert-heading"><ng-container i18n>Paperless-ngx is running!</ng-container> 🎉</h4> <h4 class="alert-heading"><ng-container i18n>Paperless-ngx is running!</ng-container> 🎉</h4>
<p i18n>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.</p> <p i18n>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.</p>

View File

@ -98,6 +98,7 @@
</div> </div>
</ng-template> </ng-template>
<div tourAnchor="tour.documents"></div>
<ng-container *ngTemplateOutlet="pagination"></ng-container> <ng-container *ngTemplateOutlet="pagination"></ng-container>
<ng-container *ngIf="list.error ; else documentListNoError"> <ng-container *ngIf="list.error ; else documentListNoError">
@ -105,7 +106,6 @@
</ng-container> </ng-container>
<ng-template #documentListNoError> <ng-template #documentListNoError>
<div tourAnchor="tour.documents"></div>
<div *ngIf="displayMode == 'largeCards'"> <div *ngIf="displayMode == 'largeCards'">
<app-document-card-large [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" *ngFor="let d of list.documents; trackBy: trackByDocumentId" [document]="d" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)" (clickDocumentType)="clickDocumentType($event)" (clickStoragePath)="clickStoragePath($event)" (clickMoreLike)="clickMoreLike(d.id)"> <app-document-card-large [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" *ngFor="let d of list.documents; trackBy: trackByDocumentId" [document]="d" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)" (clickDocumentType)="clickDocumentType($event)" (clickStoragePath)="clickStoragePath($event)" (clickMoreLike)="clickMoreLike(d.id)">
</app-document-card-large> </app-document-card-large>

View File

@ -1,4 +1,4 @@
::ng-deep .popover { ::ng-deep app-document-list .popover {
max-width: 40rem; max-width: 40rem;
.preview { .preview {

View File

@ -23,6 +23,7 @@ import {
SETTINGS, SETTINGS,
SETTINGS_KEYS, SETTINGS_KEYS,
} from '../data/paperless-uisettings' } from '../data/paperless-uisettings'
import { SavedViewService } from './rest/saved-view.service'
import { ToastService } from './toast.service' import { ToastService } from './toast.service'
export interface LanguageOption { export interface LanguageOption {
@ -56,7 +57,8 @@ export class SettingsService {
private meta: Meta, private meta: Meta,
@Inject(LOCALE_ID) private localeId: string, @Inject(LOCALE_ID) private localeId: string,
protected http: HttpClient, protected http: HttpClient,
private toastService: ToastService private toastService: ToastService,
private savedViewService: SavedViewService
) { ) {
this.renderer = rendererFactory.createRenderer(null, null) this.renderer = rendererFactory.createRenderer(null, null)
} }
@ -448,7 +450,9 @@ export class SettingsService {
} }
offerTour(): boolean { offerTour(): boolean {
return true return (
// !savedViewService.loading && savedViewService.dashboardViews.length == 0 !this.savedViewService.loading &&
this.savedViewService.dashboardViews.length == 0
)
} }
} }