mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
58789: Empty page error fix and navigate to last page on delete
This commit is contained in:
@@ -143,7 +143,6 @@ export class MetadataRegistryComponent {
|
|||||||
this.showNotification(false, failedResponses.length);
|
this.showNotification(false, failedResponses.length);
|
||||||
}
|
}
|
||||||
this.registryService.deselectAllMetadataSchema();
|
this.registryService.deselectAllMetadataSchema();
|
||||||
this.router.navigate([], { queryParams: { page: 1 }, queryParamsHandling: 'merge'});
|
|
||||||
this.forceUpdateSchemas();
|
this.forceUpdateSchemas();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -175,7 +175,6 @@ export class MetadataSchemaComponent implements OnInit {
|
|||||||
this.showNotification(false, failedResponses.length);
|
this.showNotification(false, failedResponses.length);
|
||||||
}
|
}
|
||||||
this.registryService.deselectAllMetadataField();
|
this.registryService.deselectAllMetadataField();
|
||||||
this.router.navigate([], { queryParams: { page: 1 }, queryParamsHandling: 'merge'});
|
|
||||||
this.forceUpdateFields();
|
this.forceUpdateFields();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,7 @@ import { RegistryMetadataschemasResponse } from '../registry/registry-metadatasc
|
|||||||
import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer';
|
import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.serializer';
|
||||||
import { DSOResponseParsingService } from './dso-response-parsing.service';
|
import { DSOResponseParsingService } from './dso-response-parsing.service';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { hasValue } from '../../shared/empty.util';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RegistryMetadataschemasResponseParsingService implements ResponseParsingService {
|
export class RegistryMetadataschemasResponseParsingService implements ResponseParsingService {
|
||||||
@@ -15,7 +16,10 @@ export class RegistryMetadataschemasResponseParsingService implements ResponsePa
|
|||||||
parse(request: RestRequest, data: DSpaceRESTV2Response): RestResponse {
|
parse(request: RestRequest, data: DSpaceRESTV2Response): RestResponse {
|
||||||
const payload = data.payload;
|
const payload = data.payload;
|
||||||
|
|
||||||
const metadataschemas = payload._embedded.metadataschemas;
|
let metadataschemas = [];
|
||||||
|
if (hasValue(payload._embedded)) {
|
||||||
|
metadataschemas = payload._embedded.metadataschemas;
|
||||||
|
}
|
||||||
payload.metadataschemas = metadataschemas;
|
payload.metadataschemas = metadataschemas;
|
||||||
|
|
||||||
const deserialized = new DSpaceRESTv2Serializer(RegistryMetadataschemasResponse).deserialize(payload);
|
const deserialized = new DSpaceRESTv2Serializer(RegistryMetadataschemasResponse).deserialize(payload);
|
||||||
|
Reference in New Issue
Block a user