[grade=B] DC-058: complete Share UI — admin modal + public preview page + grid share button + 3 frontend tests
This commit is contained in:
@@ -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', '🗑️');
|
||||
|
||||
Reference in New Issue
Block a user