34 Commits

Author SHA1 Message Date
mattwr18
f5545e3976 Fix middleware/spec 2019-11-29 19:45:34 +01:00
mattwr18
5d63dda6ee Refactor validateReport/Review
- Don't throw error if a report already exists since we use MERGE and
that does not create a new resource if it exists. That is tested at the
neo4j(database) level.
- We also have a test to make in reports.spec.js that no duplicate is
created to ensure we didn't make some error on our part.
- Fix some faulty logic in validateReview
2019-11-29 18:47:41 +01:00
mattwr18
c0d9fe5257 Test validationMiddleware validateReport/Review 2019-11-29 18:43:24 +01:00
mattwr18
2f249a73c5 Rename REPORTED Claim to FILED Report 2019-11-26 15:35:48 +01:00
Wolfgang Huß
99af6cbf8a Implement displaying multiple claims in the frontend 2019-11-22 18:40:51 +01:00
Wolfgang Huß
9a7774ce86 Implement review validation with validateReview 2019-11-22 15:19:49 +01:00
Wolfgang Huß
526e4c642b Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1710-list-and-protocol-moderation 2019-11-08 08:28:47 +01:00
Youri Seichter
d262ed678c close all open sessions 2019-11-06 18:32:25 +01:00
Wolfgang Huß
21e82d2ea5 Get decide mutation to work
- Tests are not fully working yet!
2019-10-30 19:07:51 +01:00
Wolfgang Huß
7b3224327e Prepare backend for next implementation step 2019-10-30 13:51:00 +01:00
mattwr18
e8c6941142 Follow @roschaefer's PR review suggestions
- disable button if form.reasonCategory is falsy
- extract valuesReasonCategoryOptions to global constant
- extract reasonCategoryOptions to created lifecycle hook to keep data()
clean and use map
- extract formSchema to components/utils and test
- remove validator from formSchema and validate based on "Deep Rules" https://github.com/yiminghe/async-validator#deep-rules
- Use v-model to update reasonCategory and reasonDescription
- default to error message in English from backend
- Update template slot to use new syntax
2019-10-15 20:28:25 +02:00
mattwr18
faf0a15aee Update to use enum in tests, seed data, etc, refactor resolver
- Extract validations to the validations middleware to clean it up
- Remove resourceId since it throws an error in the mutation if the user
asks for it back, and the resourceId is returned in post/comment/user.id
- use writeTxResultPromise to benefit from automatic retries
- more descriptive variable naming
- extract cypher query to make db manipulation into script so that it
can be run from the command line, at least locally.
2019-10-14 21:07:55 +02:00
roschaefer
1b5d91bfd2 Refactor post spec, implement soft delete, fix bug
I think the validation for categories was too complex and the graphql
query 'PostEmotionsByCurrentUser' was erroneously allowed for
unauthenticated users.
2019-09-03 21:28:29 +02:00
Matt Rider
abbfc6d757 Remove commented out, unneeded code 2019-08-23 11:30:20 +02:00
Matt Rider
773779e5f1 Fix UpdatePost resolver/validations 2019-08-23 10:57:11 +02:00
Matt Rider
555c5254bc Add tests, validations for too many categories
- Co-authored-by: Joseph Ngugi <jngugi88@gmail.com>
2019-08-19 17:31:55 +02:00
kachulio1
314dfcf413 Throw error if no categories on post creation
Co-authored-by: mattwr18 <mattwr18@gmail.com>
2019-08-15 17:55:02 +03:00
Alina Beck
0439b4407b remove social media validations from middleware 2019-07-29 17:16:05 +02:00
Matt Rider
1c53c58f42 Add backend validation tests to expose non-validation
- remove validation/index.js as it's not being used
- move validations to validationMiddleware.js where it validates
2019-07-16 14:54:13 -03:00
Matt Rider
a019c8c311 Revert unintended changes, refactor
- rename some variables in comments.spec.js while dealing with merge conflicts
- rename EditCommentForm/index.vue with new naming convention
- add comment to explain absense of <no-ssr>
- use a comments content for edit comment form content, not excerpt
2019-07-16 07:53:57 -03:00
Matt Rider
36c4a22b76 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 552-update_comment 2019-07-15 18:29:26 -03:00
Matt Rider
ba7e44a762 Refactor CreateComment resolver
- extract out the validations for a valid comment
2019-07-12 08:07:07 -03:00
Robert Schäfer
10ae4abaae Use neode to bring User mutations under control
This commit takes all backend changes for signup and invite feature. I
was working on these features and removed the generated mutations for
type user along the way.
2019-07-03 15:58:42 +02:00
ALau2088
3cc05c0916 add backend managecomments tests 2019-06-13 13:00:20 -07:00
ALau2088
22f166adac merge upstream/552-update_comment 2019-06-08 15:55:51 -07:00
ALau2088
788979eedf add update comment jest test 2019-06-05 18:12:22 -07:00
ALau2088
a5f6390f97 552-update_comment 2019-05-30 15:47:55 -07:00
ALau2088
8a8ed5131e refactor backend and add UI 2019-05-24 08:03:39 -07:00
Matt Rider
758bf215ac Merge branch 'master' of github.com:Human-Connection/Human-Connection into uploads-on-server 2019-05-23 15:26:19 -03:00
cfd0975b24
backend linting 2019-05-23 19:23:03 +02:00
Robert Schäfer
3c22a432e6 Fix lint 2019-05-21 03:08:32 +02:00
Robert Schäfer
4dbf1b2a2c UpdateUser with avatarUpload
This is a curl request from a folder where I have a file `avatar.jpg`:

```
curl localhost:4000/ \
  -F operations='{ "query": "mutation($id: ID!, $file: Upload) { UpdateUser(id: $id, avatarUpload: $file) { id name avatar } }", "variables": { "id": "u3", "file": null } }' \
  -F map='{ "0": ["variables.file"] }' \
  -F 0=@avatar.jpg
```

It uploads the avatar to the public folder. We should

* Write tests
* Change the `user.avatar` url and send it to `/api` in the frontend
2019-05-20 20:35:33 +02:00
Robert Schäfer
81a26e14ff Fix test case, move spec to the right location
@ulfgebhardt: The reason why the test case was failing is pretty
obvious. You forgot to create a user that you want to update. If there
is no user to update, then you get an empty response.

@ulfgebhardt: I moved the spec also in the right directory. You're
testing resolvers, so that's where I moved the `.spec` file.
2019-05-10 17:34:05 +02:00
Robert Schäfer
47d7c615a5 Refactoring: Put all data validations in one place
@ulfgebhardt @mattwr18 @tirokk

Here's how I imagined the data validation middleware. If we roll our own
input validations I would suggest to put them all in one place.

@ulfgebhardt this commit is a great example of how tests can speed you
up: Since I can rely on existing tests, I don't have to check the validations
manually. With tests you can refactor with confidence! 👍
2019-05-10 17:13:54 +02:00