Commit Graph

1648 Commits

Author SHA1 Message Date
Toby Zerner
38ebb15334 Track user "last seen" time and display whether they are online or not
according to their preferences
2015-03-28 15:43:58 +10:30
Toby Zerner
359f44552e Implement user preferences API
Preferences must be registered (optionally with a callback to transform
data, and a default value) on the User model.
2015-03-28 15:43:57 +10:30
Ciarán O'Mara
be067ae1b6 Fix comment count update.
Addresses the following error when using pqsql.

[PDOException]
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "comment" does not exist
  LINE 1: ...d) FROM posts WHERE user_id = users.id and type = "comment")
2015-03-28 05:38:56 +11:00
Toby Zerner
257a3fde1a Refresh avatar display after uploading 2015-03-27 11:49:26 +10:30
Franz Liedke
9621e72b9b Fix order of arguments. 2015-03-26 22:03:55 +01:00
Franz Liedke
a19f35e8c1 Construct filesystem correctly. 2015-03-26 22:03:47 +01:00
Franz Liedke
18ccec4190 Pass newly configured filesystem disk to upload handler. 2015-03-26 22:01:58 +01:00
Franz Liedke
cf8e02977f Change name of avatar field in users table. 2015-03-26 20:59:06 +01:00
Franz Liedke
e4ed057557 Wire up instantiation of Flysystem adapter for avatar storage. 2015-03-25 14:26:38 +01:00
Franz Liedke
100a5038bf Add route and action for uploading user avatars. 2015-03-25 14:26:17 +01:00
Franz Liedke
a1f723671d Add simple implementation (command handler) for avatar upload. 2015-03-25 14:23:31 +01:00
Franz Liedke
7f66a77ede Add avatar handling to user model. 2015-03-25 14:21:50 +01:00
Franz Liedke
901b6b0839 Provide empty run() method.
This allows me to override the handle() method in subclasses (where
I need access to the request object) without having to overwrite
run(), too.

The class is still abstract.
2015-03-25 13:00:23 +01:00
Toby Zerner
3081fe2aa4 Fix DiscussionWasStarted event not being dispatched 2015-03-24 19:50:52 +10:30
Toby Zerner
8be486a31d Don't show deleted posts in the activity feed 2015-03-24 19:41:30 +10:30
Toby Zerner
43842623aa Only include visible posts in post linkage 2015-03-24 19:29:47 +10:30
Toby Zerner
c35b472e66 Fix non-comment post content serialization 2015-03-24 17:03:59 +10:30
Toby Zerner
193bb0b085 Fix error if there is no included data with user
i.e. if the logged in user is unconfirmed (doesn’t have any groups
attached)
2015-03-24 16:55:22 +10:30
Toby Zerner
4a1550215c Implement notifications 2015-03-24 15:07:38 +10:30
Toby Zerner
1d1025dcd2 Only show comment posts in activity feed 2015-03-24 15:07:11 +10:30
Toby Zerner
e62119964b All post types get numbers
Decided this is necessary because some notifications will need to link
to posts which are not comments (e.g. a “renamed” post)
2015-03-24 15:06:57 +10:30
Toby Zerner
a62e04f956 Upgrade to JSON-API RC3 + latest version of tobscure/json-api
Note: npm source for ember-json-api changed to a fork, but I still had
to apply a custom change to get polymorphic relationships to work (see
https://github.com/kurko/ember-json-api/pull/71#issuecomment-85257281)
2015-03-24 15:04:24 +10:30
Toby Zerner
3880ce70f0 Add user activity system 2015-03-17 17:06:12 +10:30
Toby Zerner
c3fd7679d3 Fix error when hiding/restoring posts 2015-03-17 17:01:42 +10:30
Toby Zerner
4804d95b37 Implement user "bio" field
Perhaps this should be an extension, but it is pretty essential and I
can’t think of many instances where it wouldn’t be wanted. Would be
very easy to extract later on if need be.
2015-03-12 10:38:18 +10:30
Toby Zerner
6ffba13205 Implement user searching & minor search refactor 2015-03-12 10:37:02 +10:30
Toby Zerner
2882ecd46e Rename user posts count to comments count 2015-03-12 10:34:59 +10:30
Toby Zerner
df75c68ac4 Fix welcome hero link for demo 2015-02-26 15:30:07 +10:30
Toby Zerner
f67098461d Use sender information from config 2015-02-26 15:23:09 +10:30
Toby Zerner
2884662723 Prepare welcome hero for demo 2015-02-26 13:30:13 +10:30
Toby Zerner
225a618713 Fix password hashing 2015-02-26 13:29:36 +10:30
Toby Zerner
57f4dc6091 Have a go at some error handling
Still not happy with how this is all fitting together. But good enough
for now
2015-02-26 12:48:23 +10:30
Toby Zerner
c09e47c434 Temporary fix for read marking 2015-02-26 12:46:27 +10:30
Toby Zerner
b4f3148e30 Remove Middleware suffix 2015-02-26 12:45:44 +10:30
Toby Zerner
f2fe0a2e1d Fix setting user to null, for now
Still need to flesh out the exact purpose/use of the Actor class
2015-02-26 12:45:29 +10:30
Toby Zerner
074b4d0989 Add model validation back in 2015-02-26 12:44:39 +10:30
Toby Zerner
a079535883 I dun goofed 2015-02-25 15:44:09 +10:30
Toby Zerner
6a0cbbbe70 Fix logout action 2015-02-25 15:36:25 +10:30
Toby Zerner
3c53e512de Fix bug causing wrong index to be returned 2015-02-25 15:36:17 +10:30
Toby Zerner
9ea482254c Finish signup process, including state restoration 2015-02-25 15:34:02 +10:30
Toby Zerner
2c46888db5 Upgrade to L5 + huge refactor + more. closes #2
New stuff:
- Signup + email confirmation.
- Updated authentication strategy with remember cookies. closes #5
- New search system with some example gambits! This is cool - check out
the source. Fulltext drivers will be implemented as decorators
overriding the EloquentPostRepository’s findByContent method.
- Lay down the foundation for bootstrapping the Ember app.
- Update Web layer’s asset manager to properly publish CSS/JS files.
- Console commands to run installation migrations and seeds.

Refactoring:
- New structure: move models, repositories, commands, and events into
their own namespaces, rather than grouping by entity.
- All events are classes.
- Use L5 middleware and command bus implementations.
- Clearer use of repositories and the Active Record pattern.
Repositories are used only for retrieval of ActiveRecord objects, and
then save/delete operations are called directly on those ActiveRecords.
This way, we don’t over-abstract at the cost of Eloquent magic, but
testing is still easy.
- Refactor of Web layer so that it uses the Actions routing
architecture.
- “Actor” concept instead of depending on Laravel’s Auth.
- General cleanup!
2015-02-24 20:33:18 +10:30
Toby Zerner
0e4e44c358 Preliminary email confirmation implementation
Whenever a user registers or changes their email, they are sent an
email containing a link which they must click to confirm it.

Upon registering, a user won’t be assigned to any groups and therefore
won’t have permission to do anything (but they can still log in!) Upon
confirming their email for the first time, their account will be
assigned to the Member group and thus “activated”.
2015-02-16 14:52:53 +10:30
Toby Zerner
b6ef1f296e Cleanup 2015-02-16 14:50:38 +10:30
Toby Zerner
9bb7001645 Better check for user property in command validators 2015-02-16 14:48:10 +10:30
Toby Zerner
540902cd7a Seed renamed posts properly 2015-02-13 11:44:19 +10:30
Toby Zerner
5e09fd7cd8 Explicit mapping of post type to class 2015-02-13 10:30:32 +10:30
Toby Zerner
011ae3603e Implement "renamed" posts
Record when the discussion was renamed, from what, and by whom.
Information is stored in the `content` field as a serialised JSON
object because proper polymorphism will be too difficult with Ember
Data and especially when extensions try to add new post types.
2015-02-13 10:23:38 +10:30
Toby Zerner
5229c5c06a Mark a discussion as read when it is created 2015-02-12 15:18:45 +10:30
Toby Zerner
6138825db6 Only show reply button if user has permission 2015-02-12 15:17:20 +10:30
Toby Zerner
36787bcf45 Implement hard deletion and rename soft delete to hide 2015-02-12 14:35:24 +10:30
Toby Zerner
cf88fda8c8 Always add discussion state information 2015-02-10 17:53:52 +10:30
Toby Zerner
e30ae7b7b8 Don't imply order on posts relationship 2015-02-10 17:53:16 +10:30
Toby Zerner
8e5cbcd196 Add unordered list formatting 2015-02-10 17:52:13 +10:30
Toby Zerner
624d3d70bb Refresh comments count when updating metadata 2015-02-10 17:51:39 +10:30
Toby Zerner
227f19ddf6 Change API attribute for hiding/restoring posts 2015-02-10 17:51:16 +10:30
Toby Zerner
f56da376da Prevent unnecessary events from being triggered 2015-02-10 17:49:42 +10:30
Toby Zerner
8e6011e8d0 API for marking all as read 2015-02-10 17:48:58 +10:30
Toby Zerner
af94f22334 Rejig post formatting 2015-02-09 09:49:48 +10:30
Toby Zerner
d45f2fd1ac Signup + modal refactoring 2015-02-08 15:59:39 +10:30
Toby Zerner
077975fb17 Fix index sorting 2015-02-08 15:57:41 +10:30
Toby Zerner
7863f0114c Make post types/components more flexible 2015-02-08 15:56:44 +10:30
Toby Zerner
59964e3b22 Implement post editing 2015-02-08 15:55:33 +10:30
Toby Zerner
28d213d868 Implement discussion composition and creation 2015-02-06 14:07:15 +10:30
Toby Zerner
73d6b17963 Fix up API default sort order 2015-02-06 12:20:58 +10:30
Toby Zerner
809a87f03f Cleanup, remove some old code 2015-02-06 10:35:46 +10:30
Toby Zerner
0365ae6c71 Load discussion and posts with one request
Speeds things up a heap.
Also fix a whole bunch of bugs with the post stream.
2015-02-06 10:30:38 +10:30
Toby Zerner
5b0c775ab4 Mark discussion as read upon reply 2015-02-03 18:41:15 +10:30
Toby Zerner
edce73d6e9 Fix bugs with post creation API 2015-01-30 12:21:33 +10:30
Toby Zerner
c2feae406d Add ember-simple-auth, setup login
- Allow dropdown-buttons to render a partial
2015-01-30 12:21:18 +10:30
Toby Zerner
e37d3743ed Use our own token instead of Laravel's
Laravel’s remember_token is tied to the session/cookies, which we don’t
need as the API is stateless. It makes much more sense to use our own
token mechanism.
2015-01-30 12:08:02 +10:30
Toby Zerner
23a7f22f0b Change another instance of forum title 2015-01-26 12:07:24 +10:30
Toby Zerner
b57a8d3bc2 Improve auth API tests 2015-01-23 15:24:38 +10:30
Toby Zerner
d13ef6f1fc More flexible API URL (necessary for testing) 2015-01-23 12:48:21 +10:30
Toby Zerner
ad269fdb5a Implement token-based auth API 2015-01-22 14:44:33 +10:30
Toby Zerner
9cec5b8f41 Make default user a guest
The way it should be. Now maybe I’ll be forced to get a move-on with
auth :D
2015-01-21 12:16:54 +10:30
Toby Zerner
bf0ea864e4 Don't need to generate html content
as it’s generated on demand by the PostSerializer (for now)
2015-01-21 12:03:30 +10:30
Toby Zerner
7f22498e6c Change engine and make post content nullable
MyISAM doesn’t support transactions which is problematic for testing.
Will have to consider this more carefully when working on FULLTEXT
search, but for now I just wanna test!
2015-01-21 12:02:25 +10:30
Toby Zerner
3be47a3d4f Fix up default permissions 2015-01-21 12:00:52 +10:30
Toby Zerner
2fcb1dc7c8 Begin testing API (see #3) 2015-01-19 20:46:14 +10:30
Toby Zerner
49be8417a9 Fix incorrect column name 2015-01-19 20:43:09 +10:30
Toby Zerner
577d51358d Fix incorrect column name
(Sorry about the retrograde migration changes, but I figure it isn’t
problematic at this stage because we can just reseed. It’s nice to keep
things clean as long as we can!)
2015-01-19 20:42:56 +10:30
Toby Zerner
d204ca87cf 20 results, regardless of what's included 2015-01-16 17:26:17 +10:30
Toby Zerner
abc794c966 Change the way we fetch multiple posts by ID
JSON-API specifies that multiple resources should be fetched with a
comma-separated list of IDs, i.e. discussions/1,2,3,4. But this is
problematic because if we do a findQuery with only one ID, then a
single object will come back from the API where the serializer is
expecting an array containing a single object.

Instead, I’ve just implemented an ids “filter” on the discussions index
API route (which is the default way that the adapter finds multiple
IDs.)
2015-01-16 17:26:17 +10:30
Toby Zerner
5e288f55f5 Change the way post count metadata is stored
We care about the number of “comment” posts, not the number of posts in
total.
2015-01-16 17:26:17 +10:30
Toby Zerner
cfdf01ec70 More descriptive comments 2015-01-16 17:26:17 +10:30
Toby Zerner
c142965483 Clean up discussion API 2015-01-07 17:25:40 +10:30
Toby Zerner
569b9ab27e Fix last_post_number potentially being null 2015-01-07 17:25:40 +10:30
Allineer
d1344492ce "Specified key was too long" fix.
[Illuminate\Database\QueryException]
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `permissions` add primary key perm
  issions_grantee_entity_permission_primary(`grantee`, `entity`, `permission`))
2015-01-04 22:40:16 +03:00
Toby Zerner
dc74288915 Fix up bug in discussion seeder where number_index could be null. closes #27 2014-12-31 17:52:53 +10:30
Mike Dugan
cc122cfe4b rm vagrantfile, fix seed 2014-12-24 08:39:20 -05:00
Toby Zerner
4f2407bba3 Relocate to workbench so that dev dependencies are loaded properly. 2014-12-23 22:59:15 +10:30
Toby Zerner
238bb40360 Upgrade ember-cli to 0.1.4 and fix related breakage. closes #18 2014-12-23 12:45:07 +10:30
Toby Zerner
79ff8ff4d7 Fix asset publishing. 2014-12-20 21:06:38 +10:30
Toby Zerner
e8140cfd34 Fix seeders. 2014-12-20 21:06:29 +10:30
Toby Zerner
9b30d1b3f2 Forgot some imports. 2014-12-20 17:33:59 +10:30
Toby Zerner
dc73e36312 Add seeders. 2014-12-20 17:27:41 +10:30
Toby Zerner
5a98eb0f06 Use Laravel's database config. 2014-12-20 17:19:00 +10:30
Toby Zerner
74db323f83 Hello world! 2014-12-20 16:56:46 +10:30