From 0552a90a9f30e1cdd5c85b35f51bc7153c0f3675 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 24 Jul 2018 14:58:04 -0400 Subject: [PATCH] Remove category field - it's not an osm tag --- data/presets.yaml | 20 -------- data/presets/fields.json | 1 - data/presets/fields/category.json | 25 ---------- data/taginfo.json | 81 ------------------------------- dist/locales/en.json | 13 ----- modules/services/osm.js | 6 +-- modules/ui/note_editor.js | 56 ++++++++++----------- 7 files changed, 30 insertions(+), 172 deletions(-) delete mode 100644 data/presets/fields/category.json diff --git a/data/presets.yaml b/data/presets.yaml index 1061a765f..a5c716a72 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -304,26 +304,6 @@ en: castle_type: # castle_type=* label: Type - category: - # 'none=*, updateDetails=*, missing=*, wrongLocation=*, groundtruth=*, doesNotExist=*, discussion=*' - label: Category - options: - # discussion=yes - discussion: Needs discussing - # doesNotExist=yes - doesNotExist: Does not or never existed - # groundtruth=yes - groundtruth: Ground truth or needs local confirmation - # missing=yes - missing: Something is missing - # none=yes - none: None - # updateDetails=yes - updateDetails: Update or add details - # wrongLocation=yes - wrongLocation: Wrong location - # category field placeholder - placeholder: Unknown clothes: # clothes=* label: Clothes diff --git a/data/presets/fields.json b/data/presets/fields.json index e1018de87..d295ff913 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -49,7 +49,6 @@ "capacity": {"key": "capacity", "type": "number", "minValue": 0, "label": "Capacity", "placeholder": "50, 100, 200..."}, "cash_in": {"key": "cash_in", "type": "check", "label": "Cash In"}, "castle_type": {"key": "castle_type", "type": "combo", "label": "Type"}, - "category": {"type": "radio", "keys": ["none", "updateDetails", "missing", "wrongLocation", "groundtruth", "doesNotExist", "discussion"], "label": "Category", "placeholder": "Unknown", "strings": {"options": {"none": "None", "updateDetails": "Update or add details", "missing": "Something is missing", "wrongLocation": "Wrong location", "groundtruth": "Ground truth or needs local confirmation", "doesNotExist": "Does not or never existed", "discussion": "Needs discussing"}}}, "clothes": {"key": "clothes", "type": "semiCombo", "label": "Clothes"}, "club": {"key": "club", "type": "typeCombo", "label": "Type"}, "collection_times": {"key": "collection_times", "type": "text", "label": "Collection Times"}, diff --git a/data/presets/fields/category.json b/data/presets/fields/category.json deleted file mode 100644 index 1af4a78b8..000000000 --- a/data/presets/fields/category.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "type": "radio", - "keys": [ - "none", - "updateDetails", - "missing", - "wrongLocation", - "groundtruth", - "doesNotExist", - "discussion" - ], - "label": "Category", - "placeholder": "Unknown", - "strings": { - "options": { - "none": "None", - "updateDetails": "Update or add details", - "missing": "Something is missing", - "wrongLocation": "Wrong location", - "groundtruth": "Ground truth or needs local confirmation", - "doesNotExist": "Does not or never existed", - "discussion": "Needs discussing" - } - } -} diff --git a/data/taginfo.json b/data/taginfo.json index a22acfd27..50d522098 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -6375,87 +6375,6 @@ {"key": "capacity", "description": "Capacity"}, {"key": "cash_in", "description": "Cash In"}, {"key": "castle_type", "description": "Type"}, - {"key": "none", "value": "none", "description": "Category"}, - {"key": "none", "value": "updateDetails", "description": "Category"}, - {"key": "none", "value": "missing", "description": "Category"}, - {"key": "none", "value": "wrongLocation", "description": "Category"}, - {"key": "none", "value": "groundtruth", "description": "Category"}, - {"key": "none", "value": "doesNotExist", "description": "Category"}, - {"key": "none", "value": "discussion", "description": "Category"}, - {"key": "updateDetails", "value": "none", "description": "Category"}, - { - "key": "updateDetails", - "value": "updateDetails", - "description": "Category" - }, - {"key": "updateDetails", "value": "missing", "description": "Category"}, - { - "key": "updateDetails", - "value": "wrongLocation", - "description": "Category" - }, - {"key": "updateDetails", "value": "groundtruth", "description": "Category"}, - { - "key": "updateDetails", - "value": "doesNotExist", - "description": "Category" - }, - {"key": "updateDetails", "value": "discussion", "description": "Category"}, - {"key": "missing", "value": "none", "description": "Category"}, - {"key": "missing", "value": "updateDetails", "description": "Category"}, - {"key": "missing", "value": "missing", "description": "Category"}, - {"key": "missing", "value": "wrongLocation", "description": "Category"}, - {"key": "missing", "value": "groundtruth", "description": "Category"}, - {"key": "missing", "value": "doesNotExist", "description": "Category"}, - {"key": "missing", "value": "discussion", "description": "Category"}, - {"key": "wrongLocation", "value": "none", "description": "Category"}, - { - "key": "wrongLocation", - "value": "updateDetails", - "description": "Category" - }, - {"key": "wrongLocation", "value": "missing", "description": "Category"}, - { - "key": "wrongLocation", - "value": "wrongLocation", - "description": "Category" - }, - {"key": "wrongLocation", "value": "groundtruth", "description": "Category"}, - { - "key": "wrongLocation", - "value": "doesNotExist", - "description": "Category" - }, - {"key": "wrongLocation", "value": "discussion", "description": "Category"}, - {"key": "groundtruth", "value": "none", "description": "Category"}, - {"key": "groundtruth", "value": "updateDetails", "description": "Category"}, - {"key": "groundtruth", "value": "missing", "description": "Category"}, - {"key": "groundtruth", "value": "wrongLocation", "description": "Category"}, - {"key": "groundtruth", "value": "groundtruth", "description": "Category"}, - {"key": "groundtruth", "value": "doesNotExist", "description": "Category"}, - {"key": "groundtruth", "value": "discussion", "description": "Category"}, - {"key": "doesNotExist", "value": "none", "description": "Category"}, - { - "key": "doesNotExist", - "value": "updateDetails", - "description": "Category" - }, - {"key": "doesNotExist", "value": "missing", "description": "Category"}, - { - "key": "doesNotExist", - "value": "wrongLocation", - "description": "Category" - }, - {"key": "doesNotExist", "value": "groundtruth", "description": "Category"}, - {"key": "doesNotExist", "value": "doesNotExist", "description": "Category"}, - {"key": "doesNotExist", "value": "discussion", "description": "Category"}, - {"key": "discussion", "value": "none", "description": "Category"}, - {"key": "discussion", "value": "updateDetails", "description": "Category"}, - {"key": "discussion", "value": "missing", "description": "Category"}, - {"key": "discussion", "value": "wrongLocation", "description": "Category"}, - {"key": "discussion", "value": "groundtruth", "description": "Category"}, - {"key": "discussion", "value": "doesNotExist", "description": "Category"}, - {"key": "discussion", "value": "discussion", "description": "Category"}, {"key": "clothes", "description": "Clothes"}, {"key": "collection_times", "description": "Collection Times"}, {"key": "comment", "description": "Changeset Comment"}, diff --git a/dist/locales/en.json b/dist/locales/en.json index 1d8e703e6..ed1de77b6 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1688,19 +1688,6 @@ "castle_type": { "label": "Type" }, - "category": { - "label": "Category", - "placeholder": "Unknown", - "options": { - "none": "None", - "updateDetails": "Update or add details", - "missing": "Something is missing", - "wrongLocation": "Wrong location", - "groundtruth": "Ground truth or needs local confirmation", - "doesNotExist": "Does not or never existed", - "discussion": "Needs discussing" - } - }, "clothes": { "label": "Clothes" }, diff --git a/modules/services/osm.js b/modules/services/osm.js index 5a7d42757..45b49731b 100644 --- a/modules/services/osm.js +++ b/modules/services/osm.js @@ -885,10 +885,8 @@ export default { var comment = note.newComment; if (note.newCategory && note.newCategory !== 'None') { comment += ' #' + note.newCategory; } - var path = '/api/0.6/notes?' + - 'lat=' + note.loc[1] + - '&lon=' + note.loc[0] + - '&' + utilQsString({ text: comment }); + + var path = '/api/0.6/notes?' + utilQsString({ lon: note.loc[0], lat: note.loc[1], text: comment }); _noteCache.inflightPost[note.id] = oauth.xhr( { method: 'POST', path: path }, diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index 80f2de604..e5d6a081a 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -114,39 +114,39 @@ export function uiNoteEditor(context) { .append('div') .attr('class', 'note-save save-section cf'); - // if new note, show categories to pick from - if (_note.isNew()) { - var presets = context.presets(); + // // if new note, show categories to pick from + // if (_note.isNew()) { + // var presets = context.presets(); - // NOTE: this key isn't a age and therefore there is no documentation (yet) - _fieldsArr = [ - uiField(context, presets.field('category'), null, { show: true, revert: false }), - ]; + // // NOTE: this key isn't a age and therefore there is no documentation (yet) + // _fieldsArr = [ + // uiField(context, presets.field('category'), null, { show: true, revert: false }), + // ]; - _fieldsArr.forEach(function(field) { - field - .on('change', changeCategory); - }); + // _fieldsArr.forEach(function(field) { + // field + // .on('change', changeCategory); + // }); - noteSaveEnter - .append('div') - .attr('class', 'note-category') - .call(formFields.fieldsArr(_fieldsArr)); - } + // noteSaveEnter + // .append('div') + // .attr('class', 'note-category') + // .call(formFields.fieldsArr(_fieldsArr)); + // } - function changeCategory() { - // NOTE: perhaps there is a better way to get value - var val = d3_select('input[name=\'category\']:checked').property('__data__') || undefined; + // function changeCategory() { + // // NOTE: perhaps there is a better way to get value + // var val = d3_select('input[name=\'category\']:checked').property('__data__') || undefined; - // store the unsaved category with the note itself - _note = _note.update({ newCategory: val }); - var osm = services.osm; - if (osm) { - osm.replaceNote(_note); // update note cache - } - noteSave - .call(noteSaveButtons); - } + // // store the unsaved category with the note itself + // _note = _note.update({ newCategory: val }); + // var osm = services.osm; + // if (osm) { + // osm.replaceNote(_note); // update note cache + // } + // noteSave + // .call(noteSaveButtons); + // } noteSaveEnter .append('h4')