Can edit project dictionary

This commit is contained in:
Adina Țeudan 2021-05-17 18:38:07 +03:00
parent 29ef80f7cd
commit dbf0d6cc8b
3 changed files with 10 additions and 4 deletions

View File

@ -12,10 +12,9 @@ import { PermissionsService } from '../../../../services/permissions.service';
styleUrls: ['./dossier-dictionary-dialog.component.scss']
})
export class DossierDictionaryDialogComponent {
canEdit = false;
@ViewChild('dictionaryManager', { static: false }) private _dictionaryManager: DictionaryManagerComponent;
canEdit: boolean = false;
constructor(
public permissionsService: PermissionsService,
public dialogRef: MatDialogRef<DossierDictionaryDialogComponent>,

View File

@ -1 +1,5 @@
<redaction-dictionary-manager [initialDictionaryEntries]="projectWrapper.type?.entries || []" [withFloatingActions]="false"></redaction-dictionary-manager>
<redaction-dictionary-manager
[canEdit]="canEdit"
[initialDictionaryEntries]="projectWrapper.type?.entries || []"
[withFloatingActions]="false"
></redaction-dictionary-manager>

View File

@ -14,13 +14,16 @@ import { PermissionsService } from '../../../../../services/permissions.service'
export class EditProjectDictionaryComponent implements EditProjectSectionInterface {
@Input() projectWrapper: ProjectWrapper;
@Output() updateProject = new EventEmitter<any>();
canEdit = false;
@ViewChild(DictionaryManagerComponent, { static: false }) private _dictionaryManager: DictionaryManagerComponent;
constructor(
private readonly _appStateService: AppStateService,
private readonly _dictionarySaveService: DictionarySaveService,
private readonly _permissionsService: PermissionsService
) {}
) {
this.canEdit = this._permissionsService.isProjectMember(this.projectWrapper) || this._permissionsService.isAdmin();
}
get changed() {
return this._dictionaryManager.hasChanges;