Skip to content

Conversation

AnthonySendra
Copy link
Contributor

  • CRUD User
  • CRUD Profile
  • CRUD Role

STAFYNIAK Sacha and others added 30 commits February 3, 2016 14:40
@codecov-io
Copy link

Current coverage is 100.00%

Merging #58 into master will increase coverage by +0.12% as of 8548ffd

@@            master     #58   diff @@
======================================
  Files            5      10     +5
  Stmts          851    1196   +345
  Branches       202     294    +92
  Methods          0       0       
======================================
+ Hit            850    1196   +346
  Partial          0       0       
+ Missed           1       0     -1

Review entire Coverage Diff as of 8548ffd

Powered by Codecov. Updated on successful CI builds.

Anthony Sendra added 2 commits February 10, 2016 10:42
@AnthonySendra AnthonySendra reopened this Feb 10, 2016
@stafyniaksacha
Copy link
Contributor

+1111

data = this.serialize(),
self = this;

self.kuzzle.query(this.kuzzleSecurity.buildQueryArgs('createOrReplaceUser'), data, null, function (error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicking: For all calls to kuzzle.query, shouldn't we include the optional options in the query?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No you're right... But I think it's more clear to call the function with null instead. It works better with my IDE :)
But if you are convinced, I can change it. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid any warning raised by your IDE, skipping the options argument altogether should do the trick: I made this argument optional in the JSDoc of the query method.

But another approach would be to add an optional options argument to this method (and maybe to other methods too). Because by default, nearly all methods should support the queuable option, asking to (not) queue this query during offline mode.
The only exception to this rule I can think of should be the login and logout functions (and all other functions not sending any requests, like addListener, obviously).

src/kuzzle.js Outdated

/*
/**
* Create an attribute security that embed all methods for manage Role, Profile and User
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking: -for +to

@scottinet
Copy link
Contributor

Apart from the queuable option thing that we need to discuss: BIG +1

@xbill82
Copy link
Contributor

xbill82 commented Feb 11, 2016

👍 👍 👍 👍 👍 👍 👍 👍

@xbill82
Copy link
Contributor

xbill82 commented Feb 11, 2016

I'm the third validation, should I merge or would you like to discuss about the queuable option?

@scottinet
Copy link
Contributor

@AnthonySendra and I discussed the matter, and he agreed to add the queuable option to (almost) all these new methods, to be on par with the rest of the SDK.

New commits should be soon submitted

@AnthonySendra
Copy link
Contributor Author

@scottinet could you have a new look at this PR please ?

@scottinet
Copy link
Contributor

lgtm!

AnthonySendra added a commit that referenced this pull request Feb 11, 2016
@AnthonySendra AnthonySendra merged commit bc6a4ba into master Feb 11, 2016
@AnthonySendra AnthonySendra deleted the kuz-343-security-object branch February 11, 2016 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants