Don't display "null" as activity location in UI when reverse geocoding didn't took place #3
5 changed files with 10 additions and 6 deletions
|
|
@ -133,7 +133,7 @@ public class ActivityDTO {
|
|||
.elevationLoss(activity.getElevationLoss())
|
||||
.createdAt(activity.getCreatedAt())
|
||||
.updatedAt(activity.getUpdatedAt())
|
||||
.activityLocation(activity.getActivityLocation());
|
||||
.activityLocation(activity.getActivityLocationNonNull());
|
||||
|
||||
if (activity.getTotalDurationSeconds() != null) {
|
||||
builder.totalDurationSeconds(activity.getTotalDurationSeconds());
|
||||
|
|
@ -246,7 +246,7 @@ public class ActivityDTO {
|
|||
.subSport(activity.getSubSport())
|
||||
.indoorDetectionMethod(activity.getIndoorDetectionMethod())
|
||||
.race(activity.getRace() != null ? activity.getRace() : false)
|
||||
.activityLocation(activity.getActivityLocation())
|
||||
.activityLocation(activity.getActivityLocationNonNull())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ public class ActivityDTO {
|
|||
.elevationLoss(activity.getElevationLoss())
|
||||
.createdAt(activity.getCreatedAt())
|
||||
.updatedAt(activity.getUpdatedAt())
|
||||
.activityLocation(activity.getActivityLocation());
|
||||
.activityLocation(activity.getActivityLocationNonNull());
|
||||
|
||||
if (activity.getTotalDurationSeconds() != null) {
|
||||
builder.totalDurationSeconds(activity.getTotalDurationSeconds());
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class TimelineActivityDTO {
|
|||
.indoorDetectionMethod(activity.getIndoorDetectionMethod())
|
||||
.race(activity.getRace() != null ? activity.getRace() : false)
|
||||
.metrics(activity.getMetrics() != null ? ActivityMetricsSummary.fromMetrics(activity.getMetrics()) : null)
|
||||
.activityLocation(activity.getActivityLocation())
|
||||
.activityLocation(activity.getActivityLocationNonNull())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,10 @@ public class Activity {
|
|||
}
|
||||
}
|
||||
|
||||
public String getActivityLocationNonNull() {
|
||||
return activityLocation != null ? activityLocation : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Activity types supported by the platform
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class TimelineResultMapper {
|
|||
.commentsCount(commentsCount)
|
||||
.likedByCurrentUser(likedByCurrentUser)
|
||||
.hasGpsTrack(true) // Will be refined based on actual data
|
||||
.activityLocation(activityLocation)
|
||||
.activityLocation(activityLocation != null ? activityLocation : "")
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ const FitPubTimeline = {
|
|||
@${this.escapeHtml(activity.username)}
|
||||
</a>
|
||||
${!activity.isLocal ? ' <span class="badge bg-info ms-1" title="Federated Activity"><i class="bi bi-globe2"></i> Remote</span>' : ''}
|
||||
• ${this.formatTimeAgo(activity.startedAt)} • ${activity.activityLocation}
|
||||
• ${this.formatTimeAgo(activity.startedAt)} ${activity.activityLocation ? '•' : ''} ${activity.activityLocation}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue