Commit Graph

106 Commits

Author SHA1 Message Date
Julian Lam
fecdab8b6f refactor: helpers.loginUser to be fully async 2023-01-04 16:25:47 -05:00
Barış Soner Uşaklı
b5dd89e1c0 feat: store topic title and tags in diffs (#10900)
* feat: store topic title and tags in diffs

allow restoring post diff if tags didn't change

* test: fix tests, fast computer problems
2022-09-16 22:16:08 -04:00
Barış Soner Uşaklı
d20b07cfea Webpack5 (#10311)
* feat: webpack 5 part 1

* fix: gruntfile fixes

* fix: fix taskbar warning

add app.importScript
copy public/src/modules to build folder

* refactor: remove commented old code

* feat: reenable admin

* fix: acp settings pages, fix sortable on manage categories

embedded require in html not allowed

* fix: bundle serialize/deserizeli so plugins dont break

* test: fixe util tests

* test: fix require path

* test: more test fixes

* test: require correct utils module

* test: require correct utils

* test: log stack

* test: fix db require blowing up tests

* test: move and disable bundle test

* refactor: add aliases

* test: disable testing route

* fix: move webpack modules necessary for build, into `dependencies`

* test: fix one more test

remove 500-embed.tpl

* fix: restore use of assets/nodebb.min.js, at least for now

* fix: remove unnecessary line break

* fix: point to proper ACP bundle

* test: maybe fix build test

* test: composer

* refactor: dont need dist

* refactor: more cleanup

use everything from build/public folder

* get rid of conditional import in app.js

* fix: ace

* refactor: cropper alias

* test: lint and test fixes

* lint: fix

* refactor: rename function to app.require

* refactor: go back to using app.require

* chore: use github branch

* chore: use webpack branch

* feat: webpack webinstaller

* feat: add chunkFile name with contenthash

* refactor: move hooks to top

* refactor: get rid of template500Function

* fix(deps): use webpack5 branch of 2factor plugin

* chore: tagging v2.0.0-beta.0 pre-release version 💥 :shipit: 🎉 🚀

* refactor: disable cache on templates

loadTemplate is called once by benchpress and the result is cache internally

* refactor: add server side helpers.js

* feat: deprecate /plugins shorthand route, closes #10343

* refactor: use build/public for webpack

* test: fix filename

* fix: more specific selector

* lint: ignore

* refactor: fix comments

* test: add debug for random failing test

* refactor: cleanup

remove test page, remove dupe functions in utils.common

* lint: use relative path  for now

* chore: bump prerelease version

* feat: add translateKeys

* fix: optional params

* fix: get rid of extra timeago files

* refactor: cleanup, require timeago locale earlier

remove translator.prepareDOM, it is in header.tpl html tag

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels (#10378)

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels

- Existing hooks are preserved (to be deprecated at a later date, possibly)
- New init hooks are called on NodeBB start, and provide a one-stop shop to add new privileges, instead of having to add to four different hooks

* docs: fix typo in comment

* test: spec changes

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels (#10378)

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels

- Existing hooks are preserved (to be deprecated at a later date, possibly)
- New init hooks are called on NodeBB start, and provide a one-stop shop to add new privileges, instead of having to add to four different hooks

* docs: fix typo in comment

* test: spec changes

* feat: allow app.require('bootbox'/'benchpressjs')

* refactor: require server side utils

* test: jquery ready

* change istaller to use build/public

* test: use document.addEventListener

* refactor: closes #10301

* refactor: generateTopicClass

* fix: column counts for other privileges

* fix: #10443, regression where sorted-list items did not render into the DOM in the predicted order [breaking]

* fix: typo in hook name

* refactor: introduce a generic autocomplete.init() method that can be called to add nodebb-style autocompletion but using different data sources (e.g. not user/groups/tags)

* fix: crash if `delay` not passed in (as it cannot be destructured)

* refactor: replace substr

* feat: set --panel-offset style in html element based on stored value in localStorage

* refactor: addDropupHandler() logic to be less naive

- Take into account height of the menu
- Don't apply dropUp logic if there's nothing in the dropdown
- Remove 'hidden' class (added by default in Persona for post tools) when menu items are added

closes #10423

* refactor: simplify utils.params [breaking]

Retrospective analysis of the usage of this method suggests that the options passed in are superfluous, and that only `url` is required. Using a browser built-in makes more sense to accomplish what this method sets out to do.

* feat: add support for returning full URLSearchParams for utils.params

* fix: utils.params() fallback handling

* fix: default empty obj for params()

* fix: remove \'loggedin\' and \'register\' qs parameters once they have been used, delay invocation of messages until ajaxify.end

* fix: utils.params() not allowing relative paths to be passed in

* refactor(DRY): new assertPasswordValidity utils method

* fix: incorrect error message returned on insufficient privilege on flag edit

* fix: read/update/delete access to flags API should be limited for moderators to only post flags in categories they moderate

- added failing tests and patched up middleware.assert.flags to fix

* refactor: flag api v3 tests to create new post and flags on every round

* fix: missing error:no-flag language key

* refactor: flags.canView to check flag existence, simplify middleware.assert.flag

* feat: flag deletion API endpoint, #10426

* feat: UI for flag deletion, closes #10426

* chore: update plugin versions

* chore: up emoji

* chore: update markdown

* chore: up emoji-android

* fix: regression caused by utils.params() refactor, supports arrays and pipes all values through utils.toType, adjusts tests to type check

Co-authored-by: Julian Lam <julian@nodebb.org>
2022-04-29 21:39:33 -04:00
Julian Lam
d92da828a3 refactor: move post upload tests to its own file 2022-02-14 15:02:07 -05:00
Julian Lam
1b8eeaf840 feat: more tests for ensuring downvoted posts are added to the :votes zset 2022-02-04 14:33:58 -05:00
Barış Soner Uşaklı
6ad0472106 breaking: remove socket.emit('topics.post')
remove socket.emit('topics.search')
remove socket.emit('topics.getTopic')
2021-12-12 13:14:08 -05:00
Barış Soner Uşaklı
4604a5724c breaking: remove socket.emit('posts.reply')
remove socket.emit('posts.getPost')
2021-12-12 12:19:24 -05:00
Barış Soner Uşaklı
bd1cb2d4f9 breaking: remove socket.emit('posts.delete')
remove socket.emit('posts.restore')
remove socket.emit('posts.purge')
remove socket.emit('posts.deletePosts')
remove socket.emit('posts.purgePosts')
2021-12-09 19:58:40 -05:00
Barış Soner Uşaklı
ec1d5e38da breaking: remove socket.emit('posts.upvote')
socket.emit('posts.downvote')
socket.emit('posts.unvote')
2021-12-09 19:12:49 -05:00
Barış Soner Uşaklı
8427c5d9db breaking: remove socket.emit('posts.move') 2021-12-09 18:59:23 -05:00
Barış Soner Uşaklı
4247f62441 breaking: remove socket.emit('posts.edit') 2021-12-09 18:42:43 -05:00
Barış Soner Uşaklı
f7418ccd47 breaking: remove socket.emit('posts.bookmark/unbookmark') 2021-12-09 17:59:23 -05:00
Barış Soner Uşaklı
8117b7f22f breaking: remove deprecated post diff socket calls 2021-11-28 19:45:29 -05:00
Barış Soner Uşaklı
c5f08fdc81 breaking: remove socket.io/flags.js
refactor: helpers.loginUser returns a single object {jar, csrf_token}
2021-11-22 19:23:51 -05:00
Barış Soner Uşaklı
fb363957d1 refactor: tab rules 2021-11-18 16:42:18 -05:00
Barış Soner Uşaklı
c8b2fc46dc fix: translator path traversal 2021-10-25 12:51:56 -04:00
Julian Lam
be43cd2597 Topic Linkbacks (#9825)
* feat: WIP topic linkbacks, + failing tests

* test: don't accidentally comment out all of the post tests

* fix: rename to "backlinks"

* feat: more stub code, more failing tests

* feat: backend methods and passing tests for topic backlinks

* test: uncomment test/posts.js again

* fix: missing quotation mark in topic event helper

* fix: superfluous usage of Promise.all

* test: fix broken test -- used hardcoded (and incorrect) url

* test: parseInt shenanigans
2021-09-29 12:26:15 -04:00
Barış Soner Uşaklı
162ebacf5b fix: parseInt tids 2021-07-30 22:54:19 -04:00
Barış Soner Uşaklı
0c81642997 fix: #9681, update posts in queue if target tid is merged 2021-07-30 22:51:06 -04:00
Barış Soner Uşaklı
293b7c2650 refactor: privileges, export modules directly (#9325)
fix unused/commented out methods in admin privileges
2021-02-24 18:10:34 -05:00
Barış Soner Uşaklı
3595473485 feat: load user posts/topics via xhr on infinitescroll 2021-02-11 16:47:51 -05:00
Peter Jaszkowiak
cc9d6fd08b chore: eslint max-len 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
dab3b23575 chore: eslint no-var, vars-on-top 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
b56d9e12b5 chore: eslint prefer-arrow-callback 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
707b55b6a5 chore: eslint prefer-template 2021-02-08 18:06:44 -05:00
gasoved
72b050b4a8 test: post diff deletion tests 2021-02-03 09:49:28 -05:00
Barış Soner Uşaklı
414caac01b fix: #8957 2020-11-26 12:45:02 -05:00
Barış Soner Uşaklı
ccddbb15c9 feat: edit test 2020-09-21 15:15:30 -04:00
Julian Lam
f743f92088 refactor: socket posts delete/restore/purge so tid is not necessary (#8607)
* refactor: socket posts delete/restore/purge so tid is not necessary

* refactor: stop trying to be fancy

* fix: tests to not pass in tid into posts.deletePosts

* fix: some more unnecessary tid passing
2020-09-02 21:51:35 -04:00
Barış Soner Uşaklı
844f2b4ed0 feat: #8524, allow editing category of queued topic 2020-07-23 16:43:56 -04:00
Barış Soner Uşaklı
2485a55092 feat: #8521, allow editing title before posting from queue 2020-07-20 21:28:17 -04:00
Barış Soner Uşaklı
c513b88dff feat: #8427, daily downvote limits 2020-07-09 12:51:05 -04:00
Julian Lam
f909ed2541 feat: show editor in post diffs if available 2020-06-15 17:16:44 -04:00
Julian Lam
d5578c9906 fix: tests breaking due to #8406 2020-06-15 14:09:47 -04:00
Barış Soner Uşaklı
ec5582b53c feat: add privilege give/rescind hooks (#8336)
* feat: add privilege give/rescind hooks

action:privileges.categories.give/rescind
action:privileges.global.give/rescind

breaking change, privileges.categories.give/rescind and privileges.global.give/rescind use full privilege name for groups ie `groups:find` instead of `find`

* fix: tests, privileges renamed
2020-05-26 21:57:38 -04:00
Barış Soner Uşaklı
df2c785127 feat: add test for change post owner 2020-01-24 15:24:01 -05:00
Barış Soner Uşaklı
3e52557689 fix: change owner missing await 2020-01-17 11:16:23 -05:00
Barış Soner Uşaklı
1cedc4a0d6 feat: #7957, allow post queue based on group
allow multiple select in ACP pages
2019-10-28 14:36:14 -04:00
Julian Lam
30a86ed553 fix: #7853, dissociation on post purge 2019-09-04 16:59:04 -04:00
Baris Usakli
2abe244b6e fix: newPostEditDuration 2019-07-30 13:03:01 -04:00
Barış Soner Uşaklı
3c32d8600f fix: #7788 No new posts (#7793)
* feat: debug no-new-posts

* feat: add test for user delete

* fix: timeout for flag test

* feat: shorter
2019-07-23 21:11:04 -04:00
Barış Soner Uşaklı
c0c6c652be feat: #7743, finish post module 2019-07-17 19:05:55 -04:00
Barış Soner Uşaklı
1b2b308a7e feat: #7743, posts module 2019-07-17 00:17:21 -04:00
Barış Soner Uşaklı
53e1b349ae Change post owner (#7752)
* feat: #7749, allow array of keys for setObject

* feat: sortedSetRemoveBulk

* feat: test for bulk remove

* feat: #7083, ability to change post ownership

* feat: #7083, fix tid:<tid>:posters

* feat: #7083, front end

* fix: #7752, psql methods

* fix: add missing await

* fix: maybe psql
2019-07-12 14:06:09 -04:00
Julian Lam
8a6a58ee43 feat: added new admin option newbiePostEditDuration (#7737)
* feat: added new admin option newbiePostEditDuration

Also:
  - Grammar-checked a couple language strings
  - Moved a couple form inputs around in new user restrictions
  - Added a test for the new option
  - fix: 'defore' typo
2019-07-04 13:28:36 -04:00
Barış Soner Uşaklı
bd640a1107 Topic await errors (#7727)
* feat: derp await

* feat: restore user.getSettings

* feat: cleanup

* feat: make tid const

* feat: cleanup

* fix: tests

* feat: deprecate filter:controllers.topic.get

* feat: rewrite post-index logic

* feat: change calculation to match others

* fix: use .async

* feat: remove try/catch wrapper
2019-07-03 12:48:26 -04:00
Barış Soner Uşaklı
035f624758 Remove implicit mod privs. closes #6345 (#7648)
* feat: add upgrade script to give mods privs

* feat: give all privileges when making a moderator

* feat: remove implicit privs

* feat: give global mods default privs

* feat: more priv fixes

* feat: use lodash

* fix: remove implicit mod priv from topic delete

* fix: more privs

* fix: posts.canEdit

* fix: canDelete and canEdit

* fix: tests, remove console.log

* feat: shorter functions

* feat: add tests

* fix: uids

* fix: redis random test fail
2019-05-30 19:30:47 -04:00
Barış Soner Uşaklı
b52dba5c92 fix: #7508 2019-04-01 08:27:37 -04:00
Julian Lam
697a6597f3 fix: #7444 Re-factor handling of og:image tags (#7463)
* fix: display proper site logo or og-image with sizes in head

* fix: refactor og:image logic, #7444

- Updated logic to set additional og:image tags based on more
  factors
- logo.png fallback

* feat: save image sizes on post upload, re: #7444

* fix: awaiting addTags in topic controller

* fix: pass strings to meta tags object

* fix: sending absolute image url to meta tag

* fix: removed unneeded async and requiring sync db

* feat: upgrade to calculate image sizes for all post uploads tracked

* fix: tests
2019-03-18 12:09:10 -04:00
Julian Lam
745a9589e9 Use topics:read privilege for topic filtering use cases (#7462)
* fix: use topics:read privilege for topic filtering use cases

* fix: tests

* fix: more broken tests
2019-03-16 14:51:46 -04:00