Commit graph

3 commits

Author SHA1 Message Date
DJP
156f9ae51d Fix status updates and enhance workflow with proper error handling
Major improvements to workflow_v3.php and supporting classes:

**Status Updates (A1→A2, A2→A3, A5→A6):**
- Fix StatusManager to use correct PATCH endpoint: /v6/folders/{id}
- Add lock_strategy=optimistic parameter to prevent locking errors
- Update request body structure to use edited_folder format
- Status updates now working correctly

**Status Field Extraction:**
- Fix CampaignFormatter to extract CONTENT.SCALING.STATUS field
- Handle domain values with field_value.value path
- Now correctly filters campaigns by status (A1, A2, A5, etc.)

**Error Handling:**
- Extract and display actual API error messages
- Show HTTP status codes in all error messages
- Add expandable debug panels with full API responses
- Enhanced upload error reporting with detailed diagnostics

**Campaign Search:**
- Update to use Postman collection requests directly (avoids 503 errors)
- Fix URL encoding (rawurlencode instead of urlencode)
- Add comprehensive debug output showing OAuth status and API responses
- Search now attempts Postman request first, falls back to manual query

**Upload Improvements:**
- Rewrite AssetUploader to use native PHP CURLFile for multipart uploads
- Add support for additional file types: .mov, .mp4, .avi, .zip, .txt, .doc, .xlsx
- Increase max upload size to 100MB for video files
- Simplify asset_representation to minimal structure
- Add infrastructure to inherit metadata from master assets

**Testing Features:**
- Add "Reset to A1" button for testing workflow iterations
- Add debug mode to view all campaigns and their metadata
- Show Content Scaling Status on all campaign cards
- Display filtering debug info (total vs filtered counts)

**UI Improvements:**
- Rename buttons to clarify "Content Scaling Status" terminology
- Add status badges to campaign cards showing current status
- Better visual feedback for successful/failed operations

Current Status: Workflow A1→A2 fully working. Upload A2→A3 ready for testing
once DAM server recovers from HTTP 503 errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 16:43:09 -04:00
DJP
633c5a525e Fix workflow V3: metadata display and download error handling
Fixes:
- Metadata button now works (fixed JavaScript and element IDs)
- Display full metadata as JSON when clicked
- Detect and show proper error when files don't exist in storage
- Show detailed download error messages (HTTP 500, file not found)
- Display download success/failure with file size and path
- Use old working Postman collection with OAuth2 configured
- Update StatusManager to use working search pattern + status filter

Changes:
- Switch to Content Scaling Flow.postman_collection_Oliver(New).json
- Fix downloadAsset to detect JSON error responses
- Improve metadata display with toggle functionality
- Show clear error messages for missing files in DAM storage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 15:13:01 -04:00
DJP
a179be5da8 Add Workflow V3 with status-based campaign management
New Features:
- ConfigV3 class with test/production environment switching
- StatusManager for campaign status updates (A1→A2→A3, A5→A6)
- workflow_v3.php with tabbed interface for different workflows
- Auto-refreshing OAuth2 token (60-second buffer before expiry)
- Download workflow: Load A1 campaigns → Download master assets → Update to A2
- Metadata display for all assets
- Configurable base URLs for certificate auth and IP filtering

Status Workflow:
- A1: Ready for localization → Download assets → A2
- A2: Assets sent to agency → Upload processed → A3 (coming soon)
- A5: Rework needed → Download rework assets → A6 (coming soon)

Technical:
- Uses Content Scaling Flow V3.postman_collection.json
- Supports multiple environments (test/production)
- Session-based workflow state management
- Master Assets folder always "01. Master Assets"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 15:00:21 -04:00