RED-5705: use deny directive
This commit is contained in:
parent
43a540a295
commit
6b57552048
@ -1,4 +1,4 @@
|
||||
<iqser-help-mode *ngIf="!permissionsService.has(roles.getRss)"></iqser-help-mode>
|
||||
<iqser-help-mode *deny="roles.getRss"></iqser-help-mode>
|
||||
|
||||
<div class="top-bar">
|
||||
<ng-template #menuPlaceholder>
|
||||
@ -27,7 +27,7 @@
|
||||
[placeholder]="'search.placeholder' | translate"
|
||||
></redaction-spotlight-search>
|
||||
|
||||
<iqser-help-button [iqserHelpMode]="'help_mode'" *ngIf="!permissionsService.has(roles.getRss)"></iqser-help-button>
|
||||
<iqser-help-button *deny="roles.getRss" [iqserHelpMode]="'help_mode'"></iqser-help-button>
|
||||
|
||||
<redaction-notifications [iqserHelpMode]="'open_notifications'"></redaction-notifications>
|
||||
</div>
|
||||
|
||||
@ -96,8 +96,8 @@
|
||||
{{ 'add-edit-clone-dossier-template.save' | translate }}
|
||||
</button>
|
||||
<iqser-help-button
|
||||
*deny="roles.getRss; if: !!dossierTemplate"
|
||||
helpButtonKey="edit_clone_delete_dossier_templates"
|
||||
*ngIf="dossierTemplate && !permissionsService.has(roles.getRss)"
|
||||
></iqser-help-button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -4,7 +4,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
import { downloadTypesTranslations } from '@translations/download-types-translations';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { BaseDialogComponent, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DossierTemplate, DownloadFileType, IDossierTemplate } from '@red/domain';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
@ -37,7 +37,6 @@ export class AddEditCloneDossierTemplateDialogComponent extends BaseDialogCompon
|
||||
private _lastValidTo: Dayjs;
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: IqserPermissionsService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
protected readonly _dialogRef: MatDialogRef<AddEditCloneDossierTemplateDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: EditCloneTemplateData,
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<button (click)="save()" [disabled]="disabled" color="primary" mat-flat-button type="button">
|
||||
{{ 'add-entity.save' | translate }}
|
||||
</button>
|
||||
<iqser-help-button helpButtonKey="create_new_entity" *ngIf="!permissionsService.has(roles.getRss)"></iqser-help-button>
|
||||
<iqser-help-button *deny="roles.getRss" helpButtonKey="create_new_entity"></iqser-help-button>
|
||||
</div>
|
||||
|
||||
<iqser-circle-button (click)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component, Inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AddEditEntityComponent } from '@shared/components/add-edit-entity/add-edit-entity.component';
|
||||
import { BaseDialogComponent, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { ROLES } from '@users/roles';
|
||||
|
||||
interface DialogData {
|
||||
@ -21,7 +21,6 @@ export class AddEntityDialogComponent extends BaseDialogComponent {
|
||||
|
||||
constructor(
|
||||
protected readonly _dialogRef: MatDialogRef<AddEntityDialogComponent>,
|
||||
readonly permissionsService: IqserPermissionsService,
|
||||
@Inject(MAT_DIALOG_DATA) private readonly _data: DialogData,
|
||||
) {
|
||||
super(_dialogRef, false);
|
||||
|
||||
@ -23,7 +23,8 @@
|
||||
</button>
|
||||
|
||||
<div (click)="revert()" [translate]="'entity.info.actions.revert'" class="all-caps-label cancel"></div>
|
||||
<iqser-help-button helpButtonKey="edit_delete_entities" *ngIf="!iqserPermissionsService.has(roles.getRss)"></iqser-help-button>
|
||||
|
||||
<iqser-help-button *deny="roles.getRss" helpButtonKey="edit_delete_entities"></iqser-help-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -5,7 +5,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { getCurrentUser } from '@users/user.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { AddEditEntityComponent } from '@shared/components/add-edit-entity/add-edit-entity.component';
|
||||
import { IqserEventTarget, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { IqserEventTarget } from '@iqser/common-ui';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ROLES } from '@users/roles';
|
||||
|
||||
@ -22,12 +22,7 @@ export class EntityInfoComponent {
|
||||
readonly roles = ROLES;
|
||||
@ViewChild(AddEditEntityComponent) private readonly _addEditEntityComponent: AddEditEntityComponent;
|
||||
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
dictionariesMapService: DictionariesMapService,
|
||||
readonly iqserPermissionsService: IqserPermissionsService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
) {
|
||||
constructor(route: ActivatedRoute, dictionariesMapService: DictionariesMapService, readonly permissionsService: PermissionsService) {
|
||||
this.dossierTemplateId = route.parent.snapshot.paramMap.get(DOSSIER_TEMPLATE_ID);
|
||||
const entityType = route.parent.snapshot.paramMap.get(ENTITY_TYPE);
|
||||
this.entity$ = dictionariesMapService.watch$(this.dossierTemplateId, entityType);
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
{{ 'annotation.pending' | translate }}
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<div *ngIf="annotation.entity">
|
||||
<strong>
|
||||
<span>{{ annotation.descriptor | translate }}</span
|
||||
@ -21,12 +22,15 @@
|
||||
</strong>
|
||||
{{ annotation.entity.label }}
|
||||
</div>
|
||||
<div *ngIf="annotation.shortContent && !annotation.isHint && !iqserPermissionsService.has(roles.getRss)">
|
||||
|
||||
<div *deny="roles.getRss; if: annotation.shortContent && !annotation.isHint">
|
||||
<strong><span translate="content"></span>: </strong>{{ annotation.shortContent }}
|
||||
</div>
|
||||
|
||||
<div *ngIf="annotation.isEarmark">
|
||||
<strong><span translate="color"></span>: </strong>{{ annotation.color }}
|
||||
</div>
|
||||
|
||||
<div *ngIf="annotation.isEarmark">
|
||||
<strong><span translate="size"></span>: </strong>{{ annotation.width }}x{{ annotation.height }} px
|
||||
</div>
|
||||
|
||||
@ -3,7 +3,6 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { MultiSelectService } from '../../services/multi-select.service';
|
||||
import { annotationTypesTranslations } from '@translations/annotation-types-translations';
|
||||
import { ROLES } from '@users/roles';
|
||||
import { IqserPermissionsService } from '@iqser/common-ui';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-annotation-card',
|
||||
@ -13,9 +12,9 @@ import { IqserPermissionsService } from '@iqser/common-ui';
|
||||
})
|
||||
export class AnnotationCardComponent {
|
||||
readonly roles = ROLES;
|
||||
annotationTypesTranslations = annotationTypesTranslations;
|
||||
readonly annotationTypesTranslations = annotationTypesTranslations;
|
||||
@Input() annotation: AnnotationWrapper;
|
||||
@Input() isSelected = false;
|
||||
|
||||
constructor(readonly iqserPermissionsService: IqserPermissionsService, readonly multiSelectService: MultiSelectService) {}
|
||||
constructor(readonly multiSelectService: MultiSelectService) {}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
<button
|
||||
(click)="switchView(viewModes.DELTA)"
|
||||
*ngIf="!permissionsService.has(roles.getRss)"
|
||||
*deny="roles.getRss"
|
||||
[class.active]="viewMode === viewModes.DELTA"
|
||||
[disabled]="(canSwitchToDeltaView$ | async) === false"
|
||||
[iqserHelpMode]="'views'"
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<button
|
||||
(click)="switchView(viewModes.REDACTED)"
|
||||
*ngIf="!permissionsService.has(roles.getRss)"
|
||||
*deny="roles.getRss"
|
||||
[class.active]="viewMode === viewModes.REDACTED"
|
||||
[disabled]="(canSwitchToRedactedView$ | async) === false"
|
||||
[iqserHelpMode]="'views'"
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
<button
|
||||
(click)="switchView(viewModes.TEXT_HIGHLIGHTS)"
|
||||
*ngIf="!permissionsService.has(roles.getRss)"
|
||||
*deny="roles.getRss"
|
||||
[class.active]="viewMode === viewModes.TEXT_HIGHLIGHTS"
|
||||
[disabled]="(canSwitchToEarmarksView$ | async) === false"
|
||||
[iqserHelpMode]="'views'"
|
||||
|
||||
@ -5,7 +5,7 @@ import { FilePreviewStateService } from '../../services/file-preview-state.servi
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { FileDataService } from '../../services/file-data.service';
|
||||
import { BASE_HREF, ConfirmationDialogInput, ConfirmOptions, IqserPermissionsService, Toaster } from '@iqser/common-ui';
|
||||
import { BASE_HREF, ConfirmationDialogInput, ConfirmOptions, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { FilePreviewDialogService } from '../../services/file-preview-dialog.service';
|
||||
@ -27,7 +27,6 @@ export class ViewSwitchComponent {
|
||||
constructor(
|
||||
@Inject(BASE_HREF) private readonly _baseHref: string,
|
||||
readonly viewModeService: ViewModeService,
|
||||
readonly permissionsService: IqserPermissionsService,
|
||||
private readonly _stateService: FilePreviewStateService,
|
||||
private readonly _fileDataService: FileDataService,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<iqser-details-radio [options]="options" [displayInRow]="true" formControlName="option" class="mt-25"></iqser-details-radio>
|
||||
<iqser-details-radio [displayInRow]="true" [options]="options" class="mt-25" formControlName="option"></iqser-details-radio>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!data.color">
|
||||
@ -33,8 +33,10 @@
|
||||
<button [disabled]="form.invalid" color="primary" mat-flat-button type="submit">
|
||||
{{ translations[data.operation].save | translate }}
|
||||
</button>
|
||||
|
||||
<div class="all-caps-label cancel" mat-dialog-close translate="highlight-action-dialog.actions.cancel"></div>
|
||||
<iqser-help-button helpButtonKey="highlights" *ngIf="!permissionsService.has(roles.getRss)"></iqser-help-button>
|
||||
|
||||
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="'highlights'"></iqser-help-button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { Component, Inject } from '@angular/core';
|
||||
import { UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { EarmarkOperation, EarmarkOperationPages } from '@red/domain';
|
||||
import { BaseDialogComponent, DetailsRadioOption, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { BaseDialogComponent, DetailsRadioOption } from '@iqser/common-ui';
|
||||
import { EarmarksService } from '@services/files/earmarks.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
@ -24,9 +24,8 @@ export interface HighlightActionData {
|
||||
})
|
||||
export class HighlightActionDialogComponent extends BaseDialogComponent {
|
||||
readonly translations = highlightsTranslations;
|
||||
readonly #operation = this.data.operation;
|
||||
readonly roles = ROLES;
|
||||
|
||||
readonly #operation = this.data.operation;
|
||||
readonly options: DetailsRadioOption<EarmarkOperationPages>[] = [
|
||||
{
|
||||
label: highlightsTranslations[this.#operation].options[EarmarkOperationPages.THIS_PAGE].label,
|
||||
@ -41,7 +40,6 @@ export class HighlightActionDialogComponent extends BaseDialogComponent {
|
||||
];
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: IqserPermissionsService,
|
||||
protected readonly _dialogRef: MatDialogRef<HighlightActionDialogComponent>,
|
||||
private readonly _textHighlightService: EarmarksService,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: HighlightActionData,
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
tooltipPosition="below"
|
||||
></iqser-circle-button>
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
*ngIf="isEditingSelectedText"
|
||||
formControlName="selectedText"
|
||||
@ -23,8 +24,7 @@
|
||||
name="comment"
|
||||
rows="4"
|
||||
type="text"
|
||||
>
|
||||
</textarea>
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div *ngIf="isRectangle" class="iqser-input-group">
|
||||
@ -35,8 +35,8 @@
|
||||
*ngIf="!isFalsePositiveRequest && (isDictionaryRequest || !manualRedactionTypeExists)"
|
||||
class="iqser-input-group required w-450"
|
||||
>
|
||||
<label translate="manual-annotation.dialog.content.dictionary" *ngIf="isDictionaryRequest"></label>
|
||||
<label translate="manual-annotation.dialog.content.type" *ngIf="!isDictionaryRequest"></label>
|
||||
<label *ngIf="isDictionaryRequest" translate="manual-annotation.dialog.content.dictionary"></label>
|
||||
<label *ngIf="!isDictionaryRequest" translate="manual-annotation.dialog.content.type"></label>
|
||||
|
||||
<mat-select formControlName="dictionary">
|
||||
<mat-select-trigger>{{ displayedDictionaryLabel }}</mat-select-trigger>
|
||||
@ -51,7 +51,7 @@
|
||||
</mat-select>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!isDictionaryRequest && !iqserPermissionsService.has(roles.getRss)" class="iqser-input-group required w-450">
|
||||
<div *deny="roles.getRss; if: !isDictionaryRequest" class="iqser-input-group required w-450">
|
||||
<label translate="manual-annotation.dialog.content.reason"></label>
|
||||
<mat-select
|
||||
[placeholder]="'manual-annotation.dialog.content.reason-placeholder' | translate"
|
||||
@ -69,7 +69,7 @@
|
||||
</mat-select>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!isDictionaryRequest && !iqserPermissionsService.has(roles.getRss)" class="iqser-input-group w-450">
|
||||
<div *deny="roles.getRss; if: !isDictionaryRequest" class="iqser-input-group w-450">
|
||||
<label translate="manual-annotation.dialog.content.legalBasis"></label>
|
||||
<input [value]="form.get('reason').value?.legalBasis" disabled type="text" />
|
||||
</div>
|
||||
|
||||
@ -174,7 +174,6 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
|
||||
if (this.iqserPermissionsService.has(ROLES.getRss)) {
|
||||
const selectedType = this.possibleDictionaries.find(d => d.type === addRedactionRequest.type);
|
||||
console.log(selectedType.hasDictionary);
|
||||
addRedactionRequest.addToDictionary = selectedType.hasDictionary;
|
||||
} else {
|
||||
addRedactionRequest.addToDictionary = this.isDictionaryRequest && addRedactionRequest.type !== 'dossier_redaction';
|
||||
|
||||
@ -63,17 +63,18 @@
|
||||
>
|
||||
{{ 'edit-dossier-dialog.actions.save' | translate }}
|
||||
</button>
|
||||
|
||||
<iqser-icon-button
|
||||
(action)="save({ closeAfterSave: true })"
|
||||
[disabled]="disabled || !valid || !changed"
|
||||
[id]="'saveAndClose'"
|
||||
[label]="'edit-dossier-dialog.actions.save-and-close' | translate"
|
||||
[type]="iconButtonTypes.dark"
|
||||
>
|
||||
</iqser-icon-button>
|
||||
></iqser-icon-button>
|
||||
|
||||
<div (click)="revert()" class="all-caps-label cancel" id="revert" translate="edit-dossier-dialog.actions.revert"></div>
|
||||
|
||||
<iqser-help-button [dialogButton]="true" *ngIf="!iqserPermissionsService.has(roles.getRss)"></iqser-help-button>
|
||||
<iqser-help-button *deny="roles.getRss" [dialogButton]="true"></iqser-help-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -18,6 +18,7 @@ import {
|
||||
IqserEmptyStatesModule,
|
||||
IqserHelpModeModule,
|
||||
IqserInputsModule,
|
||||
IqserPermissionsModule,
|
||||
IqserScrollbarModule,
|
||||
IqserSharedModule,
|
||||
IqserUsersModule,
|
||||
@ -52,6 +53,7 @@ const services = [DossiersDialogService, FileAssignService];
|
||||
IqserSharedModule,
|
||||
IqserInputsModule,
|
||||
IqserScrollbarModule,
|
||||
IqserPermissionsModule,
|
||||
],
|
||||
})
|
||||
export class SharedDossiersModule {}
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
icon="red:assign"
|
||||
></iqser-icon-button>
|
||||
|
||||
<iqser-help-button [helpButtonKey]="'new_dossier_button'" *ngIf="!permissionsService.has(roles.getRss)"></iqser-help-button>
|
||||
<iqser-help-button *deny="roles.getRss" [helpButtonKey]="'new_dossier_button'"></iqser-help-button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"ADMIN_CONTACT_NAME": null,
|
||||
"ADMIN_CONTACT_URL": null,
|
||||
"API_URL": "https://syngenta-scm.iqser.cloud/redaction-gateway-v1",
|
||||
"API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1",
|
||||
"APP_NAME": "RedactManager",
|
||||
"AUTO_READ_TIME": 3,
|
||||
"BACKEND_APP_VERSION": "4.4.40",
|
||||
@ -11,11 +11,11 @@
|
||||
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
||||
"OAUTH_CLIENT_ID": "redaction",
|
||||
"OAUTH_IDP_HINT": null,
|
||||
"OAUTH_URL": "https://syngenta-scm.iqser.cloud/auth/realms/redaction",
|
||||
"OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction",
|
||||
"RECENT_PERIOD_IN_HOURS": 24,
|
||||
"SELECTION_MODE": "structural",
|
||||
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",
|
||||
"ANNOTATIONS_THRESHOLD": 1000,
|
||||
"THEME": "scm",
|
||||
"BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/scm/"
|
||||
"THEME": "redact",
|
||||
"BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/redact/"
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 05d6488bc8952d70b81bf9d95bab6d6928d81fad
|
||||
Subproject commit a4b9c045cd8dae1418bc274d311e6b938d9ddbf5
|
||||
Loading…
x
Reference in New Issue
Block a user