Giter Site home page Giter Site logo

hobz's People

Watchers

 avatar  avatar

hobz's Issues

Answer a question in Slack

Depends on #21

A user should be able to answer a quesion through Slack. It would look like:

"Hobz answer 123 The parameter for messge text in Slack webhooks is "text"' where "123" is the question ID.

Messages to Slack

In order to answer a question, we'll need to know the question ID, so we'll have to post a message right after a user asks a question. E.g.
"David asked 'What's the Slack webhook parameter for message text?' - #123"
"first-name' asked 'question-text' - question-id`"

Sending Answer from Slack

An answer would be typed into Slack like:
"Hobz answer 123 It's just 'text'"
"trigger-word answer message-id answer-text"

Future

Eventually we'll want to get really cute, like just having "Hobz answer ..." and having it answer the last question from that channel (presumably that means we'll have to store the channel ID the question was asked in), or "Hobz answer user-name ..." to answer the last question from that user.

Login - frontend

  1. If auth-token doesn't exist or is invalid when first hitting the app, the home route should show a landing page.
  2. The nav should have "Login" and "Sign Up" buttons for logged out users.
  3. The nav should have a "Logout" button for logged in users.
  4. The login form should have email and password fields. When submitted, hit the login endpoint. If we get back a 200, store the auth token in a cookie, and redirect to index. If we get a 403 back, message "Incorrect email or password".

Depends on #1 and #3

Question comments - backend

CRUD endpoint for question comments. /question-route/:id/comment

A question comment has:

  1. Text
  2. Author
  3. Creation date
  4. Lasted edited date
  5. Question ID

Endpoint should:

  1. Allow editing text by author
  2. Allow deleting by author

Answer comments - backend

CRUD endpoint for answer comments.

Answer comments have:

  1. Text
  2. Author
  3. Answer ID
  4. Creation date
  5. Last edited date

Endpoint should:

  1. Allow editing text by author
  2. Allow deleting by author

Ask a question in slack

Ask a Question in Slack

Story

A user should be able to ask a question in Slack and have it persisted to our server.
To trigger a question the user types:
trigger-word my-question

E.g. "Hobz What's the parameter for message text in the Slack webhook?"

Organizations won't be able to do a one-click integration like with Jira, but we'll have a simple tutorial on how to add Hobz to their org's Slack setup.

Investigation

Slack's webhooks only work for public channels. If their outgoing webhook API is the best way to do this, that's an OK caveat for now.

@dhuang Can you investigate which solution we'll want to use? There's webhooks, slash commands, RTM API, and Web API (maybe others too). Putting future use-cases below so we don't paint ourselves into a corner.

Future use cases for Slack Integration

We'll want to support multiple commands in the future, like "Hobz answer question_id The param for the message text is just 'text'". Covered in #22.

If the question is close to another previously asked question, we should post that answer in the chat. Would be great if we can do some rich formatting (incomming webhooks supports an 'attachment' parameter that would let us do that).

Answers - backend

CRUD endpoint for answers.

Answers have: author, question, text, expanded text, status.

GETing a list should return latest first.

Endpoint should:

  1. Accept a query string with a list of question IDs, or a list of author IDs.
  2. Allow editing text and expanded text by author.
  3. Allow deleting an answer by author.
  4. Only allow setting status by question author.

Depends on #7

Signup - backend

Endpoint to create a new user. Should return the auth token.

Accepts: email, name, username, password.

Questions - backend

CRUD endpoint for questions.

Questions

A question has: Question text, question extra text, question answer user ID, question creation date, question last updated date, question status (string), accepted answer. Deleted questions should be put into a "deleted" state (or something, just not actually deleted).

A question has many: answers #8.

Endpoint should:

  1. Return the latest question first
  2. Support an author ID querystring
  3. Allow editing question text and extra text by author
  4. Allow deleting by author

Topic Tags

A topic tag has: tag name, author, creation date.

Question comments

Comments have: text, author, creation date, lasted edited date.

Answer comments - frontend

Answers should show a count of comments, and a "add comment" button. When the question has been expanded, show all comments for the answers.

Form should have a textarea and a submit button. When submitted, refetch comments, and clear and collapse form.

Depends on: #14

Question comments - frontend

Each question in the list of questions should:

  1. Show a count of comments
  2. Have an "add comment" button

When the "expand" button is clicked - #10 - the list of comments should be shown

When the "add comment" button is clicked, a form should appear. Form has a textarea and a submit button. When form is submitted refetch comments, and clear and collapse form.

Depends on #13

Answers - frontend

Questions should show their top answer. They should have a "show all" button to show all answers, and an "answer this question" button to show an answer form. The first question in the list should have the answer form expanded.

Answers

Answers have:

  1. Text
  2. CSS class if status is "accepted"
  3. Author
  4. Date

Form

The form has two fields, for short and long answer. Short answer field is required. When submitted, save the answer to the endpoint, refetch answers for that question, and clear and collapse the form.

  1. Short answer: input limited to 128 characters.
  2. Long answer: textarea, unlimited.
  3. Submit button.

Depends on #9

Show questions in realtime - frontend

Realtime question display

When viewing the question list, the user should see new questions as they are being typed.

Question form

As a user types in the form, a message should be send to the server with the question text, author ID, and timestamp (with miliseconds) of when the user started typing. Timestamp is so if multiple questions are being typed at the same time, they don't jump around in the question list.

If the form is empty, and the input is blurred, send a message that the question has been abandoned.

Question list

Listen to messages from the server to see if a new question is being asked.

  1. When getting a message with a question ID and text, add it at the top of the question list, with an indicator that it hasn't been saved yet. Don't show mesages for questions authored by the logged in user.
  2. If message for multiple questions come down, add each to the list, sorted by question creation timestamp.
  3. If message stating that a question has been abandoned, remove it from the question list.

Login - backend

External endpoint to create an auth token or extend an auth token, and internal endpoint(?) to check if authenticated. Endpoint takes an email and password.

Work includes making an auth table.

Create org page

Should have a tutorial flow, with inputs for token and outgoing URL.

Show questions in realtime - backend

Realtime question messages

The backend should accept message from the front-end for questions as they're being typed.

Assign a temporary, unique question ID

Un-submitted questions that are being typed (and sending messages) should get an ID but not saved to the DB. Multiple questions can be sending messages up at the same time, so the front-end needs a way to differentiate between them.

Don't send messages to users generated from their own question.

Abandoned question

The front-end can send a message the the user abandoned the question. Back-end should send a message to everyone else with the question ID, saying that it has been abanonded so the front-end can stop showing it.

Post suggested answer in Slack

Suggested Answer in Slack

When we get a question from Slack, we should check if there are similar, answered questions. If so, we should post that answer in Slack.

We should only return a suggested answer if it meets some matching threshold (don't just return the first match, it has to be a good match). The threshold should be some number we can easily change - an organization might even want to set their own thresholds in the future.

E.g.
"Suggested answer: 'The param is 'text' for outgoing' by David Cameron on May 4th, 2015"
"Suggested answer: 'answer-text' by user-nameon answer-date"

Signup - frontend

New route, /signup. Has a form with the following fields:

  1. Name
  2. Username
  3. Email
  4. Password

Depends on #2

User page

Page that shows questions and answers submitted by a user. Route should be /user/user-name.

Two columns, a question list and an answers list. Both lists should show the latest authored by that user. List of questions should behave the same way as the main question list.

Depends on #10 and #9

Ask a question in Hipchat

This work encompases making a Hipchat add-on, and having it listen for a message pattern, like in #21.

Hipchat lets you make an add-on, and put it in their marketplace. Slack only has official integrations. Hipchat's marketplace should make it easier for users to integrate Hobz.

Answer comments - frontend

Answers should show a count of comments, and a "add comment" button. When the question has been expanded, show all comments for the answers.

Form should have a textarea and a submit button. When submitted, refetch comments, and clear and collapse form.

Accept Answer - frontend

Answers not in the state "accepted" should have an "accept answer" button, shown if the user is the author of the answer's question. Button should update the answer's status to "accepted" and re-fetch answer list.

Answers should show if their status is accepted.

Questions - frontend

The index route should have a form to create a question, and show the latest 20 questions in a list.

Form

Form should have a text field (limited at 128 characters) and a submit button. When button is hit or enter key is pressed, save question to API and clear form. The list should be re-fetched.

List

Shows the last 20 questions asked.

  1. Text
  2. Date
  3. Name of question asker

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.