fix(MyShares): show tooltip when mouse over an item + fix the path
This commit is contained in:
@@ -167,6 +167,8 @@ class MySharesList {
|
||||
_buildResourceLaneHeader(item) {
|
||||
const row = document.createElement('div');
|
||||
row.className = 'ms-resource-row';
|
||||
if (item.resource.path) row.dataset.path = item.resource.path;
|
||||
if (item.resource.owner_id) row.dataset.ownerId = item.resource.owner_id;
|
||||
|
||||
row.appendChild(buildResourceIcon(item.resource, item.resource_type));
|
||||
|
||||
@@ -229,6 +231,13 @@ class MySharesList {
|
||||
if (_expiryState(grant.expires_at ?? null) === 'expired') {
|
||||
row.classList.add('ms-grant-row--expired');
|
||||
}
|
||||
// In sharedWith mode each grant row represents a (resource → subject)
|
||||
// pair, so stamp the resource hierarchy info for the hover tooltip.
|
||||
// In items mode the row represents a subject — no resource attrs.
|
||||
if (viewMode === 'sharedWith') {
|
||||
if (item.resource.path) row.dataset.path = item.resource.path;
|
||||
if (item.resource.owner_id) row.dataset.ownerId = item.resource.owner_id;
|
||||
}
|
||||
|
||||
row.appendChild(this._buildIdentity(grant, item, viewMode));
|
||||
row.appendChild(this._buildRolePill(grant.role));
|
||||
|
||||
@@ -142,7 +142,7 @@ const _registry = new WeakMap();
|
||||
/** Containers known to expose `data-path`/`data-owner-id` for tooltip use.
|
||||
* Add new opt-in row classes here when other views want the tooltip — each
|
||||
* one must stamp the dataset attributes itself. */
|
||||
const _TOOLTIP_SELECTOR = '.file-item, .ms-resource-row';
|
||||
const _TOOLTIP_SELECTOR = '.file-item, .ms-resource-row, .ms-grant-row';
|
||||
|
||||
/**
|
||||
* Attach tooltip listeners to every tooltip-capable row inside `container`.
|
||||
|
||||
Reference in New Issue
Block a user