| 1770 | |
| 1771 | const newKeys = new Set(); |
| 1772 | const addItem = (shareWith, label, type) => { |
| 1773 | const key = type + '|' + shareWith; |
| 1774 | newKeys.add(key); |
| 1775 | if (!existingMap[key]) { |
| 1776 | const sharee = OCA.Analytics.Share.buildShareeRow(0, shareWith, label, type, true); |
| 1777 | resultElement.appendChild(sharee); |
| 1778 | } else { |
| 1779 | const elem = existingMap[key].querySelector('#username'); |
| 1780 | if (elem.innerText !== label && type === OCA.Analytics.SHARE_TYPE_USER) { |
| 1781 | elem.innerText = label; |
| 1782 | } |
| 1783 | } |
| 1784 | }; |
| 1785 | |
| 1786 | for (let user of jsondata['ocs']['data']['users']) { |
| 1787 | addItem(user['value']['shareWith'], user['label'], OCA.Analytics.SHARE_TYPE_USER); |