Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua-based notifications #211

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft

Lua-based notifications #211

wants to merge 40 commits into from

Conversation

dssecret
Copy link
Collaborator

@dssecret dssecret commented Dec 5, 2024

  • Trigger creation
  • Trigger updating
  • Notification creation from triggers
  • List official triggers
  • Update notifications in guilds
  • Send audit messages re notifications in audit channel
  • Add selections for all resources
  • Review/update Elixir sandboxing of notifications
  • Add some more pre-defined notifications
  • Create a method for automatically loading official notifications from the git repo
  • Delete a notification from a guild
  • Allow guilds to toggle notifications
  • Create Ecto migrations for this
  • Send messages upon notification trigger
  • Update notification state upon lua completion
  • Handle notification errors

Signed-off-by: tiksan <[email protected]>
Signed-off-by: tiksan <[email protected]>
Signed-off-by: tiksan <[email protected]>
Signed-off-by: tiksan <[email protected]>
Signed-off-by: tiksan <[email protected]>

const header = document.createElement("div");
header.classList.add("card-header");
header.innerHTML = this.getAttribute("data-header");

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix AI about 1 month ago

To fix the problem, we need to ensure that the content of the data-header attribute is treated as plain text rather than HTML. This can be achieved by using the textContent property instead of innerHTML. The textContent property will escape any HTML tags, preventing the execution of any embedded scripts.

  • Change the assignment of header.innerHTML to header.textContent on line 37.
  • No additional imports or definitions are needed for this change.
Suggested changeset 1
application/static/components/dynamic-list.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/application/static/components/dynamic-list.js b/application/static/components/dynamic-list.js
--- a/application/static/components/dynamic-list.js
+++ b/application/static/components/dynamic-list.js
@@ -36,3 +36,3 @@
         header.classList.add("card-header");
-        header.innerHTML = this.getAttribute("data-header");
+        header.textContent = this.getAttribute("data-header");
         card.append(header);
EOF
@@ -36,3 +36,3 @@
header.classList.add("card-header");
header.innerHTML = this.getAttribute("data-header");
header.textContent = this.getAttribute("data-header");
card.append(header);
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant