fix(web): prevent partner assets from being selected in geolocation utility (#28737)
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>pull/28492/head
parent
65d8b35f8b
commit
13ecfc8876
|
|
@ -38,6 +38,8 @@
|
||||||
withCoordinates: true,
|
withCoordinates: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isOwnAsset = (asset: TimelineAsset) => asset.ownerId === authManager.user.id;
|
||||||
|
|
||||||
const handleUpdate = async () => {
|
const handleUpdate = async () => {
|
||||||
if (!point) {
|
if (!point) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -54,7 +56,7 @@
|
||||||
|
|
||||||
await updateAssets({
|
await updateAssets({
|
||||||
assetBulkUpdateDto: {
|
assetBulkUpdateDto: {
|
||||||
ids: assetMultiSelectManager.assets.map((asset) => asset.id),
|
ids: assetMultiSelectManager.assets.filter((asset) => isOwnAsset(asset)).map((asset) => asset.id),
|
||||||
latitude: point.lat,
|
latitude: point.lat,
|
||||||
longitude: point.lng,
|
longitude: point.lng,
|
||||||
},
|
},
|
||||||
|
|
@ -124,7 +126,7 @@
|
||||||
}, 1500);
|
}, 1500);
|
||||||
point = { lat: asset.latitude, lng: asset.longitude };
|
point = { lat: asset.latitude, lng: asset.longitude };
|
||||||
void setQueryValue('at', asset.id);
|
void setQueryValue('at', asset.id);
|
||||||
} else {
|
} else if (isOwnAsset(asset)) {
|
||||||
onClick(timelineManager, timelineDay.getAssets(), timelineDay.groupTitle, asset);
|
onClick(timelineManager, timelineDay.getAssets(), timelineDay.groupTitle, asset);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -199,6 +201,9 @@
|
||||||
onThumbnailClick={handleThumbnailClick}
|
onThumbnailClick={handleThumbnailClick}
|
||||||
>
|
>
|
||||||
{#snippet customThumbnailLayout(asset: TimelineAsset)}
|
{#snippet customThumbnailLayout(asset: TimelineAsset)}
|
||||||
|
{#if !isOwnAsset(asset)}
|
||||||
|
<div class="pointer-events-none absolute inset-0 rounded-sm bg-black/40"></div>
|
||||||
|
{/if}
|
||||||
{#if hasGps(asset)}
|
{#if hasGps(asset)}
|
||||||
<div class="absolute inset-e-3 bottom-1 rounded-xl bg-success px-4 py-1 text-xs text-black transition-colors">
|
<div class="absolute inset-e-3 bottom-1 rounded-xl bg-success px-4 py-1 text-xs text-black transition-colors">
|
||||||
{asset.city || $t('gps')}
|
{asset.city || $t('gps')}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue