Skip to content

Commit 63e980d

Browse files
committed
Enhance Step 5 confirmation review, preserve selected steps, and add missing translations
1 parent 835287b commit 63e980d

4 files changed

Lines changed: 92 additions & 2 deletions

File tree

‎acp/main_module.php‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,16 @@ protected function handle_wizard()
747747
]);
748748
}
749749

750+
// Assign selected steps list for Step 5 confirmation & hidden inputs
751+
foreach ($selected_steps as $k)
752+
{
753+
$template->assign_block_vars('selected_steps_list', [
754+
'KEY' => $k,
755+
'LABEL' => $step_labels[$k] ?? ucfirst(str_replace('_', ' ', $k)),
756+
'COUNT' => $counts_map[$k] ?? 0,
757+
]);
758+
}
759+
750760
// Step 5 Submit: Start Run
751761
if ($step === 5 && $submit)
752762
{
@@ -790,6 +800,8 @@ protected function handle_wizard()
790800
'TARGET_POSTS' => $target_posts,
791801
'TARGET_NOT_EMPTY' => $target_not_empty,
792802
'SOURCE_SYSTEM' => $source_system,
803+
'SOURCE_SYSTEM_NAME' => ($source_system === 'xenforo' ? 'XenForo 2.x' : ($source_system === 'vbulletin' ? 'vBulletin' : ($source_system === 'mybb' ? 'MyBB' : ($source_system === 'smf' ? 'SMF' : ucfirst($source_system))))),
804+
'SELECTED_STEPS_COUNT' => count($selected_steps),
793805
'SOURCE_PATH' => $source_path,
794806
'DB_HOST' => $db_host,
795807
'DB_PORT' => $db_port,

‎adm/style/migrationcenter_main.html‎

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,13 +1503,75 @@ <h4 style="margin: 0 0 14px 0; font-size: 15px; font-weight: 700; color: var(--m
15031503
<input type="hidden" name="lock_timeout" value="{LOCK_TIMEOUT}" />
15041504
<input type="hidden" name="preserve_ids" value="{PRESERVE_IDS}" />
15051505
<input type="hidden" name="dry_run" value="{DRY_RUN}" />
1506+
<!-- BEGIN selected_steps_list -->
1507+
<input type="hidden" name="steps[]" value="{selected_steps_list.KEY}" />
1508+
<!-- END selected_steps_list -->
1509+
1510+
<!-- IF START_ERROR -->
1511+
<div class="mc-alert mc-alert-danger" style="margin-bottom: 16px;">
1512+
<strong>{L_ERROR}:</strong> {START_ERROR}
1513+
</div>
1514+
<!-- ENDIF -->
1515+
15061516
<div class="mc-plan-card">
1507-
<h3 style="margin: 0 0 14px 0; font-size: 17px; font-weight: 700; color: var(--mc-text);">{L_WIZARD_STEP_5_TITLE}</h3>
1517+
<h3 style="margin: 0 0 6px 0; font-size: 17px; font-weight: 700; color: var(--mc-text);">{L_WIZARD_STEP_5_TITLE}</h3>
15081518
<p style="font-size: 13px; color: var(--mc-text-muted); margin-bottom: 20px;">{L_CONFIRMATION_EXPLAIN}</p>
15091519

1520+
<!-- Summary Cards Grid -->
1521+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px;">
1522+
<!-- Card 1: Source & Database -->
1523+
<div class="mc-kpi-card" style="padding: 16px;">
1524+
<h4 style="margin: 0 0 12px 0; font-size: 14px; font-weight: 700; color: var(--mc-primary); border-bottom: 1px solid var(--mc-border-subtle); padding-bottom: 6px;">
1525+
{L_MIGRATION_SUMMARY_SOURCE}
1526+
</h4>
1527+
<div style="font-size: 13px; line-height: 1.9;">
1528+
<div><strong>{L_SOURCE_SYSTEM}:</strong> <span class="status-badge status-ready">{SOURCE_SYSTEM_NAME}</span></div>
1529+
<div><strong>{L_DB_NAME}:</strong> <code>{DB_NAME}</code></div>
1530+
<div><strong>{L_DB_HOST}:</strong> <code>{DB_HOST}:{DB_PORT}</code></div>
1531+
<div><strong>{L_DB_PREFIX}:</strong> <code>{DB_PREFIX}</code></div>
1532+
<!-- IF SOURCE_PATH -->
1533+
<div style="word-break: break-all;"><strong>{L_SOURCE_PATH}:</strong> <code style="font-size: 11px;">{SOURCE_PATH}</code></div>
1534+
<!-- ENDIF -->
1535+
</div>
1536+
</div>
1537+
1538+
<!-- Card 2: Execution Parameters -->
1539+
<div class="mc-kpi-card" style="padding: 16px;">
1540+
<h4 style="margin: 0 0 12px 0; font-size: 14px; font-weight: 700; color: var(--mc-primary); border-bottom: 1px solid var(--mc-border-subtle); padding-bottom: 6px;">
1541+
{L_MIGRATION_SUMMARY_CONFIG}
1542+
</h4>
1543+
<div style="font-size: 13px; line-height: 1.9;">
1544+
<div><strong>{L_DEFAULT_BATCH_SIZE}:</strong> <span class="status-badge status-ready">{BATCH_SIZE} {L_RECORDS}</span></div>
1545+
<div><strong>{L_WORKER_LOCK_TIMEOUT}:</strong> {LOCK_TIMEOUT}s</div>
1546+
<div><strong>{L_PRESERVE_IDS}:</strong> <!-- IF PRESERVE_IDS --><span class="status-badge status-completed">{L_YES}</span><!-- ELSE --><span class="status-badge status-neutral">{L_NO}</span><!-- ENDIF --></div>
1547+
<div><strong>{L_DRY_RUN}:</strong> <!-- IF DRY_RUN --><span class="status-badge status-warning">{L_YES}</span><!-- ELSE --><span class="status-badge status-completed">{L_NO}</span><!-- ENDIF --></div>
1548+
</div>
1549+
</div>
1550+
1551+
<!-- Card 3: Selected Stages Overview -->
1552+
<div class="mc-kpi-card" style="padding: 16px;">
1553+
<h4 style="margin: 0 0 12px 0; font-size: 14px; font-weight: 700; color: var(--mc-primary); border-bottom: 1px solid var(--mc-border-subtle); padding-bottom: 6px;">
1554+
{L_MIGRATION_SUMMARY_CONTENT} ({SELECTED_STEPS_COUNT})
1555+
</h4>
1556+
<div style="display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; padding: 2px;">
1557+
<!-- BEGIN selected_steps_list -->
1558+
<span class="status-badge status-ready" style="font-size: 11px; padding: 3px 8px;">
1559+
{selected_steps_list.LABEL} <!-- IF selected_steps_list.COUNT > 0 -->({selected_steps_list.COUNT})<!-- ENDIF -->
1560+
</span>
1561+
<!-- END selected_steps_list -->
1562+
</div>
1563+
</div>
1564+
</div>
1565+
1566+
<!-- Safety Note Banner -->
1567+
<div class="mc-alert mc-alert-info" style="margin-bottom: 20px; display: flex; align-items: center; gap: 10px; background: rgba(59, 130, 246, 0.08); border-left: 4px solid var(--mc-primary); padding: 12px 16px; border-radius: 4px;">
1568+
<span style="font-size: 18px;">ℹ️</span>
1569+
<span style="font-size: 13px; color: var(--mc-text);">{L_MIGRATION_SAFE_NOTE}</span>
1570+
</div>
1571+
15101572
<div class="mc-unified-toolbar">
15111573
<a href="{U_WIZARD_ACTION}&amp;step=4" class="mc-btn mc-btn-secondary">{L_BACK}</a>
1512-
<button type="submit" name="submit" class="mc-btn mc-btn-success" style="font-size: 14px; padding: 10px 24px;">{L_CREATE_MIGRATION_PLAN} &raquo;</button>
1574+
<button type="submit" name="submit" class="mc-btn mc-btn-success" style="font-size: 14px; padding: 10px 24px; font-weight: 700;">{L_CREATE_MIGRATION_PLAN} &raquo;</button>
15131575
</div>
15141576
</div>
15151577
</form>

‎language/en/migrationcenter.php‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,19 @@
372372
'DRY_RUN_EXPLAIN' => 'Simulate migration and validate all records without writing to target database.',
373373

374374
'WIZARD_STEP_5_TITLE' => 'Step 5: Confirmation & Execution',
375+
'CONFIRMATION_EXPLAIN' => 'Please review your migration configuration below. Once you click "Create Migration Plan", the migration pipeline will be initialized and you will be directed to the live execution dashboard.',
376+
'CREATE_MIGRATION_PLAN' => 'Create Migration Plan',
375377
'MIGRATION_SUMMARY' => 'Migration Summary',
378+
'MIGRATION_SUMMARY_SOURCE' => 'Source Platform & Database',
379+
'MIGRATION_SUMMARY_CONTENT' => 'Selected Content Stages',
380+
'MIGRATION_SUMMARY_CONFIG' => 'Execution Parameters',
381+
'MIGRATION_SAFE_NOTE' => 'Safe Migration: The source database will only be read (read-only mode) and will not be altered in any way.',
382+
'DB_HOST' => 'Database Host',
383+
'DB_PORT' => 'Database Port',
384+
'DB_NAME' => 'Database Name',
385+
'DB_USER' => 'Database User',
386+
'DB_PASSWORD' => 'Database Password',
387+
'DB_PREFIX' => 'Table Prefix',
376388
'CLI_RECOMMENDED' => 'Recommended CLI Command',
377389
'CLI_RECOMMENDED_EXPLAIN' => 'For large forums, running the migration via CLI in the terminal avoids web timeouts and provides maximum performance.',
378390
'START_MIGRATION' => 'Start Migration',

‎language/fa/migrationcenter.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@
477477
'POSTS' => 'پست‌ها',
478478
'CONFIRMATION_EXPLAIN' => 'پیکربندی خود را بررسی کرده و برای ادامه روی دکمه ایجاد برنامه مهاجرت کلیک کنید.',
479479
'CREATE_MIGRATION_PLAN' => 'ایجاد برنامه مهاجرت',
480+
'MIGRATION_SUMMARY_SOURCE' => 'مشخصات پلتفرم و دیتابیس مبدأ',
481+
'MIGRATION_SUMMARY_CONTENT' => 'مراحل و محتوای انتخاب‌شده',
482+
'MIGRATION_SUMMARY_CONFIG' => 'تنظیمات اجرایی',
483+
'MIGRATION_SAFE_NOTE' => 'مهاجرت ایمن: دیتابیس منبع کاملاً به صورت فقط‌خواندنی (Read-Only) خوانده می‌شود و هیچ تغییری در آن ایجاد نخواهد شد.',
480484
'RATE' => 'نرخ پردازش',
481485
'ETA' => 'زمان تخمینی باقیمانده',
482486
'BACK_TO_OVERVIEW' => 'بازگشت به نمای کلی',

0 commit comments

Comments
 (0)