diff --git a/assets/js/ARBoard.js b/assets/js/ARBoard.js index f845922..5b59303 100644 --- a/assets/js/ARBoard.js +++ b/assets/js/ARBoard.js @@ -97,6 +97,7 @@ const loadAddRemoveAdminPage = async () => { document.getElementById("refresh-cards-button").addEventListener("click", async () => { const cardsContainer = document.getElementById("cards-container") cardsContainer.innerHTML = "
Refreshing cards...
" + await initializeCachedGroups() await loadCards(addRemoveIdentifierPrefix) }) @@ -168,51 +169,63 @@ const fetchAllARTxData = async () => { txGroupId: 694, }) - const { finalAddTxs, pendingAddTxs } = partitionAddTransactions(allAddTxs) - const { finalRemTxs, pendingRemTxs } = partitionRemoveTransactions(allRemTxs) + const { finalAddTxs, pendingAddTxs, expiredAddTxs } = partitionAddTransactions(allAddTxs) + const { finalRemTxs, pendingRemTxs, expiredRemTxs } = partitionRemoveTransactions(allRemTxs) // We are going to keep all transactions in order to filter more accurately for display purposes. - console.log('Final addAdminTxs:', finalAddTxs); - console.log('Pending addAdminTxs:', pendingAddTxs); - console.log('Final remAdminTxs:', finalRemTxs); - console.log('Pending remAdminTxs:', pendingRemTxs); + console.log('Final addAdminTxs:', finalAddTxs) + console.log('Pending addAdminTxs:', pendingAddTxs) + console.log('expired addAdminTxs', expiredAddTxs) + console.log('Final remAdminTxs:', finalRemTxs) + console.log('Pending remAdminTxs:', pendingRemTxs) + console.log('expired remAdminTxs', expiredRemTxs) return { finalAddTxs, pendingAddTxs, + expiredAddTxs, finalRemTxs, pendingRemTxs, + expiredRemTxs } } const partitionAddTransactions = (rawTransactions) => { - const finalAddTxs = [] - const pendingAddTxs = [] - - for (const tx of rawTransactions) { - if (tx.approvalStatus === 'PENDING') { - pendingAddTxs.push(tx) - } else { - finalAddTxs.push(tx) - } + const finalAddTxs = [] + const pendingAddTxs = [] + const expiredAddTxs = [] + + for (const tx of rawTransactions) { + if (tx.approvalStatus === 'PENDING') { + pendingAddTxs.push(tx) } - - return { finalAddTxs, pendingAddTxs }; + else if (tx.approvalStatus === 'EXPIRED'){ + expiredAddTxs.push(tx) + } else { + finalAddTxs.push(tx) + } + } + + return { finalAddTxs, pendingAddTxs, expiredAddTxs }; } const partitionRemoveTransactions = (rawTransactions) => { - const finalRemTxs = [] - const pendingRemTxs = [] + const finalRemTxs = [] + const pendingRemTxs = [] + const expiredRemTxs = [] - for (const tx of rawTransactions) { - if (tx.approvalStatus === 'PENDING') { + for (const tx of rawTransactions) { + if (tx.approvalStatus === 'PENDING') { pendingRemTxs.push(tx) - } else { + } + else if (tx.approvalStatus === 'EXPIRED'){ + expiredRemTxs.push(tx) + } else { finalRemTxs.push(tx) - } - } + } + } - return { finalRemTxs, pendingRemTxs } + return { finalRemTxs, pendingRemTxs, expiredRemTxs } } @@ -829,9 +842,9 @@ const createARCardHTML = async (cardData, pollResults, cardIdentifier, commentCo const actionsHtmlCheck = await checkAndDisplayActions(adminYes, verifiedName, cardIdentifier) actionsHtml = actionsHtmlCheck - const { finalAddTxs, pendingAddTxs, finalRemTxs, pendingRemTxs } = await fetchAllARTxData() + const { finalAddTxs, pendingAddTxs, expiredAddTxs, finalRemTxs, pendingRemTxs, expiredRemTxs } = await fetchAllARTxData() - const confirmedAdd = finalAddTxs.some( + const userConfirmedAdd = finalAddTxs.some( (tx) => tx.groupId === 694 && tx.member === accountAddress ) const userPendingAdd = pendingAddTxs.some( @@ -843,31 +856,88 @@ const createARCardHTML = async (cardData, pollResults, cardIdentifier, commentCo const userPendingRemove = pendingRemTxs.some( (tx) => tx.groupId === 694 && tx.admin === accountAddress ) + const userExpiredAdd = expiredAddTxs.some( + (tx) => tx.groupId === 694 && tx.member === accountAddress + ) + const userExpiredRem = expiredRemTxs.some( + (tx) => tx.groupId === 694 && tx.admin === accountAddress + ) + + const noExpired = (!userExpiredAdd && !userExpiredRem) // If user is definitely admin (finalAdd) and not pending removal - if (confirmedAdd && !userPendingRemove && existingAdmin) { + if (userConfirmedAdd && !userPendingRemove && !userPendingAdd && noExpired && existingAdmin && promotionCard) { console.warn(`account was already admin, final. no add/remove pending.`); cardColorCode = 'rgb(3, 11, 24)' - altText = `The Admin Board is an encrypted card publishing board to keep track of minter data for the Minter Admins. Any Admin may publish a card, and related data, make comments on existing cards, and vote on existing card data in support or not of the name on the card. It is essentially a 'project management' tool to assist the Minter Admins in keeping track of the data related to minters they are adding/removing from the minter group.
-More functionality will be added over time. One of the first features will be the ability to output the existing card data 'decisions', to a json formatted list in order to allow crowetic to run his script easily until the final Mintership proposal changes are completed, and the MINTER group is transferred to 'null'.
+The Admin Board was meant to be utilized for DECISIONS regarding Minters or would-be Minters, and is encrypted to the Admins so that the data for the DECISIONS remains private. However, it later became the location to REMOVE minters as well. This, not being the original intended purpose has become problematic, as the removal data SHOULD be public. In the future, this data WILL be made public. The Admin Board will continue to be utilized for decision-making, but will NOT be a place for hidden removal data only.