Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/shy-kings-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Add Schedule button to admin working groups page
4 changes: 4 additions & 0 deletions .changeset/silly-paws-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Fix admin meetings page crash when loading meetings and series
31 changes: 25 additions & 6 deletions server/public/admin-meetings.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ <h2 id="detailsTitle">Meeting Details</h2>
const response = await fetch(url);
if (!response.ok) throw new Error('Failed to load meetings');

meetings = await response.json();
const data = await response.json();
meetings = data.meetings || [];
renderMeetings();

document.getElementById('loading').style.display = 'none';
Expand All @@ -479,15 +480,20 @@ <h2 id="detailsTitle">Meeting Details</h2>
async function loadSeries() {
try {
const groupId = document.getElementById('groupFilter').value;
let url = '/api/admin/meetings/series';
if (groupId) {
url += `?working_group_id=${groupId}`;

// Series endpoint requires a working group filter
if (!groupId) {
series = [];
renderSeries();
return;
}

const url = `/api/admin/meetings/series?working_group_id=${groupId}`;
const response = await fetch(url);
if (!response.ok) throw new Error('Failed to load series');

series = await response.json();
const data = await response.json();
series = data.series || [];
renderSeries();
} catch (error) {
console.error('Error loading series:', error);
Expand Down Expand Up @@ -748,7 +754,8 @@ <h3>${escapeHtml(s.title)}</h3>
const response = await fetch(`/api/admin/meetings/${id}`);
if (!response.ok) throw new Error('Failed to load meeting');

viewingMeeting = await response.json();
const data = await response.json();
viewingMeeting = { ...data.meeting, attendees: data.attendees };
const m = viewingMeeting;
const group = workingGroups.find(g => g.id === m.working_group_id);
const date = new Date(m.start_time);
Expand Down Expand Up @@ -845,6 +852,18 @@ <h3>${escapeHtml(s.title)}</h3>
async function init() {
await loadWorkingGroups();
await loadMeetings();

// Auto-open schedule modal if requested via URL
const params = new URLSearchParams(window.location.search);
if (params.get('action') === 'schedule') {
showCreateModal();
// Clear the action param to prevent re-triggering on refresh
params.delete('action');
const newUrl = params.toString()
? `${window.location.pathname}?${params.toString()}`
: window.location.pathname;
window.history.replaceState({}, '', newUrl);
}
}

init();
Expand Down
1 change: 1 addition & 0 deletions server/public/admin-working-groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ <h3>${escapeHtml(group.name)}</h3>
<div class="group-actions">
<button class="btn btn-secondary btn-small" onclick="window.open('/working-groups/${group.slug}', '_blank')">View</button>
<button class="btn btn-secondary btn-small" onclick="window.location.href='/admin/meetings?group=${group.id}'">Meetings</button>
<button class="btn btn-secondary btn-small" onclick="window.location.href='/admin/meetings?group=${group.id}&action=schedule'">Schedule</button>
<button class="btn btn-primary btn-small" onclick="editGroup('${group.id}')">Manage</button>
<button class="btn btn-danger btn-small" onclick="showDeleteModal('${group.id}', '${escapeHtml(group.name).replace(/'/g, "\\'")}')">Delete</button>
</div>
Expand Down