From f9c1cbf6bc904249aa953ecb38ce70597d0a7cfc Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 9 Apr 2018 14:33:39 -0400 Subject: [PATCH] Show a message on the History Panel if the feature is new (closes #4975) --- data/core.yaml | 1 + dist/locales/en.json | 1 + modules/ui/panels/history.js | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 6c3c59961..059d8975d 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -325,6 +325,7 @@ en: key: H title: History selected: "{n} selected" + no_history: "No History (New Feature)" version: Version last_edit: Last Edit edited_by: Edited By diff --git a/dist/locales/en.json b/dist/locales/en.json index 8bf4f41d7..9dfb67330 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -407,6 +407,7 @@ "key": "H", "title": "History", "selected": "{n} selected", + "no_history": "No History (New Feature)", "version": "Version", "last_edit": "Last Edit", "edited_by": "Edited By", diff --git a/modules/ui/panels/history.js b/modules/ui/panels/history.js index b665fe5f9..710cfa8b1 100644 --- a/modules/ui/panels/history.js +++ b/modules/ui/panels/history.js @@ -96,8 +96,8 @@ export function uiPanelHistory(context) { function redraw(selection) { - var selected = _filter(context.selectedIDs(), function(e) { return context.hasEntity(e); }), - singular = selected.length === 1 ? selected[0] : null; + var selected = _filter(context.selectedIDs(), function(e) { return context.hasEntity(e); }); + var singular = selected.length === 1 ? selected[0] : null; osm = context.connection(); @@ -112,6 +112,13 @@ export function uiPanelHistory(context) { var entity = context.entity(singular); + if (!entity.version) { + selection + .append('div') + .text(t('info_panels.history.no_history')); + return; + } + var list = selection .append('ul');