deadsuperhero / askwise Goto Github PK
View Code? Open in Web Editor NEWAn internal question-and-answer system for teams
License: GNU Affero General Public License v3.0
An internal question-and-answer system for teams
License: GNU Affero General Public License v3.0
Currently serving up static assets from the application itself, which Heroku sucks at. Need to implement conditional S3 support for cloud storage of assets.
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.
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.
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.
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.
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.
On the question index, it may be really interesting to show a sidebar containing the most active conversations that get referenced or responded to.
Currently, this isn't reflected. Maybe a conditional statement in the view can be used to detect if a tag is present?
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)
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!
The templates are starting to look pretty ugly. Let's increase code readability!
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.
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
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.
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:
It's easy enough to adapt an Admin model to Devise to be in charge of the following:
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.
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.
There are some corner cases where this flow could be pretty messy.
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!
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.
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.
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).
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.
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.
Low-hanging fruit. I should include a software license file to correctly identify what the policies of this project are.
There's no reason that we shouldn't support this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.