diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index a455d9832..460e10808 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -31,7 +31,14 @@ import { SpotlightSearchComponent } from '@components/spotlight-search/spotlight import { PruningTranslationLoader } from '@utils/pruning-translation-loader'; import { DatePipe } from '@shared/pipes/date.pipe'; import * as links from '../assets/help-mode/links.json'; -import { HELP_DOCS, IqserHelpModeModule, MAX_RETRIES_ON_SERVER_ERROR, ServerErrorInterceptor, ToastComponent } from '@iqser/common-ui'; +import { + HELP_DOCS, + IqserHelpModeModule, + MANUAL_BASE_URL, + MAX_RETRIES_ON_SERVER_ERROR, + ServerErrorInterceptor, + ToastComponent, +} from '@iqser/common-ui'; import { KeycloakService } from 'keycloak-angular'; import { GeneralSettingsService } from '@services/general-settings.service'; import { BreadcrumbsComponent } from '@components/breadcrumbs/breadcrumbs.component'; @@ -127,6 +134,11 @@ const components = [AppComponent, AuthErrorComponent, NotificationsComponent, Sp provide: HELP_DOCS, useValue: links, }, + { + provide: MANUAL_BASE_URL, + useFactory: (configService: ConfigService) => configService.values.MANUAL_BASE_URL, + deps: [ConfigService], + }, { provide: MAX_RETRIES_ON_SERVER_ERROR, useFactory: (configService: ConfigService) => configService.values.MAX_RETRIES_ON_SERVER_ERROR, diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 7b73d7228..36b1a7870 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -16,19 +16,16 @@ import { RedactionLogEntry } from './redaction-log.entry'; export class FileDataModel { static readonly DELTA_VIEW_TIME = 10 * 60 * 1000; // 10 minutes; - allAnnotations: AnnotationWrapper[]; + allAnnotations: AnnotationWrapper[] = []; readonly hasChangeLog$ = new BehaviorSubject(false); - readonly blob$ = new BehaviorSubject(undefined); constructor( private readonly _file: File, - private readonly _blob: Blob, private _redactionLog: IRedactionLog, public viewedPages?: IViewedPage[], private _dictionaryData?: { [p: string]: Dictionary }, private _areDevFeaturesEnabled?: boolean, ) { - this.blob$.next(_blob); this._buildAllAnnotations(); } @@ -56,7 +53,7 @@ export class FileDataModel { private _buildAllAnnotations() { const entries: RedactionLogEntry[] = this._convertData(); - const previousAnnotations = this.allAnnotations || []; + const previousAnnotations = [...this.allAnnotations]; this.allAnnotations = entries .map(entry => AnnotationWrapper.fromData(entry)) .filter(ann => ann.manual || !this._file.excludedPages.includes(ann.pageNumber)); diff --git a/apps/red-ui/src/app/models/file/redaction-log.entry.ts b/apps/red-ui/src/app/models/file/redaction-log.entry.ts index e53e6e570..1a82a09fe 100644 --- a/apps/red-ui/src/app/models/file/redaction-log.entry.ts +++ b/apps/red-ui/src/app/models/file/redaction-log.entry.ts @@ -28,21 +28,16 @@ export class RedactionLogEntry implements IRedactionLogEntry { readonly textBefore?: string; readonly type?: string; readonly value?: string; - readonly changeLogType?: 'ADDED' | 'REMOVED' | 'CHANGED'; - readonly isChangeLogEntry?: boolean; - readonly hidden?: boolean; - readonly legalBasisList: ILegalBasis[]; - readonly hintDictionary: boolean; reason?: string; constructor( redactionLogEntry: IRedactionLogEntry, - changeLogType: 'ADDED' | 'REMOVED' | 'CHANGED', - isChangeLogEntry: boolean, - hidden: boolean, - hintDictionary: boolean, - legalBasisList: ILegalBasis[], + readonly changeLogType: 'ADDED' | 'REMOVED' | 'CHANGED', + readonly isChangeLogEntry: boolean, + readonly hidden: boolean, + readonly hintDictionary: boolean, + readonly legalBasisList: ILegalBasis[], ) { this.changes = redactionLogEntry.changes; this.manualChanges = redactionLogEntry.manualChanges; @@ -72,10 +67,5 @@ export class RedactionLogEntry implements IRedactionLogEntry { this.textBefore = redactionLogEntry.textBefore; this.type = redactionLogEntry.type; this.value = redactionLogEntry.value; - this.changeLogType = changeLogType; - this.isChangeLogEntry = isChangeLogEntry; - this.hidden = hidden; - this.hintDictionary = hintDictionary; - this.legalBasisList = legalBasisList; } } diff --git a/apps/red-ui/src/app/modules/account/base-account-screen/base-account-screen-component.scss b/apps/red-ui/src/app/modules/account/base-account-screen/base-account-screen-component.scss index fd508d3c9..787f8c31e 100644 --- a/apps/red-ui/src/app/modules/account/base-account-screen/base-account-screen-component.scss +++ b/apps/red-ui/src/app/modules/account/base-account-screen/base-account-screen-component.scss @@ -1,5 +1,5 @@ -@use 'apps/red-ui/src/assets/styles/variables'; -@use 'libs/common-ui/src/assets/styles/common-mixins'; +@use 'variables'; +@use 'common-mixins'; .content-container { background-color: variables.$grey-2; diff --git a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.scss b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.scss index 82f2afa68..4e0c1ce0b 100644 --- a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.scss +++ b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.scss @@ -1,5 +1,5 @@ @use 'variables'; -@use 'libs/common-ui/src/assets/styles/common-mixins'; +@use 'common-mixins'; .dialog-content { flex-direction: column; diff --git a/apps/red-ui/src/app/modules/admin/admin-routing.module.ts b/apps/red-ui/src/app/modules/admin/admin-routing.module.ts index 4593549ea..33215e35e 100644 --- a/apps/red-ui/src/app/modules/admin/admin-routing.module.ts +++ b/apps/red-ui/src/app/modules/admin/admin-routing.module.ts @@ -6,16 +6,13 @@ import { AppStateGuard } from '@state/app-state.guard'; import { DictionaryListingScreenComponent } from './screens/dictionary-listing/dictionary-listing-screen.component'; import { DictionaryOverviewScreenComponent } from './screens/dictionary-overview/dictionary-overview-screen.component'; import { PendingChangesGuard } from '@guards/can-deactivate.guard'; -import { RulesScreenComponent } from './screens/rules/rules-screen.component'; import { FileAttributesListingScreenComponent } from './screens/file-attributes-listing/file-attributes-listing-screen.component'; -import { WatermarkScreenComponent } from './screens/watermark/watermark-screen.component'; import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component'; import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component'; import { LicenseInformationScreenComponent } from './screens/license-information/license-information-screen.component'; import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component'; import { AuditScreenComponent } from './screens/audit/audit-screen.component'; import { RouterModule, Routes } from '@angular/router'; -import { ReportsScreenComponent } from './screens/reports/reports-screen.component'; import { DossierAttributesListingScreenComponent } from './screens/dossier-attributes-listing/dossier-attributes-listing-screen.component'; import { TrashScreenComponent } from './screens/trash/trash-screen.component'; import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component'; @@ -72,12 +69,13 @@ const routes: Routes = [ }, { path: 'rules', - component: RulesScreenComponent, + component: BaseDossierTemplateScreenComponent, canActivate: [CompositeRouteGuard], canDeactivate: [PendingChangesGuard], data: { routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard], }, + loadChildren: () => import('./screens/rules/rules.module').then(m => m.RulesModule), }, { path: 'file-attributes', @@ -89,19 +87,21 @@ const routes: Routes = [ }, { path: 'watermark', - component: WatermarkScreenComponent, + component: BaseDossierTemplateScreenComponent, canActivate: [CompositeRouteGuard], data: { routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard], }, + loadChildren: () => import('./screens/watermark/watermark.module').then(m => m.WatermarkModule), }, { path: 'reports', - component: ReportsScreenComponent, + component: BaseDossierTemplateScreenComponent, canActivate: [CompositeRouteGuard], data: { routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard], }, + loadChildren: () => import('./screens/reports/reports.module').then(m => m.ReportsModule), }, { path: 'dossier-attributes', diff --git a/apps/red-ui/src/app/modules/admin/admin.module.ts b/apps/red-ui/src/app/modules/admin/admin.module.ts index aee060360..c36811d81 100644 --- a/apps/red-ui/src/app/modules/admin/admin.module.ts +++ b/apps/red-ui/src/app/modules/admin/admin.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { AdminRoutingModule } from './admin-routing.module'; -import { RulesScreenComponent } from './screens/rules/rules-screen.component'; import { SharedModule } from '@shared/shared.module'; import { AuditScreenComponent } from './screens/audit/audit-screen.component'; import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component'; @@ -11,7 +10,6 @@ import { DigitalSignatureScreenComponent } from './screens/digital-signature/dig import { FileAttributesListingScreenComponent } from './screens/file-attributes-listing/file-attributes-listing-screen.component'; import { LicenseInformationScreenComponent } from './screens/license-information/license-information-screen.component'; import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component'; -import { WatermarkScreenComponent } from './screens/watermark/watermark-screen.component'; import { DossierTemplateBreadcrumbsComponent } from './components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component'; import { ColorPickerModule } from 'ngx-color-picker'; import { AddEditFileAttributeDialogComponent } from './dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; @@ -31,7 +29,6 @@ import { FileAttributesCsvImportDialogComponent } from './dialogs/file-attribute import { ActiveFieldsListingComponent } from './dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component'; import { AdminSideNavComponent } from './admin-side-nav/admin-side-nav.component'; import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'; -import { ReportsScreenComponent } from './screens/reports/reports-screen.component'; import { ResetPasswordComponent } from './dialogs/add-edit-user-dialog/reset-password/reset-password.component'; import { UserDetailsComponent } from './dialogs/add-edit-user-dialog/user-details/user-details.component'; import { AddEditDossierAttributeDialogComponent } from './dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component'; @@ -66,7 +63,6 @@ const dialogs = [ ]; const screens = [ - RulesScreenComponent, AuditScreenComponent, DefaultColorsScreenComponent, DictionaryListingScreenComponent, @@ -75,9 +71,7 @@ const screens = [ FileAttributesListingScreenComponent, LicenseInformationScreenComponent, UserListingScreenComponent, - WatermarkScreenComponent, GeneralConfigScreenComponent, - ReportsScreenComponent, DossierAttributesListingScreenComponent, TrashScreenComponent, ]; diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts index a81508f20..5bfcba4ce 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts @@ -55,7 +55,7 @@ export class DefaultColorsScreenComponent extends ListingComponent imp await this._loadColors(); } - openEditColorDialog($event: any, color: { key: DefaultColorType | string; value: string }) { + openEditColorDialog($event: MouseEvent, color: { key: DefaultColorType | string; value: string }) { this._dialogService.openDialog( 'editColor', $event, diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html index 3ee132dc1..40f2241dd 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html @@ -1,6 +1,6 @@ diff --git a/apps/red-ui/src/app/modules/admin/screens/justifications/table-item/table-item.component.html b/apps/red-ui/src/app/modules/admin/screens/justifications/table-item/table-item.component.html index 8424e1c7d..84974898f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/justifications/table-item/table-item.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/justifications/table-item/table-item.component.html @@ -16,7 +16,7 @@
- - -
-
- - - -
-
- -
- -
-
-
-
- -
-
-
- -
{{ placeholder.placeholder }}
-
-
-
-
- -
-
-
- -
- -
- -
-
- {{ template.fileName }} {{ template.multiFileReport ? ('reports-screen.multi-file-report' | translate) : '' }} -
- -
- - -
-
-
-
- - - diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.html new file mode 100644 index 000000000..bffe195a8 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.html @@ -0,0 +1,60 @@ +
+
+ +
+ +
+
+
+
+ +
+
+
+ +
{{ placeholder.placeholder }}
+
+
+
+
+ +
+
+
+ +
+ +
+ +
+
+ {{ template.fileName }} {{ template.multiFileReport ? ('reports-screen.multi-file-report' | translate) : '' }} +
+ +
+ + +
+
+
+ + diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.scss similarity index 96% rename from apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.scss index 82bf1b1f7..19aac0ebd 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.scss @@ -1,6 +1,12 @@ @use 'variables'; @use 'common-mixins'; +:host { + flex-grow: 1; + overflow: hidden; + display: flex; +} + .content-container, .right-container { flex: 1; diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts similarity index 84% rename from apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts index a78562025..c18dd22c4 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { ChangeDetectionStrategy, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { IPlaceholdersResponse, IReportTemplate } from '@red/domain'; import { download } from '@utils/file-download-utils'; import { ConfirmationDialogInput, LoadingService, Toaster } from '@iqser/common-ui'; @@ -6,13 +6,13 @@ import { PermissionsService } from '@services/permissions.service'; import { generalPlaceholdersDescriptionsTranslations, placeholdersDescriptionsTranslations, -} from '../../translations/placeholders-descriptions-translations'; +} from '../../../translations/placeholders-descriptions-translations'; import { removeBraces } from '@utils/functions'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { AdminDialogService } from '../../services/admin-dialog.service'; +import { AdminDialogService } from '../../../services/admin-dialog.service'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; import { ReportTemplateService } from '@services/report-template.service'; -import { firstValueFrom } from 'rxjs'; +import { BehaviorSubject, firstValueFrom } from 'rxjs'; interface Placeholder { placeholder: string; @@ -27,10 +27,11 @@ const placeholderTypes: PlaceholderType[] = ['generalPlaceholders', 'fileAttribu selector: 'redaction-reports-screen', templateUrl: './reports-screen.component.html', styleUrls: ['./reports-screen.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ReportsScreenComponent implements OnInit { - placeholders: Placeholder[]; - availableTemplates: IReportTemplate[]; + placeholders$ = new BehaviorSubject([]); + availableTemplates$ = new BehaviorSubject([]); @ViewChild('fileInput') private _fileInput: ElementRef; @@ -85,7 +86,7 @@ export class ReportsScreenComponent implements OnInit { } private async _uploadTemplate($event) { - const file = $event.target.files[0]; + const file: File = $event.target.files[0]; if (!this._isValidFile(file)) { this._toaster.error(_('reports-screen.invalid-upload')); @@ -94,7 +95,7 @@ export class ReportsScreenComponent implements OnInit { const dossierTemplateId = this._dossierTemplatesService.activeDossierTemplateId; - if (this.availableTemplates.some(template => template.fileName === file.name)) { + if (this.availableTemplates$.value.some(template => template.fileName === file.name)) { const data = new ConfirmationDialogInput({ title: _('confirmation-dialog.report-template-same-name.title'), question: _('confirmation-dialog.report-template-same-name.question'), @@ -147,8 +148,10 @@ export class ReportsScreenComponent implements OnInit { } private async _loadReportTemplates() { - this.availableTemplates = await firstValueFrom( - this._reportTemplateService.getAvailableReportTemplates(this._dossierTemplatesService.activeDossierTemplateId), + this.availableTemplates$.next( + await firstValueFrom( + this._reportTemplateService.getAvailableReportTemplates(this._dossierTemplatesService.activeDossierTemplateId), + ), ); } @@ -156,12 +159,14 @@ export class ReportsScreenComponent implements OnInit { const placeholdersResponse: IPlaceholdersResponse = await firstValueFrom( this._reportTemplateService.getAvailablePlaceholders(this._dossierTemplatesService.activeDossierTemplateId), ); - this.placeholders = placeholderTypes.flatMap(type => - placeholdersResponse[type].map(placeholder => ({ - placeholder, - descriptionTranslation: this._getPlaceholderDescriptionTranslation(type, placeholder), - attributeName: this._getAttributeName(placeholder), - })), + this.placeholders$.next( + placeholderTypes.flatMap(type => + placeholdersResponse[type].map(placeholder => ({ + placeholder, + descriptionTranslation: this._getPlaceholderDescriptionTranslation(type, placeholder), + attributeName: this._getAttributeName(placeholder), + })), + ), ); } diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports.module.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports.module.ts new file mode 100644 index 000000000..a7632e4ee --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import { SharedModule } from '../../../shared/shared.module'; +import { ReportsScreenComponent } from './reports-screen/reports-screen.component'; + +const routes = [{ path: '', component: ReportsScreenComponent }]; + +@NgModule({ + declarations: [ReportsScreenComponent], + imports: [RouterModule.forChild(routes), CommonModule, SharedModule], +}) +export class ReportsModule {} diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html deleted file mode 100644 index 8f63c3a6d..000000000 --- a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html +++ /dev/null @@ -1,35 +0,0 @@ -
- - -
-
- - - -
- -
-
- -
-
-
-
diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.scss deleted file mode 100644 index 2a5860784..000000000 --- a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.scss +++ /dev/null @@ -1,10 +0,0 @@ -.editor-container { - width: 100%; - padding-top: 15px; - padding-left: 15px; -} - -ngx-monaco-editor { - height: 100%; - width: 100%; -} diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.html new file mode 100644 index 000000000..91cb6eac3 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.html @@ -0,0 +1,11 @@ + + +
+ +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.scss new file mode 100644 index 000000000..72374e679 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.scss @@ -0,0 +1,10 @@ +:host { + flex-grow: 1; + overflow: hidden; + padding: 15px 0 0 15px; +} + +ngx-monaco-editor { + height: 100%; + width: 100%; +} diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.ts similarity index 98% rename from apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.ts index 56592d0f0..17daa1aa7 100644 --- a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen/rules-screen.component.ts @@ -5,7 +5,7 @@ import { TranslateService } from '@ngx-translate/core'; import { saveAs } from 'file-saver'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; -import { RulesService } from '../../services/rules.service'; +import { RulesService } from '../../../services/rules.service'; import { firstValueFrom } from 'rxjs'; import ICodeEditor = monaco.editor.ICodeEditor; import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration; diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules.module.ts b/apps/red-ui/src/app/modules/admin/screens/rules/rules.module.ts new file mode 100644 index 000000000..e2824d79e --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import { SharedModule } from '../../../shared/shared.module'; +import { RulesScreenComponent } from './rules-screen/rules-screen.component'; +import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'; + +const routes = [{ path: '', component: RulesScreenComponent }]; + +@NgModule({ + declarations: [RulesScreenComponent], + imports: [RouterModule.forChild(routes), CommonModule, SharedModule, MonacoEditorModule], +}) +export class RulesModule {} diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html deleted file mode 100644 index b279ead7e..000000000 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html +++ /dev/null @@ -1,127 +0,0 @@ -
- - -
-
- - - -
-
-
- -
-
-
- -
-
-
-
- -
- -
- -
-
- ABC -
-
-
- -
- - -
- -
- - -
- -
- - -
- -
-
- -
- -
-
- {{ option.display }} -
-
-
-
-
-
-
diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html new file mode 100644 index 000000000..549beee22 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html @@ -0,0 +1,104 @@ +
+
+
+ +
+
+
+ +
+
+
+
+ +
+ +
+ +
+
+ ABC +
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ +
+
+ {{ option.display }} +
+
+
+
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.scss similarity index 96% rename from apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.scss index 9e316aa55..7b0777c44 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.scss @@ -1,5 +1,11 @@ @use 'variables'; +:host { + display: flex; + flex-grow: 1; + overflow: hidden; +} + .content-container { order: 1; diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts similarity index 99% rename from apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts index 607ef3ca4..19b0b63e5 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts @@ -6,7 +6,7 @@ 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 { BASE_HREF } from '../../../../tokens'; +import { BASE_HREF } from '../../../../../tokens'; import { stampPDFPage } from '@utils/page-stamper'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark.module.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark.module.ts new file mode 100644 index 000000000..019258112 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import { SharedModule } from '@shared/shared.module'; +import { WatermarkScreenComponent } from './watermark-screen/watermark-screen.component'; +import { ColorPickerModule } from 'ngx-color-picker'; + +const routes = [{ path: '', component: WatermarkScreenComponent }]; + +@NgModule({ + declarations: [WatermarkScreenComponent], + imports: [RouterModule.forChild(routes), CommonModule, SharedModule, ColorPickerModule], +}) +export class WatermarkModule {} diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts index 6944b4683..1adf41aa0 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts @@ -57,7 +57,7 @@ export class EditDossierDictionaryComponent implements EditDossierSectionInterfa async ngOnInit() { this._loadingService.start(); - this.canEdit = this._permissionsService.isDossierMember(this.dossier); + this.canEdit = this._permissionsService.canEditDossier(this.dossier); await this._updateDossierDictionary(); this.form = this._getForm(); this._loadingService.stop(); diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-team/edit-dossier-team.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-team/edit-dossier-team.component.html index 5d2053801..bb9c665dc 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-team/edit-dossier-team.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-team/edit-dossier-team.component.html @@ -15,7 +15,7 @@ {{ 'assign-dossier-owner.dialog.no-reviewers' | translate }}
- + { - if (!this.isApprover(owner)) { - this.toggleApprover(owner); + if (this.hasOwner) { + if (!this.isApprover(owner)) { + this.toggleApprover(owner); + } + // If it is an approver, it is already a member, no need to check + this._updateLists(); } - // If it is an approver, it is already a member, no need to check - this._updateLists(); }); this._updateLists(); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts index cd7ceaddc..ab3b664e1 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts @@ -40,7 +40,7 @@ export class FileWorkloadComponent { } get redactionColor() { - return this._getDictionaryColor('redaction'); + return this._getDictionaryColor('dossier_redaction'); } private _getDictionaryColor(type: string) { diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/view-mode-selection/view-mode-selection.component.scss b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/view-mode-selection/view-mode-selection.component.scss index 85b2b0d54..7e96bbb4e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/view-mode-selection/view-mode-selection.component.scss +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/view-mode-selection/view-mode-selection.component.scss @@ -1,4 +1,4 @@ -@use 'apps/red-ui/src/assets/styles/variables'; +@use 'variables'; .view-mode-selection { border-right: 1px solid variables.$separator; diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts index 4989a0a84..a78074fe6 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts @@ -23,6 +23,6 @@ export class DossierWorkloadColumnComponent { } get redactionColor() { - return this._appStateService.getDictionaryColor('redaction', this.dossier.dossierTemplateId); + return this._appStateService.getDictionaryColor('dossier_redaction', this.dossier.dossierTemplateId); } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.scss b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.scss index 72e8cf4bf..79ed0f815 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.scss +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.scss @@ -1,4 +1,4 @@ -@use 'apps/red-ui/src/assets/styles/variables'; +@use 'variables'; .annotation-actions { display: none; diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.ts index b147cfcec..faf87375c 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.ts @@ -8,7 +8,6 @@ import { UserService } from '@services/user.service'; import { AnnotationReferencesService } from '../../services/annotation-references.service'; import { MultiSelectService } from '../../services/multi-select.service'; import { FilePreviewStateService } from '../../services/file-preview-state.service'; -import { firstValueFrom } from 'rxjs'; export const AnnotationButtonTypes = { dark: 'dark', @@ -34,9 +33,9 @@ export class AnnotationActionsComponent implements OnChanges { constructor( private readonly _userService: UserService, readonly multiSelectService: MultiSelectService, + private readonly _state: FilePreviewStateService, private readonly _permissionsService: PermissionsService, readonly annotationActionsService: AnnotationActionsService, - private readonly _screenStateService: FilePreviewStateService, readonly annotationReferencesService: AnnotationReferencesService, ) {} @@ -115,7 +114,7 @@ export class AnnotationActionsComponent implements OnChanges { } private async _setPermissions() { - const dossier = await firstValueFrom(this._screenStateService.dossier$); + const dossier = await this._state.dossier; this.annotationPermissions = AnnotationPermissions.forUser( this._permissionsService.isApprover(dossier), this._userService.currentUser, diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.html index 3c16dd91c..1d611f7f2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.html @@ -1,8 +1,14 @@ -
+
- +
diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.ts index b293a2d58..faecb80ad 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-details/annotation-details.component.ts @@ -3,6 +3,7 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { TranslateService } from '@ngx-translate/core'; import { annotationChangesTranslations } from '../../../../../../translations/annotation-changes-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { MultiSelectService } from '../../services/multi-select.service'; interface Engine { readonly icon: string; @@ -35,7 +36,7 @@ export class AnnotationDetailsComponent implements OnChanges { hasChangesToShow: boolean; changesTooltip: string; - constructor(private readonly _translateService: TranslateService) {} + constructor(private readonly _translateService: TranslateService, readonly multiSelectService: MultiSelectService) {} ngOnChanges(changes: SimpleChanges) { if (changes.annotation) { diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts index d812af678..526eb3624 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts @@ -4,6 +4,8 @@ import { FilterService, HelpModeService, IqserEventTarget } from '@iqser/common- import { MultiSelectService } from '../../services/multi-select.service'; import { AnnotationReferencesService } from '../../services/annotation-references.service'; import { ViewModeService } from '../../services/view-mode.service'; +import { FilePreviewStateService } from '../../services/file-preview-state.service'; +import { firstValueFrom } from 'rxjs'; @Component({ selector: 'redaction-annotations-list', @@ -16,7 +18,6 @@ export class AnnotationsListComponent implements OnChanges { @Input() selectedAnnotations: AnnotationWrapper[]; @Input() annotationActionsTemplate: TemplateRef; @Input() activeViewerPage: number; - @Input() canMultiSelect = true; @Output() readonly pagesPanelActive = new EventEmitter(); @Output() readonly selectAnnotations = new EventEmitter(); @@ -28,6 +29,7 @@ export class AnnotationsListComponent implements OnChanges { readonly helpModeService: HelpModeService, readonly annotationReferencesService: AnnotationReferencesService, private readonly _filterService: FilterService, + private readonly _state: FilePreviewStateService, ) {} ngOnChanges(changes: SimpleChanges): void { @@ -36,7 +38,7 @@ export class AnnotationsListComponent implements OnChanges { } } - annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void { + async annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): Promise { if (($event?.target as IqserEventTarget)?.localName === 'input') { return; } @@ -50,15 +52,16 @@ export class AnnotationsListComponent implements OnChanges { if (this.isSelected(annotation.annotationId)) { this.deselectAnnotations.emit([annotation]); } else { - if (this.canMultiSelect && ($event?.ctrlKey || $event?.metaKey) && this.selectedAnnotations.length > 0) { + const canMultiSelect = await firstValueFrom(this._state.isWritable$); + if (canMultiSelect && ($event?.ctrlKey || $event?.metaKey) && this.selectedAnnotations.length > 0) { this.multiSelectService.activate(); } this.selectAnnotations.emit([annotation]); } } - referenceClicked(annotation: AnnotationWrapper): void { - this.annotationClicked(annotation, null); + async referenceClicked(annotation: AnnotationWrapper): Promise { + await this.annotationClicked(annotation, null); if (this._filterService.filtersEnabled('primaryFilters')) { this._filterService.toggleFilter('primaryFilters', annotation.superType, true); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.scss b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.scss index 95072ae97..4ff5ff6c0 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.scss +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.scss @@ -1,5 +1,5 @@ -@use 'apps/red-ui/src/assets/styles/variables'; -@use 'libs/common-ui/src/assets/styles/common-mixins'; +@use 'variables'; +@use 'common-mixins'; :host { display: block; diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html index 758650323..86877bcc9 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html @@ -14,7 +14,7 @@
-