DM-413: Fixed edit button on sidebar.
This commit is contained in:
parent
9c153db8ba
commit
47f5a4bc76
@ -35,12 +35,7 @@
|
||||
|
||||
<iqser-circle-button
|
||||
(action)="annotationActionsService.editRedaction(annotations)"
|
||||
*ngIf="
|
||||
annotationPermissions.canChangeLegalBasis ||
|
||||
annotationPermissions.canRecategorizeAnnotation ||
|
||||
annotationPermissions.canForceRedaction ||
|
||||
annotationPermissions.canForceHint
|
||||
"
|
||||
*ngIf="canEdit"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltip]="'annotation-actions.edit-redaction.label' | translate"
|
||||
[type]="buttonType"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, computed, Input, OnChanges } from '@angular/core';
|
||||
import { HelpModeService, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { getConfig, HelpModeService, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { AnnotationPermissions } from '@models/file/annotation.permissions';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
@ -37,6 +37,7 @@ export class AnnotationActionsComponent implements OnChanges {
|
||||
const hidden = this._annotationManager.hidden();
|
||||
return this.#annotations.reduce((acc, annotation) => !hidden.has(annotation.id) && acc, true);
|
||||
});
|
||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||
|
||||
constructor(
|
||||
readonly viewModeService: ViewModeService,
|
||||
@ -54,6 +55,15 @@ export class AnnotationActionsComponent implements OnChanges {
|
||||
return this.#annotations;
|
||||
}
|
||||
|
||||
get canEdit() {
|
||||
const canEditRedactions =
|
||||
this.annotationPermissions.canChangeLegalBasis ||
|
||||
this.annotationPermissions.canRecategorizeAnnotation ||
|
||||
this.annotationPermissions.canForceHint ||
|
||||
this.annotationPermissions.canForceRedaction;
|
||||
return this.#isDocumine && this.annotations.length > 1 ? this.annotationPermissions.canEditAnnotations : canEditRedactions;
|
||||
}
|
||||
|
||||
@Input()
|
||||
set annotations(annotations: AnnotationWrapper[]) {
|
||||
this.#annotations = annotations.filter(a => a !== undefined);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user