GithubHelp home page GithubHelp logo

deadsuperhero / askwise Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.69 MB

An internal question-and-answer system for teams

License: GNU Affero General Public License v3.0

Ruby 5.82% JavaScript 28.17% CoffeeScript 0.04% CSS 64.09% HTML 1.87%
agplv3 knowledgebase questions-and-answers rails5 team

askwise's People

Contributors

deadsuperhero avatar

Stargazers

 avatar

Watchers

 avatar  avatar

askwise's Issues

Amazon S3 support for Heroku deploy

Currently serving up static assets from the application itself, which Heroku sucks at. Need to implement conditional S3 support for cloud storage of assets.

Markdown Support

Find a good gem for Markdown formatting. Should be supported in Questions as well as Answers.

One thing worth thinking about may also be a Preview tab, to show people what their composed output looks like.

Departments

Users belong to Departments. It should be possible for users to choose which department they are a part of from a list. Only one option should be possible at any given time.

This label will sit on all user questions and comments, and we can derive stats based on what kinds of questions / how many questions are being asked by a given department.

Private vs. Public

Since AskWise is intended for internal teams, it's safe to assume that the questions list could contain sensitive information. We obviously don't want that information to be publicly viewable; therefore a configuration setting for Private or Public Access should be made available.

Of course, such a setting would need to be admin-only, which means that an Admin role would then need to exist.

Microformats / Twitter Cards / OpenGraph

This actually shouldn't be too hard to set up. Metadata is sometimes useful for SEO and link-sharing purposes.

Conditional logic might take some extra tweaking. As a feature, this generally makes more sense for instances that are public-facing - if a site is private, it may make sense not to push out that metadata onto the web.

Most frequently-asked / Most actively-answered

Most Frequently Asked

It may be useful to signify which kinds of tags have the most questions in them. This could be shown in tag / search with the highest tallies represented as the highest-order links on a short limited list.

Most Actively Answered

On the question index, it may be really interesting to show a sidebar containing the most active conversations that get referenced or responded to.

Tags

It should be possible for users to tag questions when they ask them - in fact, it might be a good idea to require at least 1 tag per question to help other people find it.

This should be doable using the acts_as_taggable_on gem. Once the tagging system is set up, it should be possible to relate questions together (and show "Related Questions" in a sidebar)

CSV Mass-Import

It'd be great to have a dedicated fixture for importing a CSV file.

The reason for this is that I've been manually collecting about 100 different questions by hand from people over the last few weeks. I could try to manually input all of these questions into the app directly - but it would be much better to just import the spreadsheet I've been working on, and have Rails automatically assign the correct columns to the correct objects.

This will obviously be an admin-only feature, and will require figuring out a good schema to work with for each column/object. Certain things like author attribution for questions and answers would be particularly useful here!

Start writing tests

AskWise doesn't have any real tests yet. We need to write some!

It's a good idea to do some research on what fixtures / functions / outcomes to focus on, along with a choice of testing framework.

Heroku - ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "users" does not exist

https://sentry.io/deadsuperhero/askwise/issues/332113277/

PG::UndefinedTable: ERROR:  relation "users" does not exist
LINE 8:                WHERE a.attrelid = '"users"'::regclass
                                          ^

  active_record/connection_adapters/postgresql/database_statements.rb:88:in `async_exec'
    result_as_array @connection.async_exec(sql)
  active_record/connection_adapters/postgresql/database_statements.rb:88:in `block in query'
    result_as_array @connection.async_exec(sql)
  active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
    connection_id:     object_id) { yield }
  active_support/notifications/instrumenter.rb:21:in `instrument'
    yield payload
  active_record/connection_adapters/abstract_adapter.rb:583:in `log'
    @instrumenter.instrument(
...
(83 additional frame(s) were not displayed)

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "users" does not exist
LINE 8:                WHERE a.attrelid = '"users"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
             (SELECT c.collname FROM pg_collation c, pg_type t
               WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation),
                     col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"users"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "users" does not exist
LINE 8:                WHERE a.attrelid = '"users"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
             (SELECT c.collname FROM pg_collation c, pg_type t
               WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation),
                     col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"users"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

Search

While tagging will provide a useful fixture for finding information, a full-text search of questions should also be made available. This will allow people to find topics if they have trouble determining the correct tag term for a given inquiry.

Create Admins, Projects, and Dashboards

It is now obvious what is missing in the structure and operational flow. Up until this point, Askwise has been intended for single-project deployments, when in fact a multi-deployment system makes way more sense.

Moving forward, everything should belong_to a project. This will require some careful investigation of the what resources should be nested, and how routing should work for separate projects within a hosted instance.

From a design standpoint, it would be interesting to consider letting every team member (admin or not) have largely the same experience of the dashboard. This could include:

  • Viewing analytics for departments or the entire project
  • Keeping track of question trends for specific subjects over time
  • Searching for existing questions, viewing related questions.
  • Notifications on responses
  • A list of unanswered questions
  • Badges and points to reflect which users are the most responsive and provide the highest amount of "best" answers

It's easy enough to adapt an Admin model to Devise to be in charge of the following:

  • Configure the project name, possibly branding.
  • Determine whether it is closed or open to the public
  • Create Teams
  • Allow free registrations or approve requests to join.

Incidentally, admin registration and project creation are the first two things that should be happening here, for onboarding purposes. With a basic onboarding flow, admins can set the initial configuration, add a list of team members to invite, and do all of the things above.

Slack Bot integration

This is a little bit far-off as of yet, but it's worth investigating.

This resource provides a Ruby Slack bot server, which presumably will integrate with any Rails application. It's worth defining a use case where this integration might be useful for teams.

  1. Company sets up a Slack channel
  2. Bot gets invited to channel
  3. People ask questions on this dedicated Slack channel
  4. If the question has been asked before, bot attempts to provide a link to an answer
  5. If the question has not been asked before, bot will attempt to save an answer from someone who addresses the bot directly.
  6. The person who asked the question, and the person who provided the answer, are both properly reflected in AskWise.

There are some corner cases where this flow could be pretty messy.

Answers do not currently save to questions (branch: answers)

On the bright side, the Answer object now exists, and is properly nested as an object of a Question. The associations appear to be correct now, and the Answer form now shows up on a Question. Great!

askwise

Not quite sure what I'm doing wrong yet, but here's the error output that comes up in the console:

Started POST "/questions/1/answers" for 127.0.0.1 at 2017-07-30 14:14:51 -0700
Processing by AnswersController#create as JS
  Parameters: {"utf8"=>"โœ“", "answer"=>{"body"=>"One more attempt, for logging purposes."}, "commit"=>"Answer", "question_id"=>"1"}
Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.0ms)
  
NoMethodError (undefined method `answers' for nil:NilClass):
  
app/controllers/answers_controller.rb:28:in `create'
  Rendering /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
  Rendering /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/_source.text.erb
  Rendered /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/_source.text.erb (0.6ms)
  Rendering /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
  Rendered /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (0.9ms)
  Rendering /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
  Rendered /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (1.1ms)
  Rendered /Users/seantilley/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb (80.4ms)

Upon checking the Answers Controller, I cannot find anything wrong with the way answers were specified under the create action.

Answers - Upvote / Downvote

It would seem like a good idea to allow upvotes / downvotes on answers, to represent which ones are the preferred go-to responses. The answer with the highest amount of upvotes in a question would get represented as the de-facto answer; any answers past a certain threshold of downvotes would be hidden instead.

Each answer should only allow people to vote once - it shouldn't be possible to submit both types of votes on a single answer.

Answers don't render properly on profiles.

This fix is part of the department branch in this repo.

The user show page now displays a tabbed list for Questions and Answers that belong to the User. Getting the list of questions works without any sort of problem. The issue is in rendering the Answers list in the way that I want.

It's possible to fetch all Answers made by a User without problems. However, I want to render the title of the Question (question.query) with a link to the question (question_path for now), and then display an excerpt of the Answer (answer.body).

screenshot-20170811130534-980x795

As you can see above, it's possible to return the title of the question and the link without incident, but I can't figure out a way to tie in answer.body in a way that makes sense. For now, I have to substitute answer.body with question.body, and that's not useful.

Make composition window suck less

Currently, there is no preview, and formatting requires a knowledge of Markdown and the desperate hope that no mistakes were made.

I'd really love to have a bootstrap solution similar to what GitHub issues offers. However, from what I can tell, it's built from scratch.

There are a few plugins available - simplemde seems to be the most promising, but it feels like overkill as an editor.

License

Low-hanging fruit. I should include a software license file to correctly identify what the policies of this project are.

Pretty URLs

There's no reason that we shouldn't support this.

  • User profile reflects user name
  • Departments reflect department name
  • Questions reflect a guid + a short snippet of the question

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.