Giter Site home page Giter Site logo

diljotsg / throne-web Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 1.71 MB

A web application that lets you find, rate, and review washrooms in your vicinity.

Home Page: https://findmythrone.com

License: GNU General Public License v3.0

JavaScript 95.37% HTML 1.15% CSS 3.48%

throne-web's Introduction

Hello there! 👋

  • I am a Software Developer looking to build cool things and work with awesome people! 🧪
  • I love building software using Python (it's one of my favourite languages). 🐍
  • If you're interested in working together, feel free to reach me via Email or connect with me on LinkedIn! 💻
  • Fun fact: I am a huge MCU nerd. 🎥

throne-web's People

Contributors

adrianpolimeni avatar amroller avatar dependabot-preview[bot] avatar diljotsg avatar jameswklassen avatar nickjosephson avatar raquelthiessen avatar tylerloewen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tylerloewen

throne-web's Issues

Display more washroom data on the 'Near Me' page

Depends on #47 (i.e. we should probably figure out what the ui looks like before we start building a bunch of stuff)

Description

Since /washrooms returns rich objects, populate the 'Near Me' list with more relevant data.

It doesn't necessarily have to be identical to iOS (since we haven't made UI mockups), but could be similar?

Maybe we should mockup what a list should look like first.

Relevant Screenshots

File

[MASTER] Washroom creation flow

Depends on #95

Master issue for implementing the flow to create a washroom. Please reference this issue with related PRs.

When creating a washroom, the following options need to be included:

  • Gender
  • Floor
  • Title
  • Amenities

Truncate star rating to 0.5 intervals

When displaying the Rate component, it supports .5 stars, but it doesn't automatically truncate the value, and doesn't correctly display a half star.

We need to round/truncate the rating to a multiple of 0.5.

This should be in a top level directory utils and file called RatingUtils (or something more general). This util should have no knowledge of anything. It should just take a float and convert

Anything from [0, 0.5) should be rounded to 0
Anything from [0.5, 1) should be rounded to 0.5

Screen Shot 2020-03-02 at 8 58 06 AM

Screen Shot 2020-03-02 at 8 59 02 AM

Fix washroomActions test

In order to get authentication merged in, we had to skip a test that was failing

it('creates FAILURE event when request fails', () => {

Since a 'failed' washroom request (code 401) causes the API handler (src/api/throneApi.js) to refresh the tokens, for some reason the refresh tokens API call is causing this test to fail.

Maybe find a way to mock the refresh tokens API call in the test, or modify it in such a way that it passes.

Add user washroom terminology

From the Settings page, allow a signed in user to set their washroom terminology preferences from a list as preferredTerm.

We can store this in local storage by doing something like this:

localStorage.setItem('preferredTerm', <term>)

List of washroom terminology to include:

john
crapper
latrine
washroom
bathroom
toilet
restroom
lavatory
powder room
comfort station
water closet
privy
loo
can

Change Web UI to Emphasize Building Title/Gender/Floor

Currently the Web UI when displaying washrooms emphasizes the Washroom Comment (AKA Additional Title). This should be changed to be more inline with the iOS App. The iOS App emphasizes the building title, the gender of the washroom and the floor before displaying the comment. This comment descriptor is intended to be used as an "additional explanation" to where the washroom is located.

Relevant screenshots:
image
image

Map should fill full screen

On mobile (and desktop too) there is lots of wasted space surrounding the map.

We should adjust the sizing of the map so it fills more of the screen.

Note: the map component gets drawn initially with width and height props, however remains at this size even when the page is resized.

i.e. width: 100% implies 100% width when the page loads, so the map size remains static, even if page resizes.

On mobile this shouldn’t be an issue, but we should have some sort of callback when the window is resized to redraw the map

image

UI Mockup for 'Near Me' Page

Overview

We should plan what the 'Near Me' page will look like before we start building it.

For reference, iOS has already started with some information being displayed.

Relevant Screenshots

File

Washroom detail view

Depends on #48

Overview

When a user clicks on a washroom, they should be brought to a more detailed view of the washroom.

This might make sense to break into PRs to keep them small and manageable

  • Handle clicking washrooms and navigating to a new page specific to a washroom
  • Nice UI/component to display washroom

Authentication Tokens don't automatically refresh

Issue

Sometimes when visiting the page for the first time after a while, the token needs to be refreshed. There's a button that does it manually, but it should be done automatically.

Where to look

API handler

This is where the API should refresh the tokens if it gets an 'unauthorized' response (i.e. expired tokens)

static async getEndpoint(url) {
const accessToken = localStorage.getItem('accessToken');
let response = await this.getRequest(url, accessToken);
if (response.status === 401) {
await Auth.refreshLogin();
response = await this.getRequest(url, accessToken);
}
return response;
}

Auth service

The Auth service might have to be edited/looked at as well (src/services/Auth.js),

static async refreshLogin() {
if (Auth.refreshAttempted) {
Auth.logout();
return;
}
const response = await Auth.refreshTokens();
if (response.ok) {
Auth.refreshAttempted = false;
} else {
Auth.refreshAttempted = false;
Auth.logout();
}
}

Relevant screenshots

Before refreshing the tokens (we should never see 401 error)

Screen Shot 2020-02-21 at 11 21 32 AM

After refreshing tokens

Screen Shot 2020-02-21 at 11 21 49 AM

Add user authentication

Since all API requests must be made using a per-user auth token, implement a user system.

Each API call will have to include the user's auth token in the headers. Maybe there's a way to set the headers for all calls to fetch globally? Look into this

Write API handler

Right now, we have a primitive handler in src/api called washroomApi to abstract away API calls for the reducers.

This could be a more generic api object......

Initial 'Map' page

The 'Map' page should display at least a placeholder map

  • This will involve research to find the best map service and include it

Fetch a single building from the API

This will be similar to the flow created for fetching a single washroom (#76).

In order to keep the PR small and manageable, implement only the redux actions/reducer cases for fetching. (i.e. no front end) – similar to #87.

Display user information on Profile page

In the Profile component, lost some user information (Name, profile picture, list of preferences) for the currently signed in user.

Note: this issue does not encompass creating preferences/uploading profile pictures, simply to display the information in some way.

Fix 404 on Page Refresh

Steps to Reproduce:

  1. Visit https://dev.findmythrone.com/
  2. Click on Map or Profile
  3. Refresh the page

The problem is when we are in the midst of our react app and we refresh the page, we lose the context, so the browser is trying to fetch the contents at the URL: /profile but that isn't a file hosted by our web server.

Create Login/sign up page

Currently, when an unauthenticated user views the app, they see this launch screen.

We should create a more visually appealing screen for this.

Right now, this content is conditionally rendered inside App.js, however could (and probably should) be housed in a separate component.

Screen Shot 2020-02-19 at 2 38 31 PM

Review a washroom flow

Add the ability to leave a review on a washroom

Reviews should include

  • a star rating ⭐️ for
    • cleanliness
    • privacy
    • paper quality
    • smell
  • a general text comment

Fix padding on mobile

Currently on mobile the padding is too high on the entire app.

We should fix the CSS selectors to make this fit better on mobile. Likely using a mixture of padding and max-width

image

Implement redux

Implement react-redux to better manage application state and events

Building Detail Page

Build a component to display a building.

This should include

  • the washrooms contained within building
  • a map displaying building location

Map height doesn't adjust

#112 went in to fix map sizing on window resize, however it appears that the height of the map is not scaling with the window.

The bug is likely in this code:

handleResize = () => {
let { viewport } = { ...this.state };
viewport = { ...viewport, ...mapDimensions };
this.setState({ viewport });
}

As the width is getting updated in the resizeHandler, but the height is only being set on component mount.

Map page should display a user's current location

Description

On the 'Map' page, it should default to a user's current location.

Note: Safari will not allow current location to work over an insecure connection (HTTP) such as localhost:3000.

You can hack a way to force https:// locally, or use a different browser to test this functionality.

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.