77742: Collection template-item loading indicator and error alert

This commit is contained in:
Kristof De Langhe
2021-03-16 13:18:11 +01:00
parent 0465ce0bc8
commit fd6605cc27
3 changed files with 13 additions and 0 deletions

View File

@@ -6,6 +6,8 @@
<ds-item-metadata [updateService]="itemTemplateService" [item]="itemRD?.payload"></ds-item-metadata>
<button [routerLink]="getCollectionEditUrl(collection)" class="btn btn-outline-secondary">{{ 'collection.edit.template.cancel' | translate }}</button>
</ng-container>
<ds-loading *ngIf="itemRD?.isLoading" [message]="'collection.edit.template.loading' | translate"></ds-loading>
<ds-alert *ngIf="itemRD?.hasFailed" [type]="AlertTypeEnum.Error" [content]="'collection.edit.template.error' | translate"></ds-alert>
</div>
</div>
</div>

View File

@@ -8,6 +8,7 @@ import { ItemTemplateDataService } from '../../core/data/item-template-data.serv
import { getCollectionEditRoute } from '../collection-page-routing-paths';
import { Item } from '../../core/shared/item.model';
import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators';
import { AlertType } from '../../shared/alert/aletr-type';
@Component({
selector: 'ds-edit-item-template-page',
@@ -28,6 +29,12 @@ export class EditItemTemplatePageComponent implements OnInit {
*/
itemRD$: Observable<RemoteData<Item>>;
/**
* The AlertType enumeration
* @type {AlertType}
*/
AlertTypeEnum = AlertType;
constructor(protected route: ActivatedRoute,
public itemTemplateService: ItemTemplateDataService) {
}

View File

@@ -777,10 +777,14 @@
"collection.edit.template.edit-button": "Edit",
"collection.edit.template.error": "An error occurred retrieving the template item",
"collection.edit.template.head": "Edit Template Item for Collection \"{{ collection }}\"",
"collection.edit.template.label": "Template item",
"collection.edit.template.loading": "Loading template item...",
"collection.edit.template.notifications.delete.error": "Failed to delete the item template",
"collection.edit.template.notifications.delete.success": "Successfully deleted the item template",