Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sharedWith: function () {
- // @TODO: will be completed by ONIST-637
- // @TODO: move to separate widget
- /** @type {List_SharingWidgetRecords_Request} */
- var request = {
- file: getRecord()
- };
- if (R.path(['parent', 'calculated', 'type'], request.file) === Enum.VaultItemType.FOLDER) {
- request.folder = {
- id: request.file.parent.id
- };
- }
- if (R.path(['parent', 'entity'], request.file)) {
- request.module = Enum.Module.FINPRINT;
- } else if (R.path(['parent', 'asset'], request.file)) {
- request.module = Enum.Module.NET_WORTH;
- }
- var userList = DbClient_Shares
- .getSharingWidgetRecordsList(request)
- .records.map(function (user) {
- return user.userName;
- });
- if (userList.length > 2) {
- var lastItem = userList.pop();
- userList = userList.join(', ') + ' and ' + lastItem;
- } else {
- userList = userList.join(' and ');
- }
- return userList;
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement