More features and plants added
This commit is contained in:
+6
-4
@@ -188,7 +188,7 @@ function extendBounds(bounds, coordinates) {
|
||||
function buildPopupContent(properties) {
|
||||
const { kind, label, name, startDate, endDate, details, parentId, groupIds } = properties;
|
||||
const entries = Object.entries(details ?? {}).filter(
|
||||
([key, value]) => value !== null && value !== undefined && !key.endsWith("Url"),
|
||||
([key, value]) => value !== null && value !== undefined && shouldShowDetailField(key),
|
||||
);
|
||||
const lifecycleEntries = [];
|
||||
const relationshipEntries = [];
|
||||
@@ -221,12 +221,16 @@ function buildPopupContent(properties) {
|
||||
.map(([key, value]) => `<div><span>${escapeHtml(formatDetailLabel(key))}:</span> ${escapeHtml(formatDetailValue(key, value))}</div>`)
|
||||
.join("");
|
||||
const linkRows = linkEntries
|
||||
.map((link) => `<div><span>${escapeHtml(link.label)}:</span> <a href="${escapeHtml(link.url)}" target="_blank" rel="noreferrer">${escapeHtml(link.url)}</a></div>`)
|
||||
.map((link) => `<div><a href="${escapeHtml(link.url)}" target="_blank" rel="noreferrer">Info</a></div>`)
|
||||
.join("");
|
||||
|
||||
return `${title}${subtitle}<div>${detailRows}${linkRows}</div>`;
|
||||
}
|
||||
|
||||
function shouldShowDetailField(key) {
|
||||
return !key.endsWith("Url") && key !== "gardenOrgId";
|
||||
}
|
||||
|
||||
function formatDetailLabel(key) {
|
||||
const labels = {
|
||||
canopyDiameterMeters: "Canopy diameter",
|
||||
@@ -239,8 +243,6 @@ function formatDetailLabel(key) {
|
||||
cultivar: "Cultivar",
|
||||
bloomColor: "Bloom color",
|
||||
bloomSeason: "Bloom season",
|
||||
daylilyDatabaseId: "Daylily database ID",
|
||||
daylilyDatabaseUrl: "Daylily database URL",
|
||||
species: "Species",
|
||||
fenceType: "Fence type",
|
||||
axis: "Axis",
|
||||
|
||||
Reference in New Issue
Block a user