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
```
This commit is contained in:
Bryan Housel
2017-08-16 20:07:12 -04:00
parent ea298b0b18
commit 2bf7a5e08b

View File

@@ -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;
}