Coder Social home page Coder Social logo

mitodl / open-discussions Goto Github PK

View Code? Open in Web Editor NEW
10.0 25.0 2.0 25.6 MB

License: BSD 3-Clause "New" or "Revised" License

Shell 0.23% HTML 1.61% JavaScript 35.17% Python 49.14% Dockerfile 0.02% SCSS 2.81% Procfile 0.01% TypeScript 10.99% Handlebars 0.01%
community mm mit

open-discussions's People

Stargazers

 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

open-discussions's Issues

Centralize documentation for installation

We currently have some of this information in this README, some information in reddit-config and some in reddit itself (for example setting up reddit.local in /etc/hosts). We should put all of this in a Getting Started section at the top of this README

Create theme API

This should be the wrapper around the subreddit APIs that exposes the limited scope of features we want exposed.

These are the minimum features:

  • API to list themes
  • API to create/edit themes

consider using Prettier for JavaScript formatting

prettier is an automated code-formatting tool for JS that looks pretty nice, basically it parses the JavaScript to an AST and then re-writes it all, allowing it to do more complicated types of automated transformations that ESLint, for instance, can't do in an automatic way. It seems like there's support to run it alongside ESLint, since prettier doesn't catch certain kinds of semantic errors in the code (which ESLint does).

anyway, I think it looks interesting and would like to try it out! @noisecapella @rhysyngsun thoughts?

JS code formatting proposal

Currently we have our line-width set to 120 characters. Prettier (the JavaScript code formatter) uses this line width to figure out how much to fit on one line. I kinda think that 120 characters is too wide, it results in things like this:

      <aside className="mdc-temporary-drawer mdc-typography" ref={div => (this.drawerRoot = div)}>
// or
const shouldLoadData = R.complement(R.allPass([R.eqProps("postID"), R.eqProps("channelName")]))

I'd like to propose we change the setting to the standard 80 characters instead, which would result in the more-manageable:

      <aside
        className="mdc-temporary-drawer mdc-typography"
        ref={div => (this.drawerRoot = div)}
      >
// or
const shouldLoadData = R.complement(
  R.allPass([R.eqProps("postID"), R.eqProps("channelName")])
)

and also make it easier to look at two files side-by-side without having to scroll horizontally. thoughts? @rhysyngsun @noisecapella

Tweaks to post page display

  • PostDisplay component should have slightly different layout on PostPage vs on a channel or the frontpage
  • the top-level comment reply (reply to the post) should always be open, unlike the comment reply text boxes
  • the comment 'reply' button should be to the left of the upvote / downvote buttons
  • the comment count should live in the gutter between the post card and the first comment card
  • the post page should have the navigation sidebar on it

Add test for authentication in reddit

The authentication code in channels/api.py is mostly uncovered because we mock this out for most tests. We should add a unit test or two for it, specifically _get_user_credentials and _get_requester_kwargs

CSS Styling

Based on the designs in Invision:

  • Basic fonts, colors, and styling for Channel pages, post summaries, and post content. (Addressed in #95
  • Styling for the sidebar with the channels and the "Submit Post" button.
  • Styles for the Create Post page and the Create Channel page.
  • HTML and CSS for a navbar, assuming we are going to have one.
  • Styling for the comments UI.
  • #115 Responsive CSS for mobile for all of the above.

subscribe users to default channels

As a new user, when I create an account, I want to be able to see the basic discussion content. I will need to be automatically subscribed to the basic set of channels.

This is a configuration option in reddit. For now, we'll just configure this as a deployment task.

subscribe API

A privileged application like MicroMasters needs to be able to subscribe (and eventually unsubscribe) users from a channel.

The scope of this issue is limited to a simple subscription API. It should be implemented similar to the APIs for adding contributors (#140) and moderators (#148).

comments API

create API for comments

  • Create
  • List
  • Edit
  • Delete ?

front-end data model

George and I had a brief conversation today about this. I think we should store all the data we need to worry about (Channels, Posts, etc) in a normalized form, something like:

type store = {
  posts: Map<postID, Post>,
  channels: Map<channelID, channel>
};

where Post and Channel are types holding all the information unique to each. We don't have to use a Map (although I like them), we could just as easily use an Object, but the idea is that all Posts would live in one spot, and handling the result of a GET request about a post or a GET request for the posts on a channel would be handled the same way - just insert the new posts into the record, and update the store.

To associate Post records with a Channel we could just store an array of Post ids on the Channel object which relevant to it - same for comments on a Post, etc.

I think designing the store like this will keep our lives simpler, and allow us to write code (e.g. for displaying posts, displaying comments, etc) that can be more agnostic about where the data came from, i.e. did we fetch these comments from a subreddit or from expanding a comment tree?

There's some documentation in the redux documentation arguining for this sort of design pattern here.

Add REST API for front page

We should add an endpoint /api/v0/frontpage/ which has the same content as a subreddit listing but which uses the frontpage listing algorithm (I think this is 'hot' by default) to create a listing of posts for all subreddits the user is subscribed to.

user API

A privileged application like MicroMasters needs a basic user API to create open-discussions users (among other things), so that they can be automatically subscribed to channels.

Should allow storing of name and profile image

Questions:

  • What do we use as the username on open-discussions, a UUID or the MM username?

Discovery for server to server APIs

We should figure out what REST APIs are needed to enable communication with MicroMasters or other servers. We need to support at least:

  • creating a new subreddit
  • creating new users
  • updating profile information for a user (limited to what we need to support for profile)

Add "Submit a New Post" button to Discussion homepage

  • the create post page should have tabs for the two options (text post vs link post)
  • there should be a dropdown on the create post page for choosing which subreddit to post to
  • if you click 'create post' from a subreddit the subreddit which you're on should be selected by default
  • following that change, we should show the 'create post' button in the sidebar everywhere

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.