[grade=B] DC-058: complete Share UI — admin modal + public preview page + grid share button + 3 frontend tests
CI / Test & Lint (push) Has been cancelled
CI / Security audit (push) Has been cancelled

This commit is contained in:
Hermes
2026-08-06 15:11:31 -07:00
parent f8b088916b
commit a7057e4fba
10 changed files with 1394 additions and 228 deletions
+19
View File
@@ -270,6 +270,25 @@
btnRow.appendChild(optBtn);
}
// Add share button for all services except 'internet' (DC-058).
// Calls into the share-modal module registered on window. We don't
// hard-require the module — if share-modal.js was excluded from the
// bundle, the button still renders but clicking it surfaces a clear
// error toast instead of a silent no-op.
if (s.id !== 'internet') {
const shareBtn = el('button', 'share-btn', '🔗');
shareBtn.title = 'Share this service (Pro)';
shareBtn.onclick = (e) => {
e.stopPropagation();
if (typeof window.openShareModal === 'function') {
window.openShareModal(s);
} else if (typeof window.showNotification === 'function') {
window.showNotification('Share modal not loaded. Refresh the page.', 'error');
}
};
btnRow.appendChild(shareBtn);
}
// Add delete button for all services except Internet
if (s.id !== 'internet') {
const delBtn = el('button', 'delete-btn', '🗑️');