RED-5779 - Actions not correctly disabled when both page and file are excluded

This commit is contained in:
Valentin Mihai 2022-12-14 13:53:10 +02:00
parent 15420778fd
commit 1386509ef7

View File

@ -88,6 +88,7 @@ export class PdfProxyService {
),
tap(canPerformActions => (this.canPerformActions = canPerformActions)),
tap(() => this._handleCustomActions()),
tap(() => this._configureTextPopup()),
shareDistinctLast(),
);
}
@ -106,7 +107,6 @@ export class PdfProxyService {
loadViewer() {
this._configureElements();
this._configureTextPopup();
}
#deactivateMultiSelect() {
@ -233,35 +233,37 @@ export class PdfProxyService {
private _configureTextPopup() {
const popups: IHeaderElement[] = [];
// Adding directly to the false-positive dict is only available in dev-mode
if (this._userPreferenceService.areDevFeaturesEnabled) {
popups.push({
type: 'actionButton',
dataElement: TextPopups.ADD_FALSE_POSITIVE,
img: this.#falsePositiveIcon,
title: this.#getTitle(ManualRedactionEntryTypes.FALSE_POSITIVE),
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.FALSE_POSITIVE),
});
}
if (this._iqserPermissionsService.has(ROLES.redactions.write) || this._iqserPermissionsService.has(ROLES.redactions.request)) {
popups.push({
type: 'actionButton',
dataElement: TextPopups.ADD_REDACTION,
img: this.#addRedactionIcon,
title: this.#getTitle(ManualRedactionEntryTypes.REDACTION),
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.REDACTION),
});
if (!this._iqserPermissionsService.has(ROLES.getRss)) {
if (!this._state.file.isApproved) {
// Adding directly to the false-positive dict is only available in dev-mode
if (this._userPreferenceService.areDevFeaturesEnabled) {
popups.push({
type: 'actionButton',
dataElement: TextPopups.ADD_DICTIONARY,
img: this.#addDictIcon,
title: this.#getTitle(ManualRedactionEntryTypes.DICTIONARY),
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.DICTIONARY),
dataElement: TextPopups.ADD_FALSE_POSITIVE,
img: this.#falsePositiveIcon,
title: this.#getTitle(ManualRedactionEntryTypes.FALSE_POSITIVE),
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.FALSE_POSITIVE),
});
}
if (this._iqserPermissionsService.has(ROLES.redactions.write) || this._iqserPermissionsService.has(ROLES.redactions.request)) {
popups.push({
type: 'actionButton',
dataElement: TextPopups.ADD_REDACTION,
img: this.#addRedactionIcon,
title: this.#getTitle(ManualRedactionEntryTypes.REDACTION),
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.REDACTION),
});
if (!this._iqserPermissionsService.has(ROLES.getRss)) {
popups.push({
type: 'actionButton',
dataElement: TextPopups.ADD_DICTIONARY,
img: this.#addDictIcon,
title: this.#getTitle(ManualRedactionEntryTypes.DICTIONARY),
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.DICTIONARY),
});
}
}
}
this._pdf.configureTextPopups(popups);