small dmp overview fixes

This commit is contained in:
amentis 2024-02-22 15:05:09 +02:00
parent 9f42381992
commit 40f56986b4
3 changed files with 3 additions and 3 deletions

View File

@ -493,7 +493,7 @@ public class DmpServiceImpl implements DmpService {
@Override
public Dmp removeUser(DmpUserRemovePersist model, FieldSet fields) throws InvalidApplicationException, IOException {
this.authorizationService.authorizeForce(Permission.AssignDmpUsers);
DmpEntity data = this.entityManager.find(DmpEntity.class, model.getId());
DmpEntity data = this.entityManager.find(DmpEntity.class, model.getDmpId());
if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), Dmp.class.getSimpleName()}, LocaleContextHolder.getLocale()));
List<DmpUserEntity> existingUsers = this.queryFactory.query(DmpUserQuery.class)

View File

@ -190,7 +190,7 @@
<p class="authors-role">{{ enumUtils.toDmpUserRoleString(dmpUser.role) }}</p>
</div>
</div>
<button *ngIf="isUserOwner && dmp.status === dmpStatusEnum.Draft && dmpUser.role === dmpUserRoleEnum.Owner" (click)="removeUserFromDmp(dmpUser)" class="remove-btn">{{ 'DMP-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}</button>
<button *ngIf="isUserOwner && dmp.status === dmpStatusEnum.Draft && dmpUser.role != dmpUserRoleEnum.Owner" (click)="removeUserFromDmp(dmpUser)" class="remove-btn">{{ 'DMP-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}</button>
</div>
</div>
<div *ngIf="isUserOwner" class="row mt-3 mb-3 d-flex align-items-center justify-content-center">

View File

@ -181,7 +181,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
setIsUserOwner() {
if (this.dmp) {
const principalId: Guid = this.authentication.userId();
if (principalId) this.isUserOwner = !!this.dmp.dmpUsers?.find(x => (x.role === DmpUserRole.Owner) && (principalId === x.id));
if (principalId) this.isUserOwner = !!this.dmp.dmpUsers?.find(x => (x.role === DmpUserRole.Owner) && (principalId === x.user?.id));
}
}