fix: use PlatformSettings for pagination in Letzshop page
- Load rows per page from PlatformSettings in init() - Apply setting to ordersLimit, exceptionsLimit, productsLimit, jobsPagination - Replace alert() with Utils.showToast() for error display - Improve viewJobErrors to show errors in modal instead of alert - Update architecture validator to catch non-standard pagination patterns (jobsPagination, ordersLimit, etc.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,16 @@ function adminMarketplaceLetzshop() {
|
||||
}
|
||||
window._marketplaceLetzshopInitialized = true;
|
||||
|
||||
// Load platform settings for pagination
|
||||
if (window.PlatformSettings) {
|
||||
const rowsPerPage = await window.PlatformSettings.getRowsPerPage();
|
||||
this.ordersLimit = rowsPerPage;
|
||||
this.exceptionsLimit = rowsPerPage;
|
||||
this.productsLimit = rowsPerPage;
|
||||
this.jobsPagination.per_page = rowsPerPage;
|
||||
marketplaceLetzshopLog.info('Loaded rows per page setting:', rowsPerPage);
|
||||
}
|
||||
|
||||
// Initialize Tom Select after a short delay to ensure DOM is ready
|
||||
this.$nextTick(() => {
|
||||
this.initTomSelect();
|
||||
@@ -1466,26 +1476,32 @@ function adminMarketplaceLetzshop() {
|
||||
* View job errors
|
||||
*/
|
||||
async viewJobErrors(job) {
|
||||
if (job.type !== 'import') return;
|
||||
if (job.type !== 'import' && job.type !== 'historical_import') return;
|
||||
|
||||
try {
|
||||
const response = await apiClient.get(`/admin/marketplace-import-jobs/${job.id}/errors`);
|
||||
const errors = response.errors || [];
|
||||
const endpoint = job.type === 'import'
|
||||
? `/admin/marketplace-import-jobs/${job.id}/errors`
|
||||
: `/admin/letzshop/historical-imports/${job.id}`;
|
||||
|
||||
if (errors.length === 0) {
|
||||
alert('No error details available');
|
||||
return;
|
||||
const response = await apiClient.get(endpoint);
|
||||
|
||||
if (job.type === 'import') {
|
||||
const errors = response.errors || [];
|
||||
if (errors.length === 0) {
|
||||
Utils.showToast('No error details available', 'info');
|
||||
return;
|
||||
}
|
||||
// Store errors and show in job details modal
|
||||
this.selectedJobDetails = { ...job, errors: errors.slice(0, 20) };
|
||||
this.showJobDetailsModal = true;
|
||||
} else {
|
||||
// Historical import - show job details
|
||||
this.selectedJobDetails = { ...job, ...response };
|
||||
this.showJobDetailsModal = true;
|
||||
}
|
||||
|
||||
// Show errors in alert for now
|
||||
const errorText = errors.slice(0, 10).map(e =>
|
||||
`Row ${e.row_number}: ${e.error_message}`
|
||||
).join('\n');
|
||||
|
||||
alert(`Import Errors (showing first 10):\n\n${errorText}`);
|
||||
} catch (error) {
|
||||
marketplaceLetzshopLog.error('Failed to load job errors:', error);
|
||||
this.error = 'Failed to load error details';
|
||||
Utils.showToast('Failed to load error details', 'error');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user