dossier and ruleset rename v1
This commit is contained in:
parent
c165e0e786
commit
9ecd8e51b5
@ -13,7 +13,7 @@ import { CustomRouteReuseStrategy } from '@utils/custom-route-reuse.strategy';
|
||||
const routes = [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'main/projects',
|
||||
redirectTo: 'main/dossiers',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
@ -41,10 +41,10 @@ const routes = [
|
||||
loadChildren: () => import('./modules/admin/admin.module').then((m) => m.AdminModule)
|
||||
},
|
||||
{
|
||||
path: 'main/projects',
|
||||
path: 'main/dossiers',
|
||||
component: BaseScreenComponent,
|
||||
loadChildren: () =>
|
||||
import('./modules/projects/projects.module').then((m) => m.ProjectsModule)
|
||||
import('./modules/dossiers/dossiers.module').then((m) => m.DossiersModule)
|
||||
},
|
||||
{
|
||||
path: 'main/downloads',
|
||||
@ -62,7 +62,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'main/projects',
|
||||
redirectTo: 'main/dossiers',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
];
|
||||
|
||||
@ -8,21 +8,21 @@
|
||||
<mat-menu #menuNav="matMenu">
|
||||
<button
|
||||
mat-menu-item
|
||||
routerLink="/main/projects"
|
||||
translate="top-bar.navigation-items.projects"
|
||||
routerLink="/main/dossiers"
|
||||
translate="top-bar.navigation-items.dossiers"
|
||||
></button>
|
||||
<button
|
||||
*ngIf="appStateService.activeProject"
|
||||
[routerLink]="'/main/projects/' + appStateService.activeProjectId"
|
||||
*ngIf="appStateService.activeDossier"
|
||||
[routerLink]="'/main/dossiers/' + appStateService.activeDossierId"
|
||||
mat-menu-item
|
||||
>
|
||||
{{ appStateService.activeProject.project.projectName }}
|
||||
{{ appStateService.activeDossier.dossier.dossierName }}
|
||||
</button>
|
||||
<button
|
||||
*ngIf="appStateService.activeFile"
|
||||
[routerLink]="
|
||||
'/main/projects/' +
|
||||
appStateService.activeProjectId +
|
||||
'/main/dossiers/' +
|
||||
appStateService.activeDossierId +
|
||||
'/file/' +
|
||||
appStateService.activeFile.fileId
|
||||
"
|
||||
@ -37,42 +37,42 @@
|
||||
class="menu flex-2 visible-lg breadcrumbs-container"
|
||||
>
|
||||
<a
|
||||
*ngIf="projectsView"
|
||||
*ngIf="dossiersView"
|
||||
[routerLinkActiveOptions]="{ exact: true }"
|
||||
class="breadcrumb"
|
||||
routerLink="/main/projects"
|
||||
routerLink="/main/dossiers"
|
||||
routerLinkActive="active"
|
||||
translate="top-bar.navigation-items.projects"
|
||||
translate="top-bar.navigation-items.dossiers"
|
||||
></a>
|
||||
<a *ngIf="!projectsView" class="breadcrumb back" redactionNavigateLastProjectsScreen>
|
||||
<a *ngIf="!dossiersView" class="breadcrumb back" redactionNavigateLastDossiersScreen>
|
||||
<mat-icon svgIcon="red:expand"></mat-icon>
|
||||
{{ 'top-bar.navigation-items.back' | translate }}
|
||||
</a>
|
||||
<ng-container *ngIf="projectsView">
|
||||
<ng-container *ngIf="dossiersView">
|
||||
<mat-icon
|
||||
*ngIf="!appStateService.activeProject"
|
||||
*ngIf="!appStateService.activeDossier"
|
||||
class="primary"
|
||||
svgIcon="red:arrow-down"
|
||||
></mat-icon>
|
||||
<mat-icon
|
||||
*ngIf="appStateService.activeProject"
|
||||
*ngIf="appStateService.activeDossier"
|
||||
svgIcon="red:arrow-right"
|
||||
></mat-icon>
|
||||
<a
|
||||
*ngIf="appStateService.activeProject"
|
||||
*ngIf="appStateService.activeDossier"
|
||||
[routerLinkActiveOptions]="{ exact: true }"
|
||||
[routerLink]="'/main/projects/' + appStateService.activeProjectId"
|
||||
[routerLink]="'/main/dossiers/' + appStateService.activeDossierId"
|
||||
class="breadcrumb"
|
||||
routerLinkActive="active"
|
||||
>
|
||||
{{ appStateService.activeProject.project.projectName }}
|
||||
{{ appStateService.activeDossier.dossier.dossierName }}
|
||||
</a>
|
||||
<mat-icon *ngIf="appStateService.activeFile" svgIcon="red:arrow-right"></mat-icon>
|
||||
<a
|
||||
*ngIf="appStateService.activeFile"
|
||||
[routerLink]="
|
||||
'/main/projects/' +
|
||||
appStateService.activeProjectId +
|
||||
'/main/dossiers/' +
|
||||
appStateService.activeDossierId +
|
||||
'/file/' +
|
||||
appStateService.activeFile.fileId
|
||||
"
|
||||
|
||||
@ -31,14 +31,14 @@ export class BaseScreenComponent {
|
||||
private readonly _translateService: TranslateService
|
||||
) {
|
||||
_router.events.subscribe(() => {
|
||||
this._projectsView = this._router.url.indexOf('/main/projects') === 0;
|
||||
this._dossiersView = this._router.url.indexOf('/main/dossiers') === 0;
|
||||
});
|
||||
}
|
||||
|
||||
private _projectsView: boolean;
|
||||
private _dossiersView: boolean;
|
||||
|
||||
get projectsView() {
|
||||
return this._projectsView;
|
||||
get dossiersView() {
|
||||
return this._dossiersView;
|
||||
}
|
||||
|
||||
get user() {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="actions flex-1">
|
||||
<redaction-circle-button
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -8,7 +8,7 @@ export class FileStatusWrapper {
|
||||
constructor(
|
||||
public fileStatus: FileStatus,
|
||||
public reviewerName: string,
|
||||
public ruleSetId: string,
|
||||
public dossierTemplateId: string,
|
||||
fileAttributesConfig?: FileAttributesConfig
|
||||
) {
|
||||
this.searchField = fileStatus.filename;
|
||||
@ -111,8 +111,8 @@ export class FileStatusWrapper {
|
||||
return this.fileStatus.numberOfAnalyses;
|
||||
}
|
||||
|
||||
get projectId() {
|
||||
return this.fileStatus.projectId;
|
||||
get dossierId() {
|
||||
return this.fileStatus.dossierId;
|
||||
}
|
||||
|
||||
get isExcluded() {
|
||||
|
||||
@ -3,7 +3,7 @@ import { AuthGuard } from '../auth/auth.guard';
|
||||
import { CompositeRouteGuard } from '@guards/composite-route.guard';
|
||||
import { RedRoleGuard } from '../auth/red-role.guard';
|
||||
import { AppStateGuard } from '@state/app-state.guard';
|
||||
import { RuleSetsListingScreenComponent } from './screens/rule-sets-listing/rule-sets-listing-screen.component';
|
||||
import { DossierTemplatesListingScreenComponent } from './screens/rule-sets-listing/rule-sets-listing-screen.component';
|
||||
import { DictionaryListingScreenComponent } from './screens/dictionary-listing/dictionary-listing-screen.component';
|
||||
import { DictionaryOverviewScreenComponent } from './screens/dictionary-overview/dictionary-overview-screen.component';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
@ -19,20 +19,20 @@ import { RouterModule } from '@angular/router';
|
||||
import { SmtpConfigScreenComponent } from './screens/smtp-config/smtp-config-screen.component';
|
||||
|
||||
const routes = [
|
||||
{ path: '', redirectTo: 'project-templates', pathMatch: 'full' },
|
||||
{ path: '', redirectTo: 'dossier-templates', pathMatch: 'full' },
|
||||
{
|
||||
path: 'project-templates',
|
||||
path: 'dossier-templates',
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: RuleSetsListingScreenComponent,
|
||||
component: DossierTemplatesListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':ruleSetId',
|
||||
path: ':dossierTemplateId',
|
||||
children: [
|
||||
{
|
||||
path: 'dictionaries',
|
||||
|
||||
@ -9,7 +9,7 @@ import { AppStateService } from '@state/app-state.service';
|
||||
styleUrls: ['./admin-side-nav.component.scss']
|
||||
})
|
||||
export class AdminSideNavComponent {
|
||||
@Input() type: 'settings' | 'project-templates';
|
||||
@Input() type: 'settings' | 'dossier-templates';
|
||||
|
||||
items: {
|
||||
[key: string]: {
|
||||
@ -21,14 +21,14 @@ export class AdminSideNavComponent {
|
||||
}[];
|
||||
} = {
|
||||
settings: [
|
||||
{ screen: 'project-templates', onlyAdmin: true },
|
||||
{ screen: 'dossier-templates', onlyAdmin: true },
|
||||
{ screen: 'digital-signature', onlyAdmin: true },
|
||||
{ screen: 'license-info', label: 'license-information', onlyAdmin: true },
|
||||
{ screen: 'audit', onlyAdmin: true },
|
||||
{ screen: 'users', label: 'user-management', userManagerOnly: true },
|
||||
{ screen: 'smtp-config', label: 'configurations', onlyAdmin: true }
|
||||
],
|
||||
'project-templates': [
|
||||
'dossier-templates': [
|
||||
{ screen: 'dictionaries' },
|
||||
{ screen: 'rules', onlyDevMode: true, label: 'rule-editor' },
|
||||
{ screen: 'default-colors' },
|
||||
|
||||
@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { AdminRoutingModule } from './admin-routing.module';
|
||||
import { RulesScreenComponent } from './screens/rules/rules-screen.component';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { RuleSetsListingScreenComponent } from './screens/rule-sets-listing/rule-sets-listing-screen.component';
|
||||
import { DossierTemplatesListingScreenComponent } from './screens/rule-sets-listing/rule-sets-listing-screen.component';
|
||||
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
|
||||
import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component';
|
||||
import { DictionaryListingScreenComponent } from './screens/dictionary-listing/dictionary-listing-screen.component';
|
||||
@ -14,10 +14,10 @@ import { LicenseInformationScreenComponent } from './screens/license-information
|
||||
import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component';
|
||||
import { WatermarkScreenComponent } from './screens/watermark/watermark-screen.component';
|
||||
import { AdminBreadcrumbsComponent } from './components/breadcrumbs/admin-breadcrumbs.component';
|
||||
import { RuleSetActionsComponent } from './components/rule-set-actions/rule-set-actions.component';
|
||||
import { DossierTemplateActionsComponent } from './components/rule-set-actions/rule-set-actions.component';
|
||||
import { ColorPickerModule } from 'ngx-color-picker';
|
||||
import { AddEditFileAttributeDialogComponent } from './dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component';
|
||||
import { AddEditRuleSetDialogComponent } from './dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component';
|
||||
import { AddEditDossierTemplateDialogComponent } from './dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component';
|
||||
import { AddEditDictionaryDialogComponent } from './dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component';
|
||||
import { ConfirmDeleteFileAttributeDialogComponent } from './dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component';
|
||||
import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component';
|
||||
@ -35,7 +35,7 @@ import { AdminSideNavComponent } from './admin-side-nav/admin-side-nav.component
|
||||
import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor';
|
||||
|
||||
const dialogs = [
|
||||
AddEditRuleSetDialogComponent,
|
||||
AddEditDossierTemplateDialogComponent,
|
||||
AddEditDictionaryDialogComponent,
|
||||
AddEditFileAttributeDialogComponent,
|
||||
ConfirmDeleteFileAttributeDialogComponent,
|
||||
@ -48,7 +48,7 @@ const dialogs = [
|
||||
];
|
||||
|
||||
const screens = [
|
||||
RuleSetsListingScreenComponent,
|
||||
DossierTemplatesListingScreenComponent,
|
||||
RulesScreenComponent,
|
||||
AuditScreenComponent,
|
||||
DefaultColorsScreenComponent,
|
||||
@ -64,7 +64,7 @@ const screens = [
|
||||
|
||||
const components = [
|
||||
AdminBreadcrumbsComponent,
|
||||
RuleSetActionsComponent,
|
||||
DossierTemplateActionsComponent,
|
||||
ComboChartComponent,
|
||||
ComboSeriesVerticalComponent,
|
||||
UsersStatsComponent,
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
<div class="menu flex-2 visible-lg breadcrumbs-container">
|
||||
<a
|
||||
*ngIf="root || !!appStateService.activeRuleSet"
|
||||
[routerLink]="'/main/admin/project-templates'"
|
||||
*ngIf="root || !!appStateService.activeDossierTemplate"
|
||||
[routerLink]="'/main/admin/dossier-templates'"
|
||||
class="breadcrumb"
|
||||
translate="project-templates"
|
||||
translate="dossier-templates"
|
||||
></a>
|
||||
|
||||
<ng-container *ngIf="appStateService.activeRuleSet">
|
||||
<ng-container *ngIf="appStateService.activeDossierTemplate">
|
||||
<mat-icon svgIcon="red:arrow-right"></mat-icon>
|
||||
<a
|
||||
[class.active]="!appStateService.activeDictionaryType"
|
||||
[routerLink]="'/main/admin/project-templates/' + appStateService.activeRuleSetId"
|
||||
[routerLink]="
|
||||
'/main/admin/dossier-templates/' + appStateService.activeDossierTemplateId
|
||||
"
|
||||
class="breadcrumb ml-0"
|
||||
>
|
||||
{{ appStateService.activeRuleSet.name }}
|
||||
{{ appStateService.activeDossierTemplate.name }}
|
||||
</a>
|
||||
</ng-container>
|
||||
|
||||
@ -21,8 +23,8 @@
|
||||
<mat-icon svgIcon="red:arrow-right"></mat-icon>
|
||||
<a
|
||||
[routerLink]="
|
||||
'/main/admin/project-templates/' +
|
||||
appStateService.activeRuleSetId +
|
||||
'/main/admin/dossier-templates/' +
|
||||
appStateService.activeDossierTemplateId +
|
||||
'/dictionaries/' +
|
||||
appStateService.activeDictionaryType
|
||||
"
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
<div class="action-buttons">
|
||||
<redaction-circle-button
|
||||
(action)="openDeleteRuleSetDialog($event)"
|
||||
(action)="openDeleteDossierTemplateDialog($event)"
|
||||
*ngIf="permissionsService.isAdmin()"
|
||||
icon="red:trash"
|
||||
tooltip="project-templates-listing.action.delete"
|
||||
tooltip="dossier-templates-listing.action.delete"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="openEditRuleSetDialog($event)"
|
||||
(action)="openEditDossierTemplateDialog($event)"
|
||||
*ngIf="permissionsService.isAdmin()"
|
||||
icon="red:edit"
|
||||
tooltip="project-templates-listing.action.edit"
|
||||
tooltip="dossier-templates-listing.action.edit"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -9,9 +9,9 @@ import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
templateUrl: './rule-set-actions.component.html',
|
||||
styleUrls: ['./rule-set-actions.component.scss']
|
||||
})
|
||||
export class RuleSetActionsComponent {
|
||||
@Input() ruleSetId: string;
|
||||
@Output() loadRuleSetsData = new EventEmitter<any>();
|
||||
export class DossierTemplateActionsComponent {
|
||||
@Input() dossierTemplateId: string;
|
||||
@Output() loadDossierTemplatesData = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
@ -19,32 +19,39 @@ export class RuleSetActionsComponent {
|
||||
private readonly _router: Router,
|
||||
readonly permissionsService: PermissionsService
|
||||
) {
|
||||
if (!this.ruleSetId) {
|
||||
this.ruleSetId = this._appStateService.activeRuleSetId;
|
||||
if (!this.dossierTemplateId) {
|
||||
this.dossierTemplateId = this._appStateService.activeDossierTemplateId;
|
||||
}
|
||||
}
|
||||
|
||||
get ruleSet() {
|
||||
return this._appStateService.getRuleSetById(this.ruleSetId);
|
||||
get dossierTemplate() {
|
||||
return this._appStateService.getDossierTemplateById(this.dossierTemplateId);
|
||||
}
|
||||
|
||||
openEditRuleSetDialog($event: any) {
|
||||
openEditDossierTemplateDialog($event: any) {
|
||||
$event.stopPropagation();
|
||||
this._dialogService.openAddEditRuleSetDialog(this.ruleSet, async (newRuleSet) => {
|
||||
if (newRuleSet && this.loadRuleSetsData) {
|
||||
this.loadRuleSetsData.emit();
|
||||
this._dialogService.openAddEditDossierTemplateDialog(
|
||||
this.dossierTemplate,
|
||||
async (newDossierTemplate) => {
|
||||
if (newDossierTemplate && this.loadDossierTemplatesData) {
|
||||
this.loadDossierTemplatesData.emit();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
openDeleteRuleSetDialog($event: any) {
|
||||
this._dialogService.openDeleteRuleSetDialog($event, this.ruleSet, async () => {
|
||||
await this._appStateService.loadAllRuleSets();
|
||||
await this._appStateService.loadDictionaryData();
|
||||
await this._router.navigate(['main', 'admin']);
|
||||
if (this.loadRuleSetsData) {
|
||||
this.loadRuleSetsData.emit();
|
||||
openDeleteDossierTemplateDialog($event: any) {
|
||||
this._dialogService.openDeleteDossierTemplateDialog(
|
||||
$event,
|
||||
this.dossierTemplate,
|
||||
async () => {
|
||||
await this._appStateService.loadAllDossierTemplates();
|
||||
await this._appStateService.loadDictionaryData();
|
||||
await this._router.navigate(['main', 'admin']);
|
||||
if (this.loadDossierTemplatesData) {
|
||||
this.loadDossierTemplatesData.emit();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
export class AddEditDictionaryDialogComponent {
|
||||
dictionaryForm: FormGroup;
|
||||
readonly dictionary: TypeValue;
|
||||
private readonly _ruleSetId: string;
|
||||
private readonly _dossierTemplateId: string;
|
||||
|
||||
constructor(
|
||||
private readonly _dictionaryControllerService: DictionaryControllerService,
|
||||
@ -24,10 +24,10 @@ export class AddEditDictionaryDialogComponent {
|
||||
private readonly _notificationService: NotificationService,
|
||||
private readonly _translateService: TranslateService,
|
||||
public dialogRef: MatDialogRef<AddEditDictionaryDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: { dictionary: TypeValue; ruleSetId: string }
|
||||
@Inject(MAT_DIALOG_DATA) public data: { dictionary: TypeValue; dossierTemplateId: string }
|
||||
) {
|
||||
this.dictionary = data.dictionary;
|
||||
this._ruleSetId = data.ruleSetId;
|
||||
this._dossierTemplateId = data.dossierTemplateId;
|
||||
this.dictionaryForm = this._formBuilder.group({
|
||||
type: [this.dictionary?.type, [Validators.required, Validators.minLength(3)]],
|
||||
description: [this.dictionary?.description],
|
||||
@ -68,11 +68,11 @@ export class AddEditDictionaryDialogComponent {
|
||||
observable = this._dictionaryControllerService.updateType(
|
||||
typeValue,
|
||||
typeValue.type,
|
||||
this._ruleSetId
|
||||
this._dossierTemplateId
|
||||
);
|
||||
} else {
|
||||
// create mode
|
||||
typeValue.ruleSetId = this._ruleSetId;
|
||||
typeValue.dossierTemplateId = this._dossierTemplateId;
|
||||
observable = this._dictionaryControllerService.addType(typeValue);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
type: this.dictionaryForm.get('type').value,
|
||||
rank: this.dictionaryForm.get('rank').value,
|
||||
addToDictionaryAction: this.dictionaryForm.get('addToDictionaryAction').value,
|
||||
ruleSetId: this._ruleSetId
|
||||
dossierTemplateId: this._dossierTemplateId
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
export class AddEditFileAttributeDialogComponent {
|
||||
fileAttributeForm: FormGroup;
|
||||
fileAttribute: FileAttributeConfig;
|
||||
ruleSetId: string;
|
||||
dossierTemplateId: string;
|
||||
readonly typeOptions = [
|
||||
FileAttributeConfig.TypeEnum.TEXT,
|
||||
FileAttributeConfig.TypeEnum.NUMBER,
|
||||
@ -24,10 +24,10 @@ export class AddEditFileAttributeDialogComponent {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<AddEditFileAttributeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: { fileAttribute: FileAttributeConfig; ruleSetId: string }
|
||||
public data: { fileAttribute: FileAttributeConfig; dossierTemplateId: string }
|
||||
) {
|
||||
this.fileAttribute = data.fileAttribute;
|
||||
this.ruleSetId = data.ruleSetId;
|
||||
this.dossierTemplateId = data.dossierTemplateId;
|
||||
|
||||
this.fileAttributeForm = this._formBuilder.group({
|
||||
label: [this.fileAttribute?.label, Validators.required],
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
<section class="dialog">
|
||||
<div class="dialog-header heading-l">
|
||||
{{
|
||||
(ruleSet
|
||||
? 'add-edit-project-template.title.edit'
|
||||
: 'add-edit-project-template.title.new'
|
||||
) | translate: { name: ruleSet?.name }
|
||||
(dossierTemplate
|
||||
? 'add-edit-dossier-template.title.edit'
|
||||
: 'add-edit-dossier-template.title.new'
|
||||
) | translate: { name: dossierTemplate?.name }
|
||||
}}
|
||||
</div>
|
||||
|
||||
<form (submit)="saveRuleSet()" [formGroup]="ruleSetForm">
|
||||
<form (submit)="saveDossierTemplate()" [formGroup]="dossierTemplateForm">
|
||||
<div class="dialog-content">
|
||||
<div class="red-input-group required w-300">
|
||||
<label translate="add-edit-project-template.form.name"></label>
|
||||
<label translate="add-edit-dossier-template.form.name"></label>
|
||||
<input
|
||||
formControlName="name"
|
||||
name="name"
|
||||
placeholder="{{
|
||||
'add-edit-project-template.form.name-placeholder' | translate
|
||||
'add-edit-dossier-template.form.name-placeholder' | translate
|
||||
}}"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="red-input-group w-400">
|
||||
<label translate="add-edit-project-template.form.description"></label>
|
||||
<label translate="add-edit-dossier-template.form.description"></label>
|
||||
<textarea
|
||||
formControlName="description"
|
||||
name="description"
|
||||
placeholder="{{
|
||||
'add-edit-project-template.form.description-placeholder' | translate
|
||||
'add-edit-dossier-template.form.description-placeholder' | translate
|
||||
}}"
|
||||
rows="4"
|
||||
type="text"
|
||||
@ -43,7 +43,7 @@
|
||||
class="filter-menu-checkbox"
|
||||
color="primary"
|
||||
>
|
||||
{{ 'add-edit-project-template.form.valid-from' | translate }}
|
||||
{{ 'add-edit-dossier-template.form.valid-from' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
<mat-checkbox
|
||||
@ -52,7 +52,7 @@
|
||||
class="filter-menu-checkbox"
|
||||
color="primary"
|
||||
>
|
||||
{{ 'add-edit-project-template.form.valid-to' | translate }}
|
||||
{{ 'add-edit-dossier-template.form.valid-to' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
|
||||
@ -93,7 +93,10 @@
|
||||
[label]="
|
||||
'report-type.label'
|
||||
| translate
|
||||
: { length: this.ruleSetForm.controls['reportTypes'].value.length }
|
||||
: {
|
||||
length: this.dossierTemplateForm.controls['reportTypes'].value
|
||||
.length
|
||||
}
|
||||
"
|
||||
[options]="reportTypesEnum"
|
||||
[translatePrefix]="'report-type.'"
|
||||
@ -105,8 +108,8 @@
|
||||
'download-type.label'
|
||||
| translate
|
||||
: {
|
||||
length: this.ruleSetForm.controls['downloadFileTypes'].value
|
||||
.length
|
||||
length: this.dossierTemplateForm.controls['downloadFileTypes']
|
||||
.value.length
|
||||
}
|
||||
"
|
||||
[options]="downloadTypesEnum"
|
||||
@ -118,12 +121,12 @@
|
||||
|
||||
<div class="dialog-actions">
|
||||
<button
|
||||
[disabled]="ruleSetForm.invalid || !changed"
|
||||
[disabled]="dossierTemplateForm.invalid || !changed"
|
||||
color="primary"
|
||||
mat-flat-button
|
||||
type="submit"
|
||||
>
|
||||
{{ 'add-edit-project-template.save' | translate }}
|
||||
{{ 'add-edit-dossier-template.save' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -4,7 +4,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import * as moment from 'moment';
|
||||
import { Moment } from 'moment';
|
||||
import { RuleSetControllerService, RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { DossierTemplateControllerService, DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
|
||||
@Component({
|
||||
@ -12,12 +12,12 @@ import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
templateUrl: './add-edit-rule-set-dialog.component.html',
|
||||
styleUrls: ['./add-edit-rule-set-dialog.component.scss']
|
||||
})
|
||||
export class AddEditRuleSetDialogComponent {
|
||||
ruleSetForm: FormGroup;
|
||||
export class AddEditDossierTemplateDialogComponent {
|
||||
dossierTemplateForm: FormGroup;
|
||||
hasValidFrom: boolean;
|
||||
hasValidTo: boolean;
|
||||
downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED'];
|
||||
reportTypesEnum = Object.values(RuleSetModel.ReportTypesEnum);
|
||||
reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum);
|
||||
|
||||
private _previousValidFrom: Moment;
|
||||
private _previousValidTo: Moment;
|
||||
@ -25,27 +25,29 @@ export class AddEditRuleSetDialogComponent {
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _ruleSetController: RuleSetControllerService,
|
||||
public dialogRef: MatDialogRef<AddEditRuleSetDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public ruleSet: RuleSetModel
|
||||
private readonly _dossierTemplateController: DossierTemplateControllerService,
|
||||
public dialogRef: MatDialogRef<AddEditDossierTemplateDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public dossierTemplate: DossierTemplateModel
|
||||
) {
|
||||
this.ruleSetForm = this._formBuilder.group({
|
||||
name: [this.ruleSet?.name, Validators.required],
|
||||
description: [this.ruleSet?.description],
|
||||
this.dossierTemplateForm = this._formBuilder.group({
|
||||
name: [this.dossierTemplate?.name, Validators.required],
|
||||
description: [this.dossierTemplate?.description],
|
||||
validFrom: [
|
||||
this.ruleSet?.validFrom ? moment(this.ruleSet?.validFrom) : null,
|
||||
this.dossierTemplate?.validFrom ? moment(this.dossierTemplate?.validFrom) : null,
|
||||
this._requiredIfValidator(() => this.hasValidFrom)
|
||||
],
|
||||
validTo: [
|
||||
this.ruleSet?.validTo ? moment(this.ruleSet?.validTo) : null,
|
||||
this.dossierTemplate?.validTo ? moment(this.dossierTemplate?.validTo) : null,
|
||||
this._requiredIfValidator(() => this.hasValidTo)
|
||||
],
|
||||
downloadFileTypes: [
|
||||
this.ruleSet ? this.ruleSet.downloadFileTypes : ['PREVIEW', 'REDACTED']
|
||||
this.dossierTemplate
|
||||
? this.dossierTemplate.downloadFileTypes
|
||||
: ['PREVIEW', 'REDACTED']
|
||||
],
|
||||
reportTypes: [
|
||||
this.ruleSet
|
||||
? this.ruleSet.reportTypes
|
||||
this.dossierTemplate
|
||||
? this.dossierTemplate.reportTypes
|
||||
: [
|
||||
'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE',
|
||||
'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE',
|
||||
@ -54,46 +56,46 @@ export class AddEditRuleSetDialogComponent {
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
this.hasValidFrom = !!this.ruleSet?.validFrom;
|
||||
this.hasValidTo = !!this.ruleSet?.validTo;
|
||||
this.hasValidFrom = !!this.dossierTemplate?.validFrom;
|
||||
this.hasValidTo = !!this.dossierTemplate?.validTo;
|
||||
|
||||
this._previousValidFrom = this.ruleSetForm.get('validFrom').value;
|
||||
this._previousValidTo = this.ruleSetForm.get('validTo').value;
|
||||
this._previousValidFrom = this.dossierTemplateForm.get('validFrom').value;
|
||||
this._previousValidTo = this.dossierTemplateForm.get('validTo').value;
|
||||
|
||||
this.ruleSetForm.valueChanges.subscribe((value) => {
|
||||
this.dossierTemplateForm.valueChanges.subscribe((value) => {
|
||||
this._applyValidityIntervalConstraints(value);
|
||||
});
|
||||
}
|
||||
|
||||
get changed(): boolean {
|
||||
if (!this.ruleSet) return true;
|
||||
if (!this.dossierTemplate) return true;
|
||||
|
||||
for (const key of Object.keys(this.ruleSetForm.getRawValue())) {
|
||||
for (const key of Object.keys(this.dossierTemplateForm.getRawValue())) {
|
||||
if (key === 'validFrom') {
|
||||
if (this.hasValidFrom !== !!this.ruleSet.validFrom) {
|
||||
if (this.hasValidFrom !== !!this.dossierTemplate.validFrom) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasValidFrom &&
|
||||
!moment(this.ruleSet.validFrom).isSame(
|
||||
moment(this.ruleSetForm.get('validFrom').value)
|
||||
!moment(this.dossierTemplate.validFrom).isSame(
|
||||
moment(this.dossierTemplateForm.get('validFrom').value)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
} else if (key === 'validTo') {
|
||||
if (this.hasValidTo !== !!this.ruleSet.validTo) {
|
||||
if (this.hasValidTo !== !!this.dossierTemplate.validTo) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasValidTo &&
|
||||
!moment(this.ruleSet.validTo).isSame(
|
||||
moment(this.ruleSetForm.get('validTo').value)
|
||||
!moment(this.dossierTemplate.validTo).isSame(
|
||||
moment(this.dossierTemplateForm.get('validTo').value)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
} else if (this.ruleSet[key] !== this.ruleSetForm.get(key).value) {
|
||||
} else if (this.dossierTemplate[key] !== this.dossierTemplateForm.get(key).value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -101,17 +103,19 @@ export class AddEditRuleSetDialogComponent {
|
||||
return false;
|
||||
}
|
||||
|
||||
async saveRuleSet() {
|
||||
const ruleSet = {
|
||||
ruleSetId: this.ruleSet?.ruleSetId,
|
||||
...this.ruleSetForm.getRawValue(),
|
||||
validFrom: this.hasValidFrom ? this.ruleSetForm.get('validFrom').value : null,
|
||||
validTo: this.hasValidTo ? this.ruleSetForm.get('validTo').value : null
|
||||
async saveDossierTemplate() {
|
||||
const dossierTemplate = {
|
||||
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
|
||||
};
|
||||
await this._ruleSetController.createOrUpdateRuleSet(ruleSet).toPromise();
|
||||
await this._appStateService.loadAllRuleSets();
|
||||
await this._dossierTemplateController
|
||||
.createOrUpdateDossierTemplate(dossierTemplate)
|
||||
.toPromise();
|
||||
await this._appStateService.loadAllDossierTemplates();
|
||||
await this._appStateService.loadDictionaryData();
|
||||
this.dialogRef.close({ ruleSet });
|
||||
this.dialogRef.close({ dossierTemplate });
|
||||
}
|
||||
|
||||
private _applyValidityIntervalConstraints(value): boolean {
|
||||
@ -120,7 +124,7 @@ export class AddEditRuleSetDialogComponent {
|
||||
value,
|
||||
this._previousValidFrom,
|
||||
this._previousValidTo,
|
||||
this.ruleSetForm,
|
||||
this.dossierTemplateForm,
|
||||
'validFrom',
|
||||
'validTo'
|
||||
)
|
||||
@ -128,8 +132,8 @@ export class AddEditRuleSetDialogComponent {
|
||||
return true;
|
||||
}
|
||||
|
||||
this._previousValidFrom = this.ruleSetForm.get('validFrom').value;
|
||||
this._previousValidTo = this.ruleSetForm.get('validTo').value;
|
||||
this._previousValidFrom = this.dossierTemplateForm.get('validFrom').value;
|
||||
this._previousValidTo = this.dossierTemplateForm.get('validTo').value;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
>
|
||||
{{
|
||||
'confirm-delete-users.' + checkbox.label
|
||||
| translate: { projectsCount: projectsCount }
|
||||
| translate: { dossiersCount: dossiersCount }
|
||||
}}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
|
||||
@ -10,18 +10,18 @@ import { AppStateService } from '@state/app-state.service';
|
||||
})
|
||||
export class ConfirmDeleteUsersDialogComponent {
|
||||
checkboxes = [
|
||||
{ value: false, label: 'impacted-projects' },
|
||||
{ value: false, label: 'impacted-dossiers' },
|
||||
{ value: false, label: 'impacted-documents.' + this.type }
|
||||
];
|
||||
showToast = false;
|
||||
projectsCount: number;
|
||||
dossiersCount: number;
|
||||
|
||||
constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public users: User[],
|
||||
private readonly _appStateService: AppStateService,
|
||||
public dialogRef: MatDialogRef<ConfirmDeleteUsersDialogComponent>
|
||||
) {
|
||||
this.projectsCount = this._appStateService.allProjects.filter((pw) => {
|
||||
this.dossiersCount = this._appStateService.allDossiers.filter((pw) => {
|
||||
for (const user of this.users) {
|
||||
if (pw.memberIds.indexOf(user.userId) !== -1) {
|
||||
return true;
|
||||
|
||||
@ -15,7 +15,7 @@ export class EditColorDialogComponent {
|
||||
readonly colorKey: string;
|
||||
colorForm: FormGroup;
|
||||
private readonly _initialColor: string;
|
||||
private readonly _ruleSetId: string;
|
||||
private readonly _dossierTemplateId: string;
|
||||
|
||||
constructor(
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
@ -24,11 +24,11 @@ export class EditColorDialogComponent {
|
||||
private readonly _translateService: TranslateService,
|
||||
public dialogRef: MatDialogRef<EditColorDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: { colors: Colors; colorKey: string; ruleSetId: string }
|
||||
public data: { colors: Colors; colorKey: string; dossierTemplateId: string }
|
||||
) {
|
||||
this.colors = data.colors;
|
||||
this.colorKey = data.colorKey;
|
||||
this._ruleSetId = data.ruleSetId;
|
||||
this._dossierTemplateId = data.dossierTemplateId;
|
||||
this._initialColor = data.colors[this.colorKey];
|
||||
|
||||
this.colorForm = this._formBuilder.group({
|
||||
@ -47,7 +47,9 @@ export class EditColorDialogComponent {
|
||||
};
|
||||
|
||||
try {
|
||||
await this._dictionaryControllerService.setColors(colors, this._ruleSetId).toPromise();
|
||||
await this._dictionaryControllerService
|
||||
.setColors(colors, this._dossierTemplateId)
|
||||
.toPromise();
|
||||
this.dialogRef.close(true);
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('edit-color-dialog.success', {
|
||||
|
||||
@ -33,7 +33,7 @@ export interface Field {
|
||||
})
|
||||
export class FileAttributesCsvImportDialogComponent extends BaseListingComponent<Field> {
|
||||
csvFile: File;
|
||||
ruleSetId: string;
|
||||
dossierTemplateId: string;
|
||||
parseResult: { data: any[]; errors: any[]; meta: any; fields: Field[] };
|
||||
hoveredColumn: string;
|
||||
activeFields: Field[] = [];
|
||||
@ -56,11 +56,15 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
public dialogRef: MatDialogRef<FileAttributesCsvImportDialogComponent>,
|
||||
protected readonly _injector: Injector,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: { csv: File; ruleSetId: string; existingConfiguration: FileAttributesConfig }
|
||||
public data: {
|
||||
csv: File;
|
||||
dossierTemplateId: string;
|
||||
existingConfiguration: FileAttributesConfig;
|
||||
}
|
||||
) {
|
||||
super(_injector);
|
||||
this.csvFile = data.csv;
|
||||
this.ruleSetId = data.ruleSetId;
|
||||
this.dossierTemplateId = data.dossierTemplateId;
|
||||
|
||||
this.baseConfigForm = this._formBuilder.group({
|
||||
filenameMappingColumnHeaderName: [
|
||||
@ -224,7 +228,7 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
|
||||
try {
|
||||
await this._fileAttributesControllerService
|
||||
.setFileAttributesConfig(fileAttributes, this.ruleSetId)
|
||||
.setFileAttributesConfig(fileAttributes, this.dossierTemplateId)
|
||||
.toPromise();
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('file-attributes-csv-import.save.success', {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
*ngIf="permissionsService.isUser()"
|
||||
class="ml-6"
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="red-content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="project-templates"></redaction-admin-side-nav>
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<div class="content-container">
|
||||
<div class="header-item">
|
||||
|
||||
@ -28,12 +28,14 @@ export class DefaultColorsScreenComponent extends BaseListingComponent<{
|
||||
protected readonly _injector: Injector
|
||||
) {
|
||||
super(_injector);
|
||||
this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
||||
this._appStateService.activateDossierTemplate(
|
||||
_activatedRoute.snapshot.params.dossierTemplateId
|
||||
);
|
||||
this._loadColors();
|
||||
}
|
||||
|
||||
async loadRuleSetsData(): Promise<void> {
|
||||
await this._appStateService.loadAllRuleSets();
|
||||
async loadDossierTemplatesData(): Promise<void> {
|
||||
await this._appStateService.loadAllDossierTemplates();
|
||||
}
|
||||
|
||||
openEditColorDialog($event: any, color: { key: string; value: string }) {
|
||||
@ -41,7 +43,7 @@ export class DefaultColorsScreenComponent extends BaseListingComponent<{
|
||||
this._dialogService.openEditColorsDialog(
|
||||
this._colorsObj,
|
||||
color.key,
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
async () => {
|
||||
this._loadColors();
|
||||
}
|
||||
@ -50,7 +52,7 @@ export class DefaultColorsScreenComponent extends BaseListingComponent<{
|
||||
|
||||
private _loadColors() {
|
||||
this._dictionaryControllerService
|
||||
.getColors(this._appStateService.activeRuleSetId)
|
||||
.getColors(this._appStateService.activeDossierTemplateId)
|
||||
.toPromise()
|
||||
.then((data) => {
|
||||
this._colorsObj = data;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="red-content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="project-templates"></redaction-admin-side-nav>
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<div class="content-container">
|
||||
<div class="header-item">
|
||||
|
||||
@ -33,7 +33,9 @@ export class DictionaryListingScreenComponent
|
||||
protected readonly _injector: Injector
|
||||
) {
|
||||
super(_injector);
|
||||
this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
||||
this._appStateService.activateDossierTemplate(
|
||||
_activatedRoute.snapshot.params.dossierTemplateId
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@ -44,7 +46,7 @@ export class DictionaryListingScreenComponent
|
||||
$event?.stopPropagation();
|
||||
this._dialogService.openAddEditDictionaryDialog(
|
||||
dict,
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
async (newDictionary) => {
|
||||
if (newDictionary) {
|
||||
await this._appStateService.loadDictionaryData();
|
||||
@ -58,7 +60,7 @@ export class DictionaryListingScreenComponent
|
||||
this._dialogService.openDeleteDictionaryDialog(
|
||||
$event,
|
||||
dict,
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
async () => {
|
||||
await this._appStateService.loadDictionaryData();
|
||||
this._loadDictionaryData();
|
||||
@ -68,14 +70,14 @@ export class DictionaryListingScreenComponent
|
||||
|
||||
private _loadDictionaryData() {
|
||||
const appStateDictionaryData =
|
||||
this._appStateService.dictionaryData[this._appStateService.activeRuleSetId];
|
||||
this._appStateService.dictionaryData[this._appStateService.activeDossierTemplateId];
|
||||
this.allEntities = Object.keys(appStateDictionaryData)
|
||||
.map((key) => appStateDictionaryData[key])
|
||||
.filter((d) => !d.virtual);
|
||||
this.displayedEntities = [...this.allEntities];
|
||||
const dataObs = this.allEntities.map((dict) =>
|
||||
this._dictionaryControllerService
|
||||
.getDictionaryForType(this._appStateService.activeRuleSetId, dict.type)
|
||||
.getDictionaryForType(this._appStateService.activeDossierTemplateId, dict.type)
|
||||
.pipe(
|
||||
tap((values) => {
|
||||
dict.entries = values.entries ? values.entries : [];
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
<div class="flex red-content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="project-templates"></redaction-admin-side-nav>
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<redaction-dictionary-manager
|
||||
[initialEntries]="entries"
|
||||
@ -92,7 +92,7 @@
|
||||
<div class="indicator">
|
||||
<redaction-dictionary-annotation-icon
|
||||
[dictionaryKey]="dictionary.hint ? 'hint' : 'redaction'"
|
||||
[ruleSetId]="dictionary.ruleSetId"
|
||||
[dossierTemplateId]="dictionary.dossierTemplateId"
|
||||
></redaction-dictionary-annotation-icon>
|
||||
<div class="large-label">
|
||||
{{ (dictionary.hint ? 'hint' : 'redaction') | translate }}
|
||||
|
||||
@ -36,7 +36,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
super(_translateService);
|
||||
this._appStateService.activateDictionary(
|
||||
this._activatedRoute.snapshot.params.type,
|
||||
this._activatedRoute.snapshot.params.ruleSetId
|
||||
this._activatedRoute.snapshot.params.dossierTemplateId
|
||||
);
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
$event.stopPropagation();
|
||||
this._dialogService.openAddEditDictionaryDialog(
|
||||
this.dictionary,
|
||||
this.dictionary.ruleSetId,
|
||||
this.dictionary.dossierTemplateId,
|
||||
async () => {
|
||||
await this._appStateService.loadDictionaryData();
|
||||
}
|
||||
@ -67,7 +67,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
this._dialogService.openDeleteDictionaryDialog(
|
||||
$event,
|
||||
this.dictionary,
|
||||
this.dictionary.ruleSetId,
|
||||
this.dictionary.dossierTemplateId,
|
||||
async () => {
|
||||
await this._appStateService.loadDictionaryData();
|
||||
this._router.navigate(['..']);
|
||||
@ -102,7 +102,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
.saveEntries(
|
||||
entries,
|
||||
this.entries,
|
||||
this.dictionary.ruleSetId,
|
||||
this.dictionary.dossierTemplateId,
|
||||
this.dictionary.type,
|
||||
null
|
||||
)
|
||||
@ -120,7 +120,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
private _loadEntries() {
|
||||
this.processing = true;
|
||||
this._dictionaryControllerService
|
||||
.getDictionaryForType(this.dictionary.ruleSetId, this.dictionary.type)
|
||||
.getDictionaryForType(this.dictionary.dossierTemplateId, this.dictionary.type)
|
||||
.subscribe(
|
||||
(data) => {
|
||||
this.processing = false;
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
*ngIf="permissionsService.isUser()"
|
||||
class="ml-6"
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="red-content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="project-templates"></redaction-admin-side-nav>
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<div class="content-container">
|
||||
<div class="header-item">
|
||||
|
||||
@ -37,7 +37,9 @@ export class FileAttributesListingScreenComponent
|
||||
protected readonly _injector: Injector
|
||||
) {
|
||||
super(_injector);
|
||||
this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
||||
this._appStateService.activateDossierTemplate(
|
||||
_activatedRoute.snapshot.params.dossierTemplateId
|
||||
);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
@ -48,11 +50,14 @@ export class FileAttributesListingScreenComponent
|
||||
$event.stopPropagation();
|
||||
this._dialogService.openAddEditFileAttributeDialog(
|
||||
fileAttribute,
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
async (newValue: FileAttributeConfig) => {
|
||||
this.loading = true;
|
||||
await this._fileAttributesService
|
||||
.setFileAttributesConfiguration(newValue, this._appStateService.activeRuleSetId)
|
||||
.setFileAttributesConfiguration(
|
||||
newValue,
|
||||
this._appStateService.activeDossierTemplateId
|
||||
)
|
||||
.toPromise();
|
||||
await this._loadData();
|
||||
}
|
||||
@ -63,13 +68,13 @@ export class FileAttributesListingScreenComponent
|
||||
$event.stopPropagation();
|
||||
this._dialogService.openConfirmDeleteFileAttributeDialog(
|
||||
fileAttribute,
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
async () => {
|
||||
this.loading = true;
|
||||
if (fileAttribute) {
|
||||
await this._fileAttributesService
|
||||
.deleteFileAttribute(
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
fileAttribute.id
|
||||
)
|
||||
.toPromise();
|
||||
@ -77,7 +82,7 @@ export class FileAttributesListingScreenComponent
|
||||
await this._fileAttributesService
|
||||
.deleteFileAttributes(
|
||||
this.selectedEntitiesIds,
|
||||
this._appStateService.activeRuleSetId
|
||||
this._appStateService.activeDossierTemplateId
|
||||
)
|
||||
.toPromise();
|
||||
}
|
||||
@ -92,7 +97,7 @@ export class FileAttributesListingScreenComponent
|
||||
|
||||
this._dialogService.openImportFileAttributeCSVDialog(
|
||||
csvFile,
|
||||
this._appStateService.activeRuleSetId,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
this._existingConfiguration,
|
||||
async () => {
|
||||
await this._loadData();
|
||||
@ -103,7 +108,7 @@ export class FileAttributesListingScreenComponent
|
||||
private async _loadData() {
|
||||
try {
|
||||
const response = await this._fileAttributesService
|
||||
.getFileAttributesConfiguration(this._appStateService.activeRuleSetId)
|
||||
.getFileAttributesConfiguration(this._appStateService.activeDossierTemplateId)
|
||||
.toPromise();
|
||||
this._existingConfiguration = response;
|
||||
this.allEntities = response?.fileAttributeConfigs || [];
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*ngIf="permissionsService.isUser()"
|
||||
class="ml-6"
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
|
||||
<div>
|
||||
<div class="page-header">
|
||||
<div class="breadcrumb" translate="project-templates"></div>
|
||||
<div class="breadcrumb" translate="dossier-templates"></div>
|
||||
|
||||
<redaction-circle-button
|
||||
*ngIf="permissionsService.isUser()"
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
<span class="all-caps-label">
|
||||
{{
|
||||
'project-templates-listing.table-header.title'
|
||||
'dossier-templates-listing.table-header.title'
|
||||
| translate: { length: displayedEntities.length }
|
||||
}}
|
||||
</span>
|
||||
@ -37,17 +37,17 @@
|
||||
<div class="actions flex-1">
|
||||
<redaction-search-input
|
||||
[form]="searchForm"
|
||||
[placeholder]="'project-templates-listing.search'"
|
||||
[placeholder]="'dossier-templates-listing.search'"
|
||||
></redaction-search-input>
|
||||
|
||||
<redaction-icon-button
|
||||
(action)="openAddRuleSetDialog()"
|
||||
(action)="openAddDossierTemplateDialog()"
|
||||
*ngIf="
|
||||
permissionsService.isAdmin() &&
|
||||
userPreferenceService.areDevFeaturesEnabled
|
||||
"
|
||||
icon="red:plus"
|
||||
text="project-templates-listing.add-new"
|
||||
text="dossier-templates-listing.add-new"
|
||||
type="primary"
|
||||
></redaction-icon-button>
|
||||
</div>
|
||||
@ -65,25 +65,25 @@
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="name"
|
||||
label="project-templates-listing.table-col-names.name"
|
||||
label="dossier-templates-listing.table-col-names.name"
|
||||
></redaction-table-col-name>
|
||||
<redaction-table-col-name
|
||||
class="user-column"
|
||||
label="project-templates-listing.table-col-names.created-by"
|
||||
label="dossier-templates-listing.table-col-names.created-by"
|
||||
></redaction-table-col-name>
|
||||
<redaction-table-col-name
|
||||
(toggleSort)="toggleSort($event)"
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="dateAdded"
|
||||
label="project-templates-listing.table-col-names.created-on"
|
||||
label="dossier-templates-listing.table-col-names.created-on"
|
||||
></redaction-table-col-name>
|
||||
<redaction-table-col-name
|
||||
(toggleSort)="toggleSort($event)"
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="dateModified"
|
||||
label="project-templates-listing.table-col-names.modified-on"
|
||||
label="dossier-templates-listing.table-col-names.modified-on"
|
||||
></redaction-table-col-name>
|
||||
<div class="scrollbar-placeholder"></div>
|
||||
</div>
|
||||
@ -91,43 +91,44 @@
|
||||
<redaction-empty-state
|
||||
*ngIf="!allEntities.length"
|
||||
icon="red:template"
|
||||
screen="project-templates-listing"
|
||||
screen="dossier-templates-listing"
|
||||
></redaction-empty-state>
|
||||
|
||||
<redaction-empty-state
|
||||
*ngIf="allEntities.length && !displayedEntities.length"
|
||||
screen="project-templates-listing"
|
||||
screen="dossier-templates-listing"
|
||||
type="no-match"
|
||||
></redaction-empty-state>
|
||||
|
||||
<cdk-virtual-scroll-viewport [itemSize]="100" redactionHasScrollbar>
|
||||
<div
|
||||
*cdkVirtualFor="
|
||||
let ruleSet of displayedEntities
|
||||
let dossierTemplate of displayedEntities
|
||||
| sortBy: sortingOption.order:sortingOption.column
|
||||
"
|
||||
[routerLink]="[ruleSet.ruleSetId, 'dictionaries']"
|
||||
[routerLink]="[dossierTemplate.dossierTemplateId, 'dictionaries']"
|
||||
class="table-item pointer"
|
||||
>
|
||||
<div
|
||||
(click)="toggleEntitySelected($event, ruleSet)"
|
||||
(click)="toggleEntitySelected($event, dossierTemplate)"
|
||||
class="selection-column"
|
||||
>
|
||||
<redaction-round-checkbox
|
||||
[active]="isEntitySelected(ruleSet)"
|
||||
[active]="isEntitySelected(dossierTemplate)"
|
||||
></redaction-round-checkbox>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="table-item-title heading">
|
||||
{{ ruleSet.name }}
|
||||
{{ dossierTemplate.name }}
|
||||
</div>
|
||||
<div class="small-label stats-subtitle">
|
||||
<div>
|
||||
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
||||
{{
|
||||
'project-templates-listing.dictionaries'
|
||||
| translate: { length: ruleSet.dictionariesCount }
|
||||
'dossier-templates-listing.dictionaries'
|
||||
| translate
|
||||
: { length: dossierTemplate.dictionariesCount }
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
@ -135,21 +136,21 @@
|
||||
|
||||
<div class="user-column">
|
||||
<redaction-initials-avatar
|
||||
[userId]="ruleSet.createdBy"
|
||||
[userId]="dossierTemplate.createdBy"
|
||||
[withName]="true"
|
||||
></redaction-initials-avatar>
|
||||
</div>
|
||||
<div class="small-label">
|
||||
{{ ruleSet.dateAdded | date: 'd MMM. yyyy' }}
|
||||
{{ dossierTemplate.dateAdded | date: 'd MMM. yyyy' }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="small-label">
|
||||
{{ ruleSet.dateModified | date: 'd MMM. yyyy' }}
|
||||
{{ dossierTemplate.dateModified | date: 'd MMM. yyyy' }}
|
||||
</div>
|
||||
|
||||
<redaction-rule-set-actions
|
||||
(loadRuleSetsData)="loadRuleSetsData()"
|
||||
[ruleSetId]="ruleSet.ruleSetId"
|
||||
(loadDossierTemplatesData)="loadDossierTemplatesData()"
|
||||
[dossierTemplateId]="dossierTemplate.dossierTemplateId"
|
||||
class="actions-container"
|
||||
></redaction-rule-set-actions>
|
||||
</div>
|
||||
|
||||
@ -4,19 +4,19 @@ import { PermissionsService } from '@services/permissions.service';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { BaseListingComponent } from '@shared/base/base-listing.component';
|
||||
import { RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-rule-sets-listing-screen',
|
||||
templateUrl: './rule-sets-listing-screen.component.html',
|
||||
styleUrls: ['./rule-sets-listing-screen.component.scss']
|
||||
})
|
||||
export class RuleSetsListingScreenComponent
|
||||
extends BaseListingComponent<RuleSetModel>
|
||||
export class DossierTemplatesListingScreenComponent
|
||||
extends BaseListingComponent<DossierTemplateModel>
|
||||
implements OnInit
|
||||
{
|
||||
protected readonly _searchKey = 'name';
|
||||
protected readonly _selectionKey = 'ruleSetId';
|
||||
protected readonly _selectionKey = 'dossierTemplateId';
|
||||
protected readonly _sortKey = 'rule-sets-listing';
|
||||
|
||||
constructor(
|
||||
@ -30,27 +30,27 @@ export class RuleSetsListingScreenComponent
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadRuleSetsData();
|
||||
this.loadDossierTemplatesData();
|
||||
}
|
||||
|
||||
loadRuleSetsData() {
|
||||
loadDossierTemplatesData() {
|
||||
this._appStateService.reset();
|
||||
this.allEntities = this._appStateService.ruleSets;
|
||||
this.allEntities = this._appStateService.dossierTemplates;
|
||||
this._executeSearchImmediately();
|
||||
this._loadRuleSetStats();
|
||||
this._loadDossierTemplateStats();
|
||||
}
|
||||
|
||||
openAddRuleSetDialog() {
|
||||
this._dialogService.openAddEditRuleSetDialog(null, async (newRuleSet) => {
|
||||
if (newRuleSet) {
|
||||
this.loadRuleSetsData();
|
||||
openAddDossierTemplateDialog() {
|
||||
this._dialogService.openAddEditDossierTemplateDialog(null, async (newDossierTemplate) => {
|
||||
if (newDossierTemplate) {
|
||||
this.loadDossierTemplatesData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private _loadRuleSetStats() {
|
||||
private _loadDossierTemplateStats() {
|
||||
this.allEntities.forEach((rs) => {
|
||||
const dictionaries = this._appStateService.dictionaryData[rs.ruleSetId];
|
||||
const dictionaries = this._appStateService.dictionaryData[rs.dossierTemplateId];
|
||||
if (dictionaries) {
|
||||
rs.dictionariesCount = Object.keys(dictionaries)
|
||||
.map((key) => dictionaries[key])
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="red-content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="project-templates"></redaction-admin-side-nav>
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<div class="editor-container">
|
||||
<ngx-monaco-editor
|
||||
|
||||
@ -44,7 +44,9 @@ export class RulesScreenComponent extends ComponentHasChanges {
|
||||
private readonly _activatedRoute: ActivatedRoute
|
||||
) {
|
||||
super(_translateService);
|
||||
this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
||||
this._appStateService.activateDossierTemplate(
|
||||
_activatedRoute.snapshot.params.dossierTemplateId
|
||||
);
|
||||
this._initialize();
|
||||
}
|
||||
|
||||
@ -101,7 +103,7 @@ export class RulesScreenComponent extends ComponentHasChanges {
|
||||
this._rulesControllerService
|
||||
.uploadRules({
|
||||
rules: this._codeEditor.getModel().getValue(),
|
||||
ruleSetId: this._appStateService.activeRuleSetId
|
||||
dossierTemplateId: this._appStateService.activeDossierTemplateId
|
||||
})
|
||||
.subscribe(
|
||||
() => {
|
||||
@ -151,12 +153,14 @@ export class RulesScreenComponent extends ComponentHasChanges {
|
||||
}
|
||||
|
||||
private _initialize() {
|
||||
this._rulesControllerService.downloadRules(this._appStateService.activeRuleSetId).subscribe(
|
||||
(rules) => {
|
||||
this.currentLines = this.initialLines = rules.rules.split('\n');
|
||||
this.revert();
|
||||
},
|
||||
() => (this.processing = false)
|
||||
);
|
||||
this._rulesControllerService
|
||||
.downloadRules(this._appStateService.activeDossierTemplateId)
|
||||
.subscribe(
|
||||
(rules) => {
|
||||
this.currentLines = this.initialLines = rules.rules.split('\n');
|
||||
this.revert();
|
||||
},
|
||||
() => (this.processing = false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
*ngIf="permissionsService.isUser()"
|
||||
class="ml-6"
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*ngIf="permissionsService.isUser()"
|
||||
class="ml-6"
|
||||
icon="red:close"
|
||||
redactionNavigateLastProjectsScreen
|
||||
redactionNavigateLastDossiersScreen
|
||||
tooltip="common.close"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="red-content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="project-templates"></redaction-admin-side-nav>
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<div class="content-container">
|
||||
<div #viewer class="viewer"></div>
|
||||
|
||||
@ -47,7 +47,9 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _activatedRoute: ActivatedRoute
|
||||
) {
|
||||
this.appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
||||
this.appStateService.activateDossierTemplate(
|
||||
_activatedRoute.snapshot.params.dossierTemplateId
|
||||
);
|
||||
this._initForm();
|
||||
}
|
||||
|
||||
@ -80,10 +82,10 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
const observable = watermark.text
|
||||
? this._watermarkControllerService.saveWatermark(
|
||||
watermark,
|
||||
this.appStateService.activeRuleSetId
|
||||
this.appStateService.activeDossierTemplateId
|
||||
)
|
||||
: this._watermarkControllerService.deleteWatermark(
|
||||
this.appStateService.activeRuleSetId
|
||||
this.appStateService.activeDossierTemplateId
|
||||
);
|
||||
|
||||
observable.subscribe(
|
||||
@ -125,7 +127,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
|
||||
private _loadWatermark() {
|
||||
this._watermarkControllerService
|
||||
.getWatermark(this.appStateService.activeRuleSetId)
|
||||
.getWatermark(this.appStateService.activeDossierTemplateId)
|
||||
.subscribe(
|
||||
(watermark) => {
|
||||
this._watermark = watermark;
|
||||
|
||||
@ -7,15 +7,15 @@ import {
|
||||
FileAttributesConfig,
|
||||
FileManagementControllerService,
|
||||
ManualRedactionControllerService,
|
||||
RuleSetControllerService,
|
||||
RuleSetModel,
|
||||
DossierTemplateControllerService,
|
||||
DossierTemplateModel,
|
||||
SMTPConfigurationModel,
|
||||
TypeValue,
|
||||
User
|
||||
} from '@redaction/red-ui-http';
|
||||
import { AddEditFileAttributeDialogComponent } from '../dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component';
|
||||
import { AddEditDictionaryDialogComponent } from '../dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component';
|
||||
import { AddEditRuleSetDialogComponent } from '../dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component';
|
||||
import { AddEditDossierTemplateDialogComponent } from '../dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component';
|
||||
import { NotificationService } from '@services/notification.service';
|
||||
import { ConfirmationDialogComponent } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
@ -46,7 +46,7 @@ export class AdminDialogService {
|
||||
private readonly _dialog: MatDialog,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _ruleSetControllerService: RuleSetControllerService,
|
||||
private readonly _dossierTemplateControllerService: DossierTemplateControllerService,
|
||||
private readonly _dictionaryControllerService: DictionaryControllerService,
|
||||
private readonly _fileManagementControllerService: FileManagementControllerService,
|
||||
private readonly _notificationService: NotificationService,
|
||||
@ -56,7 +56,7 @@ export class AdminDialogService {
|
||||
openDeleteDictionaryDialog(
|
||||
$event: MouseEvent,
|
||||
dictionary: TypeValue,
|
||||
ruleSetId: string,
|
||||
dossierTemplateId: string,
|
||||
cb?: Function
|
||||
): MatDialogRef<ConfirmationDialogComponent> {
|
||||
$event.stopPropagation();
|
||||
@ -64,7 +64,7 @@ export class AdminDialogService {
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
if (result) {
|
||||
await this._dictionaryControllerService
|
||||
.deleteType(dictionary.type, ruleSetId)
|
||||
.deleteType(dictionary.type, dossierTemplateId)
|
||||
.toPromise();
|
||||
if (cb) cb();
|
||||
}
|
||||
@ -72,16 +72,18 @@ export class AdminDialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
openDeleteRuleSetDialog(
|
||||
openDeleteDossierTemplateDialog(
|
||||
$event: MouseEvent,
|
||||
ruleSet: RuleSetModel,
|
||||
dossierTemplate: DossierTemplateModel,
|
||||
cb?: Function
|
||||
): MatDialogRef<ConfirmationDialogComponent> {
|
||||
$event.stopPropagation();
|
||||
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
if (result) {
|
||||
await this._ruleSetControllerService.getAllRuleSets(ruleSet.ruleSetId).toPromise();
|
||||
await this._dossierTemplateControllerService
|
||||
.getAllDossierTemplates(dossierTemplate.dossierTemplateId)
|
||||
.toPromise();
|
||||
if (cb) await cb();
|
||||
}
|
||||
});
|
||||
@ -90,12 +92,12 @@ export class AdminDialogService {
|
||||
|
||||
openAddEditDictionaryDialog(
|
||||
dictionary: TypeValue,
|
||||
ruleSetId: string,
|
||||
dossierTemplateId: string,
|
||||
cb?: Function
|
||||
): MatDialogRef<AddEditDictionaryDialogComponent> {
|
||||
const ref = this._dialog.open(AddEditDictionaryDialogComponent, {
|
||||
...dialogConfig,
|
||||
data: { dictionary, ruleSetId },
|
||||
data: { dictionary, dossierTemplateId },
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
@ -111,12 +113,12 @@ export class AdminDialogService {
|
||||
openEditColorsDialog(
|
||||
colors: Colors,
|
||||
colorKey: string,
|
||||
ruleSetId: string,
|
||||
dossierTemplateId: string,
|
||||
cb?: Function
|
||||
): MatDialogRef<EditColorDialogComponent> {
|
||||
const ref = this._dialog.open(EditColorDialogComponent, {
|
||||
...dialogConfig,
|
||||
data: { colors, colorKey, ruleSetId },
|
||||
data: { colors, colorKey, dossierTemplateId },
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
@ -129,14 +131,14 @@ export class AdminDialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
openAddEditRuleSetDialog(
|
||||
ruleSet: RuleSetModel,
|
||||
openAddEditDossierTemplateDialog(
|
||||
dossierTemplate: DossierTemplateModel,
|
||||
cb?: Function
|
||||
): MatDialogRef<AddEditRuleSetDialogComponent> {
|
||||
const ref = this._dialog.open(AddEditRuleSetDialogComponent, {
|
||||
): MatDialogRef<AddEditDossierTemplateDialogComponent> {
|
||||
const ref = this._dialog.open(AddEditDossierTemplateDialogComponent, {
|
||||
...dialogConfig,
|
||||
width: '900px',
|
||||
data: ruleSet,
|
||||
data: dossierTemplate,
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
@ -151,13 +153,13 @@ export class AdminDialogService {
|
||||
|
||||
openImportFileAttributeCSVDialog(
|
||||
csv: File,
|
||||
ruleSetId: string,
|
||||
dossierTemplateId: string,
|
||||
existingConfiguration: FileAttributesConfig,
|
||||
cb?: Function
|
||||
): MatDialogRef<FileAttributesCsvImportDialogComponent> {
|
||||
const ref = this._dialog.open(FileAttributesCsvImportDialogComponent, {
|
||||
...largeDialogConfig,
|
||||
data: { csv, ruleSetId, existingConfiguration }
|
||||
data: { csv, dossierTemplateId, existingConfiguration }
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
@ -171,12 +173,12 @@ export class AdminDialogService {
|
||||
|
||||
openAddEditFileAttributeDialog(
|
||||
fileAttribute: FileAttributeConfig,
|
||||
ruleSetId: string,
|
||||
dossierTemplateId: string,
|
||||
cb?: Function
|
||||
): MatDialogRef<AddEditFileAttributeDialogComponent> {
|
||||
const ref = this._dialog.open(AddEditFileAttributeDialogComponent, {
|
||||
...dialogConfig,
|
||||
data: { fileAttribute, ruleSetId },
|
||||
data: { fileAttribute, dossierTemplateId },
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
@ -191,7 +193,7 @@ export class AdminDialogService {
|
||||
|
||||
openConfirmDeleteFileAttributeDialog(
|
||||
fileAttribute: FileAttributeConfig,
|
||||
ruleSetId: string,
|
||||
dossierTemplateId: string,
|
||||
cb?: Function
|
||||
): MatDialogRef<ConfirmDeleteFileAttributeDialogComponent> {
|
||||
const ref = this._dialog.open(ConfirmDeleteFileAttributeDialogComponent, {
|
||||
|
||||
@ -35,7 +35,7 @@ export class RedRoleGuard implements CanActivate {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._userService.isUser() && state.url.startsWith('/main/projects')) {
|
||||
if (!this._userService.isUser() && state.url.startsWith('/main/dossiers')) {
|
||||
this._router.navigate(['/main/admin']);
|
||||
obs.next(false);
|
||||
obs.complete();
|
||||
@ -46,7 +46,7 @@ export class RedRoleGuard implements CanActivate {
|
||||
obs.next(true);
|
||||
obs.complete();
|
||||
} else {
|
||||
this._router.navigate(['/main/projects']);
|
||||
this._router.navigate(['/main/dossiers']);
|
||||
obs.next(false);
|
||||
obs.complete();
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
(action)="delete()"
|
||||
*ngIf="canDelete"
|
||||
icon="red:trash"
|
||||
tooltip="project-overview.bulk.delete"
|
||||
tooltip="dossier-overview.bulk.delete"
|
||||
type="dark-bg"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
(action)="assignToMe()"
|
||||
*ngIf="canAssignToSelf"
|
||||
icon="red:assign-me"
|
||||
tooltip="project-overview.assign-me"
|
||||
tooltip="dossier-overview.assign-me"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
@ -28,7 +28,7 @@
|
||||
(action)="setToUnderApproval()"
|
||||
*ngIf="canSetToUnderApproval"
|
||||
icon="red:ready-for-approval"
|
||||
tooltip="project-overview.under-approval"
|
||||
tooltip="dossier-overview.under-approval"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
@ -37,14 +37,14 @@
|
||||
(action)="setToUnderReview()"
|
||||
*ngIf="canSetToUnderReview"
|
||||
icon="red:undo"
|
||||
tooltip="project-overview.under-review"
|
||||
tooltip="dossier-overview.under-review"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-file-download-btn
|
||||
[file]="selectedFiles"
|
||||
[project]="project"
|
||||
[dossier]="dossier"
|
||||
></redaction-file-download-btn>
|
||||
|
||||
<!-- Approved-->
|
||||
@ -52,7 +52,7 @@
|
||||
(action)="approveDocuments()"
|
||||
*ngIf="isReadyForApproval"
|
||||
[disabled]="!canApprove"
|
||||
[tooltip]="canApprove ? 'project-overview.approve' : 'project-overview.approve-disabled'"
|
||||
[tooltip]="canApprove ? 'dossier-overview.approve' : 'dossier-overview.approve-disabled'"
|
||||
icon="red:approved"
|
||||
type="dark-bg"
|
||||
>
|
||||
@ -63,7 +63,7 @@
|
||||
(action)="setToUnderApproval()"
|
||||
*ngIf="canUndoApproval"
|
||||
icon="red:undo"
|
||||
tooltip="project-overview.under-approval"
|
||||
tooltip="dossier-overview.under-approval"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
@ -72,7 +72,7 @@
|
||||
(action)="ocr()"
|
||||
*ngIf="canOcr"
|
||||
icon="red:ocr"
|
||||
tooltip="project-overview.ocr-file"
|
||||
tooltip="dossier-overview.ocr-file"
|
||||
type="dark-bg"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
(action)="reanalyse()"
|
||||
*ngIf="canReanalyse"
|
||||
icon="red:refresh"
|
||||
tooltip="project-overview.bulk.reanalyse"
|
||||
tooltip="dossier-overview.bulk.reanalyse"
|
||||
type="dark-bg"
|
||||
></redaction-circle-button>
|
||||
</ng-container>
|
||||
|
||||
@ -10,14 +10,14 @@ import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import { FileActionService } from '../../services/file-action.service';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { StatusOverlayService } from '@upload-download/services/status-overlay.service';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-overview-bulk-actions',
|
||||
templateUrl: './project-overview-bulk-actions.component.html',
|
||||
styleUrls: ['./project-overview-bulk-actions.component.scss']
|
||||
selector: 'redaction-dossier-overview-bulk-actions',
|
||||
templateUrl: './dossier-overview-bulk-actions.component.html',
|
||||
styleUrls: ['./dossier-overview-bulk-actions.component.scss']
|
||||
})
|
||||
export class ProjectOverviewBulkActionsComponent {
|
||||
export class DossierOverviewBulkActionsComponent {
|
||||
@Input()
|
||||
selectedFileIds: string[];
|
||||
@Output()
|
||||
@ -28,7 +28,7 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _fileManagementControllerService: FileManagementControllerService,
|
||||
private readonly _reanalysisControllerService: ReanalysisControllerService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
@ -37,14 +37,14 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef
|
||||
) {}
|
||||
|
||||
get project() {
|
||||
return this._appStateService?.activeProject;
|
||||
get dossier() {
|
||||
return this._appStateService?.activeDossier;
|
||||
}
|
||||
|
||||
get selectedFiles(): FileStatusWrapper[] {
|
||||
return this.selectedFileIds.map((fileId) =>
|
||||
this._appStateService.getFileById(
|
||||
this._appStateService.activeProject.project.projectId,
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
fileId
|
||||
)
|
||||
);
|
||||
@ -52,8 +52,8 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
|
||||
get areAllFilesSelected() {
|
||||
return (
|
||||
this._appStateService.activeProject.files.length !== 0 &&
|
||||
this.selectedFileIds.length === this._appStateService.activeProject.files.length
|
||||
this._appStateService.activeDossier.files.length !== 0 &&
|
||||
this.selectedFileIds.length === this._appStateService.activeDossier.files.length
|
||||
);
|
||||
}
|
||||
|
||||
@ -167,15 +167,15 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
true
|
||||
);
|
||||
return allFilesAreUnderApproval
|
||||
? 'project-overview.assign-approver'
|
||||
: 'project-overview.assign-reviewer';
|
||||
? 'dossier-overview.assign-approver'
|
||||
: 'dossier-overview.assign-reviewer';
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.loading = true;
|
||||
this._dialogService.openDeleteFilesDialog(
|
||||
null,
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this.selectedFileIds,
|
||||
() => {
|
||||
this.reload.emit();
|
||||
@ -187,10 +187,10 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
|
||||
setToUnderApproval() {
|
||||
// If more than 1 approver - show dialog and ask who to assign
|
||||
if (this._appStateService.activeProject.approverIds.length > 1) {
|
||||
if (this._appStateService.activeDossier.approverIds.length > 1) {
|
||||
this.loading = true;
|
||||
const files = this.selectedFileIds.map((fileId) =>
|
||||
this._appStateService.getFileById(this._appStateService.activeProjectId, fileId)
|
||||
this._appStateService.getFileById(this._appStateService.activeDossierId, fileId)
|
||||
);
|
||||
|
||||
this._dialogService.openAssignFileToUserDialog(
|
||||
@ -206,7 +206,7 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
this._performBulkAction(
|
||||
this._fileActionService.setFileUnderApproval(
|
||||
this.selectedFiles,
|
||||
this._appStateService.activeProject.approverIds[0]
|
||||
this._appStateService.activeDossier.approverIds[0]
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -217,9 +217,9 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
.filter((file) => this._permissionsService.fileRequiresReanalysis(file))
|
||||
.map((file) => file.fileId);
|
||||
this._performBulkAction(
|
||||
this._reanalysisControllerService.reanalyzeFilesForProject(
|
||||
this._reanalysisControllerService.reanalyzeFilesForDossier(
|
||||
fileIds,
|
||||
this._appStateService.activeProject.projectId
|
||||
this._appStateService.activeDossier.dossierId
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -251,7 +251,7 @@ export class ProjectOverviewBulkActionsComponent {
|
||||
assign() {
|
||||
this.loading = true;
|
||||
const files = this.selectedFileIds.map((fileId) =>
|
||||
this._appStateService.getFileById(this._appStateService.activeProjectId, fileId)
|
||||
this._appStateService.getFileById(this._appStateService.activeDossierId, fileId)
|
||||
);
|
||||
|
||||
const mode = files[0].isUnderApproval ? 'approver' : 'reviewer';
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
<div>
|
||||
<mat-icon svgIcon="red:folder"></mat-icon>
|
||||
<span>{{
|
||||
'file-preview.tabs.document-info.details.project'
|
||||
| translate: { projectName: project.name }
|
||||
'file-preview.tabs.document-info.details.dossier'
|
||||
| translate: { dossierName: dossier.name }
|
||||
}}</span>
|
||||
</div>
|
||||
<div>
|
||||
@ -45,16 +45,16 @@
|
||||
| translate: { date: file.added | date: 'mediumDate' }
|
||||
}}</span>
|
||||
</div>
|
||||
<div *ngIf="project.project.dueDate">
|
||||
<div *ngIf="dossier.dossier.dueDate">
|
||||
<mat-icon svgIcon="red:lightning"></mat-icon>
|
||||
<span>{{
|
||||
'file-preview.tabs.document-info.details.due'
|
||||
| translate: { date: project.project.dueDate | date: 'mediumDate' }
|
||||
| translate: { date: dossier.dossier.dueDate | date: 'mediumDate' }
|
||||
}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:template"></mat-icon>
|
||||
{{ ruleSetName }}
|
||||
{{ dossierTemplateName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FileAttributesConfig, FileStatus } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-document-info',
|
||||
@ -16,17 +16,17 @@ export class DocumentInfoComponent {
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dialogService: ProjectsDialogService
|
||||
private readonly _dialogService: DossiersDialogService
|
||||
) {
|
||||
this.fileAttributesConfig = this._appStateService.activeFileAttributesConfig;
|
||||
}
|
||||
|
||||
get project() {
|
||||
return this._appStateService.getProjectById(this.file.projectId);
|
||||
get dossier() {
|
||||
return this._appStateService.getDossierById(this.file.dossierId);
|
||||
}
|
||||
|
||||
get ruleSetName(): string {
|
||||
return this._appStateService.getRuleSetById(this.project.ruleSetId).name;
|
||||
get dossierTemplateName(): string {
|
||||
return this._appStateService.getDossierTemplateById(this.dossier.dossierTemplateId).name;
|
||||
}
|
||||
|
||||
edit() {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div *ngIf="screen === 'project-overview'" [class.active]="actionMenuOpen" class="action-buttons">
|
||||
<div *ngIf="screen === 'dossier-overview'" [class.active]="actionMenuOpen" class="action-buttons">
|
||||
<ng-container *ngTemplateOutlet="actions"></ng-container>
|
||||
<redaction-status-bar
|
||||
*ngIf="fileStatus.isWorkable"
|
||||
@ -24,13 +24,13 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:trash"
|
||||
tooltip="project-overview.delete.action"
|
||||
tooltip="dossier-overview.delete.action"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="assign($event)"
|
||||
*ngIf="canAssign && screen === 'project-overview'"
|
||||
*ngIf="canAssign && screen === 'dossier-overview'"
|
||||
icon="red:assign"
|
||||
[tooltip]="assignTooltip"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
@ -39,9 +39,9 @@
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="assignToMe($event)"
|
||||
*ngIf="canAssignToSelf && screen === 'project-overview'"
|
||||
*ngIf="canAssignToSelf && screen === 'dossier-overview'"
|
||||
icon="red:assign-me"
|
||||
tooltip="project-overview.assign-me"
|
||||
tooltip="dossier-overview.assign-me"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
>
|
||||
@ -50,7 +50,7 @@
|
||||
<!-- download redacted file-->
|
||||
<redaction-file-download-btn
|
||||
[file]="fileStatus"
|
||||
[project]="appStateService.activeProject"
|
||||
[dossier]="appStateService.activeDossier"
|
||||
[tooltipClass]="'small'"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
@ -73,7 +73,7 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:ready-for-approval"
|
||||
tooltip="project-overview.under-approval"
|
||||
tooltip="dossier-overview.under-approval"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:undo"
|
||||
tooltip="project-overview.under-review"
|
||||
tooltip="dossier-overview.under-review"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -96,8 +96,8 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltip]="
|
||||
permissionsService.canApprove(fileStatus)
|
||||
? 'project-overview.approve'
|
||||
: 'project-overview.approve-disabled'
|
||||
? 'dossier-overview.approve'
|
||||
: 'dossier-overview.approve-disabled'
|
||||
"
|
||||
[type]="buttonType"
|
||||
icon="red:approved"
|
||||
@ -111,7 +111,7 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:undo"
|
||||
tooltip="project-overview.under-approval"
|
||||
tooltip="dossier-overview.under-approval"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:ocr"
|
||||
tooltip="project-overview.ocr-file"
|
||||
tooltip="dossier-overview.ocr-file"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -140,10 +140,10 @@
|
||||
<!-- reanalyse file listing -->
|
||||
<redaction-circle-button
|
||||
(action)="reanalyseFile($event)"
|
||||
*ngIf="canReanalyse && screen === 'project-overview'"
|
||||
*ngIf="canReanalyse && screen === 'dossier-overview'"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
icon="red:refresh"
|
||||
tooltip="project-overview.reanalyse.action"
|
||||
tooltip="dossier-overview.reanalyse.action"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
@ -153,7 +153,7 @@
|
||||
<mat-slide-toggle
|
||||
(click)="toggleAnalysis($event)"
|
||||
[checked]="!fileStatus?.isExcluded"
|
||||
[class.mr-24]="screen === 'project-overview'"
|
||||
[class.mr-24]="screen === 'dossier-overview'"
|
||||
[disabled]="!permissionsService.isManager()"
|
||||
[matTooltipPosition]="tooltipPosition"
|
||||
[matTooltip]="toggleTooltip | translate"
|
||||
|
||||
@ -3,7 +3,7 @@ import { PermissionsService } from '@services/permissions.service';
|
||||
import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { FileActionService } from '../../services/file-action.service';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-file-actions',
|
||||
@ -16,12 +16,12 @@ export class FileActionsComponent implements OnInit {
|
||||
@Output() actionPerformed = new EventEmitter<string>();
|
||||
actionMenuOpen: boolean;
|
||||
|
||||
screen: 'file-preview' | 'project-overview';
|
||||
screen: 'file-preview' | 'dossier-overview';
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
readonly appStateService: AppStateService,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _fileActionService: FileActionService
|
||||
) {}
|
||||
|
||||
@ -89,8 +89,8 @@ export class FileActionsComponent implements OnInit {
|
||||
|
||||
get assignTooltip() {
|
||||
return this.fileStatus.isUnderApproval
|
||||
? 'project-overview.assign-approver'
|
||||
: 'project-overview.assign-reviewer';
|
||||
? 'dossier-overview.assign-approver'
|
||||
: 'dossier-overview.assign-reviewer';
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@ -103,7 +103,7 @@ export class FileActionsComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.screen = 'project-overview';
|
||||
this.screen = 'dossier-overview';
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ export class FileActionsComponent implements OnInit {
|
||||
openDeleteFileDialog($event: MouseEvent) {
|
||||
this._dialogService.openDeleteFilesDialog(
|
||||
$event,
|
||||
this.fileStatus.projectId,
|
||||
this.fileStatus.dossierId,
|
||||
[this.fileStatus.fileId],
|
||||
() => {
|
||||
this.actionPerformed.emit('delete');
|
||||
@ -136,28 +136,28 @@ export class FileActionsComponent implements OnInit {
|
||||
$event.stopPropagation();
|
||||
|
||||
await this._fileActionService.assignToMe(this.fileStatus, () => {
|
||||
this.reloadProjects('reanalyse');
|
||||
this.reloadDossiers('reanalyse');
|
||||
});
|
||||
}
|
||||
|
||||
reanalyseFile($event: MouseEvent, priority = -1) {
|
||||
$event.stopPropagation();
|
||||
this._fileActionService.reanalyseFile(this.fileStatus, priority).subscribe(() => {
|
||||
this.reloadProjects('reanalyse');
|
||||
this.reloadDossiers('reanalyse');
|
||||
});
|
||||
}
|
||||
|
||||
setFileUnderApproval($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
if (this.appStateService.activeProject.approverIds.length > 1) {
|
||||
this._fileActionService.assignProjectApprover(
|
||||
if (this.appStateService.activeDossier.approverIds.length > 1) {
|
||||
this._fileActionService.assignDossierApprover(
|
||||
this.fileStatus,
|
||||
() => this.actionPerformed.emit('assign-reviewer'),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
this._fileActionService.setFileUnderApproval(this.fileStatus).subscribe(() => {
|
||||
this.reloadProjects('set-under-approval');
|
||||
this.reloadDossiers('set-under-approval');
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -165,27 +165,27 @@ export class FileActionsComponent implements OnInit {
|
||||
setFileApproved($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
this._fileActionService.setFileApproved(this.fileStatus).subscribe(() => {
|
||||
this.reloadProjects('set-approved');
|
||||
this.reloadDossiers('set-approved');
|
||||
});
|
||||
}
|
||||
|
||||
ocrFile($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
this._fileActionService.ocrFile(this.fileStatus).subscribe(() => {
|
||||
this.reloadProjects('ocr-file');
|
||||
this.reloadDossiers('ocr-file');
|
||||
});
|
||||
}
|
||||
|
||||
setFileUnderReview($event: MouseEvent, ignoreDialogChanges = false) {
|
||||
$event.stopPropagation();
|
||||
this._fileActionService.assignProjectReviewer(
|
||||
this._fileActionService.assignDossierReviewer(
|
||||
this.fileStatus,
|
||||
() => this.actionPerformed.emit('assign-reviewer'),
|
||||
ignoreDialogChanges
|
||||
);
|
||||
}
|
||||
|
||||
reloadProjects(action: string) {
|
||||
reloadDossiers(action: string) {
|
||||
this.appStateService.getFiles().then(() => {
|
||||
this.actionPerformed.emit(action);
|
||||
});
|
||||
|
||||
@ -2,7 +2,7 @@ import { Component, Input } from '@angular/core';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-needs-work-badge',
|
||||
@ -10,7 +10,7 @@ import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
styleUrls: ['./needs-work-badge.component.scss']
|
||||
})
|
||||
export class NeedsWorkBadgeComponent {
|
||||
@Input() needsWorkInput: FileStatusWrapper | ProjectWrapper;
|
||||
@Input() needsWorkInput: FileStatusWrapper | DossierWrapper;
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
@ -57,19 +57,19 @@ export class NeedsWorkBadgeComponent {
|
||||
}
|
||||
|
||||
reanalysisRequired() {
|
||||
if (this.needsWorkInput instanceof ProjectWrapper) {
|
||||
return this._permissionsService.projectReanalysisRequired(this.needsWorkInput);
|
||||
if (this.needsWorkInput instanceof DossierWrapper) {
|
||||
return this._permissionsService.dossierReanalysisRequired(this.needsWorkInput);
|
||||
} else {
|
||||
return this._permissionsService.fileRequiresReanalysis(this.needsWorkInput);
|
||||
}
|
||||
}
|
||||
|
||||
private _getDictionaryColor(type: string) {
|
||||
let ruleSetId = null;
|
||||
if (this.needsWorkInput instanceof ProjectWrapper) {
|
||||
ruleSetId = this.needsWorkInput.ruleSetId;
|
||||
let dossierTemplateId = null;
|
||||
if (this.needsWorkInput instanceof DossierWrapper) {
|
||||
dossierTemplateId = this.needsWorkInput.dossierTemplateId;
|
||||
}
|
||||
|
||||
return this._appStateService.getDictionaryColor(type, ruleSetId);
|
||||
return this._appStateService.getDictionaryColor(type, dossierTemplateId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this._viewedPagesControllerService
|
||||
.addPage(
|
||||
{ page: this.number },
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.subscribe(() => {
|
||||
@ -117,7 +117,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
private _markPageUnread() {
|
||||
this._viewedPagesControllerService
|
||||
.removePage(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
this.number
|
||||
)
|
||||
|
||||
@ -1,29 +1,29 @@
|
||||
<ng-container *ngIf="appStateService.activeProject">
|
||||
<ng-container *ngIf="appStateService.activeDossier">
|
||||
<div class="collapsed-wrapper">
|
||||
<redaction-circle-button
|
||||
(action)="toggleCollapse.emit()"
|
||||
icon="red:expand"
|
||||
tooltip="project-details.expand"
|
||||
tooltip="dossier-details.expand"
|
||||
tooltipPosition="before"
|
||||
></redaction-circle-button>
|
||||
<div class="all-caps-label" translate="project-details.title"></div>
|
||||
<div class="all-caps-label" translate="dossier-details.title"></div>
|
||||
</div>
|
||||
|
||||
<div class="header-wrapper mt-8">
|
||||
<div class="heading-xl flex-1">{{ appStateService.activeProject.project.projectName }}</div>
|
||||
<div class="heading-xl flex-1">{{ appStateService.activeDossier.dossier.dossierName }}</div>
|
||||
<redaction-circle-button
|
||||
(action)="toggleCollapse.emit()"
|
||||
icon="red:collapse"
|
||||
tooltip="project-details.collapse"
|
||||
tooltip="dossier-details.collapse"
|
||||
tooltipPosition="before"
|
||||
></redaction-circle-button>
|
||||
</div>
|
||||
|
||||
<div class="mt-24">
|
||||
<div class="all-caps-label" translate="project-details.owner"></div>
|
||||
<div class="all-caps-label" translate="dossier-details.owner"></div>
|
||||
<div class="mt-12">
|
||||
<redaction-initials-avatar
|
||||
[userId]="appStateService.activeProject.project.ownerId"
|
||||
[userId]="appStateService.activeDossier.dossier.ownerId"
|
||||
[withName]="true"
|
||||
color="gray"
|
||||
size="large"
|
||||
@ -32,9 +32,9 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-16">
|
||||
<div class="all-caps-label" translate="project-details.members"></div>
|
||||
<div class="all-caps-label" translate="dossier-details.members"></div>
|
||||
<redaction-team-members
|
||||
(openAssignProjectMembersDialog)="openAssignProjectMembersDialog.emit()"
|
||||
(openAssignDossierMembersDialog)="openAssignDossierMembersDialog.emit()"
|
||||
[memberIds]="memberIds"
|
||||
[perLine]="9"
|
||||
></redaction-team-members>
|
||||
@ -47,7 +47,7 @@
|
||||
[filter]="filters.statusFilters"
|
||||
[radius]="63"
|
||||
[strokeWidth]="15"
|
||||
[subtitle]="'project-overview.project-details.charts.documents-in-project'"
|
||||
[subtitle]="'dossier-overview.dossier-details.charts.documents-in-dossier'"
|
||||
direction="row"
|
||||
></redaction-simple-doughnut-chart>
|
||||
</div>
|
||||
@ -66,47 +66,47 @@
|
||||
<div>
|
||||
<mat-icon svgIcon="red:document"></mat-icon>
|
||||
<span>{{
|
||||
'project-overview.project-details.stats.documents'
|
||||
| translate: { count: appStateService.activeProject.files.length }
|
||||
'dossier-overview.dossier-details.stats.documents'
|
||||
| translate: { count: appStateService.activeDossier.files.length }
|
||||
}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:user"></mat-icon>
|
||||
<span>{{
|
||||
'project-overview.project-details.stats.people'
|
||||
| translate: { count: appStateService.activeProject.memberCount }
|
||||
'dossier-overview.dossier-details.stats.people'
|
||||
| translate: { count: appStateService.activeDossier.memberCount }
|
||||
}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:pages"></mat-icon>
|
||||
<span>{{
|
||||
'project-overview.project-details.stats.analysed-pages'
|
||||
'dossier-overview.dossier-details.stats.analysed-pages'
|
||||
| translate
|
||||
: { count: appStateService.activeProject.totalNumberOfPages | number }
|
||||
: { count: appStateService.activeDossier.totalNumberOfPages | number }
|
||||
}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:calendar"></mat-icon>
|
||||
<span
|
||||
>{{
|
||||
'project-overview.project-details.stats.created-on'
|
||||
'dossier-overview.dossier-details.stats.created-on'
|
||||
| translate
|
||||
: {
|
||||
date:
|
||||
appStateService.activeProject.project.date
|
||||
appStateService.activeDossier.dossier.date
|
||||
| date: 'd MMM. yyyy'
|
||||
}
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
<div *ngIf="appStateService.activeProject.project.dueDate">
|
||||
<div *ngIf="appStateService.activeDossier.dossier.dueDate">
|
||||
<mat-icon svgIcon="red:lightning"></mat-icon>
|
||||
<span>{{
|
||||
'project-overview.project-details.stats.due-date'
|
||||
'dossier-overview.dossier-details.stats.due-date'
|
||||
| translate
|
||||
: {
|
||||
date:
|
||||
appStateService.activeProject.project.dueDate
|
||||
appStateService.activeDossier.dossier.dueDate
|
||||
| date: 'd MMM. yyyy'
|
||||
}
|
||||
}}</span>
|
||||
@ -114,21 +114,25 @@
|
||||
<div>
|
||||
<mat-icon svgIcon="red:template"></mat-icon>
|
||||
<span
|
||||
>{{ appStateService.getRuleSetById(appStateService.activeProject.ruleSetId)?.name }}
|
||||
>{{
|
||||
appStateService.getDossierTemplateById(
|
||||
appStateService.activeDossier.dossierTemplateId
|
||||
)?.name
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="appStateService.activeProject.type"
|
||||
*ngIf="appStateService.activeDossier.type"
|
||||
class="pointer"
|
||||
(click)="openDossierDictionaryDialog.emit()"
|
||||
>
|
||||
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
||||
<span>{{ 'project-overview.project-details.dictionary' | translate }} </span>
|
||||
<span>{{ 'dossier-overview.dossier-details.dictionary' | translate }} </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!!appStateService.activeProject.project.description" class="pb-32">
|
||||
<div class="heading" translate="project-overview.project-details.description"></div>
|
||||
<div class="mt-8">{{ appStateService.activeProject.project.description }}</div>
|
||||
<div *ngIf="!!appStateService.activeDossier.dossier.description" class="pb-32">
|
||||
<div class="heading" translate="dossier-overview.dossier-details.description"></div>
|
||||
<div class="mt-8">{{ appStateService.activeDossier.dossier.description }}</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
@ -7,18 +7,18 @@ import { FilterModel } from '@shared/components/filter/model/filter.model';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
import { StatusSorter } from '@utils/sorters/status-sorter';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-details',
|
||||
templateUrl: './project-details.component.html',
|
||||
styleUrls: ['./project-details.component.scss']
|
||||
selector: 'redaction-dossier-details',
|
||||
templateUrl: './dossier-details.component.html',
|
||||
styleUrls: ['./dossier-details.component.scss']
|
||||
})
|
||||
export class ProjectDetailsComponent implements OnInit {
|
||||
export class DossierDetailsComponent implements OnInit {
|
||||
documentsChartData: DoughnutChartConfig[] = [];
|
||||
@Input() filters: { needsWorkFilters: FilterModel[]; statusFilters: FilterModel[] };
|
||||
@Output() filtersChanged = new EventEmitter();
|
||||
@Output() openAssignProjectMembersDialog = new EventEmitter();
|
||||
@Output() openAssignDossierMembersDialog = new EventEmitter();
|
||||
@Output() openDossierDictionaryDialog = new EventEmitter();
|
||||
@Output() toggleCollapse = new EventEmitter();
|
||||
|
||||
@ -27,16 +27,16 @@ export class ProjectDetailsComponent implements OnInit {
|
||||
readonly translateChartService: TranslateChartService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _router: Router
|
||||
) {}
|
||||
|
||||
get memberIds(): string[] {
|
||||
return this.appStateService.activeProject.project.memberIds;
|
||||
return this.appStateService.activeDossier.dossier.memberIds;
|
||||
}
|
||||
|
||||
get hasFiles(): boolean {
|
||||
return this.appStateService.activeProject.hasFiles;
|
||||
return this.appStateService.activeDossier.hasFiles;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@ -47,8 +47,8 @@ export class ProjectDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
calculateChartConfig(): void {
|
||||
if (this.appStateService.activeProject) {
|
||||
const groups = groupBy(this.appStateService.activeProject?.files, 'status');
|
||||
if (this.appStateService.activeDossier) {
|
||||
const groups = groupBy(this.appStateService.activeDossier?.files, 'status');
|
||||
this.documentsChartData = [];
|
||||
for (const key of Object.keys(groups)) {
|
||||
this.documentsChartData.push({
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
<redaction-status-bar [config]="getProjectStatusConfig(project)"></redaction-status-bar>
|
||||
<redaction-status-bar [config]="getDossierStatusConfig(dossier)"></redaction-status-bar>
|
||||
<div [class.active]="actionMenuOpen" class="action-buttons">
|
||||
<redaction-circle-button
|
||||
(action)="openDeleteProjectDialog($event, project)"
|
||||
*ngIf="permissionsService.canDeleteProject(project)"
|
||||
(action)="openDeleteDossierDialog($event, dossier)"
|
||||
*ngIf="permissionsService.canDeleteDossier(dossier)"
|
||||
icon="red:trash"
|
||||
tooltip="project-listing.delete.action"
|
||||
tooltip="dossier-listing.delete.action"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="openEditProjectDialog($event, project)"
|
||||
(action)="openEditDossierDialog($event, dossier)"
|
||||
*ngIf="permissionsService.isManager()"
|
||||
icon="red:edit"
|
||||
tooltip="project-listing.edit.action"
|
||||
tooltip="dossier-listing.edit.action"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="reanalyseProject($event, project)"
|
||||
*ngIf="permissionsService.displayReanalyseBtn(project)"
|
||||
(action)="reanalyseDossier($event, dossier)"
|
||||
*ngIf="permissionsService.displayReanalyseBtn(dossier)"
|
||||
icon="red:refresh"
|
||||
tooltip="project-listing.reanalyse.action"
|
||||
tooltip="dossier-listing.reanalyse.action"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-file-download-btn
|
||||
[file]="project.files"
|
||||
[project]="project"
|
||||
[file]="dossier.files"
|
||||
[dossier]="dossier"
|
||||
type="dark-bg"
|
||||
></redaction-file-download-btn>
|
||||
</div>
|
||||
|
||||
@ -1,75 +1,75 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { StatusSorter } from '@utils/sorters/status-sorter';
|
||||
import { download } from '@utils/file-download-utils';
|
||||
import { computerize } from '@utils/functions';
|
||||
import { FileManagementControllerService } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-listing-actions',
|
||||
templateUrl: './project-listing-actions.component.html',
|
||||
styleUrls: ['./project-listing-actions.component.scss']
|
||||
selector: 'redaction-dossier-listing-actions',
|
||||
templateUrl: './dossier-listing-actions.component.html',
|
||||
styleUrls: ['./dossier-listing-actions.component.scss']
|
||||
})
|
||||
export class ProjectListingActionsComponent {
|
||||
@Input() project: ProjectWrapper;
|
||||
@Output() actionPerformed = new EventEmitter<ProjectWrapper | undefined>();
|
||||
export class DossierListingActionsComponent {
|
||||
@Input() dossier: DossierWrapper;
|
||||
@Output() actionPerformed = new EventEmitter<DossierWrapper | undefined>();
|
||||
actionMenuOpen = false;
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
readonly appStateService: AppStateService,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _fileManagementControllerService: FileManagementControllerService
|
||||
) {}
|
||||
|
||||
openDeleteProjectDialog($event: MouseEvent, project: ProjectWrapper) {
|
||||
this._dialogService.openDeleteProjectDialog($event, project, () => {
|
||||
openDeleteDossierDialog($event: MouseEvent, dossier: DossierWrapper) {
|
||||
this._dialogService.openDeleteDossierDialog($event, dossier, () => {
|
||||
this.actionPerformed.emit();
|
||||
});
|
||||
}
|
||||
|
||||
openEditProjectDialog($event: MouseEvent, project: ProjectWrapper) {
|
||||
this._dialogService.openEditProjectDialog($event, project, () => {
|
||||
openEditDossierDialog($event: MouseEvent, dossier: DossierWrapper) {
|
||||
this._dialogService.openEditDossierDialog($event, dossier, () => {
|
||||
this.actionPerformed.emit();
|
||||
});
|
||||
}
|
||||
|
||||
reanalyseProject($event: MouseEvent, project: ProjectWrapper) {
|
||||
reanalyseDossier($event: MouseEvent, dossier: DossierWrapper) {
|
||||
$event.stopPropagation();
|
||||
this.appStateService.reanalyzeProject(project).then(() => {
|
||||
this.appStateService.loadAllProjects().then(() => this.actionPerformed.emit());
|
||||
this.appStateService.reanalyzeDossier(dossier).then(() => {
|
||||
this.appStateService.loadAllDossiers().then(() => this.actionPerformed.emit());
|
||||
});
|
||||
}
|
||||
|
||||
// Download Files
|
||||
downloadRedactedFiles($event: MouseEvent, project: ProjectWrapper) {
|
||||
downloadRedactedFiles($event: MouseEvent, dossier: DossierWrapper) {
|
||||
$event.stopPropagation();
|
||||
this._fileManagementControllerService
|
||||
.downloadRedactedFiles(
|
||||
{ fileIds: project.files.map((file) => file.fileId) },
|
||||
project.projectId,
|
||||
{ fileIds: dossier.files.map((file) => file.fileId) },
|
||||
dossier.dossierId,
|
||||
false,
|
||||
'response'
|
||||
)
|
||||
.subscribe((data) => {
|
||||
download(data, 'redacted_files_' + computerize(project.name) + '.zip');
|
||||
download(data, 'redacted_files_' + computerize(dossier.name) + '.zip');
|
||||
});
|
||||
}
|
||||
|
||||
canDownloadRedactedFiles(project: ProjectWrapper) {
|
||||
canDownloadRedactedFiles(dossier: DossierWrapper) {
|
||||
return (
|
||||
project.files.length > 0 &&
|
||||
project.files.reduce(
|
||||
dossier.files.length > 0 &&
|
||||
dossier.files.reduce(
|
||||
(acc, file) => acc && this.permissionsService.canDownloadRedactedFile(file),
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
getProjectStatusConfig(pw: ProjectWrapper) {
|
||||
getDossierStatusConfig(pw: DossierWrapper) {
|
||||
const obj = pw.files.reduce((acc, file) => {
|
||||
const status = file.status;
|
||||
if (!acc[status]) {
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
<div>
|
||||
<redaction-simple-doughnut-chart
|
||||
[config]="projectsChartData"
|
||||
[config]="dossiersChartData"
|
||||
[radius]="80"
|
||||
[strokeWidth]="15"
|
||||
[subtitle]="'project-listing.stats.charts.projects'"
|
||||
[subtitle]="'dossier-listing.stats.charts.dossiers'"
|
||||
></redaction-simple-doughnut-chart>
|
||||
|
||||
<div class="project-stats-container">
|
||||
<div class="project-stats-item">
|
||||
<div class="dossier-stats-container">
|
||||
<div class="dossier-stats-item">
|
||||
<mat-icon svgIcon="red:needs-work"></mat-icon>
|
||||
<div>
|
||||
<div class="heading">{{ totalPages | number }}</div>
|
||||
<div translate="project-listing.stats.analyzed-pages"></div>
|
||||
<div translate="dossier-listing.stats.analyzed-pages"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="project-stats-item">
|
||||
<div class="dossier-stats-item">
|
||||
<mat-icon svgIcon="red:user"></mat-icon>
|
||||
<div>
|
||||
<div class="heading">{{ totalPeople }}</div>
|
||||
<div translate="project-listing.stats.total-people"></div>
|
||||
<div translate="dossier-listing.stats.total-people"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -31,6 +31,6 @@
|
||||
[filter]="filters.statusFilters"
|
||||
[radius]="80"
|
||||
[strokeWidth]="15"
|
||||
[subtitle]="'project-listing.stats.charts.total-documents'"
|
||||
[subtitle]="'dossier-listing.stats.charts.total-documents'"
|
||||
></redaction-simple-doughnut-chart>
|
||||
</div>
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
align-items: center;
|
||||
padding-top: 50px;
|
||||
|
||||
.project-stats-container {
|
||||
.project-stats-item {
|
||||
.dossier-stats-container {
|
||||
.dossier-stats-item {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
margin-top: 25px;
|
||||
|
||||
@ -4,12 +4,12 @@ import { AppStateService } from '@state/app-state.service';
|
||||
import { FilterModel } from '@shared/components/filter/model/filter.model';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-listing-details',
|
||||
templateUrl: './project-listing-details.component.html',
|
||||
styleUrls: ['./project-listing-details.component.scss']
|
||||
selector: 'redaction-dossier-listing-details',
|
||||
templateUrl: './dossier-listing-details.component.html',
|
||||
styleUrls: ['./dossier-listing-details.component.scss']
|
||||
})
|
||||
export class ProjectListingDetailsComponent {
|
||||
@Input() projectsChartData: DoughnutChartConfig[];
|
||||
export class DossierListingDetailsComponent {
|
||||
@Input() dossiersChartData: DoughnutChartConfig[];
|
||||
@Input() documentsChartData: DoughnutChartConfig[];
|
||||
@Input() filters: { statusFilters: FilterModel[] };
|
||||
@Output() filtersChanged = new EventEmitter();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<form (submit)="saveMembers()" [formGroup]="teamForm">
|
||||
<div class="red-input-group w-300">
|
||||
<mat-form-field floatLabel="always">
|
||||
<mat-label>{{ 'assign-project-owner.dialog.single-user' | translate }}</mat-label>
|
||||
<mat-label>{{ 'assign-dossier-owner.dialog.single-user' | translate }}</mat-label>
|
||||
<mat-select formControlName="owner">
|
||||
<mat-option *ngFor="let userId of ownersSelectOptions" [value]="userId">
|
||||
{{ userService.getNameForId(userId) }}
|
||||
@ -9,7 +9,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div [translate]="'assign-project-owner.dialog.approvers'" class="all-caps-label mt-16"></div>
|
||||
<div [translate]="'assign-dossier-owner.dialog.approvers'" class="all-caps-label mt-16"></div>
|
||||
<redaction-team-members
|
||||
(remove)="toggleSelected($event)"
|
||||
[canAdd]="false"
|
||||
@ -22,11 +22,11 @@
|
||||
|
||||
<pre
|
||||
*ngIf="selectedApproversList.length === 0"
|
||||
[innerHTML]="'assign-project-owner.dialog.no-approvers' | translate"
|
||||
[innerHTML]="'assign-dossier-owner.dialog.no-approvers' | translate"
|
||||
class="info"
|
||||
></pre>
|
||||
|
||||
<div [translate]="'assign-project-owner.dialog.reviewers'" class="all-caps-label mt-16"></div>
|
||||
<div [translate]="'assign-dossier-owner.dialog.reviewers'" class="all-caps-label mt-16"></div>
|
||||
<redaction-team-members
|
||||
(remove)="toggleSelected($event)"
|
||||
[canAdd]="false"
|
||||
@ -39,13 +39,13 @@
|
||||
|
||||
<pre
|
||||
*ngIf="selectedReviewersList.length === 0"
|
||||
[innerHTML]="'assign-project-owner.dialog.no-reviewers' | translate"
|
||||
[innerHTML]="'assign-dossier-owner.dialog.no-reviewers' | translate"
|
||||
class="info"
|
||||
></pre>
|
||||
|
||||
<redaction-search-input
|
||||
[form]="searchForm"
|
||||
[placeholder]="'assign-project-owner.dialog.search' | translate"
|
||||
[placeholder]="'assign-dossier-owner.dialog.search' | translate"
|
||||
[width]="560"
|
||||
class="search-container"
|
||||
></redaction-search-input>
|
||||
@ -71,7 +71,7 @@
|
||||
[active]="isApprover(userId)"
|
||||
class="mr-8"
|
||||
></redaction-round-checkbox>
|
||||
<span [translate]="'assign-project-owner.dialog.make-approver'"></span>
|
||||
<span [translate]="'assign-dossier-owner.dialog.make-approver'"></span>
|
||||
</div>
|
||||
<mat-icon *ngIf="!isOwner(userId)" svgIcon="red:check"></mat-icon>
|
||||
</div>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Project, ProjectControllerService, StatusControllerService } from '@redaction/red-ui-http';
|
||||
import { Dossier, DossierControllerService, StatusControllerService } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { NotificationService, NotificationType } from '@services/notification.service';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-team-members-manager',
|
||||
@ -15,13 +15,13 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
teamForm: FormGroup;
|
||||
searchForm: FormGroup;
|
||||
|
||||
@Input() projectWrapper: ProjectWrapper;
|
||||
@Input() dossierWrapper: DossierWrapper;
|
||||
|
||||
@Output() save = new EventEmitter<Project>();
|
||||
@Output() save = new EventEmitter<Dossier>();
|
||||
|
||||
constructor(
|
||||
readonly userService: UserService,
|
||||
private readonly _projectControllerService: ProjectControllerService,
|
||||
private readonly _dossierControllerService: DossierControllerService,
|
||||
private readonly _notificationService: NotificationService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _statusControllerService: StatusControllerService,
|
||||
@ -66,14 +66,14 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
}
|
||||
|
||||
get changed(): boolean {
|
||||
if (this.projectWrapper.ownerId !== this.selectedOwnerId) {
|
||||
if (this.dossierWrapper.ownerId !== this.selectedOwnerId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const initialMembers = this.projectWrapper.memberIds.sort();
|
||||
const initialMembers = this.dossierWrapper.memberIds.sort();
|
||||
const currentMembers = this.selectedMembersList.sort();
|
||||
|
||||
const initialApprovers = this.projectWrapper.approverIds.sort();
|
||||
const initialApprovers = this.dossierWrapper.approverIds.sort();
|
||||
const currentApprovers = this.selectedApproversList.sort();
|
||||
|
||||
return (
|
||||
@ -92,11 +92,11 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
const ownerId = this.selectedOwnerId;
|
||||
const memberIds = this.selectedMembersList;
|
||||
const approverIds = this.selectedApproversList;
|
||||
const pw = Object.assign({}, this.projectWrapper);
|
||||
pw.project.memberIds = memberIds;
|
||||
pw.project.approverIds = approverIds;
|
||||
pw.project.ownerId = ownerId;
|
||||
result = await this._appStateService.addOrUpdateProject(pw.project);
|
||||
const pw = Object.assign({}, this.dossierWrapper);
|
||||
pw.dossier.memberIds = memberIds;
|
||||
pw.dossier.approverIds = approverIds;
|
||||
pw.dossier.ownerId = ownerId;
|
||||
result = await this._appStateService.addOrUpdateDossier(pw.dossier);
|
||||
this.save.emit(result);
|
||||
} catch (error) {
|
||||
this._notificationService.showToastNotification(
|
||||
@ -154,9 +154,9 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
|
||||
private _loadData() {
|
||||
this.teamForm = this._formBuilder.group({
|
||||
owner: [this.projectWrapper?.ownerId, Validators.required],
|
||||
approvers: [[...this.projectWrapper?.approverIds]],
|
||||
members: [[...this.projectWrapper?.memberIds]]
|
||||
owner: [this.dossierWrapper?.ownerId, Validators.required],
|
||||
approvers: [[...this.dossierWrapper?.approverIds]],
|
||||
members: [[...this.dossierWrapper?.memberIds]]
|
||||
});
|
||||
this.searchForm = this._formBuilder.group({
|
||||
query: ['']
|
||||
|
||||
@ -23,13 +23,13 @@
|
||||
<div (click)="toggleExpandedTeam()" class="oval large white-dark">+{{ overflowCount }}</div>
|
||||
</div>
|
||||
<redaction-circle-button
|
||||
(action)="openAssignProjectMembersDialog.emit()"
|
||||
(action)="openAssignDossierMembersDialog.emit()"
|
||||
*ngIf="permissionsService.isManager() && canAdd"
|
||||
[class.large-spacing]="largeSpacing"
|
||||
[small]="true"
|
||||
class="member"
|
||||
icon="red:plus"
|
||||
tooltip="project-details.assign-members"
|
||||
tooltip="dossier-details.assign-members"
|
||||
type="primary"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
@ -38,5 +38,5 @@
|
||||
(click)="toggleExpandedTeam()"
|
||||
*ngIf="expandedTeam"
|
||||
class="all-caps-label see-less pointer"
|
||||
translate="project-details.see-less"
|
||||
translate="dossier-details.see-less"
|
||||
></div>
|
||||
|
||||
@ -13,7 +13,7 @@ export class TeamMembersComponent {
|
||||
@Input() largeSpacing = false;
|
||||
@Input() canRemove = false;
|
||||
@Input() unremovableMembers: string[] = [];
|
||||
@Output() openAssignProjectMembersDialog = new EventEmitter();
|
||||
@Output() openAssignDossierMembersDialog = new EventEmitter();
|
||||
@Output() remove = new EventEmitter<string>();
|
||||
|
||||
@ViewChild('container', { static: true }) container: ElementRef;
|
||||
|
||||
@ -1,42 +1,46 @@
|
||||
<section class="dialog">
|
||||
<form (submit)="saveProject()" [formGroup]="projectForm">
|
||||
<div class="dialog-header heading-l" translate="add-project-dialog.header-new"></div>
|
||||
<form (submit)="saveDossier()" [formGroup]="dossierForm">
|
||||
<div class="dialog-header heading-l" translate="add-dossier-dialog.header-new"></div>
|
||||
|
||||
<div class="dialog-content">
|
||||
<div class="red-input-group required w-300">
|
||||
<label translate="add-project-dialog.form.name.label"></label>
|
||||
<label translate="add-dossier-dialog.form.name.label"></label>
|
||||
<input
|
||||
[placeholder]="'add-project-dialog.form.name.placeholder' | translate"
|
||||
formControlName="projectName"
|
||||
name="projectName"
|
||||
[placeholder]="'add-dossier-dialog.form.name.placeholder' | translate"
|
||||
formControlName="dossierName"
|
||||
name="dossierName"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="red-input-group required w-400">
|
||||
<mat-form-field floatLabel="always">
|
||||
<mat-label>{{ 'add-project-dialog.form.template' | translate }}</mat-label>
|
||||
<mat-label>{{ 'add-dossier-dialog.form.template' | translate }}</mat-label>
|
||||
<mat-select
|
||||
(valueChange)="ruleSetChanged($event)"
|
||||
formControlName="ruleSetId"
|
||||
(valueChange)="dossierTemplateChanged($event)"
|
||||
formControlName="dossierTemplateId"
|
||||
style="width: 100%"
|
||||
>
|
||||
<mat-option
|
||||
*ngFor="let ruleSet of ruleSets"
|
||||
[matTooltip]="ruleSet.description ? ruleSet.description : ruleSet.name"
|
||||
[value]="ruleSet.ruleSetId"
|
||||
*ngFor="let dossierTemplate of dossierTemplates"
|
||||
[matTooltip]="
|
||||
dossierTemplate.description
|
||||
? dossierTemplate.description
|
||||
: dossierTemplate.name
|
||||
"
|
||||
[value]="dossierTemplate.dossierTemplateId"
|
||||
matTooltipPosition="after"
|
||||
>
|
||||
{{ ruleSet.name }}
|
||||
{{ dossierTemplate.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="red-input-group w-400">
|
||||
<label translate="add-project-dialog.form.description.label"></label>
|
||||
<label translate="add-dossier-dialog.form.description.label"></label>
|
||||
<textarea
|
||||
[placeholder]="'add-project-dialog.form.description.placeholder' | translate"
|
||||
[placeholder]="'add-dossier-dialog.form.description.placeholder' | translate"
|
||||
formControlName="description"
|
||||
name="description"
|
||||
redactionHasScrollbar
|
||||
@ -52,7 +56,7 @@
|
||||
class="filter-menu-checkbox"
|
||||
color="primary"
|
||||
>
|
||||
{{ 'add-project-dialog.form.due-date' | translate }}
|
||||
{{ 'add-dossier-dialog.form.due-date' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
<div *ngIf="hasDueDate" class="red-input-group datepicker-wrapper">
|
||||
@ -88,14 +92,14 @@
|
||||
|
||||
<div class="dialog-actions">
|
||||
<button [disabled]="disabled" color="primary" mat-flat-button type="submit">
|
||||
{{ 'add-project-dialog.actions.save' | translate }}
|
||||
{{ 'add-dossier-dialog.actions.save' | translate }}
|
||||
</button>
|
||||
|
||||
<redaction-icon-button
|
||||
(action)="saveProjectAndAddMembers()"
|
||||
(action)="saveDossierAndAddMembers()"
|
||||
[disabled]="disabled"
|
||||
icon="red:assign"
|
||||
text="add-project-dialog.actions.save-and-add-members"
|
||||
text="add-dossier-dialog.actions.save-and-add-members"
|
||||
type="show-bg"
|
||||
></redaction-icon-button>
|
||||
</div>
|
||||
|
||||
@ -1,31 +1,31 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { Project, RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { Dossier, DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-add-project-dialog',
|
||||
templateUrl: './add-project-dialog.component.html',
|
||||
styleUrls: ['./add-project-dialog.component.scss']
|
||||
selector: 'redaction-add-dossier-dialog',
|
||||
templateUrl: './add-dossier-dialog.component.html',
|
||||
styleUrls: ['./add-dossier-dialog.component.scss']
|
||||
})
|
||||
export class AddProjectDialogComponent {
|
||||
projectForm: FormGroup;
|
||||
export class AddDossierDialogComponent {
|
||||
dossierForm: FormGroup;
|
||||
hasDueDate = false;
|
||||
downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED'];
|
||||
reportTypesEnum = Object.values(RuleSetModel.ReportTypesEnum);
|
||||
ruleSets: RuleSetModel[];
|
||||
reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum);
|
||||
dossierTemplates: DossierTemplateModel[];
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
public dialogRef: MatDialogRef<AddProjectDialogComponent>
|
||||
public dialogRef: MatDialogRef<AddDossierDialogComponent>
|
||||
) {
|
||||
this._filterInvalidRuleSets();
|
||||
this.projectForm = this._formBuilder.group({
|
||||
projectName: [null, Validators.required],
|
||||
ruleSetId: [null, Validators.required],
|
||||
this._filterInvalidDossierTemplates();
|
||||
this.dossierForm = this._formBuilder.group({
|
||||
dossierName: [null, Validators.required],
|
||||
dossierTemplateId: [null, Validators.required],
|
||||
downloadFileTypes: [null],
|
||||
reportTypes: [null, Validators.required],
|
||||
description: [null],
|
||||
@ -34,80 +34,82 @@ export class AddProjectDialogComponent {
|
||||
}
|
||||
|
||||
get reportTypesLength() {
|
||||
return this.projectForm.controls['reportTypes']?.value?.length
|
||||
? this.projectForm.controls['reportTypes'].value.length
|
||||
return this.dossierForm.controls['reportTypes']?.value?.length
|
||||
? this.dossierForm.controls['reportTypes'].value.length
|
||||
: 0;
|
||||
}
|
||||
|
||||
get downloadFileTypesLength() {
|
||||
return this.projectForm.controls['downloadFileTypes']?.value?.length
|
||||
? this.projectForm.controls['downloadFileTypes'].value.length
|
||||
return this.dossierForm.controls['downloadFileTypes']?.value?.length
|
||||
? this.dossierForm.controls['downloadFileTypes'].value.length
|
||||
: 0;
|
||||
}
|
||||
|
||||
get disabled() {
|
||||
if (this.hasDueDate && this.projectForm.get('dueDate').value === null) {
|
||||
if (this.hasDueDate && this.dossierForm.get('dueDate').value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.projectForm.invalid;
|
||||
return this.dossierForm.invalid;
|
||||
}
|
||||
|
||||
async saveProject() {
|
||||
const project: Project = this._formToObject();
|
||||
async saveDossier() {
|
||||
const dossier: Dossier = this._formToObject();
|
||||
|
||||
const foundProject = this._appStateService.allProjects.find(
|
||||
(p) => p.project.projectId === project.projectId
|
||||
const foundDossier = this._appStateService.allDossiers.find(
|
||||
(p) => p.dossier.dossierId === dossier.dossierId
|
||||
);
|
||||
if (foundProject) {
|
||||
project.memberIds = foundProject.memberIds;
|
||||
if (foundDossier) {
|
||||
dossier.memberIds = foundDossier.memberIds;
|
||||
}
|
||||
|
||||
const savedProject = await this._appStateService.addOrUpdateProject(project);
|
||||
if (savedProject) {
|
||||
this.dialogRef.close({ project: savedProject });
|
||||
const savedDossier = await this._appStateService.addOrUpdateDossier(dossier);
|
||||
if (savedDossier) {
|
||||
this.dialogRef.close({ dossier: savedDossier });
|
||||
}
|
||||
}
|
||||
|
||||
async saveProjectAndAddMembers() {
|
||||
const project: Project = this._formToObject();
|
||||
const savedProject = await this._appStateService.addOrUpdateProject(project);
|
||||
if (savedProject) {
|
||||
this.dialogRef.close({ addMembers: true, project: savedProject });
|
||||
async saveDossierAndAddMembers() {
|
||||
const dossier: Dossier = this._formToObject();
|
||||
const savedDossier = await this._appStateService.addOrUpdateDossier(dossier);
|
||||
if (savedDossier) {
|
||||
this.dialogRef.close({ addMembers: true, dossier: savedDossier });
|
||||
}
|
||||
}
|
||||
|
||||
ruleSetChanged(ruleSetId) {
|
||||
// get current selected ruleSet
|
||||
const ruleSet = this.ruleSets.find((r) => r.ruleSetId === ruleSetId);
|
||||
if (ruleSet) {
|
||||
dossierTemplateChanged(dossierTemplateId) {
|
||||
// get current selected dossierTemplate
|
||||
const dossierTemplate = this.dossierTemplates.find(
|
||||
(r) => r.dossierTemplateId === dossierTemplateId
|
||||
);
|
||||
if (dossierTemplate) {
|
||||
// update dropdown values
|
||||
this.projectForm.patchValue(
|
||||
this.dossierForm.patchValue(
|
||||
{
|
||||
downloadFileTypes: ruleSet.downloadFileTypes,
|
||||
reportTypes: ruleSet.reportTypes
|
||||
downloadFileTypes: dossierTemplate.downloadFileTypes,
|
||||
reportTypes: dossierTemplate.reportTypes
|
||||
},
|
||||
{ emitEvent: false }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private _filterInvalidRuleSets() {
|
||||
this.ruleSets = this._appStateService.ruleSets.filter((r) => {
|
||||
private _filterInvalidDossierTemplates() {
|
||||
this.dossierTemplates = this._appStateService.dossierTemplates.filter((r) => {
|
||||
const notYetValid = !!r.validFrom && moment(r.validFrom).isAfter(moment());
|
||||
const notValidAnymore = !!r.validTo && moment(r.validTo).add(1, 'd').isBefore(moment());
|
||||
return !(notYetValid || notValidAnymore);
|
||||
});
|
||||
}
|
||||
|
||||
private _formToObject(): Project {
|
||||
private _formToObject(): Dossier {
|
||||
return {
|
||||
projectName: this.projectForm.get('projectName').value,
|
||||
description: this.projectForm.get('description').value,
|
||||
dueDate: this.hasDueDate ? this.projectForm.get('dueDate').value : undefined,
|
||||
ruleSetId: this.projectForm.get('ruleSetId').value,
|
||||
downloadFileTypes: this.projectForm.get('downloadFileTypes').value,
|
||||
reportTypes: this.projectForm.get('reportTypes').value
|
||||
dossierName: this.dossierForm.get('dossierName').value,
|
||||
description: this.dossierForm.get('description').value,
|
||||
dueDate: this.hasDueDate ? this.dossierForm.get('dueDate').value : undefined,
|
||||
dossierTemplateId: this.dossierForm.get('dossierTemplateId').value,
|
||||
downloadFileTypes: this.dossierForm.get('downloadFileTypes').value,
|
||||
reportTypes: this.dossierForm.get('reportTypes').value
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { ProjectControllerService, StatusControllerService } from '@redaction/red-ui-http';
|
||||
import { DossierControllerService, StatusControllerService } from '@redaction/red-ui-http';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { NotificationService, NotificationType } from '@services/notification.service';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
|
||||
class DialogData {
|
||||
mode: 'approver' | 'reviewer';
|
||||
project?: ProjectWrapper;
|
||||
dossier?: DossierWrapper;
|
||||
files?: FileStatusWrapper[];
|
||||
ignoreChanged?: boolean;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-details-dialog',
|
||||
selector: 'redaction-dossier-details-dialog',
|
||||
templateUrl: './assign-reviewer-approver-dialog.component.html',
|
||||
styleUrls: ['./assign-reviewer-approver-dialog.component.scss']
|
||||
})
|
||||
@ -26,7 +26,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
|
||||
constructor(
|
||||
readonly userService: UserService,
|
||||
private readonly _projectControllerService: ProjectControllerService,
|
||||
private readonly _dossierControllerService: DossierControllerService,
|
||||
private readonly _notificationService: NotificationService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _statusControllerService: StatusControllerService,
|
||||
@ -43,8 +43,8 @@ export class AssignReviewerApproverDialogComponent {
|
||||
|
||||
get singleUsersSelectOptions() {
|
||||
return this.data.mode === 'approver'
|
||||
? this._appStateService.activeProject.approverIds
|
||||
: this._appStateService.activeProject.memberIds;
|
||||
? this._appStateService.activeDossier.approverIds
|
||||
: this._appStateService.activeDossier.memberIds;
|
||||
}
|
||||
|
||||
get changed(): boolean {
|
||||
@ -75,7 +75,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
await this._statusControllerService
|
||||
.setFileReviewerForList(
|
||||
this.data.files.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
selectedUser
|
||||
)
|
||||
.toPromise();
|
||||
@ -83,7 +83,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
await this._statusControllerService
|
||||
.setStatusUnderApprovalForList(
|
||||
this.data.files.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
selectedUser
|
||||
)
|
||||
.toPromise();
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
} from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-document-info-dialog',
|
||||
@ -19,7 +19,7 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
file: FileStatus;
|
||||
attributes: FileAttributeConfig[];
|
||||
|
||||
private _project: ProjectWrapper;
|
||||
private _dossier: DossierWrapper;
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
@ -29,13 +29,13 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public data: FileStatus
|
||||
) {
|
||||
this.file = this.data;
|
||||
this._project = this._appStateService.getProjectById(this.file.projectId);
|
||||
this._dossier = this._appStateService.getDossierById(this.file.dossierId);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.attributes = (
|
||||
await this._fileAttributesService
|
||||
.getFileAttributesConfiguration(this._project.ruleSetId)
|
||||
.getFileAttributesConfiguration(this._dossier.dossierTemplateId)
|
||||
.toPromise()
|
||||
).fileAttributeConfigs.filter((attr) => attr.editable);
|
||||
const formConfig = this.attributes.reduce(
|
||||
@ -54,7 +54,7 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
...this.documentInfoForm.getRawValue()
|
||||
};
|
||||
await this._fileAttributesService
|
||||
.setFileAttributes({ attributeIdToValue }, this.file.projectId, this.file.fileId)
|
||||
.setFileAttributes({ attributeIdToValue }, this.file.dossierId, this.file.fileId)
|
||||
.toPromise();
|
||||
this.file.fileAttributes = { attributeIdToValue };
|
||||
this.dialogRef.close(true);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#dictionaryManager
|
||||
[withFloatingActions]="false"
|
||||
[canEdit]="canEdit"
|
||||
[initialEntries]="project.type?.entries"
|
||||
[initialEntries]="dossier.type?.entries"
|
||||
></redaction-dictionary-manager>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, Inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ProjectWrapper } from '../../../../state/model/project.wrapper';
|
||||
import { DossierWrapper } from '../../../../state/model/dossier.wrapper';
|
||||
import { DictionaryManagerComponent } from '../../../shared/components/dictionary-manager/dictionary-manager.component';
|
||||
import { DictionarySaveService } from '../../../shared/services/dictionary-save.service';
|
||||
import { AppStateService } from '../../../../state/app-state.service';
|
||||
@ -19,12 +19,12 @@ export class DossierDictionaryDialogComponent {
|
||||
constructor(
|
||||
public permissionsService: PermissionsService,
|
||||
public dialogRef: MatDialogRef<DossierDictionaryDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public project: ProjectWrapper,
|
||||
@Inject(MAT_DIALOG_DATA) public dossier: DossierWrapper,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dictionarySaveService: DictionarySaveService
|
||||
) {
|
||||
this.canEdit =
|
||||
this.permissionsService.isProjectMember(this.project) ||
|
||||
this.permissionsService.isDossierMember(this.dossier) ||
|
||||
this.permissionsService.isAdmin();
|
||||
}
|
||||
|
||||
@ -33,15 +33,15 @@ export class DossierDictionaryDialogComponent {
|
||||
.saveEntries(
|
||||
this._dictionaryManager.currentEntries,
|
||||
this._dictionaryManager.initialEntries,
|
||||
this.project.ruleSetId,
|
||||
this.dossier.dossierTemplateId,
|
||||
'dossier_redaction',
|
||||
this.project.projectId
|
||||
this.dossier.dossierId
|
||||
)
|
||||
.subscribe(async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
this._appStateService.updateProjectDictionary(
|
||||
this.project.ruleSetId,
|
||||
this.project.projectId
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
this._appStateService.updateDossierDictionary(
|
||||
this.dossier.dossierTemplateId,
|
||||
this.dossier.dossierId
|
||||
);
|
||||
this.dialogRef.close();
|
||||
});
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<redaction-dictionary-manager
|
||||
[canEdit]="canEdit"
|
||||
[initialEntries]="projectWrapper.type?.entries || []"
|
||||
[initialEntries]="dossierWrapper.type?.entries || []"
|
||||
[withFloatingActions]="false"
|
||||
></redaction-dictionary-manager>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
||||
import { AppStateService } from '../../../../../state/app-state.service';
|
||||
import { ProjectWrapper } from '../../../../../state/model/project.wrapper';
|
||||
import { EditProjectSectionInterface } from '../edit-project-section.interface';
|
||||
import { DossierWrapper } from '../../../../../state/model/dossier.wrapper';
|
||||
import { EditDossierSectionInterface } from '../edit-dossier-section.interface';
|
||||
import { DictionarySaveService } from '../../../../shared/services/dictionary-save.service';
|
||||
import { DictionaryManagerComponent } from '../../../../shared/components/dictionary-manager/dictionary-manager.component';
|
||||
import { PermissionsService } from '../../../../../services/permissions.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-edit-project-dictionary',
|
||||
templateUrl: './edit-project-dictionary.component.html',
|
||||
styleUrls: ['./edit-project-dictionary.component.scss']
|
||||
selector: 'redaction-edit-dossier-dictionary',
|
||||
templateUrl: './edit-dossier-dictionary.component.html',
|
||||
styleUrls: ['./edit-dossier-dictionary.component.scss']
|
||||
})
|
||||
export class EditProjectDictionaryComponent implements EditProjectSectionInterface {
|
||||
@Input() projectWrapper: ProjectWrapper;
|
||||
@Output() updateProject = new EventEmitter<any>();
|
||||
export class EditDossierDictionaryComponent implements EditDossierSectionInterface {
|
||||
@Input() dossierWrapper: DossierWrapper;
|
||||
@Output() updateDossier = new EventEmitter<any>();
|
||||
canEdit = false;
|
||||
@ViewChild(DictionaryManagerComponent, { static: false })
|
||||
private _dictionaryManager: DictionaryManagerComponent;
|
||||
@ -24,7 +24,7 @@ export class EditProjectDictionaryComponent implements EditProjectSectionInterfa
|
||||
private readonly _permissionsService: PermissionsService
|
||||
) {
|
||||
this.canEdit =
|
||||
this._permissionsService.isProjectMember(this.projectWrapper) ||
|
||||
this._permissionsService.isDossierMember(this.dossierWrapper) ||
|
||||
this._permissionsService.isAdmin();
|
||||
}
|
||||
|
||||
@ -41,17 +41,17 @@ export class EditProjectDictionaryComponent implements EditProjectSectionInterfa
|
||||
.saveEntries(
|
||||
this._dictionaryManager.currentEntries,
|
||||
this._dictionaryManager.initialEntries,
|
||||
this.projectWrapper.ruleSetId,
|
||||
this.dossierWrapper.dossierTemplateId,
|
||||
'dossier_redaction',
|
||||
this.projectWrapper.projectId,
|
||||
this.dossierWrapper.dossierId,
|
||||
false
|
||||
)
|
||||
.subscribe(async () => {
|
||||
this._appStateService.updateProjectDictionary(
|
||||
this.projectWrapper.ruleSetId,
|
||||
this.projectWrapper.projectId
|
||||
this._appStateService.updateDossierDictionary(
|
||||
this.dossierWrapper.dossierTemplateId,
|
||||
this.dossierWrapper.dossierId
|
||||
);
|
||||
this.updateProject.emit();
|
||||
this.updateDossier.emit();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<form [formGroup]="projectForm">
|
||||
<form [formGroup]="dossierForm">
|
||||
<redaction-select
|
||||
[label]="'report-type.label' | translate: { length: reportTypesLength }"
|
||||
[options]="reportTypesEnum"
|
||||
|
||||
@ -1,23 +1,23 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { AppStateService } from '../../../../../state/app-state.service';
|
||||
import { ProjectWrapper } from '../../../../../state/model/project.wrapper';
|
||||
import { EditProjectSectionInterface } from '../edit-project-section.interface';
|
||||
import { DossierWrapper } from '../../../../../state/model/dossier.wrapper';
|
||||
import { EditDossierSectionInterface } from '../edit-dossier-section.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-edit-project-download-package',
|
||||
templateUrl: './edit-project-download-package.component.html',
|
||||
styleUrls: ['./edit-project-download-package.component.scss']
|
||||
selector: 'redaction-edit-dossier-download-package',
|
||||
templateUrl: './edit-dossier-download-package.component.html',
|
||||
styleUrls: ['./edit-dossier-download-package.component.scss']
|
||||
})
|
||||
export class EditProjectDownloadPackageComponent implements OnInit, EditProjectSectionInterface {
|
||||
projectForm: FormGroup;
|
||||
export class EditDossierDownloadPackageComponent implements OnInit, EditDossierSectionInterface {
|
||||
dossierForm: FormGroup;
|
||||
downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED'];
|
||||
reportTypesEnum = Object.values(RuleSetModel.ReportTypesEnum);
|
||||
ruleSets: RuleSetModel[];
|
||||
reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum);
|
||||
dossierTemplates: DossierTemplateModel[];
|
||||
|
||||
@Input() projectWrapper: ProjectWrapper;
|
||||
@Output() updateProject = new EventEmitter<any>();
|
||||
@Input() dossierWrapper: DossierWrapper;
|
||||
@Output() updateDossier = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
@ -25,27 +25,27 @@ export class EditProjectDownloadPackageComponent implements OnInit, EditProjectS
|
||||
) {}
|
||||
|
||||
get reportTypesLength() {
|
||||
return this.projectForm.controls['reportTypes']?.value?.length
|
||||
? this.projectForm.controls['reportTypes'].value.length
|
||||
return this.dossierForm.controls['reportTypes']?.value?.length
|
||||
? this.dossierForm.controls['reportTypes'].value.length
|
||||
: 0;
|
||||
}
|
||||
|
||||
get downloadFileTypesLength() {
|
||||
return this.projectForm.controls['downloadFileTypes']?.value?.length
|
||||
? this.projectForm.controls['downloadFileTypes'].value.length
|
||||
return this.dossierForm.controls['downloadFileTypes']?.value?.length
|
||||
? this.dossierForm.controls['downloadFileTypes'].value.length
|
||||
: 0;
|
||||
}
|
||||
|
||||
get changed() {
|
||||
for (const key of Object.keys(this.projectForm.getRawValue())) {
|
||||
for (const key of Object.keys(this.dossierForm.getRawValue())) {
|
||||
if (
|
||||
this.projectWrapper.project[key].length !== this.projectForm.get(key).value.length
|
||||
this.dossierWrapper.dossier[key].length !== this.dossierForm.get(key).value.length
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const originalItems = [...this.projectWrapper.project[key]].sort();
|
||||
const newItems = [...this.projectForm.get(key).value].sort();
|
||||
const originalItems = [...this.dossierWrapper.dossier[key]].sort();
|
||||
const newItems = [...this.dossierForm.get(key).value].sort();
|
||||
|
||||
for (let idx = 0; idx < originalItems.length; ++idx) {
|
||||
if (originalItems[idx] !== newItems[idx]) {
|
||||
@ -58,30 +58,30 @@ export class EditProjectDownloadPackageComponent implements OnInit, EditProjectS
|
||||
}
|
||||
|
||||
get disabled() {
|
||||
return this.projectForm.invalid;
|
||||
return this.dossierForm.invalid;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.projectForm = this._formBuilder.group({
|
||||
reportTypes: [this.projectWrapper.project.reportTypes, Validators.required],
|
||||
downloadFileTypes: [this.projectWrapper.project.downloadFileTypes]
|
||||
this.dossierForm = this._formBuilder.group({
|
||||
reportTypes: [this.dossierWrapper.dossier.reportTypes, Validators.required],
|
||||
downloadFileTypes: [this.dossierWrapper.dossier.downloadFileTypes]
|
||||
});
|
||||
}
|
||||
|
||||
async save() {
|
||||
const project = {
|
||||
...this.projectWrapper.project,
|
||||
downloadFileTypes: this.projectForm.get('downloadFileTypes').value,
|
||||
reportTypes: this.projectForm.get('reportTypes').value
|
||||
const dossier = {
|
||||
...this.dossierWrapper.dossier,
|
||||
downloadFileTypes: this.dossierForm.get('downloadFileTypes').value,
|
||||
reportTypes: this.dossierForm.get('reportTypes').value
|
||||
};
|
||||
const updatedProject = await this._appStateService.addOrUpdateProject(project);
|
||||
this.updateProject.emit(updatedProject);
|
||||
const updatedDossier = await this._appStateService.addOrUpdateDossier(dossier);
|
||||
this.updateDossier.emit(updatedDossier);
|
||||
}
|
||||
|
||||
revert() {
|
||||
this.projectForm.reset({
|
||||
downloadFileTypes: this.projectWrapper.project.downloadFileTypes,
|
||||
reportTypes: this.projectWrapper.project.reportTypes
|
||||
this.dossierForm.reset({
|
||||
downloadFileTypes: this.dossierWrapper.dossier.downloadFileTypes,
|
||||
reportTypes: this.dossierWrapper.dossier.reportTypes
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<section class="dialog">
|
||||
<div class="dialog-header heading-l">
|
||||
{{ 'edit-project-dialog.header' | translate: { projectName: projectWrapper.name } }}
|
||||
{{ 'edit-dossier-dialog.header' | translate: { dossierName: dossierWrapper.name } }}
|
||||
</div>
|
||||
|
||||
<div class="dialog-content">
|
||||
@ -9,7 +9,7 @@
|
||||
(click)="changeTab(item.key)"
|
||||
*ngFor="let item of navItems"
|
||||
[class.active]="item.key === activeNav"
|
||||
[translate]="'edit-project-dialog.nav-items.' + item.key"
|
||||
[translate]="'edit-dossier-dialog.nav-items.' + item.key"
|
||||
class="item"
|
||||
></div>
|
||||
</redaction-side-nav>
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="content">
|
||||
<div class="heading">
|
||||
{{
|
||||
'edit-project-dialog.nav-items.' +
|
||||
'edit-dossier-dialog.nav-items.' +
|
||||
(activeNavItem.title || activeNavItem.key) | translate
|
||||
}}
|
||||
|
||||
@ -28,39 +28,39 @@
|
||||
<div>
|
||||
<mat-icon svgIcon="red:entries"></mat-icon>
|
||||
{{
|
||||
'edit-project-dialog.dictionary.entries'
|
||||
'edit-dossier-dialog.dictionary.entries'
|
||||
| translate
|
||||
: { length: (projectWrapper.type?.entries || []).length }
|
||||
: { length: (dossierWrapper.type?.entries || []).length }
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<redaction-edit-project-general-info
|
||||
(updateProject)="updatedProject($event)"
|
||||
<redaction-edit-dossier-general-info
|
||||
(updateDossier)="updatedDossier($event)"
|
||||
*ngIf="activeNav === 'dossier-info'"
|
||||
[projectWrapper]="projectWrapper"
|
||||
></redaction-edit-project-general-info>
|
||||
[dossierWrapper]="dossierWrapper"
|
||||
></redaction-edit-dossier-general-info>
|
||||
|
||||
<redaction-edit-project-download-package
|
||||
(updateProject)="updatedProject($event)"
|
||||
<redaction-edit-dossier-download-package
|
||||
(updateDossier)="updatedDossier($event)"
|
||||
*ngIf="activeNav === 'download-package'"
|
||||
[projectWrapper]="projectWrapper"
|
||||
></redaction-edit-project-download-package>
|
||||
[dossierWrapper]="dossierWrapper"
|
||||
></redaction-edit-dossier-download-package>
|
||||
|
||||
<redaction-edit-project-dictionary
|
||||
(updateProject)="updatedProject($event)"
|
||||
<redaction-edit-dossier-dictionary
|
||||
(updateDossier)="updatedDossier($event)"
|
||||
*ngIf="activeNav === 'dossier-dictionary'"
|
||||
[projectWrapper]="projectWrapper"
|
||||
[dossierWrapper]="dossierWrapper"
|
||||
>
|
||||
</redaction-edit-project-dictionary>
|
||||
</redaction-edit-dossier-dictionary>
|
||||
|
||||
<redaction-edit-project-team-members
|
||||
(updateProject)="updatedProject($event)"
|
||||
<redaction-edit-dossier-team-members
|
||||
(updateDossier)="updatedDossier($event)"
|
||||
*ngIf="activeNav === 'members'"
|
||||
[projectWrapper]="projectWrapper"
|
||||
[dossierWrapper]="dossierWrapper"
|
||||
>
|
||||
</redaction-edit-project-team-members>
|
||||
</redaction-edit-dossier-team-members>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
@ -70,13 +70,13 @@
|
||||
color="primary"
|
||||
mat-flat-button
|
||||
>
|
||||
{{ 'edit-project-dialog.actions.save' | translate }}
|
||||
{{ 'edit-dossier-dialog.actions.save' | translate }}
|
||||
</button>
|
||||
|
||||
<div
|
||||
(click)="revert()"
|
||||
class="all-caps-label cancel"
|
||||
translate="edit-project-dialog.actions.revert"
|
||||
translate="edit-dossier-dialog.actions.revert"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
redaction-edit-project-dictionary {
|
||||
redaction-edit-dossier-dictionary {
|
||||
display: block;
|
||||
height: calc(100% - 74px);
|
||||
}
|
||||
|
||||
@ -2,39 +2,39 @@ import { ChangeDetectorRef, Component, Inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { ProjectWrapper } from '../../../../state/model/project.wrapper';
|
||||
import { EditProjectGeneralInfoComponent } from './general-info/edit-project-general-info.component';
|
||||
import { EditProjectDownloadPackageComponent } from './download-package/edit-project-download-package.component';
|
||||
import { EditProjectSectionInterface } from './edit-project-section.interface';
|
||||
import { DossierWrapper } from '../../../../state/model/dossier.wrapper';
|
||||
import { EditDossierGeneralInfoComponent } from './general-info/edit-dossier-general-info.component';
|
||||
import { EditDossierDownloadPackageComponent } from './download-package/edit-dossier-download-package.component';
|
||||
import { EditDossierSectionInterface } from './edit-dossier-section.interface';
|
||||
import { NotificationService, NotificationType } from '../../../../services/notification.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { EditProjectDictionaryComponent } from './dictionary/edit-project-dictionary.component';
|
||||
import { EditProjectTeamMembersComponent } from './team-members/edit-project-team-members.component';
|
||||
import { EditDossierDictionaryComponent } from './dictionary/edit-dossier-dictionary.component';
|
||||
import { EditDossierTeamMembersComponent } from './team-members/edit-dossier-team-members.component';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-edit-project-dialog',
|
||||
templateUrl: './edit-project-dialog.component.html',
|
||||
styleUrls: ['./edit-project-dialog.component.scss']
|
||||
selector: 'redaction-edit-dossier-dialog',
|
||||
templateUrl: './edit-dossier-dialog.component.html',
|
||||
styleUrls: ['./edit-dossier-dialog.component.scss']
|
||||
})
|
||||
export class EditProjectDialogComponent {
|
||||
export class EditDossierDialogComponent {
|
||||
navItems: { key: string; title?: string }[] = [
|
||||
{ key: 'dossier-info', title: 'general-info' },
|
||||
{ key: 'download-package', title: 'choose-download' },
|
||||
{ key: 'dossier-dictionary', title: 'dossier-dictionary' },
|
||||
{ key: 'members', title: 'team-members' }
|
||||
// TODO:
|
||||
// { key: 'project-attributes' },
|
||||
// { key: 'dossier-attributes' },
|
||||
// { key: 'report-attributes' }
|
||||
];
|
||||
activeNav = 'dossier-info';
|
||||
projectWrapper: ProjectWrapper;
|
||||
dossierWrapper: DossierWrapper;
|
||||
|
||||
@ViewChild(EditProjectGeneralInfoComponent)
|
||||
generalInfoComponent: EditProjectGeneralInfoComponent;
|
||||
@ViewChild(EditProjectDownloadPackageComponent)
|
||||
downloadPackageComponent: EditProjectDownloadPackageComponent;
|
||||
@ViewChild(EditProjectDictionaryComponent) dictionaryComponent: EditProjectDictionaryComponent;
|
||||
@ViewChild(EditProjectTeamMembersComponent) membersComponent: EditProjectTeamMembersComponent;
|
||||
@ViewChild(EditDossierGeneralInfoComponent)
|
||||
generalInfoComponent: EditDossierGeneralInfoComponent;
|
||||
@ViewChild(EditDossierDownloadPackageComponent)
|
||||
downloadPackageComponent: EditDossierDownloadPackageComponent;
|
||||
@ViewChild(EditDossierDictionaryComponent) dictionaryComponent: EditDossierDictionaryComponent;
|
||||
@ViewChild(EditDossierTeamMembersComponent) membersComponent: EditDossierTeamMembersComponent;
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
@ -42,18 +42,18 @@ export class EditProjectDialogComponent {
|
||||
private readonly _notificationService: NotificationService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _changeRef: ChangeDetectorRef,
|
||||
public dialogRef: MatDialogRef<EditProjectDialogComponent>,
|
||||
public dialogRef: MatDialogRef<EditDossierDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: { projectWrapper: ProjectWrapper; afterSave: Function }
|
||||
public data: { dossierWrapper: DossierWrapper; afterSave: Function }
|
||||
) {
|
||||
this.projectWrapper = data.projectWrapper;
|
||||
this.dossierWrapper = data.dossierWrapper;
|
||||
}
|
||||
|
||||
get activeNavItem(): { key: string; title?: string } {
|
||||
return this.navItems.find((item) => item.key === this.activeNav);
|
||||
}
|
||||
|
||||
get activeComponent(): EditProjectSectionInterface {
|
||||
get activeComponent(): EditDossierSectionInterface {
|
||||
return {
|
||||
'dossier-info': this.generalInfoComponent,
|
||||
'download-package': this.downloadPackageComponent,
|
||||
@ -62,14 +62,14 @@ export class EditProjectDialogComponent {
|
||||
}[this.activeNav];
|
||||
}
|
||||
|
||||
updatedProject(updatedProject: ProjectWrapper) {
|
||||
updatedDossier(updatedDossier: DossierWrapper) {
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('edit-project-dialog.change-successful'),
|
||||
this._translateService.instant('edit-dossier-dialog.change-successful'),
|
||||
null,
|
||||
NotificationType.SUCCESS
|
||||
);
|
||||
if (updatedProject) {
|
||||
this.projectWrapper = updatedProject;
|
||||
if (updatedDossier) {
|
||||
this.dossierWrapper = updatedDossier;
|
||||
}
|
||||
this._changeRef.detectChanges();
|
||||
if (this.data.afterSave) {
|
||||
@ -88,7 +88,7 @@ export class EditProjectDialogComponent {
|
||||
changeTab(key: string) {
|
||||
if (this.activeComponent.changed) {
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('edit-project-dialog.unsaved-changes'),
|
||||
this._translateService.instant('edit-dossier-dialog.unsaved-changes'),
|
||||
null,
|
||||
NotificationType.ERROR
|
||||
);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export interface EditProjectSectionInterface {
|
||||
export interface EditDossierSectionInterface {
|
||||
changed: boolean;
|
||||
disabled: boolean;
|
||||
save: Function;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<form (submit)="save()" [formGroup]="projectForm">
|
||||
<form (submit)="save()" [formGroup]="dossierForm">
|
||||
<div class="red-input-group required w-300">
|
||||
<label translate="edit-project-dialog.general-info.form.name.label"></label>
|
||||
<label translate="edit-dossier-dialog.general-info.form.name.label"></label>
|
||||
<input
|
||||
[placeholder]="'edit-project-dialog.general-info.form.name.placeholder' | translate"
|
||||
formControlName="projectName"
|
||||
name="projectName"
|
||||
[placeholder]="'edit-dossier-dialog.general-info.form.name.placeholder' | translate"
|
||||
formControlName="dossierName"
|
||||
name="dossierName"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
@ -12,26 +12,30 @@
|
||||
<div class="red-input-group required w-400">
|
||||
<mat-form-field floatLabel="always">
|
||||
<mat-label>{{
|
||||
'edit-project-dialog.general-info.form.template' | translate
|
||||
'edit-dossier-dialog.general-info.form.template' | translate
|
||||
}}</mat-label>
|
||||
<mat-select formControlName="ruleSetId" style="width: 100%">
|
||||
<mat-select formControlName="dossierTemplateId" style="width: 100%">
|
||||
<mat-option
|
||||
*ngFor="let ruleSet of ruleSets"
|
||||
[matTooltip]="ruleSet.description ? ruleSet.description : ruleSet.name"
|
||||
[value]="ruleSet.ruleSetId"
|
||||
*ngFor="let dossierTemplate of dossierTemplates"
|
||||
[matTooltip]="
|
||||
dossierTemplate.description
|
||||
? dossierTemplate.description
|
||||
: dossierTemplate.name
|
||||
"
|
||||
[value]="dossierTemplate.dossierTemplateId"
|
||||
matTooltipPosition="after"
|
||||
>
|
||||
{{ ruleSet.name }}
|
||||
{{ dossierTemplate.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="red-input-group w-400">
|
||||
<label translate="edit-project-dialog.general-info.form.description.label"></label>
|
||||
<label translate="edit-dossier-dialog.general-info.form.description.label"></label>
|
||||
<textarea
|
||||
[placeholder]="
|
||||
'edit-project-dialog.general-info.form.description.placeholder' | translate
|
||||
'edit-dossier-dialog.general-info.form.description.placeholder' | translate
|
||||
"
|
||||
formControlName="description"
|
||||
name="description"
|
||||
@ -48,7 +52,7 @@
|
||||
class="filter-menu-checkbox"
|
||||
color="primary"
|
||||
>
|
||||
{{ 'edit-project-dialog.general-info.form.due-date' | translate }}
|
||||
{{ 'edit-dossier-dialog.general-info.form.due-date' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
<div *ngIf="hasDueDate" class="red-input-group datepicker-wrapper">
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { AppStateService } from '../../../../../state/app-state.service';
|
||||
import * as moment from 'moment';
|
||||
import { ProjectWrapper } from '../../../../../state/model/project.wrapper';
|
||||
import { EditProjectSectionInterface } from '../edit-project-section.interface';
|
||||
import { DossierWrapper } from '../../../../../state/model/dossier.wrapper';
|
||||
import { EditDossierSectionInterface } from '../edit-dossier-section.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-edit-project-general-info',
|
||||
templateUrl: './edit-project-general-info.component.html',
|
||||
styleUrls: ['./edit-project-general-info.component.scss']
|
||||
selector: 'redaction-edit-dossier-general-info',
|
||||
templateUrl: './edit-dossier-general-info.component.html',
|
||||
styleUrls: ['./edit-dossier-general-info.component.scss']
|
||||
})
|
||||
export class EditProjectGeneralInfoComponent implements OnInit, EditProjectSectionInterface {
|
||||
projectForm: FormGroup;
|
||||
export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSectionInterface {
|
||||
dossierForm: FormGroup;
|
||||
hasDueDate: boolean;
|
||||
reportTypesEnum = Object.values(RuleSetModel.ReportTypesEnum);
|
||||
ruleSets: RuleSetModel[];
|
||||
reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum);
|
||||
dossierTemplates: DossierTemplateModel[];
|
||||
|
||||
@Input() projectWrapper: ProjectWrapper;
|
||||
@Output() updateProject = new EventEmitter<any>();
|
||||
@Input() dossierWrapper: DossierWrapper;
|
||||
@Output() updateDossier = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
@ -26,20 +26,20 @@ export class EditProjectGeneralInfoComponent implements OnInit, EditProjectSecti
|
||||
) {}
|
||||
|
||||
get changed() {
|
||||
for (const key of Object.keys(this.projectForm.getRawValue())) {
|
||||
for (const key of Object.keys(this.dossierForm.getRawValue())) {
|
||||
if (key === 'dueDate') {
|
||||
if (this.hasDueDate !== !!this.projectWrapper.dueDate) {
|
||||
if (this.hasDueDate !== !!this.dossierWrapper.dueDate) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasDueDate &&
|
||||
!moment(this.projectWrapper.dueDate).isSame(
|
||||
moment(this.projectForm.get(key).value)
|
||||
!moment(this.dossierWrapper.dueDate).isSame(
|
||||
moment(this.dossierForm.get(key).value)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
} else if (this.projectWrapper[key] !== this.projectForm.get(key).value) {
|
||||
} else if (this.dossierWrapper[key] !== this.dossierForm.get(key).value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -48,54 +48,54 @@ export class EditProjectGeneralInfoComponent implements OnInit, EditProjectSecti
|
||||
}
|
||||
|
||||
get disabled() {
|
||||
if (this.hasDueDate && this.projectForm.get('dueDate').value === null) {
|
||||
if (this.hasDueDate && this.dossierForm.get('dueDate').value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.projectForm.invalid;
|
||||
return this.dossierForm.invalid;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._filterInvalidRuleSets();
|
||||
this.projectForm = this._formBuilder.group({
|
||||
projectName: [this.projectWrapper.projectName, Validators.required],
|
||||
ruleSetId: [
|
||||
this._filterInvalidDossierTemplates();
|
||||
this.dossierForm = this._formBuilder.group({
|
||||
dossierName: [this.dossierWrapper.dossierName, Validators.required],
|
||||
dossierTemplateId: [
|
||||
{
|
||||
value: this.projectWrapper.ruleSetId,
|
||||
disabled: this.projectWrapper.hasFiles
|
||||
value: this.dossierWrapper.dossierTemplateId,
|
||||
disabled: this.dossierWrapper.hasFiles
|
||||
},
|
||||
Validators.required
|
||||
],
|
||||
description: [this.projectWrapper.description],
|
||||
dueDate: [this.projectWrapper.dueDate]
|
||||
description: [this.dossierWrapper.description],
|
||||
dueDate: [this.dossierWrapper.dueDate]
|
||||
});
|
||||
this.hasDueDate = !!this.projectWrapper.dueDate;
|
||||
this.hasDueDate = !!this.dossierWrapper.dueDate;
|
||||
}
|
||||
|
||||
revert() {
|
||||
this.projectForm.reset({
|
||||
projectName: this.projectWrapper.projectName,
|
||||
ruleSetId: this.projectWrapper.ruleSetId,
|
||||
description: this.projectWrapper.description,
|
||||
dueDate: this.projectWrapper.dueDate
|
||||
this.dossierForm.reset({
|
||||
dossierName: this.dossierWrapper.dossierName,
|
||||
dossierTemplateId: this.dossierWrapper.dossierTemplateId,
|
||||
description: this.dossierWrapper.description,
|
||||
dueDate: this.dossierWrapper.dueDate
|
||||
});
|
||||
}
|
||||
|
||||
async save() {
|
||||
const project = {
|
||||
...this.projectWrapper.project,
|
||||
projectName: this.projectForm.get('projectName').value,
|
||||
description: this.projectForm.get('description').value,
|
||||
dueDate: this.hasDueDate ? this.projectForm.get('dueDate').value : undefined,
|
||||
ruleSetId: this.projectForm.get('ruleSetId').value
|
||||
const dossier = {
|
||||
...this.dossierWrapper.dossier,
|
||||
dossierName: this.dossierForm.get('dossierName').value,
|
||||
description: this.dossierForm.get('description').value,
|
||||
dueDate: this.hasDueDate ? this.dossierForm.get('dueDate').value : undefined,
|
||||
dossierTemplateId: this.dossierForm.get('dossierTemplateId').value
|
||||
};
|
||||
const updatedProject = await this._appStateService.addOrUpdateProject(project);
|
||||
this.updateProject.emit(updatedProject);
|
||||
const updatedDossier = await this._appStateService.addOrUpdateDossier(dossier);
|
||||
this.updateDossier.emit(updatedDossier);
|
||||
}
|
||||
|
||||
private _filterInvalidRuleSets() {
|
||||
this.ruleSets = this._appStateService.ruleSets.filter((r) => {
|
||||
if (this.projectWrapper?.ruleSetId === r.ruleSetId) {
|
||||
private _filterInvalidDossierTemplates() {
|
||||
this.dossierTemplates = this._appStateService.dossierTemplates.filter((r) => {
|
||||
if (this.dossierWrapper?.dossierTemplateId === r.dossierTemplateId) {
|
||||
return true;
|
||||
}
|
||||
const notYetValid = !!r.validFrom && moment(r.validFrom).isAfter(moment());
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<redaction-team-members-manager
|
||||
(save)="updatedProject($event)"
|
||||
[projectWrapper]="projectWrapper"
|
||||
(save)="updatedDossier($event)"
|
||||
[dossierWrapper]="dossierWrapper"
|
||||
></redaction-team-members-manager>
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
||||
import { AppStateService } from '../../../../../state/app-state.service';
|
||||
import { ProjectWrapper } from '../../../../../state/model/project.wrapper';
|
||||
import { EditProjectSectionInterface } from '../edit-project-section.interface';
|
||||
import { DossierWrapper } from '../../../../../state/model/dossier.wrapper';
|
||||
import { EditDossierSectionInterface } from '../edit-dossier-section.interface';
|
||||
import { PermissionsService } from '../../../../../services/permissions.service';
|
||||
import { TeamMembersManagerComponent } from '../../../components/team-members-manager/team-members-manager.component';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-edit-project-team-members',
|
||||
templateUrl: './edit-project-team-members.component.html',
|
||||
styleUrls: ['./edit-project-team-members.component.scss']
|
||||
selector: 'redaction-edit-dossier-team-members',
|
||||
templateUrl: './edit-dossier-team-members.component.html',
|
||||
styleUrls: ['./edit-dossier-team-members.component.scss']
|
||||
})
|
||||
export class EditProjectTeamMembersComponent implements EditProjectSectionInterface {
|
||||
@Input() projectWrapper: ProjectWrapper;
|
||||
@Output() updateProject = new EventEmitter<any>();
|
||||
export class EditDossierTeamMembersComponent implements EditDossierSectionInterface {
|
||||
@Input() dossierWrapper: DossierWrapper;
|
||||
@Output() updateDossier = new EventEmitter<any>();
|
||||
|
||||
@ViewChild(TeamMembersManagerComponent) managerComponent: TeamMembersManagerComponent;
|
||||
|
||||
@ -33,8 +33,8 @@ export class EditProjectTeamMembersComponent implements EditProjectSectionInterf
|
||||
await this.managerComponent.saveMembers();
|
||||
}
|
||||
|
||||
updatedProject($event) {
|
||||
this.updateProject.emit($event);
|
||||
updatedDossier($event) {
|
||||
this.updateDossier.emit($event);
|
||||
}
|
||||
|
||||
revert() {
|
||||
|
||||
@ -39,7 +39,7 @@ export class ForceRedactionDialogComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._appStateService.activeProject.ruleSetId)
|
||||
.getLegalBasisMapping(this._appStateService.activeDossier.dossierTemplateId)
|
||||
.subscribe((data) => {
|
||||
data.map((lbm) => {
|
||||
this.legalOptions.push({
|
||||
|
||||
@ -63,7 +63,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._appStateService.activeProject.ruleSetId)
|
||||
.getLegalBasisMapping(this._appStateService.activeDossier.dossierTemplateId)
|
||||
.subscribe((data) => {
|
||||
data.map((lbm) => {
|
||||
this.legalOptions.push({
|
||||
@ -91,7 +91,9 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
});
|
||||
|
||||
for (const key of Object.keys(
|
||||
this._appStateService.dictionaryData[this._appStateService.activeProject.ruleSetId]
|
||||
this._appStateService.dictionaryData[
|
||||
this._appStateService.activeDossier.dossierTemplateId
|
||||
]
|
||||
)) {
|
||||
const dictionaryData = this._appStateService.getDictionaryTypeValue(key);
|
||||
if (!dictionaryData.virtual && dictionaryData.addToDictionaryAction) {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<section class="dialog">
|
||||
<div [translate]="'assign-project-owner.dialog.title'" class="dialog-header heading-l"></div>
|
||||
<div [translate]="'assign-dossier-owner.dialog.title'" class="dialog-header heading-l"></div>
|
||||
|
||||
<div class="dialog-content no-padding-bottom">
|
||||
<redaction-team-members-manager
|
||||
(save)="save($event)"
|
||||
[projectWrapper]="data.projectWrapper"
|
||||
[dossierWrapper]="data.dossierWrapper"
|
||||
></redaction-team-members-manager>
|
||||
</div>
|
||||
<div class="dialog-actions">
|
||||
@ -14,11 +14,11 @@
|
||||
color="primary"
|
||||
mat-flat-button
|
||||
>
|
||||
{{ 'assign-project-owner.dialog.save' | translate }}
|
||||
{{ 'assign-dossier-owner.dialog.save' | translate }}
|
||||
</button>
|
||||
|
||||
<div
|
||||
[translate]="'assign-project-owner.dialog.cancel'"
|
||||
[translate]="'assign-dossier-owner.dialog.cancel'"
|
||||
class="all-caps-label pointer cancel"
|
||||
mat-dialog-close
|
||||
></div>
|
||||
|
||||
@ -2,11 +2,11 @@ import { Component, Inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { NotificationService } from '@services/notification.service';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { TeamMembersManagerComponent } from '../../components/team-members-manager/team-members-manager.component';
|
||||
|
||||
class DialogData {
|
||||
projectWrapper?: ProjectWrapper;
|
||||
dossierWrapper?: DossierWrapper;
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { ProjectListingScreenComponent } from './screens/project-listing-screen/project-listing-screen.component';
|
||||
import { DossierListingScreenComponent } from './screens/dossier-listing-screen/dossier-listing-screen.component';
|
||||
import { CompositeRouteGuard } from '@guards/composite-route.guard';
|
||||
import { AuthGuard } from '../auth/auth.guard';
|
||||
import { RedRoleGuard } from '../auth/red-role.guard';
|
||||
import { AppStateGuard } from '@state/app-state.guard';
|
||||
import { ProjectOverviewScreenComponent } from './screens/project-overview-screen/project-overview-screen.component';
|
||||
import { DossierOverviewScreenComponent } from './screens/dossier-overview-screen/dossier-overview-screen.component';
|
||||
import { FilePreviewScreenComponent } from './screens/file-preview-screen/file-preview-screen.component';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ProjectListingScreenComponent,
|
||||
component: DossierListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
@ -19,8 +19,8 @@ const routes = [
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':projectId',
|
||||
component: ProjectOverviewScreenComponent,
|
||||
path: ':dossierId',
|
||||
component: DossierOverviewScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
@ -28,7 +28,7 @@ const routes = [
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':projectId/file/:fileId',
|
||||
path: ':dossierId/file/:fileId',
|
||||
component: FilePreviewScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
@ -42,4 +42,4 @@ const routes = [
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class ProjectsRoutingModule {}
|
||||
export class DossiersRoutingModule {}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ProjectListingScreenComponent } from './screens/project-listing-screen/project-listing-screen.component';
|
||||
import { ProjectOverviewScreenComponent } from './screens/project-overview-screen/project-overview-screen.component';
|
||||
import { DossierListingScreenComponent } from './screens/dossier-listing-screen/dossier-listing-screen.component';
|
||||
import { DossierOverviewScreenComponent } from './screens/dossier-overview-screen/dossier-overview-screen.component';
|
||||
import { FilePreviewScreenComponent } from './screens/file-preview-screen/file-preview-screen.component';
|
||||
import { AddProjectDialogComponent } from './dialogs/add-project-dialog/add-project-dialog.component';
|
||||
import { AddDossierDialogComponent } from './dialogs/add-dossier-dialog/add-dossier-dialog.component';
|
||||
import { AssignReviewerApproverDialogComponent } from './dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component';
|
||||
import { ManualAnnotationDialogComponent } from './dialogs/manual-redaction-dialog/manual-annotation-dialog.component';
|
||||
import { ForceRedactionDialogComponent } from './dialogs/force-redaction-dialog/force-redaction-dialog.component';
|
||||
@ -11,23 +11,23 @@ import { RemoveAnnotationsDialogComponent } from './dialogs/remove-annotations-d
|
||||
import { DocumentInfoDialogComponent } from './dialogs/document-info-dialog/document-info-dialog.component';
|
||||
import { PdfViewerComponent } from './components/pdf-viewer/pdf-viewer.component';
|
||||
import { CommentsComponent } from './components/comments/comments.component';
|
||||
import { ProjectDetailsComponent } from './components/project-details/project-details.component';
|
||||
import { DossierDetailsComponent } from './components/dossier-details/dossier-details.component';
|
||||
import { PageIndicatorComponent } from './components/page-indicator/page-indicator.component';
|
||||
import { NeedsWorkBadgeComponent } from './components/needs-work-badge/needs-work-badge.component';
|
||||
import { AnnotationActionsComponent } from './components/annotation-actions/annotation-actions.component';
|
||||
import { ProjectListingDetailsComponent } from './components/project-listing-details/project-listing-details.component';
|
||||
import { DossierListingDetailsComponent } from './components/dossier-listing-details/dossier-listing-details.component';
|
||||
import { FileActionsComponent } from './components/file-actions/file-actions.component';
|
||||
import { TypeAnnotationIconComponent } from './components/type-annotation-icon/type-annotation-icon.component';
|
||||
import { TypeFilterComponent } from './components/type-filter/type-filter.component';
|
||||
import { ProjectOverviewBulkActionsComponent } from './components/bulk-actions/project-overview-bulk-actions.component';
|
||||
import { DossierOverviewBulkActionsComponent } from './components/bulk-actions/dossier-overview-bulk-actions.component';
|
||||
import { TeamMembersComponent } from './components/team-members/team-members.component';
|
||||
import { ProjectListingActionsComponent } from './components/project-listing-actions/project-listing-actions.component';
|
||||
import { DossierListingActionsComponent } from './components/dossier-listing-actions/dossier-listing-actions.component';
|
||||
import { DocumentInfoComponent } from './components/document-info/document-info.component';
|
||||
import { FileWorkloadComponent } from './components/file-workload/file-workload.component';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { ProjectsRoutingModule } from './projects-routing.module';
|
||||
import { DossiersRoutingModule } from './dossiers-routing.module';
|
||||
import { FileUploadDownloadModule } from '@upload-download/file-upload-download.module';
|
||||
import { ProjectsDialogService } from './services/projects-dialog.service';
|
||||
import { DossiersDialogService } from './services/dossiers-dialog.service';
|
||||
import { AnnotationActionsService } from './services/annotation-actions.service';
|
||||
import { FileActionService } from './services/file-action.service';
|
||||
import { PdfViewerDataService } from './services/pdf-viewer-data.service';
|
||||
@ -36,25 +36,25 @@ import { AnnotationDrawService } from './services/annotation-draw.service';
|
||||
import { AnnotationProcessingService } from './services/annotation-processing.service';
|
||||
import { AnnotationRemoveActionsComponent } from './components/annotation-remove-actions/annotation-remove-actions.component';
|
||||
import { DossierDictionaryDialogComponent } from './dialogs/dossier-dictionary-dialog/dossier-dictionary-dialog.component';
|
||||
import { EditProjectDialogComponent } from './dialogs/edit-project-dialog/edit-project-dialog.component';
|
||||
import { EditProjectGeneralInfoComponent } from './dialogs/edit-project-dialog/general-info/edit-project-general-info.component';
|
||||
import { EditProjectDownloadPackageComponent } from './dialogs/edit-project-dialog/download-package/edit-project-download-package.component';
|
||||
import { EditDossierDialogComponent } from './dialogs/edit-dossier-dialog/edit-dossier-dialog.component';
|
||||
import { EditDossierGeneralInfoComponent } from './dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component';
|
||||
import { EditDossierDownloadPackageComponent } from './dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component';
|
||||
import { UserPreferenceControllerService } from '@redaction/red-ui-http';
|
||||
import { EditProjectDictionaryComponent } from './dialogs/edit-project-dialog/dictionary/edit-project-dictionary.component';
|
||||
import { EditProjectTeamMembersComponent } from './dialogs/edit-project-dialog/team-members/edit-project-team-members.component';
|
||||
import { EditDossierDictionaryComponent } from './dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component';
|
||||
import { EditDossierTeamMembersComponent } from './dialogs/edit-dossier-dialog/team-members/edit-dossier-team-members.component';
|
||||
import { TeamMembersManagerComponent } from './components/team-members-manager/team-members-manager.component';
|
||||
import { TeamMembersDialogComponent } from './dialogs/team-members-dialog/team-members-dialog.component';
|
||||
import { ScrollButtonComponent } from './components/scroll-button/scroll-button.component';
|
||||
|
||||
const screens = [
|
||||
ProjectListingScreenComponent,
|
||||
ProjectOverviewScreenComponent,
|
||||
DossierListingScreenComponent,
|
||||
DossierOverviewScreenComponent,
|
||||
FilePreviewScreenComponent
|
||||
];
|
||||
|
||||
const dialogs = [
|
||||
AddProjectDialogComponent,
|
||||
EditProjectDialogComponent,
|
||||
AddDossierDialogComponent,
|
||||
EditDossierDialogComponent,
|
||||
TeamMembersDialogComponent,
|
||||
ManualAnnotationDialogComponent,
|
||||
ForceRedactionDialogComponent,
|
||||
@ -67,24 +67,24 @@ const dialogs = [
|
||||
const components = [
|
||||
PdfViewerComponent,
|
||||
CommentsComponent,
|
||||
ProjectDetailsComponent,
|
||||
DossierDetailsComponent,
|
||||
PageIndicatorComponent,
|
||||
NeedsWorkBadgeComponent,
|
||||
AnnotationActionsComponent,
|
||||
ProjectListingDetailsComponent,
|
||||
DossierListingDetailsComponent,
|
||||
TypeAnnotationIconComponent,
|
||||
TypeFilterComponent,
|
||||
ProjectOverviewBulkActionsComponent,
|
||||
DossierOverviewBulkActionsComponent,
|
||||
FileActionsComponent,
|
||||
TeamMembersComponent,
|
||||
ProjectListingActionsComponent,
|
||||
DossierListingActionsComponent,
|
||||
DocumentInfoComponent,
|
||||
FileWorkloadComponent,
|
||||
AnnotationRemoveActionsComponent,
|
||||
EditProjectGeneralInfoComponent,
|
||||
EditProjectDownloadPackageComponent,
|
||||
EditProjectDictionaryComponent,
|
||||
EditProjectTeamMembersComponent,
|
||||
EditDossierGeneralInfoComponent,
|
||||
EditDossierDownloadPackageComponent,
|
||||
EditDossierDictionaryComponent,
|
||||
EditDossierTeamMembersComponent,
|
||||
TeamMembersManagerComponent,
|
||||
ScrollButtonComponent,
|
||||
|
||||
@ -93,7 +93,7 @@ const components = [
|
||||
];
|
||||
|
||||
const services = [
|
||||
ProjectsDialogService,
|
||||
DossiersDialogService,
|
||||
FileActionService,
|
||||
AnnotationActionsService,
|
||||
ManualAnnotationService,
|
||||
@ -106,6 +106,6 @@ const services = [
|
||||
@NgModule({
|
||||
declarations: [...components],
|
||||
providers: [...services],
|
||||
imports: [CommonModule, SharedModule, FileUploadDownloadModule, ProjectsRoutingModule]
|
||||
imports: [CommonModule, SharedModule, FileUploadDownloadModule, DossiersRoutingModule]
|
||||
})
|
||||
export class ProjectsModule {}
|
||||
export class DossiersModule {}
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
!editingReviewer &&
|
||||
!appStateService.activeFile.currentReviewer &&
|
||||
permissionsService.canAssignUser() &&
|
||||
appStateService.activeProject.hasMoreThanOneReviewer
|
||||
appStateService.activeDossier.hasMoreThanOneReviewer
|
||||
"
|
||||
class="assign-reviewer pointer"
|
||||
translate="file-preview.assign-reviewer"
|
||||
@ -200,7 +200,7 @@
|
||||
<redaction-circle-button
|
||||
(action)="closeFullScreen()"
|
||||
*ngIf="!fullScreen"
|
||||
[routerLink]="['/main/projects/' + appStateService.activeProjectId]"
|
||||
[routerLink]="['/main/dossiers/' + appStateService.activeDossierId]"
|
||||
class="ml-8"
|
||||
icon="red:close"
|
||||
tooltip="common.close"
|
||||
|
||||
@ -39,7 +39,7 @@ import { PdfViewerDataService } from '../../services/pdf-viewer-data.service';
|
||||
import { download } from '@utils/file-download-utils';
|
||||
import { ViewMode } from '@models/file/view-mode';
|
||||
import { FileWorkloadComponent } from '../../components/file-workload/file-workload.component';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy';
|
||||
|
||||
const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f'];
|
||||
@ -86,7 +86,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
private readonly _userPreferenceControllerService: UserPreferenceControllerService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _activatedRoute: ActivatedRoute,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _router: Router,
|
||||
private readonly _notificationService: NotificationService,
|
||||
private readonly _annotationProcessingService: AnnotationProcessingService,
|
||||
@ -115,14 +115,14 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
|
||||
get singleUsersSelectOptions() {
|
||||
return this.appStateService.activeFile?.isUnderApproval
|
||||
? this.appStateService.activeProject.approverIds
|
||||
: this.appStateService.activeProject.memberIds;
|
||||
? this.appStateService.activeDossier.approverIds
|
||||
: this.appStateService.activeDossier.memberIds;
|
||||
}
|
||||
|
||||
get assignTooltip() {
|
||||
return this.appStateService.activeFile.isUnderApproval
|
||||
? 'project-overview.assign-approver'
|
||||
: 'project-overview.assign-reviewer';
|
||||
? 'dossier-overview.assign-approver'
|
||||
: 'dossier-overview.assign-reviewer';
|
||||
}
|
||||
|
||||
get annotations(): AnnotationWrapper[] {
|
||||
@ -165,8 +165,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
); // on less than 3 seconds show indeterminate
|
||||
}
|
||||
|
||||
get projectId() {
|
||||
return this.appStateService.activeProjectId;
|
||||
get dossierId() {
|
||||
return this.appStateService.activeDossierId;
|
||||
}
|
||||
|
||||
get fileId() {
|
||||
@ -230,7 +230,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
ngOnInit(): void {
|
||||
this.displayPDFViewer = true;
|
||||
|
||||
const key = 'Project-Recent-' + this.projectId;
|
||||
const key = 'Dossier-Recent-' + this.dossierId;
|
||||
this._userPreferenceControllerService
|
||||
.savePreferences([this.fileId], key)
|
||||
.toPromise()
|
||||
@ -261,7 +261,9 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
);
|
||||
const processStartTime = new Date().getTime();
|
||||
this.annotationData = this.fileData.getAnnotations(
|
||||
this.appStateService.dictionaryData[this.appStateService.activeProject.ruleSetId],
|
||||
this.appStateService.dictionaryData[
|
||||
this.appStateService.activeDossier.dossierTemplateId
|
||||
],
|
||||
this.permissionsService.currentUser,
|
||||
this.viewMode,
|
||||
this.userPreferenceService.areDevFeaturesEnabled
|
||||
@ -427,7 +429,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
|
||||
switch (action) {
|
||||
case 'delete':
|
||||
await this._router.navigate([`/main/projects/${this.projectId}`]);
|
||||
await this._router.navigate([`/main/dossiers/${this.dossierId}`]);
|
||||
return;
|
||||
|
||||
case 'enable-analysis':
|
||||
@ -437,7 +439,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
this.loadingMessage = 'file-preview.reanalyse-file';
|
||||
await this._loadFileData().toPromise();
|
||||
this._updateCanPerformActions();
|
||||
await this.appStateService.reloadActiveProjectFiles();
|
||||
await this.appStateService.reloadActiveDossierFiles();
|
||||
return;
|
||||
|
||||
case 'view-document-info':
|
||||
@ -462,7 +464,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
|
||||
this._statusControllerService
|
||||
.setFileReviewer(
|
||||
this.fileData.fileStatus.projectId,
|
||||
this.fileData.fileStatus.dossierId,
|
||||
this.fileData.fileStatus.fileId,
|
||||
reviewerId
|
||||
)
|
||||
@ -499,7 +501,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
downloadOriginalFile() {
|
||||
this._fileManagementControllerService
|
||||
.downloadOriginalFile(
|
||||
this.projectId,
|
||||
this.dossierId,
|
||||
this.fileId,
|
||||
true,
|
||||
this.fileData.fileStatus.lastUploaded,
|
||||
@ -522,11 +524,11 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
|
||||
// <!-- Dev Mode Features-->
|
||||
async openSSRFilePreview() {
|
||||
window.open(`/pdf-preview/${this.projectId}/${this.fileId}`, '_blank');
|
||||
window.open(`/pdf-preview/${this.dossierId}/${this.fileId}`, '_blank');
|
||||
}
|
||||
|
||||
async openHTMLDebug() {
|
||||
window.open(`/html-debug/${this.projectId}/${this.fileId}`, '_blank');
|
||||
window.open(`/html-debug/${this.dossierId}/${this.fileId}`, '_blank');
|
||||
}
|
||||
|
||||
private _subscribeToFileUpdates(): void {
|
||||
@ -579,7 +581,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
} else {
|
||||
if (fileDataModel.fileStatus.isError) {
|
||||
this._router.navigate([
|
||||
'/main/projects/' + this.appStateService.activeProjectId
|
||||
'/main/dossiers/' + this.appStateService.activeDossierId
|
||||
]);
|
||||
} else {
|
||||
this.loadingMessage = 'file-preview.reanalyse-file';
|
||||
|
||||
@ -25,16 +25,16 @@
|
||||
[primaryFilters]="needsWorkFilters"
|
||||
></redaction-filter>
|
||||
<redaction-filter
|
||||
#ruleSetFilter
|
||||
#dossierTemplateFilter
|
||||
(filtersChanged)="filtersChanged()"
|
||||
*ngIf="ruleSetFilters.length > 1"
|
||||
[filterLabel]="'filters.rulesets'"
|
||||
*ngIf="dossierTemplateFilters.length > 1"
|
||||
[filterLabel]="'filters.dossier-templates'"
|
||||
[icon]="'red:template'"
|
||||
[primaryFilters]="ruleSetFilters"
|
||||
[primaryFilters]="dossierTemplateFilters"
|
||||
></redaction-filter>
|
||||
<redaction-search-input
|
||||
[form]="searchForm"
|
||||
[placeholder]="'project-listing.search'"
|
||||
[placeholder]="'dossier-listing.search'"
|
||||
></redaction-search-input>
|
||||
<div
|
||||
(click)="resetFilters()"
|
||||
@ -44,10 +44,10 @@
|
||||
></div>
|
||||
</div>
|
||||
<redaction-icon-button
|
||||
(action)="openAddProjectDialog()"
|
||||
(action)="openAddDossierDialog()"
|
||||
*ngIf="permissionsService.isManager()"
|
||||
icon="red:plus"
|
||||
text="project-listing.add-new"
|
||||
text="dossier-listing.add-new"
|
||||
type="primary"
|
||||
></redaction-icon-button>
|
||||
</div>
|
||||
@ -59,7 +59,7 @@
|
||||
<div class="header-item">
|
||||
<span class="all-caps-label">
|
||||
{{
|
||||
'project-listing.table-header.title'
|
||||
'dossier-listing.table-header.title'
|
||||
| translate: { length: displayedEntities.length || 0 }
|
||||
}}
|
||||
</span>
|
||||
@ -70,37 +70,37 @@
|
||||
(toggleSort)="toggleSort($event)"
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="project.projectName"
|
||||
label="project-listing.table-col-names.name"
|
||||
column="dossier.dossierName"
|
||||
label="dossier-listing.table-col-names.name"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
label="project-listing.table-col-names.needs-work"
|
||||
label="dossier-listing.table-col-names.needs-work"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
class="user-column"
|
||||
label="project-listing.table-col-names.owner"
|
||||
label="dossier-listing.table-col-names.owner"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
class="flex-end"
|
||||
label="project-listing.table-col-names.status"
|
||||
label="dossier-listing.table-col-names.status"
|
||||
></redaction-table-col-name>
|
||||
<div class="scrollbar-placeholder"></div>
|
||||
</div>
|
||||
|
||||
<redaction-empty-state
|
||||
(action)="openAddProjectDialog()"
|
||||
(action)="openAddDossierDialog()"
|
||||
*ngIf="!allEntities.length"
|
||||
[showButton]="permissionsService.isManager()"
|
||||
icon="red:folder"
|
||||
screen="project-listing"
|
||||
screen="dossier-listing"
|
||||
></redaction-empty-state>
|
||||
|
||||
<redaction-empty-state
|
||||
*ngIf="allEntities.length && !displayedEntities.length"
|
||||
screen="project-listing"
|
||||
screen="dossier-listing"
|
||||
type="no-match"
|
||||
></redaction-empty-state>
|
||||
|
||||
@ -110,20 +110,20 @@
|
||||
let pw of displayedEntities
|
||||
| sortBy: sortingOption.order:sortingOption.column
|
||||
"
|
||||
[class.pointer]="canOpenProject(pw)"
|
||||
[class.pointer]="canOpenDossier(pw)"
|
||||
[routerLink]="[
|
||||
canOpenProject(pw) ? '/main/projects/' + pw.project.projectId : []
|
||||
canOpenDossier(pw) ? '/main/dossiers/' + pw.dossier.dossierId : []
|
||||
]"
|
||||
class="table-item"
|
||||
>
|
||||
<div class="filename">
|
||||
<div class="table-item-title heading">
|
||||
{{ pw.project.projectName }}
|
||||
{{ pw.dossier.dossierName }}
|
||||
</div>
|
||||
<div class="small-label stats-subtitle">
|
||||
<div>
|
||||
<mat-icon svgIcon="red:template"></mat-icon>
|
||||
{{ getRuleSet(pw).name }}
|
||||
{{ getDossierTemplate(pw).name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="small-label stats-subtitle">
|
||||
@ -141,11 +141,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:calendar"></mat-icon>
|
||||
{{ pw.project.date | date: 'mediumDate' }}
|
||||
{{ pw.dossier.date | date: 'mediumDate' }}
|
||||
</div>
|
||||
<div *ngIf="pw.project.dueDate">
|
||||
<div *ngIf="pw.dossier.dueDate">
|
||||
<mat-icon svgIcon="red:lightning"></mat-icon>
|
||||
{{ pw.project.dueDate | date: 'mediumDate' }}
|
||||
{{ pw.dossier.dueDate | date: 'mediumDate' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -156,15 +156,15 @@
|
||||
</div>
|
||||
<div class="user-column">
|
||||
<redaction-initials-avatar
|
||||
[userId]="pw.project.ownerId"
|
||||
[userId]="pw.dossier.ownerId"
|
||||
[withName]="true"
|
||||
></redaction-initials-avatar>
|
||||
</div>
|
||||
<div class="status-container">
|
||||
<redaction-project-listing-actions
|
||||
<redaction-dossier-listing-actions
|
||||
(actionPerformed)="actionPerformed()"
|
||||
[project]="pw"
|
||||
></redaction-project-listing-actions>
|
||||
[dossier]="pw"
|
||||
></redaction-dossier-listing-actions>
|
||||
</div>
|
||||
<div class="scrollbar-placeholder"></div>
|
||||
</div>
|
||||
@ -178,13 +178,13 @@
|
||||
</div>
|
||||
|
||||
<div class="right-container" redactionHasScrollbar>
|
||||
<redaction-project-listing-details
|
||||
<redaction-dossier-listing-details
|
||||
(filtersChanged)="filtersChanged($event)"
|
||||
*ngIf="allEntities.length"
|
||||
[documentsChartData]="documentsChartData"
|
||||
[filters]="detailsContainerFilters"
|
||||
[projectsChartData]="projectsChartData"
|
||||
></redaction-project-listing-details>
|
||||
[dossiersChartData]="dossiersChartData"
|
||||
></redaction-dossier-listing-details>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
redaction-project-listing-details {
|
||||
redaction-dossier-listing-details {
|
||||
min-width: 466px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, Injector, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { Project, RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { Dossier, DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
@ -8,13 +8,13 @@ import { FilterModel } from '@shared/components/filter/model/filter.model';
|
||||
import {
|
||||
annotationFilterChecker,
|
||||
processFilters,
|
||||
projectMemberChecker,
|
||||
projectStatusChecker,
|
||||
ruleSetChecker
|
||||
dossierMemberChecker,
|
||||
dossierStatusChecker,
|
||||
dossierTemplateChecker
|
||||
} from '@shared/components/filter/utils/filter-utils';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { Subscription, timer } from 'rxjs';
|
||||
import { filter, tap } from 'rxjs/operators';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
@ -22,26 +22,26 @@ import { RedactionFilterSorter } from '@utils/sorters/redaction-filter-sorter';
|
||||
import { StatusSorter } from '@utils/sorters/status-sorter';
|
||||
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
|
||||
import { FilterComponent } from '@shared/components/filter/filter.component';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
||||
import { BaseListingComponent } from '@shared/base/base-listing.component';
|
||||
import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-listing-screen',
|
||||
templateUrl: './project-listing-screen.component.html',
|
||||
styleUrls: ['./project-listing-screen.component.scss']
|
||||
selector: 'redaction-dossier-listing-screen',
|
||||
templateUrl: './dossier-listing-screen.component.html',
|
||||
styleUrls: ['./dossier-listing-screen.component.scss']
|
||||
})
|
||||
export class ProjectListingScreenComponent
|
||||
extends BaseListingComponent<ProjectWrapper>
|
||||
export class DossierListingScreenComponent
|
||||
extends BaseListingComponent<DossierWrapper>
|
||||
implements OnInit, OnDestroy, OnAttach, OnDetach
|
||||
{
|
||||
projectsChartData: DoughnutChartConfig[] = [];
|
||||
dossiersChartData: DoughnutChartConfig[] = [];
|
||||
documentsChartData: DoughnutChartConfig[] = [];
|
||||
statusFilters: FilterModel[];
|
||||
peopleFilters: FilterModel[];
|
||||
needsWorkFilters: FilterModel[];
|
||||
ruleSetFilters: FilterModel[];
|
||||
dossierTemplateFilters: FilterModel[];
|
||||
detailsContainerFilters: {
|
||||
statusFilters: FilterModel[];
|
||||
} = {
|
||||
@ -49,8 +49,8 @@ export class ProjectListingScreenComponent
|
||||
};
|
||||
readonly itemSize = 85;
|
||||
protected readonly _searchKey = 'name';
|
||||
protected readonly _sortKey = 'project-listing';
|
||||
private _projectAutoUpdateTimer: Subscription;
|
||||
protected readonly _sortKey = 'dossier-listing';
|
||||
private _dossierAutoUpdateTimer: Subscription;
|
||||
private _lastScrollPosition: number;
|
||||
|
||||
@ViewChild(CdkVirtualScrollViewport) scrollBar: CdkVirtualScrollViewport;
|
||||
@ -58,7 +58,7 @@ export class ProjectListingScreenComponent
|
||||
@ViewChild('statusFilter') private _statusFilterComponent: FilterComponent;
|
||||
@ViewChild('peopleFilter') private _peopleFilterComponent: FilterComponent;
|
||||
@ViewChild('needsWorkFilter') private _needsWorkFilterComponent: FilterComponent;
|
||||
@ViewChild('ruleSetFilter') private _ruleSetFilterComponent: FilterComponent;
|
||||
@ViewChild('dossierTemplateFilter') private _dossierTemplateFilterComponent: FilterComponent;
|
||||
|
||||
private _routerEventsScrollPositionSub: Subscription;
|
||||
private _fileChangedSub: Subscription;
|
||||
@ -67,7 +67,7 @@ export class ProjectListingScreenComponent
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _translateChartService: TranslateChartService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _router: Router,
|
||||
private readonly _appStateService: AppStateService,
|
||||
@ -86,13 +86,13 @@ export class ProjectListingScreenComponent
|
||||
return this._userService.user;
|
||||
}
|
||||
|
||||
get activeProjectsCount() {
|
||||
return this.allEntities.filter((p) => p.project.status === Project.StatusEnum.ACTIVE)
|
||||
get activeDossiersCount() {
|
||||
return this.allEntities.filter((p) => p.dossier.status === Dossier.StatusEnum.ACTIVE)
|
||||
.length;
|
||||
}
|
||||
|
||||
get inactiveProjectsCount() {
|
||||
return this.allEntities.length - this.activeProjectsCount;
|
||||
get inactiveDossiersCount() {
|
||||
return this.allEntities.length - this.activeDossiersCount;
|
||||
}
|
||||
|
||||
protected get _filterComponents(): FilterComponent[] {
|
||||
@ -100,7 +100,7 @@ export class ProjectListingScreenComponent
|
||||
this._statusFilterComponent,
|
||||
this._peopleFilterComponent,
|
||||
this._needsWorkFilterComponent,
|
||||
this._ruleSetFilterComponent
|
||||
this._dossierTemplateFilterComponent
|
||||
];
|
||||
}
|
||||
|
||||
@ -111,25 +111,25 @@ export class ProjectListingScreenComponent
|
||||
checkerArgs?: any;
|
||||
}[] {
|
||||
return [
|
||||
{ values: this.statusFilters, checker: projectStatusChecker },
|
||||
{ values: this.peopleFilters, checker: projectMemberChecker },
|
||||
{ values: this.statusFilters, checker: dossierStatusChecker },
|
||||
{ values: this.peopleFilters, checker: dossierMemberChecker },
|
||||
{
|
||||
values: this.needsWorkFilters,
|
||||
checker: annotationFilterChecker,
|
||||
matchAll: true,
|
||||
checkerArgs: this.permissionsService
|
||||
},
|
||||
{ values: this.ruleSetFilters, checker: ruleSetChecker }
|
||||
{ values: this.dossierTemplateFilters, checker: dossierTemplateChecker }
|
||||
];
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._calculateData();
|
||||
|
||||
this._projectAutoUpdateTimer = timer(0, 10000)
|
||||
this._dossierAutoUpdateTimer = timer(0, 10000)
|
||||
.pipe(
|
||||
tap(async () => {
|
||||
await this._appStateService.loadAllProjects();
|
||||
await this._appStateService.loadAllDossiers();
|
||||
this._loadEntitiesFromState();
|
||||
})
|
||||
)
|
||||
@ -146,7 +146,7 @@ export class ProjectListingScreenComponent
|
||||
)
|
||||
)
|
||||
.subscribe((event) => {
|
||||
if (event instanceof NavigationStart && event.url !== '/main/projects') {
|
||||
if (event instanceof NavigationStart && event.url !== '/main/dossiers') {
|
||||
this._lastScrollPosition = this.scrollBar.measureScrollOffset('top');
|
||||
}
|
||||
});
|
||||
@ -164,39 +164,39 @@ export class ProjectListingScreenComponent
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this._projectAutoUpdateTimer.unsubscribe();
|
||||
this._dossierAutoUpdateTimer.unsubscribe();
|
||||
this._routerEventsScrollPositionSub.unsubscribe();
|
||||
this._fileChangedSub.unsubscribe();
|
||||
}
|
||||
|
||||
documentCount(project: ProjectWrapper) {
|
||||
return project.files.length;
|
||||
documentCount(dossier: DossierWrapper) {
|
||||
return dossier.files.length;
|
||||
}
|
||||
|
||||
userCount(project: ProjectWrapper) {
|
||||
return project.numberOfMembers;
|
||||
userCount(dossier: DossierWrapper) {
|
||||
return dossier.numberOfMembers;
|
||||
}
|
||||
|
||||
canOpenProject(pw: ProjectWrapper): boolean {
|
||||
canOpenDossier(pw: DossierWrapper): boolean {
|
||||
return !!pw;
|
||||
}
|
||||
|
||||
getRuleSet(pw: ProjectWrapper): RuleSetModel {
|
||||
return this._appStateService.getRuleSetById(pw.project.ruleSetId);
|
||||
getDossierTemplate(pw: DossierWrapper): DossierTemplateModel {
|
||||
return this._appStateService.getDossierTemplateById(pw.dossier.dossierTemplateId);
|
||||
}
|
||||
|
||||
openAddProjectDialog(): void {
|
||||
this._dialogService.openAddProjectDialog((addResponse) => {
|
||||
openAddDossierDialog(): void {
|
||||
this._dialogService.openAddDossierDialog((addResponse) => {
|
||||
this._calculateData();
|
||||
this._router.navigate([`/main/projects/${addResponse.project.projectId}`]);
|
||||
this._router.navigate([`/main/dossiers/${addResponse.dossier.dossierId}`]);
|
||||
if (addResponse.addMembers) {
|
||||
this.openAssignProjectOwnerDialog(null, addResponse.project);
|
||||
this.openAssignDossierOwnerDialog(null, addResponse.dossier);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openAssignProjectOwnerDialog($event: MouseEvent, project: ProjectWrapper) {
|
||||
this._dialogService.openAssignTeamMembersDialog($event, project);
|
||||
openAssignDossierOwnerDialog($event: MouseEvent, dossier: DossierWrapper) {
|
||||
this._dialogService.openAssignTeamMembersDialog($event, dossier);
|
||||
}
|
||||
|
||||
actionPerformed() {
|
||||
@ -210,15 +210,15 @@ export class ProjectListingScreenComponent
|
||||
}
|
||||
|
||||
private _loadEntitiesFromState() {
|
||||
this.allEntities = this._appStateService.allProjects;
|
||||
this.allEntities = this._appStateService.allDossiers;
|
||||
}
|
||||
|
||||
private _calculateData() {
|
||||
this._computeAllFilters();
|
||||
this._filterEntities();
|
||||
this.projectsChartData = [
|
||||
{ value: this.activeProjectsCount, color: 'ACTIVE', label: 'active' },
|
||||
{ value: this.inactiveProjectsCount, color: 'DELETED', label: 'archived' }
|
||||
this.dossiersChartData = [
|
||||
{ value: this.activeDossiersCount, color: 'ACTIVE', label: 'active' },
|
||||
{ value: this.inactiveDossiersCount, color: 'DELETED', label: 'archived' }
|
||||
];
|
||||
const groups = groupBy(this._appStateService.aggregatedFiles, 'status');
|
||||
this.documentsChartData = [];
|
||||
@ -240,10 +240,10 @@ export class ProjectListingScreenComponent
|
||||
const allDistinctFileStatus = new Set<string>();
|
||||
const allDistinctPeople = new Set<string>();
|
||||
const allDistinctNeedsWork = new Set<string>();
|
||||
const allDistinctRuleSets = new Set<string>();
|
||||
const allDistinctDossierTemplates = new Set<string>();
|
||||
this.allEntities.forEach((entry) => {
|
||||
// all people
|
||||
entry.project.memberIds.forEach((memberId) => allDistinctPeople.add(memberId));
|
||||
entry.dossier.memberIds.forEach((memberId) => allDistinctPeople.add(memberId));
|
||||
// file statuses
|
||||
entry.files.forEach((file) => {
|
||||
allDistinctFileStatus.add(file.status);
|
||||
@ -260,7 +260,7 @@ export class ProjectListingScreenComponent
|
||||
});
|
||||
|
||||
// Rule set
|
||||
allDistinctRuleSets.add(entry.ruleSetId);
|
||||
allDistinctDossierTemplates.add(entry.dossierTemplateId);
|
||||
});
|
||||
|
||||
const statusFilters = [];
|
||||
@ -295,13 +295,16 @@ export class ProjectListingScreenComponent
|
||||
);
|
||||
this.needsWorkFilters = processFilters(this.needsWorkFilters, needsWorkFilters);
|
||||
|
||||
const ruleSetFilters = [];
|
||||
allDistinctRuleSets.forEach((ruleSetId) => {
|
||||
ruleSetFilters.push({
|
||||
key: ruleSetId,
|
||||
label: this._appStateService.getRuleSetById(ruleSetId).name
|
||||
const dossierTemplateFilters = [];
|
||||
allDistinctDossierTemplates.forEach((dossierTemplateId) => {
|
||||
dossierTemplateFilters.push({
|
||||
key: dossierTemplateId,
|
||||
label: this._appStateService.getDossierTemplateById(dossierTemplateId).name
|
||||
});
|
||||
});
|
||||
this.ruleSetFilters = processFilters(this.ruleSetFilters, ruleSetFilters);
|
||||
this.dossierTemplateFilters = processFilters(
|
||||
this.dossierTemplateFilters,
|
||||
dossierTemplateFilters
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<section *ngIf="!!activeProject">
|
||||
<section *ngIf="!!activeDossier">
|
||||
<div class="page-header">
|
||||
<div class="filters">
|
||||
<div translate="filters.filter-by"></div>
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
<redaction-search-input
|
||||
[form]="searchForm"
|
||||
[placeholder]="'project-overview.search'"
|
||||
[placeholder]="'dossier-overview.search'"
|
||||
></redaction-search-input>
|
||||
|
||||
<div
|
||||
@ -40,31 +40,31 @@
|
||||
|
||||
<div class="actions">
|
||||
<redaction-circle-button
|
||||
(action)="openEditProjectDialog($event)"
|
||||
(action)="openEditDossierDialog($event)"
|
||||
*ngIf="permissionsService.isManager()"
|
||||
icon="red:edit"
|
||||
tooltip="project-overview.header-actions.edit"
|
||||
tooltip="dossier-overview.header-actions.edit"
|
||||
tooltipPosition="below"
|
||||
></redaction-circle-button>
|
||||
<!-- Commented because users miss-click this shit !-->
|
||||
<!-- <redaction-circle-button-->
|
||||
<!-- (action)="openDeleteProjectDialog($event)"-->
|
||||
<!-- *ngIf="permissionsService.canDeleteProject()"-->
|
||||
<!-- (action)="openDeleteDossierDialog($event)"-->
|
||||
<!-- *ngIf="permissionsService.canDeleteDossier()"-->
|
||||
<!-- icon="red:trash"-->
|
||||
<!-- tooltip="project-overview.header-actions.delete"-->
|
||||
<!-- tooltip="dossier-overview.header-actions.delete"-->
|
||||
<!-- tooltipPosition="below"-->
|
||||
<!-- ></redaction-circle-button>-->
|
||||
|
||||
<redaction-file-download-btn
|
||||
[file]="allEntities"
|
||||
[project]="activeProject"
|
||||
[dossier]="activeDossier"
|
||||
tooltipPosition="below"
|
||||
></redaction-file-download-btn>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="reanalyseProject()"
|
||||
(action)="reanalyseDossier()"
|
||||
*ngIf="permissionsService.displayReanalyseBtn()"
|
||||
[tooltip]="'project-overview.new-rule.toast.actions.reanalyse-all'"
|
||||
[tooltip]="'dossier-overview.new-rule.toast.actions.reanalyse-all'"
|
||||
icon="red:refresh"
|
||||
tooltipClass="warn small"
|
||||
tooltipPosition="below"
|
||||
@ -74,12 +74,12 @@
|
||||
(action)="fileInput.click()"
|
||||
class="ml-14"
|
||||
icon="red:upload"
|
||||
tooltip="project-overview.header-actions.upload-document"
|
||||
tooltip="dossier-overview.header-actions.upload-document"
|
||||
tooltipPosition="below"
|
||||
type="primary"
|
||||
></redaction-circle-button>
|
||||
<redaction-circle-button
|
||||
[routerLink]="['/main/projects/']"
|
||||
[routerLink]="['/main/dossiers/']"
|
||||
class="ml-6"
|
||||
icon="red:close"
|
||||
tooltip="common.close"
|
||||
@ -103,15 +103,15 @@
|
||||
|
||||
<span class="all-caps-label">
|
||||
{{
|
||||
'project-overview.table-header.title'
|
||||
'dossier-overview.table-header.title'
|
||||
| translate: { length: displayedEntities.length || 0 }
|
||||
}}
|
||||
</span>
|
||||
|
||||
<redaction-project-overview-bulk-actions
|
||||
<redaction-dossier-overview-bulk-actions
|
||||
(reload)="bulkActionPerformed()"
|
||||
[selectedFileIds]="selectedEntitiesIds"
|
||||
></redaction-project-overview-bulk-actions>
|
||||
></redaction-dossier-overview-bulk-actions>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@ -127,7 +127,7 @@
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="filename"
|
||||
label="project-overview.table-col-names.name"
|
||||
label="dossier-overview.table-col-names.name"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
@ -135,11 +135,11 @@
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="added"
|
||||
label="project-overview.table-col-names.added-on"
|
||||
label="dossier-overview.table-col-names.added-on"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
label="project-overview.table-col-names.needs-work"
|
||||
label="dossier-overview.table-col-names.needs-work"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
@ -148,7 +148,7 @@
|
||||
[withSort]="true"
|
||||
class="user-column"
|
||||
column="reviewerName"
|
||||
label="project-overview.table-col-names.assigned-to"
|
||||
label="dossier-overview.table-col-names.assigned-to"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
@ -156,7 +156,7 @@
|
||||
[activeSortingOption]="sortingOption"
|
||||
[withSort]="true"
|
||||
column="pages"
|
||||
label="project-overview.table-col-names.pages"
|
||||
label="dossier-overview.table-col-names.pages"
|
||||
></redaction-table-col-name>
|
||||
|
||||
<redaction-table-col-name
|
||||
@ -165,7 +165,7 @@
|
||||
[withSort]="true"
|
||||
class="flex-end"
|
||||
column="statusSort"
|
||||
label="project-overview.table-col-names.status"
|
||||
label="dossier-overview.table-col-names.status"
|
||||
></redaction-table-col-name>
|
||||
<div class="scrollbar-placeholder"></div>
|
||||
</div>
|
||||
@ -175,12 +175,12 @@
|
||||
*ngIf="!allEntities.length"
|
||||
buttonIcon="red:upload"
|
||||
icon="red:document"
|
||||
screen="project-overview"
|
||||
screen="dossier-overview"
|
||||
></redaction-empty-state>
|
||||
|
||||
<redaction-empty-state
|
||||
*ngIf="allEntities.length && !displayedEntities.length"
|
||||
screen="project-overview"
|
||||
screen="dossier-overview"
|
||||
type="no-match"
|
||||
></redaction-empty-state>
|
||||
|
||||
@ -231,7 +231,7 @@
|
||||
<div *ngIf="fileStatus.ocrTime" class="small-label stats-subtitle">
|
||||
<div
|
||||
[matTooltipPosition]="'above'"
|
||||
[matTooltip]="'project-overview.ocr-performed' | translate"
|
||||
[matTooltip]="'dossier-overview.ocr-performed' | translate"
|
||||
>
|
||||
<mat-icon svgIcon="red:ocr"></mat-icon>
|
||||
{{ fileStatus.ocrTime | date: 'mediumDate' }}
|
||||
@ -277,17 +277,17 @@
|
||||
<div
|
||||
*ngIf="fileStatus.isError"
|
||||
class="small-label error"
|
||||
translate="project-overview.file-listing.file-entry.file-error"
|
||||
translate="dossier-overview.file-listing.file-entry.file-error"
|
||||
></div>
|
||||
<div
|
||||
*ngIf="fileStatus.isPending"
|
||||
class="small-label"
|
||||
translate="project-overview.file-listing.file-entry.file-pending"
|
||||
translate="dossier-overview.file-listing.file-entry.file-pending"
|
||||
></div>
|
||||
<div
|
||||
*ngIf="fileStatus.isProcessing"
|
||||
class="small-label loading"
|
||||
translate="project-overview.file-listing.file-entry.file-processing"
|
||||
translate="dossier-overview.file-listing.file-entry.file-processing"
|
||||
></div>
|
||||
<redaction-status-bar
|
||||
*ngIf="fileStatus.isWorkable"
|
||||
@ -318,14 +318,14 @@
|
||||
</div>
|
||||
|
||||
<div [class.collapsed]="collapsedDetails" class="right-container" redactionHasScrollbar>
|
||||
<redaction-project-details
|
||||
#projectDetailsComponent
|
||||
<redaction-dossier-details
|
||||
#dossierDetailsComponent
|
||||
(filtersChanged)="filtersChanged($event)"
|
||||
(openAssignProjectMembersDialog)="openAssignProjectMembersDialog()"
|
||||
(openAssignDossierMembersDialog)="openAssignDossierMembersDialog()"
|
||||
(openDossierDictionaryDialog)="openDossierDictionaryDialog()"
|
||||
(toggleCollapse)="toggleCollapsedDetails()"
|
||||
[filters]="detailsContainerFilters"
|
||||
></redaction-project-details>
|
||||
></redaction-dossier-details>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -82,7 +82,7 @@ cdk-virtual-scroll-viewport {
|
||||
padding-right: 13px;
|
||||
}
|
||||
|
||||
redaction-project-details {
|
||||
redaction-dossier-details {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import { StatusOverlayService } from '@upload-download/services/status-overlay.s
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { FilterModel } from '@shared/components/filter/model/filter.model';
|
||||
import * as moment from 'moment';
|
||||
import { ProjectDetailsComponent } from '../../components/project-details/project-details.component';
|
||||
import { DossierDetailsComponent } from '../../components/dossier-details/dossier-details.component';
|
||||
import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import {
|
||||
annotationFilterChecker,
|
||||
@ -25,18 +25,18 @@ import { RedactionFilterSorter } from '@utils/sorters/redaction-filter-sorter';
|
||||
import { StatusSorter } from '@utils/sorters/status-sorter';
|
||||
import { convertFiles, handleFileDrop } from '@utils/file-drop-utils';
|
||||
import { FilterComponent } from '@shared/components/filter/filter.component';
|
||||
import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
||||
import { BaseListingComponent } from '@shared/base/base-listing.component';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-overview-screen',
|
||||
templateUrl: './project-overview-screen.component.html',
|
||||
styleUrls: ['./project-overview-screen.component.scss']
|
||||
selector: 'redaction-dossier-overview-screen',
|
||||
templateUrl: './dossier-overview-screen.component.html',
|
||||
styleUrls: ['./dossier-overview-screen.component.scss']
|
||||
})
|
||||
export class ProjectOverviewScreenComponent
|
||||
export class DossierOverviewScreenComponent
|
||||
extends BaseListingComponent<FileStatusWrapper>
|
||||
implements OnInit, OnDestroy, OnDetach, OnAttach
|
||||
{
|
||||
@ -51,9 +51,9 @@ export class ProjectOverviewScreenComponent
|
||||
readonly itemSize = 80;
|
||||
protected readonly _searchKey = 'searchField';
|
||||
protected readonly _selectionKey = 'fileId';
|
||||
protected readonly _sortKey = 'project-overview';
|
||||
@ViewChild('projectDetailsComponent', { static: false })
|
||||
private _projectDetailsComponent: ProjectDetailsComponent;
|
||||
protected readonly _sortKey = 'dossier-overview';
|
||||
@ViewChild('dossierDetailsComponent', { static: false })
|
||||
private _dossierDetailsComponent: DossierDetailsComponent;
|
||||
private _filesAutoUpdateTimer: Subscription;
|
||||
private _routerEventsScrollPositionSub: Subscription;
|
||||
private _fileChangedSub: Subscription;
|
||||
@ -70,7 +70,7 @@ export class ProjectOverviewScreenComponent
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _notificationService: NotificationService,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _fileUploadService: FileUploadService,
|
||||
private readonly _statusOverlayService: StatusOverlayService,
|
||||
private readonly _router: Router,
|
||||
@ -84,8 +84,8 @@ export class ProjectOverviewScreenComponent
|
||||
this._loadEntitiesFromState();
|
||||
}
|
||||
|
||||
get activeProject(): ProjectWrapper {
|
||||
return this._appStateService.activeProject;
|
||||
get activeDossier(): DossierWrapper {
|
||||
return this._appStateService.activeDossier;
|
||||
}
|
||||
|
||||
protected get _filterComponents(): FilterComponent[] {
|
||||
@ -121,7 +121,7 @@ export class ProjectOverviewScreenComponent
|
||||
ngOnInit(): void {
|
||||
this._userPreferenceControllerService.getAllUserAttributes().subscribe((attributes) => {
|
||||
if (attributes === null || attributes === undefined) return;
|
||||
const key = 'Project-Recent-' + this.activeProject.projectId;
|
||||
const key = 'Dossier-Recent-' + this.activeDossier.dossierId;
|
||||
if (attributes[key]?.length > 0) {
|
||||
this._lastOpenedFileId = attributes[key][0];
|
||||
}
|
||||
@ -134,7 +134,7 @@ export class ProjectOverviewScreenComponent
|
||||
this._filesAutoUpdateTimer = timer(0, 7500)
|
||||
.pipe(
|
||||
tap(async () => {
|
||||
await this._appStateService.reloadActiveProjectFilesIfNecessary();
|
||||
await this._appStateService.reloadActiveDossierFilesIfNecessary();
|
||||
this._loadEntitiesFromState();
|
||||
})
|
||||
)
|
||||
@ -147,7 +147,7 @@ export class ProjectOverviewScreenComponent
|
||||
this._routerEventsScrollPositionSub = this._router.events
|
||||
.pipe(filter((events) => events instanceof NavigationStart))
|
||||
.subscribe((event: NavigationStart) => {
|
||||
if (!event.url.endsWith(this._appStateService.activeProjectId)) {
|
||||
if (!event.url.endsWith(this._appStateService.activeDossierId)) {
|
||||
this._lastScrollPosition = this.scrollBar.measureScrollOffset('top');
|
||||
}
|
||||
});
|
||||
@ -170,20 +170,20 @@ export class ProjectOverviewScreenComponent
|
||||
this.ngOnDestroy();
|
||||
}
|
||||
|
||||
reanalyseProject() {
|
||||
reanalyseDossier() {
|
||||
return this._appStateService
|
||||
.reanalyzeProject()
|
||||
.reanalyzeDossier()
|
||||
.then(() => {
|
||||
this.reloadProjects();
|
||||
this.reloadDossiers();
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('project-overview.reanalyse-project.success'),
|
||||
this._translateService.instant('dossier-overview.reanalyse-dossier.success'),
|
||||
null,
|
||||
NotificationType.SUCCESS
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('project-overview.reanalyse-project.error'),
|
||||
this._translateService.instant('dossier-overview.reanalyse-dossier.error'),
|
||||
null,
|
||||
NotificationType.ERROR
|
||||
);
|
||||
@ -206,20 +206,20 @@ export class ProjectOverviewScreenComponent
|
||||
].includes(fileStatusWrapper.status);
|
||||
}
|
||||
|
||||
reloadProjects() {
|
||||
this._appStateService.getFiles(this._appStateService.activeProject, false).then(() => {
|
||||
reloadDossiers() {
|
||||
this._appStateService.getFiles(this._appStateService.activeDossier, false).then(() => {
|
||||
this.calculateData();
|
||||
});
|
||||
}
|
||||
|
||||
calculateData(): void {
|
||||
if (!this._appStateService.activeProjectId) {
|
||||
if (!this._appStateService.activeDossierId) {
|
||||
return;
|
||||
}
|
||||
this._loadEntitiesFromState();
|
||||
this._computeAllFilters();
|
||||
this._filterEntities();
|
||||
this._projectDetailsComponent?.calculateChartConfig();
|
||||
this._dossierDetailsComponent?.calculateChartConfig();
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ export class ProjectOverviewScreenComponent
|
||||
|
||||
@HostListener('drop', ['$event'])
|
||||
onDrop(event: DragEvent) {
|
||||
handleFileDrop(event, this.activeProject, this._uploadFiles.bind(this));
|
||||
handleFileDrop(event, this.activeDossier, this._uploadFiles.bind(this));
|
||||
}
|
||||
|
||||
@HostListener('dragover', ['$event'])
|
||||
@ -239,14 +239,14 @@ export class ProjectOverviewScreenComponent
|
||||
}
|
||||
|
||||
async uploadFiles(files: File[] | FileList) {
|
||||
await this._uploadFiles(convertFiles(files, this.activeProject));
|
||||
await this._uploadFiles(convertFiles(files, this.activeDossier));
|
||||
}
|
||||
|
||||
fileLink(fileStatus: FileStatusWrapper) {
|
||||
return this.permissionsService.canOpenFile(fileStatus)
|
||||
? [
|
||||
'/main/projects/' +
|
||||
this.activeProject.project.projectId +
|
||||
'/main/dossiers/' +
|
||||
this.activeDossier.dossier.dossierId +
|
||||
'/file/' +
|
||||
fileStatus.fileId
|
||||
]
|
||||
@ -255,28 +255,28 @@ export class ProjectOverviewScreenComponent
|
||||
|
||||
bulkActionPerformed() {
|
||||
this.selectedEntitiesIds = [];
|
||||
this.reloadProjects();
|
||||
this.reloadDossiers();
|
||||
}
|
||||
|
||||
openEditProjectDialog($event: MouseEvent) {
|
||||
this._dialogService.openEditProjectDialog($event, this.activeProject);
|
||||
openEditDossierDialog($event: MouseEvent) {
|
||||
this._dialogService.openEditDossierDialog($event, this.activeDossier);
|
||||
}
|
||||
|
||||
openDeleteProjectDialog($event: MouseEvent) {
|
||||
this._dialogService.openDeleteProjectDialog($event, this.activeProject, () => {
|
||||
this._router.navigate(['/main/projects']);
|
||||
openDeleteDossierDialog($event: MouseEvent) {
|
||||
this._dialogService.openDeleteDossierDialog($event, this.activeDossier, () => {
|
||||
this._router.navigate(['/main/dossiers']);
|
||||
});
|
||||
}
|
||||
|
||||
openAssignProjectMembersDialog(): void {
|
||||
this._dialogService.openAssignTeamMembersDialog(null, this.activeProject, () => {
|
||||
this.reloadProjects();
|
||||
openAssignDossierMembersDialog(): void {
|
||||
this._dialogService.openAssignTeamMembersDialog(null, this.activeDossier, () => {
|
||||
this.reloadDossiers();
|
||||
});
|
||||
}
|
||||
|
||||
openDossierDictionaryDialog() {
|
||||
this._dialogService.openDossierDictionaryDialog(null, this.activeProject, () => {
|
||||
this.reloadProjects();
|
||||
this._dialogService.openDossierDictionaryDialog(null, this.activeDossier, () => {
|
||||
this.reloadDossiers();
|
||||
});
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ export class ProjectOverviewScreenComponent
|
||||
}
|
||||
|
||||
private _loadEntitiesFromState() {
|
||||
if (this.activeProject) this.allEntities = this.activeProject.files;
|
||||
if (this.activeDossier) this.allEntities = this.activeDossier.files;
|
||||
}
|
||||
|
||||
private async _uploadFiles(files: FileUploadModel[]) {
|
||||
@ -304,7 +304,7 @@ export class ProjectOverviewScreenComponent
|
||||
}
|
||||
|
||||
private _computeAllFilters() {
|
||||
if (!this.activeProject) {
|
||||
if (!this.activeDossier) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
import { AddRedactionRequest } from '@redaction/red-ui-http';
|
||||
import { getFirstRelevantTextPart } from '@utils/functions';
|
||||
import { AnnotationPermissions } from '@models/file/annotation.permissions';
|
||||
import { ProjectsDialogService } from './projects-dialog.service';
|
||||
import { DossiersDialogService } from './dossiers-dialog.service';
|
||||
import { BASE_HREF } from '../../../tokens';
|
||||
|
||||
@Injectable()
|
||||
@ -18,7 +18,7 @@ export class AnnotationActionsService {
|
||||
private readonly _ngZone: NgZone,
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _dialogService: ProjectsDialogService
|
||||
private readonly _dialogService: DossiersDialogService
|
||||
) {}
|
||||
|
||||
acceptSuggestion(
|
||||
|
||||
@ -36,7 +36,7 @@ export class AnnotationDrawService {
|
||||
if (this._userPreferenceService.areDevFeaturesEnabled) {
|
||||
this._redactionLogControllerService
|
||||
.getSectionGrid(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.subscribe((sectionGrid) => {
|
||||
|
||||
@ -5,12 +5,12 @@ import { ReanalysisControllerService, StatusControllerService } from '@redaction
|
||||
import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { isArray } from 'rxjs/internal-compatibility';
|
||||
import { ProjectsDialogService } from './projects-dialog.service';
|
||||
import { DossiersDialogService } from './dossiers-dialog.service';
|
||||
|
||||
@Injectable()
|
||||
export class FileActionService {
|
||||
constructor(
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _statusControllerService: StatusControllerService,
|
||||
@ -23,7 +23,7 @@ export class FileActionService {
|
||||
fileStatusWrapper = this._appStateService.activeFile;
|
||||
}
|
||||
return this._reanalysisControllerService.reanalyzeFile(
|
||||
this._appStateService.activeProject.project.projectId,
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
fileStatusWrapper.fileId,
|
||||
priority
|
||||
);
|
||||
@ -35,12 +35,12 @@ export class FileActionService {
|
||||
}
|
||||
return this._reanalysisControllerService.toggleAnalysis(
|
||||
fileStatusWrapper.fileId,
|
||||
fileStatusWrapper.projectId,
|
||||
fileStatusWrapper.dossierId,
|
||||
!fileStatusWrapper.isExcluded
|
||||
);
|
||||
}
|
||||
|
||||
async assignProjectReviewerFromOverview(file?: FileStatusWrapper, callback?: Function) {
|
||||
async assignDossierReviewerFromOverview(file?: FileStatusWrapper, callback?: Function) {
|
||||
if (this._permissionsService.isOwner()) {
|
||||
this._openAssignReviewerDialog(file, callback);
|
||||
} else {
|
||||
@ -48,7 +48,7 @@ export class FileActionService {
|
||||
}
|
||||
}
|
||||
|
||||
assignProjectApprover(
|
||||
assignDossierApprover(
|
||||
file?: FileStatusWrapper,
|
||||
callback?: Function,
|
||||
ignoreDialogChanges = false
|
||||
@ -57,7 +57,7 @@ export class FileActionService {
|
||||
file ? [file] : [this._appStateService.activeFile],
|
||||
'approver',
|
||||
async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
@ -66,7 +66,7 @@ export class FileActionService {
|
||||
);
|
||||
}
|
||||
|
||||
assignProjectReviewer(
|
||||
assignDossierReviewer(
|
||||
file?: FileStatusWrapper,
|
||||
callback?: Function,
|
||||
ignoreDialogChanges = false
|
||||
@ -75,7 +75,7 @@ export class FileActionService {
|
||||
file ? [file] : [this._appStateService.activeFile],
|
||||
'reviewer',
|
||||
async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
@ -108,12 +108,12 @@ export class FileActionService {
|
||||
}
|
||||
|
||||
if (!approverId) {
|
||||
approverId = this._appStateService.activeProject.approverIds[0];
|
||||
approverId = this._appStateService.activeDossier.approverIds[0];
|
||||
}
|
||||
|
||||
return this._statusControllerService.setStatusUnderApprovalForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
approverId
|
||||
);
|
||||
}
|
||||
@ -124,7 +124,7 @@ export class FileActionService {
|
||||
}
|
||||
return this._statusControllerService.setStatusApprovedForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId
|
||||
this._appStateService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ export class FileActionService {
|
||||
}
|
||||
return this._statusControllerService.setStatusUnderReviewForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId
|
||||
this._appStateService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ export class FileActionService {
|
||||
}
|
||||
return this._reanalysisControllerService.ocrFiles(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId
|
||||
this._appStateService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ export class FileActionService {
|
||||
file ? [file] : [this._appStateService.activeFile],
|
||||
'reviewer',
|
||||
async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
@ -171,11 +171,11 @@ export class FileActionService {
|
||||
await this._statusControllerService
|
||||
.setFileReviewerForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._userService.userId
|
||||
)
|
||||
.toPromise();
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
if (callback) {
|
||||
await callback();
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ export class ManualAnnotationService {
|
||||
addComment(comment: string, annotationId: string) {
|
||||
return this._manualRedactionControllerService.addComment(
|
||||
{ text: comment },
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
annotationId
|
||||
);
|
||||
@ -39,7 +39,7 @@ export class ManualAnnotationService {
|
||||
// this wraps /manualRedaction/comment/undo
|
||||
deleteComment(commentId: string, annotationId: string) {
|
||||
return this._manualRedactionControllerService.undoComment(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
annotationId,
|
||||
commentId
|
||||
@ -87,7 +87,7 @@ export class ManualAnnotationService {
|
||||
return this._manualRedactionControllerService
|
||||
.approveRequest(
|
||||
{ addOrRemoveFromDictionary: addToDictionary },
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFile.fileId,
|
||||
annotationId
|
||||
)
|
||||
@ -107,7 +107,7 @@ export class ManualAnnotationService {
|
||||
undoRequest(annotationWrapper: AnnotationWrapper) {
|
||||
return this._manualRedactionControllerService
|
||||
.undo(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
annotationWrapper.id
|
||||
)
|
||||
@ -134,7 +134,7 @@ export class ManualAnnotationService {
|
||||
if (this._permissionsService.isApprover()) {
|
||||
return this._manualRedactionControllerService
|
||||
.declineRequest(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
annotationWrapper.id
|
||||
)
|
||||
@ -159,7 +159,7 @@ export class ManualAnnotationService {
|
||||
} else {
|
||||
return this._manualRedactionControllerService
|
||||
.undo(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
annotationWrapper.id
|
||||
)
|
||||
@ -196,7 +196,7 @@ export class ManualAnnotationService {
|
||||
if (annotationWrapper.dictionary === 'manual') {
|
||||
return this._manualRedactionControllerService
|
||||
.declineRequest(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId,
|
||||
annotationWrapper.id
|
||||
)
|
||||
@ -219,7 +219,7 @@ export class ManualAnnotationService {
|
||||
removeFromDictionary: removeFromDictionary,
|
||||
comment: '-'
|
||||
},
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.pipe(
|
||||
@ -242,7 +242,7 @@ export class ManualAnnotationService {
|
||||
removeFromDictionary: removeFromDictionary,
|
||||
comment: '-'
|
||||
},
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.pipe(
|
||||
@ -286,7 +286,7 @@ export class ManualAnnotationService {
|
||||
return this._manualRedactionControllerService
|
||||
.requestForceRedaction(
|
||||
forceRedactionRequest,
|
||||
this._appStateService.activeProject.project.projectId,
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
this._appStateService.activeFile.fileId
|
||||
)
|
||||
.pipe(
|
||||
@ -306,7 +306,7 @@ export class ManualAnnotationService {
|
||||
return this._manualRedactionControllerService
|
||||
.forceRedaction(
|
||||
forceRedactionRequest,
|
||||
this._appStateService.activeProject.project.projectId,
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
this._appStateService.activeFile.fileId
|
||||
)
|
||||
.pipe(
|
||||
@ -326,7 +326,7 @@ export class ManualAnnotationService {
|
||||
return this._manualRedactionControllerService
|
||||
.requestAddRedaction(
|
||||
manualRedactionEntry,
|
||||
this._appStateService.activeProject.project.projectId,
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
this._appStateService.activeFile.fileId
|
||||
)
|
||||
.pipe(
|
||||
@ -349,7 +349,7 @@ export class ManualAnnotationService {
|
||||
return this._manualRedactionControllerService
|
||||
.addRedaction(
|
||||
manualRedactionEntry,
|
||||
this._appStateService.activeProject.project.projectId,
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
this._appStateService.activeFile.fileId
|
||||
)
|
||||
.pipe(
|
||||
|
||||
@ -25,7 +25,7 @@ export class PdfViewerDataService {
|
||||
|
||||
loadActiveFileManualAnnotations() {
|
||||
return this._manualRedactionControllerService.getManualRedaction(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
);
|
||||
}
|
||||
@ -34,19 +34,19 @@ export class PdfViewerDataService {
|
||||
const fileObs = this.downloadOriginalFile(this._appStateService.activeFile);
|
||||
const reactionLogObs = this._redactionLogControllerService
|
||||
.getRedactionLog(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.pipe(catchError(() => of({})));
|
||||
const redactionChangeLogObs = this._redactionLogControllerService
|
||||
.getRedactionChangeLog(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.pipe(catchError(() => of({})));
|
||||
const manualRedactionsObs = this._manualRedactionControllerService
|
||||
.getManualRedaction(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.pipe(catchError(() => of({})));
|
||||
@ -65,7 +65,7 @@ export class PdfViewerDataService {
|
||||
if (this._permissionsService.canMarkPagesAsViewed()) {
|
||||
return this._viewedPagesControllerService
|
||||
.getViewedPages(
|
||||
this._appStateService.activeProjectId,
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.pipe(catchError(() => of({ pages: [] })));
|
||||
@ -75,7 +75,7 @@ export class PdfViewerDataService {
|
||||
|
||||
downloadOriginalFile(fileStatus: FileStatusWrapper): Observable<any> {
|
||||
return this._fileManagementControllerService.downloadOriginalFile(
|
||||
fileStatus.projectId,
|
||||
fileStatus.dossierId,
|
||||
fileStatus.fileId,
|
||||
true,
|
||||
fileStatus.lastUploaded,
|
||||
|
||||
@ -5,9 +5,9 @@ import {
|
||||
FileManagementControllerService,
|
||||
FileStatus,
|
||||
ManualRedactionControllerService,
|
||||
RuleSetControllerService
|
||||
DossierTemplateControllerService
|
||||
} from '@redaction/red-ui-http';
|
||||
import { AddProjectDialogComponent } from '../dialogs/add-project-dialog/add-project-dialog.component';
|
||||
import { AddDossierDialogComponent } from '../dialogs/add-dossier-dialog/add-dossier-dialog.component';
|
||||
import { RemoveAnnotationsDialogComponent } from '../dialogs/remove-annotations-dialog/remove-annotations-dialog.component';
|
||||
import { NotificationService, NotificationType } from '@services/notification.service';
|
||||
import { ForceRedactionDialogComponent } from '../dialogs/force-redaction-dialog/force-redaction-dialog.component';
|
||||
@ -16,7 +16,7 @@ import {
|
||||
ConfirmationDialogComponent,
|
||||
ConfirmationDialogInput
|
||||
} from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { DocumentInfoDialogComponent } from '../dialogs/document-info-dialog/document-info-dialog.component';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
||||
@ -24,7 +24,7 @@ import { ManualAnnotationService } from './manual-annotation.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ManualAnnotationDialogComponent } from '../dialogs/manual-redaction-dialog/manual-annotation-dialog.component';
|
||||
import { DossierDictionaryDialogComponent } from '../dialogs/dossier-dictionary-dialog/dossier-dictionary-dialog.component';
|
||||
import { EditProjectDialogComponent } from '../dialogs/edit-project-dialog/edit-project-dialog.component';
|
||||
import { EditDossierDialogComponent } from '../dialogs/edit-dossier-dialog/edit-dossier-dialog.component';
|
||||
import { FileStatusWrapper } from '../../../models/file/file-status.wrapper';
|
||||
import { AssignReviewerApproverDialogComponent } from '../dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component';
|
||||
import { TeamMembersDialogComponent } from '../dialogs/team-members-dialog/team-members-dialog.component';
|
||||
@ -36,12 +36,12 @@ const dialogConfig = {
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class ProjectsDialogService {
|
||||
export class DossiersDialogService {
|
||||
constructor(
|
||||
private readonly _dialog: MatDialog,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _ruleSetControllerService: RuleSetControllerService,
|
||||
private readonly _dossierTemplateControllerService: DossierTemplateControllerService,
|
||||
private readonly _dictionaryControllerService: DictionaryControllerService,
|
||||
private readonly _fileManagementControllerService: FileManagementControllerService,
|
||||
private readonly _notificationService: NotificationService,
|
||||
@ -51,7 +51,7 @@ export class ProjectsDialogService {
|
||||
|
||||
openDeleteFilesDialog(
|
||||
$event: MouseEvent,
|
||||
projectId: string,
|
||||
dossierId: string,
|
||||
fileIds: string[],
|
||||
cb?: Function
|
||||
): MatDialogRef<ConfirmationDialogComponent> {
|
||||
@ -69,9 +69,9 @@ export class ProjectsDialogService {
|
||||
if (result) {
|
||||
try {
|
||||
await this._fileManagementControllerService
|
||||
.deleteFiles(fileIds, projectId)
|
||||
.deleteFiles(fileIds, dossierId)
|
||||
.toPromise();
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
if (cb) cb();
|
||||
} catch (e) {
|
||||
this._notificationService.showToastNotification(
|
||||
@ -186,23 +186,23 @@ export class ProjectsDialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
openDeleteProjectDialog(
|
||||
openDeleteDossierDialog(
|
||||
$event: MouseEvent,
|
||||
project: ProjectWrapper,
|
||||
dossier: DossierWrapper,
|
||||
cb?: Function
|
||||
): MatDialogRef<ConfirmationDialogComponent> {
|
||||
$event.stopPropagation();
|
||||
const ref = this._dialog.open(ConfirmationDialogComponent, {
|
||||
...dialogConfig,
|
||||
data: new ConfirmationDialogInput({
|
||||
title: 'confirmation-dialog.delete-project.title',
|
||||
question: 'confirmation-dialog.delete-project.question'
|
||||
title: 'confirmation-dialog.delete-dossier.title',
|
||||
question: 'confirmation-dialog.delete-dossier.question'
|
||||
})
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
if (result) {
|
||||
await this._appStateService.deleteProject(project);
|
||||
await this._appStateService.deleteDossier(dossier);
|
||||
if (cb) cb();
|
||||
}
|
||||
});
|
||||
@ -211,13 +211,13 @@ export class ProjectsDialogService {
|
||||
|
||||
openAssignTeamMembersDialog(
|
||||
$event: MouseEvent,
|
||||
projectWrapper: ProjectWrapper,
|
||||
dossierWrapper: DossierWrapper,
|
||||
cb?: Function
|
||||
): MatDialogRef<TeamMembersDialogComponent> {
|
||||
$event?.stopPropagation();
|
||||
const ref = this._dialog.open(TeamMembersDialogComponent, {
|
||||
...dialogConfig,
|
||||
data: { projectWrapper }
|
||||
data: { dossierWrapper }
|
||||
});
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
if (cb) {
|
||||
@ -229,7 +229,7 @@ export class ProjectsDialogService {
|
||||
|
||||
openDossierDictionaryDialog(
|
||||
$event: MouseEvent,
|
||||
project: ProjectWrapper,
|
||||
dossier: DossierWrapper,
|
||||
cb?: Function
|
||||
): MatDialogRef<DossierDictionaryDialogComponent> {
|
||||
$event?.stopPropagation();
|
||||
@ -238,7 +238,7 @@ export class ProjectsDialogService {
|
||||
width: '90vw',
|
||||
height: '90vh',
|
||||
autoFocus: false,
|
||||
data: project
|
||||
data: dossier
|
||||
});
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
if (cb) {
|
||||
@ -279,8 +279,8 @@ export class ProjectsDialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
openAddProjectDialog(cb?: Function): MatDialogRef<AddProjectDialogComponent> {
|
||||
const ref = this._dialog.open(AddProjectDialogComponent, {
|
||||
openAddDossierDialog(cb?: Function): MatDialogRef<AddDossierDialogComponent> {
|
||||
const ref = this._dialog.open(AddDossierDialogComponent, {
|
||||
...dialogConfig,
|
||||
width: '900px',
|
||||
autoFocus: true
|
||||
@ -293,18 +293,18 @@ export class ProjectsDialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
openEditProjectDialog(
|
||||
openEditDossierDialog(
|
||||
$event: MouseEvent,
|
||||
projectWrapper: ProjectWrapper,
|
||||
dossierWrapper: DossierWrapper,
|
||||
cb?: Function
|
||||
): MatDialogRef<EditProjectDialogComponent> {
|
||||
): MatDialogRef<EditDossierDialogComponent> {
|
||||
$event.stopPropagation();
|
||||
return this._dialog.open(EditProjectDialogComponent, {
|
||||
return this._dialog.open(EditDossierDialogComponent, {
|
||||
...dialogConfig,
|
||||
width: '90vw',
|
||||
height: '90vh',
|
||||
autoFocus: true,
|
||||
data: { projectWrapper, afterSave: cb }
|
||||
data: { dossierWrapper, afterSave: cb }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltip]="
|
||||
canDownloadFiles
|
||||
? 'project-overview.download-file'
|
||||
: 'project-overview.download-file-disabled'
|
||||
? 'dossier-overview.download-file'
|
||||
: 'dossier-overview.download-file-disabled'
|
||||
"
|
||||
[type]="type"
|
||||
icon="red:download"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, Inject, Input } from '@angular/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { ProjectWrapper } from '@state/model/project.wrapper';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { FileStatusWrapper } from '@models/file/file-status.wrapper';
|
||||
import { FileDownloadService } from '@upload-download/services/file-download.service';
|
||||
import { NotificationService } from '@services/notification.service';
|
||||
@ -15,7 +15,7 @@ export type MenuState = 'OPEN' | 'CLOSED';
|
||||
styleUrls: ['./file-download-btn.component.scss']
|
||||
})
|
||||
export class FileDownloadBtnComponent {
|
||||
@Input() project: ProjectWrapper;
|
||||
@Input() dossier: DossierWrapper;
|
||||
@Input() file: FileStatusWrapper | FileStatusWrapper[];
|
||||
@Input() tooltipPosition: 'above' | 'below' | 'before' | 'after' = 'above';
|
||||
@Input() type: 'default' | 'primary' | 'warn' | 'dark-bg' = 'default';
|
||||
@ -46,7 +46,7 @@ export class FileDownloadBtnComponent {
|
||||
downloadFiles($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
this._fileDownloadService
|
||||
.downloadFiles(Array.isArray(this.file) ? this.file : [this.file], this.project)
|
||||
.downloadFiles(Array.isArray(this.file) ? this.file : [this.file], this.dossier)
|
||||
.subscribe(() => {
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant('download-status.queued', {
|
||||
|
||||
@ -9,7 +9,7 @@ import { TypeValue } from '@redaction/red-ui-http';
|
||||
})
|
||||
export class DictionaryAnnotationIconComponent implements OnChanges {
|
||||
@Input() dictionaryKey: string;
|
||||
@Input() ruleSetId: string;
|
||||
@Input() dossierTemplateId: string;
|
||||
|
||||
color: string;
|
||||
label: string;
|
||||
@ -21,11 +21,11 @@ export class DictionaryAnnotationIconComponent implements OnChanges {
|
||||
if (this.dictionaryKey) {
|
||||
const typeValue: TypeValue = this._appStateService.getDictionaryTypeValue(
|
||||
this.dictionaryKey,
|
||||
this.ruleSetId
|
||||
this.dossierTemplateId
|
||||
);
|
||||
this.color = this._appStateService.getDictionaryColor(
|
||||
this.dictionaryKey,
|
||||
this.ruleSetId
|
||||
this.dossierTemplateId
|
||||
);
|
||||
this.type = typeValue.hint ? 'circle' : 'square';
|
||||
this.label = this.dictionaryKey[0].toUpperCase();
|
||||
|
||||
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