mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[CST-4499] Version history - Minor fixes
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
<ng-container *ngIf="isThisBeingEdited(version); then editSummary else showSummary"></ng-container>
|
||||
<ng-template #showSummary>{{version?.summary}}</ng-template>
|
||||
<ng-template #editSummary>
|
||||
<input class="form-control" type="text" [(ngModel)]="versionBeingEditedSummary"/>
|
||||
<input class="form-control" type="text" [(ngModel)]="versionBeingEditedSummary" (keyup.enter)="onSummarySubmit()"/>
|
||||
</ng-template>
|
||||
</td>
|
||||
<td class="version-row-element-actions" *ngIf="displayActions">
|
||||
|
@@ -279,7 +279,7 @@ export class ItemVersionsComponent implements OnInit {
|
||||
mergeMap((item: Item) => combineLatest([
|
||||
of(item),
|
||||
this.versionHistoryService.getVersionHistoryFromVersion$(version).pipe(
|
||||
tap((versionHistory) => {
|
||||
tap((versionHistory: VersionHistory) => {
|
||||
this.versionHistoryService.invalidateVersionHistoryCache(versionHistory.id);
|
||||
})
|
||||
)
|
||||
@@ -298,7 +298,7 @@ export class ItemVersionsComponent implements OnInit {
|
||||
}),
|
||||
)
|
||||
])),
|
||||
).subscribe(([deleteHasSucceeded, newLatestVersionItem]) => {
|
||||
).subscribe(([deleteHasSucceeded, newLatestVersionItem]: [boolean, Item]) => {
|
||||
// Notify operation result and redirect to latest item
|
||||
if (deleteHasSucceeded) {
|
||||
this.notificationsService.success(null, this.translateService.get(successMessageKey, {'version': versionNumber}));
|
||||
@@ -334,7 +334,7 @@ export class ItemVersionsComponent implements OnInit {
|
||||
map((newVersionRD: RemoteData<Version>) => {
|
||||
if (newVersionRD.hasSucceeded) {
|
||||
const versionHistory$ = this.versionService.getHistoryFromVersion$(version).pipe(
|
||||
tap((res) => {
|
||||
tap((res: VersionHistory) => {
|
||||
this.versionHistoryService.invalidateVersionHistoryCache(res.id);
|
||||
}),
|
||||
);
|
||||
@@ -374,7 +374,7 @@ export class ItemVersionsComponent implements OnInit {
|
||||
false, true, followLink('item'), followLink('eperson'));
|
||||
}),
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((res) => {
|
||||
).subscribe((res: RemoteData<PaginatedList<Version>>) => {
|
||||
this.versionsRD$.next(res);
|
||||
});
|
||||
}
|
||||
@@ -386,18 +386,10 @@ export class ItemVersionsComponent implements OnInit {
|
||||
if (hasValue(this.item.version)) {
|
||||
this.versionRD$ = this.item.version;
|
||||
this.versionHistoryRD$ = this.versionRD$.pipe(
|
||||
// switchMap( (res) => {
|
||||
// if (res.hasFailed) {
|
||||
// return of(createFailedRemoteDataObject<VersionHistory>());
|
||||
// } else {
|
||||
// return of(res).pipe(
|
||||
getAllSucceededRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
hasValueOperator(),
|
||||
switchMap((version: Version) => version.versionhistory),
|
||||
// );
|
||||
// }
|
||||
// }),
|
||||
);
|
||||
|
||||
this.canCreateVersion$ = this.authorizationService.isAuthorized(FeatureID.CanCreateVersion, this.item.self);
|
||||
|
Reference in New Issue
Block a user