From ac81fc79c95cbb9d71cfb8cabd8026e9dc1a0dde Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 24 Apr 2020 04:57:38 +0100 Subject: [PATCH] Use AJAX for notifications table (#10961) * Use AJAX for notifications table Signed-off-by: Andrew Thornton * move to separate js Signed-off-by: Andrew Thornton * placate golangci-lint Signed-off-by: Andrew Thornton * Add autoupdating notification count Signed-off-by: Andrew Thornton * Fix wipeall Signed-off-by: Andrew Thornton * placate tests Signed-off-by: Andrew Thornton * Try hidden Signed-off-by: Andrew Thornton * Try hide and hidden Signed-off-by: Andrew Thornton * More auto-update improvements Only run checker on pages that have a count Change starting checker to 10s with a back-off to 60s if there is no change Signed-off-by: Andrew Thornton * string comparison! Signed-off-by: Andrew Thornton * as per @silverwind Signed-off-by: Andrew Thornton * add configurability as per @6543 Signed-off-by: Andrew Thornton * Add documentation as per @6543 Signed-off-by: Andrew Thornton * Use CSRF header not query Signed-off-by: Andrew Thornton * Further JS improvements Fix @etzelia update notification table request Fix @silverwind comments Co-Authored-By: silverwind Signed-off-by: Andrew Thornton * Simplify the notification count fns Signed-off-by: Andrew Thornton Co-authored-by: silverwind --- doc/advanced/config-cheat-sheet.en-us.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index fd32bfd1..9d9d2755 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -140,6 +140,13 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page. - `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page. +### UI - Notification (`ui.notification`) + +- `MIN_TIMEOUT`: **10s**: These options control how often notification is queried to update the notification count. On page load the notification count will be checked after `MIN_TIMEOUT`. The timeout will increase to `MAX_TIMEOUT` by `TIMEOUT_STEP` if the notification count is unchanged. Set MIN_TIMEOUT to 0 to turn off. +- `MAX_TIMEOUT`: **60s**. +- `TIMEOUT_STEP`: **10s**. + + ## Markdown (`markdown`) - `ENABLE_HARD_LINE_BREAK`: **true**: Render soft line breaks as hard line breaks, which