-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for collections in spaces (#141)
* added display_timezone to workflow model * added IListLanguageVariantsBySpaceResponseContract * added ListLanguageVariantsByCollectionResponse * added listLanguageVariantsBySpaceAsync to query service * added mapLanguageVariantsByCollectionResponse to mapper * added listLanguageVariantsBySpace to api-endpoints. Added list-language-variants-by-space to language variant queries. Added ListAllLanguageVariantsBySpaceResponse to language variant responses * added fake-list-language-variants-by-space * added list-language-variants-by-space.spec * added listLanguageVariantsByCollection() to imanagement-client.interface.ts * local tests successful, final changes * updated space.models.ts with collections property * updated space-contract.ts with collections property * updated space fake responses with collections property * updated space tests to validate collections property * added collection property to mapSpace, updated test cases. All tests passing * renames file --------- Co-authored-by: Richard Sustek <[email protected]>
- Loading branch information
Showing
27 changed files
with
308 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
lib/queries/language-variants/list-language-variants-by-space-query.class.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { IManagementClientConfig } from '../../config'; | ||
import { Identifiers } from '../../models'; | ||
import { LanguageVariantResponses } from '../../responses'; | ||
import { ManagementQueryService } from '../../services'; | ||
import { BaseListingQuery } from '../base-listing-query'; | ||
|
||
export class ListLanguageVariantsBySpaceQuery extends BaseListingQuery< | ||
LanguageVariantResponses.ListLanguageVariantsBySpaceResponse, | ||
LanguageVariantResponses.ListAllLanguageVariantsBySpaceResponse | ||
> { | ||
constructor( | ||
protected config: IManagementClientConfig, | ||
protected queryService: ManagementQueryService, | ||
protected identifier: Identifiers.SpaceIdentifier | ||
) { | ||
super(config, queryService); | ||
} | ||
|
||
toPromise(): Promise<LanguageVariantResponses.ListLanguageVariantsBySpaceResponse> { | ||
return this.queryService.listLanguageVariantsBySpaceAsync(this.getUrl(), this.queryConfig); | ||
} | ||
|
||
protected getAction(): string { | ||
return this.apiEndpoints.listLanguageVariantsBySpace(this.identifier); | ||
} | ||
|
||
protected allResponseFactory( | ||
items: any[], | ||
responses: LanguageVariantResponses.ListLanguageVariantsBySpaceResponse[] | ||
): LanguageVariantResponses.ListAllLanguageVariantsBySpaceResponse { | ||
return new LanguageVariantResponses.ListAllLanguageVariantsBySpaceResponse({ | ||
items: items, | ||
responses: responses | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
test/browser/fake-responses/language-variants/fake-list-language-variants-by-space.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"variants": [ | ||
{ | ||
"elements": [ | ||
{ | ||
"element": { | ||
"id": "c7c3b834-2222-5677-89c4-b46f04489109" | ||
}, | ||
"value": "Text element value" | ||
}, | ||
{ | ||
"mode": "custom", | ||
"element": { | ||
"id": "53a5eecb-f295-59b4-a07d-19655b6ad860" | ||
}, | ||
"value": "custom-url-slug-value" | ||
} | ||
], | ||
"workflow": { | ||
"workflow_identifier": { | ||
"id": "06ea628e-4ec7-4991-91e4-1412995151ee" | ||
}, | ||
"step_identifier": { | ||
"id": "dc87d7cf-424b-4b89-9519-c9f79a3458b7" | ||
} | ||
}, | ||
"workflow_step": { | ||
"id": "dc87d7cf-424b-4b89-9519-c9f79a3458b7" | ||
}, | ||
"item": { | ||
"id": "82ef61f4-ccee-42ac-95e2-1a44beda9625" | ||
}, | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"last_modified": "2020-02-27T19:08:25.404Z" | ||
} | ||
], | ||
"pagination": { | ||
"continuation_token": "W3sidG9rZW4iOiIrUklEOn...", | ||
"next_page": "https://manage.kontent.ai/v2/your/chosen/list/endpoint" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.