| 1341 | |
| 1342 | const newKeys = new Set(); |
| 1343 | const addItem = (shareWith, label, type) => { |
| 1344 | const key = type + '|' + shareWith; |
| 1345 | newKeys.add(key); |
| 1346 | if (!existingMap[key]) { |
| 1347 | const sharee = OCA.Analytics.Share.buildShareeRow(0, shareWith, label, type, true); |
| 1348 | resultElement.appendChild(sharee); |
| 1349 | } else { |
| 1350 | const elem = existingMap[key].querySelector('#username'); |
| 1351 | if (elem.innerText !== label && type === OCA.Analytics.SHARE_TYPE_USER) { |
| 1352 | elem.innerText = label; |
| 1353 | } |
| 1354 | } |
| 1355 | }; |
| 1356 | |
| 1357 | for (let user of jsondata['ocs']['data']['users']) { |
| 1358 | addItem(user['value']['shareWith'], user['label'], OCA.Analytics.SHARE_TYPE_USER); |