Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes #5107

Merged
merged 86 commits into from
Jul 16, 2018
Merged

Notes #5107

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
f92bc63
init commit: updated locales/en after build
thomas-hervey Jun 19, 2018
e3c0fd4
added: .vscode debug config to ignore
thomas-hervey Jun 19, 2018
1ed915e
added: map data notes toggle
thomas-hervey Jun 19, 2018
3de1fd8
reformatted svg/notes
thomas-hervey Jun 19, 2018
cf2a9ad
added: notes api service, parse and callback stubs
thomas-hervey Jun 19, 2018
3df01e2
added: svg notes, TODO: add icon, test
thomas-hervey Jun 20, 2018
473570c
updated: fixed services/notes function declarations
thomas-hervey Jun 21, 2018
47ef49d
added: .vscode to .gitignore
thomas-hervey Jun 21, 2018
db0fe7e
merged from master
thomas-hervey Jun 21, 2018
4576100
cleaned: extraneous details in notes
thomas-hervey Jun 21, 2018
e16b411
added: first test (failing)
thomas-hervey Jun 21, 2018
dab46d2
updated: notes rendering
thomas-hervey Jun 22, 2018
1878397
remove console.log, change icon
thomas-hervey Jun 23, 2018
0859d00
updated: notes svg to prevent duplicate appending
thomas-hervey Jun 25, 2018
737ccfc
updated: siebar displays note details on hover (via svg)
thomas-hervey Jun 29, 2018
b3f7b06
merged: services/notes into /osm; todo: fix some caching & rendering
thomas-hervey Jun 30, 2018
9517635
Merge branch 'master' into notes
bhousel Jun 30, 2018
d034691
Merge remote-tracking branch 'origin/merge_notes_service' into notes
bhousel Jun 30, 2018
fd1d2f0
Fix the osmNote initializer
bhousel Jun 30, 2018
ede5610
Add update method, remove getters..
bhousel Jun 30, 2018
1b06dbd
delete: demo select file (unintentional commit)
thomas-hervey Jun 30, 2018
229484a
Cleanup osm service notes and caches, remove state variable
bhousel Jun 30, 2018
2f8efee
Draw 2x icons (shadow and fill) so they stand out more
bhousel Jun 30, 2018
eba9bde
updated: pull from remote
thomas-hervey Jun 30, 2018
dcef114
updated: notes caching
thomas-hervey Jun 30, 2018
bcc1669
Move note css from the photos.css into a new css file data.css
bhousel Jun 30, 2018
f3d31f3
Update css styles for notes
bhousel Jun 30, 2018
487ec9d
Better spinner event management
bhousel Jul 1, 2018
9fc94f5
updated: Premium DigitalGlobe description
thomas-hervey Jul 1, 2018
fc4d800
updated: pull from remote
thomas-hervey Jul 1, 2018
00c8ff4
Don't add notes to the _seenEntity cache
bhousel Jul 2, 2018
535208b
Move tests to spec/services/osm.js and remove old notes.js files
bhousel Jul 2, 2018
65b2a42
Adjust green
bhousel Jul 2, 2018
13a30c0
Add some dots if there is a comment thread
bhousel Jul 2, 2018
3304cc8
Remove unused far-comment-alt icon
bhousel Jul 2, 2018
5b4dde0
pulled updates from remote
thomas-hervey Jul 2, 2018
2c22fe0
updated: hacky note hovering; todo: complete note click handling
thomas-hervey Jul 2, 2018
d81b9c5
merged: icon update from remote
thomas-hervey Jul 2, 2018
a474e3b
Working on note editor style and ui, simplify d3 code
bhousel Jul 2, 2018
94eae89
Merge, continue to tweak note_editor
bhousel Jul 2, 2018
86dc0c9
updated: new comments in notes sidebar ui
thomas-hervey Jul 2, 2018
7999aca
Add getNode and replaceNote methods, refactor caches
bhousel Jul 2, 2018
bd8705b
updated: reintroduced hovering on notes
thomas-hervey Jul 2, 2018
2d2845e
If notes are coincident, move them apart slightly
bhousel Jul 2, 2018
d87a2c2
Adjust pointer css for note markers
bhousel Jul 3, 2018
e0cc626
Switch `innerHtml` to `textContent`, which properly unescapes xml
bhousel Jul 3, 2018
ab8e793
Playing with note styling, add avatars and more metadata
bhousel Jul 3, 2018
b4c6607
merged from remote
thomas-hervey Jul 3, 2018
61ae541
updated: notes save buttons
thomas-hervey Jul 3, 2018
8121f58
added checks for multiclick and click on notes
thomas-hervey Jul 3, 2018
b14d1b5
resolve conflicts, fix a few minor bugs prob caused by merging:
bhousel Jul 3, 2018
bf499d9
Restore modeSelect, and make a new modeSelectNote just for the notes
bhousel Jul 3, 2018
73ee5c2
fixed select_note mode, cleaned note_editor, TODO: enable note save
thomas-hervey Jul 4, 2018
6f1dc12
Add `user` method to osm service, `_userCache`, user parser
bhousel Jul 4, 2018
263ec9e
Add code to swap in avatar images for users that have them
bhousel Jul 5, 2018
01b33e3
Linkify the usernames
bhousel Jul 6, 2018
d137aa0
Add "More/Less" toggle for too long comments (curr limit 600 chars)
bhousel Jul 7, 2018
3eb3eef
Combine Osm and Notes layers into the same ul
bhousel Jul 8, 2018
7b42743
pacify some eslint warnings
bhousel Jul 8, 2018
0f49514
updated: removed centering when clicking a note
thomas-hervey Jul 8, 2018
14356ce
WIP: toggle note status
thomas-hervey Jul 8, 2018
c460c03
fixed typo
thomas-hervey Jul 9, 2018
eafae6c
WIP: update service calls; todo: note update event handling
thomas-hervey Jul 10, 2018
0d7c292
Refactor out uiNoteHeader and uiNoteComments into separate modules
bhousel Jul 11, 2018
7423d19
Implement multi-fetch get for users from OSM API
bhousel Jul 11, 2018
f52f24b
Add noteOptions, default to 10k note limit and 7 days closed
bhousel Jul 11, 2018
e9e2f9b
Style note header
bhousel Jul 11, 2018
3454753
Drop more/less toggle and just use a scrollbar for long comments
bhousel Jul 11, 2018
91add0c
WIP on buttons, simplify, remove some event dispatch
bhousel Jul 12, 2018
5e5601f
Store the unsaved comment in the note itself
bhousel Jul 12, 2018
fe7086f
Add header close 'X' button, add grey hover styling
bhousel Jul 12, 2018
19560eb
Properly save and restore caches when entering/leaving the walkthrough
bhousel Jul 12, 2018
645cc79
Add docs about OSM API, finish implementing `postNoteUpdate`
bhousel Jul 13, 2018
57da729
Implement note save button code
bhousel Jul 13, 2018
775b472
Remove from inflight cache before doing anything in `done`
bhousel Jul 13, 2018
8a1079c
Update notes on status change
bhousel Jul 13, 2018
f825845
Can't skip seen on the `userDetails` call
bhousel Jul 13, 2018
bd15865
added tests for notes service
thomas-hervey Jul 13, 2018
33ef9a4
Wrap callbacks with common checks for connection id and auth failure
bhousel Jul 13, 2018
1a106f5
Make uiViewOnOSM work for notes too, add it to note_editor footer
bhousel Jul 13, 2018
7fb42ac
added note reporting and margin to save buttons
thomas-hervey Jul 13, 2018
7ad765d
added simple tests for loading and retrieving notes
thomas-hervey Jul 16, 2018
33de399
fixed note-report display
thomas-hervey Jul 16, 2018
70f8763
Cleaner note icon rendering
bhousel Jul 16, 2018
47de7b3
Make sure note report link doesn't show on hover
bhousel Jul 16, 2018
694cc60
Add thread dots to note header icon, disable comments on closed nodes
bhousel Jul 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ land.html
/css/img
/test/css
/test/img

\.vscode/
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Drawing is then accomplished with
.merge(footer);

footer
.call(uiViewOnOSM(context).entityID(entityID));
.call(uiViewOnOSM(context).what(entity));
```

Some components are reconfigurable, and some provide functionality beyond
Expand Down
162 changes: 162 additions & 0 deletions css/65_data.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@

/* OSM Notes Layer */
.layer-notes {
pointer-events: none;
}
.layer-notes .note * {
pointer-events: none;
}
.layer-notes .note .note-fill {
pointer-events: visible;
cursor: pointer; /* Opera */
cursor: url(img/cursor-select-point.png), pointer; /* FF */
}

.note-header-icon .note-shadow,
.layer-notes .note .note-shadow {
color: #000;
}
.note-header-icon .note-fill,
.layer-notes .note .note-fill {
color: #ff3300;
stroke: #333;
}
.note-header-icon.closed .note-fill,
.layer-notes .note.closed .note-fill {
color: #55dd00;
stroke: #333;
}
.layer-notes .note.hovered .note-fill {
color: #eebb00;
stroke: #333;
}
.layer-notes .note.selected .note-fill {
color: #ffee00;
stroke: #333;
}

/* slight adjustments to preset icon for note icons */
.note-header-icon .preset-icon-28 {
top: 18px;
}

.note-header-icon .note-icon-annotation {
position: absolute;
top: 21px;
left: 21px;
margin: auto;
}

.note-header-icon .note-icon-annotation .icon {
width: 18px;
height: 18px;
}


/* OSM Note UI */
.note-header {
background-color: #f6f6f6;
border-radius: 5px;
border: 1px solid #ccc;
display: flex;
flex-flow: row nowrap;
align-items: center;
}

.note-header-icon {
background-color: #fff;
padding: 10px;
flex: 0 0 62px;
position: relative;
width: 60px;
height: 60px;
border-right: 1px solid #ccc;
border-radius: 5px 0 0 5px;
}
[dir='rtl'] .note-header-icon {
border-right: unset;
border-left: 1px solid #ccc;
border-radius: 0 5px 5px 0;
}

.note-header-icon .icon-wrap {
position: absolute;
top: 0px;
}

.note-header-label {
background-color: #f6f6f6;
padding: 0 15px;
flex: 1 1 100%;
font-size: 14px;
font-weight: bold;
border-radius: 0 5px 5px 0;
}
[dir='rtl'] .note-header-label {
border-radius: 5px 0 0 5px;
}

.comments-container {
background: #ececec;
padding: 1px 10px;
margin: 10px 0;
border-radius: 8px;
}

.comment {
background-color: #fff;
border-radius: 5px;
border: 1px solid #ccc;
margin: 10px auto;
display: flex;
flex-flow: row nowrap;
}
.comment-avatar {
padding: 10px;
flex: 0 0 62px;
}
.comment-avatar .icon.comment-avatar-icon {
width: 40px;
height: 40px;
object-fit: cover;
border: 1px solid #ccc;
border-radius: 20px;
}
.comment-main {
padding: 10px;
flex: 1 1 100%;
flex-flow: column nowrap;
overflow: hidden;
overflow-wrap: break-word;
}
.comment-metadata {
flex-flow: row nowrap;
justify-content: space-between;
}
.comment-author {
font-weight: bold;
color: #333;
}
.comment-date {
color: #aaa;
}
.comment-text {
color: #333;
margin-top: 10px;
overflow-y: auto;
max-height: 250px;
}
.comment-text::-webkit-scrollbar {
border-left: none;
}

#new-comment-input {
width: 100%;
height: 100px;
max-height: 300px;
min-height: 100px;
}

.note-report {
float: right;
}
28 changes: 24 additions & 4 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,15 @@ button.save.has-count .count::before {
}

.field-help-title button.close,
.sidebar-component .header button.note-editor-close,
.entity-editor-pane .header button.preset-close,
.preset-list-pane .header button.preset-choose {
position: absolute;
right: 0;
top: 0;
}
[dir='rtl'] .field-help-title button.close,
[dir='rtl'] .sidebar-component .header button.note-editor-close,
[dir='rtl'] .entity-editor-pane .header button.preset-close,
[dir='rtl'] .preset-list-pane .header button.preset-choose {
left: 0;
Expand Down Expand Up @@ -733,11 +735,21 @@ button.save.has-count .count::before {
.footer {
position: absolute;
bottom: 0;
margin: 0;
padding: 5px 20px 5px 20px;
border-top: 1px solid #ccc;
background-color: #fafafa;
width: 100%;
z-index: 1;
flex-wrap: wrap;
justify-content: space-between;
list-style: none;
display: flex;

}

.footer > a {
justify-content: center;
}

.sidebar-component .body {
Expand Down Expand Up @@ -1290,6 +1302,7 @@ a.hide-toggle {
.inspector-hover .preset-input-wrap .label,
.inspector-hover .form-field-multicombo,
.inspector-hover .structure-extras-wrap,
.inspector-hover .comments-container .comment,
.inspector-hover input,
.inspector-hover textarea,
.inspector-hover label {
Expand Down Expand Up @@ -1329,14 +1342,14 @@ a.hide-toggle {
/* hide but preserve in layout */
.inspector-hover .entity-editor-pane button.minor,
.inspector-hover .combobox-caret,
.inspector-hover .entity-editor-pane .header button,
.inspector-hover .header button,
.inspector-hover .spin-control,
.inspector-hover .form-field-multicombo .chips .remove,
.inspector-hover .hide-toggle:before,
.inspector-hover .more-fields,
.inspector-hover .form-label-button-wrap,
.inspector-hover .tag-reference-button,
.inspector-hover .view-on-osm {
.inspector-hover .footer * {
opacity: 0;
}

Expand Down Expand Up @@ -3566,10 +3579,17 @@ img.tile-debug {
vertical-align: middle;
}

.save-section .buttons {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-bottom: 30px;
}

.save-section .buttons .action,
.save-section .buttons .secondary-action {
display: inline-block;
margin: 0 20px 0 0;
width: 45%;
margin: 10px auto;
text-align: center;
vertical-align: middle;
}
Expand Down
17 changes: 17 additions & 0 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ en:
osm:
tooltip: Map data from OpenStreetMap
title: OpenStreetMap data
notes:
tooltip: Note data from OpenStreetMap
title: OpenStreetMap notes
fill_area: Fill Areas
map_features: Map Features
autohidden: "These features have been automatically hidden because too many would be shown on the screen. You can zoom in to edit them."
Expand Down Expand Up @@ -607,6 +610,20 @@ en:
title: "Photo Overlay (OpenStreetCam)"
openstreetcam:
view_on_openstreetcam: "View this image on OpenStreetCam"
note:
note: Note
title: Edit note
anonymous: anonymous
closed: "(Closed)"
commentTitle: Comments
newComment: New Comment
inputPlaceholder: Enter a comment to share with other users.
close: Close Note
open: Reopen Note
comment: Comment
close_comment: Close and Comment
open_comment: Reopen and Comment
report: Report
help:
title: Help
key: H
Expand Down
19 changes: 19 additions & 0 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@
"osm": {
"tooltip": "Map data from OpenStreetMap",
"title": "OpenStreetMap data"
},
"notes": {
"tooltip": "Note data from OpenStreetMap",
"title": "OpenStreetMap notes"
}
},
"fill_area": "Fill Areas",
Expand Down Expand Up @@ -739,6 +743,21 @@
"openstreetcam": {
"view_on_openstreetcam": "View this image on OpenStreetCam"
},
"note": {
"note": "Note",
"title": "Edit note",
"anonymous": "anonymous",
"closed": "(Closed)",
"commentTitle": "Comments",
"newComment": "New Comment",
"inputPlaceholder": "Enter a comment to share with other users.",
"close": "Close Note",
"open": "Reopen Note",
"comment": "Comment",
"close_comment": "Close and Comment",
"open_comment": "Reopen and Comment",
"report": "Report"
},
"help": {
"title": "Help",
"key": "H",
Expand Down
15 changes: 11 additions & 4 deletions modules/behavior/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
} from 'd3-selection';

import { d3keybinding as d3_keybinding } from '../lib/d3.keybinding.js';
import { osmEntity } from '../osm';
import {
osmEntity,
osmNote
} from '../osm';
import { utilRebind } from '../util/rebind';


Expand Down Expand Up @@ -108,7 +111,7 @@ export function behaviorHover(context) {
.classed('hover-suppressed', false);

var entity;
if (datum instanceof osmEntity) {
if (datum instanceof osmNote || datum instanceof osmEntity) {
entity = datum;
} else {
entity = datum && datum.properties && datum.properties.entity;
Expand All @@ -122,7 +125,7 @@ export function behaviorHover(context) {
return;
}

var selector = '.' + entity.id;
var selector = (datum instanceof osmNote) ? 'note-' + entity.id : '.' + entity.id;

if (entity.type === 'relation') {
entity.members.forEach(function(member) {
Expand All @@ -135,7 +138,11 @@ export function behaviorHover(context) {
_selection.selectAll(selector)
.classed(suppressed ? 'hover-suppressed' : 'hover', true);

dispatch.call('hover', this, !suppressed && entity.id);
if (datum instanceof osmNote) {
dispatch.call('hover', this, !suppressed && entity);
} else {
dispatch.call('hover', this, !suppressed && entity.id);
}

} else {
dispatch.call('hover', this, null);
Expand Down
Loading