Remove Programs tab and all supporting code
The Programs feature is superseded by Shows, which provides a more flexible model with schedule slots. This commit removes all Programs code across frontend and backend: Frontend: - Delete admin-program-form component (ts/html/scss) - Delete program.service.ts and program.ts interface - Remove Programs tab, form modal, and all CRUD logic from admin component (ts + html) Backend: - Delete programs API router - Remove Program ORM model and ProgramCreate/Update/Response schemas - Remove programs router registration from main.py - Remove Program from seed data, seed helpers, and truncate/reset
This commit is contained in:
@@ -3,7 +3,6 @@ import { CommonModule, AsyncPipe } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { BehaviorSubject, firstValueFrom } from 'rxjs';
|
||||
|
||||
import { Program } from '../interfaces/program';
|
||||
import { Show } from '../interfaces/show';
|
||||
import { Event } from '../interfaces/event';
|
||||
import { Tier } from '../interfaces/tier';
|
||||
@@ -11,7 +10,6 @@ import { StationConfig } from '../interfaces/station-config';
|
||||
import { HistoryEntry } from '../interfaces/history-entry';
|
||||
import { TeamMember } from '../interfaces/team-member';
|
||||
import { CommunityHighlight } from '../interfaces/community-highlight';
|
||||
import { ProgramService } from '../services/program.service';
|
||||
import { ShowService } from '../services/show.service';
|
||||
import { EventService } from '../services/event.service';
|
||||
import { TierService } from '../services/tier.service';
|
||||
@@ -19,7 +17,6 @@ import { StationConfigService } from '../services/station-config.service';
|
||||
import { HistoryEntryService } from '../services/history-entry.service';
|
||||
import { TeamMemberService } from '../services/team-member.service';
|
||||
import { CommunityHighlightService } from '../services/community-highlight.service';
|
||||
import { AdminProgramFormComponent } from './admin-program-form.component';
|
||||
import { AdminShowFormComponent } from './admin-show-form.component';
|
||||
import { AdminEventFormComponent } from './admin-event-form.component';
|
||||
import { AdminTierFormComponent } from './admin-tier-form.component';
|
||||
@@ -28,7 +25,7 @@ import { AdminHistoryFormComponent } from './admin-history-form.component';
|
||||
import { AdminTeamFormComponent } from './admin-team-form.component';
|
||||
import { AdminCommunityFormComponent } from './admin-community-form.component';
|
||||
|
||||
type TabKey = 'shows' | 'programs' | 'events' | 'tiers' | 'station' | 'history' | 'team' | 'community';
|
||||
type TabKey = 'shows' | 'events' | 'tiers' | 'station' | 'history' | 'team' | 'community';
|
||||
|
||||
@Component({
|
||||
selector: 'app-admin',
|
||||
@@ -38,7 +35,6 @@ type TabKey = 'shows' | 'programs' | 'events' | 'tiers' | 'station' | 'history'
|
||||
AsyncPipe,
|
||||
FormsModule,
|
||||
AdminShowFormComponent,
|
||||
AdminProgramFormComponent,
|
||||
AdminEventFormComponent,
|
||||
AdminTierFormComponent,
|
||||
AdminStationFormComponent,
|
||||
@@ -50,7 +46,6 @@ type TabKey = 'shows' | 'programs' | 'events' | 'tiers' | 'station' | 'history'
|
||||
styleUrl: './admin.component.scss',
|
||||
})
|
||||
export class AdminComponent implements OnInit {
|
||||
private programService = inject(ProgramService);
|
||||
private showService = inject(ShowService);
|
||||
private eventService = inject(EventService);
|
||||
private tierService = inject(TierService);
|
||||
@@ -63,7 +58,6 @@ export class AdminComponent implements OnInit {
|
||||
|
||||
/** Item currently being edited (set by editXxx, cleared on save/close). */
|
||||
editingShow: Show | null = null;
|
||||
editingProgram: Program | null = null;
|
||||
editingEvent: Event | null = null;
|
||||
editingTier: Tier | null = null;
|
||||
editingHistory: HistoryEntry | null = null;
|
||||
@@ -72,7 +66,6 @@ export class AdminComponent implements OnInit {
|
||||
|
||||
/** BehaviorSubjects guarantee change detection via the async pipe — start empty, populated on load. */
|
||||
readonly shows$ = new BehaviorSubject<Show[]>([]);
|
||||
readonly programs$ = new BehaviorSubject<Program[]>([]);
|
||||
readonly events$ = new BehaviorSubject<Event[]>([]);
|
||||
readonly tiers$ = new BehaviorSubject<Tier[]>([]);
|
||||
readonly stationConfig$ = new BehaviorSubject<StationConfig | null>(null);
|
||||
@@ -81,7 +74,6 @@ export class AdminComponent implements OnInit {
|
||||
readonly communityHighlights$ = new BehaviorSubject<CommunityHighlight[]>([]);
|
||||
|
||||
showShowForm = false;
|
||||
showProgramForm = false;
|
||||
showEventForm = false;
|
||||
showTierForm = false;
|
||||
showStationForm = false;
|
||||
@@ -98,11 +90,6 @@ export class AdminComponent implements OnInit {
|
||||
this.shows$.next(data);
|
||||
}
|
||||
|
||||
async reloadPrograms(): Promise<void> {
|
||||
const data = await firstValueFrom(this.programService.getPrograms());
|
||||
this.programs$.next(data);
|
||||
}
|
||||
|
||||
async reloadEvents(): Promise<void> {
|
||||
const data = await firstValueFrom(this.eventService.getEvents());
|
||||
this.events$.next(data);
|
||||
@@ -136,7 +123,6 @@ export class AdminComponent implements OnInit {
|
||||
async loadAll(): Promise<void> {
|
||||
await Promise.all([
|
||||
this.reloadShows(),
|
||||
this.reloadPrograms(),
|
||||
this.reloadEvents(),
|
||||
this.reloadTiers(),
|
||||
this.reloadStationConfig(),
|
||||
@@ -175,35 +161,6 @@ export class AdminComponent implements OnInit {
|
||||
await this.reloadShows();
|
||||
}
|
||||
|
||||
// ── Program CRUD ────────────────────────────────────────
|
||||
|
||||
openProgramForm(): void {
|
||||
this.editingProgram = null;
|
||||
this.showProgramForm = true;
|
||||
}
|
||||
|
||||
editProgram(program: Program): void {
|
||||
this.editingProgram = program;
|
||||
this.showProgramForm = true;
|
||||
}
|
||||
|
||||
onProgramSaved(): void {
|
||||
this.reloadPrograms();
|
||||
this.showProgramForm = false;
|
||||
this.editingProgram = null;
|
||||
}
|
||||
|
||||
onProgramClosed(): void {
|
||||
this.showProgramForm = false;
|
||||
this.editingProgram = null;
|
||||
}
|
||||
|
||||
async deleteProgram(id: number): Promise<void> {
|
||||
if (!confirm('Delete this program?')) return;
|
||||
await firstValueFrom(this.programService.deleteProgram(id));
|
||||
await this.reloadPrograms();
|
||||
}
|
||||
|
||||
// ── Event CRUD ──────────────────────────────────────────
|
||||
|
||||
openEventForm(): void {
|
||||
|
||||
Reference in New Issue
Block a user