From 2f4b1e76e5ed61e4a561d152eff8dbdd5d52d927 Mon Sep 17 00:00:00 2001 From: Aries Date: Mon, 24 Feb 2025 16:04:06 +0800 Subject: [PATCH] optimize ui (#7509) Co-authored-by: zhouwenxuan --- .../metadata/components/metadata-details/ai/index.js | 4 ++++ .../components/metadata-details/location/index.css | 2 +- .../components/metadata-details/location/index.js | 10 ++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/metadata/components/metadata-details/ai/index.js b/frontend/src/metadata/components/metadata-details/ai/index.js index 90ab814cff..5e6cc2fcaa 100644 --- a/frontend/src/metadata/components/metadata-details/ai/index.js +++ b/frontend/src/metadata/components/metadata-details/ai/index.js @@ -111,6 +111,7 @@ const AI = () => { } const fileDetails = detail[PRIVATE_COLUMN_KEY.FILE_DETAILS]; const location = detail[PRIVATE_COLUMN_KEY.LOCATION]; + const address = detail[PRIVATE_COLUMN_KEY.LOCATION_TRANSLATED]; let update = {}; if (fileDetails) { update[PRIVATE_COLUMN_KEY.FILE_DETAILS] = fileDetails; @@ -118,6 +119,9 @@ const AI = () => { if (location) { update[PRIVATE_COLUMN_KEY.LOCATION] = location; } + if (address) { + update[PRIVATE_COLUMN_KEY.LOCATION_TRANSLATED] = address; + } Object.keys(update).length > 0 && onLocalRecordChange(recordId, update); }, }); diff --git a/frontend/src/metadata/components/metadata-details/location/index.css b/frontend/src/metadata/components/metadata-details/location/index.css index 68af6ff9d7..b59807f82b 100644 --- a/frontend/src/metadata/components/metadata-details/location/index.css +++ b/frontend/src/metadata/components/metadata-details/location/index.css @@ -1,5 +1,5 @@ .dirent-detail-item-value-map { - height: 100px; + height: 200px; width: 100%; } diff --git a/frontend/src/metadata/components/metadata-details/location/index.js b/frontend/src/metadata/components/metadata-details/location/index.js index 77cfeb38a4..02d98d3d6d 100644 --- a/frontend/src/metadata/components/metadata-details/location/index.js +++ b/frontend/src/metadata/components/metadata-details/location/index.js @@ -151,13 +151,11 @@ class Location extends React.Component { {isValid ? (
- {!isLoading && this.mapType && address && ( - <> - {address} -
- + {!isLoading && this.mapType && address ? ( + {address} + ) : ( + {getGeolocationDisplayString(position, { geo_format: GEOLOCATION_FORMAT.LNG_LAT })} )} - {getGeolocationDisplayString(position, { geo_format: GEOLOCATION_FORMAT.LNG_LAT })}
) : (