resolve conflicts

This commit is contained in:
Dan Percic 2021-04-20 10:28:06 +03:00
parent 8221c7cfbd
commit 0913e12cfa
3 changed files with 12 additions and 24 deletions

View File

@ -1,5 +1,5 @@
import { ChangeDetectorRef, Component, HostListener, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { AppStateService } from '../../../../state/app-state.service';
import { WebViewerInstance } from '@pdftron/webviewer';
import { PdfViewerComponent } from '../../components/pdf-viewer/pdf-viewer.component';

View File

@ -1,5 +1,5 @@
import { Component, Injector, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { FileManagementControllerService, Project, RuleSetModel } from '@redaction/red-ui-http';
import { Project, RuleSetModel } from '@redaction/red-ui-http';
import { AppStateService } from '../../../../state/app-state.service';
import { UserService } from '../../../../services/user.service';
import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
@ -38,8 +38,6 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
public projectsChartData: DoughnutChartConfig[] = [];
public documentsChartData: DoughnutChartConfig[] = [];
public actionMenuOpen: boolean;
public statusFilters: FilterModel[];
public peopleFilters: FilterModel[];
public needsWorkFilters: FilterModel[];
@ -51,7 +49,7 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
statusFilters: []
};
private projectAutoUpdateTimer: Subscription;
private _projectAutoUpdateTimer: Subscription;
private _lastScrollPosition: number;
@ViewChild(CdkVirtualScrollViewport) private _scrollBar: CdkVirtualScrollViewport;
@ -62,15 +60,13 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
@ViewChild('ruleSetFilter') private _ruleSetFilterComponent: FilterComponent;
constructor(
private readonly _appStateService: AppStateService,
public readonly userService: UserService,
public readonly sortingService: SortingService,
public readonly translateChartService: TranslateChartService,
public readonly permissionsService: PermissionsService,
private readonly _dialogService: ProjectsDialogService,
private readonly _translateService: TranslateService,
private readonly _router: Router,
public readonly translateChartService: TranslateChartService,
private readonly _appStateService: AppStateService,
protected readonly _injector: Injector
) {
super(_injector);
@ -79,7 +75,7 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
}
public ngOnInit(): void {
this.projectAutoUpdateTimer = timer(0, 10000)
this._projectAutoUpdateTimer = timer(0, 10000)
.pipe(
tap(async () => {
await this._appStateService.loadAllProjects();
@ -103,7 +99,7 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
}
ngOnDestroy(): void {
this.projectAutoUpdateTimer.unsubscribe();
this._projectAutoUpdateTimer.unsubscribe();
}
private _loadEntitiesFromState() {

View File

@ -1,5 +1,5 @@
import { Component, HostListener, Injector, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from '@angular/router';
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { NotificationService, NotificationType } from '../../../../services/notification.service';
import { AppStateService } from '../../../../state/app-state.service';
import { FileDropOverlayService } from '../../../upload-download/services/file-drop-overlay.service';
@ -7,7 +7,6 @@ import { FileUploadModel } from '../../../upload-download/model/file-upload.mode
import { FileUploadService } from '../../../upload-download/services/file-upload.service';
import { StatusOverlayService } from '../../../upload-download/services/status-overlay.service';
import { TranslateService } from '@ngx-translate/core';
import { FileActionService } from '../../services/file-action.service';
import { FilterModel } from '../../../shared/components/filter/model/filter.model';
import * as moment from 'moment';
import { ProjectDetailsComponent } from '../../components/project-details/project-details.component';
@ -61,27 +60,20 @@ export class ProjectOverviewScreenComponent extends BaseListingComponent<FileSta
@ViewChild('needsWorkFilter') private _needsWorkFilterComponent: FilterComponent;
constructor(
private readonly _appStateService: AppStateService,
public readonly userService: UserService,
public readonly permissionsService: PermissionsService,
private readonly _sortingService: SortingService,
private readonly _activatedRoute: ActivatedRoute,
private readonly _notificationService: NotificationService,
private readonly _dialogService: ProjectsDialogService,
private readonly _fileActionService: FileActionService,
private readonly _fileUploadService: FileUploadService,
private readonly _statusOverlayService: StatusOverlayService,
private readonly _router: Router,
private readonly _translateService: TranslateService,
private readonly _fileDropOverlayService: FileDropOverlayService,
private readonly _appStateService: AppStateService,
protected readonly _injector: Injector
) {
super(_injector);
this._activatedRoute.params.subscribe((params) => {
this._appStateService.activateProject(params.projectId);
this._loadEntitiesFromState();
});
this._loadEntitiesFromState();
this._appStateService.fileChanged.subscribe(() => {
this.calculateData();
@ -101,11 +93,11 @@ export class ProjectOverviewScreenComponent extends BaseListingComponent<FileSta
this.calculateData();
this._router.events.pipe(filter((events) => events instanceof NavigationStart || events instanceof NavigationEnd)).subscribe((event) => {
if (event instanceof NavigationStart && !event.url.endsWith(this.appStateService.activeProjectId)) {
if (event instanceof NavigationStart && !event.url.endsWith(this._appStateService.activeProjectId)) {
this._lastScrollPosition = this._scrollBar.getOffsetToRenderedContentStart() + this._scrollBar.getRenderedRange().end;
}
if (event instanceof NavigationEnd && event.url.endsWith(this.appStateService.activeProjectId)) {
if (event instanceof NavigationEnd && event.url.endsWith(this._appStateService.activeProjectId)) {
this._scrollBar.scrollTo({ top: this._lastScrollPosition });
}
});
@ -157,7 +149,7 @@ export class ProjectOverviewScreenComponent extends BaseListingComponent<FileSta
}
private _loadEntitiesFromState() {
this.allEntities = this._appStateService.activeProject.files;
if (this.activeProject) this.allEntities = this.activeProject.files;
}
reloadProjects() {