Merge remote-tracking branch 'origin/master' into RED-3950
This commit is contained in:
commit
f0d9bc0899
@ -9,7 +9,7 @@ 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 { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { ARCHIVE_ROUTE, DOSSIER_TEMPLATE_ID, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@red/domain';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
import { DossierTemplateExistsGuard } from '@guards/dossier-template-exists.guard';
|
||||
import { DashboardGuard } from '@guards/dashboard-guard.service';
|
||||
|
||||
@ -3,9 +3,8 @@ 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_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DOSSIER_ID, DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { DOSSIER_ID } from '@red/domain';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DossierFilesGuard implements CanActivate {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import { DashboardStatsService } from '@services/dossier-templates/dashboard-stats.service';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
|
||||
@ -13,8 +13,8 @@ export class EntityExistsGuard implements CanActivate {
|
||||
) {}
|
||||
|
||||
async canActivate(route: ActivatedRouteSnapshot): Promise<boolean> {
|
||||
const dossierTemplateId: string = route.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
const type: string = route.paramMap.get(ENTITY_TYPE);
|
||||
const dossierTemplateId = route.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
const type = route.paramMap.get(ENTITY_TYPE);
|
||||
|
||||
if (!this._dictionariesMapService.get(dossierTemplateId, type)) {
|
||||
const dossierTemplate = this._dossierTemplatesService.find(dossierTemplateId);
|
||||
|
||||
@ -15,7 +15,7 @@ import { GeneralConfigScreenComponent } from './screens/general-config/general-c
|
||||
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
|
||||
import { BaseDossierTemplateScreenComponent } from './base-dossier-templates-screen/base-dossier-template-screen.component';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { DossierTemplateExistsGuard } from '@guards/dossier-template-exists.guard';
|
||||
import { EntityExistsGuard } from '@guards/entity-exists-guard.service';
|
||||
import { DossierStatesListingScreenComponent } from './screens/dossier-states-listing/dossier-states-listing-screen.component';
|
||||
|
||||
@ -4,8 +4,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { adminSideNavTranslations } from '../translations/admin-side-nav-translations';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ENTITY_TYPE } from '@utils/constants';
|
||||
import { AdminSideNavType, AdminSideNavTypes } from '@red/domain';
|
||||
import { AdminSideNavType, AdminSideNavTypes, ENTITY_TYPE } from '@red/domain';
|
||||
|
||||
interface NavItem {
|
||||
readonly label: string;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<div class="flex-1 actions">
|
||||
<iqser-circle-button
|
||||
(action)="openDeleteDictionariesDialog()"
|
||||
*ngIf="this.canDeleteEntity$ | async"
|
||||
*ngIf="canDeleteEntity$ | async"
|
||||
[tooltip]="'entities-listing.action.delete' | translate"
|
||||
icon="iqser:trash"
|
||||
></iqser-circle-button>
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { AdminDialogService } from '../services/admin-dialog.service';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { LoadingService } from '@iqser/common-ui';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
@ -16,26 +15,24 @@ import { PermissionsService } from '@services/permissions.service';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class BaseEntityScreenComponent {
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
readonly disabledItems$: Observable<string[]>;
|
||||
readonly canDeleteEntity$: Observable<boolean>;
|
||||
readonly #dossierTemplateId: string;
|
||||
readonly #entityType: string;
|
||||
|
||||
constructor(
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _userService: UserService,
|
||||
route: ActivatedRoute,
|
||||
private readonly _router: Router,
|
||||
dictionaryMapService: DictionariesMapService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
private readonly _dictionaryMapService: DictionariesMapService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _router: Router,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
) {
|
||||
this.#dossierTemplateId = this._route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.#entityType = this._route.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
const entity$ = this._dictionaryMapService.watch$(this.#dossierTemplateId, this.#entityType);
|
||||
this.#dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.#entityType = route.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
const entity$ = dictionaryMapService.watch$(this.#dossierTemplateId, this.#entityType);
|
||||
this.canDeleteEntity$ = entity$.pipe(map(entity => this._permissionsService.canDeleteEntities(entity)));
|
||||
this.disabledItems$ = entity$.pipe(
|
||||
map(entity => (entity.hasDictionary ? [] : ['dictionary', 'false-positive', 'false-recommendations'])),
|
||||
|
||||
@ -3,9 +3,8 @@ import { DossierTemplatesService } from '@services/dossier-templates/dossier-tem
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map, switchMap } from 'rxjs/operators';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Dictionary, DossierTemplate } from '@red/domain';
|
||||
import { Dictionary, DOSSIER_TEMPLATE_ID, DossierTemplate, ENTITY_TYPE } from '@red/domain';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@utils/constants';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-template-breadcrumbs',
|
||||
@ -20,16 +19,16 @@ export class DossierTemplateBreadcrumbsComponent {
|
||||
constructor(
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dictionariesMapService: DictionariesMapService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
route: ActivatedRoute,
|
||||
) {
|
||||
this.dossierTemplate$ = _route.paramMap.pipe(
|
||||
this.dossierTemplate$ = route.paramMap.pipe(
|
||||
map(params => params.get(DOSSIER_TEMPLATE_ID)),
|
||||
switchMap((dossierTemplateId: string) => this._dossierTemplatesService.getEntityChanged$(dossierTemplateId)),
|
||||
switchMap(dossierTemplateId => _dossierTemplatesService.getEntityChanged$(dossierTemplateId)),
|
||||
);
|
||||
this.activeDictionary$ = _route.paramMap.pipe(
|
||||
map(params => [params.get(DOSSIER_TEMPLATE_ID), params.get(ENTITY_TYPE)]),
|
||||
switchMap(([dossierTemplateId, dictionary]: [string, string]) =>
|
||||
dictionary ? this._dictionariesMapService.watch$(dossierTemplateId, dictionary) : of(undefined),
|
||||
this.activeDictionary$ = route.paramMap.pipe(
|
||||
map(params => [params.get(DOSSIER_TEMPLATE_ID), params.get(ENTITY_TYPE)] as const),
|
||||
switchMap(([dossierTemplateId, dictionary]) =>
|
||||
dictionary ? _dictionariesMapService.watch$(dossierTemplateId, dictionary) : of(undefined),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnInit } from '@angular/core';
|
||||
import { DefaultColorType, IColors } from '@red/domain';
|
||||
import { DefaultColorType, DOSSIER_TEMPLATE_ID, IColors, User } from '@red/domain';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import {
|
||||
CircleButtonTypes,
|
||||
@ -13,10 +13,8 @@ import { defaultColorsTranslations } from '../../translations/default-colors-tra
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
interface ListItem extends IListable {
|
||||
readonly key: string;
|
||||
@ -31,27 +29,28 @@ interface ListItem extends IListable {
|
||||
})
|
||||
export class DefaultColorsScreenComponent extends ListingComponent<ListItem> implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
readonly currentUser: User;
|
||||
readonly translations = defaultColorsTranslations;
|
||||
readonly tableHeaderLabel = _('default-colors-screen.table-header.title');
|
||||
readonly tableColumnConfigs: TableColumnConfig<ListItem>[] = [
|
||||
{ label: _('default-colors-screen.table-col-names.key'), sortByKey: 'searchKey', width: '2fr' },
|
||||
{ label: _('default-colors-screen.table-col-names.color'), class: 'flex-center' },
|
||||
];
|
||||
private _colorsObj: IColors;
|
||||
|
||||
#colorsObj: IColors;
|
||||
readonly #dossierTemplateId: string;
|
||||
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
userService: UserService,
|
||||
protected readonly _injector: Injector,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
) {
|
||||
super(_injector);
|
||||
this.#dossierTemplateId = _route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.currentUser = userService.currentUser;
|
||||
this.#dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
openEditColorDialog($event: MouseEvent, color: { key: DefaultColorType | string; value: string }) {
|
||||
@ -59,7 +58,7 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
'editColor',
|
||||
$event,
|
||||
{
|
||||
colors: this._colorsObj,
|
||||
colors: this.#colorsObj,
|
||||
colorKey: color.key,
|
||||
dossierTemplateId: this.#dossierTemplateId,
|
||||
},
|
||||
@ -76,7 +75,7 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
private async _loadColors() {
|
||||
this._loadingService.start();
|
||||
const data = await firstValueFrom(this._dictionaryService.getColors(this.#dossierTemplateId));
|
||||
this._colorsObj = data;
|
||||
this.#colorsObj = data;
|
||||
const entities = Object.keys(data)
|
||||
.map(key => ({
|
||||
id: key,
|
||||
|
||||
@ -13,11 +13,10 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d
|
||||
import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { DossierAttributeConfig, IDossierAttributeConfig } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, DossierAttributeConfig, IDossierAttributeConfig } from '@red/domain';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ReportTemplateService } from '../../../../services/report-template.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
@Component({
|
||||
templateUrl: './dossier-attributes-listing-screen.component.html',
|
||||
|
||||
@ -10,7 +10,6 @@ import {
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig,
|
||||
Toaster,
|
||||
} from '@iqser/common-ui';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -44,7 +43,6 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent<Dos
|
||||
];
|
||||
|
||||
constructor(
|
||||
private readonly _toaster: Toaster,
|
||||
protected readonly _injector: Injector,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
|
||||
@ -10,13 +10,12 @@ import {
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { Dictionary, DossierTemplateStats } from '@red/domain';
|
||||
import { Dictionary, DOSSIER_TEMPLATE_ID, DossierTemplateStats } from '@red/domain';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { DossierTemplateStatsService } from '@services/entity-services/dossier-template-stats.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,37 +1,36 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DictionaryManagerComponent } from '@shared/components/dictionary-manager/dictionary-manager.component';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { List, LoadingService } from '@iqser/common-ui';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { BehaviorSubject, firstValueFrom } from 'rxjs';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@utils/constants';
|
||||
import { DICTIONARY_TO_ENTRY_TYPE_MAP, DICTIONARY_TYPE_KEY_MAP, DictionaryType } from '@red/domain';
|
||||
import { DICTIONARY_TO_ENTRY_TYPE_MAP, DICTIONARY_TYPE_KEY_MAP, DictionaryType, DOSSIER_TEMPLATE_ID, ENTITY_TYPE, User } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
templateUrl: './dictionary-screen.component.html',
|
||||
styleUrls: ['./dictionary-screen.component.scss'],
|
||||
})
|
||||
export class DictionaryScreenComponent implements OnInit {
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
initialEntries$ = new BehaviorSubject<string[]>([]);
|
||||
readonly currentUser: User;
|
||||
readonly initialEntries$ = new BehaviorSubject<string[]>([]);
|
||||
isLeavingPage = false;
|
||||
readonly type: DictionaryType;
|
||||
readonly #dossierTemplateId: string;
|
||||
readonly #entityType: string;
|
||||
@ViewChild('dictionaryManager', { static: false })
|
||||
private readonly _dictionaryManager: DictionaryManagerComponent;
|
||||
@ViewChild('fileInput') private readonly _fileInput: ElementRef;
|
||||
|
||||
constructor(
|
||||
private readonly _userService: UserService,
|
||||
route: ActivatedRoute,
|
||||
userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
) {
|
||||
this.#dossierTemplateId = _route.parent.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.#entityType = _route.parent.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
this.type = this._route.snapshot.routeConfig.path as DictionaryType;
|
||||
this.currentUser = userService.currentUser;
|
||||
this.#dossierTemplateId = route.parent.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.#entityType = route.parent.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
this.type = route.snapshot.routeConfig.path as DictionaryType;
|
||||
}
|
||||
|
||||
get changed() {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component, HostListener, ViewChild } from '@angular/core';
|
||||
import { Dictionary } from '@red/domain';
|
||||
import { Dictionary, DOSSIER_TEMPLATE_ID, ENTITY_TYPE, User } from '@red/domain';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@utils/constants';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
@ -16,20 +15,21 @@ import { Observable } from 'rxjs';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class InfoComponent {
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
readonly currentUser: User;
|
||||
readonly entity$: Observable<Dictionary>;
|
||||
readonly dossierTemplateId: string;
|
||||
@ViewChild(AddEditEntityComponent) private readonly _addEditEntityComponent: AddEditEntityComponent;
|
||||
|
||||
constructor(
|
||||
private readonly _dictionariesMapService: DictionariesMapService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _userService: UserService,
|
||||
route: ActivatedRoute,
|
||||
userService: UserService,
|
||||
dictionariesMapService: DictionariesMapService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
) {
|
||||
this.dossierTemplateId = this._route.parent.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
const entityType = this._route.parent.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
this.entity$ = this._dictionariesMapService.watch$(this.dossierTemplateId, entityType);
|
||||
this.currentUser = userService.currentUser;
|
||||
this.dossierTemplateId = route.parent.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
const entityType = route.parent.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
this.entity$ = dictionariesMapService.watch$(this.dossierTemplateId, entityType);
|
||||
}
|
||||
|
||||
get disabled(): boolean {
|
||||
|
||||
@ -22,14 +22,12 @@ import {
|
||||
import { fileAttributeTypesTranslations } from '../../translations/file-attribute-types-translations';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { FileAttributeConfig, IFileAttributeConfig, IFileAttributesConfig } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, FileAttributeConfig, IFileAttributeConfig, IFileAttributesConfig, User } from '@red/domain';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ReportTemplateService } from '../../../../services/report-template.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
@Component({
|
||||
templateUrl: './file-attributes-listing-screen.component.html',
|
||||
@ -43,7 +41,7 @@ import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
export class FileAttributesListingScreenComponent extends ListingComponent<FileAttributeConfig> implements OnInit, OnDestroy {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
readonly currentUser: User;
|
||||
readonly translations = fileAttributeTypesTranslations;
|
||||
readonly tableHeaderLabel = _('file-attributes-listing.table-header.title');
|
||||
readonly tableColumnConfigs: TableColumnConfig<FileAttributeConfig>[] = [
|
||||
@ -60,24 +58,24 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
rightIconTooltip: _('file-attributes-listing.table-col-names.primary-info-tooltip'),
|
||||
},
|
||||
];
|
||||
@ViewChild('impactedTemplates') impactedTemplatesRef: TemplateRef<unknown>;
|
||||
@ViewChild('impactedTemplates') private readonly _impactedTemplatesRef: TemplateRef<unknown>;
|
||||
private _existingConfiguration: IFileAttributesConfig;
|
||||
@ViewChild('fileInput') private _fileInput: ElementRef;
|
||||
readonly #dossierTemplateId: string;
|
||||
|
||||
constructor(
|
||||
protected readonly _injector: Injector,
|
||||
route: ActivatedRoute,
|
||||
userService: UserService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _userService: UserService,
|
||||
protected readonly _injector: Injector,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
private readonly _reportTemplateService: ReportTemplateService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
) {
|
||||
super(_injector);
|
||||
this.#dossierTemplateId = _route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.currentUser = userService.currentUser;
|
||||
this.#dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
private get _numberOfDisplayedAttrs(): number {
|
||||
@ -111,7 +109,7 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
await this._dialogService.deleteAttributes(
|
||||
attributes,
|
||||
this.#dossierTemplateId,
|
||||
this.impactedTemplatesRef,
|
||||
this._impactedTemplatesRef,
|
||||
'file',
|
||||
$event,
|
||||
async () => {
|
||||
|
||||
@ -2,11 +2,10 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { DossierTemplate, DossierTemplateStats } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, DossierTemplate, DossierTemplateStats } from '@red/domain';
|
||||
import { DossierTemplateStatsService } from '@services/entity-services/dossier-template-stats.service';
|
||||
import { AdminDialogService } from '../../../services/admin-dialog.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { dossierTemplateStatusTranslations } from '../../../translations/dossier-template-status-translations';
|
||||
|
||||
@Component({
|
||||
@ -20,15 +19,15 @@ export class DossierTemplateInfoScreenComponent {
|
||||
readonly translations = dossierTemplateStatusTranslations;
|
||||
|
||||
constructor(
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dossierTemplateStatsService: DossierTemplateStatsService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
route: ActivatedRoute,
|
||||
readonly permissionsService: PermissionsService,
|
||||
dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
dossierTemplateStatsService: DossierTemplateStatsService,
|
||||
) {
|
||||
const dossierTemplateId = _route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.dossierTemplate$ = this._dossierTemplatesService.getEntityChanged$(dossierTemplateId);
|
||||
this.dossierTemplateStats$ = this._dossierTemplateStatsService.watch$(dossierTemplateId);
|
||||
const dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.dossierTemplate$ = dossierTemplatesService.getEntityChanged$(dossierTemplateId);
|
||||
this.dossierTemplateStats$ = dossierTemplateStatsService.watch$(dossierTemplateId);
|
||||
}
|
||||
|
||||
openEditDossierTemplateDialog($event: MouseEvent, dossierTemplate: DossierTemplate) {
|
||||
|
||||
@ -9,14 +9,13 @@ import {
|
||||
LoadingService,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { Justification } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, Justification } from '@red/domain';
|
||||
import { JustificationsService } from '@services/entity-services/justifications.service';
|
||||
import { JustificationsDialogService } from '../justifications-dialog.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-justifications-screen',
|
||||
@ -54,6 +53,10 @@ export class JustificationsScreenComponent extends ListingComponent<Justificatio
|
||||
this.#dossierTemplateId = _route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
get canUpdateJustifications(): boolean {
|
||||
return this.userPreferenceService.areDevFeaturesEnabled && this.userService.currentUser.isAdmin;
|
||||
}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
this._loadingService.start();
|
||||
await firstValueFrom(this._justificationService.loadAll(this.#dossierTemplateId));
|
||||
@ -67,8 +70,4 @@ export class JustificationsScreenComponent extends ListingComponent<Justificatio
|
||||
openConfirmDeleteDialog() {
|
||||
this._dialogService.confirmDelete(this.listingService.selected, this.#dossierTemplateId);
|
||||
}
|
||||
|
||||
get canUpdateJustifications(): boolean {
|
||||
return this.userPreferenceService.areDevFeaturesEnabled && this.userService.currentUser.isAdmin;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,20 +14,20 @@
|
||||
</span>
|
||||
|
||||
<div class="action-buttons">
|
||||
<iqser-circle-button
|
||||
(action)="openEditJustificationDialog()"
|
||||
*ngIf="userPreferenceService.areDevFeaturesEnabled && userService.currentUser.isAdmin"
|
||||
[tooltip]="'justifications-listing.actions.edit' | translate"
|
||||
[type]="circleButtonTypes.dark"
|
||||
icon="iqser:edit"
|
||||
></iqser-circle-button>
|
||||
<ng-container *ngIf="userPreferenceService.areDevFeaturesEnabled && (currentUser$ | async).isAdmin">
|
||||
<iqser-circle-button
|
||||
(action)="openEditJustificationDialog()"
|
||||
[tooltip]="'justifications-listing.actions.edit' | translate"
|
||||
[type]="circleButtonTypes.dark"
|
||||
icon="iqser:edit"
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button
|
||||
(action)="openConfirmDeleteDialog()"
|
||||
*ngIf="userPreferenceService.areDevFeaturesEnabled && userService.currentUser.isAdmin"
|
||||
[tooltip]="'justifications-listing.actions.delete' | translate"
|
||||
[type]="circleButtonTypes.dark"
|
||||
icon="iqser:trash"
|
||||
></iqser-circle-button>
|
||||
<iqser-circle-button
|
||||
(action)="openConfirmDeleteDialog()"
|
||||
[tooltip]="'justifications-listing.actions.delete' | translate"
|
||||
[type]="circleButtonTypes.dark"
|
||||
icon="iqser:trash"
|
||||
></iqser-circle-button>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { Justification } from '@red/domain';
|
||||
import { CircleButtonTypes, ListingService, LoadingService } from '@iqser/common-ui';
|
||||
import { DOSSIER_TEMPLATE_ID, Justification, User } from '@red/domain';
|
||||
import { CircleButtonTypes } from '@iqser/common-ui';
|
||||
import { JustificationsDialogService } from '../justifications-dialog.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-table-item',
|
||||
@ -16,17 +16,17 @@ import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
export class TableItemComponent {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@Input() justification: Justification;
|
||||
readonly currentUser$: Observable<User>;
|
||||
readonly #dossierTemplateId: string;
|
||||
|
||||
constructor(
|
||||
private readonly _dialogService: JustificationsDialogService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _listingService: ListingService<Justification>,
|
||||
route: ActivatedRoute,
|
||||
userService: UserService,
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
readonly userService: UserService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _dialogService: JustificationsDialogService,
|
||||
) {
|
||||
this.#dossierTemplateId = _route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.currentUser$ = userService.currentUser$;
|
||||
this.#dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
openEditJustificationDialog() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { IPlaceholdersResponse, IReportTemplate } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, IPlaceholdersResponse, IReportTemplate } from '@red/domain';
|
||||
import { download } from '@utils/file-download-utils';
|
||||
import { ConfirmationDialogInput, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
@ -14,7 +14,6 @@ import { DossierTemplatesService } from '@services/dossier-templates/dossier-tem
|
||||
import { ReportTemplateService } from '@services/report-template.service';
|
||||
import { BehaviorSubject, firstValueFrom } from 'rxjs';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
interface Placeholder {
|
||||
placeholder: string;
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { Debounce, IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { RulesService } from '../../../services/rules.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import ICodeEditor = monaco.editor.ICodeEditor;
|
||||
import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration;
|
||||
import IStandaloneEditorConstructionOptions = monaco.editor.IStandaloneEditorConstructionOptions;
|
||||
@ -44,11 +43,10 @@ export class RulesScreenComponent implements OnInit {
|
||||
private readonly _rulesService: RulesService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _toaster: Toaster,
|
||||
protected readonly _translateService: TranslateService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
route: ActivatedRoute,
|
||||
) {
|
||||
this.#dossierTemplateId = _route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.#dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
set isLeavingPage(isLeaving: boolean) {
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
:host {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import { environment } from '@environments/environment';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Debounce, IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { IWatermark, WatermarkOrientation, WatermarkOrientations } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, IWatermark, WatermarkOrientation, WatermarkOrientations } from '@red/domain';
|
||||
import { BASE_HREF } from '../../../../../tokens';
|
||||
import { stampPDFPage } from '@utils/page-stamper';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -13,7 +13,6 @@ import { WatermarkService } from '@shared/services/watermark.service';
|
||||
import { firstValueFrom, Observable, of, switchMap } from 'rxjs';
|
||||
import { catchError, tap } from 'rxjs/operators';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
export const DEFAULT_WATERMARK: IWatermark = {
|
||||
text: null,
|
||||
@ -39,18 +38,18 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
private _viewer: ElementRef;
|
||||
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
private readonly _http: HttpClient,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
@Inject(BASE_HREF) private readonly _baseHref: string,
|
||||
private readonly _watermarkService: WatermarkService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _http: HttpClient,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _route: ActivatedRoute,
|
||||
) {
|
||||
this._loadingService.start();
|
||||
this.#dossierTemplateId = this._route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.#dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
}
|
||||
|
||||
get changed(): boolean {
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AdminDialogService } from '../../../services/admin-dialog.service';
|
||||
import { CircleButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { CircleButtonTypes, LoadingService } from '@iqser/common-ui';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-template-actions',
|
||||
@ -22,10 +21,8 @@ export class DossierTemplateActionsComponent implements OnInit {
|
||||
constructor(
|
||||
private readonly _router: Router,
|
||||
private readonly _route: ActivatedRoute,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
) {}
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { BreadcrumbTypes, DOSSIER_ID } from '@red/domain';
|
||||
import { BreadcrumbTypes, DOSSIER_ID, FILE_ID } from '@red/domain';
|
||||
import { ArchivedDossiersScreenComponent } from './screens/archived-dossiers-screen/archived-dossiers-screen.component';
|
||||
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,11 +1,10 @@
|
||||
import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnInit } from '@angular/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DefaultListingServices, ListingComponent } from '@iqser/common-ui';
|
||||
import { Dossier } from '@red/domain';
|
||||
import { Dossier, DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import { ConfigService } from '../../services/config.service';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { ArchivedDossiersService } from '@services/dossiers/archived-dossiers.service';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, Inject, Injector, OnInit } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { DownloadFileType, IDossierRequest, IDossierTemplate, IReportTemplate } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, DownloadFileType, IDossierRequest, IDossierTemplate, IReportTemplate } from '@red/domain';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { downloadTypesTranslations } from '../../../../translations/download-types-translations';
|
||||
import { BaseDialogComponent, IconButtonTypes, LoadingService, SaveOptions } from '@iqser/common-ui';
|
||||
@ -8,7 +8,6 @@ import { ActiveDossiersService } from '@services/dossiers/active-dossiers.servic
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { ReportTemplateService } from '@services/report-template.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import dayjs from 'dayjs';
|
||||
import { Router } from '@angular/router';
|
||||
import { DossiersDialogService } from '../../shared/services/dossiers-dialog.service';
|
||||
|
||||
@ -94,10 +94,6 @@ export class AssignReviewerApproverDialogComponent {
|
||||
return user;
|
||||
}
|
||||
|
||||
isOwner(userId: string): boolean {
|
||||
return userId === this.selectedUser;
|
||||
}
|
||||
|
||||
async save() {
|
||||
this._loadingService.start();
|
||||
try {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Dossier, IDossierRequest, IDossierTemplate } from '@red/domain';
|
||||
import { Dossier, DOSSIER_TEMPLATE_ID, IDossierRequest, IDossierTemplate } from '@red/domain';
|
||||
import { EditDossierSaveResult, EditDossierSectionInterface } from '../edit-dossier-section.interface';
|
||||
import { DossiersDialogService } from '../../../shared/services/dossiers-dialog.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
@ -12,7 +12,6 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { DossierStatsService } from '@services/dossiers/dossier-stats.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { TrashService } from '@services/entity-services/trash.service';
|
||||
|
||||
@ -2,8 +2,7 @@ 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, DOSSIER_ID } from '@red/domain';
|
||||
import { FILE_ID } from '@utils/constants';
|
||||
import { BreadcrumbTypes, DOSSIER_ID, FILE_ID } from '@red/domain';
|
||||
import { ACTIVE_DOSSIERS_SERVICE } from '../../tokens';
|
||||
|
||||
const routes: Routes = [
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { DashboardStats, DonutChartConfig } from '@red/domain';
|
||||
import { DashboardStats, DonutChartConfig, DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { DashboardStatsService } from '@services/dossier-templates/dashboard-stats.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossiers-listing-details',
|
||||
@ -23,7 +22,7 @@ export class DossiersListingDetailsComponent {
|
||||
dashboardStatsService: DashboardStatsService,
|
||||
private readonly _translateChartService: TranslateChartService,
|
||||
) {
|
||||
const dossierTemplateId: string = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
const dossierTemplateId = route.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this.stats$ = dashboardStatsService.getEntityChanged$(dossierTemplateId);
|
||||
|
||||
this.dossiersChartConfig$ = this.stats$.pipe(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { Dossier } from '@red/domain';
|
||||
import { Dossier, DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { ButtonConfig, DefaultListingServices, ListingComponent, OnAttach, TableComponent } from '@iqser/common-ui';
|
||||
@ -9,7 +9,6 @@ import { ActiveDossiersService } from '@services/dossiers/active-dossiers.servic
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { DossiersDialogService } from '../../dossier/shared/services/dossiers-dialog.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
|
||||
@Component({
|
||||
@ -32,18 +31,18 @@ export class DossiersListingScreenComponent extends ListingComponent<Dossier> im
|
||||
@ViewChild(TableComponent) private readonly _tableComponent: TableComponent<Dossier>;
|
||||
|
||||
constructor(
|
||||
router: Router,
|
||||
protected readonly _injector: Injector,
|
||||
private readonly _userService: UserService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _activeDossiersService: ActiveDossiersService,
|
||||
private readonly _configService: ConfigService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _router: Router,
|
||||
private readonly _activeDossiersService: ActiveDossiersService,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
) {
|
||||
super(_injector);
|
||||
this.dossierTemplateId = this._router.routerState.snapshot.root.firstChild.firstChild.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
this._router.routeReuseStrategy.shouldReuseRoute = () => false;
|
||||
this.dossierTemplateId = router.routerState.snapshot.root.firstChild.firstChild.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
router.routeReuseStrategy.shouldReuseRoute = () => false;
|
||||
this.buttonConfigs = this._configService.buttonsConfig(this.dossierTemplateId);
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
(click)="multiSelectService.activate()"
|
||||
*ngIf="(multiSelectService.enabled$ | async) && (multiSelectInactive$ | async)"
|
||||
class="all-caps-label primary pointer"
|
||||
iqserHelpMode="bulk_select_annotations"
|
||||
iqserHelpMode="workload_in_editor"
|
||||
translate="file-preview.tabs.annotations.select"
|
||||
></div>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
[actionsTemplate]="annotationFilterActionTemplate"
|
||||
[primaryFiltersSlug]="'primaryFilters'"
|
||||
[secondaryFiltersSlug]="'secondaryFilters'"
|
||||
iqserHelpMode="workload_filter"
|
||||
iqserHelpMode="workload_in_editor"
|
||||
></iqser-popup-filter>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[class.active]="viewModeService.isStandard"
|
||||
[matTooltip]="'file-preview.standard-tooltip' | translate"
|
||||
class="red-tab"
|
||||
iqserHelpMode="view"
|
||||
iqserHelpMode="views"
|
||||
>
|
||||
{{ 'file-preview.standard' | translate }}
|
||||
</button>
|
||||
@ -15,7 +15,7 @@
|
||||
[disabled]="(canSwitchToDeltaView$ | async) === false"
|
||||
[matTooltip]="'file-preview.delta-tooltip' | translate"
|
||||
class="red-tab"
|
||||
iqserHelpMode="view"
|
||||
iqserHelpMode="views"
|
||||
>
|
||||
{{ 'file-preview.delta' | translate }}
|
||||
</button>
|
||||
@ -26,7 +26,7 @@
|
||||
[disabled]="(canSwitchToRedactedView$ | async) === false"
|
||||
[matTooltip]="'file-preview.redacted-tooltip' | translate"
|
||||
class="red-tab"
|
||||
iqserHelpMode="view"
|
||||
iqserHelpMode="views"
|
||||
>
|
||||
{{ 'file-preview.redacted' | translate }}
|
||||
</button>
|
||||
@ -37,7 +37,7 @@
|
||||
[disabled]="(canSwitchToHighlightsView$ | async) === false"
|
||||
[matTooltip]="'file-preview.text-highlights-tooltip' | translate"
|
||||
class="red-tab"
|
||||
iqserHelpMode="view"
|
||||
iqserHelpMode="views"
|
||||
>
|
||||
{{ 'file-preview.text-highlights' | translate }}
|
||||
</button>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectorRef, Component, HostListener, NgZone, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { ChangeDetectorRef, Component, HostListener, Injector, NgZone, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, ActivatedRouteSnapshot, NavigationExtras, Router } from '@angular/router';
|
||||
import { Core } from '@pdftron/webviewer';
|
||||
import {
|
||||
@ -39,7 +39,6 @@ import { MultiSelectService } from './services/multi-select.service';
|
||||
import { DocumentInfoService } from './services/document-info.service';
|
||||
import { ReanalysisService } from '@services/reanalysis.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { SkippedService } from './services/skipped.service';
|
||||
import { FilePreviewStateService } from './services/file-preview-state.service';
|
||||
import { filePreviewScreenProviders } from './file-preview-providers';
|
||||
import { ManualRedactionService } from './services/manual-redaction.service';
|
||||
@ -49,22 +48,11 @@ import { ComponentCanDeactivate } from '@guards/can-deactivate.guard';
|
||||
import { PdfViewer } from './services/pdf-viewer.service';
|
||||
import { FilePreviewDialogService } from './services/file-preview-dialog.service';
|
||||
import { FileDataService } from './services/file-data.service';
|
||||
import { ALL_HOTKEYS } from './shared/constants';
|
||||
import { ActionsHelpModeKeys, ALL_HOTKEYS } from './shared/constants';
|
||||
import { NGXLogger } from 'ngx-logger';
|
||||
import { StampService } from './services/stamp.service';
|
||||
import Annotation = Core.Annotations.Annotation;
|
||||
|
||||
const HelpModeKeys = {
|
||||
redaction: 'redaction_text',
|
||||
'manual-redaction': 'redaction_text',
|
||||
recommendation: 'recommendation',
|
||||
skipped: 'skipped',
|
||||
hint: 'hint_text',
|
||||
'hint-ocr': 'hint_picture',
|
||||
'hint-formula': 'picture',
|
||||
'hint-image': 'image',
|
||||
};
|
||||
|
||||
@Component({
|
||||
templateUrl: './file-preview-screen.component.html',
|
||||
styleUrls: ['./file-preview-screen.component.scss'],
|
||||
@ -107,20 +95,17 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
private readonly _filterService: FilterService,
|
||||
private readonly _activatedRoute: ActivatedRoute,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _skippedService: SkippedService,
|
||||
private readonly _filesMapService: FilesMapService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _fileDataService: FileDataService,
|
||||
private readonly _viewModeService: ViewModeService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _reanalysisService: ReanalysisService,
|
||||
private readonly _dialogService: FilePreviewDialogService,
|
||||
private readonly _pageRotationService: PageRotationService,
|
||||
private readonly _annotationDrawService: AnnotationDrawService,
|
||||
private readonly _fileManagementService: FileManagementService,
|
||||
private readonly _manualRedactionService: ManualRedactionService,
|
||||
private readonly _annotationProcessingService: AnnotationProcessingService,
|
||||
private readonly _stampService: StampService,
|
||||
private readonly _injector: Injector,
|
||||
) {
|
||||
super();
|
||||
this.canPerformAnnotationActions$ = this._canPerformAnnotationActions$;
|
||||
@ -197,7 +182,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
this._loadingService.start();
|
||||
this.pdf.hideAnnotations(annotations);
|
||||
const highlights = await this._fileDataService.loadTextHighlights();
|
||||
await this._annotationDrawService.drawAnnotations(highlights);
|
||||
await this._annotationDrawService.draw(highlights);
|
||||
this._loadingService.stop();
|
||||
}
|
||||
}
|
||||
@ -240,7 +225,8 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
this._subscribeToFileUpdates();
|
||||
|
||||
if (file?.analysisRequired && !file.excludedFromAutomaticAnalysis) {
|
||||
const reanalyzeFiles = this._reanalysisService.reanalyzeFilesForDossier([file], this.dossierId, { force: true });
|
||||
const reanalysisService = this._injector.get(ReanalysisService);
|
||||
const reanalyzeFiles = reanalysisService.reanalyzeFilesForDossier([file], this.dossierId, { force: true });
|
||||
await firstValueFrom(reanalyzeFiles);
|
||||
}
|
||||
|
||||
@ -275,12 +261,14 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
if (selectedAnnotations.length > 0) {
|
||||
this.pdf.deleteAnnotations([selectedAnnotations[0].Id]);
|
||||
}
|
||||
const add$ = this._manualRedactionService.addAnnotation(
|
||||
const manualRedactionService = this._injector.get(ManualRedactionService);
|
||||
const add$ = manualRedactionService.addAnnotation(
|
||||
wrappers.map(w => w.manualRedactionEntry).filter(e => e.positions[0].page <= file.numberOfPages),
|
||||
this.dossierId,
|
||||
this.fileId,
|
||||
);
|
||||
const addAndReload$ = add$.pipe(switchMap(() => this._filesService.reload(this.dossierId, file)));
|
||||
const filesService = this._injector.get(FilesService);
|
||||
const addAndReload$ = add$.pipe(switchMap(() => filesService.reload(this.dossierId, file)));
|
||||
return firstValueFrom(addAndReload$.pipe(catchError(() => of(undefined))));
|
||||
},
|
||||
);
|
||||
@ -382,14 +370,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
this._scrollViews();
|
||||
}
|
||||
|
||||
async downloadOriginalFile(file: File) {
|
||||
const originalFile = this._fileManagementService.downloadOriginalFile(
|
||||
this.dossierId,
|
||||
this.fileId,
|
||||
'response',
|
||||
file.cacheIdentifier,
|
||||
);
|
||||
download(await firstValueFrom(originalFile), file.filename);
|
||||
async downloadOriginalFile({ cacheIdentifier, dossierId, fileId, filename }: File) {
|
||||
const fileManagementService = this._injector.get(FileManagementService);
|
||||
const originalFile = fileManagementService.downloadOriginalFile(dossierId, fileId, 'response', cacheIdentifier);
|
||||
download(await firstValueFrom(originalFile), filename);
|
||||
}
|
||||
|
||||
loadAnnotations() {
|
||||
@ -443,9 +427,9 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
const type = annotation?.typeLabel?.split('.')[1];
|
||||
const typeValue = annotation?.typeValue;
|
||||
if (type === 'hint' && (typeValue === 'ocr' || typeValue === 'formula' || typeValue === 'image')) {
|
||||
return HelpModeKeys[`${type}-${typeValue}`];
|
||||
return ActionsHelpModeKeys[`${type}-${typeValue}`];
|
||||
}
|
||||
return HelpModeKeys[type];
|
||||
return ActionsHelpModeKeys[type];
|
||||
}
|
||||
|
||||
#rebuildFilters() {
|
||||
@ -492,19 +476,23 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
|
||||
const changed = JSON.stringify(oldAnnotation) !== JSON.stringify(newAnnotation);
|
||||
if (changed && this.userPreferenceService.areDevFeaturesEnabled) {
|
||||
import('@iqser/common-ui').then(commonUi => {
|
||||
this._logger.info('[ANNOTATIONS] Changed annotation: ', {
|
||||
value: oldAnnotation.value,
|
||||
before: commonUi.deepDiffObj(newAnnotation, oldAnnotation),
|
||||
after: commonUi.deepDiffObj(oldAnnotation, newAnnotation),
|
||||
});
|
||||
});
|
||||
this.#logDiff(oldAnnotation, newAnnotation);
|
||||
}
|
||||
|
||||
return changed;
|
||||
});
|
||||
}
|
||||
|
||||
#logDiff(oldAnnotation: AnnotationWrapper, newAnnotation: AnnotationWrapper) {
|
||||
import('@iqser/common-ui').then(commonUi => {
|
||||
this._logger.info('[ANNOTATIONS] Changed annotation: ', {
|
||||
value: oldAnnotation.value,
|
||||
before: commonUi.deepDiffObj(newAnnotation, oldAnnotation),
|
||||
after: commonUi.deepDiffObj(oldAnnotation, newAnnotation),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#deactivateMultiSelect() {
|
||||
this.multiSelectService.deactivate();
|
||||
this.pdf.deselectAllAnnotations();
|
||||
@ -539,10 +527,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
.pipe(tap(() => this._handleDeletedFile()))
|
||||
.subscribe();
|
||||
|
||||
this.addActiveScreenSubscription = this._skippedService.hideSkipped$
|
||||
.pipe(tap(hideSkipped => this._handleIgnoreAnnotationsDrawing(hideSkipped)))
|
||||
.subscribe();
|
||||
|
||||
this.addActiveScreenSubscription = combineLatest([this._viewModeService.viewMode$, this.state.file$])
|
||||
.pipe(
|
||||
tap(([viewMode, file]) => {
|
||||
@ -590,7 +574,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
this._handleDeltaAnnotationFilters(currentFilters, this._fileDataService.all);
|
||||
}
|
||||
|
||||
await this._annotationDrawService.drawAnnotations(newAnnotations);
|
||||
await this._annotationDrawService.draw(newAnnotations);
|
||||
this._logger.info(`[ANNOTATIONS] Redraw time: ${new Date().getTime() - startTime} ms for ${newAnnotations.length} annotations`);
|
||||
}
|
||||
|
||||
@ -620,15 +604,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
}
|
||||
}
|
||||
|
||||
private _handleIgnoreAnnotationsDrawing(hideSkipped: boolean): void {
|
||||
const ignored = this.pdf.getAnnotations(a => a.getCustomData('skipped'));
|
||||
if (hideSkipped) {
|
||||
this.pdf.hideAnnotations(ignored);
|
||||
} else {
|
||||
this.pdf.showAnnotations(ignored);
|
||||
}
|
||||
}
|
||||
|
||||
private _setAnnotationsOpacity(annotations: Annotation[], restoreToOriginal: boolean = false) {
|
||||
annotations.forEach(annotation => {
|
||||
annotation['Opacity'] = restoreToOriginal ? parseFloat(annotation.getCustomData('opacity')) : 1;
|
||||
|
||||
@ -437,7 +437,7 @@ export class AnnotationActionsService {
|
||||
annotationWrapper.resizing = false;
|
||||
|
||||
this._pdf.deleteAnnotations([annotationWrapper.id]);
|
||||
await this._annotationDrawService.drawAnnotations([annotationWrapper]);
|
||||
await this._annotationDrawService.draw([annotationWrapper]);
|
||||
this._pdf.annotationManager.deselectAllAnnotations();
|
||||
await this._fileDataService.annotationsChanged();
|
||||
}
|
||||
|
||||
@ -10,13 +10,13 @@ import { IRectangle, ISectionGrid, ISectionRectangle } from '@red/domain';
|
||||
import { SkippedService } from './skipped.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { PdfViewer } from './pdf-viewer.service';
|
||||
import { FilePreviewStateService } from './file-preview-state.service';
|
||||
import { ViewModeService } from './view-mode.service';
|
||||
import { FileDataService } from './file-data.service';
|
||||
import { SuperTypes } from '@models/file/super-types';
|
||||
import Annotation = Core.Annotations.Annotation;
|
||||
import Quad = Core.Math.Quad;
|
||||
|
||||
const DEFAULT_TEXT_ANNOTATION_OPACITY = 1;
|
||||
const DEFAULT_REMOVED_ANNOTATION_OPACITY = 0.2;
|
||||
@ -25,7 +25,6 @@ const DEFAULT_REMOVED_ANNOTATION_OPACITY = 0.2;
|
||||
export class AnnotationDrawService {
|
||||
constructor(
|
||||
private readonly _dictionariesMapService: DictionariesMapService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _redactionLogService: RedactionLogService,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _skippedService: SkippedService,
|
||||
@ -35,9 +34,9 @@ export class AnnotationDrawService {
|
||||
private readonly _fileDataService: FileDataService,
|
||||
) {}
|
||||
|
||||
drawAnnotations(annotationWrappers: readonly AnnotationWrapper[]) {
|
||||
draw(annotations: readonly AnnotationWrapper[]) {
|
||||
const licenseKey = environment.licenseKey ? atob(environment.licenseKey) : null;
|
||||
return this._pdf.PDFNet.runWithCleanup(() => this._drawAnnotations(annotationWrappers), licenseKey);
|
||||
return this._pdf.PDFNet.runWithCleanup(() => this._draw(annotations), licenseKey);
|
||||
}
|
||||
|
||||
getColor(superType: string, dictionary?: string) {
|
||||
@ -85,7 +84,7 @@ export class AnnotationDrawService {
|
||||
return new this._pdf.instance.Core.Math.Quad(x1, y1, x2, y2, x3, y3, x4, y4);
|
||||
}
|
||||
|
||||
private async _drawAnnotations(annotationWrappers: readonly AnnotationWrapper[]) {
|
||||
private async _draw(annotationWrappers: readonly AnnotationWrapper[]) {
|
||||
const annotations = annotationWrappers.map(annotation => this._computeAnnotation(annotation)).filter(a => !!a);
|
||||
this._pdf.annotationManager.addAnnotations(annotations, { imported: true });
|
||||
await this._pdf.annotationManager.drawAnnotationsFromList(annotations);
|
||||
@ -185,12 +184,12 @@ export class AnnotationDrawService {
|
||||
return annotation;
|
||||
}
|
||||
|
||||
private _rectanglesToQuads(positions: IRectangle[], pageNumber: number): any[] {
|
||||
private _rectanglesToQuads(positions: IRectangle[], pageNumber: number): Quad[] {
|
||||
const pageHeight = this._pdf.documentViewer.getPageHeight(pageNumber);
|
||||
return positions.map(p => this._rectangleToQuad(p, pageHeight));
|
||||
}
|
||||
|
||||
private _rectangleToQuad(rectangle: IRectangle, pageHeight: number): any {
|
||||
private _rectangleToQuad(rectangle: IRectangle, pageHeight: number): Quad {
|
||||
const x1 = rectangle.topLeft.x;
|
||||
const y1 = pageHeight - (rectangle.topLeft.y + rectangle.height);
|
||||
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { combineLatest, firstValueFrom, from, merge, Observable, of, pairwise, Subject, switchMap } from 'rxjs';
|
||||
import { Dossier, DOSSIER_ID, File } from '@red/domain';
|
||||
import { Dossier, DOSSIER_ID, File, FILE_ID } 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 { 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';
|
||||
|
||||
@ -1,24 +1,38 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { skip } from 'rxjs/operators';
|
||||
import { skip, tap } from 'rxjs/operators';
|
||||
import { shareDistinctLast } from '@iqser/common-ui';
|
||||
import { PdfViewer } from './pdf-viewer.service';
|
||||
|
||||
@Injectable()
|
||||
export class SkippedService {
|
||||
readonly hideSkipped$: Observable<boolean>;
|
||||
private readonly _hideSkipped$ = new BehaviorSubject(false);
|
||||
readonly #hideSkipped$ = new BehaviorSubject(false);
|
||||
|
||||
constructor() {
|
||||
this.hideSkipped$ = this._hideSkipped$.pipe(shareDistinctLast(), skip(1));
|
||||
constructor(private readonly _pdf: PdfViewer) {
|
||||
this.hideSkipped$ = this.#hideSkipped$.pipe(
|
||||
tap(hideSkipped => this._handleIgnoreAnnotationsDrawing(hideSkipped)),
|
||||
shareDistinctLast(),
|
||||
skip(1),
|
||||
);
|
||||
}
|
||||
|
||||
get hideSkipped(): boolean {
|
||||
return this._hideSkipped$.value;
|
||||
return this.#hideSkipped$.value;
|
||||
}
|
||||
|
||||
toggleSkipped($event): void {
|
||||
$event.stopPropagation();
|
||||
$event.preventDefault();
|
||||
this._hideSkipped$.next(!this.hideSkipped);
|
||||
this.#hideSkipped$.next(!this.hideSkipped);
|
||||
}
|
||||
|
||||
private _handleIgnoreAnnotationsDrawing(hideSkipped: boolean): void {
|
||||
const ignored = this._pdf.getAnnotations(a => a.getCustomData('skipped'));
|
||||
if (hideSkipped) {
|
||||
this._pdf.hideAnnotations(ignored);
|
||||
} else {
|
||||
this._pdf.showAnnotations(ignored);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,19 @@
|
||||
export const ALLOWED_KEYBOARD_SHORTCUTS: readonly string[] = ['+', '-', 'p', 'r', 'Escape'] as const;
|
||||
import { List } from '@iqser/common-ui';
|
||||
|
||||
export const ALL_HOTKEYS = ['Escape', 'F', 'f', 'ArrowUp', 'ArrowDown'];
|
||||
export const ActionsHelpModeKeys = {
|
||||
redaction: 'redaction_text',
|
||||
'manual-redaction': 'redaction_text',
|
||||
recommendation: 'recommendation',
|
||||
skipped: 'skipped',
|
||||
hint: 'hint_text',
|
||||
'hint-ocr': 'hint_picture',
|
||||
'hint-formula': 'picture',
|
||||
'hint-image': 'picture',
|
||||
} as const;
|
||||
|
||||
export const ALLOWED_KEYBOARD_SHORTCUTS: List = ['+', '-', 'p', 'r', 'Escape'] as const;
|
||||
|
||||
export const ALL_HOTKEYS: List = ['Escape', 'F', 'f', 'ArrowUp', 'ArrowDown'] as const;
|
||||
|
||||
export type HeaderElementType =
|
||||
| 'SHAPE_TOOL_GROUP_BUTTON'
|
||||
|
||||
@ -5,8 +5,7 @@ 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, DOSSIER_ID, DOSSIERS_ARCHIVE } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID, FILE_ID } from '@utils/constants';
|
||||
import { BreadcrumbTypes, DOSSIER_ID, DOSSIER_TEMPLATE_ID, DOSSIERS_ARCHIVE, FILE_ID } from '@red/domain';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { dossiersServiceResolver } from '@services/entity-services/dossiers.service.provider';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
@ -34,7 +33,7 @@ export type Breadcrumbs = List<Breadcrumb>;
|
||||
})
|
||||
export class BreadcrumbsService {
|
||||
readonly breadcrumbs$: Observable<Breadcrumbs>;
|
||||
private readonly _store$ = new BehaviorSubject<Breadcrumbs>([]);
|
||||
readonly #store$ = new BehaviorSubject<Breadcrumbs>([]);
|
||||
|
||||
constructor(
|
||||
private readonly _injector: Injector,
|
||||
@ -44,17 +43,17 @@ export class BreadcrumbsService {
|
||||
private readonly _dashboardStatsService: DashboardStatsService,
|
||||
private readonly _featuresService: FeaturesService,
|
||||
) {
|
||||
this.breadcrumbs$ = this._store$.asObservable();
|
||||
this.breadcrumbs$ = this.#store$.asObservable();
|
||||
|
||||
this._router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
|
||||
const root = this._router.routerState.snapshot.root;
|
||||
_router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
|
||||
const root = _router.routerState.snapshot.root;
|
||||
this._clear();
|
||||
this._addBreadcrumbs(root);
|
||||
});
|
||||
}
|
||||
|
||||
get breadcrumbs() {
|
||||
return this._store$.value;
|
||||
return this.#store$.value;
|
||||
}
|
||||
|
||||
private get _dossiersService(): DossiersService {
|
||||
@ -73,11 +72,11 @@ export class BreadcrumbsService {
|
||||
}
|
||||
|
||||
private _append(breadcrumb: Breadcrumb) {
|
||||
this._store$.next([...this._store$.value, breadcrumb]);
|
||||
this.#store$.next([...this.#store$.value, breadcrumb]);
|
||||
}
|
||||
|
||||
private _clear() {
|
||||
this._store$.next([]);
|
||||
this.#store$.next([]);
|
||||
}
|
||||
|
||||
private _addBreadcrumbs(route: ActivatedRouteSnapshot, params: Record<string, string> = {}) {
|
||||
@ -132,7 +131,7 @@ export class BreadcrumbsService {
|
||||
}
|
||||
|
||||
private _dossierTemplateBreadcrumb(params: Record<string, string>): Breadcrumb {
|
||||
const dossierTemplateId: string = params[DOSSIER_TEMPLATE_ID];
|
||||
const dossierTemplateId = params[DOSSIER_TEMPLATE_ID];
|
||||
return {
|
||||
name$: this._dashboardStatsService.getEntityChanged$(dossierTemplateId).pipe(pluck('name')),
|
||||
type: 'text' as BreadcrumbDisplayType,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Dictionary, IDictionary } from '@red/domain';
|
||||
import { Dictionary, DOSSIER_TEMPLATE_ID, IDictionary } from '@red/domain';
|
||||
import { EntitiesMapService } from '@iqser/common-ui';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DictionariesMapService extends EntitiesMapService<Dictionary, IDictionary> {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DonutChartConfig, DossierState, IDossierState } from '@red/domain';
|
||||
import { DonutChartConfig, DOSSIER_TEMPLATE_ID, DossierState, IDossierState } from '@red/domain';
|
||||
import { EntitiesMapService } from '@iqser/common-ui';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { flatMap } from 'lodash-es';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { StatsService } from '@iqser/common-ui';
|
||||
import { DossierTemplateStats, IDossierTemplateStats } from '@red/domain';
|
||||
import { DOSSIER_TEMPLATE_ID } from '@utils/constants';
|
||||
import { DOSSIER_TEMPLATE_ID, DossierTemplateStats, IDossierTemplateStats } from '@red/domain';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
||||
@ -12,19 +12,21 @@ export class PermissionsService {
|
||||
private readonly _featuresService: FeaturesService,
|
||||
) {}
|
||||
|
||||
canEditEntities(user = this._userService.currentUser): boolean {
|
||||
return user.isAdmin;
|
||||
get #userId(): string {
|
||||
return this._userService.currentUser.id;
|
||||
}
|
||||
|
||||
canDeleteEntities(entity: Dictionary | Dictionary[], user = this._userService.currentUser): boolean {
|
||||
canEditEntities(): boolean {
|
||||
return this.isAdmin();
|
||||
}
|
||||
|
||||
canDeleteEntities(entity: Dictionary | Dictionary[]): boolean {
|
||||
const entities = entity instanceof Dictionary ? [entity] : entity;
|
||||
return (
|
||||
entities.length && this.canEditEntities(user) && entities.reduce((acc, _entity) => this._canDeleteEntity(_entity) && acc, true)
|
||||
);
|
||||
return entities.length && this.canEditEntities() && entities.reduce((acc, _entity) => this._canDeleteEntity(_entity) && acc, true);
|
||||
}
|
||||
|
||||
canPerformDossierStatesActions(user = this._userService.currentUser): boolean {
|
||||
return user.isAdmin;
|
||||
canPerformDossierStatesActions(): boolean {
|
||||
return this.isAdmin();
|
||||
}
|
||||
|
||||
isReviewerOrApprover(file: File, dossier: Dossier): boolean {
|
||||
@ -74,7 +76,7 @@ export class PermissionsService {
|
||||
}
|
||||
|
||||
isFileAssignee(file: File): boolean {
|
||||
return file.assignee === this._userService.currentUser.id;
|
||||
return file.assignee === this.#userId;
|
||||
}
|
||||
|
||||
canDeleteFile(file: File | File[], dossier: Dossier): boolean {
|
||||
@ -130,16 +132,16 @@ export class PermissionsService {
|
||||
return files.reduce((acc, _file) => this._canSetUnderApproval(_file, dossier) && acc, true);
|
||||
}
|
||||
|
||||
isOwner(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.ownerId === user.id;
|
||||
isOwner(dossier: IDossier): boolean {
|
||||
return dossier.ownerId === this.#userId;
|
||||
}
|
||||
|
||||
isApprover(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.approverIds.indexOf(user.id) >= 0;
|
||||
isApprover(dossier: Dossier): boolean {
|
||||
return dossier.approverIds.indexOf(this.#userId) >= 0;
|
||||
}
|
||||
|
||||
isDossierMember(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.memberIds.includes(user.id);
|
||||
isDossierMember(dossier: Dossier): boolean {
|
||||
return dossier.memberIds.includes(this.#userId);
|
||||
}
|
||||
|
||||
canPerformAnnotationActions(file: File, dossier: Dossier): boolean {
|
||||
@ -172,53 +174,51 @@ export class PermissionsService {
|
||||
}
|
||||
|
||||
canDeleteDossier(dossier: IDossier): boolean {
|
||||
return dossier.ownerId === this._userService.currentUser.id;
|
||||
return this.isOwner(dossier);
|
||||
}
|
||||
|
||||
canHardDeleteDossier(dossier: IDossier): boolean {
|
||||
return this._userService.currentUser.isManager;
|
||||
return this.isOwner(dossier);
|
||||
}
|
||||
|
||||
canRestoreDossier(dossier: IDossier): boolean {
|
||||
return this._userService.currentUser.isManager;
|
||||
return this.isManager();
|
||||
}
|
||||
|
||||
canArchiveDossier(dossier: Dossier): boolean {
|
||||
return (
|
||||
this._featuresService.isEnabled(DOSSIERS_ARCHIVE) && dossier.isActive && dossier.ownerId === this._userService.currentUser.id
|
||||
);
|
||||
return this._featuresService.isEnabled(DOSSIERS_ARCHIVE) && dossier.isActive && this.isOwner(dossier);
|
||||
}
|
||||
|
||||
canEditDossier(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return user.isManager && !!dossier?.ownerId;
|
||||
canEditDossier(dossier: Dossier): boolean {
|
||||
return this.isManager() && !!dossier?.ownerId;
|
||||
}
|
||||
|
||||
canEditDossierDictionary(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.isActive && this.isDossierMember(dossier, user);
|
||||
canEditDossierDictionary(dossier: Dossier): boolean {
|
||||
return dossier.isActive && this.isDossierMember(dossier);
|
||||
}
|
||||
|
||||
canEditDossierDictionaryDisplayName(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.isActive && this.isOwner(dossier, user);
|
||||
canEditDossierDictionaryDisplayName(dossier: Dossier): boolean {
|
||||
return dossier.isActive && this.isOwner(dossier);
|
||||
}
|
||||
|
||||
canEditDossierDictionaryAddAction(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.isActive && this.isOwner(dossier, user);
|
||||
canEditDossierDictionaryAddAction(dossier: Dossier): boolean {
|
||||
return dossier.isActive && this.isOwner(dossier);
|
||||
}
|
||||
|
||||
canEditDossierAttributes(dossier: Dossier, user = this._userService.currentUser): boolean {
|
||||
return dossier.isActive && this.isOwner(dossier, user);
|
||||
canEditDossierAttributes(dossier: Dossier): boolean {
|
||||
return dossier.isActive && this.isOwner(dossier);
|
||||
}
|
||||
|
||||
canEditTeamMembers(): boolean {
|
||||
return this.isManager();
|
||||
}
|
||||
|
||||
isAdmin(user = this._userService.currentUser): boolean {
|
||||
return user.isAdmin;
|
||||
isAdmin(): boolean {
|
||||
return this._userService.currentUser.isAdmin;
|
||||
}
|
||||
|
||||
isManager(user = this._userService.currentUser): boolean {
|
||||
return user.isManager;
|
||||
isManager(): boolean {
|
||||
return this._userService.currentUser.isManager;
|
||||
}
|
||||
|
||||
canAddComment(file: File, dossier: Dossier): boolean {
|
||||
@ -230,7 +230,7 @@ export class PermissionsService {
|
||||
}
|
||||
|
||||
canDeleteComment(comment: IComment, file: File, dossier: Dossier) {
|
||||
return (comment.user === this._userService.currentUser.id || this.isApprover(dossier)) && !file.isApproved;
|
||||
return (comment.user === this.#userId || this.isApprover(dossier)) && !file.isApproved;
|
||||
}
|
||||
|
||||
canImportRedactions(file: File, dossier: Dossier) {
|
||||
@ -265,18 +265,11 @@ export class PermissionsService {
|
||||
}
|
||||
|
||||
private _canEnableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
||||
return (
|
||||
dossier.isActive && file.excludedFromAutomaticAnalysis && file.assignee === this._userService.currentUser.id && !file.isApproved
|
||||
);
|
||||
return dossier.isActive && file.excludedFromAutomaticAnalysis && this.isFileAssignee(file) && !file.isApproved;
|
||||
}
|
||||
|
||||
private _canDisableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
||||
return (
|
||||
dossier.isActive &&
|
||||
!file.excludedFromAutomaticAnalysis &&
|
||||
file.assignee === this._userService.currentUser.id &&
|
||||
!file.isApproved
|
||||
);
|
||||
return dossier.isActive && !file.excludedFromAutomaticAnalysis && this.isFileAssignee(file) && !file.isApproved;
|
||||
}
|
||||
|
||||
private _canAssignToSelf(file: File, dossier: Dossier): boolean {
|
||||
|
||||
@ -1,5 +1,2 @@
|
||||
export const CHANGED_CHECK_INTERVAL = 5000;
|
||||
export const FALLBACK_COLOR = '#CCCCCC';
|
||||
export const FILE_ID = 'fileId';
|
||||
export const DOSSIER_TEMPLATE_ID = 'dossierTemplateId';
|
||||
export const ENTITY_TYPE = 'entity';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"ADMIN_CONTACT_NAME": null,
|
||||
"ADMIN_CONTACT_URL": null,
|
||||
"API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1",
|
||||
"API_URL": "https://dev-05.iqser.cloud/redaction-gateway-v1",
|
||||
"APP_NAME": "RedactManager",
|
||||
"AUTO_READ_TIME": 3,
|
||||
"BACKEND_APP_VERSION": "4.4.40",
|
||||
@ -17,7 +17,7 @@
|
||||
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
||||
"OAUTH_CLIENT_ID": "redaction",
|
||||
"OAUTH_IDP_HINT": null,
|
||||
"OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction",
|
||||
"OAUTH_URL": "https://dev-05.iqser.cloud/auth/realms/redaction",
|
||||
"RECENT_PERIOD_IN_HOURS": 24,
|
||||
"SELECTION_MODE": "structural",
|
||||
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview"
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
{
|
||||
"bulk_select_annotations": {
|
||||
"en": "/en/index-en.html?contextId=bulk_select_annotations",
|
||||
"de": "",
|
||||
"it": "",
|
||||
"fr": ""
|
||||
},
|
||||
"document_features_in_dossier": {
|
||||
"en": "/en/index-en.html?contextId=document_features_in_dossier",
|
||||
"de": "",
|
||||
@ -71,8 +65,8 @@
|
||||
"it": "",
|
||||
"fr": ""
|
||||
},
|
||||
"view": {
|
||||
"en": "/en/index-en.html?contextId=view",
|
||||
"views": {
|
||||
"en": "/en/index-en.html?contextId=views",
|
||||
"de": "",
|
||||
"it": "",
|
||||
"fr": ""
|
||||
@ -89,12 +83,6 @@
|
||||
"it": "",
|
||||
"fr": ""
|
||||
},
|
||||
"workload_filter": {
|
||||
"en": "/en/index-en.html?contextId=workload_filter",
|
||||
"de": "",
|
||||
"it": "",
|
||||
"fr": ""
|
||||
},
|
||||
"dossiers_quickfilter_my_dossiers": {
|
||||
"en": "/en/index-en.html?contextId=dossiers_quickfilter_my_dossiers",
|
||||
"de": "",
|
||||
@ -263,8 +251,8 @@
|
||||
"it": "",
|
||||
"fr": ""
|
||||
},
|
||||
"image": {
|
||||
"en": "/en/index-en.html?contextId=image",
|
||||
"workload_in_editor": {
|
||||
"en": "/en/index-en.html?contextId=workload_in_editor",
|
||||
"de": "",
|
||||
"it": "",
|
||||
"fr": ""
|
||||
|
||||
@ -5,3 +5,6 @@ export const DossierTemplateStatuses = {
|
||||
} as const;
|
||||
|
||||
export type DossierTemplateStatus = keyof typeof DossierTemplateStatuses;
|
||||
|
||||
export const DOSSIER_TEMPLATE_ID = 'dossierTemplateId';
|
||||
export const ENTITY_TYPE = 'entity';
|
||||
@ -1,7 +1,7 @@
|
||||
import { IListable, List } from '@iqser/common-ui';
|
||||
import { IDossierTemplate } from './dossier-template';
|
||||
import { DownloadFileType } from '../shared';
|
||||
import { DossierTemplateStatus, DossierTemplateStatuses } from './types';
|
||||
import { DossierTemplateStatus, DossierTemplateStatuses } from './constants';
|
||||
|
||||
export class DossierTemplate implements IDossierTemplate, IListable {
|
||||
readonly createdBy: string;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { List } from '@iqser/common-ui';
|
||||
import { DownloadFileType } from '../shared';
|
||||
import { DossierTemplateStatus } from './types';
|
||||
import { DossierTemplateStatus } from './constants';
|
||||
|
||||
export interface IDossierTemplate {
|
||||
/**
|
||||
|
||||
@ -4,4 +4,4 @@ export * from './dossier-template-stats';
|
||||
export * from './dossier-template-stats.model';
|
||||
export * from './dashboard-stats';
|
||||
export * from './dashboard-stats.model';
|
||||
export * from './types';
|
||||
export * from './constants';
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import { List } from '@iqser/common-ui';
|
||||
|
||||
export const FILE_ID = 'fileId';
|
||||
|
||||
export const WorkflowFileStatuses = {
|
||||
APPROVED: 'APPROVED',
|
||||
NEW: 'NEW',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "redaction",
|
||||
"version": "3.468.0",
|
||||
"version": "3.472.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user