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

Proposing minors improvements and more test coverage #4

Open
wants to merge 63 commits into
base: master
Choose a base branch
from

Conversation

ponsfrilus
Copy link
Collaborator

Among other things, this PR:

  • allows units to be queried by uniqueIdentifier in addtion to accountingNumber (cc @ogiermaitre)
  • proposes to depreciate unitsRepo.getUnitById
  • fixes the unnecessary pipe in LDAP filters
  • allows the tests to finish when done
  • methods for units and users are covered by tests
  • makes the "official" repo in epfl-idevelop github org, allowing the team to manage it (also see the epfl team in npmjs.org)

models/user.js Outdated
@@ -32,6 +32,7 @@ module.exports = function User(ldapUserArray) {
userEntry.mail.map(function(mail) {
userModel.emails.push(mail);
});
userModel.emails = [...new Set(userModel.emails)];
Copy link
Owner

Choose a reason for hiding this comment

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

le spread operator (aka ...) est supporte a partir de la version 5.x... Du coup la doc annonce version 4... (juste au cas ou une vielle image docker n'a pas ete mise a jour 😄 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

La doc dit: "⚠ this library "try" to use ES2015 (or ES6) capabilities, don't use it with nodejs under 4.x?"

Copy link
Owner

Choose a reason for hiding this comment

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

Yep, la doc devrait dire under 5.x 😄

models/user.js Outdated
@@ -32,6 +32,7 @@ module.exports = function User(ldapUserArray) {
userEntry.mail.map(function(mail) {
Copy link
Owner

Choose a reason for hiding this comment

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

Note pour plus tard:

Je pense que c'est pas la bonne utilisation map, je que ca pourrait etre remplace par:

Suggested change
userEntry.mail.map(function(mail) {
userEntry.mail.forEach(function(mail) {

ou mieux remplacer le tout par:

userModel.emails = [...new Set(userEntry.mail)];

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suis aussi pour le spread operator

Copy link
Owner

Choose a reason for hiding this comment

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

spread, mais sur userEntry.mail (et pas l'autre) en etant sur que userEntry existe...

README.md Outdated Show resolved Hide resolved
Co-Authored-By: stefanonepa <stefano.nepa@outlook.com>
ponsfrilus and others added 30 commits February 12, 2020 09:51
* Now one can query the ldap using user's email
* Querying with phone will now handle "12345" and "+41 21 6912345"
The cache wasn't taking into consideration the param "isResultUniq", 
meaning that getUser and getUsers would return the same data, regardless 
of the isResultUniq param that should either return an Array or a single 
result.
Close #3

* Get rid of cache callbacks
* Use the same context for all the tests
[FIX] WARNING! node-cache legacy callback support will drop in v6.x
[RFA] epfl-idevelop → epfl-si
* clean up the test.js
* improve the package.json script
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.

None yet

4 participants