Skip to content

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Jul 22, 2020

What does this PR do?

Adds Typescript support for SearchResult classes

import { JSONObject } from '../../utils/interfaces';

class SpecificationsSearchResult extends SearchResultBase {
export class SpecificationsSearchResult extends SearchResultBase<JSONObject> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I should have created a proper Specification interface but I'm lazy to do it since I doubt someone is using this and we need a refactor of this module.
The JSONObject type works like a POJO

@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

❗ No coverage uploaded for pull request base (7-dev@005269a). Click here to learn what that means.
The diff coverage is 97.56%.

Impacted file tree graph

@@           Coverage Diff            @@
##             7-dev     #530   +/-   ##
========================================
  Coverage         ?   91.18%           
========================================
  Files            ?       32           
  Lines            ?     1395           
  Branches         ?      133           
========================================
  Hits             ?     1272           
  Misses           ?       98           
  Partials         ?       25           
Impacted Files Coverage Δ
src/controllers/Auth.ts 75.94% <ø> (ø)
src/core/security/Profile.ts 100.00% <ø> (ø)
src/core/searchResult/SearchResultBase.ts 77.58% <75.00%> (ø)
src/core/searchResult/Profile.ts 100.00% <100.00%> (ø)
src/core/searchResult/Role.ts 100.00% <100.00%> (ø)
src/core/searchResult/Specifications.ts 100.00% <100.00%> (ø)
src/core/searchResult/User.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 005269a...72052fe. Read the comment docs.

this._scrollAction = 'scroll';
Reflect.defineProperty(this, '_controller', {
value: request.controller,
writable: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these writable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in the SpecificationSearchResult class we overload the controller with collection

@Aschen Aschen merged commit 25fa21c into 7-dev Aug 11, 2020
@Aschen Aschen deleted the add-typescript-support-search-results branch August 11, 2020 09:29
This was referenced Aug 18, 2020
Aschen added a commit that referenced this pull request Aug 18, 2020
# [7.4.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.4.0) (2020-08-18)


#### New features

- [ [#542](#542) ] Finalize typescript support   ([Aschen](https://github.com/Aschen))
- [ [#529](#529) ] Add typescript support for protocols   ([Aschen](https://github.com/Aschen))

#### Enhancements

- [ [#541](#541) ] Add meaningful stacktrace   ([Aschen](https://github.com/Aschen))
- [ [#537](#537) ] Add typescript support realtime   ([Aschen](https://github.com/Aschen))
- [ [#531](#531) ] Add typescript support for Index and Collection controllers   ([Aschen](https://github.com/Aschen))
- [ [#530](#530) ] Add typescript support for search results   ([Aschen](https://github.com/Aschen))
- [ [#523](#523) ] Add support for the collection:delete API action   ([morgandruesne](https://github.com/morgandruesne))
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants