646 Commits

Author SHA1 Message Date
Robert Schäfer
180491c08c Put isAuthor in permissions middleware
I find it dirty to access the database in a middleware, ie. I would like
to put all access on the database as close to the resolver as possible.
However, in this case that would mean to put the authorization check in
the resolver, where nobody expects it to be.

CC @appinteractive
2019-03-04 19:43:24 +01:00
Robert Schäfer
b64ea75011 Add a deleted post and a disabled post to seeds 2019-03-04 18:41:05 +01:00
Robert Schäfer
c869724d29 Let all tests pass 💚 2019-03-04 18:41:05 +01:00
Robert Schäfer
b2520258a3 Improve specification of posts resolver
* only authors are alllowed to update/delete their own posts
* set disabled+deleted to false if not provided
2019-03-04 18:41:05 +01:00
Grzegorz Leoniec
4d0af7688d
Merge pull request #192 from Human-Connection/27_disable_posts
Show disabled or deleted posts for moderators
2019-03-04 15:55:38 +01:00
Robert Schäfer
82bbdd12c4
Merge branch 'master' into 27_disable_posts 2019-03-04 15:35:46 +01:00
Robert Schäfer
f496b3f329
Merge pull request #202 from Human-Connection/dependabot/npm_and_yarn/eslint-5.15.0
Bump eslint from 5.14.1 to 5.15.0
2019-03-04 15:35:24 +01:00
dependabot[bot]
b23380d593
Bump eslint from 5.14.1 to 5.15.0
Bumps [eslint](https://github.com/eslint/eslint) from 5.14.1 to 5.15.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v5.14.1...v5.15.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 04:21:10 +00:00
dependabot[bot]
802736e562
Merge pull request #183 from Human-Connection/dependabot/npm_and_yarn/@babel/core-7.3.4 2019-03-03 14:40:23 +00:00
Robert Schäfer
4a64755df7
Merge branch 'master' into 27_disable_posts 2019-03-03 15:27:27 +01:00
Robert Schäfer
cb78a30195 Merge remote-tracking branch 'origin/master' into dependabot/npm_and_yarn/@babel/core-7.3.4 2019-03-03 15:27:02 +01:00
Robert Schäfer
db30f4d2d4
Merge pull request #195 from Human-Connection/194-create-unit-test-for-badges
[WIP] Write API test badge creation
2019-03-03 15:22:21 +01:00
Robert Schäfer
c4b9d9011b
Merge branch 'master' into 194-create-unit-test-for-badges 2019-03-03 14:34:53 +01:00
Robert Schäfer
8d1eb6026a Let all tests pass 💚 2019-03-03 14:35:08 +01:00
Robert Schäfer
fb2b407be0 Extend @Tirokk 's test to Create and Update 2019-03-03 14:32:29 +01:00
Robert Schäfer
f25708875a Refactor badges test
CC @Tirokk @grenzfrequence

* the top level block should correspond with the name of the resolver
  * the block below should be `CreatePost` or `UpdatePost`
* the arguments of client.request are `query/mutation`, `variables` but
  you passed in the `headers` which should go into `new
  GraphQlClient(host, options)`
* re-use the very same mutation to avoid bugs in the tests
* use `await expect(someAsyncMethod).resolves.toEqual(expected)` style for
  extra test assurance
2019-03-03 14:01:50 +01:00
Robert Schäfer
44a4e3e32f
Merge branch 'master' into 27_disable_posts 2019-03-03 13:34:22 +01:00
Wolfgang Huß
6937c60ef8 Only admins are allowed to create badges 2019-03-01 15:49:11 +01:00
Wolfgang Huß
d8502ef3a9 Merge branch '194-create-unit-test-for-badges' of https://github.com/Human-Connection/Nitro-Backend into 194-create-unit-test-for-badges 2019-03-01 13:55:20 +01:00
Wolfgang Huß
6271c6e8a3 Add to .gitignore .DS_Store (#196) 2019-03-01 13:38:14 +01:00
Wolfgang Huß
ec64811379 Add to .gitignore .DS_Store 2019-03-01 13:17:07 +01:00
Wolfgang Huß
20b5cd521b Merge branch 'master' of https://github.com/Human-Connection/Nitro-Backend 2019-03-01 11:57:24 +01:00
Matt Rider
5e592f666b Write unit test badge creation
- for unauthenticated
- for authenticated admin

Co-authored-by: Wolfgang Huss <wolle.huss@pjannto.com>
2019-02-28 16:16:14 -03:00
Robert Schäfer
8febf147ce Fix lint 2019-02-28 18:37:52 +01:00
Robert Schäfer
f3ab671f21 Soft delete middleware test passes 2019-02-28 18:37:52 +01:00
Robert Schäfer
911500a3bd Don't override given { deleted, disabled } = args
@appinteractive I guess this was done unintentionally?
2019-02-28 18:37:52 +01:00
Robert Schäfer
738ba4f51c DRY softDeleteMiddleware 2019-02-28 18:37:52 +01:00
Robert Schäfer
ce28de893b Write a test for #27
Moderators are allowed to see disabled or deleted posts if they
ask for it.
2019-02-28 18:37:52 +01:00
Grzegorz Leoniec
086345cd35
Merge pull request #187 from Human-Connection/194_stop_decoding_jwt_on_frontend
Implement currentUser query
2019-02-28 14:33:12 +01:00
Grzegorz Leoniec
9427f3937f
Merge branch 'master' into 194_stop_decoding_jwt_on_frontend 2019-02-28 12:23:55 +01:00
dependabot[bot]
6933657530
Merge pull request #184 from Human-Connection/dependabot/npm_and_yarn/@babel/preset-env-7.3.4 2019-02-28 09:40:06 +00:00
dependabot[bot]
57c24f62d1
Bump @babel/preset-env from 7.3.1 to 7.3.4
Bumps [@babel/preset-env](https://github.com/babel/babel) from 7.3.1 to 7.3.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.1...v7.3.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-28 09:25:48 +00:00
dependabot[bot]
4152a2e393
Merge pull request #186 from Human-Connection/dependabot/npm_and_yarn/apollo-server-testing-2.4.8 2019-02-28 09:21:42 +00:00
dependabot[bot]
4b2ca9368b
Bump apollo-server-testing from 2.4.2 to 2.4.8
Bumps [apollo-server-testing](https://github.com/apollographql/apollo-server) from 2.4.2 to 2.4.8.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/compare/apollo-server-testing@2.4.2...apollo-server-testing@2.4.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-28 08:58:00 +00:00
dependabot[bot]
e95d6d4ce3
Merge pull request #193 from Human-Connection/dependabot/npm_and_yarn/apollo-cache-inmemory-1.5.1 2019-02-28 08:52:22 +00:00
Grzegorz Leoniec
88e5f36f6c
Merge branch 'master' into 194_stop_decoding_jwt_on_frontend 2019-02-28 09:49:15 +01:00
Wolfgang Huß
d4a85cfbc1 Merge branch 'master' of https://github.com/Human-Connection/Nitro-Backend 2019-02-28 09:35:57 +01:00
dependabot[bot]
e74962a2be
Bump apollo-cache-inmemory from 1.5.0 to 1.5.1
Bumps [apollo-cache-inmemory](https://github.com/apollographql/apollo-client) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/apollographql/apollo-client/releases)
- [Changelog](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-client/compare/apollo-cache-inmemory@1.5.0...apollo-cache-inmemory@1.5.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-28 04:29:33 +00:00
dependabot[bot]
a3a8c9d7cb
Merge pull request #185 from Human-Connection/dependabot/npm_and_yarn/apollo-server-2.4.8 2019-02-27 23:10:59 +00:00
mattwr18
659a5d5ef8
Merge branch 'master' into 194_stop_decoding_jwt_on_frontend 2019-02-27 18:07:23 -03:00
dependabot[bot]
85a702c8de
Bump apollo-server from 2.4.2 to 2.4.8
Bumps [apollo-server](https://github.com/apollographql/apollo-server) from 2.4.2 to 2.4.8.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/compare/apollo-server@2.4.2...apollo-server@2.4.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 20:54:07 +00:00
dependabot[bot]
550eaff67c
Merge pull request #191 from Human-Connection/dependabot/npm_and_yarn/apollo-client-2.5.1 2019-02-27 20:50:13 +00:00
Robert Schäfer
da3cf86e25
Merge branch 'master' into 194_stop_decoding_jwt_on_frontend 2019-02-27 20:43:53 +01:00
dependabot[bot]
100aad61e1
Bump apollo-client from 2.4.13 to 2.5.1
Bumps [apollo-client](https://github.com/apollographql/apollo-client) from 2.4.13 to 2.5.1.
- [Release notes](https://github.com/apollographql/apollo-client/releases)
- [Changelog](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-client/compare/apollo-client@2.4.13...apollo-client@2.5.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 19:33:45 +00:00
dependabot[bot]
bdc796ac59
Merge pull request #190 from Human-Connection/dependabot/npm_and_yarn/apollo-cache-inmemory-1.5.0 2019-02-27 19:31:30 +00:00
Matt Rider
f9b60fa0b0 Fix lint 2019-02-27 08:10:20 -03:00
Robert Schäfer
5fd44230dd Get rid of LoggedInUser graphql type
This was causing a lot of headache on the frontend. Now, there a single
source of truth. If you query `currentUser` you can overwrite your local
copy of the user and update the UI.
2019-02-27 11:08:13 +01:00
dependabot[bot]
7a063d1707
Bump apollo-cache-inmemory from 1.4.3 to 1.5.0
Bumps [apollo-cache-inmemory](https://github.com/apollographql/apollo-client) from 1.4.3 to 1.5.0.
- [Release notes](https://github.com/apollographql/apollo-client/releases)
- [Changelog](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-client/compare/apollo-cache-inmemory@1.4.3...apollo-cache-inmemory@1.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 04:34:03 +00:00
mattwr18
ec185f13d4
Merge branch 'master' into 194_stop_decoding_jwt_on_frontend 2019-02-26 16:14:00 -03:00
Wolfgang Huß
78b25ba05e Merge branch 'master' of https://github.com/Human-Connection/Nitro-Backend 2019-02-26 16:47:57 +01:00