GithubHelp home page GithubHelp logo

cams-app-client's People

Contributors

aalanders avatar ammanley avatar andrewmundy avatar aricwl avatar bigrobsf avatar divyaoswal avatar ggladden avatar joelponce avatar jonwyuen avatar jrobinson2 avatar mmmaaatttttt avatar tbobarino avatar tigarcia avatar tochaim avatar tostaylo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

cams-app-client's Issues

this is gross

toggleForm(e) {
e.preventDefault();
if (e.target.id === "addVideo") {
this.setState({
showVideoForm: true,
showQuestionForm: false,
showMultipleChoiceQuestionForm: false,
showVideoPlayer: false
});
}
if (e.target.id === "addQuestion") {
this.setState({
showVideoForm: false,
showQuestionForm: true,
showMultipleChoiceQuestionForm: false,
showVideoPlayer: false
});
}
if (e.target.id === "addMultipleChoiceQuestion") {
this.setState({
showVideoForm: false,
showQuestionForm: false,
showMultipleChoiceQuestionForm: true,
showVideoPlayer: false
});
}
}

Login before authenticate

When I run the app locally, sometimes it seems like i'm being redirected to login before authentication is completed - i get a 401 and my playlists don't show up. Doesn't happen consistently, and when i refresh the page everything shows up normally.

Component / file names

Make sure that for files exporting a default component, the file name matches the component name. This currently isn't the case for a couple of files (e.g. Login vs LoginForm)

too many requests!

app is sending a bunch of PATCH requests unnecessarily:

componentDidUpdate() {
this.state.screenData.forEach((value, index) => {
axios.patch(
`${BASE_URL}/api/screens`,
{
entity_id: value.entity_id,
playlist_id: this.props.playlistID,
order: index + 1,
type: value.type
},
config()
);
});
}

first, this request only needs to be sent when drag and drop is happening to re-order screens. Second, it would be better to only fire this event once (e.g. on a componentWillUnmount).

Automatically send authorization headers for logged in users

There are several client-side requests being made in the app that require an authorization header be sent. Rather than duplicating code across components and functions, you can tell axios to set this header on every request. App should be refactored so that on login, something like this happens:

axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;

On logout, this default header can then be deleted.

Assessments don't show questions

/playlist/home needs some refactoring to accommodate the Question model. Right now, only videos get shown when a patient goes through the playlist, not questions.

add a helper to get current user id from token on client

There are quite a few places where the same code is being written to grab the token from localStorage, decode it, and find the logged in user's id. To remove duplication, it would be better to refactor this into a helper.

spaces, not tabs!

indentation is a little inconsistent. Use 2 spaces throughout. Some files need to be looked over and fixed.

Necessary styling fixes

  • In the patient assessment view, use flexbox to center the content on the screen
  • In the patient assessment view, remove the index displayed above the timeline
  • In the patient assessment view, move the timeline to the top instead of the bottom, make sure it's centered on all devices, and remove margin (styling right now is hard-coded and device dependent: https://github.com/rithmschool/cams-app-client/blob/master/src/horizontal-timeline/EventsBar.js#L44)
  • In the patient assessment view, add more design to differentiate dots in the past from dots in the future in the timeline
  • In the patient assessment view, center the timer and add more design elements
  • Improve the design of the screen creation after making a playlist (owned by @aricWL)
  • Improve the copy in the emails being sent to patients for their assessments
  • On the doctor assessment dashboard, format the timestamp nicely and order by most recent
  • On the doctor assessment dashboard, style the button to download a link

Pull out components in Nav.js

There's a lot of markup inside of the render method that could probably be pulled out into a few different component files.

Improve flow through assessment as a patient

UI could use some improvement; there's no visual cue to press space bar after the timer is finished or a video is complete, for example. A little more visual polish overall would be good too.

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.