Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for wildcard events #299

Merged
merged 29 commits into from
Jun 12, 2019
Merged

Documentation for wildcard events #299

merged 29 commits into from
Jun 12, 2019

Conversation

thomasarbona
Copy link
Contributor

@thomasarbona thomasarbona commented May 27, 2019

What does this PR do?

How should this be manually tested?

Boyscout

  • [ @xbill82 ] Disabled C++ and Java tests from local execution
  • fix pages sorting (page with an order set to 0 isn't classified first)

@thomasarbona thomasarbona requested a review from xbill82 May 27, 2019 16:13
@thomasarbona thomasarbona self-assigned this May 28, 2019
package.json Outdated
@@ -29,6 +29,7 @@
"js-cookie": "^2.1.4",
"lunr": "^2.3.6",
"moment": "^2.24.0",
"mqtt": "^3.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some tests failed because mqtt dependency is missing

Copy link
Contributor

@scottinet scottinet Jun 5, 2019

Choose a reason for hiding this comment

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

I made the effort and checked: that module is indeed used by the Javascript IoT guide.

  1. this change should appear in your PR description: without it, it's impossible for reviewers to get why this module has been added
  2. the package-lock.json file must also be updated (with an up-to-date version of the npm CLI).
  3. since this is only used to test the documentation, then that module must be installed in the devDependencies part of the package.json file

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

So it should be removed from this project's package.json file.

@@ -148,10 +148,10 @@ function sortPagesByOrderAndTitle(p1, p2) {
const o1 = get(p1, 'frontmatter.order', null);
const o2 = get(p2, 'frontmatter.order', null);

if ((o1 === null || typeof o1 === 'undefined') && o2) {
if ((o1 === null || typeof o1 === 'undefined') && !isNaN(o2)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if o1 or o2 is NaN, then that function returns 1 (because any comparison operation on a NaN value ends up returning false)

also, I don't get the purpose of that test, what does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both if serve to check if o1 and o2 are valids. I added !isNaN() because without that, if o1 or o2 equals to zero, the sorting is broken

Copy link
Contributor

@scottinet scottinet Jun 5, 2019

Choose a reason for hiding this comment

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

I don't get it, because NaN is not 0

(and what do you mean by broken?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When o2 is equal to zero, the condition consider that o2 is not a valid number. This produce broken sorting of pages because a page with order set to zero wasn't the first page in the list

src/core/1/plugins/plugins/events/wildcard-events/index.md Outdated Show resolved Hide resolved
src/core/1/plugins/plugins/events/wildcard-events/index.md Outdated Show resolved Hide resolved
src/core/1/plugins/plugins/events/wildcard-events/index.md Outdated Show resolved Hide resolved
Copy link
Contributor

@xbill82 xbill82 left a comment

Choose a reason for hiding this comment

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

Nice one, just one sentence to clarify

src/core/1/plugins/guides/events/wildcard-events/index.md Outdated Show resolved Hide resolved
@benoitvidis benoitvidis mentioned this pull request Jun 6, 2019
Copy link
Contributor

@scottinet scottinet left a comment

Choose a reason for hiding this comment

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

The package-lock.json file must be unstaged

Copy link
Contributor

@scottinet scottinet left a comment

Choose a reason for hiding this comment

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

A couple wording issues but apart from that, this looks good to me.


```javascript
this.pipes =
// listener function will trigger at each
Copy link
Contributor

Choose a reason for hiding this comment

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

  // the listener function is executed every time an
  // event is triggered by the "document" controller


```javascript
this.pipes =
// listener function will trigger after each
Copy link
Contributor

@scottinet scottinet Jun 12, 2019

Choose a reason for hiding this comment

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

Beware copy/pasted examples:

  // the listener function is executed after every successful
  // API action performed by the "document" controller

@xbill82
Copy link
Contributor

xbill82 commented Jun 12, 2019

I've restored the package-lock.json to its consistent state after the migration.

@xbill82 xbill82 merged commit ef6ddea into 3-dev Jun 12, 2019
@xbill82 xbill82 deleted the KZL-291-wildcarded-event branch June 12, 2019 12:49
This was referenced Jun 12, 2019
xbill82 added a commit that referenced this pull request Jun 13, 2019
# [3.0.0](https://github.com/kuzzleio/documentation/releases/tag/3.0.0) (2019-06-12)


#### Bug fixes

- [ [#298](#298) ] Fix bulk import return   ([Aschen](https://github.com/Aschen))
- [ [#325](#325) ] Adapt legacy redirection   ([Aschen](https://github.com/Aschen))
- [ [#322](#322) ] Fix remaining dead links and add check_link to CI   ([Aschen](https://github.com/Aschen))
- [ [#304](#304) ] Fix sdk js tests   ([benoitvidis](https://github.com/benoitvidis))

#### New features

- [ [#299](#299) ] Documentation for wildcard events   ([thomasarbona](https://github.com/thomasarbona))
- [ [#321](#321) ] Add guide about secrets management with the Vault   ([Aschen](https://github.com/Aschen))
- [ [#300](#300) ] Add page about bulk:write and bulk:mwrite   ([Aschen](https://github.com/Aschen))

#### Enhancements

- [ [#327](#327) ] SPA mode   ([xbill82](https://github.com/xbill82))
- [ [#324](#324) ] Update Redis version   ([Aschen](https://github.com/Aschen))
- [ [#316](#316) ] Sdks authenticated connected props   ([Aschen](https://github.com/Aschen))
- [ [#317](#317) ] Add new way for updateSpecifications & validateSpecifications   ([thomasarbona](https://github.com/thomasarbona))
- [ [#296](#296) ] Rewrite the Realtime guide   ([Aschen](https://github.com/Aschen))
- [ [#301](#301) ] Deprecate realtime join   ([Aschen](https://github.com/Aschen))
- [ [#291](#291) ] Getting started React + improve snippetManager   ([thomasarbona](https://github.com/thomasarbona))
- [ [#294](#294) ] Add s3 plugin   ([Aschen](https://github.com/Aschen))
- [ [#292](#292) ] Add since   ([Aschen](https://github.com/Aschen))
- [ [#276](#276) ] [KZL-907] Getting started dev plugin   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#284](#284) ] Extending the JS SDK with controllers   ([Aschen](https://github.com/Aschen))
- [ [#271](#271) ] Add documentation page about mappings   ([Aschen](https://github.com/Aschen))

#### Others

- [ [#314](#314) ] Add a clustering guide   ([scottinet](https://github.com/scottinet))
- [ [#319](#319) ] Getting-started-sdk-JS6-architecture   ([berthieresteban](https://github.com/berthieresteban))
- [ [#311](#311) ] Add PDF sending example for Request.setResult   ([Aschen](https://github.com/Aschen))
- [ [#315](#315) ] Normalize directories and generate redirections   ([Aschen](https://github.com/Aschen))
- [ [#309](#309) ] Port #284 to 3-dev   ([berthieresteban](https://github.com/berthieresteban))
- [ [#308](#308) ] Port #283 to 3-dev   ([berthieresteban](https://github.com/berthieresteban))
- [ [#307](#307) ] Port #282 to 3-dev   ([berthieresteban](https://github.com/berthieresteban))
- [ [#306](#306) ] Port #280 to 3-dev   ([berthieresteban](https://github.com/berthieresteban))
- [ [#312](#312) ] Port 278 to 3-dev   ([Aschen](https://github.com/Aschen))
- [ [#310](#310) ] Port #277 to 3-dev   ([Aschen](https://github.com/Aschen))
- [ [#305](#305) ] Port #275 to 3-dev   ([Aschen](https://github.com/Aschen))
- [ [#303](#303) ] Port #274 to 3-dev   ([Aschen](https://github.com/Aschen))
- [ [#302](#302) ] Port #271 to 3-dev   ([Aschen](https://github.com/Aschen))
- [ [#313](#313) ] Port #266 to 3-dev   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#290](#290) ] [KZL-1050] Role template example in the documentation   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#293](#293) ] [KZL-1036] Add available plugins   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#286](#286) ] Embedded protocols   ([benoitvidis](https://github.com/benoitvidis))
---
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.

7 participants