Merge remote-tracking branch 'origin/master' into updates

This commit is contained in:
Dan Percic 2021-05-17 13:56:10 +03:00
commit b3ce5d7914
6 changed files with 18 additions and 6 deletions

View File

@ -64,6 +64,7 @@
<redaction-dictionary-manager
[initialDictionaryEntries]="entries"
[canEdit]="permissionsService.isAdmin()"
(saveDictionary)="saveEntries($event)"
#dictionaryManager
></redaction-dictionary-manager>

View File

@ -6,13 +6,14 @@
<redaction-dictionary-manager
#dictionaryManager
[withFloatingActions]="false"
[canEdit]="canEdit"
[initialDictionaryEntries]="project.type?.entries"
></redaction-dictionary-manager>
</div>
<div class="dialog-actions">
<button
[disabled]="!dictionaryManager.hasChanges"
[disabled]="!canEdit || !dictionaryManager.hasChanges"
color="primary"
mat-flat-button
type="submit"

View File

@ -4,6 +4,7 @@ import { ProjectWrapper } from '../../../../state/model/project.wrapper';
import { DictionaryManagerComponent } from '../../../shared/components/dictionary-manager/dictionary-manager.component';
import { DictionarySaveService } from '../../../shared/services/dictionary-save.service';
import { AppStateService } from '../../../../state/app-state.service';
import { PermissionsService } from '../../../../services/permissions.service';
@Component({
selector: 'redaction-dossier-dictionary-dialog',
@ -14,12 +15,19 @@ export class DossierDictionaryDialogComponent {
@ViewChild('dictionaryManager', { static: false })
private _dictionaryManager: DictionaryManagerComponent;
canEdit: boolean = false;
constructor(
public permissionsService: PermissionsService,
public dialogRef: MatDialogRef<DossierDictionaryDialogComponent>,
@Inject(MAT_DIALOG_DATA) public project: ProjectWrapper,
private readonly _appStateService: AppStateService,
private readonly _dictionarySaveService: DictionarySaveService
) {}
) {
this.canEdit =
this.permissionsService.isProjectMember(this.project) ||
this.permissionsService.isAdmin();
}
saveDossierDictionary() {
this._dictionarySaveService

View File

@ -70,7 +70,7 @@
[autoUpdateContent]="true"
[mode]="'text'"
[options]="aceOptions"
[readOnly]="!permissionsService.isAdmin()"
[readOnly]="!canEdit"
[theme]="'eclipse'"
class="ace-redaction"
>
@ -101,7 +101,7 @@
</div>
<div
*ngIf="withFloatingActions && hasChanges && permissionsService.isAdmin()"
*ngIf="withFloatingActions && hasChanges && canEdit"
[class.offset]="compareForm.get('active').value"
class="changes-box"
>

View File

@ -32,6 +32,9 @@ export class DictionaryManagerComponent implements OnInit, OnChanges {
@Input()
initialDictionaryEntries: string[];
@Input()
canEdit = false;
@Output()
saveDictionary = new EventEmitter<string[]>();
@ -55,7 +58,6 @@ export class DictionaryManagerComponent implements OnInit, OnChanges {
@ViewChild('compareEditorComponent') private _compareEditorComponent: AceEditorComponent;
constructor(
readonly permissionsService: PermissionsService,
private readonly _notificationService: NotificationService,
protected readonly _translateService: TranslateService,
private readonly _dictionaryControllerService: DictionaryControllerService,

View File

@ -1,6 +1,6 @@
{
"name": "redaction",
"version": "2.40.0",
"version": "2.41.0",
"private": true,
"license": "MIT",
"scripts": {