From 1f71274db66eab16d0989567dcd8b21a22a5bd5a Mon Sep 17 00:00:00 2001 From: Marie Verdonck Date: Fri, 21 Feb 2020 15:55:41 +0100 Subject: [PATCH] 68930: rename forwardToRest typo fix --- src/app/core/data/data.service.spec.ts | 12 ++++++------ src/app/core/data/data.service.ts | 8 ++++---- src/app/shared/utils/follow-link-config.model.ts | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app/core/data/data.service.spec.ts b/src/app/core/data/data.service.spec.ts index fcb7929fad..c5748b05fb 100644 --- a/src/app/core/data/data.service.spec.ts +++ b/src/app/core/data/data.service.spec.ts @@ -177,14 +177,14 @@ describe('DataService', () => { }); }); - it('should not include linksToFollow with shootEmbed = false', () => { + it('should not include linksToFollow with shouldEmbed = false', () => { const mockFollowLinkConfig: FollowLinkConfig = Object.assign(new FollowLinkConfig(), { name: 'bundles' as any, - shootEmbed: false, + shouldEmbed: false, }); const mockFollowLinkConfig2: FollowLinkConfig = Object.assign(new FollowLinkConfig(), { name: 'owningCollection' as any, - shootEmbed: false, + shouldEmbed: false, }); const mockFollowLinkConfig3: FollowLinkConfig = Object.assign(new FollowLinkConfig(), { name: 'templateItemOf' as any, @@ -249,14 +249,14 @@ describe('DataService', () => { expect(result).toEqual(expected); }); - it('should not include linksToFollow with shootEmbed = false', () => { + it('should not include linksToFollow with shouldEmbed = false', () => { const mockFollowLinkConfig: FollowLinkConfig = Object.assign(new FollowLinkConfig(), { name: 'bundles' as any, - shootEmbed: false, + shouldEmbed: false, }); const mockFollowLinkConfig2: FollowLinkConfig = Object.assign(new FollowLinkConfig(), { name: 'owningCollection' as any, - shootEmbed: false, + shouldEmbed: false, }); const mockFollowLinkConfig3: FollowLinkConfig = Object.assign(new FollowLinkConfig(), { name: 'templateItemOf' as any, diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index ee48ca1a83..71f4295b68 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -155,13 +155,13 @@ export abstract class DataService { /** * Adds the embed options to the link for the request * @param args params for the query string - * @param linksToFollow links we want to embed in query string if shootEmbed is true + * @param linksToFollow links we want to embed in query string if shouldEmbed is true */ protected addEmbedParams(args: any, ...linksToFollow: Array>) { if (linksToFollow !== undefined) { [...linksToFollow].forEach((linkToFollow: FollowLinkConfig) => { console.log('linksToFollow', linksToFollow) - if (linkToFollow.shootEmbed) { + if (linkToFollow.shouldEmbed) { const embedString = 'embed=' + String(linkToFollow.name); const embedWithNestedString = this.addNestedEmbeds(embedString, ...linkToFollow.linksToFollow); args = [...args, embedWithNestedString]; @@ -174,14 +174,14 @@ export abstract class DataService { /** * Add the nested followLinks to the embed param, recursively, separated by a / * @param embedString embedString so far (recursive) - * @param linksToFollow links we want to embed in query string if shootEmbed is true + * @param linksToFollow links we want to embed in query string if shouldEmbed is true */ protected addNestedEmbeds(embedString: string, ...linksToFollow: Array>): string { let nestEmbed = embedString; if (linksToFollow !== undefined) { console.log('linksToFollow addNestedEmbed', linksToFollow); [...linksToFollow].forEach((linkToFollow: FollowLinkConfig) => { - if (linkToFollow.shootEmbed) { + if (linkToFollow.shouldEmbed) { nestEmbed = nestEmbed + '/' + String(linkToFollow.name); if (linkToFollow.linksToFollow !== undefined) { nestEmbed = this.addNestedEmbeds(nestEmbed, ...linkToFollow.linksToFollow); diff --git a/src/app/shared/utils/follow-link-config.model.ts b/src/app/shared/utils/follow-link-config.model.ts index 49866dc641..87942d8467 100644 --- a/src/app/shared/utils/follow-link-config.model.ts +++ b/src/app/shared/utils/follow-link-config.model.ts @@ -27,7 +27,7 @@ export class FollowLinkConfig { /** * Forward to rest which links we're following, so these can already be embedded */ - shootEmbed? = true; + shouldEmbed? = true; } /** @@ -41,19 +41,19 @@ export class FollowLinkConfig { * in a certain way * @param linksToFollow: a list of {@link FollowLinkConfig}s to * use on the retrieved object. - * @param shootEmbed: boolean to check whether to forward info on followLinks to rest, + * @param shouldEmbed: boolean to check whether to forward info on followLinks to rest, * so these can be embedded, default true */ export const followLink = ( linkName: keyof R['_links'], findListOptions?: FindListOptions, - shootEmbed = true, + shouldEmbed = true, ...linksToFollow: Array> ): FollowLinkConfig => { return { name: linkName, findListOptions, - shootEmbed: shootEmbed, + shouldEmbed: shouldEmbed, linksToFollow } };