diff --git a/.circleci/config.yml b/.circleci/config.yml index f18f84943..d405486b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,6 +76,9 @@ jobs: - run: name: Test - Routes command: npm run test:route + - run: + name: Test - HTML sanitization + command: npm run test:safehtml - run: name: Test - Coverage command: npm run test:coverage diff --git a/client/admin/notificationUtils/notificationAdd/notificationAdd.jsx b/client/admin/notificationUtils/notificationAdd/notificationAdd.jsx index 5a8ebf5d0..0cca1047e 100644 --- a/client/admin/notificationUtils/notificationAdd/notificationAdd.jsx +++ b/client/admin/notificationUtils/notificationAdd/notificationAdd.jsx @@ -66,7 +66,7 @@ const NotificationAdd = ()=>{ diff --git a/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx b/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx index 71f8da59c..05f81b776 100644 --- a/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx +++ b/client/admin/notificationUtils/notificationLookup/notificationLookup.jsx @@ -14,9 +14,6 @@ const NotificationDetail = ({ notification, onDelete })=>(
Title
{notification.title || 'No Title'}
-
Text
-
{notification.text || 'No Text'}
-
Created
{Moment(notification.createdAt).format('LLLL')}
@@ -25,6 +22,9 @@ const NotificationDetail = ({ notification, onDelete })=>(
Stop
{Moment(notification.stopAt).format('LLLL') || 'No End Time'}
+ +
Text
+
{notification.text || 'No Text'}
diff --git a/client/components/dialog.jsx b/client/components/dialog.jsx index 2057ecb87..9e88afa33 100644 --- a/client/components/dialog.jsx +++ b/client/components/dialog.jsx @@ -1,22 +1,26 @@ // Dialog box, for popups and modal blocking messages -const React = require('react'); +import React from "react"; const { useRef, useEffect } = React; -function Dialog({ dismissKey, closeText = 'Close', blocking = false, ...rest }) { +function Dialog({ dismisskeys, closeText = 'Close', blocking = false, ...rest }) { const dialogRef = useRef(null); useEffect(()=>{ - if(!dismissKey || !localStorage.getItem(dismissKey)) { + if (dismisskeys.length !== 0) { blocking ? dialogRef.current?.showModal() : dialogRef.current?.show(); } - }, []); + }, [dialogRef.current, dismisskeys]); - const dismiss = ()=>{ - dismissKey && localStorage.setItem(dismissKey, true); + const dismiss = () => { + dismisskeys.forEach(key => { + if (key) { + localStorage.setItem(key, 'true'); + } + }); dialogRef.current?.close(); }; - - return ( + + return ( {rest.children} `; + const rendered = safeHTML(source); + expect(rendered).toBe('
'); +}); + + + diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index c3094abc4..dbcdc6f2a 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -154,28 +154,6 @@ module.exports = [ ] }, - { - name : 'Table of Contents Toggles', - icon : 'fas fa-book', - gen : `{{tocGlobalH4}}\n\n`, - subsnippets : [ - { - name : 'Enable H1-H4 all pages', - icon : 'fas fa-dice-four', - gen : `{{tocGlobalH4}}\n\n`, - }, - { - name : 'Enable H1-H5 all pages', - icon : 'fas fa-dice-five', - gen : `{{tocGlobalH5}}\n\n`, - }, - { - name : 'Enable H1-H6 all pages', - icon : 'fas fa-dice-six', - gen : `{{tocGlobalH6}}\n\n`, - }, - ] - } ] }, { @@ -214,6 +192,27 @@ module.exports = [ line-height: 1em; }\n\n` }, + { + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + subsnippets : [ + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : `.page {\n\th4 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : `.page {\n\th4, h5 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : `.page {\n\th4, h5, h6 {--TOC: include; }\n}\n\n`, + }, + ] + } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 5a2b5cf3f..ba975e58a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -812,17 +812,8 @@ h6, // Brew level default inclusion changes. // These add Headers 'back' to inclusion. -.pages:has(.tocGlobalH4) { - h4 {--TOC: include; } -} -.pages:has(.tocGlobalH5) { - h4, h5 {--TOC: include; } -} - -.pages:has(.tocGlobalH6) { - h4, h5, h6 {--TOC: include; } -} +//NOTE: DO NOT USE :HAS WITH .PAGES!!! EXTREMELY SLOW TO RENDER ON LARGE DOCS! // Block level inclusion changes // These include either a single (include) or a range (depth)