Fix repositories list update after deposit

This commit is contained in:
Konstantinos Triantafyllou 2023-01-31 17:39:17 +02:00
parent 6924d82c80
commit 8b34d55706
2 changed files with 6 additions and 2 deletions

View File

@ -167,7 +167,7 @@
<hr class="hr-line"> <hr class="hr-line">
</div> </div>
</div> </div>
<app-dmp-deposit-dropdown *ngIf="(hasDoi(dmp) || moreDeposit()) && isFinalizedDmp(dmp) && !this.isPublicView && isUserOwner" [inputRepos]="depositRepos" [dmp]="dmp" (outputReposEmitter)="afterDeposit($event)"></app-dmp-deposit-dropdown> <app-dmp-deposit-dropdown *ngIf="(hasDoi(dmp) || moreDeposit()) && isFinalizedDmp(dmp) && !this.isPublicView && isUserOwner" [inputRepos]="inputRepos" [dmp]="dmp" (outputReposEmitter)="afterDeposit($event)"></app-dmp-deposit-dropdown>
<div *ngIf="isFinalizedDmp(dmp) && hasDoi(dmp) && !isPublishedDMP(dmp) && isUserOwner" (click)="reverse()" class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center"> <div *ngIf="isFinalizedDmp(dmp) && hasDoi(dmp) && !isPublishedDMP(dmp) && isUserOwner" (click)="reverse()" class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center">
<button mat-mini-fab class="frame-btn"> <button mat-mini-fab class="frame-btn">
<mat-icon class="mat-mini-fab-icon">unarchive</mat-icon> <mat-icon class="mat-mini-fab-icon">unarchive</mat-icon>

View File

@ -508,12 +508,16 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
afterDeposit(result: DoiModel[]) { afterDeposit(result: DoiModel[]) {
if (result.length > 0) { if (result.length > 0) {
this.dmp.dois.push(...result); this.dmp.dois = result;
this.selectedModel = this.dmp.dois[this.dmp.dois.length - 1]; this.selectedModel = this.dmp.dois[this.dmp.dois.length - 1];
this.hasDOIToken = true; this.hasDOIToken = true;
} }
} }
get inputRepos() {
return this.depositRepos.filter(repo => !this.dmp.dois.find(doi => doi.repositoryId === repo.repositoryId));
}
moreDeposit(){ moreDeposit(){
return (this.dmp.dois.length < this.depositRepos.length); return (this.dmp.dois.length < this.depositRepos.length);
} }