RED-3800: prepare for adding ids
This commit is contained in:
parent
0c65fca38e
commit
5195577743
@ -1,8 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: './base-admin-screen.component.html',
|
||||
styleUrls: ['./base-admin-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class BaseAdminScreenComponent {}
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
<ng-container *ngIf="dossierStats$ | async as stats">
|
||||
<div>
|
||||
<mat-icon svgIcon="iqser:document"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.documents' | translate: { count: stats.numberOfFiles } }}</span>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.documents' | translate : { count: stats.numberOfFiles } }}</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="stats.numberOfProcessingFiles">
|
||||
<mat-icon svgIcon="red:reanalyse"></mat-icon>
|
||||
<span>{{
|
||||
'dossier-overview.dossier-details.stats.processing-documents' | translate: { count: stats.numberOfProcessingFiles }
|
||||
'dossier-overview.dossier-details.stats.processing-documents' | translate : { count: stats.numberOfProcessingFiles }
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<mat-icon svgIcon="red:user"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.people' | translate: { count: dossier.memberIds.length } }}</span>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.people' | translate : { count: dossier.memberIds.length } }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<mat-icon svgIcon="iqser:pages"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.analysed-pages' | translate: { count: stats.numberOfPages | number } }}</span>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.analysed-pages' | translate : { count: stats.numberOfPages | number } }}</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="dossier.date | date: 'd MMM yyyy' as date">
|
||||
<div *ngIf="dossier.date | date : 'd MMM yyyy' as date">
|
||||
<mat-icon svgIcon="red:calendar"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.created-on' | translate: { date: date } }}</span>
|
||||
<span [innerHTML]="'dossier-overview.dossier-details.stats.created-on' | translate : { date }"></span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="dossier.dueDate | date: 'd MMM yyyy' as dueDate">
|
||||
<div *ngIf="dossier.dueDate | date : 'd MMM yyyy' as dueDate">
|
||||
<mat-icon svgIcon="red:lightning"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.due-date' | translate: { date: dueDate } }}</span>
|
||||
<span [innerHTML]="'dossier-overview.dossier-details.stats.due-date' | translate : { date: dueDate }"></span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@ -44,7 +44,7 @@
|
||||
<!--TODO: Navigate to trash with filter on click?-->
|
||||
<div>
|
||||
<mat-icon svgIcon="iqser:trash"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.deleted' | translate: { count: stats.numberOfSoftDeletedFiles } }}</span>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.deleted' | translate : { count: stats.numberOfSoftDeletedFiles } }}</span>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
@ -55,14 +55,14 @@
|
||||
[iqserHelpMode]="'edit_dossier_dossier_attributes'"
|
||||
class="all-caps-label show-attributes"
|
||||
>
|
||||
{{ 'dossier-overview.dossier-details.attributes.expand' | translate: { count: dossierAttributes.length } }}
|
||||
{{ 'dossier-overview.dossier-details.attributes.expand' | translate : { count: dossierAttributes.length } }}
|
||||
</div>
|
||||
|
||||
<div *ngIf="attributesExpanded" class="attributes" [iqserHelpMode]="'edit_dossier_dossier_attributes'">
|
||||
<div *ngIf="attributesExpanded" [iqserHelpMode]="'edit_dossier_dossier_attributes'" class="attributes">
|
||||
<div (click)="openEditDossierDialog('dossierAttributes')" *ngFor="let attr of dossierAttributes" class="link-property">
|
||||
<mat-icon svgIcon="red:attribute"></mat-icon>
|
||||
<span *ngIf="!attr.value"> {{ attr.label + ': -' }}</span>
|
||||
<span *ngIf="attr.value && attr.type === 'DATE'"> {{ attr.label + ': ' + (attr.value | date: 'd MMM yyyy') }}</span>
|
||||
<span *ngIf="attr.value && attr.type === 'DATE'"> {{ attr.label + ': ' + (attr.value | date : 'd MMM yyyy') }}</span>
|
||||
<span *ngIf="attr.value && attr.type === 'IMAGE'">
|
||||
{{ attr.label + ': ' + ('dossier-overview.dossier-details.attributes.image-uploaded' | translate) }}</span
|
||||
>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Dossier, DossierAttributeWithValue, DossierStats } from '@red/domain';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { FilesService } from '@services/files/files.service';
|
||||
@ -10,7 +10,6 @@ import { DossiersDialogService } from '../../../shared-dossiers/services/dossier
|
||||
selector: 'redaction-dossier-details-stats',
|
||||
templateUrl: './dossier-details-stats.component.html',
|
||||
styleUrls: ['./dossier-details-stats.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DossierDetailsStatsComponent implements OnInit {
|
||||
@Input() dossierAttributes: DossierAttributeWithValue[];
|
||||
|
||||
@ -40,8 +40,8 @@
|
||||
<iqser-circle-button
|
||||
(action)="upload.emit()"
|
||||
*ngIf="permissionsService.canUploadFiles(dossier)"
|
||||
[buttonId]="'upload-document-btn'"
|
||||
[icon]="'iqser:upload'"
|
||||
[id]="'upload-document-btn'"
|
||||
[iqserHelpMode]="'edit_dossier_in_dossier'"
|
||||
[overlappingElements]="['USER_MENU']"
|
||||
[tooltipPosition]="'below'"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
|
||||
import { Component, Input, OnChanges } from '@angular/core';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { AnnotationPermissions } from '@models/file/annotation.permissions';
|
||||
@ -22,7 +22,6 @@ export type AnnotationButtonType = keyof typeof AnnotationButtonTypes;
|
||||
selector: 'redaction-annotation-actions',
|
||||
templateUrl: './annotation-actions.component.html',
|
||||
styleUrls: ['./annotation-actions.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AnnotationActionsComponent implements OnChanges {
|
||||
@Input() buttonType: AnnotationButtonType = AnnotationButtonTypes.dark;
|
||||
@ -32,6 +31,9 @@ export class AnnotationActionsComponent implements OnChanges {
|
||||
annotationPermissions: AnnotationPermissions;
|
||||
readonly roles = ROLES;
|
||||
|
||||
isVisible = true;
|
||||
isImage = true;
|
||||
|
||||
constructor(
|
||||
readonly viewModeService: ViewModeService,
|
||||
readonly helpModeService: HelpModeService,
|
||||
@ -53,20 +55,15 @@ export class AnnotationActionsComponent implements OnChanges {
|
||||
@Input()
|
||||
set annotations(annotations: AnnotationWrapper[]) {
|
||||
this._annotations = annotations.filter(a => a !== undefined);
|
||||
const viewerAnnotations = this.viewerAnnotations ?? [];
|
||||
this.isVisible = viewerAnnotations.reduce((acc, annotation) => annotation?.isVisible() && acc, true);
|
||||
this.isImage = this._annotations?.reduce((accumulator, annotation) => annotation.isImage && accumulator, true);
|
||||
}
|
||||
|
||||
get viewerAnnotations() {
|
||||
return this._annotationManager.get(this._annotations);
|
||||
}
|
||||
|
||||
get isVisible() {
|
||||
return this.viewerAnnotations?.reduce((accumulator, annotation) => annotation?.isVisible() && accumulator, true);
|
||||
}
|
||||
|
||||
get isImage() {
|
||||
return this.annotations?.reduce((accumulator, annotation) => annotation.isImage && accumulator, true);
|
||||
}
|
||||
|
||||
get resizing() {
|
||||
return this.annotations?.length === 1 && this.annotations?.[0].resizing;
|
||||
}
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { File } from '@red/domain';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-readonly-banner',
|
||||
templateUrl: './readonly-banner.component.html',
|
||||
styleUrls: ['./readonly-banner.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ReadonlyBannerComponent {
|
||||
@Input() file: File;
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
<iqser-circle-button
|
||||
(action)="editingReviewer$.next(true)"
|
||||
*ngIf="(canAssignOrUnassign$ | async) && !!file.assignee"
|
||||
[buttonId]="'change-assignee'"
|
||||
[icon]="'iqser:edit'"
|
||||
[id]="'change-assignee'"
|
||||
[iqserHelpMode]="'document_features_in_editor'"
|
||||
[overlappingElements]="['USER_MENU']"
|
||||
[tooltipPosition]="'below'"
|
||||
@ -43,12 +43,12 @@
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button
|
||||
id="assign-me"
|
||||
(action)="fileAssignService.assignToMe([file])"
|
||||
*ngIf="canAssignToSelf$ | async"
|
||||
[icon]="'red:assign-me'"
|
||||
[tooltipPosition]="'below'"
|
||||
[tooltip]="'file-preview.assign-me' | translate"
|
||||
buttonId="assign-me"
|
||||
></iqser-circle-button>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { ViewMode, ViewModes } from '@red/domain';
|
||||
import { ViewModeService } from '../../services/view-mode.service';
|
||||
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
||||
@ -15,7 +15,6 @@ import { ROLES } from '@users/roles';
|
||||
selector: 'redaction-view-switch',
|
||||
templateUrl: './view-switch.component.html',
|
||||
styleUrls: ['./view-switch.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ViewSwitchComponent {
|
||||
readonly viewModes = ViewModes;
|
||||
@ -54,40 +53,45 @@ export class ViewSwitchComponent {
|
||||
|
||||
async #switchToRedactedView() {
|
||||
const unapprovedSuggestionsWarning = this._userPreferenceService.getUnapprovedSuggestionsWarning();
|
||||
if (!unapprovedSuggestionsWarning) {
|
||||
const suggestions = (await this._fileDataService.annotations).filter(a => a.isSuggestion);
|
||||
if (suggestions.length) {
|
||||
const displaySuggestionsInPreview = this._userPreferenceService.getDisplaySuggestionsInPreview();
|
||||
const question = displaySuggestionsInPreview
|
||||
? _('unapproved-suggestions.confirmation-dialog.displayed-question')
|
||||
: _('unapproved-suggestions.confirmation-dialog.not-displayed-question');
|
||||
const data = new ConfirmationDialogInput({
|
||||
title: _('unapproved-suggestions.confirmation-dialog.title'),
|
||||
question: question,
|
||||
confirmationText: _('unapproved-suggestions.confirmation-dialog.confirmation-text'),
|
||||
denyText: _('unapproved-suggestions.confirmation-dialog.deny-text'),
|
||||
checkboxes: [
|
||||
{
|
||||
label: _('unapproved-suggestions.confirmation-dialog.checkbox-text'),
|
||||
value: false,
|
||||
},
|
||||
],
|
||||
checkboxesValidation: false,
|
||||
});
|
||||
if (unapprovedSuggestionsWarning) {
|
||||
return this.viewModeService.switchToRedacted();
|
||||
}
|
||||
|
||||
return this._dialogService.openDialog('confirm', null, data, result => {
|
||||
if (result) {
|
||||
if (result === ConfirmOptions.SECOND_CONFIRM) {
|
||||
this._userPreferenceService.toggleUnapprovedSuggestionsWarning();
|
||||
this._toaster.success(_('unapproved-suggestions.confirmation-dialog.success-confirmation-text'), {
|
||||
params: { settingsUrl: `${this._baseHref}/main/account/warnings-preferences` },
|
||||
});
|
||||
}
|
||||
this.viewModeService.switchToRedacted();
|
||||
}
|
||||
const suggestions = (await this._fileDataService.annotations).filter(a => a.isSuggestion);
|
||||
if (!suggestions.length) {
|
||||
return this.viewModeService.switchToRedacted();
|
||||
}
|
||||
|
||||
const displaySuggestionsInPreview = this._userPreferenceService.getDisplaySuggestionsInPreview();
|
||||
const question = displaySuggestionsInPreview
|
||||
? _('unapproved-suggestions.confirmation-dialog.displayed-question')
|
||||
: _('unapproved-suggestions.confirmation-dialog.not-displayed-question');
|
||||
const data = new ConfirmationDialogInput({
|
||||
title: _('unapproved-suggestions.confirmation-dialog.title'),
|
||||
question: question,
|
||||
confirmationText: _('unapproved-suggestions.confirmation-dialog.confirmation-text'),
|
||||
denyText: _('unapproved-suggestions.confirmation-dialog.deny-text'),
|
||||
checkboxes: [
|
||||
{
|
||||
label: _('unapproved-suggestions.confirmation-dialog.checkbox-text'),
|
||||
value: false,
|
||||
},
|
||||
],
|
||||
checkboxesValidation: false,
|
||||
});
|
||||
|
||||
return this._dialogService.openDialog('confirm', null, data, result => {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result === ConfirmOptions.SECOND_CONFIRM) {
|
||||
this._userPreferenceService.toggleUnapprovedSuggestionsWarning();
|
||||
this._toaster.success(_('unapproved-suggestions.confirmation-dialog.success-confirmation-text'), {
|
||||
params: { settingsUrl: `${this._baseHref}/main/account/warnings-preferences` },
|
||||
});
|
||||
}
|
||||
}
|
||||
return this.viewModeService.switchToRedacted();
|
||||
this.viewModeService.switchToRedacted();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,13 +58,13 @@
|
||||
[disabled]="disabled || !valid || !changed"
|
||||
[label]="'edit-dossier-dialog.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
id="editDossierSaveButton"
|
||||
buttonId="editDossierSaveButton"
|
||||
></iqser-icon-button>
|
||||
|
||||
<iqser-icon-button
|
||||
(action)="save({ closeAfterSave: true })"
|
||||
[buttonId]="'saveAndClose'"
|
||||
[disabled]="disabled || !valid || !changed"
|
||||
[id]="'saveAndClose'"
|
||||
[label]="'edit-dossier-dialog.actions.save-and-close' | translate"
|
||||
[type]="iconButtonTypes.dark"
|
||||
></iqser-icon-button>
|
||||
@ -76,5 +76,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<iqser-circle-button (action)="close()" class="dialog-close" icon="iqser:close" id="editDossierCloseButton"></iqser-circle-button>
|
||||
<iqser-circle-button (action)="close()" buttonId="editDossierCloseButton" class="dialog-close" icon="iqser:close"></iqser-circle-button>
|
||||
</section>
|
||||
|
||||
@ -79,9 +79,9 @@
|
||||
<iqser-icon-button
|
||||
(action)="deleteDossier()"
|
||||
*ngIf="permissionsService.canSoftDeleteDossier(dossier)"
|
||||
[buttonId]="'deleteDossier'"
|
||||
[dialogElement]="true"
|
||||
[icon]="'iqser:trash'"
|
||||
[id]="'deleteDossier'"
|
||||
[iqserHelpMode]="'edit_dossier_delete_dossier'"
|
||||
[label]="'dossier-listing.delete.action' | translate"
|
||||
[type]="iconButtonTypes.dark"
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
import { NativeDateAdapter } from '@angular/material/core';
|
||||
import dayjs from 'dayjs';
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
dayjs.extend(customParseFormat);
|
||||
|
||||
@Injectable()
|
||||
export class CustomDateAdapter extends NativeDateAdapter {
|
||||
parse(value: any, parseFormat: string): Date | null {
|
||||
return dayjs(value, parseFormat).toDate();
|
||||
}
|
||||
|
||||
format(date: Date, displayFormat: string): string {
|
||||
return dayjs(date).format(displayFormat);
|
||||
}
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
(action)="save.emit(value)"
|
||||
[disabled]="value === oldUser"
|
||||
[tooltip]="'assign-user.save' | translate"
|
||||
buttonId="save-assignee"
|
||||
class="pl-1"
|
||||
icon="iqser:check"
|
||||
id="save-assignee"
|
||||
tooltipPosition="below"
|
||||
></iqser-circle-button>
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
<iqser-circle-button
|
||||
(action)="btn.action($event)"
|
||||
*ngIf="btn.type === 'circleBtn'"
|
||||
[id]="btn.id"
|
||||
[attr.aria-expanded]="btn.ariaExpanded && btn.ariaExpanded | async"
|
||||
[buttonId]="btn.id"
|
||||
[disabled]="btn.disabled"
|
||||
[icon]="btn.icon"
|
||||
[showDot]="btn.showDot"
|
||||
@ -16,12 +16,12 @@
|
||||
<!-- download redacted file-->
|
||||
<redaction-file-download-btn
|
||||
*ngIf="btn.type === 'downloadBtn'"
|
||||
[disabled]="btn.disabled"
|
||||
[dossier]="btn.dossier"
|
||||
[files]="btn.files"
|
||||
[tooltipClass]="btn.tooltipClass"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
[disabled]="btn.disabled"
|
||||
></redaction-file-download-btn>
|
||||
|
||||
<!-- exclude from redaction -->
|
||||
|
||||
@ -101,13 +101,13 @@
|
||||
[disabled]="disabled"
|
||||
[label]="'add-dossier-dialog.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
id="createDossierSaveButton"
|
||||
buttonId="createDossierSaveButton"
|
||||
></iqser-icon-button>
|
||||
|
||||
<iqser-icon-button
|
||||
(action)="save({ addMembers: true })"
|
||||
[buttonId]="'createDossierEditTeamButton'"
|
||||
[disabled]="disabled"
|
||||
[id]="'createDossierEditTeamButton'"
|
||||
[label]="'add-dossier-dialog.actions.save-and-add-members' | translate"
|
||||
[type]="iconButtonTypes.dark"
|
||||
icon="red:assign"
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
<section class="red-upload-download-overlay">
|
||||
<div (click)="collapsed = !collapsed" [class.expanded]="!collapsed" class="red-upload-download-header">
|
||||
<div class="title flex-2">
|
||||
{{ 'upload-status.dialog.title' | translate: { len: uploadService.files.length } }}
|
||||
{{ 'upload-status.dialog.title' | translate : { len: uploadService.files.length } }}
|
||||
</div>
|
||||
<span><mat-icon *ngIf="uploadError" [svgIcon]="'red:alert-circle'"></mat-icon></span>
|
||||
|
||||
<iqser-circle-button [icon]="'iqser:status-' + (collapsed ? 'expand' : 'collapse')" id="expand-upload-status"></iqser-circle-button>
|
||||
<iqser-circle-button
|
||||
[icon]="'iqser:status-' + (collapsed ? 'expand' : 'collapse')"
|
||||
buttonId="expand-upload-status"
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button (action)="closeDialog()" icon="iqser:close" id="close-upload-status"></iqser-circle-button>
|
||||
<iqser-circle-button (action)="closeDialog()" buttonId="close-upload-status" icon="iqser:close"></iqser-circle-button>
|
||||
</div>
|
||||
|
||||
<div [hidden]="collapsed" class="upload-download-list">
|
||||
@ -31,9 +34,7 @@
|
||||
<div *ngIf="!model.error" class="progress">{{ model.progress }}%</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="model.error" class="error-message">
|
||||
{{ model.error?.message }}
|
||||
</div>
|
||||
<div *ngIf="model.error" [innerHTML]="model.error?.message" class="error-message"></div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!model.error" class="upload-download-progress">
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 40517f145e0f8719e49ef133ef271f242d8dd078
|
||||
Subproject commit fe9a50d367901bc6b3c21794f5fd189ab69ce2c1
|
||||
Loading…
x
Reference in New Issue
Block a user