Commit Graph

68 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ı
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
Barış Soner Uşaklı
c52401da02 fix: #10491, don't leak deleted message in cleanedContent 2022-04-12 15:36:06 -04:00
Julian Lam
d95b4ee29a fix: assertion check to ensure messages are in the room when editing/deleting, etc 2021-12-22 14:58:42 -05:00
Julian Lam
aaa6f752d0 refactor: put message api calls behind /messages prefix, #10097 2021-12-22 14:39:18 -05:00
Julian Lam
16ba16cdc4 fix: deprecate chats.leave 2021-12-22 10:59:36 -05:00
Julian Lam
6294beea0b fix: re-allow kicking of the other party in a 1-to-1 chat 2021-12-22 10:59:36 -05:00
Julian Lam
d62ee84637 feat: POST /chats/:roomId/users 2021-12-22 10:59:36 -05:00
Julian Lam
6eea6451d2 feat: GET /chats/:roomId/users [breaking] 2021-12-22 10:59:36 -05:00
Julian Lam
b292960594 feat: GET /chats/:roomId/:mid 2021-12-22 10:59:36 -05:00
Julian Lam
f48ed3658a feat: PUT /chats/:roomId/:mid 2021-12-22 10:59:36 -05:00
Julian Lam
140f9d2481 fix: isFinite check for room assertion, more test migrating 2021-12-22 10:59:36 -05:00
Julian Lam
e745e21242 chore: use apiv3 for room rename tests 2021-12-22 10:59:36 -05:00
Julian Lam
c990211cf2 refactor: rewrite messaging tests to use API v3 calls when available, rewrote a bunch of tests to async..await 2021-12-22 10:59:36 -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ı
4ac9270a2a test: increase timeout 2021-11-05 14:25:43 -04:00
Barış Soner Uşaklı
c953b1b3d1 fix: #9292, messageobj.content already parsed 2021-02-11 12:55:00 -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
Julian Lam
895e3d939e fix: #9149, server-side handling of disableChatMessageEditing 2020-12-28 10:20:52 -05:00
psychobunny
5b427a0c3b feat: option in ACP to configure notification/email delay for chats 2020-09-28 11:15:45 -04:00
Barış Soner Uşaklı
067034082f fix: #6422, update deleted/restored messages 2020-02-14 23:26:54 -05:00
Barış Soner Uşaklı
23810cc64b fix: #8133, check if user is in room before removing 2020-01-23 22:40:14 -05:00
Barış Soner Uşaklı
1f13ab8a19 fix: restrict getUsersInRoom to members 2020-01-22 11:46:26 -05:00
Julian Lam
ecc579a29c fix: tests for messaging 2020-01-21 14:35:50 -05:00
Barış Soner Uşaklı
1b08f37612 fix: tests, was using hardcoded message id 2020-01-20 11:15:26 -05:00
Barış Soner Uşaklı
6a63c1a100 fix: escape system message, don't allow editing system messages 2020-01-19 22:20:43 -05:00
Barış Soner Uşaklı
e3c9dafa08 fix: tests 2019-11-01 22:13:00 -04:00
Julian Lam
4fb271c684 System chat messages (#7771)
* fix: removed duplicate checkContent call in addMessage

addMessage is called in one place (sendMessage), and the checks
are already contained there. addMessage is the lower level call
and so should be called only from within core itself.

* feat: #7330 chat system messages for join, leave, rename

* fix: add back content checking in .addMessage();

* fix: tests, and added .addSystemMessage() method

Tests were relying on message indices that changed due to the
new system messages.

* feat: add tests for system chat messages

* refactor: rewrite half of src/messaging/rooms.js, fix tests

* feat: #7743 messaging/room.js

* fix: tests for messaging/room.js, #7743

* fix: trying to fix tests

* fix: omg :rage2:
2019-07-19 12:20:11 -04:00
Barış Soner Uşaklı
bc41848adb fix: test 2019-01-24 15:17:24 -05:00
Barış Soner Uşaklı
e55fb43703 fix: #7086 2018-12-08 19:36:38 -05:00
Barış Soner Uşaklı
805da98a36 remove unnecessary groups.resetCache calls 2018-09-30 13:42:33 -04:00
Julian Lam
a08572b800 kick support for chats, #6479 2018-04-30 12:35:17 -04:00
Julian Lam
1ce448f2a1 Merge remote-tracking branch 'origin/master' into develop 2018-02-16 21:23:25 -05:00
Baris Usakli
e99d4a5c61 closes #6313 2018-02-07 15:46:11 -05:00
Julian Lam
c47987b305 fixed test for error when adding self to chat 2018-01-12 13:19:14 -05:00
Julian Lam
d1ccd78ac2 Merge remote-tracking branch 'origin/master' into develop 2018-01-06 12:04:07 -05:00
Barış Soner Uşaklı
ff6c6a54c1 make upload permissions global
give upload image permission to registered users on install
add global privileges to app.user.privileges for client side use
2018-01-03 13:27:34 -05:00
Julian Lam
82a95a03be Chat message soft deletion -- closes #6181
Squashed commit of the following:

commit f84c06bdcc45f24ef7ffde6a8f33b48d8f97fc36
Author: Julian Lam <julian@nodebb.org>
Date:   Mon Dec 18 14:42:47 2017 -0500

    added restore handler for chat messages

commit 725cd370c6ea1e8f4a28298350f3dc024d4e668e
Author: Julian Lam <julian@nodebb.org>
Date:   Mon Dec 18 14:23:52 2017 -0500

    backend logic and testing complete for deletion and restoration of chat messages

commit 072da758319cc93fa4c6f8bc0d672a1b716dc06e
Author: Julian Lam <julian@nodebb.org>
Date:   Mon Dec 18 13:52:35 2017 -0500

    changing message delete logic to not remove mids, but to filter when retrieving

commit 68bf373305ab82737658a7c31dc5549af4d6d69f
Author: Julian Lam <julian@nodebb.org>
Date:   Mon Dec 18 12:37:58 2017 -0500

    logic to handle deletion of a deleted chat message -- added some failing tests

commit 6899d0d234fa752e227188aa69cfcabd0d0500cc
Author: Julian Lam <julian@nodebb.org>
Date:   Mon Dec 18 11:35:36 2017 -0500

    chat message deletion logic
2017-12-18 14:45:06 -05:00
Baris Usakli
b19310049d closes #6136 2017-11-29 11:46:36 -05:00
Barış Soner Uşaklı
3bf7faf5fc increase rate limit delay 2017-11-20 19:58:46 -05:00
Barış Soner Uşaklı
a46db9616c fix message delete and add test 2017-08-21 16:48:18 -04:00
Baris Usakli
37a8247293 add test for teaser content escape 2017-08-16 13:40:33 -04:00
Peter Jaszkowiak
1471fbdc14 Fix tests 2017-07-02 16:26:31 -06:00
Peter Jaszkowiak
b171f3072b Fix many "duplicate key" errors
- Reset defaults after every test
- Remove individual `after(db.emptydb)` calls
- Fix async.every in groups test
- Update plugin list in socket tests
2017-05-26 17:16:59 -06:00
Barış Soner Uşaklı
c364cebbe4 more tests 2017-05-20 20:20:53 -04:00
Barış Soner Uşaklı
7fb45cc148 more tests 2017-05-20 20:03:46 -04:00