Some ignored filles was missing
This commit is contained in:
parent
7db22245e2
commit
fd5ab6bc0d
268 changed files with 31970 additions and 4 deletions
62
wwwroot/js/repositories/MockEventRepository.js
Normal file
62
wwwroot/js/repositories/MockEventRepository.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* MockEventRepository - Loads event data from local JSON file (LEGACY)
|
||||
*
|
||||
* This repository implementation fetches mock event data from a static JSON file.
|
||||
* DEPRECATED: Use IndexedDBEventRepository for offline-first functionality.
|
||||
*
|
||||
* Data Source: data/mock-events.json
|
||||
*
|
||||
* NOTE: Create/Update/Delete operations are not supported - throws errors.
|
||||
* This is intentional to encourage migration to IndexedDBEventRepository.
|
||||
*/
|
||||
export class MockEventRepository {
|
||||
constructor() {
|
||||
this.dataUrl = 'data/mock-events.json';
|
||||
}
|
||||
async loadEvents() {
|
||||
try {
|
||||
const response = await fetch(this.dataUrl);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to load mock events: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
const rawData = await response.json();
|
||||
return this.processCalendarData(rawData);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Failed to load event data:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* NOT SUPPORTED - MockEventRepository is read-only
|
||||
* Use IndexedDBEventRepository instead
|
||||
*/
|
||||
async createEvent(event, source) {
|
||||
throw new Error('MockEventRepository does not support createEvent. Use IndexedDBEventRepository instead.');
|
||||
}
|
||||
/**
|
||||
* NOT SUPPORTED - MockEventRepository is read-only
|
||||
* Use IndexedDBEventRepository instead
|
||||
*/
|
||||
async updateEvent(id, updates, source) {
|
||||
throw new Error('MockEventRepository does not support updateEvent. Use IndexedDBEventRepository instead.');
|
||||
}
|
||||
/**
|
||||
* NOT SUPPORTED - MockEventRepository is read-only
|
||||
* Use IndexedDBEventRepository instead
|
||||
*/
|
||||
async deleteEvent(id, source) {
|
||||
throw new Error('MockEventRepository does not support deleteEvent. Use IndexedDBEventRepository instead.');
|
||||
}
|
||||
processCalendarData(data) {
|
||||
return data.map((event) => ({
|
||||
...event,
|
||||
start: new Date(event.start),
|
||||
end: new Date(event.end),
|
||||
type: event.type,
|
||||
allDay: event.allDay || false,
|
||||
syncStatus: 'synced'
|
||||
}));
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=MockEventRepository.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue