| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (event === 'sent-to-queue' && data.field) { |
| | | const fieldName = data.field.config.name; |
| | | const itemId = data.field.config.itemID; |
| | | if (itemId && fieldName && this.changes.has(itemId)) { |
| | | delete this.changes.get(itemId)[fieldName]; |
| | | } |
| | | // Also clear from IndexedDB store |
| | | this.changesStore.get(itemId).then(stored => { |
| | | if (stored && stored[fieldName] !== undefined) { |
| | | delete stored[fieldName]; |
| | | this.changesStore.save(stored); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | initModals() { |
| | |
| | | && data.status === 'completed') { |
| | | this.store.clearCache(); |
| | | } |
| | | console.log('CRUD.js queue subscription'); |
| | | console.log(event, data); |
| | | |
| | | |
| | | if (event === 'operation-status' |
| | | && data.status === 'completed' |
| | | && data.endpoint === 'uploads/groups') { |
| | | console.log('Grouped Uploads completed'); |
| | | if (data.result && data.result.group_mappings) { |
| | | this.handleGroupMappings(data.result.group_mappings); |
| | | } |
| | | console.log('Cleared local cache. Refresh to see changes'); |
| | | this.store.clearCache(); |
| | | } |
| | | if (event === 'operation-status' |
| | | && data.status === 'completed' |
| | | && data.type === 'content_update') { |
| | | console.log('Cleared local cache. Refresh to see changes'); |
| | | this.store.clearCache(); |
| | | |
| | | // Check for result data (from ContentExecutor) |
| | |
| | | await this.handleBackup(); |
| | | } |
| | | const changes = await this.changesStore.getAll(); |
| | | console.log('Saving Changes: ', changes); |
| | | if (changes.length === 0) return; |
| | | |
| | | if (title === '') { |
| | |
| | | let uploader = window.jvbUploads; |
| | | let field = uploader.fields.get(fieldId); |
| | | |
| | | |
| | | console.log(posts); |
| | | console.log(field); |
| | | |
| | | let added = []; |
| | | posts.forEach(post => { |
| | | const placeholderPost = { |
| | |
| | | } |
| | | |
| | | handleGroupMappings(mappings) { |
| | | console.log('[CRUD] Applying group mappings:', mappings); |
| | | // mappings = { "group_abc123": 456, "group_def456": 789 } |
| | | |
| | | for (const [groupId, postId] of Object.entries(mappings)) { |