RED-3800: fix license typo, fix circular imports, add ids for tests
This commit is contained in:
parent
553e2d5e85
commit
1b24b15caf
@ -9,10 +9,11 @@ import { DownloadsListScreenComponent } from '@components/downloads-list-screen/
|
||||
import { DossiersGuard } from '@guards/dossiers.guard';
|
||||
import { ACTIVE_DOSSIERS_SERVICE, ARCHIVED_DOSSIERS_SERVICE } from './tokens';
|
||||
import { FeaturesGuard } from '@guards/features-guard.service';
|
||||
import { ARCHIVE_ROUTE, DOSSIER_TEMPLATE_ID, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
import { DossierTemplateExistsGuard } from '@guards/dossier-template-exists.guard';
|
||||
import { DashboardGuard } from '@guards/dashboard-guard.service';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@red/domain';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
|
||||
@ -10,7 +10,7 @@ import { filter, map, startWith } from 'rxjs/operators';
|
||||
import { shareDistinctLast } from '@iqser/common-ui';
|
||||
import { BreadcrumbsService } from '@services/breadcrumbs.service';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@utils/constants';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@red/domain';
|
||||
|
||||
interface MenuItem {
|
||||
readonly id: string;
|
||||
|
||||
@ -3,8 +3,9 @@ import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DOSSIER_ID, DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { DOSSIER_ID } from '@red/domain';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DossierFilesGuard implements CanActivate {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { DoughnutChartConfig } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-users-stats',
|
||||
|
||||
@ -7,11 +7,10 @@ import {
|
||||
SortingOrders,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { DossierState, IDossierState } from '@red/domain';
|
||||
import { DossierState, DoughnutChartConfig, IDossierState } from '@red/domain';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DossierStatesMapService } from '@services/entity-services/dossier-states-map.service';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<div *ngIf="userPreferenceService.areDevFeaturesEnabled" class="row">
|
||||
<div class="flex align-center" translate="license-info-screen.license-title"></div>
|
||||
<div>
|
||||
<redaction-license-select (valueChanges)="licenceChanged($event)"></redaction-license-select>
|
||||
<redaction-license-select (valueChanges)="licenseChanged($event)"></redaction-license-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -45,10 +45,10 @@ export class LicenseScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
return this.loadLicenceData(this.licenseService.selectedLicense);
|
||||
return this.loadLicenseData(this.licenseService.selectedLicense);
|
||||
}
|
||||
|
||||
async loadLicenceData(license: ILicense) {
|
||||
async loadLicenseData(license: ILicense) {
|
||||
const startDate = dayjs(license.validFrom);
|
||||
const endDate = dayjs(license.validUntil);
|
||||
|
||||
@ -88,8 +88,8 @@ export class LicenseScreenComponent implements OnInit {
|
||||
window.location.href = `mailto:${mail}?subject=${subject}&body=${body}`;
|
||||
}
|
||||
|
||||
licenceChanged(license: ILicense) {
|
||||
licenseChanged(license: ILicense) {
|
||||
this.totalLicensedNumberOfPages = this.licenseService.totalLicensedNumberOfPages;
|
||||
return this.loadLicenceData(license);
|
||||
return this.loadLicenseData(license);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import { getStoredReports } from '../utils/functions';
|
||||
@Injectable()
|
||||
export class LicenseService extends GenericService<ILicenseReport> {
|
||||
storedReports = getStoredReports();
|
||||
readonly licenseData = this.#licenceData;
|
||||
readonly licenseData = this.#licenseData;
|
||||
readonly activeLicenseId = this.licenseData.activeLicense;
|
||||
readonly selectedLicense$ = new BehaviorSubject<ILicense>(this.getActiveLicense());
|
||||
|
||||
@ -27,7 +27,7 @@ export class LicenseService extends GenericService<ILicenseReport> {
|
||||
return Number(processingPagesFeature.value ?? '0');
|
||||
}
|
||||
|
||||
get #licenceData(): ILicenses {
|
||||
get #licenseData(): ILicenses {
|
||||
return {
|
||||
...LICENSE_DATA,
|
||||
licenses: [
|
||||
|
||||
@ -2,7 +2,7 @@ import { Component, forwardRef, Injector, OnInit } from '@angular/core';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { DoughnutChartConfig, User, UserTypes } from '@red/domain';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
import {
|
||||
CircleButtonTypes,
|
||||
@ -18,7 +18,6 @@ import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { rolesTranslations } from '../../../../translations/roles-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { User, UserTypes } from '@red/domain';
|
||||
import { userTypeChecker, userTypeFilters } from '../../../../utils';
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { BreadcrumbTypes } from '@red/domain';
|
||||
import { BreadcrumbTypes, DOSSIER_ID } from '@red/domain';
|
||||
import { ArchivedDossiersScreenComponent } from './screens/archived-dossiers-screen/archived-dossiers-screen.component';
|
||||
import { DOSSIER_ID, FILE_ID } from '@utils/constants';
|
||||
import { FILE_ID } from '@utils/constants';
|
||||
import { CompositeRouteGuard } from '@iqser/common-ui';
|
||||
import { ARCHIVED_DOSSIERS_SERVICE } from '../../tokens';
|
||||
import { DossierFilesGuard } from '@guards/dossier-files-guard';
|
||||
|
||||
@ -1,18 +1,23 @@
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import {
|
||||
Dossier,
|
||||
DOSSIER_ID,
|
||||
DossierAttributeWithValue,
|
||||
DossierStats,
|
||||
DoughnutChartConfig,
|
||||
IDossierRequest,
|
||||
StatusSorter,
|
||||
User,
|
||||
} from '@red/domain';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { FilterService, ProgressBarConfigModel, shareLast, Toaster } from '@iqser/common-ui';
|
||||
import { workflowFileStatusTranslations } from '../../../../translations/file-status-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { Dossier, DossierAttributeWithValue, DossierStats, IDossierRequest, StatusSorter, User } from '@red/domain';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { DossierStatsService } from '@services/dossiers/dossier-stats.service';
|
||||
import { map, pluck, switchMap } from 'rxjs/operators';
|
||||
import { DossiersDialogService } from '../../../dossier/shared/services/dossiers-dialog.service';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
import { DOSSIER_ID } from '@utils/constants';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
|
||||
@Component({
|
||||
@ -40,19 +45,16 @@ export class DossierDetailsComponent {
|
||||
readonly translateChartService: TranslateChartService,
|
||||
readonly filterService: FilterService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _filesService: FilesService,
|
||||
private readonly _dossierStatsService: DossierStatsService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _activatedRoute: ActivatedRoute,
|
||||
activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.dossierId = _activatedRoute.snapshot.paramMap.get(DOSSIER_ID);
|
||||
this.dossier$ = this._dossiersService.getEntityChanged$(this.dossierId).pipe(shareLast());
|
||||
this.dossierId = activatedRoute.snapshot.paramMap.get(DOSSIER_ID);
|
||||
this.dossier$ = _dossiersService.getEntityChanged$(this.dossierId).pipe(shareLast());
|
||||
this.dossierStats$ = this.dossier$.pipe(
|
||||
pluck('dossierId'),
|
||||
switchMap(dossierId => this._dossierStatsService.watch$(dossierId)),
|
||||
switchMap(dossierId => _dossierStatsService.watch$(dossierId)),
|
||||
);
|
||||
this.chartConfig$ = this.dossierStats$.pipe(map(stats => this.#calculateChartConfig(stats)));
|
||||
this.statusConfig$ = this.dossierStats$.pipe(map(stats => this.#calculateStatusConfig(stats)));
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
[type]="circleButtonTypes.primary"
|
||||
class="ml-14"
|
||||
icon="iqser:upload"
|
||||
id="upload-document-btn"
|
||||
iqserHelpMode="edit_dossier_in_dossier"
|
||||
tooltipPosition="below"
|
||||
></iqser-circle-button>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, forwardRef, HostListener, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { Dossier, DossierAttributeWithValue, File, IFileAttributeConfig, WorkflowFileStatus } from '@red/domain';
|
||||
import { Dossier, DOSSIER_ID, DossierAttributeWithValue, File, IFileAttributeConfig, WorkflowFileStatus } from '@red/domain';
|
||||
import { FileDropOverlayService } from '@upload-download/services/file-drop-overlay.service';
|
||||
import { FileUploadModel } from '@upload-download/model/file-upload.model';
|
||||
import { FileUploadService } from '@upload-download/services/file-upload.service';
|
||||
@ -32,7 +32,6 @@ import { DossierTemplatesService } from '@services/dossier-templates/dossier-tem
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
import { DOSSIER_ID } from '@utils/constants';
|
||||
import { BulkActionsService } from '../services/bulk-actions.service';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { dossiersServiceProvider } from '@services/entity-services/dossiers.service.provider';
|
||||
@ -76,27 +75,27 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
private _fileAttributeConfigs: IFileAttributeConfig[];
|
||||
|
||||
constructor(
|
||||
protected readonly _injector: Injector,
|
||||
route: ActivatedRoute,
|
||||
private readonly _router: Router,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _fileUploadService: FileUploadService,
|
||||
private readonly _logger: NGXLogger,
|
||||
readonly configService: ConfigService,
|
||||
protected readonly _injector: Injector,
|
||||
private readonly _errorService: ErrorService,
|
||||
private readonly _filesService: FilesService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _fileMapService: FilesMapService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _fileUploadService: FileUploadService,
|
||||
private readonly _statusOverlayService: StatusOverlayService,
|
||||
private readonly _fileDropOverlayService: FileDropOverlayService,
|
||||
private readonly _dossierAttributesService: DossierAttributesService,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _fileMapService: FilesMapService,
|
||||
private readonly _errorService: ErrorService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _logger: NGXLogger,
|
||||
readonly permissionsService: PermissionsService,
|
||||
readonly configService: ConfigService,
|
||||
private readonly _fileDropOverlayService: FileDropOverlayService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dossierAttributesService: DossierAttributesService,
|
||||
) {
|
||||
super(_injector);
|
||||
this.dossierId = _route.snapshot.paramMap.get(DOSSIER_ID);
|
||||
this.dossierId = route.snapshot.paramMap.get(DOSSIER_ID);
|
||||
this.dossier$ = _dossiersService.getEntityChanged$(this.dossierId).pipe(tap(dossier => (this.#currentDossier = dossier)));
|
||||
this.#currentDossier = _dossiersService.find(this.dossierId);
|
||||
this.workflowConfig = configService.workflowConfig(this.#currentDossier);
|
||||
|
||||
@ -2,8 +2,8 @@ import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { DossierFilesGuard } from '@guards/dossier-files-guard';
|
||||
import { CompositeRouteGuard } from '@iqser/common-ui';
|
||||
import { BreadcrumbTypes } from '@red/domain';
|
||||
import { DOSSIER_ID, FILE_ID } from '@utils/constants';
|
||||
import { BreadcrumbTypes, DOSSIER_ID } from '@red/domain';
|
||||
import { FILE_ID } from '@utils/constants';
|
||||
import { ACTIVE_DOSSIERS_SERVICE } from '../../tokens';
|
||||
|
||||
const routes: Routes = [
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { DashboardStats, DoughnutChartConfig } from '@red/domain';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { map, pluck } from 'rxjs/operators';
|
||||
import { DashboardStatsService } from '@services/dossier-templates/dashboard-stats.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DashboardStats } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossiers-listing-details',
|
||||
@ -20,15 +19,20 @@ export class DossiersListingDetailsComponent {
|
||||
readonly dossiersChartData$: Observable<DoughnutChartConfig[]>;
|
||||
|
||||
constructor(
|
||||
private readonly _dashboardStatsService: DashboardStatsService,
|
||||
route: ActivatedRoute,
|
||||
dashboardStatsService: DashboardStatsService,
|
||||
private readonly _translateChartService: TranslateChartService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
) {
|
||||
const dossierTemplateId: string = this._route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.stats$ = this._dashboardStatsService.getEntityChanged$(dossierTemplateId);
|
||||
const dossierTemplateId: string = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.stats$ = dashboardStatsService.getEntityChanged$(dossierTemplateId);
|
||||
|
||||
this.dossiersChartData$ = this.stats$.pipe(
|
||||
map(s => this._translateChartService.translateDossierStates(s.dossiersChartData, dossierTemplateId)),
|
||||
pluck('dossiersChartData'),
|
||||
map(data => this._translateChartService.translateDossierStates(data, dossierTemplateId)),
|
||||
);
|
||||
this.documentsChartData$ = this.stats$.pipe(
|
||||
pluck('documentsChartData'),
|
||||
map(data => this._translateChartService.translateWorkflowStatus(data)),
|
||||
);
|
||||
this.documentsChartData$ = this.stats$.pipe(map(s => this._translateChartService.translateWorkflowStatus(s.documentsChartData)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,10 +2,9 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } f
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { MultiSelectService } from '../../services/multi-select.service';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { DOSSIER_ID } from '@utils/constants';
|
||||
import { Dictionary, DOSSIER_ID } from '@red/domain';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { Dictionary } from '@red/domain';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@ -21,13 +20,13 @@ export class AnnotationCardComponent implements OnChanges {
|
||||
readonly #dossierTemplateId: string;
|
||||
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
dossiersService: DossiersService,
|
||||
readonly multiSelectService: MultiSelectService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _dictionariesMapService: DictionariesMapService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
) {
|
||||
const dossierId: string = _route.snapshot.paramMap.get(DOSSIER_ID);
|
||||
this.#dossierTemplateId = this._dossiersService.find(dossierId).dossierTemplateId;
|
||||
const dossierId: string = route.snapshot.paramMap.get(DOSSIER_ID);
|
||||
this.#dossierTemplateId = dossiersService.find(dossierId).dossierTemplateId;
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
@ -136,6 +136,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
return this._pageRotationService.hasRotations();
|
||||
}
|
||||
|
||||
get scrollableParentView(): ScrollableParentView {
|
||||
return ScrollableParentViews.ANNOTATIONS_LIST;
|
||||
}
|
||||
|
||||
private get _canPerformAnnotationActions$() {
|
||||
const viewMode$ = this._viewModeService.viewMode$.pipe(tap(() => this.#deactivateMultiSelect()));
|
||||
|
||||
@ -209,12 +213,11 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
this._changeDetectorRef.markForCheck();
|
||||
}
|
||||
|
||||
async ngOnAttach(previousRoute: ActivatedRouteSnapshot): Promise<boolean> {
|
||||
const file = this.state.file;
|
||||
if (!file.canBeOpened) {
|
||||
this._navigateToDossier();
|
||||
return;
|
||||
async ngOnAttach(previousRoute: ActivatedRouteSnapshot): Promise<void> {
|
||||
if (!this.state.file.canBeOpened) {
|
||||
return this._navigateToDossier();
|
||||
}
|
||||
|
||||
this._viewModeService.compareMode = false;
|
||||
this._viewModeService.switchToStandard();
|
||||
|
||||
@ -228,20 +231,20 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
const file = this.state.file;
|
||||
|
||||
if (!file) {
|
||||
this._handleDeletedFile();
|
||||
} else {
|
||||
this.ready = false;
|
||||
this._loadingService.start();
|
||||
await this.userPreferenceService.saveLastOpenedFileForDossier(this.dossierId, this.fileId);
|
||||
this._subscribeToFileUpdates();
|
||||
|
||||
if (file?.analysisRequired && !file.excludedFromAutomaticAnalysis) {
|
||||
const reanalyzeFiles = this._reanalysisService.reanalyzeFilesForDossier([file], this.dossierId, { force: true });
|
||||
await firstValueFrom(reanalyzeFiles);
|
||||
}
|
||||
|
||||
this.displayPdfViewer = true;
|
||||
return this._handleDeletedFile();
|
||||
}
|
||||
|
||||
this.ready = false;
|
||||
this._loadingService.start();
|
||||
await this.userPreferenceService.saveLastOpenedFileForDossier(this.dossierId, this.fileId);
|
||||
this._subscribeToFileUpdates();
|
||||
|
||||
if (file?.analysisRequired && !file.excludedFromAutomaticAnalysis) {
|
||||
const reanalyzeFiles = this._reanalysisService.reanalyzeFilesForDossier([file], this.dossierId, { force: true });
|
||||
await firstValueFrom(reanalyzeFiles);
|
||||
}
|
||||
|
||||
this.displayPdfViewer = true;
|
||||
}
|
||||
|
||||
handleAnnotationSelected(annotationIds: string[]) {
|
||||
@ -436,6 +439,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
return this._cleanupAndRedrawAnnotations(annotationsToDraw);
|
||||
}
|
||||
|
||||
getActionsHelpModeKey(annotation: AnnotationWrapper): string {
|
||||
const type = annotation?.typeLabel?.split('.')[1];
|
||||
const typeValue = annotation?.typeValue;
|
||||
if (type === 'hint' && (typeValue === 'ocr' || typeValue === 'formula' || typeValue === 'image')) {
|
||||
return HelpModeKeys[`${type}-${typeValue}`];
|
||||
}
|
||||
return HelpModeKeys[type];
|
||||
}
|
||||
|
||||
#rebuildFilters() {
|
||||
const startTime = new Date().getTime();
|
||||
|
||||
@ -499,19 +511,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
this.handleAnnotationSelected([]);
|
||||
}
|
||||
|
||||
get scrollableParentView(): ScrollableParentView {
|
||||
return ScrollableParentViews.ANNOTATIONS_LIST;
|
||||
}
|
||||
|
||||
getActionsHelpModeKey(annotation: AnnotationWrapper): string {
|
||||
const type = annotation?.typeLabel?.split('.')[1];
|
||||
const typeValue = annotation?.typeValue;
|
||||
if (type === 'hint' && (typeValue === 'ocr' || typeValue === 'formula' || typeValue === 'image')) {
|
||||
return HelpModeKeys[`${type}-${typeValue}`];
|
||||
}
|
||||
return HelpModeKeys[type];
|
||||
}
|
||||
|
||||
private _setExcludedPageStyles() {
|
||||
const file = this._filesMapService.get(this.dossierId, this.fileId);
|
||||
setTimeout(() => {
|
||||
@ -556,21 +555,23 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
}
|
||||
|
||||
private _handleDeletedDossier(): void {
|
||||
this._errorService.set(
|
||||
new CustomError(_('error.deleted-entity.file-dossier.label'), _('error.deleted-entity.file-dossier.action'), 'iqser:expand'),
|
||||
const error = new CustomError(
|
||||
_('error.deleted-entity.file-dossier.label'),
|
||||
_('error.deleted-entity.file-dossier.action'),
|
||||
'iqser:expand',
|
||||
);
|
||||
this._errorService.set(error);
|
||||
}
|
||||
|
||||
private _handleDeletedFile(): void {
|
||||
this._errorService.set(
|
||||
new CustomError(
|
||||
_('error.deleted-entity.file.label'),
|
||||
_('error.deleted-entity.file.action'),
|
||||
'iqser:expand',
|
||||
null,
|
||||
this._navigateToDossier.bind(this),
|
||||
),
|
||||
const error = new CustomError(
|
||||
_('error.deleted-entity.file.label'),
|
||||
_('error.deleted-entity.file.action'),
|
||||
'iqser:expand',
|
||||
null,
|
||||
this._navigateToDossier.bind(this),
|
||||
);
|
||||
this._errorService.set(error);
|
||||
}
|
||||
|
||||
@Debounce(0)
|
||||
|
||||
@ -36,8 +36,8 @@ export class AnnotationDrawService {
|
||||
) {}
|
||||
|
||||
drawAnnotations(annotationWrappers: readonly AnnotationWrapper[]) {
|
||||
const licenceKey = environment.licenseKey ? atob(environment.licenseKey) : null;
|
||||
return this._pdf.PDFNet.runWithCleanup(() => this._drawAnnotations(annotationWrappers), licenceKey);
|
||||
const licenseKey = environment.licenseKey ? atob(environment.licenseKey) : null;
|
||||
return this._pdf.PDFNet.runWithCleanup(() => this._drawAnnotations(annotationWrappers), licenseKey);
|
||||
}
|
||||
|
||||
getColor(superType: string, dictionary?: string) {
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { combineLatest, firstValueFrom, from, merge, Observable, of, pairwise, Subject, switchMap } from 'rxjs';
|
||||
import { Dossier, File } from '@red/domain';
|
||||
import { Dossier, DOSSIER_ID, File } from '@red/domain';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { boolFactory } from '@iqser/common-ui';
|
||||
import { filter, map, startWith, tap, withLatestFrom } from 'rxjs/operators';
|
||||
import { FileManagementService } from '@services/entity-services/file-management.service';
|
||||
import { DOSSIER_ID, FILE_ID } from '@utils/constants';
|
||||
import { FILE_ID } from '@utils/constants';
|
||||
import { dossiersServiceResolver } from '@services/entity-services/dossiers.service.provider';
|
||||
import { wipeFilesCache } from '@red/cache';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
@ -32,6 +32,7 @@ export class FilePreviewStateService {
|
||||
readonly #reloadBlob$ = new Subject();
|
||||
|
||||
constructor(
|
||||
router: Router,
|
||||
route: ActivatedRoute,
|
||||
filesMapService: FilesMapService,
|
||||
private readonly _injector: Injector,
|
||||
@ -39,9 +40,8 @@ export class FilePreviewStateService {
|
||||
private readonly _filesService: FilesService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _fileManagementService: FileManagementService,
|
||||
private readonly _router: Router,
|
||||
) {
|
||||
const dossiersService = dossiersServiceResolver(_injector, _router);
|
||||
const dossiersService = dossiersServiceResolver(_injector, router);
|
||||
|
||||
this.fileId = route.snapshot.paramMap.get(FILE_ID);
|
||||
this.dossierId = route.snapshot.paramMap.get(DOSSIER_ID);
|
||||
|
||||
@ -17,11 +17,10 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { workflowFileStatusTranslations } from '../../../translations/file-status-translations';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { RouterHistoryService } from '@services/router-history.service';
|
||||
import { Dossier, IMatchedDocument, ISearchListItem, ISearchResponse } from '@red/domain';
|
||||
import { Dossier, DOSSIERS_ARCHIVE, IMatchedDocument, ISearchListItem, ISearchResponse } from '@red/domain';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { PlatformSearchService } from '@services/entity-services/platform-search.service';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
import { DOSSIERS_ARCHIVE } from '@utils/constants';
|
||||
import { DossiersCacheService } from '../../../services/dossiers/dossiers-cache.service';
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from '@utils/constants';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossiers-type-switch',
|
||||
|
||||
@ -1,17 +1,9 @@
|
||||
import { Component, Input, OnChanges, OnInit, Optional } from '@angular/core';
|
||||
import { Color } from '@red/domain';
|
||||
import { DoughnutChartConfig } from '@red/domain';
|
||||
import { FilterService, INestedFilter } from '@iqser/common-ui';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
export interface DoughnutChartConfig {
|
||||
value: number;
|
||||
color: Color;
|
||||
label: string;
|
||||
key?: string;
|
||||
active?: boolean;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-simple-doughnut-chart',
|
||||
templateUrl: './simple-doughnut-chart.component.html',
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<div class="title flex-1">
|
||||
{{ 'upload-status.dialog.title' | translate: { len: uploadService.files.length } }}
|
||||
</div>
|
||||
<iqser-circle-button [icon]="'iqser:status-' + (collapsed ? 'expand' : 'collapse')"></iqser-circle-button>
|
||||
<iqser-circle-button (action)="closeDialog()" icon="iqser:close"></iqser-circle-button>
|
||||
<iqser-circle-button [icon]="'iqser:status-' + (collapsed ? 'expand' : 'collapse')" id="expand-upload-status"></iqser-circle-button>
|
||||
<iqser-circle-button (action)="closeDialog()" icon="iqser:close" id="close-upload-status"></iqser-circle-button>
|
||||
</div>
|
||||
<div [hidden]="collapsed" class="upload-download-list">
|
||||
<div *ngFor="let dossierId of uploadService.activeDossierKeys">
|
||||
|
||||
@ -5,8 +5,8 @@ import { BehaviorSubject, Observable, of } from 'rxjs';
|
||||
import { filter, pluck } from 'rxjs/operators';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { BreadcrumbTypes } from '@red/domain';
|
||||
import { DOSSIER_ID, DOSSIER_TEMPLATE_ID, DOSSIERS_ARCHIVE, FILE_ID } from '@utils/constants';
|
||||
import { BreadcrumbTypes, DOSSIER_ID, DOSSIERS_ARCHIVE } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, FILE_ID } from '@utils/constants';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { dossiersServiceResolver } from '@services/entity-services/dossiers.service.provider';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { CHANGED_CHECK_INTERVAL, DOSSIERS_ROUTE } from '@utils/constants';
|
||||
import { CHANGED_CHECK_INTERVAL } from '@utils/constants';
|
||||
import { DossiersService } from './dossiers.service';
|
||||
import { Observable, timer } from 'rxjs';
|
||||
import { switchMap, tap } from 'rxjs/operators';
|
||||
import { Dossier } from '@red/domain';
|
||||
import { Dossier, DOSSIERS_ROUTE } from '@red/domain';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { Dossier } from '@red/domain';
|
||||
import { ARCHIVE_ROUTE, Dossier, DOSSIERS_ARCHIVE } from '@red/domain';
|
||||
import { catchError, tap } from 'rxjs/operators';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -7,7 +7,6 @@ import { ActiveDossiersService } from './active-dossiers.service';
|
||||
import { DossiersService } from './dossiers.service';
|
||||
import { FilesMapService } from '../entity-services/files-map.service';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ARCHIVE } from '@utils/constants';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ArchivedDossiersService extends DossiersService {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { StatsService } from '@iqser/common-ui';
|
||||
import { DossierStats, IDossierStats } from '@red/domain';
|
||||
import { DOSSIER_ID } from '@utils/constants';
|
||||
import { DOSSIER_ID, DossierStats, IDossierStats } from '@red/domain';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { UserService } from '../user.service';
|
||||
import { NGXLogger } from 'ngx-logger';
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DossierState, IDossierState } from '@red/domain';
|
||||
import { DossierState, DoughnutChartConfig, IDossierState } from '@red/domain';
|
||||
import { EntitiesMapService } from '@iqser/common-ui';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { flatMap } from 'lodash-es';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
@ -17,7 +16,7 @@ export class DossierStatesMapService extends EntitiesMapService<DossierState, ID
|
||||
allStates
|
||||
.reduce((acc, { color, name, dossierCount }) => {
|
||||
const key = name + '-' + color;
|
||||
const item = acc.get(key) ?? Object.assign({}, { value: 0, label: name, color: color });
|
||||
const item: DoughnutChartConfig = acc.get(key) ?? Object.assign({}, { value: 0, label: name, color: color });
|
||||
return acc.set(key, { ...item, value: item.value + dossierCount });
|
||||
}, new Map<string, DoughnutChartConfig>())
|
||||
.values(),
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { File, IFile } from '@red/domain';
|
||||
import { DOSSIER_ID, File, IFile } from '@red/domain';
|
||||
import { EntitiesMapService } from '@iqser/common-ui';
|
||||
import { DOSSIER_ID } from '@utils/constants';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class FilesMapService extends EntitiesMapService<File, IFile> {
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { UserService } from './user.service';
|
||||
import { Dictionary, Dossier, File, IComment, IDossier } from '@red/domain';
|
||||
import { Dictionary, Dossier, DOSSIERS_ARCHIVE, File, IComment, IDossier } from '@red/domain';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
import { DOSSIERS_ARCHIVE } from '@utils/constants';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class PermissionsService {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { DoughnutChartConfig } from '@red/domain';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { rolesTranslations } from '../translations/roles-translations';
|
||||
import { workflowFileStatusTranslations } from '../translations/file-status-translations';
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
export const CHANGED_CHECK_INTERVAL = 5000;
|
||||
export const FALLBACK_COLOR = '#CCCCCC';
|
||||
export const DOSSIER_ID = 'dossierId';
|
||||
export const FILE_ID = 'fileId';
|
||||
export const DOSSIER_TEMPLATE_ID = 'dossierTemplateId';
|
||||
export const ENTITY_TYPE = 'entity';
|
||||
export const DOSSIERS_ARCHIVE = 'DOSSIERS_ARCHIVE';
|
||||
|
||||
export const ARCHIVE_ROUTE = 'archive';
|
||||
export const DOSSIERS_ROUTE = 'dossiers';
|
||||
|
||||
@ -1,28 +1,13 @@
|
||||
import { IDashboardStats, ProcessingFileStatus, StatusSorter, WorkflowFileStatus } from '@red/domain';
|
||||
import { IListable } from '@iqser/common-ui';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { IListable, List } from '@iqser/common-ui';
|
||||
import { CountByStatus, CountPerProcessingStatus, CountPerWorkflowStatus, IDashboardStats } from './dashboard-stats';
|
||||
import { DoughnutChartConfig, StatusSorter } from '../shared';
|
||||
|
||||
export class DashboardStats implements IListable, IDashboardStats {
|
||||
readonly dossierCountByStatus: [
|
||||
{
|
||||
count: number;
|
||||
statusId: string;
|
||||
},
|
||||
];
|
||||
readonly dossierCountByStatus: List<CountByStatus>;
|
||||
readonly dossierTemplateId: string;
|
||||
readonly dossiersInTemplate: [string];
|
||||
readonly fileCountPerProcessingStatus: [
|
||||
{
|
||||
readonly count: number;
|
||||
readonly processingStatus: ProcessingFileStatus;
|
||||
},
|
||||
];
|
||||
readonly fileCountPerWorkflowStatus: [
|
||||
{
|
||||
readonly count: number;
|
||||
readonly workflowStatus: WorkflowFileStatus;
|
||||
},
|
||||
];
|
||||
readonly dossiersInTemplate: List<string>;
|
||||
readonly fileCountPerProcessingStatus: List<CountPerProcessingStatus>;
|
||||
readonly fileCountPerWorkflowStatus: List<CountPerWorkflowStatus>;
|
||||
readonly name: string;
|
||||
readonly numberOfActiveDossiers: number;
|
||||
readonly numberOfActiveFiles: number;
|
||||
|
||||
@ -1,26 +1,28 @@
|
||||
import { ProcessingFileStatus, WorkflowFileStatus } from '@red/domain';
|
||||
import { ProcessingFileStatus, WorkflowFileStatus } from '../files';
|
||||
import { List } from '@iqser/common-ui';
|
||||
|
||||
interface Counter {
|
||||
readonly count: number;
|
||||
}
|
||||
|
||||
export interface CountByStatus extends Counter {
|
||||
readonly statusId: string;
|
||||
}
|
||||
|
||||
export interface CountPerProcessingStatus extends Counter {
|
||||
readonly processingStatus: ProcessingFileStatus;
|
||||
}
|
||||
|
||||
export interface CountPerWorkflowStatus extends Counter {
|
||||
readonly workflowStatus: WorkflowFileStatus;
|
||||
}
|
||||
|
||||
export interface IDashboardStats {
|
||||
readonly dossierCountByStatus: [
|
||||
{
|
||||
count: number;
|
||||
statusId: string;
|
||||
},
|
||||
];
|
||||
readonly dossierCountByStatus: List<CountByStatus>;
|
||||
readonly dossierTemplateId: string;
|
||||
readonly dossiersInTemplate: [string];
|
||||
readonly fileCountPerProcessingStatus: [
|
||||
{
|
||||
readonly count: number;
|
||||
readonly processingStatus: ProcessingFileStatus;
|
||||
},
|
||||
];
|
||||
readonly fileCountPerWorkflowStatus: [
|
||||
{
|
||||
readonly count: number;
|
||||
readonly workflowStatus: WorkflowFileStatus;
|
||||
},
|
||||
];
|
||||
readonly dossiersInTemplate: List<string>;
|
||||
readonly fileCountPerProcessingStatus: List<CountPerProcessingStatus>;
|
||||
readonly fileCountPerWorkflowStatus: List<CountPerWorkflowStatus>;
|
||||
readonly name: string;
|
||||
readonly numberOfActiveDossiers: number;
|
||||
readonly numberOfActiveFiles: number;
|
||||
|
||||
5
libs/red-domain/src/lib/dossiers/constants.ts
Normal file
5
libs/red-domain/src/lib/dossiers/constants.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export const DOSSIER_ID = 'dossierId';
|
||||
export const DOSSIERS_ARCHIVE = 'DOSSIERS_ARCHIVE';
|
||||
|
||||
export const ARCHIVE_ROUTE = 'archive';
|
||||
export const DOSSIERS_ROUTE = 'dossiers';
|
||||
@ -1,7 +1,7 @@
|
||||
import { IListable, List } from '@iqser/common-ui';
|
||||
import { IDossier } from './dossier';
|
||||
import { DownloadFileType } from '../shared';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from '@utils/constants';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from './constants';
|
||||
|
||||
export class Dossier implements IDossier, IListable {
|
||||
readonly dossierId: string;
|
||||
@ -49,7 +49,7 @@ export class Dossier implements IDossier, IListable {
|
||||
this.hasReviewers = !!this.memberIds && this.memberIds.length > 1;
|
||||
|
||||
this.id = this.dossierId;
|
||||
const routerPath = (this.isArchived ? ARCHIVE_ROUTE : DOSSIERS_ROUTE) as string;
|
||||
const routerPath = this.isArchived ? ARCHIVE_ROUTE : DOSSIERS_ROUTE;
|
||||
this.dossiersListRouterLink = `/main/${this.dossierTemplateId}/${routerPath}`;
|
||||
this.routerLink = `${this.dossiersListRouterLink}/${this.dossierId}`;
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
export * from './dossier';
|
||||
export * from './constants';
|
||||
export * from './dossier.request';
|
||||
export * from './dossier.model';
|
||||
export * from './dossier-changes';
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
} from './types';
|
||||
import { IFile } from './file';
|
||||
import { FileAttributes } from '../file-attributes';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from '@utils/constants';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from '../dossiers';
|
||||
|
||||
export class File extends Entity<IFile> implements IFile {
|
||||
readonly added?: string;
|
||||
|
||||
9
libs/red-domain/src/lib/shared/charts.ts
Normal file
9
libs/red-domain/src/lib/shared/charts.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { Color } from './colors';
|
||||
|
||||
export interface DoughnutChartConfig {
|
||||
value: number;
|
||||
color: Color;
|
||||
label: string;
|
||||
key?: string;
|
||||
active?: boolean;
|
||||
}
|
||||
@ -10,3 +10,4 @@ export * from './expandable-file-actions';
|
||||
export * from './pdf.types';
|
||||
export * from './logger-config';
|
||||
export * from './admin-side-nav-types';
|
||||
export * from './charts';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user