update eslint
This commit is contained in:
parent
5002e3d3ce
commit
8095d6a941
@ -42,23 +42,17 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"airbnb-typescript/base",
|
||||
"plugin:@angular-eslint/template/process-inline-templates",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"plugin:@angular-eslint/recommended--extra"
|
||||
],
|
||||
"rules": {
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/no-conflicting-lifecycle": "error",
|
||||
"@angular-eslint/no-host-metadata-property": "error",
|
||||
"@angular-eslint/no-input-rename": "error",
|
||||
@ -71,7 +65,14 @@
|
||||
"@angular-eslint/use-pipe-transform-interface": "error",
|
||||
"@typescript-eslint/consistent-type-definitions": "error",
|
||||
"@typescript-eslint/dot-notation": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-misused-promises": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/indent": "off",
|
||||
"@typescript-eslint/lines-between-class-members": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"error",
|
||||
@ -129,6 +130,10 @@
|
||||
"@typescript-eslint/no-unused-expressions": "error",
|
||||
"@typescript-eslint/prefer-function-type": "error",
|
||||
"@typescript-eslint/unified-signatures": "error",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-floating-promises": "off",
|
||||
"@typescript-eslint/unbound-method": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"arrow-body-style": "error",
|
||||
"arrow-parens": ["error", "as-needed"],
|
||||
"constructor-super": "error",
|
||||
@ -137,6 +142,7 @@
|
||||
"id-blacklist": "off",
|
||||
"id-match": "off",
|
||||
"import/no-deprecated": "warn",
|
||||
"import/no-extraneous-dependencies": "off",
|
||||
"no-bitwise": "error",
|
||||
"no-caller": "error",
|
||||
"no-console": [
|
||||
@ -178,7 +184,16 @@
|
||||
"prefer-const": "error",
|
||||
"radix": "error",
|
||||
"curly": "error",
|
||||
"comma-dangle": "error",
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
{
|
||||
"arrays": "always-multiline",
|
||||
"objects": "always-multiline",
|
||||
"imports": "always-multiline",
|
||||
"exports": "always-multiline",
|
||||
"functions": "always-multiline"
|
||||
}
|
||||
],
|
||||
"max-len": [
|
||||
"error",
|
||||
{
|
||||
@ -192,12 +207,13 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template", "plugin:@angular-eslint/template/recommended"],
|
||||
"rules": {
|
||||
"@angular-eslint/template/banana-in-box": "error",
|
||||
"@angular-eslint/template/no-negated-async": "error",
|
||||
"@angular-eslint/template/eqeqeq": "error"
|
||||
},
|
||||
"plugins": ["@angular-eslint/eslint-plugin-template"]
|
||||
"plugins": ["@angular-eslint/eslint-plugin-template", "prettier"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -13,12 +13,12 @@ const routes = [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'main/dossiers',
|
||||
pathMatch: 'full'
|
||||
pathMatch: 'full',
|
||||
},
|
||||
{
|
||||
path: 'auth-error',
|
||||
component: AuthErrorComponent,
|
||||
canActivate: [AuthGuard]
|
||||
canActivate: [AuthGuard],
|
||||
},
|
||||
{
|
||||
path: 'main/my-profile',
|
||||
@ -26,23 +26,23 @@ const routes = [
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: UserProfileScreenComponent
|
||||
}
|
||||
component: UserProfileScreenComponent,
|
||||
},
|
||||
],
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'main/admin',
|
||||
component: BaseScreenComponent,
|
||||
loadChildren: () => import('./modules/admin/admin.module').then(m => m.AdminModule)
|
||||
loadChildren: () => import('./modules/admin/admin.module').then(m => m.AdminModule),
|
||||
},
|
||||
{
|
||||
path: 'main/dossiers',
|
||||
component: BaseScreenComponent,
|
||||
loadChildren: () => import('./modules/dossier/dossiers.module').then(m => m.DossiersModule)
|
||||
loadChildren: () => import('./modules/dossier/dossiers.module').then(m => m.DossiersModule),
|
||||
},
|
||||
{
|
||||
path: 'main/downloads',
|
||||
@ -50,24 +50,24 @@ const routes = [
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: DownloadsListScreenComponent
|
||||
}
|
||||
component: DownloadsListScreenComponent,
|
||||
},
|
||||
],
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'main/dossiers',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
pathMatch: 'full',
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled' })],
|
||||
providers: [{ provide: RouteReuseStrategy, useClass: CustomRouteReuseStrategy }],
|
||||
exports: [RouterModule]
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
|
||||
@ -3,8 +3,6 @@ import { Component } from '@angular/core';
|
||||
@Component({
|
||||
selector: 'redaction-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
styleUrls: ['./app.component.scss'],
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor() {}
|
||||
}
|
||||
export class AppComponent {}
|
||||
|
||||
@ -72,78 +72,78 @@ const components = [AppComponent, AuthErrorComponent, ToastComponent, Notificati
|
||||
ToastrModule.forRoot({
|
||||
closeButton: true,
|
||||
enableHtml: true,
|
||||
toastComponent: ToastComponent
|
||||
toastComponent: ToastComponent,
|
||||
}),
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: httpLoaderFactory,
|
||||
deps: [HttpClient]
|
||||
deps: [HttpClient],
|
||||
},
|
||||
compiler: {
|
||||
provide: TranslateCompiler,
|
||||
useClass: TranslateMessageFormatCompiler
|
||||
}
|
||||
useClass: TranslateMessageFormatCompiler,
|
||||
},
|
||||
}),
|
||||
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
|
||||
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
multi: true,
|
||||
useClass: ServerErrorInterceptor
|
||||
useClass: ServerErrorInterceptor,
|
||||
},
|
||||
{
|
||||
provide: ErrorHandler,
|
||||
useClass: GlobalErrorHandler
|
||||
useClass: GlobalErrorHandler,
|
||||
},
|
||||
{
|
||||
provide: BASE_HREF,
|
||||
useFactory: (s: PlatformLocation) => cleanupBaseUrl(s.getBaseHrefFromDOM()),
|
||||
deps: [PlatformLocation]
|
||||
deps: [PlatformLocation],
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
multi: true,
|
||||
useClass: ApiPathInterceptor
|
||||
useClass: ApiPathInterceptor,
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
multi: true,
|
||||
useClass: HttpCacheInterceptor
|
||||
useClass: HttpCacheInterceptor,
|
||||
},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: languageInitializer,
|
||||
deps: [LanguageService]
|
||||
deps: [LanguageService],
|
||||
},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: configurationInitializer,
|
||||
deps: [KeycloakService, Title, ConfigService, GeneralSettingsControllerService]
|
||||
deps: [KeycloakService, Title, ConfigService, GeneralSettingsControllerService],
|
||||
},
|
||||
{
|
||||
provide: MONACO_PATH,
|
||||
useValue: 'https://unpkg.com/monaco-editor@0.24.0/min/vs'
|
||||
useValue: 'https://unpkg.com/monaco-editor@0.24.0/min/vs',
|
||||
},
|
||||
{
|
||||
provide: MissingTranslationHandler,
|
||||
useClass: REDMissingTranslationHandler
|
||||
useClass: REDMissingTranslationHandler,
|
||||
},
|
||||
{
|
||||
provide: HELP_DOCS,
|
||||
useValue: links
|
||||
useValue: links,
|
||||
},
|
||||
{
|
||||
provide: MAX_RETRIES_ON_SERVER_ERROR,
|
||||
useFactory: (configService: ConfigService) => configService.values.MAX_RETRIES_ON_SERVER_ERROR,
|
||||
deps: [ConfigService]
|
||||
deps: [ConfigService],
|
||||
},
|
||||
DatePipe
|
||||
DatePipe,
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {
|
||||
constructor(private readonly _router: Router, private readonly _route: ActivatedRoute) {
|
||||
@ -157,9 +157,9 @@ export class AppModule {
|
||||
queryParams: {
|
||||
state: null,
|
||||
session_state: null,
|
||||
code: null
|
||||
code: null,
|
||||
},
|
||||
queryParamsHandling: 'merge'
|
||||
queryParamsHandling: 'merge',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -5,7 +5,7 @@ import { ConfigService } from '@services/config.service';
|
||||
@Component({
|
||||
selector: 'redaction-auth-error',
|
||||
templateUrl: './auth-error.component.html',
|
||||
styleUrls: ['./auth-error.component.scss']
|
||||
styleUrls: ['./auth-error.component.scss'],
|
||||
})
|
||||
export class AuthErrorComponent {
|
||||
adminName = this._configService.values.ADMIN_CONTACT_NAME;
|
||||
|
||||
@ -24,7 +24,7 @@ const isSearchScreen = url => url.includes('/main/dossiers') && url.includes('/s
|
||||
|
||||
@Component({
|
||||
templateUrl: './base-screen.component.html',
|
||||
styleUrls: ['./base-screen.component.scss']
|
||||
styleUrls: ['./base-screen.component.scss'],
|
||||
})
|
||||
export class BaseScreenComponent {
|
||||
readonly currentUser = this.userService.currentUser;
|
||||
@ -32,43 +32,43 @@ export class BaseScreenComponent {
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.my-profile'),
|
||||
routerLink: '/main/my-profile',
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.admin'),
|
||||
routerLink: '/main/admin',
|
||||
show: this.currentUser.isManager || this.currentUser.isUserAdmin,
|
||||
action: this.appStateService.reset
|
||||
action: this.appStateService.reset,
|
||||
},
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.downloads'),
|
||||
routerLink: '/main/downloads',
|
||||
show: this.currentUser.isUser
|
||||
show: this.currentUser.isUser,
|
||||
},
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.trash'),
|
||||
routerLink: '/main/admin/trash',
|
||||
show: this.currentUser.isManager
|
||||
}
|
||||
show: this.currentUser.isManager,
|
||||
},
|
||||
];
|
||||
readonly searchActions: readonly SpotlightSearchAction[] = [
|
||||
{
|
||||
text: this._translateService.instant('search.this-dossier'),
|
||||
icon: 'red:enter',
|
||||
hide: (): boolean => !this.dossiersService.activeDossier,
|
||||
action: (query): void => this._search(query, this.dossiersService.activeDossierId)
|
||||
action: (query): void => this._search(query, this.dossiersService.activeDossierId),
|
||||
},
|
||||
{
|
||||
text: this._translateService.instant('search.entire-platform'),
|
||||
icon: 'red:enter',
|
||||
action: (query): void => this._search(query)
|
||||
}
|
||||
action: (query): void => this._search(query),
|
||||
},
|
||||
];
|
||||
private readonly _navigationStart$ = this._router.events.pipe(
|
||||
filter(isNavigationStart),
|
||||
map((event: NavigationStart) => event.url),
|
||||
startWith(this._router.url),
|
||||
distinctUntilChanged()
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
readonly isDossiersView$ = this._navigationStart$.pipe(map(isDossiersView));
|
||||
readonly isSearchScreen$ = this._navigationStart$.pipe(map(isSearchScreen));
|
||||
@ -81,7 +81,7 @@ export class BaseScreenComponent {
|
||||
readonly titleService: Title,
|
||||
readonly fileDownloadService: FileDownloadService,
|
||||
private readonly _router: Router,
|
||||
private readonly _translateService: TranslateService
|
||||
private readonly _translateService: TranslateService,
|
||||
) {}
|
||||
|
||||
trackByName(index: number, item: MenuItem) {
|
||||
|
||||
@ -11,7 +11,7 @@ import { RouterHistoryService } from '@services/router-history.service';
|
||||
selector: 'redaction-downloads-list-screen',
|
||||
templateUrl: './downloads-list-screen.component.html',
|
||||
styleUrls: ['./downloads-list-screen.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DownloadsListScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DownloadsListScreenComponent) }],
|
||||
})
|
||||
export class DownloadsListScreenComponent extends ListingComponent<DownloadStatusWrapper> implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -20,7 +20,7 @@ export class DownloadsListScreenComponent extends ListingComponent<DownloadStatu
|
||||
{ label: _('downloads-list.table-col-names.name'), width: '2fr' },
|
||||
{ label: _('downloads-list.table-col-names.size') },
|
||||
{ label: _('downloads-list.table-col-names.date') },
|
||||
{ label: _('downloads-list.table-col-names.status') }
|
||||
{ label: _('downloads-list.table-col-names.status') },
|
||||
];
|
||||
|
||||
constructor(
|
||||
@ -28,7 +28,7 @@ export class DownloadsListScreenComponent extends ListingComponent<DownloadStatu
|
||||
private readonly _loadingService: LoadingService,
|
||||
readonly fileDownloadService: FileDownloadService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
private readonly _downloadControllerService: DownloadControllerService
|
||||
private readonly _downloadControllerService: DownloadControllerService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import { DossiersService } from '../../modules/dossier/services/dossiers.service
|
||||
@Component({
|
||||
selector: 'redaction-notifications',
|
||||
templateUrl: './notifications.component.html',
|
||||
styleUrls: ['./notifications.component.scss']
|
||||
styleUrls: ['./notifications.component.scss'],
|
||||
})
|
||||
export class NotificationsComponent {
|
||||
notifications: Notification[];
|
||||
@ -25,7 +25,7 @@ export class NotificationsComponent {
|
||||
private readonly _notificationControllerService: NotificationControllerService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _datePipe: DatePipe
|
||||
private readonly _datePipe: DatePipe,
|
||||
) {
|
||||
this._notificationControllerService.getNotifications(false).subscribe((response: NotificationResponse) => {
|
||||
this.notifications = response.notifications.filter(notification => this._isSupportedType(notification));
|
||||
@ -78,7 +78,7 @@ export class NotificationsComponent {
|
||||
dossierHref: this._getDossierHref(dossierId),
|
||||
dossierName: this._getDossierName(notification.target?.dossierId),
|
||||
fileName: this._getFileName(notification.target?.dossierId, notification.target?.fileId),
|
||||
user: this._getUsername(notification.userId)
|
||||
user: this._getUsername(notification.userId),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { MatMenuTrigger } from '@angular/material/menu';
|
||||
selector: 'redaction-spotlight-search [actions]',
|
||||
templateUrl: './spotlight-search.component.html',
|
||||
styleUrls: ['./spotlight-search.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class SpotlightSearchComponent {
|
||||
@Input() actions: readonly SpotlightSearchAction[];
|
||||
@ -22,7 +22,7 @@ export class SpotlightSearchComponent {
|
||||
readonly showActions$ = this.valueChanges$.pipe(
|
||||
debounceTime(300),
|
||||
map(value => value !== ''),
|
||||
tap(show => (show ? this._menuTrigger.openMenu() : this._menuTrigger.closeMenu()))
|
||||
tap(show => (show ? this._menuTrigger.openMenu() : this._menuTrigger.closeMenu())),
|
||||
);
|
||||
|
||||
get shownActions(): readonly SpotlightSearchAction[] {
|
||||
|
||||
@ -4,7 +4,7 @@ import { ToasterOptions } from '@iqser/common-ui';
|
||||
|
||||
@Component({
|
||||
templateUrl: './toast.component.html',
|
||||
styleUrls: ['./toast.component.scss']
|
||||
styleUrls: ['./toast.component.scss'],
|
||||
})
|
||||
export class ToastComponent extends Toast {
|
||||
constructor(protected readonly _toastrService: ToastrService, readonly toastPackage: ToastPackage) {
|
||||
|
||||
@ -13,7 +13,7 @@ import { LoadingService } from '@iqser/common-ui';
|
||||
@Component({
|
||||
selector: 'redaction-user-profile-screen',
|
||||
templateUrl: './user-profile-screen.component.html',
|
||||
styleUrls: ['./user-profile-screen.component.scss']
|
||||
styleUrls: ['./user-profile-screen.component.scss'],
|
||||
})
|
||||
export class UserProfileScreenComponent implements OnInit {
|
||||
formGroup: FormGroup;
|
||||
@ -31,18 +31,18 @@ export class UserProfileScreenComponent implements OnInit {
|
||||
private readonly _languageService: LanguageService,
|
||||
private readonly _domSanitizer: DomSanitizer,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _loadingService: LoadingService
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {
|
||||
this._loadingService.start();
|
||||
this.formGroup = this._formBuilder.group({
|
||||
email: [undefined, [Validators.required, Validators.email]],
|
||||
firstName: [undefined],
|
||||
lastName: [undefined],
|
||||
language: [undefined]
|
||||
language: [undefined],
|
||||
});
|
||||
|
||||
this.changePasswordUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(
|
||||
this._configService.values.OAUTH_URL + '/account/password'
|
||||
`${this._configService.values.OAUTH_URL}/account/password`,
|
||||
);
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ export class UserProfileScreenComponent implements OnInit {
|
||||
|
||||
await this._userControllerService
|
||||
.updateMyProfile({
|
||||
...value
|
||||
...value,
|
||||
})
|
||||
.toPromise();
|
||||
|
||||
@ -101,7 +101,7 @@ export class UserProfileScreenComponent implements OnInit {
|
||||
email: this._userService.currentUser.email,
|
||||
firstName: this._userService.currentUser.firstName,
|
||||
lastName: this._userService.currentUser.lastName,
|
||||
language: this._languageService.currentLanguage
|
||||
language: this._languageService.currentLanguage,
|
||||
};
|
||||
if (this._userService.currentUser.email) {
|
||||
// disable email if it's already set
|
||||
|
||||
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LanguageService {
|
||||
constructor(private readonly _translateService: TranslateService) {
|
||||
|
||||
@ -387,7 +387,7 @@ export class AnnotationWrapper {
|
||||
private static _createContent(annotationWrapper: AnnotationWrapper, entry: RedactionLogEntryWrapper) {
|
||||
let content = '';
|
||||
if (entry.matchedRule) {
|
||||
content += 'Rule ' + entry.matchedRule + ' matched \n\n';
|
||||
content += `Rule ${entry.matchedRule} matched \n\n`;
|
||||
}
|
||||
|
||||
if (entry.reason) {
|
||||
|
||||
@ -19,7 +19,7 @@ export class FileDataModel {
|
||||
dictionaryData: { [p: string]: TypeValue },
|
||||
currentUser: User,
|
||||
viewMode: ViewMode,
|
||||
areDevFeaturesEnabled: boolean
|
||||
areDevFeaturesEnabled: boolean,
|
||||
): AnnotationData {
|
||||
const entries: RedactionLogEntryWrapper[] = this._convertData();
|
||||
let allAnnotations = entries
|
||||
@ -42,7 +42,7 @@ export class FileDataModel {
|
||||
|
||||
return {
|
||||
visibleAnnotations: visibleAnnotations,
|
||||
allAnnotations: allAnnotations
|
||||
allAnnotations: allAnnotations,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ const processingStatuses: List<FileStatus> = [
|
||||
FileStatuses.FULLREPROCESS,
|
||||
FileStatuses.OCR_PROCESSING,
|
||||
FileStatuses.INDEXING,
|
||||
FileStatuses.PROCESSING
|
||||
FileStatuses.PROCESSING,
|
||||
] as const;
|
||||
|
||||
export class File implements IFile, IListable {
|
||||
|
||||
@ -6,6 +6,6 @@ export class ManualRedactionEntryWrapper {
|
||||
readonly manualRedactionEntry: ManualRedactionEntry,
|
||||
readonly type: 'DICTIONARY' | 'REDACTION' | 'FALSE_POSITIVE',
|
||||
readonly annotationType: 'TEXT' | 'RECTANGLE' = 'TEXT',
|
||||
readonly rectId?: string
|
||||
readonly rectId?: string,
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -31,8 +31,8 @@ const routes = [
|
||||
component: DossierTemplatesListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':dossierTemplateId',
|
||||
@ -45,8 +45,8 @@ const routes = [
|
||||
component: DictionaryListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':type',
|
||||
@ -54,10 +54,10 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
}
|
||||
]
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'rules',
|
||||
@ -65,57 +65,57 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'file-attributes',
|
||||
component: FileAttributesListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'watermark',
|
||||
component: WatermarkScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'reports',
|
||||
component: ReportsScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-attributes',
|
||||
component: DossierAttributesListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'default-colors',
|
||||
component: DefaultColorsScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{ path: '', redirectTo: 'dictionaries', pathMatch: 'full' }
|
||||
]
|
||||
}
|
||||
{ path: '', redirectTo: 'dictionaries', pathMatch: 'full' },
|
||||
],
|
||||
},
|
||||
],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_MANAGER', 'RED_ADMIN']
|
||||
}
|
||||
requiredRoles: ['RED_MANAGER', 'RED_ADMIN'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'users',
|
||||
@ -123,8 +123,8 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_USER_ADMIN']
|
||||
}
|
||||
requiredRoles: ['RED_USER_ADMIN'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'license-info',
|
||||
@ -132,8 +132,8 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_ADMIN']
|
||||
}
|
||||
requiredRoles: ['RED_ADMIN'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'digital-signature',
|
||||
@ -141,8 +141,8 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_ADMIN']
|
||||
}
|
||||
requiredRoles: ['RED_ADMIN'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'audit',
|
||||
@ -150,8 +150,8 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_ADMIN']
|
||||
}
|
||||
requiredRoles: ['RED_ADMIN'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'general-config',
|
||||
@ -159,21 +159,21 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_ADMIN']
|
||||
}
|
||||
requiredRoles: ['RED_ADMIN'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trash',
|
||||
component: TrashScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AdminRoutingModule {}
|
||||
|
||||
@ -16,7 +16,7 @@ interface NavItem {
|
||||
@Component({
|
||||
selector: 'redaction-admin-side-nav',
|
||||
templateUrl: './admin-side-nav.component.html',
|
||||
styleUrls: ['./admin-side-nav.component.scss']
|
||||
styleUrls: ['./admin-side-nav.component.scss'],
|
||||
})
|
||||
export class AdminSideNavComponent {
|
||||
@Input() type: Type;
|
||||
@ -29,44 +29,44 @@ export class AdminSideNavComponent {
|
||||
{
|
||||
screen: 'dossier-templates',
|
||||
label: _('dossier-templates'),
|
||||
hideIf: !this.currentUser.isManager
|
||||
hideIf: !this.currentUser.isManager,
|
||||
},
|
||||
{
|
||||
screen: 'digital-signature',
|
||||
label: _('digital-signature'),
|
||||
hideIf: !this.currentUser.isAdmin
|
||||
hideIf: !this.currentUser.isAdmin,
|
||||
},
|
||||
{
|
||||
screen: 'license-info',
|
||||
label: _('license-information'),
|
||||
hideIf: !this.currentUser.isAdmin
|
||||
hideIf: !this.currentUser.isAdmin,
|
||||
},
|
||||
{ screen: 'audit', label: _('audit'), hideIf: !this.currentUser.isAdmin },
|
||||
{ screen: 'users', label: _('user-management'), hideIf: !this.currentUser.isUserAdmin },
|
||||
{
|
||||
screen: 'general-config',
|
||||
label: _('configurations'),
|
||||
hideIf: !this.currentUser.isAdmin
|
||||
}
|
||||
hideIf: !this.currentUser.isAdmin,
|
||||
},
|
||||
],
|
||||
dossierTemplates: [
|
||||
{ screen: 'dictionaries', label: _('dictionaries') },
|
||||
{
|
||||
screen: 'rules',
|
||||
label: _('rule-editor'),
|
||||
hideIf: !this.userPreferenceService.areDevFeaturesEnabled
|
||||
hideIf: !this.userPreferenceService.areDevFeaturesEnabled,
|
||||
},
|
||||
{ screen: 'default-colors', label: _('default-colors') },
|
||||
{ screen: 'watermark', label: _('watermark') },
|
||||
{ screen: 'file-attributes', label: _('file-attributes') },
|
||||
{ screen: 'dossier-attributes', label: _('dossier-attributes') },
|
||||
{ screen: 'reports', label: _('reports') }
|
||||
]
|
||||
{ screen: 'reports', label: _('reports') },
|
||||
],
|
||||
};
|
||||
|
||||
constructor(
|
||||
private readonly _userService: UserService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
readonly userPreferenceService: UserPreferenceService
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ const dialogs = [
|
||||
AddEditUserDialogComponent,
|
||||
ConfirmDeleteUsersDialogComponent,
|
||||
FileAttributesCsvImportDialogComponent,
|
||||
AddEditDossierAttributeDialogComponent
|
||||
AddEditDossierAttributeDialogComponent,
|
||||
];
|
||||
|
||||
const screens = [
|
||||
@ -68,7 +68,7 @@ const screens = [
|
||||
GeneralConfigScreenComponent,
|
||||
ReportsScreenComponent,
|
||||
DossierAttributesListingScreenComponent,
|
||||
TrashScreenComponent
|
||||
TrashScreenComponent,
|
||||
];
|
||||
|
||||
const components = [
|
||||
@ -83,12 +83,12 @@ const components = [
|
||||
UserDetailsComponent,
|
||||
|
||||
...dialogs,
|
||||
...screens
|
||||
...screens,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...components],
|
||||
providers: [AdminDialogService],
|
||||
imports: [CommonModule, SharedModule, AdminRoutingModule, NgxChartsModule, ColorPickerModule, MonacoEditorModule]
|
||||
imports: [CommonModule, SharedModule, AdminRoutingModule, NgxChartsModule, ColorPickerModule, MonacoEditorModule],
|
||||
})
|
||||
export class AdminModule {}
|
||||
|
||||
@ -7,7 +7,7 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
@Component({
|
||||
selector: 'redaction-admin-breadcrumbs',
|
||||
templateUrl: './admin-breadcrumbs.component.html',
|
||||
styleUrls: ['./admin-breadcrumbs.component.scss']
|
||||
styleUrls: ['./admin-breadcrumbs.component.scss'],
|
||||
})
|
||||
export class AdminBreadcrumbsComponent {
|
||||
@Input() root = false;
|
||||
@ -16,6 +16,6 @@ export class AdminBreadcrumbsComponent {
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
readonly permissionService: PermissionsService,
|
||||
readonly appStateService: AppStateService,
|
||||
readonly dossierTemplatesService: DossierTemplatesService
|
||||
readonly dossierTemplatesService: DossierTemplatesService,
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
Output,
|
||||
TemplateRef,
|
||||
ViewChild,
|
||||
ViewEncapsulation
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
|
||||
import { curveLinear } from 'd3-shape';
|
||||
@ -19,7 +19,7 @@ import { BaseChartComponent, calculateViewDimensions, ColorHelper, LineSeriesCom
|
||||
selector: 'combo-chart-component',
|
||||
templateUrl: './combo-chart.component.html',
|
||||
styleUrls: ['./combo-chart.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class ComboChartComponent extends BaseChartComponent {
|
||||
@Input() curve: any = curveLinear;
|
||||
@ -86,7 +86,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
yOrientLeft = 'left';
|
||||
yOrientRight = 'right';
|
||||
legendSpacing = 0;
|
||||
bandwidth;
|
||||
bandwidth: number;
|
||||
barPadding = 8;
|
||||
|
||||
trackBy(index, item): string {
|
||||
@ -107,7 +107,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
showYLabel: this.showYAxisLabel,
|
||||
showLegend: this.legend,
|
||||
legendType: this.schemeType,
|
||||
legendPosition: this.legendPosition
|
||||
legendPosition: this.legendPosition,
|
||||
});
|
||||
|
||||
if (!this.yAxis) {
|
||||
@ -171,7 +171,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
this.combinedSeries = this.lineChart.slice(0);
|
||||
this.combinedSeries.push({
|
||||
name: this.yAxisLabel,
|
||||
series: this.results
|
||||
series: this.results,
|
||||
});
|
||||
return this.combinedSeries.map(d => d.name);
|
||||
}
|
||||
@ -270,7 +270,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
}
|
||||
}
|
||||
|
||||
getXScaleLine(domain, width): any {
|
||||
getXScaleLine(domain, width: number): any {
|
||||
let scale;
|
||||
if (this.bandwidth === undefined) {
|
||||
this.bandwidth = width - this.barPadding;
|
||||
@ -349,7 +349,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
colors: undefined,
|
||||
domain: [],
|
||||
title: undefined,
|
||||
position: this.legendPosition
|
||||
position: this.legendPosition,
|
||||
};
|
||||
if (opts.scaleType === 'ordinal') {
|
||||
opts.domain = this.seriesDomain;
|
||||
@ -367,7 +367,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
this.scaleLines();
|
||||
}
|
||||
|
||||
updateYAxisWidth({ width }): void {
|
||||
updateYAxisWidth({ width }: { width: number }): void {
|
||||
this.yAxisWidth = width + 20;
|
||||
this.update();
|
||||
}
|
||||
|
||||
@ -38,12 +38,12 @@ import { formatLabel } from '@swimlane/ngx-charts';
|
||||
transition('* => void', [
|
||||
style({
|
||||
opacity: 1,
|
||||
transform: '*'
|
||||
transform: '*',
|
||||
}),
|
||||
animate(500, style({ opacity: 0, transform: 'scale(0)' }))
|
||||
])
|
||||
])
|
||||
]
|
||||
animate(500, style({ opacity: 0, transform: 'scale(0)' })),
|
||||
]),
|
||||
]),
|
||||
],
|
||||
})
|
||||
export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
@Input() dims;
|
||||
@ -82,11 +82,11 @@ export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
let d0 = 0;
|
||||
let total;
|
||||
if (this.type === 'normalized') {
|
||||
total = this.series.map(d => d.value).reduce((sum, d) => sum + d, 0);
|
||||
total = this.series.map(d => d.value).reduce((sum: number, d: number) => sum + d, 0);
|
||||
}
|
||||
|
||||
this.bars = this.series.map((d, index) => {
|
||||
let value = d.value;
|
||||
let value: number = d.value;
|
||||
const label = d.name;
|
||||
const formattedLabel = formatLabel(label);
|
||||
const roundEdges = this.type === 'standard';
|
||||
@ -100,7 +100,7 @@ export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
formattedLabel,
|
||||
height: 0,
|
||||
x: 0,
|
||||
y: 0
|
||||
y: 0,
|
||||
};
|
||||
|
||||
if (this.type === 'standard') {
|
||||
@ -140,6 +140,8 @@ export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
bar.y = this.yScale(offset1);
|
||||
bar.offset0 = offset0;
|
||||
bar.offset1 = offset1;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
value = (offset1 - offset0).toFixed(2) + '%';
|
||||
}
|
||||
|
||||
@ -163,8 +165,8 @@ export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
this.getSeriesTooltips(this.seriesLine, index);
|
||||
const lineValue = this.seriesLine[0].series[index].value;
|
||||
bar.tooltipText = `
|
||||
<span class='tooltip-label'>${tooltipLabel}</span>
|
||||
<span class='tooltip-val'>
|
||||
<span class="tooltip-label">${tooltipLabel}</span>
|
||||
<span class="tooltip-val">
|
||||
Y1 - ${value.toLocaleString()} • Y2 - ${lineValue.toLocaleString()}%
|
||||
</span>
|
||||
`;
|
||||
|
||||
@ -11,7 +11,7 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
@Component({
|
||||
selector: 'redaction-dossier-template-actions',
|
||||
templateUrl: './dossier-template-actions.component.html',
|
||||
styleUrls: ['./dossier-template-actions.component.scss']
|
||||
styleUrls: ['./dossier-template-actions.component.scss'],
|
||||
})
|
||||
export class DossierTemplateActionsComponent implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -28,7 +28,7 @@ export class DossierTemplateActionsComponent implements OnInit {
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _dossierTemplateControllerService: DossierTemplateControllerService
|
||||
private readonly _dossierTemplateControllerService: DossierTemplateControllerService,
|
||||
) {}
|
||||
|
||||
get dossierTemplate() {
|
||||
|
||||
@ -4,7 +4,7 @@ import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/si
|
||||
@Component({
|
||||
selector: 'redaction-users-stats',
|
||||
templateUrl: './users-stats.component.html',
|
||||
styleUrls: ['./users-stats.component.scss']
|
||||
styleUrls: ['./users-stats.component.scss'],
|
||||
})
|
||||
export class UsersStatsComponent {
|
||||
@Output() toggleCollapse = new EventEmitter();
|
||||
|
||||
@ -14,7 +14,7 @@ import { DictionaryService } from '@shared/services/dictionary.service';
|
||||
@Component({
|
||||
selector: 'redaction-add-edit-dictionary-dialog',
|
||||
templateUrl: './add-edit-dictionary-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dictionary-dialog.component.scss']
|
||||
styleUrls: ['./add-edit-dictionary-dialog.component.scss'],
|
||||
})
|
||||
export class AddEditDictionaryDialogComponent {
|
||||
dictionaryForm: FormGroup;
|
||||
@ -30,7 +30,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _dialogRef: MatDialogRef<AddEditDictionaryDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
private readonly _data: { dictionary: TypeValue; dossierTemplateId: string }
|
||||
private readonly _data: { dictionary: TypeValue; dossierTemplateId: string },
|
||||
) {
|
||||
this.dictionary = _data.dictionary;
|
||||
this._dossierTemplateId = _data.dossierTemplateId;
|
||||
@ -41,7 +41,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
hexColor: [this.dictionary?.hexColor, [Validators.required, Validators.minLength(7)]],
|
||||
hint: [!!this.dictionary?.hint],
|
||||
addToDictionaryAction: [!!this.dictionary?.addToDictionaryAction],
|
||||
caseSensitive: [this.dictCaseSensitive]
|
||||
caseSensitive: [this.dictCaseSensitive],
|
||||
});
|
||||
this.dictionaryForm.get('label').valueChanges.subscribe(() => {
|
||||
this._updateTechnicalName();
|
||||
@ -51,7 +51,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
get dialogHeader(): string {
|
||||
return this._translateService.instant('add-edit-dictionary.title', {
|
||||
type: this.dictionary ? 'edit' : 'create',
|
||||
name: this.dictionary?.label
|
||||
name: this.dictionary?.label,
|
||||
});
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
return false;
|
||||
}
|
||||
|
||||
async saveDictionary(): Promise<void> {
|
||||
saveDictionary(): void {
|
||||
const typeValue: ITypeValue = this._formToObject();
|
||||
let observable: Observable<unknown>;
|
||||
|
||||
@ -104,7 +104,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
} else {
|
||||
this._toaster.error(_('add-edit-dictionary.error.generic'));
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
hint: this.dictionaryForm.get('hint').value,
|
||||
rank: this.dictionaryForm.get('rank').value,
|
||||
addToDictionaryAction: this.dictionaryForm.get('addToDictionaryAction').value,
|
||||
dossierTemplateId: this._dossierTemplateId
|
||||
dossierTemplateId: this._dossierTemplateId,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
|
||||
@Component({
|
||||
templateUrl: './add-edit-dossier-attribute-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dossier-attribute-dialog.component.scss']
|
||||
styleUrls: ['./add-edit-dossier-attribute-dialog.component.scss'],
|
||||
})
|
||||
export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribe implements OnDestroy {
|
||||
dossierAttributeForm: FormGroup;
|
||||
@ -25,7 +25,7 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribe impl
|
||||
private readonly _toaster: Toaster,
|
||||
readonly dialogRef: MatDialogRef<AddEditDossierAttributeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
readonly data: { readonly dossierAttribute: IDossierAttributeConfig }
|
||||
readonly data: { readonly dossierAttribute: IDossierAttributeConfig },
|
||||
) {
|
||||
super();
|
||||
this.dossierAttribute = data.dossierAttribute;
|
||||
@ -35,10 +35,10 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribe impl
|
||||
...(!!this.dossierAttribute && {
|
||||
placeholder: {
|
||||
value: this.dossierAttribute.placeholder,
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
},
|
||||
}),
|
||||
type: [this.dossierAttribute?.type || FileAttributeConfigTypes.TEXT, Validators.required]
|
||||
type: [this.dossierAttribute?.type || FileAttributeConfigTypes.TEXT, Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribe impl
|
||||
const attribute: IDossierAttributeConfig = {
|
||||
id: this.dossierAttribute?.id,
|
||||
editable: true,
|
||||
...this.dossierAttributeForm.getRawValue()
|
||||
...this.dossierAttributeForm.getRawValue(),
|
||||
};
|
||||
|
||||
this._dossierAttributesService.addOrUpdateConfig(attribute).subscribe(
|
||||
@ -72,7 +72,7 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribe impl
|
||||
(error: HttpErrorResponse) => {
|
||||
this._loadingService.stop();
|
||||
this._toaster.error(_('add-edit-dossier-attribute.error.generic'), { error: error });
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
@Component({
|
||||
selector: 'redaction-add-edit-dossier-template-dialog',
|
||||
templateUrl: './add-edit-dossier-template-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dossier-template-dialog.component.scss']
|
||||
styleUrls: ['./add-edit-dossier-template-dialog.component.scss'],
|
||||
})
|
||||
export class AddEditDossierTemplateDialogComponent {
|
||||
dossierTemplateForm: FormGroup;
|
||||
@ -21,7 +21,7 @@ export class AddEditDossierTemplateDialogComponent {
|
||||
downloadTypesEnum: DownloadFileType[] = ['ORIGINAL', 'PREVIEW', 'REDACTED'];
|
||||
downloadTypes: { key: DownloadFileType; label: string }[] = this.downloadTypesEnum.map(type => ({
|
||||
key: type,
|
||||
label: downloadTypesTranslations[type]
|
||||
label: downloadTypesTranslations[type],
|
||||
}));
|
||||
|
||||
private _previousValidFrom: Moment;
|
||||
@ -33,20 +33,20 @@ export class AddEditDossierTemplateDialogComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _dossierTemplateController: DossierTemplateControllerService,
|
||||
public dialogRef: MatDialogRef<AddEditDossierTemplateDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly dossierTemplate: IDossierTemplate
|
||||
@Inject(MAT_DIALOG_DATA) readonly dossierTemplate: IDossierTemplate,
|
||||
) {
|
||||
this.dossierTemplateForm = this._formBuilder.group({
|
||||
name: [this.dossierTemplate?.name, Validators.required],
|
||||
description: [this.dossierTemplate?.description],
|
||||
validFrom: [
|
||||
this.dossierTemplate?.validFrom ? moment(this.dossierTemplate?.validFrom) : null,
|
||||
this._requiredIfValidator(() => this.hasValidFrom)
|
||||
this._requiredIfValidator(() => this.hasValidFrom),
|
||||
],
|
||||
validTo: [
|
||||
this.dossierTemplate?.validTo ? moment(this.dossierTemplate?.validTo) : null,
|
||||
this._requiredIfValidator(() => this.hasValidTo)
|
||||
this._requiredIfValidator(() => this.hasValidTo),
|
||||
],
|
||||
downloadFileTypes: [this.dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']]
|
||||
downloadFileTypes: [this.dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']],
|
||||
});
|
||||
this.hasValidFrom = !!this.dossierTemplate?.validFrom;
|
||||
this.hasValidTo = !!this.dossierTemplate?.validTo;
|
||||
@ -97,7 +97,7 @@ export class AddEditDossierTemplateDialogComponent {
|
||||
dossierTemplateId: this.dossierTemplate?.dossierTemplateId,
|
||||
...this.dossierTemplateForm.getRawValue(),
|
||||
validFrom: this.hasValidFrom ? this.dossierTemplateForm.get('validFrom').value : null,
|
||||
validTo: this.hasValidTo ? this.dossierTemplateForm.get('validTo').value : null
|
||||
validTo: this.hasValidTo ? this.dossierTemplateForm.get('validTo').value : null,
|
||||
};
|
||||
await this._dossierTemplateController.createOrUpdateDossierTemplate(dossierTemplate).toPromise();
|
||||
await this._dossierTemplatesService.loadAll().toPromise();
|
||||
@ -113,7 +113,7 @@ export class AddEditDossierTemplateDialogComponent {
|
||||
this._previousValidTo,
|
||||
this.dossierTemplateForm,
|
||||
'validFrom',
|
||||
'validTo'
|
||||
'validTo',
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
|
||||
@ -8,7 +8,7 @@ import { fileAttributeTypesTranslations } from '../../translations/file-attribut
|
||||
@Component({
|
||||
selector: 'redaction-add-edit-file-attribute-dialog',
|
||||
templateUrl: './add-edit-file-attribute-dialog.component.html',
|
||||
styleUrls: ['./add-edit-file-attribute-dialog.component.scss']
|
||||
styleUrls: ['./add-edit-file-attribute-dialog.component.scss'],
|
||||
})
|
||||
export class AddEditFileAttributeDialogComponent {
|
||||
fileAttributeForm: FormGroup;
|
||||
@ -22,7 +22,7 @@ export class AddEditFileAttributeDialogComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<AddEditFileAttributeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: { fileAttribute: IFileAttributeConfig; dossierTemplateId: string }
|
||||
public data: { fileAttribute: IFileAttributeConfig; dossierTemplateId: string },
|
||||
) {
|
||||
this.fileAttribute = data.fileAttribute;
|
||||
this.dossierTemplateId = data.dossierTemplateId;
|
||||
@ -34,7 +34,7 @@ export class AddEditFileAttributeDialogComponent {
|
||||
readonly: [this.fileAttribute ? !this.fileAttribute.editable : false],
|
||||
primaryAttribute: [this.fileAttribute?.primaryAttribute],
|
||||
filterable: [this.fileAttribute?.filterable],
|
||||
displayedInFileList: [this.fileAttribute?.displayedInFileList]
|
||||
displayedInFileList: [this.fileAttribute?.displayedInFileList],
|
||||
});
|
||||
}
|
||||
|
||||
@ -56,11 +56,11 @@ export class AddEditFileAttributeDialogComponent {
|
||||
return false;
|
||||
}
|
||||
|
||||
async saveFileAttribute() {
|
||||
saveFileAttribute() {
|
||||
const fileAttribute: IFileAttributeConfig = {
|
||||
id: this.fileAttribute?.id,
|
||||
editable: !this.fileAttributeForm.get('readonly').value,
|
||||
...this.fileAttributeForm.getRawValue()
|
||||
...this.fileAttributeForm.getRawValue(),
|
||||
};
|
||||
this.dialogRef.close(fileAttribute);
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import { User } from '@models/user';
|
||||
@Component({
|
||||
selector: 'redaction-add-edit-user-dialog',
|
||||
templateUrl: './add-edit-user-dialog.component.html',
|
||||
styleUrls: ['./add-edit-user-dialog.component.scss']
|
||||
styleUrls: ['./add-edit-user-dialog.component.scss'],
|
||||
})
|
||||
export class AddEditUserDialogComponent {
|
||||
resettingPassword = false;
|
||||
|
||||
@ -8,11 +8,11 @@ import { User } from '@models/user';
|
||||
@Component({
|
||||
selector: 'redaction-reset-password',
|
||||
templateUrl: './reset-password.component.html',
|
||||
styleUrls: ['./reset-password.component.scss']
|
||||
styleUrls: ['./reset-password.component.scss'],
|
||||
})
|
||||
export class ResetPasswordComponent {
|
||||
readonly passwordForm = this._formBuilder.group({
|
||||
temporaryPassword: [null, Validators.required]
|
||||
temporaryPassword: [null, Validators.required],
|
||||
});
|
||||
@Input() user: User;
|
||||
@Output() readonly toggleResetPassword = new EventEmitter();
|
||||
@ -21,7 +21,7 @@ export class ResetPasswordComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _userControllerService: UserControllerService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {}
|
||||
|
||||
async save() {
|
||||
@ -30,9 +30,9 @@ export class ResetPasswordComponent {
|
||||
.resetPassword(
|
||||
{
|
||||
password: this.passwordForm.get('temporaryPassword').value,
|
||||
temporary: true
|
||||
temporary: true,
|
||||
},
|
||||
this.user.id
|
||||
this.user.id,
|
||||
)
|
||||
.toPromise();
|
||||
this._loadingService.stop();
|
||||
|
||||
@ -10,7 +10,7 @@ import { User } from '@models/user';
|
||||
@Component({
|
||||
selector: 'redaction-user-details',
|
||||
templateUrl: './user-details.component.html',
|
||||
styleUrls: ['./user-details.component.scss']
|
||||
styleUrls: ['./user-details.component.scss'],
|
||||
})
|
||||
export class UserDetailsComponent implements OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -29,7 +29,7 @@ export class UserDetailsComponent implements OnInit {
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _userControllerService: UserControllerService
|
||||
private readonly _userControllerService: UserControllerService,
|
||||
) {}
|
||||
|
||||
get changed(): boolean {
|
||||
@ -75,12 +75,12 @@ export class UserDetailsComponent implements OnInit {
|
||||
this.user &&
|
||||
Object.keys(this._ROLE_REQUIREMENTS).reduce(
|
||||
(value, key) => value || (role === this._ROLE_REQUIREMENTS[key] && this.user.roles.indexOf(key) !== -1),
|
||||
false
|
||||
)
|
||||
}
|
||||
]
|
||||
false,
|
||||
),
|
||||
},
|
||||
],
|
||||
}),
|
||||
{}
|
||||
{},
|
||||
);
|
||||
this.userForm = this._formBuilder.group({
|
||||
firstName: [this.user?.firstName, Validators.required],
|
||||
@ -88,11 +88,11 @@ export class UserDetailsComponent implements OnInit {
|
||||
email: [
|
||||
{
|
||||
value: this.user?.email,
|
||||
disabled: !!this.user
|
||||
disabled: !!this.user,
|
||||
},
|
||||
[Validators.required, Validators.email]
|
||||
[Validators.required, Validators.email],
|
||||
],
|
||||
...rolesControls
|
||||
...rolesControls,
|
||||
});
|
||||
this._setRolesRequirements();
|
||||
}
|
||||
@ -122,8 +122,8 @@ export class UserDetailsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async delete() {
|
||||
this._dialogService.openDialog('deleteUsers', null, [this.user], async () => {
|
||||
delete() {
|
||||
this._dialogService.openDialog('deleteUsers', null, [this.user], () => {
|
||||
this.closeDialog.emit(true);
|
||||
});
|
||||
}
|
||||
|
||||
@ -6,19 +6,19 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@Component({
|
||||
selector: 'redaction-confirm-delete-file-attribute-dialog',
|
||||
templateUrl: './confirm-delete-file-attribute-dialog.component.html',
|
||||
styleUrls: ['./confirm-delete-file-attribute-dialog.component.scss']
|
||||
styleUrls: ['./confirm-delete-file-attribute-dialog.component.scss'],
|
||||
})
|
||||
export class ConfirmDeleteFileAttributeDialogComponent {
|
||||
fileAttribute: IFileAttributeConfig;
|
||||
checkboxes = [
|
||||
{ value: false, label: _('confirm-delete-file-attribute.impacted-documents') },
|
||||
{ value: false, label: _('confirm-delete-file-attribute.lost-details') }
|
||||
{ value: false, label: _('confirm-delete-file-attribute.lost-details') },
|
||||
];
|
||||
showToast = false;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ConfirmDeleteFileAttributeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: IFileAttributeConfig
|
||||
@Inject(MAT_DIALOG_DATA) public data: IFileAttributeConfig,
|
||||
) {
|
||||
this.fileAttribute = data;
|
||||
}
|
||||
|
||||
@ -9,12 +9,12 @@ import { DossiersService } from '../../../dossier/services/dossiers.service';
|
||||
@Component({
|
||||
selector: 'redaction-confirm-delete-users-dialog',
|
||||
templateUrl: './confirm-delete-users-dialog.component.html',
|
||||
styleUrls: ['./confirm-delete-users-dialog.component.scss']
|
||||
styleUrls: ['./confirm-delete-users-dialog.component.scss'],
|
||||
})
|
||||
export class ConfirmDeleteUsersDialogComponent {
|
||||
readonly checkboxes = [
|
||||
{ value: false, label: _('confirm-delete-users.impacted-dossiers') },
|
||||
{ value: false, label: _('confirm-delete-users.impacted-documents') }
|
||||
{ value: false, label: _('confirm-delete-users.impacted-documents') },
|
||||
];
|
||||
showToast = false;
|
||||
dossiersCount: number;
|
||||
@ -24,7 +24,7 @@ export class ConfirmDeleteUsersDialogComponent {
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _userControllerService: UserControllerService,
|
||||
readonly dialogRef: MatDialogRef<ConfirmDeleteUsersDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly users: User[]
|
||||
@Inject(MAT_DIALOG_DATA) readonly users: User[],
|
||||
) {
|
||||
this.dossiersCount = this._dossiersService.all.filter(dw => {
|
||||
for (const user of this.users) {
|
||||
|
||||
@ -12,7 +12,7 @@ import { DictionaryService } from '@shared/services/dictionary.service';
|
||||
@Component({
|
||||
selector: 'redaction-edit-color-dialog',
|
||||
templateUrl: './edit-color-dialog.component.html',
|
||||
styleUrls: ['./edit-color-dialog.component.scss']
|
||||
styleUrls: ['./edit-color-dialog.component.scss'],
|
||||
})
|
||||
export class EditColorDialogComponent {
|
||||
readonly colors: Colors;
|
||||
@ -29,7 +29,7 @@ export class EditColorDialogComponent {
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _dialogRef: MatDialogRef<EditColorDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
private readonly _data: { colors: Colors; colorKey: DefaultColorType; dossierTemplateId: string }
|
||||
private readonly _data: { colors: Colors; colorKey: DefaultColorType; dossierTemplateId: string },
|
||||
) {
|
||||
this.colors = _data.colors;
|
||||
this.colorKey = _data.colorKey;
|
||||
@ -37,7 +37,7 @@ export class EditColorDialogComponent {
|
||||
this._initialColor = _data.colors[this.colorKey];
|
||||
|
||||
this.colorForm = this._formBuilder.group({
|
||||
color: [this.colors[this.colorKey], [Validators.required, Validators.minLength(7)]]
|
||||
color: [this.colors[this.colorKey], [Validators.required, Validators.minLength(7)]],
|
||||
});
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ export class EditColorDialogComponent {
|
||||
async saveColors() {
|
||||
const colors = {
|
||||
...this.colors,
|
||||
[this.colorKey]: this.colorForm.get('color').value
|
||||
[this.colorKey]: this.colorForm.get('color').value,
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
@ -9,7 +9,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
selector: 'redaction-active-fields-listing',
|
||||
templateUrl: './active-fields-listing.component.html',
|
||||
styleUrls: ['./active-fields-listing.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => ActiveFieldsListingComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => ActiveFieldsListingComponent) }],
|
||||
})
|
||||
export class ActiveFieldsListingComponent extends ListingComponent<Field> implements OnChanges {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -19,25 +19,25 @@ export class ActiveFieldsListingComponent extends ListingComponent<Field> implem
|
||||
{
|
||||
label: _('file-attributes-csv-import.table-col-names.name'),
|
||||
class: 'name',
|
||||
width: 'minmax(0, 350px)'
|
||||
width: 'minmax(0, 350px)',
|
||||
},
|
||||
{
|
||||
label: _('file-attributes-csv-import.table-col-names.type'),
|
||||
width: '150px'
|
||||
width: '150px',
|
||||
},
|
||||
{
|
||||
label: _('file-attributes-csv-import.table-col-names.read-only'),
|
||||
class: 'flex-center',
|
||||
leftIcon: 'red:read-only',
|
||||
width: 'auto'
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
label: _('file-attributes-csv-import.table-col-names.primary'),
|
||||
class: 'flex-center',
|
||||
rightIcon: 'red:status-info',
|
||||
rightIconTooltip: _('file-attributes-csv-import.table-col-names.primary-info-tooltip'),
|
||||
width: 'auto'
|
||||
}
|
||||
width: 'auto',
|
||||
},
|
||||
];
|
||||
readonly typeOptions = Object.keys(FileAttributeConfigTypes);
|
||||
@Input() entities: Field[];
|
||||
|
||||
@ -22,7 +22,7 @@ export interface Field extends IListable {
|
||||
@Component({
|
||||
templateUrl: './file-attributes-csv-import-dialog.component.html',
|
||||
styleUrls: ['./file-attributes-csv-import-dialog.component.scss'],
|
||||
providers: [...DefaultListingServices]
|
||||
providers: [...DefaultListingServices],
|
||||
})
|
||||
export class FileAttributesCsvImportDialogComponent extends ListingComponent<Field> {
|
||||
readonly tableColumnConfigs: TableColumnConfig<Field>[] = [];
|
||||
@ -49,14 +49,14 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
readonly csv: File;
|
||||
readonly dossierTemplateId: string;
|
||||
readonly existingConfiguration: FileAttributesConfig;
|
||||
}
|
||||
},
|
||||
) {
|
||||
super(_injector);
|
||||
|
||||
this.baseConfigForm = this._formBuilder.group({
|
||||
filenameMappingColumnHeaderName: ['', [Validators.required, this._autocompleteStringValidator()]],
|
||||
delimiter: [undefined, Validators.required],
|
||||
encoding: ['UTF-8', Validators.required]
|
||||
encoding: ['UTF-8', Validators.required],
|
||||
});
|
||||
|
||||
this.readFile();
|
||||
@ -71,11 +71,11 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
|
||||
readFile() {
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', async event => {
|
||||
reader.addEventListener('load', event => {
|
||||
const parsedCsv = <any>event.target.result;
|
||||
this.parseResult = Papa.parse(parsedCsv, {
|
||||
header: true,
|
||||
delimiter: this.baseConfigForm.get('delimiter').value
|
||||
delimiter: this.baseConfigForm.get('delimiter').value,
|
||||
});
|
||||
this.baseConfigForm.patchValue({ delimiter: this.parseResult.meta.delimiter });
|
||||
|
||||
@ -104,8 +104,8 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
map((value: string) =>
|
||||
this.allEntities
|
||||
.filter(field => field.csvColumn.toLowerCase().indexOf(value.toLowerCase()) !== -1)
|
||||
.map(field => field.csvColumn)
|
||||
)
|
||||
.map(field => field.csvColumn),
|
||||
),
|
||||
);
|
||||
|
||||
if (
|
||||
@ -113,13 +113,13 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
this.allEntities.find(entity => entity.csvColumn === this.data.existingConfiguration.filenameMappingColumnHeaderName)
|
||||
) {
|
||||
this.baseConfigForm.patchValue({
|
||||
filenameMappingColumnHeaderName: this.data.existingConfiguration.filenameMappingColumnHeaderName
|
||||
filenameMappingColumnHeaderName: this.data.existingConfiguration.filenameMappingColumnHeaderName,
|
||||
});
|
||||
}
|
||||
|
||||
this.initialParseConfig = {
|
||||
delimiter: this.baseConfigForm.get('delimiter').value,
|
||||
encoding: this.baseConfigForm.get('encoding').value
|
||||
encoding: this.baseConfigForm.get('encoding').value,
|
||||
};
|
||||
});
|
||||
reader.readAsText(this.data.csv, this.baseConfigForm.get('encoding').value);
|
||||
@ -181,9 +181,9 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
editable: !field.readonly,
|
||||
label: field.name,
|
||||
type: field.type,
|
||||
primaryAttribute: field.primaryAttribute
|
||||
}))
|
||||
]
|
||||
primaryAttribute: field.primaryAttribute,
|
||||
})),
|
||||
],
|
||||
};
|
||||
|
||||
try {
|
||||
@ -230,7 +230,7 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
searchKey: csvColumn,
|
||||
type: isNumber ? FileAttributeConfigTypes.NUMBER : FileAttributeConfigTypes.TEXT,
|
||||
readonly: false,
|
||||
primaryAttribute: false
|
||||
primaryAttribute: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import { SMTPConfiguration } from '@redaction/red-ui-http';
|
||||
@Component({
|
||||
selector: 'redaction-smtp-auth-dialog',
|
||||
templateUrl: './smtp-auth-dialog.component.html',
|
||||
styleUrls: ['./smtp-auth-dialog.component.scss']
|
||||
styleUrls: ['./smtp-auth-dialog.component.scss'],
|
||||
})
|
||||
export class SmtpAuthDialogComponent {
|
||||
authForm: FormGroup;
|
||||
@ -16,11 +16,11 @@ export class SmtpAuthDialogComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _userService: UserService,
|
||||
public dialogRef: MatDialogRef<SmtpAuthDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: SMTPConfiguration
|
||||
@Inject(MAT_DIALOG_DATA) public data: SMTPConfiguration,
|
||||
) {
|
||||
this.authForm = this._formBuilder.group({
|
||||
user: [data?.user || this._userService.currentUser.email, [Validators.required]],
|
||||
password: [data?.password, Validators.required]
|
||||
password: [data?.password, Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ const PAGE_SIZE = 50;
|
||||
selector: 'redaction-audit-screen',
|
||||
templateUrl: './audit-screen.component.html',
|
||||
styleUrls: ['./audit-screen.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => AuditScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => AuditScreenComponent) }],
|
||||
})
|
||||
export class AuditScreenComponent extends ListingComponent<Audit> implements OnDestroy, OnInit {
|
||||
readonly ALL_CATEGORIES = 'allCategories';
|
||||
@ -30,7 +30,7 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnD
|
||||
{ label: _('audit-screen.table-col-names.message') },
|
||||
{ label: _('audit-screen.table-col-names.date') },
|
||||
{ label: _('audit-screen.table-col-names.user'), class: 'user-column' },
|
||||
{ label: _('audit-screen.table-col-names.category') }
|
||||
{ label: _('audit-screen.table-col-names.category') },
|
||||
];
|
||||
readonly tableHeaderLabel = _('audit-screen.table-header.title');
|
||||
private _previousFrom: Moment;
|
||||
@ -41,14 +41,14 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnD
|
||||
protected readonly _injector: Injector,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _auditControllerService: AuditControllerService
|
||||
private readonly _auditControllerService: AuditControllerService,
|
||||
) {
|
||||
super(_injector);
|
||||
this.filterForm = this._formBuilder.group({
|
||||
category: [this.ALL_CATEGORIES],
|
||||
userId: [this.ALL_USERS],
|
||||
from: [],
|
||||
to: []
|
||||
to: [],
|
||||
});
|
||||
|
||||
this.addSubscription = this.filterForm.valueChanges.subscribe(async value => {
|
||||
@ -99,7 +99,7 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnD
|
||||
category: category === this.ALL_CATEGORIES ? undefined : category,
|
||||
userId: userId === this.ALL_USERS ? undefined : userId,
|
||||
from,
|
||||
to
|
||||
to,
|
||||
};
|
||||
|
||||
promises.push(this._auditControllerService.getAuditCategories().toPromise());
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
IListable,
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { DefaultColorType } from '@models/default-color-key.model';
|
||||
import { defaultColorsTranslations } from '../../translations/default-colors-translations';
|
||||
@ -27,7 +27,7 @@ interface ListItem extends IListable {
|
||||
templateUrl: './default-colors-screen.component.html',
|
||||
styleUrls: ['./default-colors-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DefaultColorsScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DefaultColorsScreenComponent) }],
|
||||
})
|
||||
export class DefaultColorsScreenComponent extends ListingComponent<ListItem> implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -36,7 +36,7 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
readonly tableHeaderLabel = _('default-colors-screen.table-header.title');
|
||||
readonly tableColumnConfigs: TableColumnConfig<ListItem>[] = [
|
||||
{ label: _('default-colors-screen.table-col-names.key'), sortByKey: 'searchKey', width: '2fr' },
|
||||
{ label: _('default-colors-screen.table-col-names.color'), class: 'flex-center' }
|
||||
{ label: _('default-colors-screen.table-col-names.color'), class: 'flex-center' },
|
||||
];
|
||||
private _colorsObj: Colors;
|
||||
|
||||
@ -48,7 +48,7 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _dictionaryService: DictionaryService
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -64,12 +64,12 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
{
|
||||
colors: this._colorsObj,
|
||||
colorKey: color.key,
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId,
|
||||
},
|
||||
async () => {
|
||||
await this._loadColors();
|
||||
await this._appStateService.refreshDossierTemplate(this._dossierTemplatesService.activeDossierTemplateId);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
id: key,
|
||||
key,
|
||||
searchKey: key,
|
||||
value: data[key]
|
||||
value: data[key],
|
||||
}))
|
||||
.filter(entry => entry.id !== 'dossierTemplateId');
|
||||
this.entitiesService.setEntities(entities);
|
||||
|
||||
@ -12,7 +12,7 @@ import {
|
||||
IconButtonTypes,
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -24,13 +24,13 @@ const toChartConfig = (dict: TypeValue): DoughnutChartConfig => ({
|
||||
value: dict.entries?.length ?? 0,
|
||||
color: dict.hexColor,
|
||||
label: dict.label,
|
||||
key: dict.type
|
||||
key: dict.type,
|
||||
});
|
||||
|
||||
@Component({
|
||||
templateUrl: './dictionary-listing-screen.component.html',
|
||||
styleUrls: ['./dictionary-listing-screen.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DictionaryListingScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DictionaryListingScreenComponent) }],
|
||||
})
|
||||
export class DictionaryListingScreenComponent extends ListingComponent<TypeValue> implements OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -40,7 +40,7 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
readonly tableColumnConfigs: TableColumnConfig<TypeValue>[] = [
|
||||
{ label: _('dictionary-listing.table-col-names.type'), sortByKey: 'searchKey', width: '2fr' },
|
||||
{ label: _('dictionary-listing.table-col-names.order-of-importance'), sortByKey: 'rank', class: 'flex-center' },
|
||||
{ label: _('dictionary-listing.table-col-names.hint-redaction'), class: 'flex-center' }
|
||||
{ label: _('dictionary-listing.table-col-names.hint-redaction'), class: 'flex-center' },
|
||||
];
|
||||
chartData: DoughnutChartConfig[] = [];
|
||||
|
||||
@ -53,7 +53,7 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _dictionaryService: DictionaryService
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
) {
|
||||
super(_injector);
|
||||
_loadingService.start();
|
||||
@ -69,7 +69,7 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
await this._dictionaryService
|
||||
.deleteTypes(
|
||||
types.map(t => t.type),
|
||||
this._dossierTemplatesService.activeDossierTemplateId
|
||||
this._dossierTemplatesService.activeDossierTemplateId,
|
||||
)
|
||||
.toPromise();
|
||||
this.listingService.setSelected([]);
|
||||
@ -86,7 +86,7 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
$event,
|
||||
{
|
||||
dictionary,
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId,
|
||||
},
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
@ -94,7 +94,7 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
this._loadDictionaryData(false);
|
||||
this._calculateData();
|
||||
this._loadingService.stop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
entities.map(dict => {
|
||||
dict.entries = this.allEntities.find(d => d.type === dict.type)?.entries || [];
|
||||
return dict;
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
this.entitiesService.setEntities(entities);
|
||||
@ -123,8 +123,8 @@ export class DictionaryListingScreenComponent extends ListingComponent<TypeValue
|
||||
catchError(() => {
|
||||
dict.entries = [];
|
||||
return of({});
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
forkJoin(dataObs)
|
||||
|
||||
@ -14,7 +14,7 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
|
||||
@Component({
|
||||
templateUrl: './dictionary-overview-screen.component.html',
|
||||
styleUrls: ['./dictionary-overview-screen.component.scss']
|
||||
styleUrls: ['./dictionary-overview-screen.component.scss'],
|
||||
})
|
||||
export class DictionaryOverviewScreenComponent extends ComponentHasChanges implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -36,7 +36,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
protected readonly _translateService: TranslateService,
|
||||
private readonly _dictionaryService: DictionaryService
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
) {
|
||||
super(_translateService);
|
||||
}
|
||||
@ -57,14 +57,14 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
$event,
|
||||
{
|
||||
dictionary: this.dictionary,
|
||||
dossierTemplateId: this.dictionary.dossierTemplateId
|
||||
dossierTemplateId: this.dictionary.dossierTemplateId,
|
||||
},
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
await this._appStateService.loadDictionaryData();
|
||||
this.dictionary = this._appStateService.activeDictionary;
|
||||
this._loadingService.stop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
'admin',
|
||||
'dossier-templates',
|
||||
this._dossierTemplatesService.activeDossierTemplateId,
|
||||
'dictionaries'
|
||||
'dictionaries',
|
||||
]);
|
||||
});
|
||||
}
|
||||
@ -87,7 +87,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
download(): void {
|
||||
const content = this._dictionaryManager.editor.value;
|
||||
const blob = new Blob([content], {
|
||||
type: 'text/plain;charset=utf-8'
|
||||
type: 'text/plain;charset=utf-8',
|
||||
});
|
||||
saveAs(blob, `${this.dictionary.label}.txt`);
|
||||
}
|
||||
@ -113,7 +113,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
},
|
||||
() => {
|
||||
this._loadingService.stop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
() => {
|
||||
this._loadingService.stop();
|
||||
this.entries = [];
|
||||
}
|
||||
},
|
||||
)
|
||||
.catch(() => {
|
||||
this._loadingService.stop();
|
||||
|
||||
@ -10,7 +10,7 @@ import { RouterHistoryService } from '@services/router-history.service';
|
||||
@Component({
|
||||
selector: 'redaction-digital-signature-screen',
|
||||
templateUrl: './digital-signature-screen.component.html',
|
||||
styleUrls: ['./digital-signature-screen.component.scss']
|
||||
styleUrls: ['./digital-signature-screen.component.scss'],
|
||||
})
|
||||
export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements OnDestroy {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -27,7 +27,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
private readonly _digitalSignatureControllerService: DigitalSignatureControllerService
|
||||
private readonly _digitalSignatureControllerService: DigitalSignatureControllerService,
|
||||
) {
|
||||
super();
|
||||
this.loadDigitalSignatureAndInitializeForm();
|
||||
@ -39,7 +39,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements
|
||||
|
||||
saveDigitalSignature() {
|
||||
const digitalSignature = {
|
||||
...this.digitalSignatureForm.getRawValue()
|
||||
...this.digitalSignatureForm.getRawValue(),
|
||||
};
|
||||
//adjusted for chrome auto-complete / password manager
|
||||
digitalSignature.password = digitalSignature.keySecret;
|
||||
@ -59,7 +59,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements
|
||||
} else {
|
||||
this._toaster.error(_('digital-signature-screen.action.save-error'));
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements
|
||||
this.loadDigitalSignatureAndInitializeForm();
|
||||
this._toaster.success(_('digital-signature-screen.action.delete-success'));
|
||||
},
|
||||
() => this._toaster.error(_('digital-signature-screen.action.delete-error'))
|
||||
() => this._toaster.error(_('digital-signature-screen.action.delete-error')),
|
||||
);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements
|
||||
() => {
|
||||
this.digitalSignatureExists = false;
|
||||
this.digitalSignature = {};
|
||||
}
|
||||
},
|
||||
)
|
||||
.add(() => {
|
||||
this._initForm();
|
||||
@ -115,7 +115,7 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribe implements
|
||||
reason: this.digitalSignature.reason,
|
||||
base64EncodedPrivateKey: this.digitalSignatureExists
|
||||
? null
|
||||
: [this.digitalSignature.base64EncodedPrivateKey, Validators.required]
|
||||
: [this.digitalSignature.base64EncodedPrivateKey, Validators.required],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
IconButtonTypes,
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { IDossierAttributeConfig } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
@ -23,8 +23,8 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
styleUrls: ['./dossier-attributes-listing-screen.component.scss'],
|
||||
providers: [
|
||||
...DefaultListingServices,
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => DossierAttributesListingScreenComponent) }
|
||||
]
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => DossierAttributesListingScreenComponent) },
|
||||
],
|
||||
})
|
||||
export class DossierAttributesListingScreenComponent extends ListingComponent<DossierAttributeConfig> implements OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -35,7 +35,7 @@ export class DossierAttributesListingScreenComponent extends ListingComponent<Do
|
||||
readonly tableColumnConfigs: TableColumnConfig<DossierAttributeConfig>[] = [
|
||||
{ label: _('dossier-attributes-listing.table-col-names.label'), sortByKey: 'label', width: '2fr' },
|
||||
{ label: _('dossier-attributes-listing.table-col-names.placeholder'), width: '2fr' },
|
||||
{ label: _('dossier-attributes-listing.table-col-names.type'), sortByKey: 'type' }
|
||||
{ label: _('dossier-attributes-listing.table-col-names.type'), sortByKey: 'type' },
|
||||
];
|
||||
|
||||
constructor(
|
||||
@ -46,12 +46,12 @@ export class DossierAttributesListingScreenComponent extends ListingComponent<Do
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _dossierAttributesService: DossierAttributesService,
|
||||
private readonly _userService: UserService
|
||||
private readonly _userService: UserService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
async ngOnInit(): Promise<void> {
|
||||
await this._loadData();
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ export class DossierAttributesListingScreenComponent extends ListingComponent<Do
|
||||
'addEditDossierAttribute',
|
||||
$event,
|
||||
{ dossierAttribute, dossierTemplateId },
|
||||
async () => await this._loadData()
|
||||
async () => this._loadData(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig,
|
||||
Toaster
|
||||
Toaster,
|
||||
} from '@iqser/common-ui';
|
||||
import { DossierTemplateControllerService } from '@redaction/red-ui-http';
|
||||
import { UserService } from '@services/user.service';
|
||||
@ -26,8 +26,8 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
providers: [
|
||||
...DefaultListingServicesTmp,
|
||||
{ provide: EntitiesService, useExisting: DossierTemplatesService },
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => DossierTemplatesListingScreenComponent) }
|
||||
]
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => DossierTemplatesListingScreenComponent) },
|
||||
],
|
||||
})
|
||||
export class DossierTemplatesListingScreenComponent extends ListingComponent<DossierTemplate> implements OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -38,7 +38,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent<Dos
|
||||
{ label: _('dossier-templates-listing.table-col-names.name'), sortByKey: 'searchKey' },
|
||||
{ label: _('dossier-templates-listing.table-col-names.created-by'), class: 'user-column' },
|
||||
{ label: _('dossier-templates-listing.table-col-names.created-on'), sortByKey: 'dateAdded' },
|
||||
{ label: _('dossier-templates-listing.table-col-names.modified-on'), sortByKey: 'dateModified' }
|
||||
{ label: _('dossier-templates-listing.table-col-names.modified-on'), sortByKey: 'dateModified' },
|
||||
];
|
||||
|
||||
constructor(
|
||||
@ -51,7 +51,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent<Dos
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
private readonly _dossierTemplateControllerService: DossierTemplateControllerService
|
||||
private readonly _dossierTemplateControllerService: DossierTemplateControllerService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -61,7 +61,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent<Dos
|
||||
}
|
||||
|
||||
openBulkDeleteTemplatesDialog($event?: MouseEvent) {
|
||||
return this._dialogService.openDialog('confirm', $event, null, async () => {
|
||||
return this._dialogService.openDialog('confirm', $event, null, () => {
|
||||
this._loadingService.loadWhile(this._deleteTemplates());
|
||||
});
|
||||
}
|
||||
@ -89,7 +89,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent<Dos
|
||||
}
|
||||
});
|
||||
this.listingService.setSelected([]);
|
||||
await this._dossierTemplatesService.loadAll();
|
||||
await this._dossierTemplatesService.loadAll().toPromise();
|
||||
await this._appStateService.loadDictionaryData();
|
||||
this.loadDossierTemplatesData();
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
IconButtonTypes,
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { fileAttributeTypesTranslations } from '../../translations/file-attribute-types-translations';
|
||||
import { UserService } from '@services/user.service';
|
||||
@ -24,8 +24,8 @@ import { DossierTemplatesService } from '../../../dossier/services/dossier-templ
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [
|
||||
...DefaultListingServices,
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => FileAttributesListingScreenComponent) }
|
||||
]
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => FileAttributesListingScreenComponent) },
|
||||
],
|
||||
})
|
||||
export class FileAttributesListingScreenComponent extends ListingComponent<FileAttributeConfig> implements OnInit, OnDestroy {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -44,8 +44,8 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
label: _('file-attributes-listing.table-col-names.primary'),
|
||||
class: 'flex-center',
|
||||
rightIcon: 'red:status-info',
|
||||
rightIconTooltip: _('file-attributes-listing.table-col-names.primary-info-tooltip')
|
||||
}
|
||||
rightIconTooltip: _('file-attributes-listing.table-col-names.primary-info-tooltip'),
|
||||
},
|
||||
];
|
||||
private _existingConfiguration: FileAttributesConfig;
|
||||
@ViewChild('fileInput') private _fileInput: ElementRef;
|
||||
@ -58,7 +58,7 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _fileAttributesService: FileAttributesService
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -79,7 +79,7 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
.toPromise();
|
||||
await this._appStateService.refreshDossierTemplate(this._dossierTemplatesService.activeDossierTemplateId);
|
||||
await this._loadData();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
await this._fileAttributesService
|
||||
.deleteFileAttributes(
|
||||
this.listingService.selected.map(f => f.id),
|
||||
dossierTemplateId
|
||||
dossierTemplateId,
|
||||
)
|
||||
.toPromise();
|
||||
}
|
||||
@ -112,9 +112,9 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
{
|
||||
csv,
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId,
|
||||
existingConfiguration: this._existingConfiguration
|
||||
existingConfiguration: this._existingConfiguration,
|
||||
},
|
||||
async () => await this._loadData()
|
||||
async () => this._loadData(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
GeneralConfigurationModel,
|
||||
GeneralSettingsControllerService,
|
||||
SMTPConfiguration,
|
||||
SmtpConfigurationControllerService
|
||||
SmtpConfigurationControllerService,
|
||||
} from '@redaction/red-ui-http';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { AutoUnsubscribe, IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
@ -15,7 +15,7 @@ import { UserService } from '@services/user.service';
|
||||
@Component({
|
||||
selector: 'redaction-general-config-screen',
|
||||
templateUrl: './general-config-screen.component.html',
|
||||
styleUrls: ['./general-config-screen.component.scss']
|
||||
styleUrls: ['./general-config-screen.component.scss'],
|
||||
})
|
||||
export class GeneralConfigScreenComponent extends AutoUnsubscribe implements OnInit, OnDestroy {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -35,13 +35,13 @@ export class GeneralConfigScreenComponent extends AutoUnsubscribe implements OnI
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _smtpConfigService: SmtpConfigurationControllerService,
|
||||
private readonly _generalSettingsControllerService: GeneralSettingsControllerService
|
||||
private readonly _generalSettingsControllerService: GeneralSettingsControllerService,
|
||||
) {
|
||||
super();
|
||||
|
||||
this.configForm = this._formBuilder.group({
|
||||
forgotPasswordFunctionEnabled: [false],
|
||||
auxiliaryName: [undefined]
|
||||
auxiliaryName: [undefined],
|
||||
});
|
||||
|
||||
this.smtpForm = this._formBuilder.group({
|
||||
@ -56,7 +56,7 @@ export class GeneralConfigScreenComponent extends AutoUnsubscribe implements OnI
|
||||
starttls: [false],
|
||||
auth: [false],
|
||||
user: [undefined],
|
||||
password: [undefined]
|
||||
password: [undefined],
|
||||
});
|
||||
|
||||
this.addSubscription = this.smtpForm.controls.auth.valueChanges.subscribe(auth => {
|
||||
|
||||
@ -11,7 +11,7 @@ import { RouterHistoryService } from '@services/router-history.service';
|
||||
@Component({
|
||||
selector: 'redaction-license-information-screen',
|
||||
templateUrl: './license-information-screen.component.html',
|
||||
styleUrls: ['./license-information-screen.component.scss']
|
||||
styleUrls: ['./license-information-screen.component.scss'],
|
||||
})
|
||||
export class LicenseInformationScreenComponent implements OnInit {
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
@ -19,8 +19,8 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
{
|
||||
label: _('license-info-screen.email-report'),
|
||||
action: (): void => this.sendMail(),
|
||||
type: IconButtonTypes.primary
|
||||
}
|
||||
type: IconButtonTypes.primary,
|
||||
},
|
||||
];
|
||||
|
||||
currentInfo: LicenseReport = {};
|
||||
@ -33,12 +33,12 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
lineChartScheme = {
|
||||
selectable: true,
|
||||
group: 'Ordinal',
|
||||
domain: ['#dd4d50', '#5ce594', '#0389ec']
|
||||
domain: ['#dd4d50', '#5ce594', '#0389ec'],
|
||||
};
|
||||
comboBarScheme = {
|
||||
selectable: true,
|
||||
group: 'Ordinal',
|
||||
domain: ['#0389ec']
|
||||
domain: ['#0389ec'],
|
||||
};
|
||||
|
||||
constructor(
|
||||
@ -47,7 +47,7 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
private readonly _loadingService: LoadingService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _licenseReportController: LicenseReportControllerService
|
||||
private readonly _licenseReportController: LicenseReportControllerService,
|
||||
) {
|
||||
_loadingService.start();
|
||||
}
|
||||
@ -65,16 +65,16 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
|
||||
const currentConfig = {
|
||||
startDate: startDate.toDate(),
|
||||
endDate: endDate.toDate()
|
||||
endDate: endDate.toDate(),
|
||||
};
|
||||
const promises = [
|
||||
this._licenseReportController.licenseReport(currentConfig).toPromise(),
|
||||
this._licenseReportController.licenseReport({}).toPromise()
|
||||
this._licenseReportController.licenseReport({}).toPromise(),
|
||||
];
|
||||
|
||||
if (endDate.isBefore(moment())) {
|
||||
const unlicensedConfig = {
|
||||
startDate: endDate.toDate()
|
||||
startDate: endDate.toDate(),
|
||||
};
|
||||
promises.push(this._licenseReportController.licenseReport(unlicensedConfig).toPromise());
|
||||
}
|
||||
@ -92,16 +92,16 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
sendMail(): void {
|
||||
const licenseCustomer = this.configService.values.LICENSE_CUSTOMER;
|
||||
const subject = this._translateService.instant('license-info-screen.email.title', {
|
||||
licenseCustomer
|
||||
licenseCustomer,
|
||||
});
|
||||
const lineBreak = '%0D%0A';
|
||||
const body = [
|
||||
this._translateService.instant('license-info-screen.email.body.analyzed', {
|
||||
pages: this.currentInfo.numberOfAnalyzedPages
|
||||
pages: this.currentInfo.numberOfAnalyzedPages,
|
||||
}),
|
||||
this._translateService.instant('license-info-screen.email.body.licensed', {
|
||||
pages: this.totalLicensedNumberOfPages
|
||||
})
|
||||
pages: this.totalLicensedNumberOfPages,
|
||||
}),
|
||||
].join(lineBreak);
|
||||
window.location.href = `mailto:${this.configService.values.LICENSE_EMAIL}?subject=${subject}&body=${body}`;
|
||||
}
|
||||
@ -120,7 +120,7 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
while (m <= endMonth && y <= endYear) {
|
||||
totalLicensedSeries.push({
|
||||
name: `${moment.localeData().monthsShort(moment([y, m]))} ${y}`,
|
||||
value: this.totalLicensedNumberOfPages
|
||||
value: this.totalLicensedNumberOfPages,
|
||||
});
|
||||
|
||||
let nm = m + 1;
|
||||
@ -134,9 +134,9 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
this._licenseReportController
|
||||
.licenseReport({
|
||||
startDate: moment(`01-${m + 1}-${y}`, 'DD-MM-YYYY').toDate(),
|
||||
endDate: moment(`01-${nm + 1}-${ny}`, 'DD-MM-YYYY').toDate()
|
||||
endDate: moment(`01-${nm + 1}-${ny}`, 'DD-MM-YYYY').toDate(),
|
||||
})
|
||||
.toPromise()
|
||||
.toPromise(),
|
||||
);
|
||||
|
||||
y = ny;
|
||||
@ -153,11 +153,11 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
cumulativePages += report.numberOfAnalyzedPages;
|
||||
this.barChart.push({
|
||||
name: `${moment.localeData().monthsShort(moment([y, m]))} ${y}`,
|
||||
value: report.numberOfAnalyzedPages
|
||||
value: report.numberOfAnalyzedPages,
|
||||
});
|
||||
cumulativePagesSeries.push({
|
||||
name: `${moment.localeData().monthsShort(moment([y, m]))} ${y}`,
|
||||
value: cumulativePages
|
||||
value: cumulativePages,
|
||||
});
|
||||
m++;
|
||||
if (m === 12) {
|
||||
@ -169,12 +169,12 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
this.lineChartSeries = [
|
||||
{
|
||||
name: this._translateService.instant('license-info-screen.chart.licensed-total'),
|
||||
series: totalLicensedSeries
|
||||
series: totalLicensedSeries,
|
||||
},
|
||||
{
|
||||
name: this._translateService.instant('license-info-screen.chart.cumulative'),
|
||||
series: cumulativePagesSeries
|
||||
}
|
||||
series: cumulativePagesSeries,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import { ConfirmationDialogInput, LoadingService, Toaster } from '@iqser/common-
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import {
|
||||
generalPlaceholdersDescriptionsTranslations,
|
||||
placeholdersDescriptionsTranslations
|
||||
placeholdersDescriptionsTranslations,
|
||||
} from '../../translations/placeholders-descriptions-translations';
|
||||
import { removeBraces } from '@utils/functions';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -26,7 +26,7 @@ const placeholderTypes: PlaceholderType[] = ['generalPlaceholders', 'fileAttribu
|
||||
@Component({
|
||||
selector: 'redaction-reports-screen',
|
||||
templateUrl: './reports-screen.component.html',
|
||||
styleUrls: ['./reports-screen.component.scss']
|
||||
styleUrls: ['./reports-screen.component.scss'],
|
||||
})
|
||||
export class ReportsScreenComponent implements OnInit {
|
||||
placeholders: Placeholder[];
|
||||
@ -42,7 +42,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _loadingService: LoadingService,
|
||||
readonly permissionsService: PermissionsService
|
||||
readonly permissionsService: PermissionsService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@ -52,7 +52,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
async uploadTemplate($event) {
|
||||
uploadTemplate($event) {
|
||||
this._loadingService.loadWhile(this._uploadTemplate($event));
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
deleteTemplate(template: ReportTemplate) {
|
||||
this._dialogService.openDialog('confirm', null, null, async () => {
|
||||
this._dialogService.openDialog('confirm', null, null, () => {
|
||||
this._loadingService.loadWhile(this._deleteTemplate(template));
|
||||
});
|
||||
}
|
||||
@ -98,8 +98,8 @@ export class ReportsScreenComponent implements OnInit {
|
||||
denyText: _('confirmation-dialog.upload-report-template.deny-text'),
|
||||
alternativeConfirmationText: _('confirmation-dialog.upload-report-template.alternate-confirmation-text'),
|
||||
translateParams: {
|
||||
fileName: file.name
|
||||
}
|
||||
fileName: file.name,
|
||||
},
|
||||
});
|
||||
this._dialogService.openDialog('confirm', null, data, null, async result => {
|
||||
if (result) {
|
||||
@ -133,8 +133,8 @@ export class ReportsScreenComponent implements OnInit {
|
||||
placeholdersResponse[type].map(placeholder => ({
|
||||
placeholder,
|
||||
descriptionTranslation: this._getPlaceholderDescriptionTranslation(type, placeholder),
|
||||
attributeName: this._getAttributeName(placeholder)
|
||||
}))
|
||||
attributeName: this._getAttributeName(placeholder),
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ import IStandaloneEditorConstructionOptions = monaco.editor.IStandaloneEditorCon
|
||||
@Component({
|
||||
selector: 'redaction-rules-screen',
|
||||
templateUrl: './rules-screen.component.html',
|
||||
styleUrls: ['./rules-screen.component.scss']
|
||||
styleUrls: ['./rules-screen.component.scss'],
|
||||
})
|
||||
export class RulesScreenComponent extends ComponentHasChanges implements OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -24,7 +24,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
theme: 'vs',
|
||||
language: 'java',
|
||||
automaticLayout: true,
|
||||
readOnly: !this.permissionsService.isAdmin()
|
||||
readOnly: !this.permissionsService.isAdmin(),
|
||||
};
|
||||
|
||||
initialLines: string[] = [];
|
||||
@ -44,7 +44,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
private readonly _toaster: Toaster,
|
||||
protected readonly _translateService: TranslateService,
|
||||
private readonly _activatedRoute: ActivatedRoute,
|
||||
private readonly _loadingService: LoadingService
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {
|
||||
super(_translateService);
|
||||
}
|
||||
@ -73,8 +73,8 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
inherit: true,
|
||||
rules: [],
|
||||
colors: {
|
||||
'editor.lineHighlightBackground': '#f4f5f7'
|
||||
}
|
||||
'editor.lineHighlightBackground': '#f4f5f7',
|
||||
},
|
||||
});
|
||||
(window as any).monaco.editor.setTheme('redaction');
|
||||
}
|
||||
@ -91,7 +91,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
await this._rulesControllerService
|
||||
.uploadRules({
|
||||
rules: this._codeEditor.getModel().getValue(),
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId
|
||||
dossierTemplateId: this._dossierTemplatesService.activeDossierTemplateId,
|
||||
})
|
||||
.toPromise()
|
||||
.then(
|
||||
@ -102,7 +102,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
() => {
|
||||
this._loadingService.stop();
|
||||
this._toaster.error(_('rules-screen.error.generic'));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
download(): void {
|
||||
const content = this._codeEditor.getModel().getValue();
|
||||
const blob = new Blob([content], {
|
||||
type: 'text/plain;charset=utf-8'
|
||||
type: 'text/plain;charset=utf-8',
|
||||
});
|
||||
saveAs(blob, 'rules.txt');
|
||||
}
|
||||
@ -142,7 +142,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
|
||||
return {
|
||||
range: new monaco.Range(line, 1, line, 1),
|
||||
options: { isWholeLine: true, className: 'changed-row-marker' }
|
||||
options: { isWholeLine: true, className: 'changed-row-marker' },
|
||||
} as IModelDeltaDecoration;
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit
|
||||
this.currentLines = this.initialLines = rules.rules.split('\n');
|
||||
this.revert();
|
||||
},
|
||||
() => this._loadingService.stop()
|
||||
() => this._loadingService.stop(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
LoadingService,
|
||||
SortingOrders,
|
||||
TableColumnConfig,
|
||||
TitleColors
|
||||
TitleColors,
|
||||
} from '@iqser/common-ui';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import * as moment from 'moment';
|
||||
@ -30,7 +30,7 @@ interface DossierListItem extends IDossier, IListable {
|
||||
templateUrl: './trash-screen.component.html',
|
||||
styleUrls: ['./trash-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => TrashScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => TrashScreenComponent) }],
|
||||
})
|
||||
export class TrashScreenComponent extends ListingComponent<DossierListItem> implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -40,7 +40,7 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
|
||||
{ label: _('trash.table-col-names.name'), sortByKey: 'searchKey' },
|
||||
{ label: _('trash.table-col-names.owner'), class: 'user-column' },
|
||||
{ label: _('trash.table-col-names.deleted-on'), sortByKey: 'softDeletedTime' },
|
||||
{ label: _('trash.table-col-names.time-to-restore'), sortByKey: 'softDeletedTime' }
|
||||
{ label: _('trash.table-col-names.time-to-restore'), sortByKey: 'softDeletedTime' },
|
||||
];
|
||||
|
||||
constructor(
|
||||
@ -49,7 +49,7 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
|
||||
private readonly _dossiersService: DossiersService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _adminDialogService: AdminDialogService
|
||||
private readonly _adminDialogService: AdminDialogService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -57,7 +57,7 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
|
||||
private get _canRestoreSelected$(): Observable<boolean> {
|
||||
return this.listingService.selectedEntities$.pipe(
|
||||
map(entities => entities.length && !entities.find(dossier => !dossier.canRestore)),
|
||||
distinctUntilChanged()
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
|
||||
await this._loadDossiersData();
|
||||
this.sortingService.setSortingOption({
|
||||
column: 'softDeletedTime',
|
||||
order: SortingOrders.desc
|
||||
order: SortingOrders.desc,
|
||||
});
|
||||
this._loadingService.stop();
|
||||
}
|
||||
@ -84,10 +84,10 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
|
||||
denyText: _('confirmation-dialog.delete-dossier.deny-text'),
|
||||
translateParams: {
|
||||
dossierName: dossiers[0].dossierName,
|
||||
dossiersCount: dossiers.length
|
||||
}
|
||||
dossiersCount: dossiers.length,
|
||||
},
|
||||
});
|
||||
this._adminDialogService.openDialog('confirm', null, data, async () => {
|
||||
this._adminDialogService.openDialog('confirm', null, data, () => {
|
||||
this._loadingService.loadWhile(this._hardDelete(dossiers));
|
||||
});
|
||||
}
|
||||
@ -123,7 +123,7 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
|
||||
restoreDate,
|
||||
canRestore: this._canRestoreDossier(restoreDate),
|
||||
// Because of migrations, for some this is not set
|
||||
softDeletedTime: dossier.softDeletedTime || '-'
|
||||
softDeletedTime: dossier.softDeletedTime || '-',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
IconButtonTypes,
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
TableColumnConfig
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { InitialsAvatarComponent } from '@shared/components/initials-avatar/initials-avatar.component';
|
||||
import { Observable } from 'rxjs';
|
||||
@ -23,7 +23,7 @@ import { User } from '@models/user';
|
||||
@Component({
|
||||
templateUrl: './user-listing-screen.component.html',
|
||||
styleUrls: ['./user-listing-screen.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => UserListingScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => UserListingScreenComponent) }],
|
||||
})
|
||||
export class UserListingScreenComponent extends ListingComponent<User> implements OnInit {
|
||||
readonly translations = rolesTranslations;
|
||||
@ -36,7 +36,7 @@ export class UserListingScreenComponent extends ListingComponent<User> implement
|
||||
{ label: _('user-listing.table-col-names.name'), width: '2fr' },
|
||||
{ label: _('user-listing.table-col-names.email') },
|
||||
{ label: _('user-listing.table-col-names.active'), class: 'flex-center' },
|
||||
{ label: _('user-listing.table-col-names.roles') }
|
||||
{ label: _('user-listing.table-col-names.roles') },
|
||||
];
|
||||
collapsedDetails = false;
|
||||
chartData: DoughnutChartConfig[] = [];
|
||||
@ -50,7 +50,7 @@ export class UserListingScreenComponent extends ListingComponent<User> implement
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _userControllerService: UserControllerService,
|
||||
private readonly _translateChartService: TranslateChartService
|
||||
private readonly _translateChartService: TranslateChartService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -108,34 +108,34 @@ export class UserListingScreenComponent extends ListingComponent<User> implement
|
||||
{
|
||||
value: this.allEntities.filter(user => !user.isActive).length,
|
||||
color: 'INACTIVE',
|
||||
label: 'INACTIVE'
|
||||
label: 'INACTIVE',
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(user => user.roles.length === 1 && user.roles[0] === 'RED_USER').length,
|
||||
color: 'REGULAR',
|
||||
label: 'REGULAR'
|
||||
label: 'REGULAR',
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(user => user.isManager && !user.isAdmin).length,
|
||||
color: 'MANAGER',
|
||||
label: 'RED_MANAGER'
|
||||
label: 'RED_MANAGER',
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(user => user.isManager && user.isAdmin).length,
|
||||
color: 'MANAGER_ADMIN',
|
||||
label: 'MANAGER_ADMIN'
|
||||
label: 'MANAGER_ADMIN',
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(user => user.isUserAdmin && !user.isAdmin).length,
|
||||
color: 'USER_ADMIN',
|
||||
label: 'RED_USER_ADMIN'
|
||||
label: 'RED_USER_ADMIN',
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(user => user.isAdmin && !user.isManager).length,
|
||||
color: 'ADMIN',
|
||||
label: 'RED_ADMIN'
|
||||
}
|
||||
].filter(type => type.value > 0)
|
||||
label: 'RED_ADMIN',
|
||||
},
|
||||
].filter(type => type.value > 0),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,13 +18,13 @@ export const DEFAULT_WATERMARK: WatermarkModel = {
|
||||
opacity: 70,
|
||||
fontSize: 11,
|
||||
fontType: 'sans-serif',
|
||||
orientation: WatermarkModel.OrientationEnum.DIAGONAL
|
||||
orientation: WatermarkModel.OrientationEnum.DIAGONAL,
|
||||
} as const;
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-watermark-screen',
|
||||
templateUrl: './watermark-screen.component.html',
|
||||
styleUrls: ['./watermark-screen.component.scss']
|
||||
styleUrls: ['./watermark-screen.component.scss'],
|
||||
})
|
||||
export class WatermarkScreenComponent implements OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -44,7 +44,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _activatedRoute: ActivatedRoute,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _loadingService: LoadingService
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {
|
||||
this._loadingService.start();
|
||||
this._initForm();
|
||||
@ -73,7 +73,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
|
||||
save() {
|
||||
const watermark = {
|
||||
...this.configForm.getRawValue()
|
||||
...this.configForm.getRawValue(),
|
||||
};
|
||||
|
||||
const dossierTemplateId = this._dossierTemplatesService.activeDossierTemplateId;
|
||||
@ -86,10 +86,10 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
() => {
|
||||
this._loadWatermark();
|
||||
this._toaster.success(
|
||||
watermark.text ? _('watermark-screen.action.change-success') : _('watermark-screen.action.delete-success')
|
||||
watermark.text ? _('watermark-screen.action.change-success') : _('watermark-screen.action.delete-success'),
|
||||
);
|
||||
},
|
||||
() => this._toaster.error(_('watermark-screen.action.error'))
|
||||
() => this._toaster.error(_('watermark-screen.action.error')),
|
||||
);
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
this._watermark = DEFAULT_WATERMARK;
|
||||
this.configForm.setValue({ ...this._watermark });
|
||||
this._loadViewer();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -131,9 +131,9 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
css: this._baseHref + '/assets/pdftron/stylesheet.css',
|
||||
fullAPI: true,
|
||||
isReadOnly: true,
|
||||
backendType: 'ems'
|
||||
backendType: 'ems',
|
||||
},
|
||||
this._viewer.nativeElement
|
||||
this._viewer.nativeElement,
|
||||
).then(instance => {
|
||||
this._instance = instance;
|
||||
|
||||
@ -146,7 +146,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
|
||||
return this._http
|
||||
.request('get', '/assets/pdftron/blank.pdf', {
|
||||
responseType: 'blob'
|
||||
responseType: 'blob',
|
||||
})
|
||||
.subscribe(blobData => {
|
||||
this._instance.UI.loadDocument(blobData, { filename: 'blank.pdf' });
|
||||
@ -182,38 +182,38 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
hexColor: [
|
||||
{
|
||||
value: null,
|
||||
disabled: !this.permissionsService.isAdmin()
|
||||
disabled: !this.permissionsService.isAdmin(),
|
||||
},
|
||||
Validators.required
|
||||
Validators.required,
|
||||
],
|
||||
opacity: [
|
||||
{
|
||||
value: null,
|
||||
disabled: !this.permissionsService.isAdmin()
|
||||
disabled: !this.permissionsService.isAdmin(),
|
||||
},
|
||||
Validators.required
|
||||
Validators.required,
|
||||
],
|
||||
fontSize: [
|
||||
{
|
||||
value: null,
|
||||
disabled: !this.permissionsService.isAdmin()
|
||||
disabled: !this.permissionsService.isAdmin(),
|
||||
},
|
||||
Validators.required
|
||||
Validators.required,
|
||||
],
|
||||
fontType: [
|
||||
{
|
||||
value: null,
|
||||
disabled: !this.permissionsService.isAdmin()
|
||||
disabled: !this.permissionsService.isAdmin(),
|
||||
},
|
||||
Validators.required
|
||||
Validators.required,
|
||||
],
|
||||
orientation: [
|
||||
{
|
||||
value: null,
|
||||
disabled: !this.permissionsService.isAdmin()
|
||||
disabled: !this.permissionsService.isAdmin(),
|
||||
},
|
||||
Validators.required
|
||||
]
|
||||
Validators.required,
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,47 +37,47 @@ type AdminDialogConfig = {
|
||||
export class AdminDialogService extends DialogService<DialogType> {
|
||||
protected readonly _config: AdminDialogConfig = {
|
||||
confirm: {
|
||||
component: ConfirmationDialogComponent
|
||||
component: ConfirmationDialogComponent,
|
||||
},
|
||||
addEditDictionary: {
|
||||
component: AddEditDictionaryDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
editColor: {
|
||||
component: EditColorDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
addEditFileAttribute: {
|
||||
component: AddEditFileAttributeDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
deleteFileAttribute: {
|
||||
component: ConfirmDeleteFileAttributeDialogComponent
|
||||
component: ConfirmDeleteFileAttributeDialogComponent,
|
||||
},
|
||||
importFileAttributes: {
|
||||
component: FileAttributesCsvImportDialogComponent,
|
||||
dialogConfig: largeDialogConfig
|
||||
dialogConfig: largeDialogConfig,
|
||||
},
|
||||
deleteUsers: {
|
||||
component: ConfirmDeleteUsersDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
addEditUser: {
|
||||
component: AddEditUserDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
smtpAuthConfig: {
|
||||
component: SmtpAuthDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
addEditDossierTemplate: {
|
||||
component: AddEditDossierTemplateDialogComponent,
|
||||
dialogConfig: { width: '900px', autoFocus: true }
|
||||
dialogConfig: { width: '900px', autoFocus: true },
|
||||
},
|
||||
addEditDossierAttribute: {
|
||||
component: AddEditDossierAttributeDialogComponent,
|
||||
dialogConfig: { autoFocus: true }
|
||||
}
|
||||
dialogConfig: { autoFocus: true },
|
||||
},
|
||||
};
|
||||
|
||||
constructor(protected readonly _dialog: MatDialog) {
|
||||
|
||||
@ -2,5 +2,5 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
|
||||
export const adminSideNavTranslations = {
|
||||
settings: _('admin-side-nav.settings'),
|
||||
dossierTemplates: _('admin-side-nav.dossier-templates')
|
||||
dossierTemplates: _('admin-side-nav.dossier-templates'),
|
||||
};
|
||||
|
||||
@ -12,5 +12,5 @@ export const auditCategoriesTranslations: { [key: string]: string } = {
|
||||
USER: _('audit-screen.categories.user'),
|
||||
DOCUMENT: _('audit-screen.categories.document'),
|
||||
AUDIT: _('audit-screen.categories.audit'),
|
||||
DOSSIER_TEMPLATE: _('audit-screen.categories.dossier-template')
|
||||
DOSSIER_TEMPLATE: _('audit-screen.categories.dossier-template'),
|
||||
};
|
||||
|
||||
@ -10,5 +10,5 @@ export const defaultColorsTranslations: { [key in DefaultColorType]: string } =
|
||||
previewColor: _('default-colors-screen.types.previewColor'),
|
||||
requestAdd: _('default-colors-screen.types.requestAdd'),
|
||||
requestRemove: _('default-colors-screen.types.requestRemove'),
|
||||
updatedColor: _('default-colors-screen.types.updatedColor')
|
||||
updatedColor: _('default-colors-screen.types.updatedColor'),
|
||||
};
|
||||
|
||||
@ -5,5 +5,5 @@ export const dossierAttributeTypesTranslations: { [key in DossierAttributeConfig
|
||||
TEXT: _('dossier-attribute-types.text'),
|
||||
NUMBER: _('dossier-attribute-types.number'),
|
||||
DATE: _('dossier-attribute-types.date'),
|
||||
IMAGE: _('dossier-attribute-types.image')
|
||||
IMAGE: _('dossier-attribute-types.image'),
|
||||
};
|
||||
|
||||
@ -4,5 +4,5 @@ import { FileAttributeConfigType } from '@redaction/red-ui-http';
|
||||
export const fileAttributeTypesTranslations: { [key in FileAttributeConfigType]: string } = {
|
||||
TEXT: _('file-attribute-types.text'),
|
||||
NUMBER: _('file-attribute-types.number'),
|
||||
DATE: _('file-attribute-types.date')
|
||||
DATE: _('file-attribute-types.date'),
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
|
||||
export const placeholdersDescriptionsTranslations: { [key: string]: string } = {
|
||||
dossierAttributePlaceholders: _('reports-screen.descriptions.dossier-attributes'),
|
||||
fileAttributePlaceholders: _('reports-screen.descriptions.file-attributes')
|
||||
fileAttributePlaceholders: _('reports-screen.descriptions.file-attributes'),
|
||||
};
|
||||
|
||||
export const generalPlaceholdersDescriptionsTranslations: { [key: string]: string } = {
|
||||
@ -14,5 +14,5 @@ export const generalPlaceholdersDescriptionsTranslations: { [key: string]: strin
|
||||
'date.dd.MM.yyyy': _('reports-screen.descriptions.general.date.d-m-y'),
|
||||
'date.MM/dd/yyyy': _('reports-screen.descriptions.general.date.m-d-y'),
|
||||
'time.HH:mm': _('reports-screen.descriptions.general.time.h-m'),
|
||||
'dossier.name': _('reports-screen.descriptions.general.dossier.name')
|
||||
'dossier.name': _('reports-screen.descriptions.general.dossier.name'),
|
||||
};
|
||||
|
||||
@ -6,7 +6,7 @@ import { ConfigService } from '@services/config.service';
|
||||
import { BASE_HREF } from '../../tokens';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AuthGuard extends KeycloakAuthGuard {
|
||||
constructor(
|
||||
@ -14,7 +14,7 @@ export class AuthGuard extends KeycloakAuthGuard {
|
||||
private readonly _userService: UserService,
|
||||
protected readonly _keycloak: KeycloakService,
|
||||
private readonly _configService: ConfigService,
|
||||
@Inject(BASE_HREF) private readonly _baseHref: string
|
||||
@Inject(BASE_HREF) private readonly _baseHref: string,
|
||||
) {
|
||||
super(_router, _keycloak);
|
||||
}
|
||||
@ -24,7 +24,7 @@ export class AuthGuard extends KeycloakAuthGuard {
|
||||
const kcIdpHint = route.queryParamMap.get('kc_idp_hint');
|
||||
await this._keycloak.login({
|
||||
idpHint: kcIdpHint ?? this._configService.values.OAUTH_IDP_HINT,
|
||||
redirectUri: window.location.origin + this._baseHref + state.url
|
||||
redirectUri: window.location.origin + this._baseHref + state.url,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -7,20 +7,8 @@ import { ConfigService } from '@services/config.service';
|
||||
import { BASE_HREF } from '../../tokens';
|
||||
import { environment } from '@environments/environment';
|
||||
|
||||
export function keycloakInitializer(keycloakService: KeycloakService, configService: ConfigService, baseUrl: string): () => Promise<void> {
|
||||
return () =>
|
||||
configService
|
||||
.loadAppConfig()
|
||||
.toPromise()
|
||||
.then(() =>
|
||||
keycloakService
|
||||
.init(getKeycloakOptions(configService, baseUrl))
|
||||
.then(() => configureAutomaticRedirectToLoginScreen(keycloakService))
|
||||
);
|
||||
}
|
||||
|
||||
function getKeycloakOptions(configService: ConfigService, baseUrl: string) {
|
||||
let url = configService.values.OAUTH_URL;
|
||||
let url: string = configService.values.OAUTH_URL;
|
||||
url = url.replace(/\/$/, ''); // remove trailing slash
|
||||
const realm = url.substring(url.lastIndexOf('/') + 1, url.length);
|
||||
url = url.substr(0, url.lastIndexOf('/realms'));
|
||||
@ -28,7 +16,7 @@ function getKeycloakOptions(configService: ConfigService, baseUrl: string) {
|
||||
config: {
|
||||
url: url,
|
||||
realm: realm,
|
||||
clientId: configService.values.OAUTH_CLIENT_ID
|
||||
clientId: configService.values.OAUTH_CLIENT_ID,
|
||||
},
|
||||
initOptions: {
|
||||
checkLoginIframe: false,
|
||||
@ -36,9 +24,9 @@ function getKeycloakOptions(configService: ConfigService, baseUrl: string) {
|
||||
silentCheckSsoRedirectUri: environment.production
|
||||
? window.location.origin + baseUrl + '/assets/oauth/silent-refresh.html'
|
||||
: null,
|
||||
flow: 'standard'
|
||||
flow: 'standard',
|
||||
},
|
||||
enableBearerInterceptor: true
|
||||
enableBearerInterceptor: true,
|
||||
};
|
||||
return options;
|
||||
}
|
||||
@ -49,6 +37,18 @@ function configureAutomaticRedirectToLoginScreen(keyCloakService: KeycloakServic
|
||||
};
|
||||
}
|
||||
|
||||
export function keycloakInitializer(keycloakService: KeycloakService, configService: ConfigService, baseUrl: string): () => Promise<void> {
|
||||
return () =>
|
||||
configService
|
||||
.loadAppConfig()
|
||||
.toPromise()
|
||||
.then(() =>
|
||||
keycloakService
|
||||
.init(getKeycloakOptions(configService, baseUrl))
|
||||
.then(() => configureAutomaticRedirectToLoginScreen(keycloakService)),
|
||||
);
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, HttpClientModule, KeycloakAngularModule],
|
||||
providers: [
|
||||
@ -56,8 +56,8 @@ function configureAutomaticRedirectToLoginScreen(keyCloakService: KeycloakServic
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: keycloakInitializer,
|
||||
multi: true,
|
||||
deps: [KeycloakService, ConfigService, BASE_HREF]
|
||||
}
|
||||
]
|
||||
deps: [KeycloakService, ConfigService, BASE_HREF],
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AuthModule {}
|
||||
|
||||
@ -5,13 +5,13 @@ import { LoadingService } from '@iqser/common-ui';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RedRoleGuard implements CanActivate {
|
||||
constructor(
|
||||
protected readonly _router: Router,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _userService: UserService
|
||||
private readonly _userService: UserService,
|
||||
) {}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
|
||||
|
||||
@ -9,7 +9,7 @@ import { UserService } from '@services/user.service';
|
||||
|
||||
export const AnnotationButtonTypes = {
|
||||
dark: 'dark',
|
||||
primary: 'primary'
|
||||
primary: 'primary',
|
||||
} as const;
|
||||
|
||||
export type AnnotationButtonType = keyof typeof AnnotationButtonTypes;
|
||||
@ -17,7 +17,7 @@ export type AnnotationButtonType = keyof typeof AnnotationButtonTypes;
|
||||
@Component({
|
||||
selector: 'redaction-annotation-actions',
|
||||
templateUrl: './annotation-actions.component.html',
|
||||
styleUrls: ['./annotation-actions.component.scss']
|
||||
styleUrls: ['./annotation-actions.component.scss'],
|
||||
})
|
||||
export class AnnotationActionsComponent implements OnInit {
|
||||
@Input() buttonType: AnnotationButtonType = AnnotationButtonTypes.dark;
|
||||
@ -32,7 +32,7 @@ export class AnnotationActionsComponent implements OnInit {
|
||||
readonly appStateService: AppStateService,
|
||||
readonly annotationActionsService: AnnotationActionsService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _userService: UserService
|
||||
private readonly _userService: UserService,
|
||||
) {}
|
||||
|
||||
private _annotations: AnnotationWrapper[];
|
||||
@ -94,7 +94,7 @@ export class AnnotationActionsComponent implements OnInit {
|
||||
this.annotationPermissions = AnnotationPermissions.forUser(
|
||||
this._permissionsService.isApprover(),
|
||||
this._userService.currentUser,
|
||||
this.annotations
|
||||
this.annotations,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import { PermissionsService } from '@services/permissions.service';
|
||||
@Component({
|
||||
selector: 'redaction-comments',
|
||||
templateUrl: './comments.component.html',
|
||||
styleUrls: ['./comments.component.scss']
|
||||
styleUrls: ['./comments.component.scss'],
|
||||
})
|
||||
export class CommentsComponent {
|
||||
@Input() annotation: AnnotationWrapper;
|
||||
@ -17,7 +17,7 @@ export class CommentsComponent {
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _manualAnnotationService: ManualAnnotationService
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
) {}
|
||||
|
||||
addComment(value: string): void {
|
||||
@ -31,7 +31,7 @@ export class CommentsComponent {
|
||||
this.annotation.comments.push({
|
||||
text: value,
|
||||
id: parseInt(commentResponse.commentId, 10),
|
||||
user: this._userService.currentUser.id
|
||||
user: this._userService.currentUser.id,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import { DossierTemplatesService } from '../../services/dossier-templates.servic
|
||||
@Component({
|
||||
selector: 'redaction-document-info',
|
||||
templateUrl: './document-info.component.html',
|
||||
styleUrls: ['./document-info.component.scss']
|
||||
styleUrls: ['./document-info.component.scss'],
|
||||
})
|
||||
export class DocumentInfoComponent extends AutoUnsubscribe implements OnInit {
|
||||
@Input() file: File;
|
||||
@ -24,7 +24,7 @@ export class DocumentInfoComponent extends AutoUnsubscribe implements OnInit {
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
private readonly _dialogService: DossiersDialogService
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -9,12 +9,10 @@ interface Engine {
|
||||
readonly show: boolean;
|
||||
}
|
||||
|
||||
type Engines = readonly Engine[];
|
||||
|
||||
const Engines = {
|
||||
DICTIONARY: 'DICTIONARY',
|
||||
NER: 'NER',
|
||||
RULE: 'RULE'
|
||||
RULE: 'RULE',
|
||||
} as const;
|
||||
|
||||
type EngineName = keyof typeof Engines;
|
||||
@ -23,7 +21,7 @@ type EngineName = keyof typeof Engines;
|
||||
selector: 'redaction-annotation-source',
|
||||
templateUrl: './annotation-source.component.html',
|
||||
styleUrls: ['./annotation-source.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AnnotationSourceComponent {
|
||||
@Input()
|
||||
@ -31,7 +29,7 @@ export class AnnotationSourceComponent {
|
||||
annotation: AnnotationWrapper;
|
||||
|
||||
isPopoverOpen = false;
|
||||
engines: Engines;
|
||||
engines: readonly Engine[];
|
||||
|
||||
constructor(private readonly _translateService: TranslateService) {}
|
||||
|
||||
@ -44,18 +42,18 @@ export class AnnotationSourceComponent {
|
||||
{
|
||||
icon: 'red:dictionary',
|
||||
description: this._translateService.instant('annotation-engines.dictionary'),
|
||||
show: this._isBasedOn(Engines.DICTIONARY)
|
||||
show: this._isBasedOn(Engines.DICTIONARY),
|
||||
},
|
||||
{
|
||||
icon: 'red:ai',
|
||||
description: this._translateService.instant('annotation-engines.ner'),
|
||||
show: this._isBasedOn(Engines.NER)
|
||||
show: this._isBasedOn(Engines.NER),
|
||||
},
|
||||
{
|
||||
icon: 'red:rule',
|
||||
description: this._translateService.instant('annotation-engines.rule', { rule: this.annotation.legalBasisValue }),
|
||||
show: this._isBasedOn(Engines.RULE)
|
||||
}
|
||||
show: this._isBasedOn(Engines.RULE),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import { IqserEventTarget } from '@iqser/common-ui';
|
||||
selector: 'redaction-annotations-list',
|
||||
templateUrl: './annotations-list.component.html',
|
||||
styleUrls: ['./annotations-list.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AnnotationsListComponent {
|
||||
@Input() annotations: AnnotationWrapper[];
|
||||
@ -37,7 +37,7 @@ export class AnnotationsListComponent {
|
||||
}
|
||||
this.selectAnnotations.emit({
|
||||
annotations: [annotation],
|
||||
multiSelect: this.multiSelectActive
|
||||
multiSelect: this.multiSelectActive,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
||||
@Component({
|
||||
selector: 'redaction-file-workload',
|
||||
templateUrl: './file-workload.component.html',
|
||||
styleUrls: ['./file-workload.component.scss']
|
||||
styleUrls: ['./file-workload.component.scss'],
|
||||
})
|
||||
export class FileWorkloadComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -52,7 +52,7 @@ export class FileWorkloadComponent {
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _filterService: FilterService,
|
||||
private readonly _annotationProcessingService: AnnotationProcessingService
|
||||
private readonly _annotationProcessingService: AnnotationProcessingService,
|
||||
) {
|
||||
this.displayedAnnotations$ = this._displayedAnnotations$;
|
||||
}
|
||||
@ -99,7 +99,7 @@ export class FileWorkloadComponent {
|
||||
const secondary$ = this._filterService.getFilterModels$('secondaryFilters');
|
||||
|
||||
return combineLatest([this._annotations$.asObservable(), primary$, secondary$]).pipe(
|
||||
map(([annotations, primary, secondary]) => this._filterAnnotations(annotations, primary, secondary))
|
||||
map(([annotations, primary, secondary]) => this._filterAnnotations(annotations, primary, secondary)),
|
||||
);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ export class FileWorkloadComponent {
|
||||
behavior: 'smooth',
|
||||
scrollMode: mode,
|
||||
block: 'start',
|
||||
inline: 'start'
|
||||
inline: 'start',
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ export class FileWorkloadComponent {
|
||||
return;
|
||||
}
|
||||
const elements = this._annotationsElement.nativeElement.querySelectorAll(
|
||||
`div[annotation-id="${this._firstSelectedAnnotation?.id}"].active`
|
||||
`div[annotation-id="${this._firstSelectedAnnotation?.id}"].active`,
|
||||
);
|
||||
FileWorkloadComponent._scrollToFirstElement(elements);
|
||||
}
|
||||
@ -228,7 +228,7 @@ export class FileWorkloadComponent {
|
||||
private _filterAnnotations(
|
||||
annotations: AnnotationWrapper[],
|
||||
primary: INestedFilter[],
|
||||
secondary: INestedFilter[] = []
|
||||
secondary: INestedFilter[] = [],
|
||||
): Map<number, AnnotationWrapper[]> {
|
||||
if (!primary) {
|
||||
return;
|
||||
|
||||
@ -8,7 +8,7 @@ import { File } from '@models/file/file';
|
||||
@Component({
|
||||
selector: 'redaction-page-exclusion',
|
||||
templateUrl: './page-exclusion.component.html',
|
||||
styleUrls: ['./page-exclusion.component.scss']
|
||||
styleUrls: ['./page-exclusion.component.scss'],
|
||||
})
|
||||
export class PageExclusionComponent implements OnChanges {
|
||||
@Input() file: File;
|
||||
@ -21,7 +21,7 @@ export class PageExclusionComponent implements OnChanges {
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _reanalysisControllerService: ReanalysisControllerService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _loadingService: LoadingService
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {}
|
||||
|
||||
ngOnChanges(): void {
|
||||
@ -31,6 +31,7 @@ export class PageExclusionComponent implements OnChanges {
|
||||
return [{ startPage: page, endPage: page }];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
||||
if (page === ranges[ranges.length - 1].endPage + 1) {
|
||||
ranges[ranges.length - 1].endPage = page;
|
||||
} else {
|
||||
@ -52,16 +53,16 @@ export class PageExclusionComponent implements OnChanges {
|
||||
}
|
||||
return {
|
||||
startPage,
|
||||
endPage
|
||||
endPage,
|
||||
};
|
||||
});
|
||||
await this._reanalysisControllerService
|
||||
.excludePages(
|
||||
{
|
||||
pageRanges: pageRanges
|
||||
pageRanges: pageRanges,
|
||||
},
|
||||
this.file.dossierId,
|
||||
this.file.fileId
|
||||
this.file.fileId,
|
||||
)
|
||||
.toPromise();
|
||||
this._inputComponent.reset();
|
||||
@ -77,10 +78,10 @@ export class PageExclusionComponent implements OnChanges {
|
||||
await this._reanalysisControllerService
|
||||
.includePages(
|
||||
{
|
||||
pageRanges: [range]
|
||||
pageRanges: [range],
|
||||
},
|
||||
this.file.dossierId,
|
||||
this.file.fileId
|
||||
this.file.fileId,
|
||||
)
|
||||
.toPromise();
|
||||
this._inputComponent.reset();
|
||||
|
||||
@ -9,7 +9,7 @@ import { DossiersService } from '../../services/dossiers.service';
|
||||
@Component({
|
||||
selector: 'redaction-page-indicator',
|
||||
templateUrl: './page-indicator.component.html',
|
||||
styleUrls: ['./page-indicator.component.scss']
|
||||
styleUrls: ['./page-indicator.component.scss'],
|
||||
})
|
||||
export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
@Input() active: boolean;
|
||||
@ -28,7 +28,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _permissionService: PermissionsService
|
||||
private readonly _permissionService: PermissionsService,
|
||||
) {}
|
||||
|
||||
get read() {
|
||||
@ -109,7 +109,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
.subscribe(() => {
|
||||
this.viewedPages?.pages?.splice(
|
||||
this.viewedPages?.pages?.findIndex(p => p.page === this.number),
|
||||
1
|
||||
1,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
OnInit,
|
||||
Output,
|
||||
SimpleChanges,
|
||||
ViewChild
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { ManualRedactionEntry } from '@redaction/red-ui-http';
|
||||
import WebViewer, { Core, WebViewerInstance } from '@pdftron/webviewer';
|
||||
@ -31,14 +31,14 @@ import { PdfViewerUtils } from '../../utils/pdf-viewer.utils';
|
||||
import { ViewMode } from '@models/file/view-mode';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import TextTool = Tools.TextTool;
|
||||
import Tools = Core.Tools;
|
||||
import TextTool = Tools.TextTool;
|
||||
import Annotation = Core.Annotations.Annotation;
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-pdf-viewer',
|
||||
templateUrl: './pdf-viewer.component.html',
|
||||
styleUrls: ['./pdf-viewer.component.scss']
|
||||
styleUrls: ['./pdf-viewer.component.scss'],
|
||||
})
|
||||
export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
@Input() fileData: Blob;
|
||||
@ -73,7 +73,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
private readonly _annotationDrawService: AnnotationDrawService,
|
||||
private readonly _annotationActionsService: AnnotationActionsService,
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _loadingService: LoadingService
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {}
|
||||
|
||||
private _viewMode: ViewMode = 'STANDARD';
|
||||
@ -115,7 +115,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
this.instance.Core.documentViewer.getDisplayModeManager().setDisplayMode(instanceDisplayMode);
|
||||
}
|
||||
|
||||
async uploadFile(files: any) {
|
||||
uploadFile(files: any) {
|
||||
const fileToCompare = files[0];
|
||||
this.compareFileInput.nativeElement.value = null;
|
||||
|
||||
@ -152,7 +152,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
() => {
|
||||
this.utils.navigateToPage(1);
|
||||
},
|
||||
this.instance.Core.PDFNet
|
||||
this.instance.Core.PDFNet,
|
||||
);
|
||||
this._loadingService.stop();
|
||||
};
|
||||
@ -167,10 +167,10 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
translateParams: {
|
||||
fileName: fileToCompare.name,
|
||||
currentDocumentPageCount,
|
||||
compareDocumentPageCount
|
||||
}
|
||||
compareDocumentPageCount,
|
||||
},
|
||||
}),
|
||||
loadCompareDocument
|
||||
loadCompareDocument,
|
||||
);
|
||||
} else {
|
||||
await loadCompareDocument();
|
||||
@ -187,7 +187,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
await pdfNet.initialize(environment.licenseKey ? atob(environment.licenseKey) : null);
|
||||
const currentDocument = await pdfNet.PDFDoc.createFromBuffer(await this.fileData.arrayBuffer());
|
||||
this.instance.UI.loadDocument(currentDocument, {
|
||||
filename: this.file ? this.file.filename : 'document.pdf'
|
||||
filename: this.file ? this.file.filename : 'document.pdf',
|
||||
});
|
||||
this.instance.UI.disableElements(['closeCompareButton']);
|
||||
this.instance.UI.enableElements(['compareButton']);
|
||||
@ -205,9 +205,9 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
fullAPI: true,
|
||||
path: this._convertPath('/assets/wv-resources'),
|
||||
css: this._convertPath('/assets/pdftron/stylesheet.css'),
|
||||
backendType: 'ems'
|
||||
backendType: 'ems',
|
||||
},
|
||||
this.viewer.nativeElement
|
||||
this.viewer.nativeElement,
|
||||
);
|
||||
|
||||
this.utils = new PdfViewerUtils(this.instance, this.viewMode, this.multiSelectActive);
|
||||
@ -296,7 +296,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
private _setSelectionMode(): void {
|
||||
const textTool = (<unknown>this.instance.Core.Tools.TextTool) as TextTool;
|
||||
const textTool = (<unknown> this.instance.Core.Tools.TextTool) as TextTool;
|
||||
textTool.SELECTION_MODE = this._configService.values.SELECTION_MODE;
|
||||
}
|
||||
|
||||
@ -329,21 +329,21 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
'rotateClockwiseButton',
|
||||
'rotateCounterClockwiseButton',
|
||||
'annotationStyleEditButton',
|
||||
'annotationGroupButton'
|
||||
'annotationGroupButton',
|
||||
]);
|
||||
|
||||
this.instance.UI.setHeaderItems(header => {
|
||||
const originalHeaderItems = header.getItems();
|
||||
originalHeaderItems.splice(8, 0, {
|
||||
type: 'divider',
|
||||
dataElement: 'rectangleToolDivider'
|
||||
dataElement: 'rectangleToolDivider',
|
||||
});
|
||||
originalHeaderItems.splice(9, 0, {
|
||||
type: 'toolGroupButton',
|
||||
toolGroup: 'rectangleTools',
|
||||
dataElement: 'shapeToolGroupButton',
|
||||
img: this._convertPath('/assets/icons/general/rectangle.svg'),
|
||||
title: 'annotation.rectangle'
|
||||
title: 'annotation.rectangle',
|
||||
});
|
||||
if (this._userPreferenceService.areDevFeaturesEnabled) {
|
||||
originalHeaderItems.splice(11, 0, {
|
||||
@ -354,7 +354,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
title: 'Compare',
|
||||
onClick: () => {
|
||||
this.compareFileInput.nativeElement.click();
|
||||
}
|
||||
},
|
||||
});
|
||||
originalHeaderItems.splice(11, 0, {
|
||||
type: 'actionButton',
|
||||
@ -364,11 +364,11 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
title: 'Leave Compare Mode',
|
||||
onClick: () => {
|
||||
this.closeCompareMode();
|
||||
}
|
||||
},
|
||||
});
|
||||
originalHeaderItems.splice(13, 0, {
|
||||
type: 'divider',
|
||||
dataElement: 'compareToolDivider'
|
||||
dataElement: 'compareToolDivider',
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -379,7 +379,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
StrokeThickness: 2,
|
||||
StrokeColor: this._annotationDrawService.getColor(this.instance, 'manual'),
|
||||
FillColor: this._annotationDrawService.getColor(this.instance, 'manual'),
|
||||
Opacity: 0.6
|
||||
Opacity: 0.6,
|
||||
}));
|
||||
}
|
||||
|
||||
@ -418,13 +418,13 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
this.instance.Core.annotationManager.deselectAllAnnotations();
|
||||
this._annotationActionsService.updateHiddenAnnotation(this.annotations, viewerAnnotations, allAreVisible);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
this.instance.UI.annotationPopup.add(
|
||||
this._annotationActionsService.getViewerAvailableActions(annotationWrappers, this.annotationsChanged)
|
||||
this._annotationActionsService.getViewerAvailableActions(annotationWrappers, this.annotationsChanged),
|
||||
);
|
||||
}
|
||||
|
||||
@ -448,9 +448,9 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
this.instance.UI.enableElements(['shapeToolGroupButton', 'rectangleToolDivider']);
|
||||
// dispatch event
|
||||
this.manualAnnotationRequested.emit(
|
||||
new ManualRedactionEntryWrapper([quad], mre, 'REDACTION', 'RECTANGLE', activeAnnotation.Id)
|
||||
new ManualRedactionEntryWrapper([quad], mre, 'REDACTION', 'RECTANGLE', activeAnnotation.Id),
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -467,13 +467,13 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
wildcard: false, // allow using '*' as a wildcard value
|
||||
regex: false, // string is treated as a regular expression
|
||||
searchUp: false, // search from the end of the document upwards
|
||||
ambientString: true // return ambient string as part of the result
|
||||
ambientString: true, // return ambient string as part of the result
|
||||
};
|
||||
this.instance.UI.openElements(['searchPanel']);
|
||||
setTimeout(() => {
|
||||
this.instance.UI.searchTextFull(text, searchOptions);
|
||||
}, 250);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Adding directly to the false-positive dict is only available in dev-mode
|
||||
@ -488,9 +488,9 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
const text = this.instance.Core.documentViewer.getSelectedText();
|
||||
const mre = this._getManualRedactionEntry(selectedQuads, text, true);
|
||||
this.manualAnnotationRequested.emit(
|
||||
new ManualRedactionEntryWrapper(this.instance.Core.documentViewer.getSelectedTextQuads(), mre, 'FALSE_POSITIVE')
|
||||
new ManualRedactionEntryWrapper(this.instance.Core.documentViewer.getSelectedTextQuads(), mre, 'FALSE_POSITIVE'),
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -504,9 +504,9 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
const text = this.instance.Core.documentViewer.getSelectedText();
|
||||
const mre = this._getManualRedactionEntry(selectedQuads, text, true);
|
||||
this.manualAnnotationRequested.emit(
|
||||
new ManualRedactionEntryWrapper(this.instance.Core.documentViewer.getSelectedTextQuads(), mre, 'DICTIONARY')
|
||||
new ManualRedactionEntryWrapper(this.instance.Core.documentViewer.getSelectedTextQuads(), mre, 'DICTIONARY'),
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
this.instance.UI.textPopup.add(<any>{
|
||||
@ -519,9 +519,9 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
const text = this.instance.Core.documentViewer.getSelectedText();
|
||||
const mre = this._getManualRedactionEntry(selectedQuads, text, true);
|
||||
this.manualAnnotationRequested.emit(
|
||||
new ManualRedactionEntryWrapper(this.instance.Core.documentViewer.getSelectedTextQuads(), mre, 'REDACTION')
|
||||
new ManualRedactionEntryWrapper(this.instance.Core.documentViewer.getSelectedTextQuads(), mre, 'REDACTION'),
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
this._handleCustomActions();
|
||||
}
|
||||
@ -536,7 +536,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
'add-false-positive',
|
||||
'shapeToolGroupButton',
|
||||
'rectangleToolDivider',
|
||||
'annotationPopup'
|
||||
'annotationPopup',
|
||||
]);
|
||||
if (this._selectedText.length > 2) {
|
||||
this.instance.UI.enableElements(['add-dictionary', 'add-false-positive']);
|
||||
@ -550,7 +550,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
'add-rectangle',
|
||||
'shapeToolGroupButton',
|
||||
'rectangleToolDivider',
|
||||
'annotationPopup'
|
||||
'annotationPopup',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -570,7 +570,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
|
||||
private _loadDocument() {
|
||||
if (this.fileData) {
|
||||
this.instance.UI.loadDocument(this.fileData, {
|
||||
filename: this.file ? this.file.filename : 'document.pdf'
|
||||
filename: this.file ? this.file.filename : 'document.pdf',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import { DossiersService } from '../../services/dossiers.service';
|
||||
@Component({
|
||||
selector: 'redaction-team-members-manager',
|
||||
templateUrl: './team-members-manager.component.html',
|
||||
styleUrls: ['./team-members-manager.component.scss']
|
||||
styleUrls: ['./team-members-manager.component.scss'],
|
||||
})
|
||||
export class TeamMembersManagerComponent implements OnInit {
|
||||
teamForm: FormGroup;
|
||||
@ -27,7 +27,7 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
readonly userService: UserService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _dossiersService: DossiersService
|
||||
private readonly _dossiersService: DossiersService,
|
||||
) {}
|
||||
|
||||
get selectedOwnerId(): string {
|
||||
@ -55,7 +55,7 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
...this.dossier,
|
||||
memberIds: this.selectedMembersList,
|
||||
approverIds: this.selectedApproversList,
|
||||
ownerId: this.selectedOwnerId
|
||||
ownerId: this.selectedOwnerId,
|
||||
} as DossierRequest;
|
||||
|
||||
const result = await this._dossiersService.createOrUpdate(dossier).toPromise();
|
||||
@ -105,7 +105,7 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
this._updateLists();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
ngOnInit() {
|
||||
this._loadData();
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
this.teamForm = this._formBuilder.group({
|
||||
owner: [this.dossier?.ownerId, Validators.required],
|
||||
approvers: [[...this.dossier?.approverIds]],
|
||||
members: [[...this.dossier?.memberIds]]
|
||||
members: [[...this.dossier?.memberIds]],
|
||||
});
|
||||
this.teamForm.get('owner').valueChanges.subscribe(owner => {
|
||||
if (!this.isApprover(owner)) {
|
||||
|
||||
@ -5,7 +5,7 @@ import { AppStateService } from '@state/app-state.service';
|
||||
@Component({
|
||||
selector: 'redaction-type-annotation-icon',
|
||||
templateUrl: './type-annotation-icon.component.html',
|
||||
styleUrls: ['./type-annotation-icon.component.scss']
|
||||
styleUrls: ['./type-annotation-icon.component.scss'],
|
||||
})
|
||||
export class TypeAnnotationIconComponent implements OnChanges {
|
||||
@Input() annotation: AnnotationWrapper;
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
DownloadFileType,
|
||||
IDossierTemplate,
|
||||
ReportTemplate,
|
||||
ReportTemplateControllerService
|
||||
ReportTemplateControllerService,
|
||||
} from '@redaction/red-ui-http';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import * as moment from 'moment';
|
||||
@ -16,7 +16,7 @@ import { DossierTemplatesService } from '../../services/dossier-templates.servic
|
||||
|
||||
@Component({
|
||||
templateUrl: './add-dossier-dialog.component.html',
|
||||
styleUrls: ['./add-dossier-dialog.component.scss']
|
||||
styleUrls: ['./add-dossier-dialog.component.scss'],
|
||||
})
|
||||
export class AddDossierDialogComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -25,7 +25,7 @@ export class AddDossierDialogComponent {
|
||||
hasDueDate = false;
|
||||
downloadTypes: { key: DownloadFileType; label: string }[] = ['ORIGINAL', 'PREVIEW', 'REDACTED'].map((type: DownloadFileType) => ({
|
||||
key: type,
|
||||
label: downloadTypesTranslations[type]
|
||||
label: downloadTypesTranslations[type],
|
||||
}));
|
||||
dossierTemplates: IDossierTemplate[];
|
||||
availableReportTypes = [];
|
||||
@ -35,7 +35,7 @@ export class AddDossierDialogComponent {
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _reportTemplateController: ReportTemplateControllerService,
|
||||
readonly dialogRef: MatDialogRef<AddDossierDialogComponent>
|
||||
readonly dialogRef: MatDialogRef<AddDossierDialogComponent>,
|
||||
) {
|
||||
this._filterInvalidDossierTemplates();
|
||||
this.dossierForm = this._formBuilder.group(
|
||||
@ -46,14 +46,14 @@ export class AddDossierDialogComponent {
|
||||
reportTemplateIds: [null],
|
||||
description: [null],
|
||||
dueDate: [null],
|
||||
watermarkEnabled: [true]
|
||||
watermarkEnabled: [true],
|
||||
},
|
||||
{
|
||||
validators: control =>
|
||||
control.value.reportTemplateIds?.length > 0 || control.value.downloadFileTypes?.length > 0
|
||||
? null
|
||||
: { downloadPackage: true }
|
||||
}
|
||||
: { downloadPackage: true },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -93,18 +93,18 @@ export class AddDossierDialogComponent {
|
||||
this.dossierForm.patchValue(
|
||||
{
|
||||
downloadFileTypes: dossierTemplate.downloadFileTypes,
|
||||
reportTemplateIds: [] // TODO DEFAULT
|
||||
reportTemplateIds: [], // TODO DEFAULT
|
||||
},
|
||||
{ emitEvent: false }
|
||||
{ emitEvent: false },
|
||||
);
|
||||
} else {
|
||||
this.availableReportTypes = [];
|
||||
this.dossierForm.patchValue(
|
||||
{
|
||||
downloadFileTypes: [],
|
||||
reportTemplateIds: []
|
||||
reportTemplateIds: [],
|
||||
},
|
||||
{ emitEvent: false }
|
||||
{ emitEvent: false },
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -125,7 +125,7 @@ export class AddDossierDialogComponent {
|
||||
dossierTemplateId: this.dossierForm.get('dossierTemplateId').value,
|
||||
downloadFileTypes: this.dossierForm.get('downloadFileTypes').value,
|
||||
reportTemplateIds: this.dossierForm.get('reportTemplateIds').value,
|
||||
watermarkEnabled: this.dossierForm.get('watermarkEnabled').value
|
||||
watermarkEnabled: this.dossierForm.get('watermarkEnabled').value,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ class DialogData {
|
||||
|
||||
@Component({
|
||||
templateUrl: './assign-reviewer-approver-dialog.component.html',
|
||||
styleUrls: ['./assign-reviewer-approver-dialog.component.scss']
|
||||
styleUrls: ['./assign-reviewer-approver-dialog.component.scss'],
|
||||
})
|
||||
export class AssignReviewerApproverDialogComponent {
|
||||
usersForm: FormGroup;
|
||||
@ -33,7 +33,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _filesService: FilesService,
|
||||
private readonly _dialogRef: MatDialogRef<AssignReviewerApproverDialogComponent, boolean>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: DialogData
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: DialogData,
|
||||
) {
|
||||
this._loadData();
|
||||
}
|
||||
@ -75,7 +75,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
.setReviewerFor(
|
||||
this.data.files.map(f => f.fileId),
|
||||
this._dossiersService.activeDossierId,
|
||||
selectedUser
|
||||
selectedUser,
|
||||
)
|
||||
.toPromise();
|
||||
} else {
|
||||
@ -83,7 +83,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
.setUnderApprovalFor(
|
||||
this.data.files.map(f => f.fileId),
|
||||
selectedUser,
|
||||
this._dossiersService.activeDossierId
|
||||
this._dossiersService.activeDossierId,
|
||||
)
|
||||
.toPromise();
|
||||
}
|
||||
@ -106,7 +106,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
singleUser = this.singleUsersSelectOptions.indexOf(singleUser) >= 0 ? singleUser : this.singleUsersSelectOptions[0];
|
||||
|
||||
this.usersForm = this._formBuilder.group({
|
||||
singleUser: [singleUser, Validators.required]
|
||||
singleUser: [singleUser, Validators.required],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ export interface LegalBasisOption {
|
||||
@Component({
|
||||
selector: 'redaction-change-legal-basis-dialog',
|
||||
templateUrl: './change-legal-basis-dialog.component.html',
|
||||
styleUrls: ['./change-legal-basis-dialog.component.scss']
|
||||
styleUrls: ['./change-legal-basis-dialog.component.scss'],
|
||||
})
|
||||
export class ChangeLegalBasisDialogComponent implements OnInit {
|
||||
legalBasisForm: FormGroup;
|
||||
@ -32,7 +32,7 @@ export class ChangeLegalBasisDialogComponent implements OnInit {
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<ChangeLegalBasisDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public annotations: AnnotationWrapper[]
|
||||
@Inject(MAT_DIALOG_DATA) public annotations: AnnotationWrapper[],
|
||||
) {}
|
||||
|
||||
get changed(): boolean {
|
||||
@ -44,7 +44,7 @@ export class ChangeLegalBasisDialogComponent implements OnInit {
|
||||
|
||||
this.legalBasisForm = this._formBuilder.group({
|
||||
reason: [null, Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required]
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
});
|
||||
const data = await this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._dossiersService.activeDossier.dossierTemplateId)
|
||||
@ -54,19 +54,19 @@ export class ChangeLegalBasisDialogComponent implements OnInit {
|
||||
.map(lbm => ({
|
||||
legalBasis: lbm.reason,
|
||||
description: lbm.description,
|
||||
label: lbm.name
|
||||
label: lbm.name,
|
||||
}))
|
||||
.sort((a, b) => a.label.localeCompare(b.label));
|
||||
|
||||
this.legalBasisForm.patchValue({
|
||||
reason: this.legalOptions.find(option => option.legalBasis === this.annotations[0].legalBasis)
|
||||
reason: this.legalOptions.find(option => option.legalBasis === this.annotations[0].legalBasis),
|
||||
});
|
||||
}
|
||||
|
||||
save() {
|
||||
this.dialogRef.close({
|
||||
legalBasis: this.legalBasisForm.get('reason').value.legalBasis,
|
||||
comment: this.legalBasisForm.get('comment').value
|
||||
comment: this.legalBasisForm.get('comment').value,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import { DossiersService } from '../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './document-info-dialog.component.html',
|
||||
styleUrls: ['./document-info-dialog.component.scss']
|
||||
styleUrls: ['./document-info-dialog.component.scss'],
|
||||
})
|
||||
export class DocumentInfoDialogComponent implements OnInit {
|
||||
documentInfoForm: FormGroup;
|
||||
@ -24,7 +24,7 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
public dialogRef: MatDialogRef<DocumentInfoDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: IFile
|
||||
@Inject(MAT_DIALOG_DATA) public data: IFile,
|
||||
) {
|
||||
this.file = this.data;
|
||||
this._dossier = this._dossiersService.find(this.file.dossierId);
|
||||
@ -37,9 +37,9 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
const formConfig = this.attributes.reduce(
|
||||
(acc, attr) => ({
|
||||
...acc,
|
||||
[attr.id]: [this.file.fileAttributes?.attributeIdToValue[attr.id]]
|
||||
[attr.id]: [this.file.fileAttributes?.attributeIdToValue[attr.id]],
|
||||
}),
|
||||
{}
|
||||
{},
|
||||
);
|
||||
this.documentInfoForm = this._formBuilder.group(formConfig);
|
||||
}
|
||||
@ -47,7 +47,7 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
async saveDocumentInfo() {
|
||||
const attributeIdToValue = {
|
||||
...this.file.fileAttributes?.attributeIdToValue,
|
||||
...this.documentInfoForm.getRawValue()
|
||||
...this.documentInfoForm.getRawValue(),
|
||||
};
|
||||
await this._fileAttributesService.setFileAttributes({ attributeIdToValue }, this.file.dossierId, this.file.fileId).toPromise();
|
||||
this.file.fileAttributes = { attributeIdToValue };
|
||||
|
||||
@ -11,7 +11,7 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d
|
||||
@Component({
|
||||
selector: 'redaction-edit-dossier-attributes',
|
||||
templateUrl: './edit-dossier-attributes.component.html',
|
||||
styleUrls: ['./edit-dossier-attributes.component.scss']
|
||||
styleUrls: ['./edit-dossier-attributes.component.scss'],
|
||||
})
|
||||
export class EditDossierAttributesComponent implements EditDossierSectionInterface, OnInit {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -30,7 +30,7 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _dossierAttributesService: DossierAttributesService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _formBuilder: FormBuilder
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
) {}
|
||||
|
||||
get changed() {
|
||||
@ -66,7 +66,7 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
this._loadingService.start();
|
||||
const dossierAttributeList = this.attributes.map(attr => ({
|
||||
dossierAttributeId: attr.id,
|
||||
value: this.currentAttrValue(attr)
|
||||
value: this.currentAttrValue(attr),
|
||||
}));
|
||||
await this._dossierAttributesService.setValues(this.dossier, dossierAttributeList);
|
||||
await this._loadAttributes();
|
||||
@ -106,7 +106,7 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
const image = $event.target.files[0];
|
||||
const result = await toBase64(image);
|
||||
this.attributesForm.patchValue({
|
||||
[attr.id]: result
|
||||
[attr.id]: result,
|
||||
});
|
||||
this._getFileInputById(attr.id).nativeElement.value = null;
|
||||
}
|
||||
@ -121,7 +121,7 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
|
||||
deleteAttr(attr: DossierAttributeWithValue) {
|
||||
this.attributesForm.patchValue({
|
||||
[attr.id]: null
|
||||
[attr.id]: null,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
LoadingService,
|
||||
SortingOrders,
|
||||
TableColumnConfig,
|
||||
TitleColors
|
||||
TitleColors,
|
||||
} from '@iqser/common-ui';
|
||||
import { FileManagementControllerService, IFile } from '@redaction/red-ui-http';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -34,8 +34,8 @@ interface FileListItem extends IFile, IListable {
|
||||
styleUrls: ['./edit-dossier-deleted-documents.component.scss'],
|
||||
providers: [
|
||||
...DefaultListingServices,
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => EditDossierDeletedDocumentsComponent) }
|
||||
]
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => EditDossierDeletedDocumentsComponent) },
|
||||
],
|
||||
})
|
||||
export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileListItem> implements EditDossierSectionInterface, OnInit {
|
||||
@Input() dossier: Dossier;
|
||||
@ -47,7 +47,7 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileL
|
||||
{ label: _('edit-dossier-dialog.deleted-documents.table-col-names.name'), width: '3fr' },
|
||||
{ label: _('edit-dossier-dialog.deleted-documents.table-col-names.pages') },
|
||||
{ label: _('edit-dossier-dialog.deleted-documents.table-col-names.deleted-on'), sortByKey: 'softDeleted', width: '2fr' },
|
||||
{ label: _('edit-dossier-dialog.deleted-documents.table-col-names.time-to-restore'), sortByKey: 'softDeleted', width: '2fr' }
|
||||
{ label: _('edit-dossier-dialog.deleted-documents.table-col-names.time-to-restore'), sortByKey: 'softDeleted', width: '2fr' },
|
||||
];
|
||||
readonly tableHeaderLabel = _('edit-dossier-dialog.deleted-documents.table-header.label');
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -60,7 +60,7 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileL
|
||||
private readonly _filesService: FilesService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _dialogService: DossiersDialogService
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -68,7 +68,7 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileL
|
||||
private get _canRestoreSelected$(): Observable<boolean> {
|
||||
return this.listingService.selectedEntities$.pipe(
|
||||
map(entities => entities.length && !entities.find(file => !file.canRestore)),
|
||||
distinctUntilChanged()
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -82,10 +82,10 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileL
|
||||
denyText: _('confirmation-dialog.permanently-delete-file.deny-text'),
|
||||
translateParams: {
|
||||
fileName: files[0].filename,
|
||||
filesCount: files.length
|
||||
}
|
||||
filesCount: files.length,
|
||||
},
|
||||
});
|
||||
this._dialogService.openDialog('confirm', null, data, async () => {
|
||||
this._dialogService.openDialog('confirm', null, data, () => {
|
||||
this._loadingService.loadWhile(this._hardDelete(files));
|
||||
});
|
||||
}
|
||||
@ -96,7 +96,7 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileL
|
||||
this.entitiesService.setEntities(this._toListItems(files));
|
||||
this.sortingService.setSortingOption({
|
||||
column: 'softDeleted',
|
||||
order: SortingOrders.desc
|
||||
order: SortingOrders.desc,
|
||||
});
|
||||
this._loadingService.stop();
|
||||
}
|
||||
@ -143,7 +143,7 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent<FileL
|
||||
...file,
|
||||
restoreDate,
|
||||
searchKey: file.filename,
|
||||
canRestore: this._canRestoreFile(restoreDate)
|
||||
canRestore: this._canRestoreFile(restoreDate),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import { DossiersService } from '../../../services/dossiers.service';
|
||||
@Component({
|
||||
selector: 'redaction-edit-dossier-dictionary',
|
||||
templateUrl: './edit-dossier-dictionary.component.html',
|
||||
styleUrls: ['./edit-dossier-dictionary.component.scss']
|
||||
styleUrls: ['./edit-dossier-dictionary.component.scss'],
|
||||
})
|
||||
export class EditDossierDictionaryComponent implements EditDossierSectionInterface, OnInit {
|
||||
@Input() dossier: Dossier;
|
||||
@ -27,7 +27,7 @@ export class EditDossierDictionaryComponent implements EditDossierSectionInterfa
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _formBuilder: FormBuilder
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
) {
|
||||
this.canEdit = this._permissionsService.isDossierMember(this.dossier);
|
||||
}
|
||||
@ -63,7 +63,7 @@ export class EditDossierDictionaryComponent implements EditDossierSectionInterfa
|
||||
this.dossier.dossierTemplateId,
|
||||
'dossier_redaction',
|
||||
this.dossier.id,
|
||||
false
|
||||
false,
|
||||
)
|
||||
.toPromise();
|
||||
await this._dossiersService.updateDossierDictionary(this.dossier.dossierTemplateId, this.dossier.id);
|
||||
|
||||
@ -9,13 +9,13 @@ import { DossiersService } from '../../../services/dossiers.service';
|
||||
@Component({
|
||||
selector: 'redaction-edit-dossier-download-package',
|
||||
templateUrl: './edit-dossier-download-package.component.html',
|
||||
styleUrls: ['./edit-dossier-download-package.component.scss']
|
||||
styleUrls: ['./edit-dossier-download-package.component.scss'],
|
||||
})
|
||||
export class EditDossierDownloadPackageComponent implements OnInit, EditDossierSectionInterface {
|
||||
dossierForm: FormGroup;
|
||||
downloadTypes: { key: DownloadFileType; label: string }[] = ['ORIGINAL', 'PREVIEW', 'REDACTED'].map((type: DownloadFileType) => ({
|
||||
key: type,
|
||||
label: downloadTypesTranslations[type]
|
||||
label: downloadTypesTranslations[type],
|
||||
}));
|
||||
availableReportTypes: ReportTemplate[] = [];
|
||||
|
||||
@ -25,7 +25,7 @@ export class EditDossierDownloadPackageComponent implements OnInit, EditDossierS
|
||||
constructor(
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _reportTemplateController: ReportTemplateControllerService,
|
||||
private readonly _formBuilder: FormBuilder
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
) {}
|
||||
|
||||
get reportTypesLength() {
|
||||
@ -70,14 +70,14 @@ export class EditDossierDownloadPackageComponent implements OnInit, EditDossierS
|
||||
this.dossierForm = this._formBuilder.group(
|
||||
{
|
||||
reportTemplateIds: [this.dossier.reportTemplateIds],
|
||||
downloadFileTypes: [this.dossier.downloadFileTypes]
|
||||
downloadFileTypes: [this.dossier.downloadFileTypes],
|
||||
},
|
||||
{
|
||||
validators: control =>
|
||||
control.value.reportTemplateIds?.length > 0 || control.value.downloadFileTypes?.length > 0
|
||||
? null
|
||||
: { downloadPackage: true }
|
||||
}
|
||||
: { downloadPackage: true },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ export class EditDossierDownloadPackageComponent implements OnInit, EditDossierS
|
||||
const dossier = {
|
||||
...this.dossier,
|
||||
downloadFileTypes: this.dossierForm.get('downloadFileTypes').value,
|
||||
reportTemplateIds: this.dossierForm.get('reportTemplateIds').value
|
||||
reportTemplateIds: this.dossierForm.get('reportTemplateIds').value,
|
||||
};
|
||||
await this._dossiersService.createOrUpdate(dossier).toPromise();
|
||||
this.updateDossier.emit();
|
||||
@ -94,7 +94,7 @@ export class EditDossierDownloadPackageComponent implements OnInit, EditDossierS
|
||||
revert() {
|
||||
this.dossierForm.reset({
|
||||
downloadFileTypes: this.dossier.downloadFileTypes,
|
||||
reportTemplateIds: this.dossier.reportTemplateIds
|
||||
reportTemplateIds: this.dossier.reportTemplateIds,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ type Section = 'dossierInfo' | 'downloadPackage' | 'dossierDictionary' | 'member
|
||||
|
||||
@Component({
|
||||
templateUrl: './edit-dossier-dialog.component.html',
|
||||
styleUrls: ['./edit-dossier-dialog.component.scss']
|
||||
styleUrls: ['./edit-dossier-dialog.component.scss'],
|
||||
})
|
||||
export class EditDossierDialogComponent {
|
||||
readonly navItems: { key: Section; title?: string; sideNavTitle?: string }[];
|
||||
@ -42,37 +42,37 @@ export class EditDossierDialogComponent {
|
||||
dossier: Dossier;
|
||||
afterSave: Function;
|
||||
section?: Section;
|
||||
}
|
||||
},
|
||||
) {
|
||||
this.navItems = [
|
||||
{
|
||||
key: 'dossierInfo',
|
||||
title: _('edit-dossier-dialog.nav-items.general-info'),
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.dossier-info')
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.dossier-info'),
|
||||
},
|
||||
{
|
||||
key: 'downloadPackage',
|
||||
title: _('edit-dossier-dialog.nav-items.choose-download'),
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.download-package')
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.download-package'),
|
||||
},
|
||||
{
|
||||
key: 'dossierDictionary',
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.dictionary'),
|
||||
title: _('edit-dossier-dialog.nav-items.dossier-dictionary')
|
||||
title: _('edit-dossier-dialog.nav-items.dossier-dictionary'),
|
||||
},
|
||||
{
|
||||
key: 'members',
|
||||
title: _('edit-dossier-dialog.nav-items.team-members'),
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.members')
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.members'),
|
||||
},
|
||||
{
|
||||
key: 'dossierAttributes',
|
||||
title: _('edit-dossier-dialog.nav-items.dossier-attributes')
|
||||
title: _('edit-dossier-dialog.nav-items.dossier-attributes'),
|
||||
},
|
||||
{
|
||||
key: 'deletedDocuments',
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.deleted-documents')
|
||||
}
|
||||
sideNavTitle: _('edit-dossier-dialog.nav-items.deleted-documents'),
|
||||
},
|
||||
];
|
||||
|
||||
this.dossier = _data.dossier;
|
||||
@ -90,7 +90,7 @@ export class EditDossierDialogComponent {
|
||||
dossierDictionary: this.dictionaryComponent,
|
||||
members: this.membersComponent,
|
||||
dossierAttributes: this.attributesComponent,
|
||||
deletedDocuments: this.deletedDocumentsComponent
|
||||
deletedDocuments: this.deletedDocumentsComponent,
|
||||
}[this.activeNav];
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ export class EditDossierDialogComponent {
|
||||
await this.activeComponent.save();
|
||||
}
|
||||
|
||||
async revert() {
|
||||
revert() {
|
||||
this.activeComponent.revert();
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ import { DossierTemplatesService } from '../../../services/dossier-templates.ser
|
||||
@Component({
|
||||
selector: 'redaction-edit-dossier-general-info',
|
||||
templateUrl: './edit-dossier-general-info.component.html',
|
||||
styleUrls: ['./edit-dossier-general-info.component.scss']
|
||||
styleUrls: ['./edit-dossier-general-info.component.scss'],
|
||||
})
|
||||
export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSectionInterface {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -37,7 +37,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _router: Router,
|
||||
private readonly _editDossierDialogRef: MatDialogRef<EditDossierDialogComponent>,
|
||||
private readonly _toaster: Toaster
|
||||
private readonly _toaster: Toaster,
|
||||
) {}
|
||||
|
||||
get changed() {
|
||||
@ -72,13 +72,13 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
dossierTemplateId: [
|
||||
{
|
||||
value: this.dossier.dossierTemplateId,
|
||||
disabled: this.dossier.hasFiles
|
||||
disabled: this.dossier.hasFiles,
|
||||
},
|
||||
Validators.required
|
||||
Validators.required,
|
||||
],
|
||||
description: [this.dossier.description],
|
||||
dueDate: [this.dossier.dueDate],
|
||||
watermarkEnabled: [this.dossier.watermarkEnabled]
|
||||
watermarkEnabled: [this.dossier.watermarkEnabled],
|
||||
});
|
||||
this.hasDueDate = !!this.dossier.dueDate;
|
||||
}
|
||||
@ -89,7 +89,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
dossierTemplateId: this.dossier.dossierTemplateId,
|
||||
description: this.dossier.description,
|
||||
watermarkEnabled: this.dossier.watermarkEnabled,
|
||||
dueDate: this.dossier.dueDate
|
||||
dueDate: this.dossier.dueDate,
|
||||
});
|
||||
}
|
||||
|
||||
@ -100,13 +100,13 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
description: this.dossierForm.get('description').value,
|
||||
watermarkEnabled: this.dossierForm.get('watermarkEnabled').value,
|
||||
dueDate: this.hasDueDate ? this.dossierForm.get('dueDate').value : undefined,
|
||||
dossierTemplateId: this.dossierForm.get('dossierTemplateId').value
|
||||
dossierTemplateId: this.dossierForm.get('dossierTemplateId').value,
|
||||
} as DossierRequest;
|
||||
await this._dossiersService.createOrUpdate(dossier).toPromise();
|
||||
this.updateDossier.emit();
|
||||
}
|
||||
|
||||
async deleteDossier() {
|
||||
deleteDossier() {
|
||||
const data = new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.delete-dossier.title'),
|
||||
titleColor: TitleColors.PRIMARY,
|
||||
@ -117,8 +117,8 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
denyText: _('confirmation-dialog.delete-dossier.deny-text'),
|
||||
translateParams: {
|
||||
dossierName: this.dossier.dossierName,
|
||||
dossiersCount: 1
|
||||
}
|
||||
dossiersCount: 1,
|
||||
},
|
||||
});
|
||||
this._dialogService.openDialog('confirm', null, data, async () => {
|
||||
await this._dossiersService.delete(this.dossier).toPromise();
|
||||
|
||||
@ -7,7 +7,7 @@ import { UserService } from '@services/user.service';
|
||||
@Component({
|
||||
selector: 'redaction-edit-dossier-team-members',
|
||||
templateUrl: './edit-dossier-team-members.component.html',
|
||||
styleUrls: ['./edit-dossier-team-members.component.scss']
|
||||
styleUrls: ['./edit-dossier-team-members.component.scss'],
|
||||
})
|
||||
export class EditDossierTeamMembersComponent implements EditDossierSectionInterface {
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
|
||||
@ -18,7 +18,7 @@ export interface LegalBasisOption {
|
||||
@Component({
|
||||
selector: 'redaction-force-redaction-dialog',
|
||||
templateUrl: './force-redaction-dialog.component.html',
|
||||
styleUrls: ['./force-redaction-dialog.component.scss']
|
||||
styleUrls: ['./force-redaction-dialog.component.scss'],
|
||||
})
|
||||
export class ForceRedactionDialogComponent implements OnInit {
|
||||
redactionForm: FormGroup;
|
||||
@ -34,10 +34,10 @@ export class ForceRedactionDialogComponent implements OnInit {
|
||||
private readonly _legalBasisMappingControllerService: LegalBasisMappingControllerService,
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
public dialogRef: MatDialogRef<ForceRedactionDialogComponent>
|
||||
public dialogRef: MatDialogRef<ForceRedactionDialogComponent>,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
ngOnInit() {
|
||||
this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._dossiersService.activeDossier.dossierTemplateId)
|
||||
.subscribe(data => {
|
||||
@ -45,7 +45,7 @@ export class ForceRedactionDialogComponent implements OnInit {
|
||||
this.legalOptions.push({
|
||||
legalBasis: lbm.reason,
|
||||
description: lbm.description,
|
||||
label: lbm.name
|
||||
label: lbm.name,
|
||||
});
|
||||
});
|
||||
|
||||
@ -56,7 +56,7 @@ export class ForceRedactionDialogComponent implements OnInit {
|
||||
|
||||
this.redactionForm = this._formBuilder.group({
|
||||
reason: [null, Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required]
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ export interface LegalBasisOption {
|
||||
@Component({
|
||||
selector: 'redaction-manual-annotation-dialog',
|
||||
templateUrl: './manual-annotation-dialog.component.html',
|
||||
styleUrls: ['./manual-annotation-dialog.component.scss']
|
||||
styleUrls: ['./manual-annotation-dialog.component.scss'],
|
||||
})
|
||||
export class ManualAnnotationDialogComponent implements OnInit {
|
||||
redactionForm: FormGroup;
|
||||
@ -45,7 +45,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
public dialogRef: MatDialogRef<ManualAnnotationDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public manualRedactionEntryWrapper: ManualRedactionEntryWrapper
|
||||
@Inject(MAT_DIALOG_DATA) public manualRedactionEntryWrapper: ManualRedactionEntryWrapper,
|
||||
) {}
|
||||
|
||||
get title() {
|
||||
@ -60,7 +60,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
return null;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
ngOnInit() {
|
||||
this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._dossiersService.activeDossier.dossierTemplateId)
|
||||
.subscribe(data => {
|
||||
@ -68,7 +68,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
this.legalOptions.push({
|
||||
legalBasis: lbm.reason,
|
||||
description: lbm.description,
|
||||
label: lbm.name
|
||||
label: lbm.name,
|
||||
});
|
||||
});
|
||||
|
||||
@ -85,7 +85,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
dictionary: this.isDictionaryRequest
|
||||
? [this.isFalsePositiveRequest ? 'false_positive' : null, Validators.required]
|
||||
: ['manual', Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required]
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
});
|
||||
|
||||
for (const key of Object.keys(this._appStateService.dictionaryData[this._dossiersService.activeDossier.dossierTemplateId])) {
|
||||
@ -101,7 +101,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
this._enhanceManualRedaction(this.manualRedactionEntryWrapper.manualRedactionEntry);
|
||||
this._manualAnnotationService.addAnnotation(this.manualRedactionEntryWrapper.manualRedactionEntry).subscribe(
|
||||
response => this.dialogRef.close(new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response)),
|
||||
() => this.dialogRef.close()
|
||||
() => this.dialogRef.close(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
return value.replace(
|
||||
// eslint-disable-next-line no-control-regex,max-len
|
||||
/([^\s\d-]{2,})[-\u00AD]\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi,
|
||||
'$1'
|
||||
'$1',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import { ImageCategory } from '../../models/image-category.model';
|
||||
@Component({
|
||||
selector: 'redaction-recategorize-image-dialog',
|
||||
templateUrl: './recategorize-image-dialog.component.html',
|
||||
styleUrls: ['./recategorize-image-dialog.component.scss']
|
||||
styleUrls: ['./recategorize-image-dialog.component.scss'],
|
||||
})
|
||||
export class RecategorizeImageDialogComponent implements OnInit {
|
||||
recategorizeImageForm: FormGroup;
|
||||
@ -21,26 +21,26 @@ export class RecategorizeImageDialogComponent implements OnInit {
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<RecategorizeImageDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public annotations: AnnotationWrapper[]
|
||||
@Inject(MAT_DIALOG_DATA) public annotations: AnnotationWrapper[],
|
||||
) {}
|
||||
|
||||
get changed(): boolean {
|
||||
return this.recategorizeImageForm.get('type').value !== this.annotations[0].type;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
ngOnInit() {
|
||||
this.isDocumentAdmin = this._permissionsService.isApprover();
|
||||
|
||||
this.recategorizeImageForm = this._formBuilder.group({
|
||||
type: [this.annotations[0].type, Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required]
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
save() {
|
||||
this.dialogRef.close({
|
||||
type: this.recategorizeImageForm.get('type').value,
|
||||
comment: this.recategorizeImageForm.get('comment').value
|
||||
comment: this.recategorizeImageForm.get('comment').value,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ export interface RemoveAnnotationsDialogInput {
|
||||
@Component({
|
||||
selector: 'redaction-remove-annotations-dialog',
|
||||
templateUrl: './remove-annotations-dialog.component.html',
|
||||
styleUrls: ['./remove-annotations-dialog.component.scss']
|
||||
styleUrls: ['./remove-annotations-dialog.component.scss'],
|
||||
})
|
||||
export class RemoveAnnotationsDialogComponent {
|
||||
redactionForm: FormGroup;
|
||||
@ -24,10 +24,10 @@ export class RemoveAnnotationsDialogComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
readonly permissionsService: PermissionsService,
|
||||
public dialogRef: MatDialogRef<RemoveAnnotationsDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: RemoveAnnotationsDialogInput
|
||||
@Inject(MAT_DIALOG_DATA) public data: RemoveAnnotationsDialogInput,
|
||||
) {
|
||||
this.redactionForm = this._formBuilder.group({
|
||||
comment: this.permissionsService.isApprover() ? [null] : [null, Validators.required]
|
||||
comment: this.permissionsService.isApprover() ? [null] : [null, Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ export class RemoveAnnotationsDialogComponent {
|
||||
printable(annotation: AnnotationWrapper) {
|
||||
if (annotation.isImage) {
|
||||
return this._translateService.instant('remove-annotations-dialog.image-type', {
|
||||
typeLabel: humanize(annotation.type)
|
||||
typeLabel: humanize(annotation.type),
|
||||
});
|
||||
} else {
|
||||
return annotation.value;
|
||||
|
||||
@ -13,17 +13,17 @@ const routes: Routes = [
|
||||
component: SearchScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':dossierId',
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
reuse: true
|
||||
reuse: true,
|
||||
},
|
||||
loadChildren: () => import('./screens/dossier-overview/dossier-overview.module').then(m => m.DossierOverviewModule)
|
||||
loadChildren: () => import('./screens/dossier-overview/dossier-overview.module').then(m => m.DossierOverviewModule),
|
||||
},
|
||||
{
|
||||
path: ':dossierId/file/:fileId',
|
||||
@ -31,8 +31,8 @@ const routes: Routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
reuse: true
|
||||
}
|
||||
reuse: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
@ -40,14 +40,14 @@ const routes: Routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
reuse: true
|
||||
reuse: true,
|
||||
},
|
||||
loadChildren: () => import('./screens/dossiers-listing/dossiers-listing.module').then(m => m.DossiersListingModule)
|
||||
}
|
||||
loadChildren: () => import('./screens/dossiers-listing/dossiers-listing.module').then(m => m.DossiersListingModule),
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class DossiersRoutingModule {}
|
||||
|
||||
@ -52,7 +52,7 @@ const dialogs = [
|
||||
DocumentInfoDialogComponent,
|
||||
AssignReviewerApproverDialogComponent,
|
||||
ChangeLegalBasisDialogComponent,
|
||||
RecategorizeImageDialogComponent
|
||||
RecategorizeImageDialogComponent,
|
||||
];
|
||||
|
||||
const components = [
|
||||
@ -75,7 +75,7 @@ const components = [
|
||||
AnnotationSourceComponent,
|
||||
|
||||
...screens,
|
||||
...dialogs
|
||||
...dialogs,
|
||||
];
|
||||
|
||||
const services = [
|
||||
@ -85,12 +85,12 @@ const services = [
|
||||
PdfViewerDataService,
|
||||
AnnotationDrawService,
|
||||
AnnotationProcessingService,
|
||||
UserPreferenceControllerService
|
||||
UserPreferenceControllerService,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...components],
|
||||
providers: [...services],
|
||||
imports: [CommonModule, SharedModule, SharedDossiersModule, FileUploadDownloadModule, DossiersRoutingModule, OverlayModule]
|
||||
imports: [CommonModule, SharedModule, SharedDossiersModule, FileUploadDownloadModule, DossiersRoutingModule, OverlayModule],
|
||||
})
|
||||
export class DossiersModule {}
|
||||
|
||||
@ -14,7 +14,7 @@ import { Dossier } from '@state/model/dossier';
|
||||
@Component({
|
||||
selector: 'redaction-dossier-overview-bulk-actions',
|
||||
templateUrl: './dossier-overview-bulk-actions.component.html',
|
||||
styleUrls: ['./dossier-overview-bulk-actions.component.scss']
|
||||
styleUrls: ['./dossier-overview-bulk-actions.component.scss'],
|
||||
})
|
||||
export class DossierOverviewBulkActionsComponent {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -31,7 +31,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
private readonly _fileActionService: FileActionService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _listingService: ListingService<File>
|
||||
private readonly _listingService: ListingService<File>,
|
||||
) {}
|
||||
|
||||
get selectedFiles(): File[] {
|
||||
@ -50,7 +50,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
if (this.areSomeFilesSelected) {
|
||||
const allFilesAreUnderReviewOrUnassigned = this.selectedFiles.reduce(
|
||||
(acc, file) => acc && (file.isUnderReview || file.isUnassigned),
|
||||
true
|
||||
true,
|
||||
);
|
||||
const allFilesAreUnderApproval = this.selectedFiles.reduce((acc, file) => acc && file.isUnderApproval, true);
|
||||
return allFilesAreUnderReviewOrUnassigned || allFilesAreUnderApproval;
|
||||
@ -121,21 +121,21 @@ export class DossierOverviewBulkActionsComponent {
|
||||
null,
|
||||
new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.delete-file.title'),
|
||||
question: _('confirmation-dialog.delete-file.question')
|
||||
question: _('confirmation-dialog.delete-file.question'),
|
||||
}),
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
await this._fileManagementControllerService
|
||||
.deleteFiles(
|
||||
this.selectedFiles.map(item => item.fileId),
|
||||
this.dossier.dossierId
|
||||
this.dossier.dossierId,
|
||||
)
|
||||
.toPromise();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
this.reload.emit();
|
||||
this._listingService.setSelected([]);
|
||||
this._loadingService.stop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
}
|
||||
}
|
||||
|
||||
async reanalyse() {
|
||||
reanalyse() {
|
||||
const fileIds = this.selectedFiles.filter(file => file.analysisRequired).map(file => file.fileId);
|
||||
this._performBulkAction(this._reanalysisControllerService.reanalyzeFilesForDossier(fileIds, this.dossier.id));
|
||||
}
|
||||
@ -169,11 +169,11 @@ export class DossierOverviewBulkActionsComponent {
|
||||
null,
|
||||
new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.approve-multiple-files.title'),
|
||||
question: _('confirmation-dialog.approve-multiple-files.question')
|
||||
question: _('confirmation-dialog.approve-multiple-files.question'),
|
||||
}),
|
||||
() => {
|
||||
this._performBulkAction(this._fileActionService.setFilesApproved(this.selectedFiles));
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this._performBulkAction(this._fileActionService.setFilesApproved(this.selectedFiles));
|
||||
|
||||
@ -10,7 +10,7 @@ import { DossierTemplate } from '@models/file/dossier-template';
|
||||
@Component({
|
||||
selector: 'redaction-dossier-details-stats',
|
||||
templateUrl: './dossier-details-stats.component.html',
|
||||
styleUrls: ['./dossier-details-stats.component.scss']
|
||||
styleUrls: ['./dossier-details-stats.component.scss'],
|
||||
})
|
||||
export class DossierDetailsStatsComponent {
|
||||
attributesExpanded = false;
|
||||
@ -21,7 +21,7 @@ export class DossierDetailsStatsComponent {
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
readonly dossiersService: DossiersService
|
||||
readonly dossiersService: DossiersService,
|
||||
) {}
|
||||
|
||||
dossierTemplate(dossier: Dossier): DossierTemplate {
|
||||
@ -31,7 +31,7 @@ export class DossierDetailsStatsComponent {
|
||||
openEditDossierAttributesDialog(dossier: Dossier) {
|
||||
this._dialogService.openDialog('editDossier', null, {
|
||||
dossier,
|
||||
section: 'dossierAttributes'
|
||||
section: 'dossierAttributes',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import { DossiersService } from '../../../../services/dossiers.service';
|
||||
@Component({
|
||||
selector: 'redaction-dossier-details',
|
||||
templateUrl: './dossier-details.component.html',
|
||||
styleUrls: ['./dossier-details.component.scss']
|
||||
styleUrls: ['./dossier-details.component.scss'],
|
||||
})
|
||||
export class DossierDetailsComponent implements OnInit {
|
||||
documentsChartData: DoughnutChartConfig[] = [];
|
||||
@ -38,7 +38,7 @@ export class DossierDetailsComponent implements OnInit {
|
||||
readonly filterService: FilterService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _toaster: Toaster
|
||||
private readonly _toaster: Toaster,
|
||||
) {}
|
||||
|
||||
get managers() {
|
||||
@ -66,7 +66,7 @@ export class DossierDetailsComponent implements OnInit {
|
||||
value: groups[status].length,
|
||||
color: status,
|
||||
label: fileStatusTranslations[status],
|
||||
key: status
|
||||
key: status,
|
||||
});
|
||||
}
|
||||
this.documentsChartData.sort(StatusSorter.byStatus);
|
||||
|
||||
@ -7,7 +7,7 @@ import { IFileAttributeConfig } from '@redaction/red-ui-http';
|
||||
selector: 'redaction-table-item',
|
||||
templateUrl: './table-item.component.html',
|
||||
styleUrls: ['./table-item.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class TableItemComponent {
|
||||
@Input() @Required() file!: File;
|
||||
|
||||
@ -27,7 +27,7 @@ export class ConfigService {
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _appConfigService: AppConfigService
|
||||
private readonly _appConfigService: AppConfigService,
|
||||
) {}
|
||||
|
||||
get actionConfig() {
|
||||
@ -36,46 +36,46 @@ export class ConfigService {
|
||||
label: this._translateService.instant('dossier-overview.header-actions.edit'),
|
||||
action: $event => this._openEditDossierDialog($event),
|
||||
icon: 'iqser:edit',
|
||||
hide: !this._userService.currentUser.isManager
|
||||
}
|
||||
hide: !this._userService.currentUser.isManager,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
tableConfig(displayedAttributes: IFileAttributeConfig[]): TableColumnConfig<File>[] {
|
||||
const dynamicColumns: TableColumnConfig<File>[] = displayedAttributes.map(config => ({
|
||||
label: config.label,
|
||||
notTranslatable: true
|
||||
notTranslatable: true,
|
||||
}));
|
||||
return [
|
||||
{
|
||||
label: _('dossier-overview.table-col-names.name'),
|
||||
sortByKey: 'searchKey',
|
||||
width: '3fr'
|
||||
width: '3fr',
|
||||
},
|
||||
{
|
||||
label: _('dossier-overview.table-col-names.added-on'),
|
||||
sortByKey: 'added',
|
||||
width: '2fr'
|
||||
width: '2fr',
|
||||
},
|
||||
...dynamicColumns,
|
||||
{
|
||||
label: _('dossier-overview.table-col-names.needs-work')
|
||||
label: _('dossier-overview.table-col-names.needs-work'),
|
||||
},
|
||||
{
|
||||
label: _('dossier-overview.table-col-names.assigned-to'),
|
||||
class: 'user-column',
|
||||
sortByKey: 'reviewerName',
|
||||
width: '2fr'
|
||||
width: '2fr',
|
||||
},
|
||||
{
|
||||
label: _('dossier-overview.table-col-names.pages'),
|
||||
sortByKey: 'numberOfPages'
|
||||
sortByKey: 'numberOfPages',
|
||||
},
|
||||
{
|
||||
label: _('dossier-overview.table-col-names.status'),
|
||||
class: 'flex-end',
|
||||
sortByKey: 'statusSort'
|
||||
}
|
||||
sortByKey: 'statusSort',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ export class ConfigService {
|
||||
key: FileStatuses.UNASSIGNED,
|
||||
enterFn: this._unassignFn(reloadDossiers),
|
||||
enterPredicate: () => false,
|
||||
color: '#D3D5DA'
|
||||
color: '#D3D5DA',
|
||||
},
|
||||
{
|
||||
label: fileStatusTranslations[FileStatuses.UNDER_REVIEW],
|
||||
@ -99,7 +99,7 @@ export class ConfigService {
|
||||
this._permissionsService.canAssignToSelf(file) ||
|
||||
this._permissionsService.canAssignUser(file),
|
||||
key: FileStatuses.UNDER_REVIEW,
|
||||
color: '#FDBD00'
|
||||
color: '#FDBD00',
|
||||
},
|
||||
{
|
||||
label: fileStatusTranslations[FileStatuses.UNDER_APPROVAL],
|
||||
@ -107,16 +107,16 @@ export class ConfigService {
|
||||
enterPredicate: (file: File) =>
|
||||
this._permissionsService.canSetUnderApproval(file) || this._permissionsService.canUndoApproval(file),
|
||||
key: FileStatuses.UNDER_APPROVAL,
|
||||
color: '#374C81'
|
||||
color: '#374C81',
|
||||
},
|
||||
{
|
||||
label: fileStatusTranslations[FileStatuses.APPROVED],
|
||||
enterFn: this._approveFn(reloadDossiers),
|
||||
enterPredicate: (file: File) => this._permissionsService.isReadyForApproval(file) && file.canBeApproved,
|
||||
key: FileStatuses.APPROVED,
|
||||
color: '#48C9F7'
|
||||
}
|
||||
]
|
||||
color: '#48C9F7',
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ export class ConfigService {
|
||||
fileAttributeConfigs: IFileAttributeConfig[],
|
||||
needsWorkFilterTemplate: TemplateRef<unknown>,
|
||||
checkedRequiredFilters: () => NestedFilter[],
|
||||
checkedNotRequiredFilters: () => NestedFilter[]
|
||||
checkedNotRequiredFilters: () => NestedFilter[],
|
||||
) {
|
||||
const allDistinctFileStatuses = new Set<string>();
|
||||
const allDistinctPeople = new Set<string>();
|
||||
@ -189,8 +189,8 @@ export class ConfigService {
|
||||
status =>
|
||||
new NestedFilter({
|
||||
id: status,
|
||||
label: this._translateService.instant(fileStatusTranslations[status])
|
||||
})
|
||||
label: this._translateService.instant(fileStatusTranslations[status]),
|
||||
}),
|
||||
);
|
||||
|
||||
filterGroups.push({
|
||||
@ -198,7 +198,7 @@ export class ConfigService {
|
||||
label: this._translateService.instant('filters.status'),
|
||||
icon: 'red:status',
|
||||
filters: statusFilters.sort((a, b) => StatusSorter[a.id] - StatusSorter[b.id]),
|
||||
checker: keyChecker('status')
|
||||
checker: keyChecker('status'),
|
||||
});
|
||||
|
||||
const peopleFilters: NestedFilter[] = [];
|
||||
@ -208,16 +208,16 @@ export class ConfigService {
|
||||
peopleFilters.push(
|
||||
new NestedFilter({
|
||||
id: null,
|
||||
label: this._translateService.instant('initials-avatar.unassigned')
|
||||
})
|
||||
label: this._translateService.instant('initials-avatar.unassigned'),
|
||||
}),
|
||||
);
|
||||
}
|
||||
allDistinctPeople.forEach(userId => {
|
||||
peopleFilters.push(
|
||||
new NestedFilter({
|
||||
id: userId,
|
||||
label: this._userService.getNameForId(userId)
|
||||
})
|
||||
label: this._userService.getNameForId(userId),
|
||||
}),
|
||||
);
|
||||
});
|
||||
filterGroups.push({
|
||||
@ -225,15 +225,15 @@ export class ConfigService {
|
||||
label: this._translateService.instant('filters.assigned-people'),
|
||||
icon: 'red:user',
|
||||
filters: peopleFilters,
|
||||
checker: keyChecker('currentReviewer')
|
||||
checker: keyChecker('currentReviewer'),
|
||||
});
|
||||
|
||||
const needsWorkFilters = [...allDistinctNeedsWork].map(
|
||||
item =>
|
||||
new NestedFilter({
|
||||
id: item,
|
||||
label: workloadTranslations[item]
|
||||
})
|
||||
label: workloadTranslations[item],
|
||||
}),
|
||||
);
|
||||
|
||||
filterGroups.push({
|
||||
@ -243,7 +243,7 @@ export class ConfigService {
|
||||
filterTemplate: needsWorkFilterTemplate,
|
||||
filters: needsWorkFilters.sort(RedactionFilterSorter.byKey),
|
||||
checker: annotationFilterChecker,
|
||||
matchAll: true
|
||||
matchAll: true,
|
||||
});
|
||||
|
||||
dynamicFilters.forEach((filterValue: Set<string>, filterKey: string) => {
|
||||
@ -257,10 +257,10 @@ export class ConfigService {
|
||||
(value: string) =>
|
||||
new NestedFilter({
|
||||
id: value,
|
||||
label: value === '-' ? this._translateService.instant('filters.empty') : value
|
||||
})
|
||||
label: value === '-' ? this._translateService.instant('filters.empty') : value,
|
||||
}),
|
||||
),
|
||||
checker: (input: File, filter: INestedFilter) => filter.id === input.fileAttributes.attributeIdToValue[id]
|
||||
checker: (input: File, filter: INestedFilter) => filter.id === input.fileAttributes.attributeIdToValue[id],
|
||||
});
|
||||
});
|
||||
|
||||
@ -269,15 +269,15 @@ export class ConfigService {
|
||||
filters: this._quickFilters(entities),
|
||||
checker: (file: File) =>
|
||||
checkedRequiredFilters().reduce((acc, f) => acc && f.checker(file), true) &&
|
||||
(checkedNotRequiredFilters().length === 0 || checkedNotRequiredFilters().reduce((acc, f) => acc || f.checker(file), false))
|
||||
(checkedNotRequiredFilters().length === 0 || checkedNotRequiredFilters().reduce((acc, f) => acc || f.checker(file), false)),
|
||||
});
|
||||
|
||||
const filesNamesFilters = entities.map(
|
||||
file =>
|
||||
new NestedFilter({
|
||||
id: file.filename,
|
||||
label: file.filename
|
||||
})
|
||||
label: file.filename,
|
||||
}),
|
||||
);
|
||||
|
||||
filterGroups.push({
|
||||
@ -286,7 +286,7 @@ export class ConfigService {
|
||||
icon: 'iqser:document',
|
||||
filters: filesNamesFilters,
|
||||
checker: keyChecker('filename'),
|
||||
filterceptionPlaceholder: this._translateService.instant('dossier-overview.filters.search')
|
||||
filterceptionPlaceholder: this._translateService.instant('dossier-overview.filters.search'),
|
||||
});
|
||||
|
||||
return filterGroups;
|
||||
@ -303,11 +303,11 @@ export class ConfigService {
|
||||
{
|
||||
id: 'recent',
|
||||
label: this._translateService.instant('dossier-overview.quick-filters.recent', {
|
||||
hours: recentPeriod
|
||||
hours: recentPeriod,
|
||||
}),
|
||||
required: true,
|
||||
checker: this._recentlyModifiedChecker
|
||||
}
|
||||
checker: this._recentlyModifiedChecker,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@ -316,29 +316,29 @@ export class ConfigService {
|
||||
{
|
||||
id: 'assigned-to-me',
|
||||
label: this._translateService.instant('dossier-overview.quick-filters.assigned-to-me'),
|
||||
checker: (file: File) => file.currentReviewer === this._userService.currentUser.id
|
||||
checker: (file: File) => file.currentReviewer === this._userService.currentUser.id,
|
||||
},
|
||||
{
|
||||
id: 'unassigned',
|
||||
label: this._translateService.instant('dossier-overview.quick-filters.unassigned'),
|
||||
checker: (file: File) => !file.currentReviewer
|
||||
checker: (file: File) => !file.currentReviewer,
|
||||
},
|
||||
{
|
||||
id: 'assigned-to-others',
|
||||
label: this._translateService.instant('dossier-overview.quick-filters.assigned-to-others'),
|
||||
checker: (file: File) => !!file.currentReviewer && file.currentReviewer !== this._userService.currentUser.id
|
||||
}
|
||||
checker: (file: File) => !!file.currentReviewer && file.currentReviewer !== this._userService.currentUser.id,
|
||||
},
|
||||
].map(filter => new NestedFilter(filter));
|
||||
}
|
||||
|
||||
private _openEditDossierDialog($event: MouseEvent) {
|
||||
this._dialogService.openDialog('editDossier', $event, {
|
||||
dossier: this._dossiersService.activeDossier
|
||||
dossier: this._dossiersService.activeDossier,
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
private _unassignFn = (reloadDossiers: () => Promise<void>) => async (file: File) => {
|
||||
private _unassignFn = (reloadDossiers: () => Promise<void>) => (file: File) => {
|
||||
// TODO
|
||||
console.log('unassign', file);
|
||||
};
|
||||
|
||||
@ -16,8 +16,8 @@ const routes = [
|
||||
{
|
||||
path: '',
|
||||
component: DossierOverviewScreenComponent,
|
||||
pathMatch: 'full'
|
||||
}
|
||||
pathMatch: 'full',
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
@ -26,9 +26,9 @@ const routes = [
|
||||
DossierOverviewBulkActionsComponent,
|
||||
DossierDetailsComponent,
|
||||
DossierDetailsStatsComponent,
|
||||
TableItemComponent
|
||||
TableItemComponent,
|
||||
],
|
||||
providers: [ConfigService],
|
||||
imports: [RouterModule.forChild(routes), CommonModule, SharedModule, SharedDossiersModule, IqserIconsModule, TranslateModule]
|
||||
imports: [RouterModule.forChild(routes), CommonModule, SharedModule, SharedDossiersModule, IqserIconsModule, TranslateModule],
|
||||
})
|
||||
export class DossierOverviewModule {}
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
TemplateRef,
|
||||
ViewChild
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { FileStatus, IFileAttributeConfig } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
@ -38,7 +38,7 @@ import {
|
||||
TableColumnConfig,
|
||||
TableComponent,
|
||||
Toaster,
|
||||
WorkflowConfig
|
||||
WorkflowConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service';
|
||||
import { DossierAttributeWithValue } from '@models/dossier-attributes.model';
|
||||
@ -56,7 +56,7 @@ import { DossierTemplatesService } from '../../../services/dossier-templates.ser
|
||||
@Component({
|
||||
templateUrl: './dossier-overview-screen.component.html',
|
||||
styleUrls: ['./dossier-overview-screen.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DossierOverviewScreenComponent) }]
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DossierOverviewScreenComponent) }],
|
||||
})
|
||||
export class DossierOverviewScreenComponent extends ListingComponent<File> implements OnInit, OnDestroy, OnDetach, OnAttach {
|
||||
readonly listingModes = ListingModes;
|
||||
@ -97,7 +97,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
private readonly _fileDropOverlayService: FileDropOverlayService,
|
||||
private readonly _dossierAttributesService: DossierAttributesService,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
private readonly _configService: ConfigService
|
||||
private readonly _configService: ConfigService,
|
||||
) {
|
||||
super(_injector);
|
||||
}
|
||||
@ -120,7 +120,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
|
||||
async actionPerformed(action?: string, file?: File) {
|
||||
if (action === 'assign-reviewer') {
|
||||
return await this.reloadDossiers();
|
||||
return this.reloadDossiers();
|
||||
}
|
||||
|
||||
this.calculateData();
|
||||
@ -138,7 +138,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
this._loadingService.start();
|
||||
this._loadEntitiesFromState();
|
||||
this.fileAttributeConfigs = this._fileAttributesService.getFileAttributeConfig(
|
||||
this.currentDossier.dossierTemplateId
|
||||
this.currentDossier.dossierTemplateId,
|
||||
)?.fileAttributeConfigs;
|
||||
this.tableColumnConfigs = this._configService.tableConfig(this.displayedAttributes);
|
||||
try {
|
||||
@ -157,7 +157,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
|
||||
this.addSubscription = this._dossierTemplatesService.entityChanged$.subscribe(() => {
|
||||
this.fileAttributeConfigs = this._fileAttributesService.getFileAttributeConfig(
|
||||
this.currentDossier.dossierTemplateId
|
||||
this.currentDossier.dossierTemplateId,
|
||||
)?.fileAttributeConfigs;
|
||||
});
|
||||
|
||||
@ -239,7 +239,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
|
||||
openAssignDossierMembersDialog(): void {
|
||||
const data = { dossier: this.currentDossier, section: 'members' };
|
||||
this._dialogService.openDialog('editDossier', null, data, async () => await this.reloadDossiers());
|
||||
this._dialogService.openDialog('editDossier', null, data, async () => this.reloadDossiers());
|
||||
}
|
||||
|
||||
openDossierDictionaryDialog() {
|
||||
@ -280,7 +280,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
this.fileAttributeConfigs,
|
||||
this._needsWorkFilterTemplate,
|
||||
() => this.checkedRequiredFilters,
|
||||
() => this.checkedNotRequiredFilters
|
||||
() => this.checkedNotRequiredFilters,
|
||||
);
|
||||
|
||||
for (const filterGroup of filterGroups) {
|
||||
|
||||
@ -11,7 +11,7 @@ import { DossiersDialogService } from '../../../../services/dossiers-dialog.serv
|
||||
selector: 'redaction-dossiers-listing-actions',
|
||||
templateUrl: './dossiers-listing-actions.component.html',
|
||||
styleUrls: ['./dossiers-listing-actions.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DossiersListingActionsComponent {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
@ -24,7 +24,7 @@ export class DossiersListingActionsComponent {
|
||||
readonly permissionsService: PermissionsService,
|
||||
readonly appStateService: AppStateService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _userService: UserService
|
||||
private readonly _userService: UserService,
|
||||
) {}
|
||||
|
||||
get statusConfig(): readonly StatusBarConfig<string>[] {
|
||||
@ -50,7 +50,7 @@ export class DossiersListingActionsComponent {
|
||||
openEditDossierDialog($event: MouseEvent, dossier: Dossier): void {
|
||||
this._dialogService.openDialog('editDossier', $event, {
|
||||
dossier,
|
||||
afterSave: () => this.actionPerformed.emit()
|
||||
afterSave: () => this.actionPerformed.emit(),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { DossiersService } from '../../../../services/dossiers.service';
|
||||
selector: 'redaction-dossiers-listing-details',
|
||||
templateUrl: './dossiers-listing-details.component.html',
|
||||
styleUrls: ['./dossiers-listing-details.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DossiersListingDetailsComponent {
|
||||
@Input() dossiersChartData: DoughnutChartConfig[];
|
||||
|
||||
@ -6,7 +6,7 @@ import { DossierTemplatesService } from '../../../../services/dossier-templates.
|
||||
selector: 'redaction-dossiers-listing-dossier-name',
|
||||
templateUrl: './dossiers-listing-dossier-name.component.html',
|
||||
styleUrls: ['./dossiers-listing-dossier-name.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DossiersListingDossierNameComponent {
|
||||
@Input() dossier: Dossier;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user