Add Final Assets folder viewing to Download workflow
New Features:
- Added 'Get Final Assets' button in Download (A1→A2) workflow
- View uploaded/localized assets in Final Assets folder
- Display metadata for final assets (same format as master assets)
- Shows asset name, ID, type, size, metadata model
Backend:
- Added get_final_assets action handler
- Loads assets from Final Assets folder (findUploadFolder)
- Uses same getAssetsFromFolder helper as Master Assets
Frontend:
- 'Get Final Assets (Uploaded)' button next to 'Get Master Assets'
- Final Assets list with expandable metadata
- Metadata display includes:
- Basic Info (name, type, size, model)
- Content Info (dimensions, format, etc.)
- Ferrero Fields (all custom metadata)
UI Styling:
- Green border-left for Final Assets (vs blue for Master)
- Same metadata extraction using MetadataExtractor
- Collapsible metadata view per asset
This allows users to verify uploaded assets and review their metadata.
🤖 Generated with Claude Code
This commit is contained in:
parent
bd9030c0ab
commit
ef5f45273f
1 changed files with 128 additions and 1 deletions
129
workflow_v3.php
129
workflow_v3.php
|
|
@ -426,6 +426,21 @@ if ($_POST && $testRunner) {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'get_final_assets':
|
||||
if (isset($results['selected_campaign'])) {
|
||||
$campaignId = $results['selected_campaign']['asset_id'];
|
||||
$finalFolderId = findUploadFolder($testRunner, $campaignId, $configV3);
|
||||
|
||||
if ($finalFolderId) {
|
||||
$results['final_assets_folder_id'] = $finalFolderId;
|
||||
$results['final_assets'] = getAssetsFromFolder($testRunner, $finalFolderId);
|
||||
$success = "Found Final Assets folder with " . count($results['final_assets']) . " assets";
|
||||
} else {
|
||||
$error = "Final Assets folder not found in campaign";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'download_asset':
|
||||
$assetId = $_POST['asset_id'] ?? '';
|
||||
$filename = $_POST['filename'] ?? '';
|
||||
|
|
@ -1989,11 +2004,17 @@ $envInfo = $configV3->getEnvironmentInfo();
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<form method="POST" style="margin-top: 20px;">
|
||||
<form method="POST" style="margin-top: 20px; display: inline-block; margin-right: 10px;">
|
||||
<input type="hidden" name="tab" value="download">
|
||||
<input type="hidden" name="action" value="get_master_assets">
|
||||
<button type="submit" class="btn btn-primary">Get Master Assets</button>
|
||||
</form>
|
||||
|
||||
<form method="POST" style="margin-top: 20px; display: inline-block;">
|
||||
<input type="hidden" name="tab" value="download">
|
||||
<input type="hidden" name="action" value="get_final_assets">
|
||||
<button type="submit" class="btn btn-success">Get Final Assets (Uploaded)</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($results['master_assets']) && !empty($results['master_assets'])): ?>
|
||||
|
|
@ -2169,6 +2190,112 @@ $envInfo = $configV3->getEnvironmentInfo();
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($results['final_assets']) && !empty($results['final_assets'])): ?>
|
||||
<h3 style="margin-top: 30px;">Final Assets / Uploaded Assets (<?= count($results['final_assets']) ?> files)</h3>
|
||||
<p style="color: #666; font-size: 14px; margin: 10px 0;">
|
||||
These are the localized/processed assets that have been uploaded back to the DAM.
|
||||
</p>
|
||||
|
||||
<div class="asset-list">
|
||||
<?php foreach ($results['final_assets'] as $index => $asset): ?>
|
||||
<?php
|
||||
$assetName = extractFolderName($asset);
|
||||
$assetId = $asset['asset_id'];
|
||||
$metadataId = 'final-metadata-' . $index;
|
||||
?>
|
||||
<div class="asset-item">
|
||||
<div class="asset-info">
|
||||
<strong><?= htmlspecialchars($assetName) ?></strong><br>
|
||||
<small>ID: <?= htmlspecialchars($assetId) ?></small><br>
|
||||
<small>Type: <?= htmlspecialchars($asset['mime_type'] ?? 'Unknown') ?></small>
|
||||
<?php if (isset($asset['file_size'])): ?>
|
||||
<small> | Size: <?= number_format($asset['file_size']) ?> bytes</small>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($asset['metadata_model_id'])): ?>
|
||||
<br><small style="color: #28a745;">✅ Model: <?= htmlspecialchars($asset['metadata_model_id']) ?></small>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="asset-actions">
|
||||
<button class="btn btn-secondary"
|
||||
onclick="toggleMetadata('<?= $metadataId ?>')">
|
||||
📋 View Metadata
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="<?= $metadataId ?>" class="metadata-display" style="display: none;">
|
||||
<?php
|
||||
$metadata = MetadataExtractor::extractAllMetadata($asset);
|
||||
if (!empty($metadata)):
|
||||
?>
|
||||
<div style="font-size: 13px;">
|
||||
<!-- Basic Info -->
|
||||
<?php if (isset($metadata['basic'])): ?>
|
||||
<div style="background: white; padding: 12px; margin: 8px 0; border-radius: 4px; border-left: 4px solid #28a745;">
|
||||
<strong>📋 Basic Info:</strong><br>
|
||||
<div style="margin-top: 8px; display: grid; grid-template-columns: 150px 1fr; gap: 5px;">
|
||||
<?php foreach ($metadata['basic'] as $key => $value): ?>
|
||||
<?php if ($value !== null): ?>
|
||||
<div style="color: #666;"><?= ucwords(str_replace('_', ' ', $key)) ?>:</div>
|
||||
<div><strong><?= htmlspecialchars($value) ?></strong></div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Content Info -->
|
||||
<?php if (isset($metadata['content'])): ?>
|
||||
<div style="background: white; padding: 12px; margin: 8px 0; border-radius: 4px; border-left: 4px solid #28a745;">
|
||||
<strong>📐 Content Info:</strong><br>
|
||||
<div style="margin-top: 8px; display: grid; grid-template-columns: 150px 1fr; gap: 5px;">
|
||||
<?php foreach ($metadata['content'] as $key => $value): ?>
|
||||
<?php if ($value !== null): ?>
|
||||
<div style="color: #666;"><?= ucwords(str_replace('_', ' ', $key)) ?>:</div>
|
||||
<div><strong><?= htmlspecialchars($value) ?></strong></div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Ferrero Fields -->
|
||||
<?php if (isset($metadata['ferrero_fields']) && !empty($metadata['ferrero_fields'])): ?>
|
||||
<details style="background: white; padding: 12px; margin: 8px 0; border-radius: 4px; border-left: 4px solid #667eea;">
|
||||
<summary style="cursor: pointer; font-weight: 600; color: #333;">🏷️ Ferrero Metadata Fields (<?= count($metadata['ferrero_fields']) ?>)</summary>
|
||||
<div style="margin-top: 8px;">
|
||||
<?php foreach ($metadata['ferrero_fields'] as $fieldName => $fieldData): ?>
|
||||
<div style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
||||
<div style="color: #667eea; font-weight: 600; font-size: 11px;">
|
||||
<?= htmlspecialchars($fieldData['id']) ?>
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: 150px 1fr; gap: 5px; margin-top: 4px;">
|
||||
<div style="color: #666;">Value:</div>
|
||||
<div>
|
||||
<strong>
|
||||
<?php
|
||||
if (is_array($fieldData['value'])) {
|
||||
echo htmlspecialchars(implode(', ', $fieldData['value']));
|
||||
} else {
|
||||
echo htmlspecialchars($fieldData['value']);
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</details>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<p>No metadata available for this asset</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($results['status_update_error'])): ?>
|
||||
<div class="alert alert-error" style="margin-top: 20px;">
|
||||
<strong>⚠️ Status Update Debug Information:</strong>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue