efsa improvements
This commit is contained in:
parent
3b64d7b785
commit
1a1a1e7f97
@ -72,6 +72,8 @@ const components = [AppComponent, AuthErrorComponent, NotificationsComponent, Sp
|
|||||||
closeButton: true,
|
closeButton: true,
|
||||||
enableHtml: true,
|
enableHtml: true,
|
||||||
toastComponent: ToastComponent,
|
toastComponent: ToastComponent,
|
||||||
|
preventDuplicates: true,
|
||||||
|
resetTimeoutOnDuplicate: true,
|
||||||
}),
|
}),
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
|
|||||||
@ -70,6 +70,7 @@
|
|||||||
<p class="download-includes">{{ 'download-includes' | translate }}</p>
|
<p class="download-includes">{{ 'download-includes' | translate }}</p>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<redaction-select
|
<redaction-select
|
||||||
|
[height]="150"
|
||||||
[label]="'report-type.label' | translate: { length: reportTemplateIdsLength }"
|
[label]="'report-type.label' | translate: { length: reportTemplateIdsLength }"
|
||||||
[optionTemplate]="reportTemplateOptionTemplate"
|
[optionTemplate]="reportTemplateOptionTemplate"
|
||||||
[options]="availableReportTypes"
|
[options]="availableReportTypes"
|
||||||
@ -78,6 +79,7 @@
|
|||||||
formControlName="reportTemplateIds"
|
formControlName="reportTemplateIds"
|
||||||
></redaction-select>
|
></redaction-select>
|
||||||
<redaction-select
|
<redaction-select
|
||||||
|
[height]="150"
|
||||||
[label]="'download-type.label' | translate: { length: downloadFileTypesLength }"
|
[label]="'download-type.label' | translate: { length: downloadFileTypesLength }"
|
||||||
[options]="downloadTypes"
|
[options]="downloadTypes"
|
||||||
formControlName="downloadFileTypes"
|
formControlName="downloadFileTypes"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<mat-icon [svgIcon]="'red:redaction-changes'"></mat-icon>
|
<mat-icon [svgIcon]="'red:redaction-changes'"></mat-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="hasEnginesToShow">
|
<ng-container *ngIf="hasEnginesToShow && !isSelected">
|
||||||
<div #trigger="cdkOverlayOrigin" (mouseout)="isPopoverOpen = false" (mouseover)="isPopoverOpen = true" cdkOverlayOrigin class="chip">
|
<div #trigger="cdkOverlayOrigin" (mouseout)="isPopoverOpen = false" (mouseover)="isPopoverOpen = true" cdkOverlayOrigin class="chip">
|
||||||
<ng-container *ngFor="let engine of engines">
|
<ng-container *ngFor="let engine of engines">
|
||||||
<mat-icon *ngIf="engine.show" [svgIcon]="engine.icon"></mat-icon>
|
<mat-icon *ngIf="engine.show" [svgIcon]="engine.icon"></mat-icon>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ type EngineName = keyof typeof Engines;
|
|||||||
})
|
})
|
||||||
export class AnnotationDetailsComponent implements OnChanges {
|
export class AnnotationDetailsComponent implements OnChanges {
|
||||||
@Input() annotation: AnnotationWrapper;
|
@Input() annotation: AnnotationWrapper;
|
||||||
|
@Input() isSelected: boolean;
|
||||||
|
|
||||||
isPopoverOpen = false;
|
isPopoverOpen = false;
|
||||||
hasEnginesToShow: boolean;
|
hasEnginesToShow: boolean;
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
<redaction-comments #comments [annotation]="annotation"></redaction-comments>
|
<redaction-comments #comments [annotation]="annotation"></redaction-comments>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<redaction-annotation-details [annotation]="annotation"></redaction-annotation-details>
|
<redaction-annotation-details [annotation]="annotation" [isSelected]="isSelected(annotation.id)"></redaction-annotation-details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="annotationReferencesService.annotation$ | async as annotation">
|
<ng-container *ngIf="annotationReferencesService.annotation$ | async as annotation">
|
||||||
|
|||||||
@ -2,8 +2,8 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Out
|
|||||||
import { File, ViewMode } from '@red/domain';
|
import { File, ViewMode } from '@red/domain';
|
||||||
import { ViewModeService } from '../../services/view-mode.service';
|
import { ViewModeService } from '../../services/view-mode.service';
|
||||||
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
||||||
import { Observable } from 'rxjs';
|
import { combineLatest, Observable } from 'rxjs';
|
||||||
import { filter, switchMap } from 'rxjs/operators';
|
import { filter, map, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-view-switch [file]',
|
selector: 'redaction-view-switch [file]',
|
||||||
@ -21,7 +21,11 @@ export class ViewSwitchComponent implements OnChanges {
|
|||||||
constructor(readonly viewModeService: ViewModeService, private readonly _stateService: FilePreviewStateService) {
|
constructor(readonly viewModeService: ViewModeService, private readonly _stateService: FilePreviewStateService) {
|
||||||
this.canSwitchToDeltaView$ = this._stateService.fileData$.pipe(
|
this.canSwitchToDeltaView$ = this._stateService.fileData$.pipe(
|
||||||
filter(fileData => !!fileData),
|
filter(fileData => !!fileData),
|
||||||
switchMap(fileData => fileData?.hasChangeLog$),
|
switchMap(fileData =>
|
||||||
|
combineLatest([fileData.hasChangeLog$, fileData.file$]).pipe(
|
||||||
|
map(([hasChangeLog, file]) => hasChangeLog && !file.isApproved),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/34641281/how-to-add-class-to-host-element
|
||||||
|
:host(.fixed-height) {
|
||||||
|
height: var(--height);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
::ng-deep .mat-chip-list {
|
||||||
|
height: calc(var(--height) - 44px);
|
||||||
|
|
||||||
|
.mat-chip-list-wrapper {
|
||||||
|
height: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.label-header {
|
.label-header {
|
||||||
padding: 16px 16px 14px 16px;
|
padding: 16px 16px 14px 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { AfterViewInit, ChangeDetectorRef, Component, Input, TemplateRef, ViewChild } from '@angular/core';
|
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, HostBinding, Input, TemplateRef, ViewChild } from '@angular/core';
|
||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||||
import { MatChip, MatChipList, MatChipSelectionChange } from '@angular/material/chips';
|
import { MatChip, MatChipList, MatChipSelectionChange } from '@angular/material/chips';
|
||||||
|
|
||||||
@ -20,13 +20,27 @@ export class SelectComponent implements AfterViewInit, ControlValueAccessor {
|
|||||||
@Input() options: any[];
|
@Input() options: any[];
|
||||||
@Input() disabled = false;
|
@Input() disabled = false;
|
||||||
@Input() multiple = true;
|
@Input() multiple = true;
|
||||||
|
|
||||||
@ViewChild(MatChipList) chipList: MatChipList;
|
@ViewChild(MatChipList) chipList: MatChipList;
|
||||||
|
|
||||||
private _value: any[] = [];
|
private _value: any[] = [];
|
||||||
private _onChange: (value: any[]) => void;
|
private _onChange: (value: any[]) => void;
|
||||||
|
|
||||||
constructor(private readonly _changeDetector: ChangeDetectorRef) {}
|
constructor(private readonly _changeDetector: ChangeDetectorRef, private readonly _elementRef: ElementRef) {}
|
||||||
|
|
||||||
|
@HostBinding('class.fixed-height')
|
||||||
|
get isFixedHeight(): boolean {
|
||||||
|
return !!this._height;
|
||||||
|
}
|
||||||
|
|
||||||
|
private _height?: number;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
set height(value: number) {
|
||||||
|
this._height = value;
|
||||||
|
if (this.isFixedHeight) {
|
||||||
|
const nativeElement = this._elementRef.nativeElement as HTMLElement;
|
||||||
|
nativeElement.style.setProperty('--height', `${this._height}px`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Input() valueMapper: (option: any) => any = option => option.key;
|
@Input() valueMapper: (option: any) => any = option => option.key;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user