101108: Angular 14 upgrade - build fixes #1

This commit is contained in:
Kristof De Langhe
2023-04-11 17:50:50 +02:00
parent 59681ea54d
commit 643e75a838
3 changed files with 5 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ export class LinkService {
const provider = this.getDataServiceFor(matchingLinkDef.resourceType); const provider = this.getDataServiceFor(matchingLinkDef.resourceType);
if (hasNoValue(provider)) { 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({ const service: HALDataService<any> = Injector.create({
@@ -79,12 +79,12 @@ export class LinkService {
return service.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); return service.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
} }
} catch (e) { } 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; throw e;
} }
} }
} else if (!linkToFollow.isOptional) { } 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; return EMPTY;

View File

@@ -72,7 +72,7 @@ export class RemoteDataBuildService {
if (hasValue(obj)) { if (hasValue(obj)) {
if (getResourceTypeValueFor((obj as any).type) === PAGINATED_LIST.value) { if (getResourceTypeValueFor((obj as any).type) === PAGINATED_LIST.value) {
return this.buildPaginatedList<T>(obj, ...linksToFollow); return this.buildPaginatedList<T>(obj, ...linksToFollow);
} else if (isNotEmpty(linksToFollow)) { } else if (isNotEmpty(linksToFollow) && obj instanceof HALResource) {
return [this.linkService.resolveLinks(obj, ...linksToFollow)]; return [this.linkService.resolveLinks(obj, ...linksToFollow)];
} }
} }

View File

@@ -56,7 +56,7 @@ interface AppConfig extends Config {
*/ */
const APP_CONFIG = new InjectionToken<AppConfig>('APP_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 { export {
AppConfig, AppConfig,