thoughtbot / constable Goto Github PK
View Code? Open in Web Editor NEWBetter company announcements
Home Page: https://constable.io
License: GNU Affero General Public License v3.0
Better company announcements
Home Page: https://constable.io
License: GNU Affero General Public License v3.0
Similar to how it's done in Rails: http://railscasts.com/episodes/274-remember-me-reset-password
You would likely use Plug's put_resp_cookie
with a max_age set 1 year into the future:
@one_year_from_now 365 * 24 * 60 * 60 * 1000`
# When you create a new session
signed_user_id = Phoenix.Token.sign(conn, "user_id", user.id) # Signs the user_id
conn
|> Plug.Conn.put_resp_cookie("user_id", signed_user_id, max_age: @one_year_from_now)
# When fetching the user
case Phoenix.Token.verify(conn, "user_id", conn.cookies["user_id"]) do
{:ok, user_id} -> # fetch the user
{:error, _} -> conn # returns he conn unchanged
end
Ping me in #constable on Slack if you need any help with this. The docs for Phoenix.Token and Plug.Conn have more info. Also this article on cookies with Plug will be useful: https://www.amberbit.com/elixir-cocktails/phoenix/reading-and-writing-cookies-in-phoenix-with-plug/
You can add and update an interest's slack channel, but you can't remove it entirely.
Just remembered that we need to add a note about brew install phantomjs
in order to run the test suite.
The new email template is looking great so far, and works much better on the phone!
It's still a bit too wide to fit on my screen, though, and requires some scrolling around. I'd love if everything fit on the screen! I also realize I might be the only person with a screen this size, and recognize it may not be able to accommodate all of us.
We used mousetrap previously. I believe we can still use that :)
Similar to https://constable.io/settings
Sets the auto_subscribe
and daily_digest
flags on the User
https://github.com/thoughtbot/constable-api/blob/master/web/models/user.ex#L18
This one hits home for me. I really dislike when I have to log into a service to unsubscribe from something. Could it use my email and a get param of the thread id to unsubscribe me?
This is two fold, but could probably done in the same PR pretty easily
-[ ] use jquery-textcomplete https://github.com/thoughtbot/constable/blob/master/package.json#L40 to complete usernames
-[ ] bold usernames in comment body and announcement body
Right now it shows people's avatar more than once. I think we should only show unique avatars. What do you think @BlakeWilliams?
I think this will help with https://github.com/thoughtbot/handbook/pull/248
Let's answer the question of what Constable is by sending a welcome email along these lines
Welcome to Constable!
We use Constable at thoughtbot to post announcements and have discussions. Constable is a tool we've built internally using Phoenix and React. It gives us a place to try out new things in Elixir, Phoenix and React, so feel free to contribute or just take a look around the code.
You can @mention people in an announcement or comment to send to specific people
Subscribe to specific things you are interested in on the interests page
That's just a rough idea, but I think this could help with the user's initial experience
https://thoughtbot.slack.com/archives/boston/p1450194512002581
One of the great things about constable is that I have no idea who is subscribed to what channels
We could show who the message will be sent to, or at the very least show who it was sent to on the announcement page?
The basecamp email digest shows posts that received new comments (how many and who commented). This lets me see if a topic is getting some discussion and lets me keep on it without be subscribed.
Fairly self-explanatory. I'd like to be able to edit a comment after posting it to fix formatting, wording, etc.
There is a lot of code shared between the email templates. This makes working on them a bit of a pain. They should be extracted. Maybe a nice mailer preview controller could be added as well
Submit comment form with AJAX, append comment to comment list in real time
We will need to update welcome wagon and srs business to point to the new URL and/or make sure API.constable.io points to the right place so that integrations still work
When you click the "search" icon
See react version here: https://constable.io/search
Search function in Constable.User
: https://github.com/thoughtbot/constable-api/blob/master/web/models/announcement.ex#L32
Go to: https://constable.io/interests/57
Notice there's no simple way to subscribe to this interest from this page. We should make that possible.
This should be just like the existing React front-end, and should still use React for writing and previewing the content.
I tried removing turbolinks and it appears to still fail. Maybe it's an issue with phoenix_html? I've read that a few people have issues with it sometimes
Right now there are some problems with the interest picker
We also talked about adding a welcome page that I imagine would look similar to the redesigned interest page, but has an explanation at the top
Welcome to Constable, follow some topics...etc.
So we need a way to solve those 3 problems above. There are a bunch of ways we could go with this, but here's one I kind of like
Instead of jumping straight to all announcements or my announcements, we could go to a dashboard type page that shows maybe the newest 2-3 announcements, and then a list of "All announcements, my interests, and then all the other interests. Each interest would also have a check mark to subscribe
Pros
Cons
I kind of like this idea personally. Thoughts?
cc @kaishin
We fetch the current user, but do not require login. We should add a plug for requiring login on authenticated pages. https://github.com/thoughtbot/constable-api/blob/master/web/router.ex#L13
Right now if someone isn't logged in the page 500s. Instead it should redirect to the sign in with a flash message
This is what is generated:
https://constable.io/unsubscribe/%7B%7Bsubscription_id%7D%7D
The Mandrill add-on will be removed in a couple months from now (end of April). We should switch to a real account soon
h2 and h3 not displaying properly as shown here: https://constable.io/announcements/277 (everything after "moving forward")
bullet points not showing in preview window; but render correctly in the finalized post
And be sure to run it in bin/setup as well
This should add the everyone interest since it is required. Maybe it should add a couple announcements and comments as well
thom [5:29 PM]
got a double email today when i was emailed in a group & mentioned in a message
Right now when you hit "unsubscribe" from the email link it takes you to the constable API, unsubscribes the user, and presents a button. The button redirects them to the React front end. This button should be changed to redirect to the phoenix front end instead. This should be done before launch, but not right away so that it continues to work with the React front end until we remove it
The announcements on the interest show page are being displayed using the announcement_list
partial. This partial should sort the announcements by last_discussed_at
.
We can remove the FRONT_END_URI and BACK_END_URI env vars and just use _url
helpers for generating urls. For example announcement_url(Constable.Endpoint, show, @announcement.id)
would generate a fully url for viewing an announcement
The new announcement page works if you go directly to it: https://staging.constable.io/announcements/new, but if you go to it, visit a different page, and then go back it is not properly set up. this also happens with the comment form
I believe the reason is that when you require
a module it only requires it once. So it loads it on the first page load, but then when the page is re-rendered it doesn't re-require it (which is what we want). So I think we need to export a function that we call to set up the event handlers, similar to what @BlakeWilliams did at first. Anything that should only happen once should not go in the exported function (stuff like connecting to a websocket for example), but things like setting up event handlers on the page should go in the exported function.
require("/new-announcement-form.js").setupEventHandlers();
This was being done before but I missed it when switching to Bamboo
We can't deploy to staging until we have SSL since we have to provide port
as 443
to the url
option in our production config. This is because of how Phoenix handles url generation.
Starting from https://thoughtbot.slack.com/archives/nyc/p1462393370001295
Specifically: https://thoughtbot.slack.com/archives/nyc/p1462393470001299
I think we should change the wording to "subscribe to comments" or "subscribe to thread" or something along those lines. We may also want to reposition it, but I think changing the wording is a good start
Add individual interest page where you can view all posts for a given interest, and add webhooks.
I’m setting the project up for the first time and when I ran bin/setup
, I got this error:
bin/setup: line 10: mix: command not found
I assume this is because I don’t have Phoenix installed? If that’s the case, maybe we should make the README more clear?
After deploying and migrating production we need to run that task so that the announcements have the correct last_discussed_at set
Sometimes user's don't have their name set up in Gmail so it was blank in the database. This makes it so that the changeset uses the username if the name if not there.
We need to use something like highlight.js
to syntax highlight code posted in comments and posts to have parity with the front-end.
That way the front end can show an intro page if the user is new
last_discussed_at
is the inserted_at
time by default, and is updated whenever a comment is added to the announcement
Interests should be unique. Can we use slugs rather than ids in the URLs?
Helps people realize that they can change their email preferences
Inspired by https://github.com/thoughtbot/handbook/issues/402, I'd like to update https://github.com/thoughtbot/srs-bsns so that it posts on Constable instead of Basecamp, but I'm having trouble figuring out the API.
The README says the best place to look is the app/stores
directory in the https://github.com/thoughtbot/constable/ repo, but that directory doesn't exist.
I don't have enough experience with either Elixr or React to quickly piece together what's going on without a bit more documentation.
To make the app feel as snappy and interactive as it was, we should use AJAX to subscribe/unsubscribe users from announcements.
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.