Git Product home page Git Product logo

osmcha-frontend's Introduction

osmcha-frontend

CircleCI

OSMCha is composed by a group of softwares that together has the aim to make it easier to monitor and validate the changes in OpenStreetMap. Learn more …

This repository contains the frontend code. Other repositories are:

Setting up editor

Prettier

This repository uses prettier to keep the code consistent and formatted. You can config your favourite editor by the following links

  • Atom users can simply install the prettier-atom package and use Ctrl+Alt+F to format a file (or format on save if enabled).
  • Visual Studio Code users can Search for Prettier - JavaScript formatter.

Prerequisite

  1. Install asdf version manager
  2. asdf install to install the required tools from .tool-versions
  3. yarn install (brew install yarn if required).

Local development

  1. yarn start
  2. Open https://localhost:3000?filters=%7B%22date__gte%22%3A%5B%7B%22label%22%3A%222020-04-01%22%2C%22value%22%3A%222020-04-01%22%7D%5D%7D of e.g. changeset#91638199
    • The app runs with https; Firefox is recommended since it allows self signed certificates.
    • The staging database does not have all the changesets that production has, therefore the filter is needed.

To also edit the part of the UI that is provided by the OSM Changeset Viewer

Checkout https://github.com/osmlab/changeset-map in a sibling folder.

In ./changeset-map:

  1. yarn link
  2. yarn build --watch

In ./osmcha-frontend

  1. yarn link "changeset-map"
  2. yarn start

Edits in both projects will result in a rebuild and reload the browser.

When finished, reset "osmcha-frontend" back to the npm version of "changeset-map" with yarn add changeset-map@latest

Local testing

Test the application before commiting any changes. If you encounter any error make sure you have watchman installed. Installation Guide.

yarn test

Deploy/Release

  • There are three stacks to deploy to
  • yarn deploy:dev deploys it to mapbox.github.io (currently broken)
  • yarn deploy:staging deploys it to staging.osmcha.org
  • yarn deploy:prod deploys it to osmcha.org
  1. Run the tests with yarn test

  2. (optional) before deploy, you might want to increment the version number of application.

    • We use minor for all non-drastic changes.
    • The patch is reserved for minor changes.
    • We try to stick to sem-ver.
    npm version minor
  3. Then build the app with the following command.

    yarn build:<stack>
    • here stack could be dev, staging, prod. Refer to package.json for more info.
  4. The next step involves deploying the build folder to github. If you get an error like this error: failed to push some refs to 'git' while doing the deploy step. Run rm -rf node_modules/gh-pages/.cache/.

    yarn deploy:<stack>
    
    • here stack could be dev, staging, prod. Refer to package.json for more info.
    • oh-pages branch handles the build for staging, prod stacks.
    • gh-pages branch handles the build for dev stack.
  5. (optional) If you want to see the new changes on a staging or prod stack. You will need to draft a new github release. The convention is to append -staging or -production or just -server to the current version tag for the server to consume the build and separate concerns.

    • for eg. if the version npm module version was v0.16.3.
    • draft a github release with a tag v0.16.3-staging. (Note the name spacing)
    • supply this version tag to the server.
    • Refer to githubs article for creating releases.

Issues and feature requests

If you have any error reports of want to request new features, please read our contribution guide to file an issue.

osmcha-frontend's People

Contributors

ajithranka avatar arch0345 avatar bmillemathias avatar danieldegroot2 avatar dependabot[bot] avatar geohacker avatar grischard avatar gszy avatar jasonharrison avatar jinalfoflia avatar kepta avatar manoharuss avatar mkopinsky avatar naoliv avatar rasagy avatar redsoull avatar scottwalkerau avatar simon04 avatar sunu avatar thalesbruno avatar tordans avatar tridip1931 avatar willemarcel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osmcha-frontend's Issues

Deployment workflow for production

We need to setup a workflow for copying the static and dynamic (htmls) to the backend server.

  • Change /osmcha-frontend/ url in package.json to / for production
  • change all the links to / for production
  • handle the case when .com/:id comes and convert it to .com/changeset/:id
  • make osmcha backend for this.
    cc @batpad

[UI Discussions] Changeset List

Following up from #11, let’s use this ticket to iterate on the Changeset list:

c - changeset-list - v2
(Initial mockup)

Based on my discussions, here’s the list of fields in the order of importance:

  1. Verified status — Not reviewed, harmful, not harmful (Helps to skip already verified changesets)
  2. Changeset comment (Most descriptive: reverts/HOT tasks vs gibberish/foul language etc.)
  3. Count of added/modified/deleted objects (Gives context on the scale of the changeset)
  4. Flagged reason
  5. Date created
  6. Tags added by user (Not as important in the list view)
  7. User name (Might have cues like gibberish characters, or suffix like _revert)
  8. Changeset ID (Helps to lookup details on other apps, but not as relevant to see in the list)
  9. Verified by username (Useful in only edge cases)

Apart from this, a state change (visual attribute) that shows:

  • Changesets not opened yet
  • Current changeset being viewed (selected)
  • Changesets that have been opened

Here’s the mockup with the above details:

c - changeset-list - v3

Specific details:

  • Bar on the left indicates verified status (Harmful, not harmful, not reviewed)
  • Background color of list item + font-weight of comment indicates opened/selected state

cc @kepta @ajithranka @batpad @geohacker @Rub21

Unify constants

currently call url constants are scattered, it would be better to have a consolidated file for them.

A user page

Creating this ticket to track user page related things.

keyboard shortcuts

We need to discuss and implement proper keyboard shortcuts for everything .

Using a component library

To speed up design & development time, I think it might be useful to rely on a react component library instead of using assembly. AFAIK, assembly does not have an extensive library of React components.

Let's assess these

Some considerations

  • Ease of designing responsive layouts
  • Extensive collection of complex form components
  • Stability and popularity of the library

Ref #8.
cc: @kepta @rasagy @batpad @geohacker

Mobile view

Currently the mobile view is in denial, we might need to fix mobile related issues.
I will add all the minor issues related to mobile and small screens here.

User feedback + Design Directions

Last month, we did a short user feedback session with the data team that have been actively using OSMCha for the daily validation work. Using this ticket to document what was discussed and planning next steps.

Here are the key pain points that were highlighted in the conversation:

BBox + Filter

  • Favorite filters: No easy way to keep track of filter combinations that one might use regularly
  • Notifications: No way to know if there are new changesets for a particular filter — especially useful with one/multiple bbox set as my area and get notifications for new results
  • Logic operators: Can’t exclude certain values/filters using a NOT (!) operator
  • Tag-based filters: No way to extensively filter for a particular tag, like looking for all changesets that add fire hydrant(s)

List of Changesets

  • Auto refresh list: Once some changesets are checked, the list doesn’t auto-refresh, so you need to refresh everytime — which is slow if there are several changesets in the result
  • Pagination controls: You can’t control how many changesets show on each page (set to 15) or jump pages quickly (without editing url) — which makes some low signal queries hard to parse through
  • User details: Apart from user name and changeset comment, showing more user specific details (like user ratings from HDYC, edit count etc.) can help identify potentially harmful edits quicker

Individual changeset page

  • Multiple tabs: Due to the slow speed of changeset map (or loading errors), folks in data team tend to open multiple changesets in tabs (~3) in one go so the others load while they examine one.
  • Discussions: Not seeing changeset comments in this view means they might spend a lot of time on a changeset that might already have been flagged by the community

Changeset details & actions

  • User details: Generally head to OSM to see join date, description, edit count, diary post count, active blocks + history
  • View changeset in OSM: This helps see any major visual breakage on a map quickly — the OSM map style shows more detail than Mapbox Streets/Dark style
  • View feature list in OSM: In some cases, it helps to see all the features, not just the suspicious ones
  • Opening in JOSM: For complex changesets, opening directly in JOSM doesn’t work (slow/too large bbox) — instead folks in data team tend to zoom into particular part of changeset in OSM or select a feature from the list and then load that bbox or feature in JOSM
  • Actual reason vs possible reason: No way to specify what was actually wrong in the changeset (for analytics or machine learning)
  • Tracking status: No way to track if something that was marked harmful was fixed (reverted), or still not reverted, or get notifications if there’s an activity on the changeset (this would be a workflow overhead though)
  • Tracking action: No way to specify what was done: was a harmful changeset reverted completely, fixed (partially), comment was left on changeset or something else
  • Leaving a comment: No way to quickly leave a comment, so tend to go to OSM comments for this

Mark as harmful/valid

  • Actions: They generally don’t mark all valid changesets, only the harmful ones

cc @batpad @geohacker @ajithranka @kepta @willemarcel

Forbidden actions

We need to handle some forbidden operations, like when the user tries to check or tag his own changeset or is not logged in to check/tag another user's changeset. We could show an error message or just hide those buttons.

Workflow and UI directions

I got started with some quick thumbnail sketches to highlight key information+states for each step of the flow, and explore UI patterns that we can use.

osmcha - collection of concepts

Details of each concept

osmcha-concepts - a

A) Tabs or wizard like breadcrumbs:

Split the three major steps — Filter, List, Details — into individual tabs, with either some tabs disabled (no details till you select something in the list) or visual cue of which step of the flow you are, and what you can jump to (filled/stroked circles).

What works:

  • Clear mental model
  • Highlights the major steps: Filter, Select, Explore

What doesn’t work:

  • Tabs are usually mutually-exclusive, and the relation between the tabs isn’t as evident
  • The actual workflow is non-linear, so can’t use a wizard/step-by-step interface — you might jump into the second step (link to results of a filter) or last step (link to a changeset detail)
  • Leaves no context to quickly jump across changesets — you need to switch tabs to go next

osmcha-concepts - b

B) Vertical Accordions

Each section expands to the full screen, with one vertical bar each for the other sections. Allows you to hover on the bar to get a glance of that section, which might be helpful in switching from details view to list of changesets and jumping to another changeset.

What works:

  • Allows you to get a glance of the previous section
  • Can glance at the whole list of changesets and jump around easily

What doesn’t work:

  • Narrow column width for glancing would limit what can be shown for each section while keeping a consistent layout
  • Collapsed states can’t be used to show any detail (except icons or vertical text)

osmcha-concepts - c

C) Horizontal Accordions

Similar to above, but with the sections stacked horizontally. The bar for filters could show the specific filters that are being used, and the bar for changeset list could show the selected row (and more rows on hover/glance)

What works:

  • Easy to use a consistent expanded and collapsed layout
  • Better context for both filters and list
  • Scope for better transitions

What doesn’t work:

  • There’s lesser real estate on the Y axis (on a typical wide-screen monitor), so this will take significant screen space to show detailed collapsed sections
  • The changeset list won’t be easy to view completely in a glance (only a few rows on hover)

osmcha-concepts - d

E) Map based

Shows bounding box of each changeset in the search result on a map, and allows you to hover to see basic info and click to see details

What works:

  • Orients you geospatially — could be useful for users that are focusing on one area regularly
  • Bigger changesets (that could correlate to more impact) will be easier to spot
  • More details could be shown by adding visual properties to the bbox: thicker bbox for high number of features, colors for more additions/modifications/deletions etc.

What doesn’t work:

  • Might get very complex for low zoom levels or high number of changesets
  • Would be difficult to interact with overlapping bbox

osmcha-concepts - e

Hoverable Edge Panels

Both Filters and Changeset list collapse into small panels on the top and left edge, and hovering on each part shows more details (change existing filter or view detail of other changesets in the list)

What works:

  • Allows quicker modification of filters
  • Persistent view of changeset list

What doesn’t work:

  • Not too valuable to have such interactivity for each part of filter & list
  • More value in parsing through the whole list at once instead of hovering on each item

Conclusion:

We’ll go ahead with (C), and I’ll work on more detailed designs that I can use to get feedback from users.

cc @ajithranka @kepta @batpad @geohacker

Hide changesets that are still being processed

The default list of changesets reflects all changesets, which means the most recent ones will have data that is still being processed. We should hide these so it doesn’t get confusing for people — in any case these won’t be usable till we fetch all the details.

screenshot 2017-06-12 16 13 52

cc @batpad @geohacker @kepta

Blockers for a beta testing.

We are almost there with the existing osmcha.
Couple of things that need to move before we start beta testing the app, next week.

Login


Status Completed
Info The current login mechanism doesn't work in regular browsers. @wille is working on an update.
Beta release Blocker

Changeset Details View


Status functional but scope for improvement
Info This design is being tracked here. The changes mention require a UI uplift from both osmcha and changeset-map side. Would like to push it at the last of priority.
Beta release none of them are a blocker for beta testing.
V1 release Up for discussion. Fix nit picks from beta testing phase.

Changesetmap


Status functional and ok for v1.
Info Changesetmap has gotten a serious refactor to accommodate the needs for this project. Currently we have to unload and load changeset-map when Changeset Details View goes for loading, we should decouple cMap from this view.
Beta release good
V1 release ok Fix nit picks from beta testing phase.

Sidebar View

Status Functional and good enough for v1.
Info Rasagy has some concerns our the sidebar aka changeset list, which are discussed here.
Beta release good, none of them are a blocker for beta testing.
V1 release But we might need to consider the suggestions for the June 5 release.

Filters View

Status non- Functional
Info Filters page would be the major chunk of work to get to the June 5 release. Currently the design is ready and need to start on implementation. Ticket for discussion.
Beta release blocker?
V1 release blocker

Add tags

Status Not yet picked or discussed formally
Info The backend allows us to add tags to a changeset. Have some concerns about how it will look and work. Need to open a ticket for it.
Beta release unknown?
V1 release unknown?

Suspicious Feature

Status WIP
Info To get feature parity with existing osmcha. We need to be able to click on a feature and show it on the map.
Beta release up for discussion ?
V1 release desirable?

Miscellaneous

  • Fresh data: Get fresh data from backend
  • Fix map style: changeset-map map style doesn't work atm.
  • Page ref in urls.: show the page in url ?

cc @batpad @ajithranka @rasagy @manoharuss

Checklist for launch

Listing things that we should try to include (must have + good to have) when we release the new beta.

  1. Good About page: More detail about what the tool is, what validation is about, what flags mean, and a bit about repo, licensing + Mapbox etc.
  2. Welcome to NEW OSMCha modal: Highlight the major changes in the new UI
  3. Walkthrough: (Optional) Step-by-step list of UI highlights

cc @kepta @batpad @geohacker

Fix pagination on front-end

Right now it always shows a list of page numbers even when those pages don't exist, and clicking on an invalid page number seems to break things a bit.

Also would be nice to display the count of results returned somewhere.

Validate input fields

Fields like Filter dates needs basic checks so that invalid input should give an error. For ex: From is after to, to/from is in the future etc.

cc @kepta

A couple of UI appearance suggestions

Hi
I'm finding this project very useful.

Could changeset descriptions be added to the dialog so it can been read in fullscreen mode? It's useful as a guide as to what was edited.
Could the dialog be collapsible to an icon & slightly transparent when open?

capture

[UI Discussions] Changeset Details

Following up from #11, let’s use this ticket to iterate on the Changeset details view:

c - changeset detail - v2

Key information:

  1. Main header with CTA
  • Open in (JOSM, iD etc.)
  • Verify (Harmful, not harmful)
  • Add tag (Longer list of tags that could explain actual cause, action taken, escalation etc.)
  1. Changeset metadata
  • Apart from what’s visible in the changeset list, more details like Imagery, Source, Editor etc.
  1. Flagged features
  • Table with links to open the individual feature page, highlight it in changeset map, open in JOSM
  1. Changeset discussion
  2. Changeset map

For the layout, I’m envisioning the top half with dedicated section for 2, 3, 4 and the bottom half for changeset map. This ensures that the changeset detail is always visible (for context), and you can view the flagged feature list along with the changeset map (so you can quickly inspect individual features on the map without any scrolling).

cc @kepta @ajithranka @batpad @geohacker

Fix feature selection remaining from previous changeset

Steps to reproduce:

Click on changeset in list.
Select a feature on changeset map.
Click on different changeset on list.

What happens:
The details for the feature selected from the previous changeset still shows on changeset map.

What I expect to happen:
Feature selection from previous changeset is cleared.

Better naming of redux constants

We can scope similar constants in an object and achieve namespaced constants.
This should reduce the visual clutter they created.

Define default date range filter

Sometime ago we talked about to define a default date range filter in the frontend, because the database count operation to return the total number of changesets takes too much time. So defining a smaller default date range will make the API response be faster and save our servers. As I remember, we thought to define the default date range to one week.

cc @batpad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.