Commit Graph

101 Commits

Author SHA1 Message Date
Julian Lam
55b0e902fb feat: consolidation of flags to reduce flagspam, #8510
Squashed commit of the following:

commit c6d0939620
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 24 13:41:32 2020 -0400

    fix: more tests

commit 32f9af2a87
Merge: e50907535 4eae927d1
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 24 10:53:04 2020 -0400

    Merge remote-tracking branch 'origin/master' into singleton-flags

commit e509075351
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 24 10:52:46 2020 -0400

    fix: controllers-admin test

commit fd5af99e30
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 17:26:55 2020 -0400

    fix(tests): dummy commit to trigger travisCI

commit c452a6ffcf
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 17:05:09 2020 -0400

    fix(openapi): openapi spec changes

commit 8089a74e89
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 15:48:00 2020 -0400

    fix: reversing the order of reports for display purposes

commit a099892b37
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 15:45:44 2020 -0400

    refactor: run all flag creation calls in a single batch

commit b24999682f
Author: Julian Lam <julian@nodebb.org>
Date:   Fri Jul 17 15:08:23 2020 -0400

    feat: handling multiple reporters per flag, #8510

commit 08c75c0200
Author: Julian Lam <julian@nodebb.org>
Date:   Thu Jul 16 20:53:18 2020 -0400

    feat: upgrade script for #8510
2020-07-24 14:10:37 -04:00
Julian Lam
e3e55f25d0 refactor: flag sanity checks, +feat: flag limits
- Added new config flag:limitPerTarget, to disallow flags after an item has
  already been flagged x times (default 0, or infinite)
- New zset flags:byTarget, score is the number of times a flag has been made
  against that item
- "already-flagged" translation key removed, now "post-already-flagged" or
  "user-already-flagged" -- this fixed bug where flagging a user you've already
  flagged would tell you you've already flagged this post already.
- Refactored Flags.canFlag to throw errors only, instead of returning boolean
- Updated ACP form inputs for reputation settings page to be more bootstrappy
- +1 upgrade script
2020-07-15 17:10:49 -04:00
Julian Lam
1441720962 feat: logic for flag note editing, #8499 2020-07-14 13:38:28 -04:00
Julian Lam
f85a45c722 feat: logic for flag note deletion, #8499 2020-07-14 13:38:28 -04:00
Barış Soner Uşaklı
e80379dc0e feat: display stack trace on winston.error 2020-06-20 23:32:12 -04:00
Julian Lam
922d49be0b fix(style): switch..case 2020-06-03 11:26:08 -04:00
Julian Lam
cf00cda07c refactor: src/flags.js because codeclimate 2020-05-26 20:40:55 -04:00
Julian Lam
8d995d1eb6 refactor: flags detail page
- Show account moderation history
- Ban and delete quick actions

Squashed commit of the following:

commit 0e782e65f4d48ae814708e510ec9d01bcdd914e0
Author: Julian Lam <julian@nodebb.org>
Date:   Tue May 26 20:24:53 2020 -0400

    fix(deps): use persona 10.1.41/vanilla 11.1.17

commit 369e073d3c3189d8ce181eb3d573489cbe54d4fc
Author: Julian Lam <julian@nodebb.org>
Date:   Tue May 26 20:23:24 2020 -0400

    fix: allow ban and delete exported methods to have cbs

commit b83a086ea31a77ec82d161306c0b9bc115cb2a3a
Merge: 525aae1ea 256ee45d3
Author: Julian Lam <julian@nodebb.org>
Date:   Tue May 26 08:54:25 2020 -0400

    Merge remote-tracking branch 'origin/master' into flags-improvements

commit 525aae1ea2e5d0103028a0f0c8dde05f172d088e
Author: Julian Lam <julian@nodebb.org>
Date:   Tue May 26 08:53:39 2020 -0400

    feat: integrate ban history and username changes to flag history list

commit 3e68ad28ba266f4c8620a676aa7f463f0a9d1df7
Author: Julian Lam <julian@nodebb.org>
Date:   Mon May 25 18:22:53 2020 -0400

    feat: allow ban and deletion from flag details page

commit a559ea1d8e8883385c2876868d855a0b93516c54
Author: Julian Lam <julian@nodebb.org>
Date:   Mon May 25 18:22:00 2020 -0400

    feat: export banAccount and deleteAccount methods from accounts module
2020-05-26 20:27:16 -04:00
Barış Soner Uşaklı
5ebcdb1806 fix: #8287, fix users:flags as well 2020-05-02 15:34:58 -04:00
Barış Soner Uşaklı
0391856d7d fix: #8286, rescind notif when its resolved/rejected 2020-05-01 13:32:20 -04:00
Julian Lam
ccc6118d30 Testing suite integration for openapi spec (#8263)
* feat: testing suite integration for openapi spec

The testing suite now takes the openapi spec into account. It will
check each route defined, make a call to it, and compare the
response with the defined schema. Any mismatches will cause the
test to fail.

* fix(openapi): removed debug stuff from tests

* fix(openapi): fixed some tests

* fix(openapi): added additional check to tests, test fixes

* fix(openapi): better tests, fixed spec errors

* fix(openapi): bad conditional in test

* fix: oops

* fix(openapi): more tests fixing

* fix(openapi): more tests

* fix(openapi): fix some more tests

* fix: verbose'd an info log

* fix: topic pagination route returns schema-optimized pagination block

* fix(openapi): more test/spec fixes

* fix(openapi): accidentally sending in authenticated jar for anon routes

* fix(openapi): more test/spec fixes

* fix(openapi): more spec fixes

* fix: timestampReadable Invalid Date

* fix(openapi): more tests... almost there

* fix(openapi): more tests fixing

* fix(openapi): finally all tests passing

* fix(openapi): added reverse test to compare response to spec

... and fixed all the tests that broke

* fix: remove tests related to group covers, as route is gone

* fix(openapi): broken test on travis

* fix(openapi): broken test on travis

* fix(openapi): broken test on travis

* fix(openapi): object cache is not present for psql

* fix: tests

Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
2020-04-23 21:50:08 -04:00
Barış Soner Uşaklı
51236df4ed fix: check if user has read priv before flagging 2020-01-22 12:14:50 -05:00
Julian Lam
8e5a2276af feat: check flag values on save (assignee and state) (#8122)
* feat: add assignee checking when updating flag

Prior to this, it was possible to update the assignee to any value (or
any user. This commit adds checking to allow only admins, global
moderators, or in the case of flagged posts, moderators.

Also some prep work was added for value checking `state`.

* feat: value checking `state` on flag update

The state should be one of the constants defined earlier in the file.
2020-01-20 10:19:23 -05:00
Baris Usakli
2150701f32 fix: missing await 2019-09-28 15:08:51 -04:00
Baris Usakli
ac6eb31c69 refactor: async/await flags.js 2019-09-28 14:37:50 -04:00
Barış Soner Uşaklı
0ced71be39 refactor: async/await flags 2019-09-26 22:51:11 -04:00
Baris Usakli
a651d154ce fix: #7921, dont create wrong entries in db for flag
upgrade script to remove wrong entries
2019-09-24 12:22:40 -04:00
Barış Soner Uşaklı
e32a55460f refactor: remove logs 2019-09-24 00:36:42 -04:00
Barış Soner Uşaklı
9ee1a882ec refactor: async/await flags 2019-09-24 00:30:59 -04:00
Julian Lam
0921230976 fix(style): updated code to follow new eslint recommendations
Squashed commit of the following:

commit f9ce878b26
Author: Julian Lam <julian@nodebb.org>
Date:   Tue Aug 13 14:30:46 2019 -0400

    fix(style): updated code to follow new eslint recommendations

commit 80dd370e41
Author: Julian Lam <julian@nodebb.org>
Date:   Tue Aug 13 14:14:58 2019 -0400

    fix(deps): update dependency sitemap to v4

    Squashed commit of the following:

    commit f4dd9cabb2
    Author: Julian Lam <julian@nodebb.org>
    Date:   Tue Aug 13 11:33:05 2019 -0400

        fix: resolved breaking changes from sitemap v4 upgrade

    commit 9043415ee1
    Merge: e3352b272 72590b346
    Author: Julian Lam <julian@nodebb.org>
    Date:   Tue Aug 13 11:09:55 2019 -0400

        Merge branch 'master' into renovate/sitemap-4.x

    commit e3352b272e
    Author: Renovate Bot <bot@renovateapp.com>
    Date:   Mon Aug 12 07:59:05 2019 +0000

        fix(deps): update dependency sitemap to v4

commit 8e3c0cdcae
Author: Renovate Bot <bot@renovateapp.com>
Date:   Fri Aug 9 00:49:51 2019 +0000

    fix(deps): update dependency commander to v3

commit 2104449d38
Author: Renovate Bot <bot@renovateapp.com>
Date:   Tue Aug 13 15:00:27 2019 +0000

    fix(deps): update dependency mongodb to v3.3.0

commit d2937f446a
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Tue Aug 13 10:36:48 2019 -0400

    feat: async/await admin/controllers

commit 1b97e8b199
Author: Misty (Bot) <deploy@nodebb.org>
Date:   Tue Aug 13 09:28:39 2019 +0000

    Latest translations and fallbacks

commit 69a48957a2
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Mon Aug 12 21:56:09 2019 -0400

    feat: async/await

commit b9b2a7e593
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Mon Aug 12 20:58:29 2019 -0400

    feat: async/await refactor

    controllers/accounts

commit a8d43a1759
Author: Baris Usakli <barisusakli@gmail.com>
Date:   Mon Aug 12 14:49:40 2019 -0400

    feat: async/await controllers/accounts

commit 2f25aae57b
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 23:09:50 2019 -0400

    fix: #7831, fix pagination

    convert to async/await

commit c9e83f2374
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 00:14:35 2019 -0400

    fix: remove empty line

commit 30be91b26c
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 00:13:41 2019 -0400

    fix: remove useless catchs and empty line

commit 2e4a71c0b6
Author: Renovate Bot <bot@renovateapp.com>
Date:   Sat Aug 10 06:51:50 2019 +0000

    chore(deps): update dependency eslint-config-airbnb-base to v14
2019-08-13 15:12:27 -04:00
Barış Soner Uşaklı
0d047f4eb9 feat: #7743, webserver 2019-07-22 18:16:18 -04:00
Barış Soner Uşaklı
7b95ebbb6a fix: #7748, if reputation system is disabled, dont check min reputation 2019-07-11 09:54:46 -04:00
Julian Lam
91f0bce628 fix: #7624, default open state on stateless flags 2019-05-21 12:23:19 -04:00
Barış Soner Uşaklı
81aa3a0b8a fix: don't crash in flags.validate if user blocked target 2018-12-09 15:25:43 -05:00
Julian Lam
d027207f88 fix: flags detail page crash if reporter blocks author
Fixed an issue where the flags detail page would crash if the
reporting user flagged a post and then proceeded to block the
post author.

Retrieval of a flag's target data should be irrespective of
block status.

fixes #6925
2018-11-08 13:43:45 -05:00
Barış Soner Uşaklı
f3a679e268 remove parseInts 2018-10-25 17:02:59 -04:00
Barış Soner Uşaklı
9c022afae1 Parse int (#6853)
* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
2018-10-21 16:47:51 -04:00
Barış Soner Uşaklı
dff86b1ac9 closes #6740
* flag notifications will go to the flag details page instead of the post or user that was flag
* if you assign a flag to yourself you won't get a notification about it
@benlubar
2018-09-18 17:28:24 -04:00
Julian Lam
2ce6a85756 properly closes #6698 2018-08-13 14:17:51 -04:00
Julian Lam
ed9dc113b0 sanitizing notes in flags details page, fixes #6698 2018-08-10 15:01:49 -04:00
Barış Soner Uşaklı
b7f5995aab closes #6550 2018-06-03 14:54:25 -04:00
Julian Lam
7ba2ac9f69 Merge remote-tracking branch 'origin/master' into develop 2018-04-11 16:30:03 -04:00
Barış Soner Uşaklı
bb13c4948d closes #6448 2018-04-11 13:18:52 -04:00
Barış Soner Uşaklı
0070f5c1b2 Merge remote-tracking branch 'refs/remotes/origin/master' into develop 2018-04-05 12:34:38 -04:00
Julian Lam
e8d4fe3209 Revert "closes #6380"
Turns out the issue was a malformed flag object, and not anything
code-wise

This reverts commit 956c5a2a32.
2018-03-22 09:58:09 -04:00
Julian Lam
956c5a2a32 closes #6380 2018-03-22 09:14:37 -04:00
Baris Usakli
29b7c67946 use utils.toISOString 2018-03-15 12:43:11 -04:00
Baris Usakli
a48144e632 dont crash if description is numeric 2018-03-15 12:40:43 -04:00
Julian Lam
a126f07471 closes #6043 2018-03-09 12:57:52 -05:00
Barış Soner Uşaklı
2983fc3e5e get group names first 2018-02-07 20:02:07 -05:00
Barış Soner Uşaklı
bb9528b82e closes #6314 2018-02-07 18:29:56 -05:00
Barış Soner Uşaklı
7f67528280 change parallel to series in flag creation 2018-01-18 12:48:42 -05:00
Barış Soner Uşaklı
72140e5338 closes #5991, closes #5884 2018-01-12 17:29:47 -05:00
Baris Usakli
a19537dc25 closes #6137 2017-11-29 14:04:45 -05:00
Barış Soner Uşaklı
dd176dd5f2 Notification delivery (#6072)
* ability for users to choose how they receive notifications

add type field to more notifications, the type field is used to
determine what to do based on user
setting(none,notification,email,notificationemail)

* change var name to types

* cleanup

* add event types for privileged users

* remove unused language keys

* fix uids check

* changed if statements

* upgrade script to preserver old settings
2017-11-15 21:35:10 -05:00
Barış Soner Uşaklı
67bc58f04c wait for state to be updated 2017-11-12 08:45:08 -05:00
Peter Jaszkowiak
e609e497b3 Provide more error information to logs
Provides full stack instead of just message
2017-11-01 18:59:48 -06:00
Peter Jaszkowiak
46fafb20b9 Remove string.js dependency 2017-10-13 21:02:41 -06:00
Julian Lam
b44cfacda1 resolve XSS vulnerability in flags pages 2017-10-13 11:54:16 -04:00
Peter Jaszkowiak
da9da8190f Bump dependencies
Bumping eslint & configs meant making some linting fixes

For future reference, the `xmlhttprequest-ssl` library must be of equal versioning to the one in `engine.io-client`, otherwise it won't be deduped which causes the socket.io tests to fail
2017-10-02 09:24:27 -04:00