From 2bf7a5e08bbf539ce71884f1bb086a693ab99a8c Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 16 Aug 2017 20:07:12 -0400 Subject: [PATCH] Write changeset tags for new mappers to indicate walkthrough progress These tags all start with `ideditor:` (closes #3968) ``` ideditor:walkthrough_completed=yes ideditor:walkthrough_progress=welcome;navigation;point;area;line;building;startEditing ideditor:walkthrough_started=yes ``` --- modules/ui/commit.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index b3681d602..0d1fff7e9 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -14,6 +14,7 @@ var changeset; var readOnlyTags = [ /^changesets_count$/, /^created_by$/, + /^ideditor:/, /^imagery_used$/, /^host$/, /^locale$/ @@ -335,6 +336,25 @@ export function uiCommit(context) { // always update userdetails, just in case user reauthenticates as someone else if (userDetails && userDetails.changesets_count !== undefined) { tags.changesets_count = String(userDetails.changesets_count); + + // first 100 edits - new user + if (parseInt(tags.changesets_count, 10) < 100) { + var s; + s = context.storage('walkthrough_completed'); + if (s) { + tags['ideditor:walkthrough_completed'] = s; + } + + s = context.storage('walkthrough_progress'); + if (s) { + tags['ideditor:walkthrough_progress'] = s; + } + + s = context.storage('walkthrough_started'); + if (s) { + tags['ideditor:walkthrough_started'] = s; + } + } } else { delete tags.changesets_count; }