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