mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
101108: Angular 14 upgrade - build fixes #1
This commit is contained in:
6
src/app/core/cache/builders/link.service.ts
vendored
6
src/app/core/cache/builders/link.service.ts
vendored
@@ -60,7 +60,7 @@ export class LinkService {
|
||||
const provider = this.getDataServiceFor(matchingLinkDef.resourceType);
|
||||
|
||||
if (hasNoValue(provider)) {
|
||||
throw new Error(`The @link() for ${linkToFollow.name} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`);
|
||||
throw new Error(`The @link() for ${String(linkToFollow.name)} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`);
|
||||
}
|
||||
|
||||
const service: HALDataService<any> = Injector.create({
|
||||
@@ -79,12 +79,12 @@ export class LinkService {
|
||||
return service.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${linkToFollow.name} at ${href}`);
|
||||
console.error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${String(linkToFollow.name)} at ${href}`);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
} else if (!linkToFollow.isOptional) {
|
||||
throw new Error(`followLink('${linkToFollow.name}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${linkToFollow.name}`);
|
||||
throw new Error(`followLink('${String(linkToFollow.name)}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${String(linkToFollow.name)}`);
|
||||
}
|
||||
|
||||
return EMPTY;
|
||||
|
@@ -72,7 +72,7 @@ export class RemoteDataBuildService {
|
||||
if (hasValue(obj)) {
|
||||
if (getResourceTypeValueFor((obj as any).type) === PAGINATED_LIST.value) {
|
||||
return this.buildPaginatedList<T>(obj, ...linksToFollow);
|
||||
} else if (isNotEmpty(linksToFollow)) {
|
||||
} else if (isNotEmpty(linksToFollow) && obj instanceof HALResource) {
|
||||
return [this.linkService.resolveLinks(obj, ...linksToFollow)];
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ interface AppConfig extends Config {
|
||||
*/
|
||||
const APP_CONFIG = new InjectionToken<AppConfig>('APP_CONFIG');
|
||||
|
||||
const APP_CONFIG_STATE = makeStateKey('APP_CONFIG_STATE');
|
||||
const APP_CONFIG_STATE = makeStateKey<AppConfig>('APP_CONFIG_STATE');
|
||||
|
||||
export {
|
||||
AppConfig,
|
||||
|
Reference in New Issue
Block a user