Skip to content

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
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
ldapUserArray.map(function (userEntry) {
if (userEntry.mail != undefined) {
if (userEntry.mail instanceof Array) {
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...

Co-Authored-By: stefanonepa <stefano.nepa@outlook.com>
ponsfrilus and others added 30 commits February 12, 2020 11:15
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.

5 participants