Giter VIP home page Giter VIP logo

code-corps-ember's People

Contributors

applejax avatar begedin avatar chjpugh avatar dennybiasiolli avatar eablack avatar ethantanner avatar filipecrosk avatar fxvarga avatar green-arrow avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hbrysiewicz avatar idelairre avatar igarrenton avatar ivy-g avatar jayjayjpg avatar jderr-mx avatar joshsmith avatar kumarmj avatar m0nica avatar marineb avatar npendery avatar pixelhandler avatar rileytaylor avatar sarupbanskota avatar sashashakun avatar snewcomer avatar terrancebryant avatar thomascchen avatar wenincode 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

code-corps-ember's Issues

Handle 401 unauthorized better

Should we be logging users out anytime they hit a 401? Right now I see that when adding a new post, I get logged out of the application if I didn't have permission to do so. This seems unexpected. Not that I should see the form if I didn't have permission. But I'm not sure this is expected behavior.

What do you think @begedin?

Create comments form

We need to create the front-end for creating a comment. Markdown preview would be nice but not necessary.

Create login form

We need a login form for email/password, add a link for "sign up" to login form, and after signing in, redirect to projects page.

Find a way to get user's permissions for a project

This is problematic because only certain types of users can create certain types of posts. And we'll need to show the types in a dropdown.

We can't show the same list to everyone, since some people can only submit issues, and some people can submit anything.

Add listing of user's skills to user profile

A user should have their skills listed on their profile.

We'll want to use the {{related-skills}} component for this, and pass in the userSkills of the user who's currently viewing the profile (to see the skills they have in common).

This will need an h2 or h3 tag in the component for Skills, and perhaps an ( i ) icon that will say "Skills you share are highlighted" when hovering, in a tooltip.

User should be able to navigate to a list of applicable projects from their skills page

See #6

A user selects skills they have and should then be able to click "Show me the projects" to get a list of projects that require the skills they have.

This navigates from the skills page to the project page, so it is blocked both by #7 and #9

It will involve either adding a list of skill ids to the projects request, or a user_id as well as changes api-side which would return a list of projects appropriate for the specified user.

@joshsmith What do you think the better approach would be.

The way I see it, filtering by skills would allow us to later implement a skill-based search of projects, while just fetching projects appropriate for the user would make it a simpler request. Are we planning such project searches in the future?

Handle "" correctly in /settings/profile

Currently in /settings/profile if a user removes their name/website etc. from the the text box and then clicks update it will erase their previous data.

Not sure what we should be checking for/doing here. For example, we probably want them to be able to remove a website they no longer have access to or user but probably we probably want them to have a name once they add one.
This or at least ask, "Are you sure you want to remove your Name?" if they previously had information and then are setting it to an empty string.

Handle errors better

For API error wrapping, some research notes:

Ember-Data expects the typical JSON API error format, but there is a difference in how it works with validation, and other errors.

  • If the response code is 422 Unprocessable entity, ember data will initialize a DS.InvalidError.
  • For any other code, the initialized error will be DS.AdapterError

DS.InvalidError

DS.InvalidError expects the error data to be in the following format (the listed properties are the minimum it needs to have):

{
  errors: [
  {
    detail: "Detailed message"
    source: { pointer: "data/attributes/dasherized-field-name" }
  }
  ...
  ]
}

If the errors are in this format, ember-data's serialization layer will parse them and the model will have its model.errors property set. Note that the model.isError will not be set to true in this case. The model.isError property is only set to true if, during a model.save, the server returns an error that is not a validation error.

The default field name format is dasherized, but my guess is, if we override our serializer to expect underscored property names by default, that setting will also apply to errors.

My proposal is that, for validation errors, we do a PR on the API side which changes how we serialize those errors so the format is valid for ember.

Then, we handle such errors by catching a failed save on the model. We will have access to properties such as model.get('errors.username'); and it will be easy to display them.

Fetching the property in the way I describe will give us back an object:

[
   {
      "attribute": "username",
      "message": "The username is too long"
    }
]

Basically, detail is mapped to message and pointer is mapped (with modification) to attribute.

DS.AdapterError

This instance is used for any other error, including model save errors that aren't validation errors. This type of error expects the format:

errors = [
  {
    title: 'Adapter Error',
    detail: message
  }
]

If the API doesn't return a body with an error response, a default error object will be generated, with a single error in it, with detail set to 'Adapter operation failed'.

There are two additional error classes which are sometimes used - DS.AbortError and DS.TimeoutError. They inherit from DS.AdapterError by initializing it with custom messages of their own.

Basically, I don't really think we should handle errors in any custom way. Ember-data already wraps errors on it's own well enough.

At most, we might want to override the messages ember uses, so we could do a wrapper for that, which checks the error type and returns a different message based on that.

Something like

function overrideErrorMessage(error)
  if error.typeOf(TimeoutError) { 
    error.set('message', 'Our custom message for timeout error');
  } else if (error.typeOf(AbortError) {
    error.set('message', 'Our custom message for abort error');
  }
}

We would likely override the above two, since as far as I can tell, they are raised when the operation fails, but the server doesn't respond with anything.

For an AdapterError, the server did respond with something, so we should leave the message the server provided.

Create signup form

We need to handle username, email, and password. Add a link for login instead to e-mail signup form. And after signing up from the front page, redirect to skill selection.

Improve profile page page

We need to design a user's profile page, which will include a user's basic information, photo, skills, website, Twitter, and contributions.

Design profile edit page

We need to design a page for users to edit their profile.

  • User can edit their photo
  • Better spacing on the page
  • Ability to edit skills from here

Add ability to join a project

You should be able to click a button in a project to join it. We should flash success (and maybe some sort of popover to really drive home the thanks and give some orientation), and change the button.

Design project page

We need to design the individual project page.

Should look something like:

screen shot 2015-07-13 at 12 40 39 pm-1

Make acceptance tests fail properly because of routing issues

Right now the acceptance tests do not fail properly. I think that inserting things into the schema directly like we're doing with Mirage right now is causing an issue where we have false positives on acceptance. In reality, we need to ensure that the route is going through the process of hitting a particular API URL, which I don't believe is happening right now.

Add markdown rendering

We'll need to properly render Markdown in comments (and the post's body, which is also in Markdown).

Add photo to user profile

  • It should be viewed
  • It should be editable
  • The API will accept base_64_photo_data, so there is no need to upload. It should suffice to read the photo on the client side and send the bae64 data - blocked by code-corps/code-corps-api#187
  • Might be a good idea to limit file size.

Remove nesting for routes

Unlike on the API side, routing on the Ember side should be mostly unnested. Nesting routes in Ember means nesting of UI, which is mostly not what we want. An individual post should not be nested inside the list of posts, for example.

Design projects list page

We need to design the list of projects. We're only starting with one, so we should keep that in mind.

Finalize post publishing/draft process

For new posts

  1. User starts typing
  2. Periodically, the post is saved to the API as draft
  3. API transforms markdown into html, sets it to post body, returns post with body filled in
  4. Ember can show preview using body field in separate tab/pane
  5. Once user clicks publish, the final version of the post is saved in the published state

For edited post

  1. User clicks edit on existing post
  2. Periodically, the post is saved to the API as a separate draft
  3. API transforms markdown into html, sets it to post body, returns post with body filled in
  4. Ember can show preview using body field in separate tab/pane
  5. Once user clicks publish, the original version of the post has changes saved.

Questions

  1. What does the API do with the drafts once publish is done - might require issue on API side.
  2. How does the API figure out which original post the draft of an edit belongs to? It could be doable by identifying via number, but I'm not sure. There is no unique index on the number field at the moment, so it is possible.

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.