Code Monkey home page Code Monkey logo

crews's People

Contributors

dependabot[bot] avatar pedro-otero avatar

crews's Issues

Builds to dev env are failing

Builds to dev env in Netlify are failing, always. The error message contained something about not being able to resolve progress/progress so it may have been introduced in #15. The build command locally works just fine.

Set all tracks in state after loading album

When viewing an album and then clicking a track, if it's not in state, it's loaded using the Spotify endpoint. This brings the full track. A simple track is enough ti display it in the TrackDetails component, and all simple tracks of the album are contained in the album.

In the thunk that loads the album, if succeded, all tracks of the album must be set into state using the setTrack action. This way:

  • User sees the data faster
  • No additional data is consumed because of an extra API call
  • Calls to the API are saved up

Do not remove the load track thunk

HOC for containers

Both TrackContainer and AlbumContainer have duplicate code. Their componentDidMount and componentWillUnmount are the same. Consider an HOC for them.

User library

Read artists, albums and tracks from user library. #19 is necessary for this.

Handle styles

  1. Use styled-components to solve the following issues:
  • Pass a size prop to Cover to be used both as width and height.
  • Produce the background of Banner (because the image itself is variable).
  1. Also, scope all the styles (except globals) to avoid clashing. One alternative might be point 3 here but CRA will only support it in 2.0 (facebook/create-react-app#2285)

#16 should be addressed first so changes to the component can be viewed easily.

Global tests init

Initialize globally enzyme and the tests adapter globally
Make sure tests can be run individually, as a whole and with coverage

Refactor components properties

Currently many components are requiring complex structures such as album, artist, and so on. Because of that:

  • These complex structures have to be built correctly in order to write stories and tests.
  • The components are coupled to Spotify's current data structure for such entities.
  • Reusability of the components is compromised.
  • Redundant data is being passed. Example: Both a simple and full track (see model) contain the artist name. In a component that requires artist and track, that info is duplicated.

Example:
Cover requires an album. But all it needs is an image url. Make it require just that.

Such refactorings will likely affect all the components that require them and the refactored component's tests. Tackle one component at a time. As in per PR.

Current components that need the refactor:

  • Album
  • Cover
  • Credits
  • Current Playback
  • Track Details
  • Track Item

The ones not included here either don't need it or are already built this way. Also, components may use so many properties of the same object that the actual object may make more sense than a very long list of properties.

Spotify throttle

Allow the Spotify module to function like a throttled queue, much like the Discogs API is used by Crews-BE.

  • The throttle time should me parameterizable as a REACT_APP_ env variable.
  • The queue has to intercept error 429 and add the delay in the Retry-After header to the next request.

Welcome and logout components

If app has never been run, a welcome component should show so and instruct the user to login with their Spotify account. Also, once in, they should be able to log out. After logging out they should see the welcome component.

Refactor state

State must hold only the exact info needed to display the tracks and albums. Currently, all info as it's coming from Spotify is being stored in state.

Tracks and albums should be kept apart and albums should only contain the ids of their tracks.

Change component where you trigger the search

Currently root is in charge of triggering the actions that start searches inthe backend for albums and tracks. When such components unmount, they're unsubscribing from the all observables started.

Change the place for dispatching the actions to its corresponding component.

Artist Work component

Create Artist Work component that acts as the header for track and album pages.

Desktop
image

Mobile
image

Properties:

  • title: The name of the work, such as either the track or album title.
  • artist: Name of the artist.
  • background: URL of the blurred image in the background (the one in a Banner component).
  • image: URL of the image to the left.
  • year: Year of the work.

Should also accept children to be accomodated below the work title as shown in the images

Create stories

Add stories for every component. At least one per component.

Retry button in EmptyPlayback component

Show a retry button in EmptyPlayback component so request of current playback can be retried without reloading or hittin back. Please note than when reloading app state is lost.

URL when logging out

When logging out, don't reload location. Redirect to / instead. If user were viewing a track, is that UR they're going to be directed to when logging out.

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.