wip env for rule editor
This commit is contained in:
parent
4aa8f90df9
commit
217d8a0d7a
@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="userPreferenceService.areDevFeaturesEnabled" class="dev-mode" translate="dev-mode"></div>
|
<div *ngIf="userPreferenceService.isIqserDevMode" class="dev-mode" translate="dev-mode"></div>
|
||||||
|
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';
|
||||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { BaseFormComponent, getConfig, IqserPermissionsService, LanguageService, LoadingService, Toaster } from '@iqser/common-ui';
|
import { BaseFormComponent, getConfig, IqserPermissionsService, LanguageService, LoadingService, Toaster } from '@iqser/common-ui';
|
||||||
|
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { AppConfig, IProfile } from '@red/domain';
|
import { AppConfig, IProfile } from '@red/domain';
|
||||||
import { languagesTranslations } from '@translations/languages-translations';
|
import { languagesTranslations } from '@translations/languages-translations';
|
||||||
|
import { Roles } from '@users/roles';
|
||||||
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
import { UserService } from '@users/user.service';
|
import { UserService } from '@users/user.service';
|
||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
|
||||||
import { Roles } from '@users/roles';
|
|
||||||
import { UserProfileDialogService } from '../services/user-profile-dialog.service';
|
import { UserProfileDialogService } from '../services/user-profile-dialog.service';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './user-profile-screen.component.html',
|
templateUrl: './user-profile-screen.component.html',
|
||||||
@ -21,7 +21,7 @@ import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|||||||
export class UserProfileScreenComponent extends BaseFormComponent implements OnInit {
|
export class UserProfileScreenComponent extends BaseFormComponent implements OnInit {
|
||||||
#profileModel: IProfile;
|
#profileModel: IProfile;
|
||||||
readonly translations = languagesTranslations;
|
readonly translations = languagesTranslations;
|
||||||
readonly devMode = this._userPreferenceService.areDevFeaturesEnabled;
|
readonly devMode = this._userPreferenceService.isIqserDevMode;
|
||||||
readonly changePasswordUrl: string;
|
readonly changePasswordUrl: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<iqser-icon-button
|
<iqser-icon-button
|
||||||
(action)="openAddDossierTemplateDialog()"
|
(action)="openAddDossierTemplateDialog()"
|
||||||
*allow="roles.templates.write; if: currentUser.isAdmin && userPreferenceService.areDevFeaturesEnabled"
|
*allow="roles.templates.write; if: currentUser.isAdmin && userPreferenceService.isIqserDevMode"
|
||||||
[icon]="'iqser:plus'"
|
[icon]="'iqser:plus'"
|
||||||
[label]="'dossier-templates-listing.add-new' | translate"
|
[label]="'dossier-templates-listing.add-new' | translate"
|
||||||
[type]="iconButtonTypes.primary"
|
[type]="iconButtonTypes.primary"
|
||||||
|
|||||||
@ -2,15 +2,14 @@ import { NgForOf, NgIf } from '@angular/common';
|
|||||||
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, RouterLink, RouterLinkActive } from '@angular/router';
|
import { ActivatedRoute, RouterLink, RouterLinkActive } from '@angular/router';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { getConfig, IqserHelpModeModule, IqserPermissionsService } from '@iqser/common-ui';
|
import { getConfig, IqserHelpModeModule, IqserPermissionsService, isIqserDevMode } from '@iqser/common-ui';
|
||||||
import { SideNavComponent } from '@iqser/common-ui/lib/shared';
|
import { SideNavComponent } from '@iqser/common-ui/lib/shared';
|
||||||
import { TenantPipe } from '@iqser/common-ui/lib/tenants';
|
import { TenantPipe } from '@iqser/common-ui/lib/tenants';
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { AdminSideNavType, AdminSideNavTypes, DOSSIER_TEMPLATE_ID, ENTITY_TYPE, User, WATERMARK_ID } from '@red/domain';
|
import { AdminSideNavType, AdminSideNavTypes, AppConfig, DOSSIER_TEMPLATE_ID, ENTITY_TYPE, User, WATERMARK_ID } from '@red/domain';
|
||||||
import { adminSideNavTranslations } from '@translations/admin-side-nav-translations';
|
import { adminSideNavTranslations } from '@translations/admin-side-nav-translations';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
|
||||||
|
|
||||||
interface NavItem {
|
interface NavItem {
|
||||||
readonly label: string;
|
readonly label: string;
|
||||||
@ -27,12 +26,15 @@ interface NavItem {
|
|||||||
imports: [TranslateModule, NgIf, IqserHelpModeModule, RouterLink, RouterLinkActive, NgForOf, SideNavComponent, TenantPipe],
|
imports: [TranslateModule, NgIf, IqserHelpModeModule, RouterLink, RouterLinkActive, NgForOf, SideNavComponent, TenantPipe],
|
||||||
})
|
})
|
||||||
export class AdminSideNavComponent implements OnInit {
|
export class AdminSideNavComponent implements OnInit {
|
||||||
|
readonly #config = getConfig<AppConfig>();
|
||||||
|
readonly isIqserDevMode = isIqserDevMode();
|
||||||
@Input() type: AdminSideNavType;
|
@Input() type: AdminSideNavType;
|
||||||
@Input() disabledItems: string[] = [];
|
@Input() disabledItems: string[] = [];
|
||||||
readonly translations = adminSideNavTranslations;
|
readonly translations = adminSideNavTranslations;
|
||||||
readonly currentUser = getCurrentUser<User>();
|
readonly currentUser = getCurrentUser<User>();
|
||||||
readonly roles = Roles;
|
readonly roles = Roles;
|
||||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
readonly isDocumine = this.#config.IS_DOCUMINE;
|
||||||
|
readonly canAccessRulesInDocumine = this.isDocumine && !this.#config.RULE_EDITOR_DEV_ONLY;
|
||||||
prefix: string;
|
prefix: string;
|
||||||
|
|
||||||
readonly items: { readonly [key in AdminSideNavType]: NavItem[] } = {
|
readonly items: { readonly [key in AdminSideNavType]: NavItem[] } = {
|
||||||
@ -96,8 +98,7 @@ export class AdminSideNavComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
screen: 'rules',
|
screen: 'rules',
|
||||||
label: _('admin-side-nav.rule-editor'),
|
label: _('admin-side-nav.rule-editor'),
|
||||||
show:
|
show: (this.isIqserDevMode || this.canAccessRulesInDocumine) && this._permissionsService.has(Roles.rules.read),
|
||||||
(this.userPreferenceService.areDevFeaturesEnabled || this.isDocumine) && this._permissionsService.has(Roles.rules.read),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: 'default-colors',
|
screen: 'default-colors',
|
||||||
@ -169,11 +170,7 @@ export class AdminSideNavComponent implements OnInit {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(
|
constructor(private readonly _permissionsService: IqserPermissionsService, private readonly _route: ActivatedRoute) {}
|
||||||
private readonly _permissionsService: IqserPermissionsService,
|
|
||||||
private readonly _route: ActivatedRoute,
|
|
||||||
readonly userPreferenceService: UserPreferenceService,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
@HostBinding('class.smaller') get isSmaller(): boolean {
|
@HostBinding('class.smaller') get isSmaller(): boolean {
|
||||||
return [AdminSideNavTypes.dossierTemplates, AdminSideNavTypes.entities].includes(this.type);
|
return [AdminSideNavTypes.dossierTemplates, AdminSideNavTypes.entities].includes(this.type);
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { Component, Input, OnChanges } from '@angular/core';
|
import { Component, Input, OnChanges } from '@angular/core';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
|
||||||
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses } from '@red/domain';
|
|
||||||
import { CircleButtonType, CircleButtonTypes } from '@iqser/common-ui';
|
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
|
import { CircleButtonType, CircleButtonTypes } from '@iqser/common-ui';
|
||||||
|
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses } from '@red/domain';
|
||||||
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
import { BulkActionsService } from '../../services/bulk-actions.service';
|
|
||||||
import { ConfigService } from '../../config.service';
|
import { ConfigService } from '../../config.service';
|
||||||
|
import { BulkActionsService } from '../../services/bulk-actions.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-dossier-overview-bulk-actions [dossier] [selectedFiles]',
|
selector: 'redaction-dossier-overview-bulk-actions [dossier] [selectedFiles]',
|
||||||
@ -14,12 +14,6 @@ import { ConfigService } from '../../config.service';
|
|||||||
styleUrls: ['./dossier-overview-bulk-actions.component.scss'],
|
styleUrls: ['./dossier-overview-bulk-actions.component.scss'],
|
||||||
})
|
})
|
||||||
export class DossierOverviewBulkActionsComponent implements OnChanges {
|
export class DossierOverviewBulkActionsComponent implements OnChanges {
|
||||||
@Input() dossier: Dossier;
|
|
||||||
@Input() selectedFiles: File[];
|
|
||||||
@Input() buttonType: CircleButtonType = CircleButtonTypes.dark;
|
|
||||||
@Input() maxWidth: number;
|
|
||||||
buttons: Action[];
|
|
||||||
|
|
||||||
#analysisForced: boolean;
|
#analysisForced: boolean;
|
||||||
#canAssignToSelf: boolean;
|
#canAssignToSelf: boolean;
|
||||||
#canAssign: boolean;
|
#canAssign: boolean;
|
||||||
@ -39,6 +33,11 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
|
|||||||
#toggleAnalysisTooltip: string;
|
#toggleAnalysisTooltip: string;
|
||||||
#allFilesAreExcluded: boolean;
|
#allFilesAreExcluded: boolean;
|
||||||
#canMoveToSameState: boolean;
|
#canMoveToSameState: boolean;
|
||||||
|
@Input() dossier: Dossier;
|
||||||
|
@Input() selectedFiles: File[];
|
||||||
|
@Input() buttonType: CircleButtonType = CircleButtonTypes.dark;
|
||||||
|
@Input() maxWidth: number;
|
||||||
|
buttons: Action[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _permissionsService: PermissionsService,
|
private readonly _permissionsService: PermissionsService,
|
||||||
@ -171,7 +170,7 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forceReanalysisAction($event: LongPressEvent) {
|
forceReanalysisAction($event: LongPressEvent) {
|
||||||
this.#analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled;
|
this.#analysisForced = !$event.touchEnd && this._userPreferenceService.isIqserDevMode;
|
||||||
this._setup();
|
this._setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
import { ChangeDetectorRef, Component, computed, ElementRef, EventEmitter, Input, OnChanges, Output } from '@angular/core';
|
import { ChangeDetectorRef, Component, computed, ElementRef, EventEmitter, Input, OnChanges, Output } from '@angular/core';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
|
||||||
import { HasScrollbarDirective } from '@iqser/common-ui';
|
import { HasScrollbarDirective } from '@iqser/common-ui';
|
||||||
import { MultiSelectService } from '../../services/multi-select.service';
|
|
||||||
import { AnnotationReferencesService } from '../../services/annotation-references.service';
|
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
|
||||||
import { ViewModeService } from '../../services/view-mode.service';
|
|
||||||
import { EarmarkGroup } from '@red/domain';
|
|
||||||
import { REDAnnotationManager } from '../../../pdf-viewer/services/annotation-manager.service';
|
|
||||||
import { AnnotationsListingService } from '../../services/annotations-listing.service';
|
|
||||||
import { ListItem } from '@models/file/list-item';
|
|
||||||
import { FilterService } from '@iqser/common-ui/lib/filtering';
|
import { FilterService } from '@iqser/common-ui/lib/filtering';
|
||||||
import { IqserEventTarget } from '@iqser/common-ui/lib/utils';
|
import { IqserEventTarget } from '@iqser/common-ui/lib/utils';
|
||||||
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
|
import { ListItem } from '@models/file/list-item';
|
||||||
|
import { EarmarkGroup } from '@red/domain';
|
||||||
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
|
import { REDAnnotationManager } from '../../../pdf-viewer/services/annotation-manager.service';
|
||||||
|
import { AnnotationReferencesService } from '../../services/annotation-references.service';
|
||||||
|
import { AnnotationsListingService } from '../../services/annotations-listing.service';
|
||||||
|
import { MultiSelectService } from '../../services/multi-select.service';
|
||||||
|
import { ViewModeService } from '../../services/view-mode.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-annotations-list',
|
selector: 'redaction-annotations-list',
|
||||||
@ -42,7 +42,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective implements O
|
|||||||
}
|
}
|
||||||
|
|
||||||
annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void {
|
annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void {
|
||||||
if (this._userPreferenceService.areDevFeaturesEnabled) {
|
if (this._userPreferenceService.isIqserDevMode) {
|
||||||
console.log('Selected Annotation:', annotation);
|
console.log('Selected Annotation:', annotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +1,29 @@
|
|||||||
import { ChangeDetectorRef, Component, computed, effect, ElementRef, HostListener, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import { ChangeDetectorRef, Component, computed, effect, ElementRef, HostListener, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
|
||||||
import { AnnotationProcessingService } from '../../services/annotation-processing.service';
|
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
||||||
import { CircleButtonTypes, getConfig, IconButtonTypes } from '@iqser/common-ui';
|
|
||||||
import { combineLatest, delay, Observable } from 'rxjs';
|
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { ExcludedPagesService } from '../../services/excluded-pages.service';
|
|
||||||
import { MultiSelectService } from '../../services/multi-select.service';
|
|
||||||
import { DocumentInfoService } from '../../services/document-info.service';
|
|
||||||
import { SkippedService } from '../../services/skipped.service';
|
|
||||||
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
|
||||||
import { ViewModeService } from '../../services/view-mode.service';
|
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { FileDataService } from '../../services/file-data.service';
|
import { CircleButtonTypes, getConfig, IconButtonTypes } from '@iqser/common-ui';
|
||||||
import { PdfViewer } from '../../../pdf-viewer/services/pdf-viewer.service';
|
|
||||||
import { REDAnnotationManager } from '../../../pdf-viewer/services/annotation-manager.service';
|
|
||||||
import { AnnotationsListingService } from '../../services/annotations-listing.service';
|
|
||||||
import { REDDocumentViewer } from '../../../pdf-viewer/services/document-viewer.service';
|
|
||||||
import { ListItem } from '@models/file/list-item';
|
|
||||||
import { PageRotationService } from '../../../pdf-viewer/services/page-rotation.service';
|
|
||||||
import { getLocalStorageDataByFileId } from '@utils/local-storage';
|
|
||||||
import { FilterService, INestedFilter } from '@iqser/common-ui/lib/filtering';
|
import { FilterService, INestedFilter } from '@iqser/common-ui/lib/filtering';
|
||||||
import { AutoUnsubscribe, bool, Debounce, IqserEventTarget } from '@iqser/common-ui/lib/utils';
|
import { AutoUnsubscribe, bool, Debounce, IqserEventTarget } from '@iqser/common-ui/lib/utils';
|
||||||
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
|
import { ListItem } from '@models/file/list-item';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
|
import { getLocalStorageDataByFileId } from '@utils/local-storage';
|
||||||
|
import { combineLatest, delay, Observable } from 'rxjs';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
||||||
|
import { REDAnnotationManager } from '../../../pdf-viewer/services/annotation-manager.service';
|
||||||
|
import { REDDocumentViewer } from '../../../pdf-viewer/services/document-viewer.service';
|
||||||
|
import { PageRotationService } from '../../../pdf-viewer/services/page-rotation.service';
|
||||||
|
import { PdfViewer } from '../../../pdf-viewer/services/pdf-viewer.service';
|
||||||
|
import { AnnotationProcessingService } from '../../services/annotation-processing.service';
|
||||||
|
import { AnnotationsListingService } from '../../services/annotations-listing.service';
|
||||||
|
import { DocumentInfoService } from '../../services/document-info.service';
|
||||||
|
import { ExcludedPagesService } from '../../services/excluded-pages.service';
|
||||||
|
import { FileDataService } from '../../services/file-data.service';
|
||||||
|
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
||||||
|
import { MultiSelectService } from '../../services/multi-select.service';
|
||||||
|
import { SkippedService } from '../../services/skipped.service';
|
||||||
|
import { ViewModeService } from '../../services/view-mode.service';
|
||||||
|
|
||||||
const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape'];
|
const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape'];
|
||||||
const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
||||||
@ -36,6 +36,8 @@ const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
|||||||
export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, OnDestroy {
|
export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, OnDestroy {
|
||||||
@ViewChild('annotationsElement') private readonly _annotationsElement: ElementRef;
|
@ViewChild('annotationsElement') private readonly _annotationsElement: ElementRef;
|
||||||
@ViewChild('quickNavigation') private readonly _quickNavigationElement: ElementRef;
|
@ViewChild('quickNavigation') private readonly _quickNavigationElement: ElementRef;
|
||||||
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
|
readonly #devMode = this._userPreferenceService.isIqserDevMode;
|
||||||
readonly iconButtonTypes = IconButtonTypes;
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
readonly circleButtonTypes = CircleButtonTypes;
|
readonly circleButtonTypes = CircleButtonTypes;
|
||||||
displayedAnnotations = new Map<number, AnnotationWrapper[]>();
|
displayedAnnotations = new Map<number, AnnotationWrapper[]>();
|
||||||
@ -46,8 +48,6 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On
|
|||||||
this.viewModeService.isEarmarks() ? _('file-preview.tabs.highlights.label') : _('file-preview.tabs.annotations.label'),
|
this.viewModeService.isEarmarks() ? _('file-preview.tabs.highlights.label') : _('file-preview.tabs.annotations.label'),
|
||||||
);
|
);
|
||||||
readonly currentPageIsExcluded = computed(() => this.state.file().excludedPages.includes(this.pdf.currentPage()));
|
readonly currentPageIsExcluded = computed(() => this.state.file().excludedPages.includes(this.pdf.currentPage()));
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
|
||||||
readonly #devMode = this._userPreferenceService.areDevFeaturesEnabled;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly filterService: FilterService,
|
readonly filterService: FilterService,
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
<iqser-icon-button
|
<iqser-icon-button
|
||||||
(action)="exportAllInDossier()"
|
(action)="exportAllInDossier()"
|
||||||
*ngIf="userPreferences.areDevFeaturesEnabled"
|
*ngIf="userPreferences.isIqserDevMode"
|
||||||
[type]="iconButtonTypes.primary"
|
[type]="iconButtonTypes.primary"
|
||||||
label="Export All"
|
label="Export All"
|
||||||
></iqser-icon-button>
|
></iqser-icon-button>
|
||||||
|
|||||||
@ -58,7 +58,7 @@
|
|||||||
<!-- Dev Mode Features-->
|
<!-- Dev Mode Features-->
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="downloadOriginalFile(file)"
|
(action)="downloadOriginalFile(file)"
|
||||||
*ngIf="userPreferenceService.areDevFeaturesEnabled"
|
*ngIf="userPreferenceService.isIqserDevMode"
|
||||||
[tooltip]="'file-preview.download-original-file' | translate"
|
[tooltip]="'file-preview.download-original-file' | translate"
|
||||||
[type]="circleButtonTypes.primary"
|
[type]="circleButtonTypes.primary"
|
||||||
class="ml-8"
|
class="ml-8"
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
|
||||||
import { SuperTypeSorter } from '../../../utils';
|
|
||||||
import { Filter, handleCheckedValue, IFilter, INestedFilter, NestedFilter } from '@iqser/common-ui/lib/filtering';
|
|
||||||
import { annotationTypesTranslations } from '@translations/annotation-types-translations';
|
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
|
import { getConfig } from '@iqser/common-ui';
|
||||||
|
import { Filter, handleCheckedValue, IFilter, INestedFilter, NestedFilter } from '@iqser/common-ui/lib/filtering';
|
||||||
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
import { annotationDefaultColorConfig } from '@red/domain';
|
import { annotationDefaultColorConfig } from '@red/domain';
|
||||||
import { FilePreviewStateService } from './file-preview-state.service';
|
|
||||||
import { DefaultColorsService } from '@services/entity-services/default-colors.service';
|
import { DefaultColorsService } from '@services/entity-services/default-colors.service';
|
||||||
import { of } from 'rxjs';
|
|
||||||
import { ViewedPagesMapService } from '@services/files/viewed-pages-map.service';
|
import { ViewedPagesMapService } from '@services/files/viewed-pages-map.service';
|
||||||
import { FileDataService } from './file-data.service';
|
import { annotationTypesTranslations } from '@translations/annotation-types-translations';
|
||||||
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
|
import { of } from 'rxjs';
|
||||||
|
import { SuperTypeSorter } from '../../../utils';
|
||||||
import { PageRotationService } from '../../pdf-viewer/services/page-rotation.service';
|
import { PageRotationService } from '../../pdf-viewer/services/page-rotation.service';
|
||||||
import {
|
import {
|
||||||
sortBottomLeftToTopRight,
|
sortBottomLeftToTopRight,
|
||||||
@ -17,13 +17,14 @@ import {
|
|||||||
sortTopLeftToBottomRight,
|
sortTopLeftToBottomRight,
|
||||||
sortTopRightToBottomLeft,
|
sortTopRightToBottomLeft,
|
||||||
} from '../utils/sort-by-page-rotation.utils';
|
} from '../utils/sort-by-page-rotation.utils';
|
||||||
import { getConfig } from '@iqser/common-ui';
|
import { FileDataService } from './file-data.service';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
import { FilePreviewStateService } from './file-preview-state.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AnnotationProcessingService {
|
export class AnnotationProcessingService {
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
readonly #devMode = this._userPreferenceService.areDevFeaturesEnabled;
|
readonly #devMode = this._userPreferenceService.isIqserDevMode;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _viewedPagesMapService: ViewedPagesMapService,
|
private readonly _viewedPagesMapService: ViewedPagesMapService,
|
||||||
private readonly _fileDataService: FileDataService,
|
private readonly _fileDataService: FileDataService,
|
||||||
|
|||||||
@ -136,7 +136,7 @@ export class FileDataService extends EntitiesService<AnnotationWrapper, Annotati
|
|||||||
this._logger.info('[REDACTION_LOG] Redaction log loaded', redactionLog);
|
this._logger.info('[REDACTION_LOG] Redaction log loaded', redactionLog);
|
||||||
let annotations = await this.#convertData(redactionLog);
|
let annotations = await this.#convertData(redactionLog);
|
||||||
this.#checkMissingTypes();
|
this.#checkMissingTypes();
|
||||||
annotations = this._userPreferenceService.areDevFeaturesEnabled ? annotations : annotations.filter(a => !a.isFalsePositive);
|
annotations = this._userPreferenceService.isIqserDevMode ? annotations : annotations.filter(a => !a.isFalsePositive);
|
||||||
this.#annotations.set(annotations);
|
this.#annotations.set(annotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,43 +1,43 @@
|
|||||||
import { computed, effect, inject, Injectable, NgZone } from '@angular/core';
|
import { computed, effect, inject, Injectable, NgZone } from '@angular/core';
|
||||||
import { IHeaderElement, IManualRedactionEntry, User } from '@red/domain';
|
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
import { Core } from '@pdftron/webviewer';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { BASE_HREF_FN, isJustOne, shareDistinctLast } from '@iqser/common-ui/lib/utils';
|
||||||
import {
|
import {
|
||||||
ManualRedactionEntryType,
|
ManualRedactionEntryType,
|
||||||
ManualRedactionEntryTypes,
|
ManualRedactionEntryTypes,
|
||||||
ManualRedactionEntryWrapper,
|
ManualRedactionEntryWrapper,
|
||||||
} from '@models/file/manual-redaction-entry.wrapper';
|
} from '@models/file/manual-redaction-entry.wrapper';
|
||||||
import { AnnotationDrawService } from '../../pdf-viewer/services/annotation-draw.service';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { Core } from '@pdftron/webviewer';
|
||||||
|
import { IHeaderElement, IManualRedactionEntry, User } from '@red/domain';
|
||||||
|
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||||
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
|
import { Roles } from '@users/roles';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
import { toPosition } from '../utils/pdf-calculation.utils';
|
import { Subject } from 'rxjs';
|
||||||
import { MultiSelectService } from './multi-select.service';
|
|
||||||
import { FilePreviewStateService } from './file-preview-state.service';
|
|
||||||
import { map, tap } from 'rxjs/operators';
|
import { map, tap } from 'rxjs/operators';
|
||||||
import { HeaderElements, HeaderElementType, TextPopups } from '../utils/constants';
|
import { AnnotationDrawService } from '../../pdf-viewer/services/annotation-draw.service';
|
||||||
import { FileDataService } from './file-data.service';
|
|
||||||
import { ViewerHeaderService } from '../../pdf-viewer/services/viewer-header.service';
|
|
||||||
import { ManualRedactionService } from './manual-redaction.service';
|
|
||||||
import { PdfViewer } from '../../pdf-viewer/services/pdf-viewer.service';
|
|
||||||
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
||||||
|
import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service';
|
||||||
|
import { PdfViewer } from '../../pdf-viewer/services/pdf-viewer.service';
|
||||||
|
import { ViewerHeaderService } from '../../pdf-viewer/services/viewer-header.service';
|
||||||
import {
|
import {
|
||||||
ALLOWED_ACTIONS_WHEN_PAGE_EXCLUDED,
|
ALLOWED_ACTIONS_WHEN_PAGE_EXCLUDED,
|
||||||
AnnotationToolNames,
|
AnnotationToolNames,
|
||||||
HEADER_ITEMS_TO_TOGGLE,
|
HEADER_ITEMS_TO_TOGGLE,
|
||||||
TEXT_POPUPS_TO_TOGGLE,
|
TEXT_POPUPS_TO_TOGGLE,
|
||||||
} from '../../pdf-viewer/utils/constants';
|
} from '../../pdf-viewer/utils/constants';
|
||||||
import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service';
|
import { HeaderElements, HeaderElementType, TextPopups } from '../utils/constants';
|
||||||
import { Subject } from 'rxjs';
|
import { toPosition } from '../utils/pdf-calculation.utils';
|
||||||
import { ViewModeService } from './view-mode.service';
|
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
|
||||||
import { AnnotationsListingService } from './annotations-listing.service';
|
|
||||||
import { PdfAnnotationActionsService } from './pdf-annotation-actions.service';
|
|
||||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
|
||||||
import { Roles } from '@users/roles';
|
|
||||||
import { AnnotationActionsService } from './annotation-actions.service';
|
import { AnnotationActionsService } from './annotation-actions.service';
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { AnnotationsListingService } from './annotations-listing.service';
|
||||||
import { BASE_HREF_FN, isJustOne, shareDistinctLast } from '@iqser/common-ui/lib/utils';
|
import { FileDataService } from './file-data.service';
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { FilePreviewStateService } from './file-preview-state.service';
|
||||||
|
import { ManualRedactionService } from './manual-redaction.service';
|
||||||
|
import { MultiSelectService } from './multi-select.service';
|
||||||
|
import { PdfAnnotationActionsService } from './pdf-annotation-actions.service';
|
||||||
|
import { ViewModeService } from './view-mode.service';
|
||||||
import Annotation = Core.Annotations.Annotation;
|
import Annotation = Core.Annotations.Annotation;
|
||||||
import Quad = Core.Math.Quad;
|
import Quad = Core.Math.Quad;
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ export class PdfProxyService {
|
|||||||
|
|
||||||
const popups: IHeaderElement[] = [];
|
const popups: IHeaderElement[] = [];
|
||||||
// Adding directly to the false-positive dict is only available in dev-mode
|
// Adding directly to the false-positive dict is only available in dev-mode
|
||||||
if (this._userPreferenceService.areDevFeaturesEnabled) {
|
if (this._userPreferenceService.isIqserDevMode) {
|
||||||
popups.push({
|
popups.push({
|
||||||
type: 'actionButton',
|
type: 'actionButton',
|
||||||
dataElement: TextPopups.ADD_FALSE_POSITIVE,
|
dataElement: TextPopups.ADD_FALSE_POSITIVE,
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import { Component, Input, OnChanges } from '@angular/core';
|
import { Component, Input, OnChanges } from '@angular/core';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
|
||||||
import { CircleButtonTypes, IqserPermissionsService, ScrollableParentViews } from '@iqser/common-ui';
|
import { CircleButtonTypes, IqserPermissionsService, ScrollableParentViews } from '@iqser/common-ui';
|
||||||
import type { Dossier, File, User } from '@red/domain';
|
|
||||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
|
||||||
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
|
||||||
import { FilesMapService } from '@services/files/files-map.service';
|
|
||||||
import { ReanalysisService } from '@services/reanalysis.service';
|
|
||||||
import { Roles } from '@users/roles';
|
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
|
import type { Dossier, File, User } from '@red/domain';
|
||||||
|
import { FilesMapService } from '@services/files/files-map.service';
|
||||||
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
|
import { ReanalysisService } from '@services/reanalysis.service';
|
||||||
|
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
||||||
|
import { Roles } from '@users/roles';
|
||||||
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
|
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-dossiers-listing-actions [dossier]',
|
selector: 'redaction-dossiers-listing-actions [dossier]',
|
||||||
@ -36,6 +36,10 @@ export class DossiersListingActionsComponent implements OnChanges {
|
|||||||
private readonly _userPreferenceService: UserPreferenceService,
|
private readonly _userPreferenceService: UserPreferenceService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
get canEditDossierDictionary() {
|
||||||
|
return this.permissionsService.canEditDossierDictionary(this.dossier);
|
||||||
|
}
|
||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
this.files = this.filesMapService.get(this.dossier.id);
|
this.files = this.filesMapService.get(this.dossier.id);
|
||||||
this.downloadBtnDisabled = this.files.some(file => !file.lastProcessed);
|
this.downloadBtnDisabled = this.files.some(file => !file.lastProcessed);
|
||||||
@ -43,11 +47,7 @@ export class DossiersListingActionsComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forceReanalysisAction($event: LongPressEvent) {
|
forceReanalysisAction($event: LongPressEvent) {
|
||||||
this.analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled;
|
this.analysisForced = !$event.touchEnd && this._userPreferenceService.isIqserDevMode;
|
||||||
}
|
|
||||||
|
|
||||||
get canEditDossierDictionary() {
|
|
||||||
return this.permissionsService.canEditDossierDictionary(this.dossier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openEditDossierDialog(dossierId: string): void {
|
openEditDossierDialog(dossierId: string): void {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { ChangeDetectorRef, Component, HostBinding, Injector, Input, OnChanges, Optional, ViewChild } from '@angular/core';
|
import { ChangeDetectorRef, Component, HostBinding, Injector, Input, OnChanges, Optional, ViewChild } from '@angular/core';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
import { toObservable } from '@angular/core/rxjs-interop';
|
||||||
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses, User } from '@red/domain';
|
import { Router } from '@angular/router';
|
||||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import {
|
import {
|
||||||
CircleButtonType,
|
CircleButtonType,
|
||||||
CircleButtonTypes,
|
CircleButtonTypes,
|
||||||
@ -11,29 +11,29 @@ import {
|
|||||||
LoadingService,
|
LoadingService,
|
||||||
Toaster,
|
Toaster,
|
||||||
} from '@iqser/common-ui';
|
} from '@iqser/common-ui';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
|
||||||
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
|
||||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
|
||||||
import { FileManagementService } from '@services/files/file-management.service';
|
|
||||||
import { FilesService } from '@services/files/files.service';
|
|
||||||
import { ReanalysisService, ReanalyzeQueryParams } from '@services/reanalysis.service';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { ExcludedPagesService } from '../../../file-preview/services/excluded-pages.service';
|
|
||||||
import { DocumentInfoService } from '../../../file-preview/services/document-info.service';
|
|
||||||
import { ExpandableFileActionsComponent } from '@shared/components/expandable-file-actions/expandable-file-actions.component';
|
|
||||||
import { firstValueFrom, Observable } from 'rxjs';
|
|
||||||
import { PageRotationService } from '../../../pdf-viewer/services/page-rotation.service';
|
|
||||||
import { FileAssignService } from '../../services/file-assign.service';
|
|
||||||
import { ViewerHeaderService } from '../../../pdf-viewer/services/viewer-header.service';
|
|
||||||
import { ROTATION_ACTION_BUTTONS } from '../../../pdf-viewer/utils/constants';
|
|
||||||
import { Roles } from '@users/roles';
|
|
||||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
|
||||||
import { toObservable } from '@angular/core/rxjs-interop';
|
|
||||||
import { setLocalStorageDataByFileId } from '@utils/local-storage';
|
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { IqserTooltipPositions } from '@iqser/common-ui/lib/utils';
|
import { IqserTooltipPositions } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses, User } from '@red/domain';
|
||||||
|
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||||
|
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||||
|
import { FileManagementService } from '@services/files/file-management.service';
|
||||||
|
import { FilesService } from '@services/files/files.service';
|
||||||
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
|
import { ReanalysisService, ReanalyzeQueryParams } from '@services/reanalysis.service';
|
||||||
|
import { ExpandableFileActionsComponent } from '@shared/components/expandable-file-actions/expandable-file-actions.component';
|
||||||
|
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
||||||
|
import { Roles } from '@users/roles';
|
||||||
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
|
import { setLocalStorageDataByFileId } from '@utils/local-storage';
|
||||||
|
import { firstValueFrom, Observable } from 'rxjs';
|
||||||
|
import { DocumentInfoService } from '../../../file-preview/services/document-info.service';
|
||||||
|
import { ExcludedPagesService } from '../../../file-preview/services/excluded-pages.service';
|
||||||
|
import { PageRotationService } from '../../../pdf-viewer/services/page-rotation.service';
|
||||||
|
import { ViewerHeaderService } from '../../../pdf-viewer/services/viewer-header.service';
|
||||||
|
import { ROTATION_ACTION_BUTTONS } from '../../../pdf-viewer/utils/constants';
|
||||||
|
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||||
|
import { FileAssignService } from '../../services/file-assign.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-file-actions',
|
selector: 'redaction-file-actions',
|
||||||
@ -43,6 +43,7 @@ import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|||||||
export class FileActionsComponent implements OnChanges {
|
export class FileActionsComponent implements OnChanges {
|
||||||
@ViewChild(ExpandableFileActionsComponent)
|
@ViewChild(ExpandableFileActionsComponent)
|
||||||
private readonly _expandableActionsComponent: ExpandableFileActionsComponent;
|
private readonly _expandableActionsComponent: ExpandableFileActionsComponent;
|
||||||
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
@Input({ required: true }) file: File;
|
@Input({ required: true }) file: File;
|
||||||
@Input({ required: true }) dossier: Dossier;
|
@Input({ required: true }) dossier: Dossier;
|
||||||
@Input({ required: true }) type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
|
@Input({ required: true }) type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
|
||||||
@ -51,7 +52,6 @@ export class FileActionsComponent implements OnChanges {
|
|||||||
@Input() fileActionsHelpModeKey: 'document_features_in_dossier' | 'editor_document_features' = 'document_features_in_dossier';
|
@Input() fileActionsHelpModeKey: 'document_features_in_dossier' | 'editor_document_features' = 'document_features_in_dossier';
|
||||||
readonly circleButtonTypes = CircleButtonTypes;
|
readonly circleButtonTypes = CircleButtonTypes;
|
||||||
readonly currentUser = getCurrentUser<User>();
|
readonly currentUser = getCurrentUser<User>();
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
|
||||||
toggleTooltip?: string;
|
toggleTooltip?: string;
|
||||||
assignTooltip?: string;
|
assignTooltip?: string;
|
||||||
buttonType?: CircleButtonType;
|
buttonType?: CircleButtonType;
|
||||||
@ -302,7 +302,7 @@ export class FileActionsComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forceReanalysisAction($event: LongPressEvent) {
|
forceReanalysisAction($event: LongPressEvent) {
|
||||||
this.analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled;
|
this.analysisForced = !$event.touchEnd && this._userPreferenceService.isIqserDevMode;
|
||||||
this.#setup();
|
this.#setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { UserService } from '@users/user.service';
|
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
import {
|
import {
|
||||||
DashboardStats,
|
DashboardStats,
|
||||||
Dictionary,
|
Dictionary,
|
||||||
@ -10,18 +10,18 @@ import {
|
|||||||
IComment,
|
IComment,
|
||||||
IDossier,
|
IDossier,
|
||||||
ProcessingFileStatuses,
|
ProcessingFileStatuses,
|
||||||
WorkflowFileStatuses,
|
|
||||||
} from '@red/domain';
|
} from '@red/domain';
|
||||||
import { FilesMapService } from '@services/files/files-map.service';
|
import { DossierDictionariesMapService } from '@services/entity-services/dossier-dictionaries-map.service';
|
||||||
import { FeaturesService } from '@services/features.service';
|
import { FeaturesService } from '@services/features.service';
|
||||||
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
import { FilesMapService } from '@services/files/files-map.service';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
import { DossierDictionariesMapService } from '@services/entity-services/dossier-dictionaries-map.service';
|
import { UserService } from '@users/user.service';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class PermissionsService {
|
export class PermissionsService {
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _userService: UserService,
|
private readonly _userService: UserService,
|
||||||
private readonly _filesMapService: FilesMapService,
|
private readonly _filesMapService: FilesMapService,
|
||||||
@ -36,9 +36,7 @@ export class PermissionsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
canAddEditJustifications() {
|
canAddEditJustifications() {
|
||||||
return (
|
return this._userPreferenceService.isIqserDevMode && this.isAdmin() && this._iqserPermissionsService.has(Roles.legalBasis.write);
|
||||||
this._userPreferenceService.areDevFeaturesEnabled && this.isAdmin() && this._iqserPermissionsService.has(Roles.legalBasis.write)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
canEditGlobalFileAttributes() {
|
canEditGlobalFileAttributes() {
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"ADMIN_CONTACT_NAME": null,
|
"ADMIN_CONTACT_NAME": null,
|
||||||
"ADMIN_CONTACT_URL": null,
|
"ADMIN_CONTACT_URL": null,
|
||||||
"API_URL": "https://kilian2.iqser.cloud",
|
"API_URL": "https://dan.iqser.cloud",
|
||||||
"APP_NAME": "RedactManager",
|
"APP_NAME": "RedactManager",
|
||||||
"IS_DOCUMINE": false,
|
"IS_DOCUMINE": true,
|
||||||
|
"RULE_EDITOR_DEV_ONLY": false,
|
||||||
"AUTO_READ_TIME": 3,
|
"AUTO_READ_TIME": 3,
|
||||||
"BACKEND_APP_VERSION": "4.4.40",
|
"BACKEND_APP_VERSION": "4.4.40",
|
||||||
"EULA_URL": "EULA_URL",
|
"EULA_URL": "EULA_URL",
|
||||||
@ -12,7 +13,7 @@
|
|||||||
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
||||||
"OAUTH_CLIENT_ID": "redaction",
|
"OAUTH_CLIENT_ID": "redaction",
|
||||||
"OAUTH_IDP_HINT": null,
|
"OAUTH_IDP_HINT": null,
|
||||||
"OAUTH_URL": "https://kilian2.iqser.cloud/auth",
|
"OAUTH_URL": "https://dan.iqser.cloud/auth",
|
||||||
"RECENT_PERIOD_IN_HOURS": 24,
|
"RECENT_PERIOD_IN_HOURS": 24,
|
||||||
"SELECTION_MODE": "structural",
|
"SELECTION_MODE": "structural",
|
||||||
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",
|
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",
|
||||||
|
|||||||
@ -2,9 +2,9 @@ import { ApplicationRef, enableProdMode } from '@angular/core';
|
|||||||
import { enableDebugTools } from '@angular/platform-browser';
|
import { enableDebugTools } from '@angular/platform-browser';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
import { bool } from '@common-ui/utils';
|
import { bool } from '@common-ui/utils';
|
||||||
|
import { environment } from '@environments/environment';
|
||||||
import { AppConfig } from '@red/domain';
|
import { AppConfig } from '@red/domain';
|
||||||
import { appModuleFactory } from './app/app.module';
|
import { appModuleFactory } from './app/app.module';
|
||||||
import { environment } from './environments/environment';
|
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
@ -12,9 +12,12 @@ if (environment.production) {
|
|||||||
|
|
||||||
// https://github.com/angular/angular/issues/11195#issuecomment-248020928
|
// https://github.com/angular/angular/issues/11195#issuecomment-248020928
|
||||||
async function bootstrap(appConfig: AppConfig, version: { FRONTEND_APP_VERSION: string }) {
|
async function bootstrap(appConfig: AppConfig, version: { FRONTEND_APP_VERSION: string }) {
|
||||||
|
const ruleEditorDevOnly = appConfig.RULE_EDITOR_DEV_ONLY as unknown as string | boolean;
|
||||||
const config = {
|
const config = {
|
||||||
...appConfig,
|
...appConfig,
|
||||||
IS_DOCUMINE: bool(appConfig.IS_DOCUMINE),
|
IS_DOCUMINE: bool(appConfig.IS_DOCUMINE),
|
||||||
|
RULE_EDITOR_DEV_ONLY:
|
||||||
|
typeof ruleEditorDevOnly === 'string' ? ruleEditorDevOnly.toLowerCase() === 'true' : ruleEditorDevOnly !== false,
|
||||||
FRONTEND_APP_VERSION: version.FRONTEND_APP_VERSION,
|
FRONTEND_APP_VERSION: version.FRONTEND_APP_VERSION,
|
||||||
} as AppConfig;
|
} as AppConfig;
|
||||||
console.log('Started with local config: ', config);
|
console.log('Started with local config: ', config);
|
||||||
|
|||||||
@ -31,7 +31,7 @@ CMD ["/bin/cp", "-r", "/ng-app/dist/paligo-styles", "/tmp/styles-export"]
|
|||||||
### STAGE 2: Setup ###
|
### STAGE 2: Setup ###
|
||||||
|
|
||||||
|
|
||||||
FROM nginx:1.25.1-alpine
|
FROM nginx:1.25.2-alpine
|
||||||
|
|
||||||
## Copy our default nginx config
|
## Copy our default nginx config
|
||||||
COPY docker/common/nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
COPY docker/common/nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|||||||
@ -5,6 +5,7 @@ ADMIN_CONTACT_URL="${ADMIN_CONTACT_URL:-}"
|
|||||||
API_URL="${API_URL:-}"
|
API_URL="${API_URL:-}"
|
||||||
APP_NAME="${APP_NAME:-}"
|
APP_NAME="${APP_NAME:-}"
|
||||||
IS_DOCUMINE="${IS_DOCUMINE:-}"
|
IS_DOCUMINE="${IS_DOCUMINE:-}"
|
||||||
|
RULE_EDITOR_DEV_ONLY="${RULE_EDITOR_DEV_ONLY:-}"
|
||||||
AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}"
|
AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}"
|
||||||
BACKEND_APP_VERSION="${BACKEND_APP_VERSION:-4.7.0}"
|
BACKEND_APP_VERSION="${BACKEND_APP_VERSION:-4.7.0}"
|
||||||
EULA_URL="${EULA_URL:-}"
|
EULA_URL="${EULA_URL:-}"
|
||||||
@ -32,6 +33,7 @@ echo '{
|
|||||||
"API_URL":"'"$API_URL"'",
|
"API_URL":"'"$API_URL"'",
|
||||||
"APP_NAME":"'"$APP_NAME"'",
|
"APP_NAME":"'"$APP_NAME"'",
|
||||||
"IS_DOCUMINE":"'"$IS_DOCUMINE"'",
|
"IS_DOCUMINE":"'"$IS_DOCUMINE"'",
|
||||||
|
"RULE_EDITOR_DEV_ONLY":"'"$RULE_EDITOR_DEV_ONLY"'",
|
||||||
"AUTO_READ_TIME":"'"$AUTO_READ_TIME"'",
|
"AUTO_READ_TIME":"'"$AUTO_READ_TIME"'",
|
||||||
"BACKEND_APP_VERSION":"'"$BACKEND_APP_VERSION"'",
|
"BACKEND_APP_VERSION":"'"$BACKEND_APP_VERSION"'",
|
||||||
"EULA_URL":"'"$EULA_URL:"'",
|
"EULA_URL":"'"$EULA_URL:"'",
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { IqserAppConfig } from '@common-ui/utils';
|
|||||||
|
|
||||||
export interface AppConfig extends IqserAppConfig {
|
export interface AppConfig extends IqserAppConfig {
|
||||||
readonly ADMIN_CONTACT_NAME: string;
|
readonly ADMIN_CONTACT_NAME: string;
|
||||||
|
readonly RULE_EDITOR_DEV_ONLY: boolean;
|
||||||
readonly ADMIN_CONTACT_URL: string;
|
readonly ADMIN_CONTACT_URL: string;
|
||||||
readonly AUTO_READ_TIME: number;
|
readonly AUTO_READ_TIME: number;
|
||||||
readonly BACKEND_APP_VERSION: string;
|
readonly BACKEND_APP_VERSION: string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user