mark last opened file
This commit is contained in:
parent
4b73b4cc5d
commit
b44d9c9d0c
@ -88,6 +88,16 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
this.reviewerForm = this._formBuilder.group({
|
this.reviewerForm = this._formBuilder.group({
|
||||||
reviewer: [this.appStateService.activeFile.currentReviewer]
|
reviewer: [this.appStateService.activeFile.currentReviewer]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._loadFileData().subscribe(() => {
|
||||||
|
this._updateCanPerformActions();
|
||||||
|
});
|
||||||
|
|
||||||
|
document.documentElement.addEventListener('fullscreenchange', () => {
|
||||||
|
if (!document.fullscreenElement) {
|
||||||
|
this.fullScreen = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get annotations(): AnnotationWrapper[] {
|
get annotations(): AnnotationWrapper[] {
|
||||||
@ -178,23 +188,13 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
|
ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
|
||||||
this.displayPDFViewer = true;
|
this.ngOnInit();
|
||||||
this._lastPage = previousRoute.queryParams.page;
|
this._lastPage = previousRoute.queryParams.page;
|
||||||
this._subscribeToFileUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.displayPDFViewer = true;
|
this.displayPDFViewer = true;
|
||||||
|
this.userPreferenceService.lastOpenedFileId = this.fileId;
|
||||||
document.documentElement.addEventListener('fullscreenchange', () => {
|
|
||||||
if (!document.fullscreenElement) {
|
|
||||||
this.fullScreen = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this._loadFileData().subscribe(() => {
|
|
||||||
this._updateCanPerformActions();
|
|
||||||
});
|
|
||||||
|
|
||||||
this._subscribeToFileUpdates();
|
this._subscribeToFileUpdates();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -170,6 +170,7 @@
|
|||||||
*cdkVirtualFor="let fileStatus of displayedEntities | sortBy: sortingOption.order:sortingOption.column; trackBy: fileId"
|
*cdkVirtualFor="let fileStatus of displayedEntities | sortBy: sortingOption.order:sortingOption.column; trackBy: fileId"
|
||||||
[class.disabled]="fileStatus.isExcluded"
|
[class.disabled]="fileStatus.isExcluded"
|
||||||
[class.pointer]="permissionsService.canOpenFile(fileStatus)"
|
[class.pointer]="permissionsService.canOpenFile(fileStatus)"
|
||||||
|
[class.last-opened]="isLastOpenedFile(fileStatus)"
|
||||||
[routerLink]="fileLink(fileStatus)"
|
[routerLink]="fileLink(fileStatus)"
|
||||||
class="table-item"
|
class="table-item"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -122,3 +122,16 @@ cdk-virtual-scroll-viewport {
|
|||||||
.primary-attribute {
|
.primary-attribute {
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.last-opened {
|
||||||
|
> .selection-column {
|
||||||
|
padding-left: 6px !important;
|
||||||
|
border-left: 4px solid $red-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
> div {
|
||||||
|
background-color: rgba($red-1, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|||||||
import { BaseListingComponent } from '@shared/base/base-listing.component';
|
import { BaseListingComponent } from '@shared/base/base-listing.component';
|
||||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||||
import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy';
|
import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy';
|
||||||
|
import { UserPreferenceService } from '@services/user-preference.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-project-overview-screen',
|
selector: 'redaction-project-overview-screen',
|
||||||
@ -68,6 +69,7 @@ export class ProjectOverviewScreenComponent extends BaseListingComponent<FileSta
|
|||||||
private readonly _translateService: TranslateService,
|
private readonly _translateService: TranslateService,
|
||||||
private readonly _fileDropOverlayService: FileDropOverlayService,
|
private readonly _fileDropOverlayService: FileDropOverlayService,
|
||||||
private readonly _appStateService: AppStateService,
|
private readonly _appStateService: AppStateService,
|
||||||
|
private readonly _userPreferencesService: UserPreferenceService,
|
||||||
protected readonly _injector: Injector
|
protected readonly _injector: Injector
|
||||||
) {
|
) {
|
||||||
super(_injector);
|
super(_injector);
|
||||||
@ -78,6 +80,10 @@ export class ProjectOverviewScreenComponent extends BaseListingComponent<FileSta
|
|||||||
return this._appStateService.activeProject;
|
return this._appStateService.activeProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isLastOpenedFile(fileStatus: FileStatusWrapper): boolean {
|
||||||
|
return this._userPreferencesService.lastOpenedFileId === fileStatus.fileId;
|
||||||
|
}
|
||||||
|
|
||||||
protected get _filterComponents(): FilterComponent[] {
|
protected get _filterComponents(): FilterComponent[] {
|
||||||
return [this._statusFilterComponent, this._peopleFilterComponent, this._needsWorkFilterComponent];
|
return [this._statusFilterComponent, this._peopleFilterComponent, this._needsWorkFilterComponent];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,14 @@ export class UserPreferenceService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set lastOpenedFileId(value: string) {
|
||||||
|
sessionStorage.setItem('redaction.last-opened-file', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
get lastOpenedFileId(): string {
|
||||||
|
return sessionStorage.getItem('redaction.last-opened-file') || '';
|
||||||
|
}
|
||||||
|
|
||||||
toggleDevFeatures() {
|
toggleDevFeatures() {
|
||||||
sessionStorage.setItem('redaction.enable-dev-features', `${!this.areDevFeaturesEnabled}`);
|
sessionStorage.setItem('redaction.enable-dev-features', `${!this.areDevFeaturesEnabled}`);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user