From da783c43ba684f00b1733d86015b928c158f4b6d Mon Sep 17 00:00:00 2001
From: QuickMythril
Date: Tue, 28 Jan 2025 04:23:23 -0500
Subject: [PATCH 01/13] fix for names with quotes or apostrophes
---
assets/js/MinterBoard.js | 10 +++++++++-
assets/js/QortalApi.js | 3 ++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/assets/js/MinterBoard.js b/assets/js/MinterBoard.js
index 5e635d5..5bf3e58 100644
--- a/assets/js/MinterBoard.js
+++ b/assets/js/MinterBoard.js
@@ -1394,10 +1394,18 @@ const handleInviteMinter = async (minterName) => {
}
}
+function escapeForHtmlAttribute(str) {
+ return str
+ .replace(/'/g, ''')
+ .replace(/"/g, '"');
+}
+
const createInviteButtonHtml = (creator, cardIdentifier) => {
+ // Safely escape special chars so they won't break the HTML attribute
+ const safeCreator = escapeForHtmlAttribute(creator);
return `
+ ${creator === userState.accountName ? `
+
+
+
+ ` : ''}
+ ${creator === userState.accountName ? `
+
+
+
+ ` : ''}
+ ${creator === userState.accountName ? `
+
+
+
+ ` : ''}
@@ -61,7 +65,7 @@
- Q-Mintership v1.04b
+
@@ -572,12 +576,12 @@
![](assets/images/again-edited-qortal-minting-icon-156x156.png)
-
Q-Mintership (v1.04b)
+
- Q-Mintership v1.04beta
+
@@ -590,6 +594,12 @@
+
--
2.43.0
From 746e94a8f5fc449df03656ec37f621edc995c60e Mon Sep 17 00:00:00 2001
From: QuickMythril
Date: Tue, 28 Jan 2025 04:48:44 -0500
Subject: [PATCH 08/13] add count of minter admins & signatures needed to ARA
board
---
assets/js/ARBoard.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/assets/js/ARBoard.js b/assets/js/ARBoard.js
index 45f536a..e9c90b0 100644
--- a/assets/js/ARBoard.js
+++ b/assets/js/ARBoard.js
@@ -28,7 +28,6 @@ const loadAddRemoveAdminPage = async () => {
@@ -231,6 +230,9 @@ const displayExistingMinterAdmins = async () => {
// 1) Fetch addresses
const admins = await fetchMinterGroupAdmins()
minterAdminAddresses = admins.map(m => m.member)
+ // Compute total admin count and signatures needed (40%, rounded up)
+ const totalAdmins = admins.length;
+ const signaturesNeeded = Math.ceil(totalAdmins * 0.40);
let rowsHtml = "";
for (const adminAddr of admins) {
if (adminAddr.member === nullAddress) {
@@ -290,7 +292,11 @@ const displayExistingMinterAdmins = async () => {
`
- adminListContainer.innerHTML = tableHtml
+ adminListContainer.innerHTML = `
+ Existing Minter Admins: ${totalAdmins}
+ Signatures for Group Approval (40%): ${signaturesNeeded}
+ ${tableHtml}
+ `;
} catch (err) {
console.error("Error fetching minter admins:", err)
adminListContainer.innerHTML =
--
2.43.0
From 136a6458c8c9e6df2573d25c0462f13d23587c16 Mon Sep 17 00:00:00 2001
From: QuickMythril
Date: Tue, 28 Jan 2025 04:50:54 -0500
Subject: [PATCH 09/13] add button to show/hide minter admin list in ARA board
---
assets/js/ARBoard.js | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/assets/js/ARBoard.js b/assets/js/ARBoard.js
index e9c90b0..09fdc98 100644
--- a/assets/js/ARBoard.js
+++ b/assets/js/ARBoard.js
@@ -147,6 +147,19 @@ const toggleProposeButton = () => {
proposeButton.style.display === 'flex' ? 'none' : 'flex'
}
+const toggleAdminTable = () => {
+ const tableContainer = document.getElementById("adminTableContainer")
+ const toggleBtn = document.getElementById("toggleAdminTableButton")
+
+ if (tableContainer.style.display === "none") {
+ tableContainer.style.display = "block"
+ toggleBtn.textContent = "Hide Minter Admins"
+ } else {
+ tableContainer.style.display = "none"
+ toggleBtn.textContent = "Show Minter Admins"
+ }
+}
+
const fetchAllARTxData = async () => {
const addAdmTx = "ADD_GROUP_ADMIN"
const remAdmTx = "REMOVE_GROUP_ADMIN"
@@ -279,6 +292,22 @@ const displayExistingMinterAdmins = async () => {
}
// 3) Build the table
const tableHtml = `
+
+
+
+
@@ -291,6 +320,7 @@ const displayExistingMinterAdmins = async () => {
${rowsHtml}
+
`
adminListContainer.innerHTML = `
Existing Minter Admins: ${totalAdmins}
--
2.43.0
From 01fe92eda62155be50bdcde2b07bc29a1b2cfe4d Mon Sep 17 00:00:00 2001
From: QuickMythril
Date: Tue, 28 Jan 2025 04:52:28 -0500
Subject: [PATCH 10/13] fix rounding errors for signature count
---
assets/js/ARBoard.js | 2 +-
assets/js/AdminBoard.js | 2 +-
assets/js/MinterBoard.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/assets/js/ARBoard.js b/assets/js/ARBoard.js
index 09fdc98..1ff1563 100644
--- a/assets/js/ARBoard.js
+++ b/assets/js/ARBoard.js
@@ -601,7 +601,7 @@ const checkAndDisplayActions = async (adminYes, name, cardIdentifier) => {
} else if ((minterAdmins) && (minterAdmins.length > 1) && isBlockPassed){
const totalAdmins = minterAdmins.length
const fortyPercent = totalAdmins * 0.40
- minAdminCount = Math.round(fortyPercent)
+ minAdminCount = Math.ceil(fortyPercent)
console.warn(`this is another check to ensure minterAdmin group has more than 1 admin. IF so we will calculate the 40% needed for GROUP_APPROVAL, that number is: ${minAdminCount}`)
}
const addressInfo = await getNameInfo(name)
diff --git a/assets/js/AdminBoard.js b/assets/js/AdminBoard.js
index 4e2b13c..eb4f650 100644
--- a/assets/js/AdminBoard.js
+++ b/assets/js/AdminBoard.js
@@ -1067,7 +1067,7 @@ const checkAndDisplayRemoveActions = async (adminYes, name, cardIdentifier, name
} else if ((minterAdmins) && (minterAdmins.length > 1) && isBlockPassed){
const totalAdmins = minterAdmins.length
const fortyPercent = totalAdmins * 0.40
- minAdminCount = Math.round(fortyPercent)
+ minAdminCount = Math.ceil(fortyPercent)
console.warn(`this is another check to ensure minterAdmin group has more than 1 admin. IF so we will calculate the 40% needed for GROUP_APPROVAL, that number is: ${minAdminCount}`)
}
if (isBlockPassed && (userState.isMinterAdmin || userState.isAdmin)) {
diff --git a/assets/js/MinterBoard.js b/assets/js/MinterBoard.js
index a25e726..315813d 100644
--- a/assets/js/MinterBoard.js
+++ b/assets/js/MinterBoard.js
@@ -1442,7 +1442,7 @@ const checkAndDisplayInviteButton = async (adminYes, creator, cardIdentifier) =>
let minAdminCount = 9
if (isBlockPassed) {
- minAdminCount = Math.round(minterAdmins.length * 0.4)
+ minAdminCount = Math.ceil(minterAdmins.length * 0.4)
console.warn(`Using 40% => ${minAdminCount}`)
}
--
2.43.0
From 53b90f2b1b7fb3fc7bb1af81d211e298ad3728d4 Mon Sep 17 00:00:00 2001
From: QuickMythril
Date: Tue, 28 Jan 2025 04:54:45 -0500
Subject: [PATCH 11/13] always show group invite tx approvals
---
assets/js/MinterBoard.js | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/assets/js/MinterBoard.js b/assets/js/MinterBoard.js
index 315813d..ec6ea0f 100644
--- a/assets/js/MinterBoard.js
+++ b/assets/js/MinterBoard.js
@@ -1432,11 +1432,6 @@ const featureTriggerCheck = async () => {
const checkAndDisplayInviteButton = async (adminYes, creator, cardIdentifier) => {
- if (!userState.isMinterAdmin){
- console.warn(`User is NOT an admin, not displaying invite/approve button...`)
- return null
- }
-
const isBlockPassed = await featureTriggerCheck()
const minterAdmins = await fetchMinterGroupAdmins()
@@ -1483,7 +1478,7 @@ const checkAndDisplayInviteButton = async (adminYes, creator, cardIdentifier) =>
console.warn(`PriorBanOrKick determination:`, priorBanOrKick)
- const inviteButtonHtml = createInviteButtonHtml(creator, cardIdentifier)
+ const inviteButtonHtml = userState.isMinterAdmin ? createInviteButtonHtml(creator, cardIdentifier) : ''
const groupApprovalHtml = await checkGroupApprovalAndCreateButton(minterAddress, cardIdentifier, "GROUP_INVITE")
if (!priorBanOrKick) {
@@ -1572,7 +1567,8 @@ const checkGroupApprovalAndCreateButton = async (address, cardIdentifier, transa
Existing ${transactionType} Approvals: ${uniqueApprovalCount}
${tableHtml}
-