-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added option `modify` to `$SP().getManager()` - Added `$SP().isSPO()` - Changed `$SP().ajax()` to better managed 401 error for the REST API calls - Changed `$SP().cleanResult()` when dealing with a date (`$SP().cleanResult("2022-01-19 00:00:00")` will now return "2022-01-19" instead of "2022-01-19 00:00:00") - Changed `$SP().toDate()` to ignore the timezone (e.g. `$SP().toDate("2022-01-19")` used to return different result based on the user's timezone, but now it returns the correct date at 00:00:00 in the current timezone) - /!\ Changed `$SP().getVersions()`: only compatible with REST API, and it returns a different result/outcome than before - /!\ Changed `$SP().hasREST()`: it will always return TRUE (it's possible to override the value) because REST API is around for a while now and I assume everyone is using at least SP2013 (see issue #180) - Fixed `$SP().isMember()` for the `url` option (see issue #175) - Removed support for IE10 in the bundle for browsers
- Loading branch information
Showing
64 changed files
with
539 additions
and
6,184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
generate_docs.bat | ||
inch.json | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regene | |
|
||
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise")); | ||
|
||
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with")); | ||
|
||
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof")); | ||
|
||
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator")); | ||
|
@@ -32,13 +30,14 @@ var _people = _interopRequireDefault(require("./people.js")); | |
@category people | ||
@description Return the manager for the provided user, as a People string | ||
@param {String} [username] With or without the domain, and you can also use an email address, and if you leave it empty it's the current user by default | ||
@param {String} [username] Username with the domain, and if you leave it empty it's the current user by default | ||
@param {Object} [setup] Options (see below) | ||
@param {String} [setup.url='current website'] The website url | ||
@param {Function} [setup.modify] Permits to modify the manager's username returned by the service | ||
@return {Function} resolve(manager), reject(error) | ||
@example | ||
$SP().getManager("john_doe",{url:"http://my.si.te/subdir/"}) | ||
$SP().getManager("domain\\john_doe",{url:"http://my.si.te/subdir/"}) | ||
.then(function(manager) { | ||
console.log(manager); // 42;#Smith,, Jane,#i:0#.w|domain\Jane_Smith,#[email protected],#[email protected],#Smith,, Jane | ||
manager = $SP().getPeopleLookup(manager); | ||
|
@@ -47,6 +46,12 @@ var _people = _interopRequireDefault(require("./people.js")); | |
.catch(function(err) { | ||
console.log("Err => ",err) | ||
}); | ||
$SP().getManager("domain\\john_doe",{ | ||
modify:function(managerUserName) { | ||
return (managerUserName.startsWith('i:0') ? managerUserName : "i:0#.w|" + managerUserName); | ||
} | ||
}) | ||
*/ | ||
function getManager(_x, _x2) { | ||
return _getManager.apply(this, arguments); | ||
|
@@ -88,13 +93,16 @@ function _getManager() { | |
setup.url = _context.sent; | ||
|
||
case 8: | ||
_context.next = 10; | ||
setup.modify = setup.modify || function (val) { | ||
return val; | ||
}; | ||
|
||
_context.next = 11; | ||
return _people.default.call(this, username, setup); | ||
|
||
case 10: | ||
case 11: | ||
pres = _context.sent; | ||
managerUserName = pres.Manager; | ||
if (!(0, _startsWith.default)(managerUserName).call(managerUserName, 'i:0')) managerUserName = "i:0#.w|" + managerUserName; | ||
managerUserName = setup.modify(pres.Manager); | ||
_context.next = 15; | ||
return _getUserInfo.default.call(this, managerUserName, setup); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.