Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. sharedWith: function () {
  2. // @TODO: will be completed by ONIST-637
  3. // @TODO: move to separate widget
  4. /** @type {List_SharingWidgetRecords_Request} */
  5. var request = {
  6. file: getRecord()
  7. };
  8. if (R.path(['parent', 'calculated', 'type'], request.file) === Enum.VaultItemType.FOLDER) {
  9. request.folder = {
  10. id: request.file.parent.id
  11. };
  12. }
  13. if (R.path(['parent', 'entity'], request.file)) {
  14. request.module = Enum.Module.FINPRINT;
  15. } else if (R.path(['parent', 'asset'], request.file)) {
  16. request.module = Enum.Module.NET_WORTH;
  17. }
  18. var userList = DbClient_Shares
  19. .getSharingWidgetRecordsList(request)
  20. .records.map(function (user) {
  21. return user.userName;
  22. });
  23. if (userList.length > 2) {
  24. var lastItem = userList.pop();
  25. userList = userList.join(', ') + ' and ' + lastItem;
  26. } else {
  27. userList = userList.join(' and ');
  28. }
  29. return userList;
  30. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement