fix: add missing icons and use Utils.showToast() for notifications

Icons:
- Add cloud-download, cloud-upload, and key icons

Notifications:
- Replace alert() with Utils.showToast() in companies.js
- Replace alert() with Utils.showToast() in content-pages.js
- Add noqa comment for intentional fallback in components.js

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-12 22:37:10 +01:00
parent 65f296e883
commit 4e8ea8151c
5 changed files with 22 additions and 8 deletions

View File

@@ -190,7 +190,7 @@ function adminCompanies() {
async deleteCompany(company) {
if (company.vendor_count > 0) {
companiesLog.warn('Cannot delete company with vendors');
alert(`Cannot delete "${company.name}" because it has ${company.vendor_count} vendor(s). Please delete or reassign the vendors first.`);
Utils.showToast(`Cannot delete "${company.name}" because it has ${company.vendor_count} vendor(s). Please delete or reassign the vendors first.`, 'warning');
return;
}
@@ -214,10 +214,10 @@ function adminCompanies() {
await this.loadCompanies();
await this.loadStats();
alert(`Company "${company.name}" deleted successfully`);
Utils.showToast(`Company "${company.name}" deleted successfully`, 'success');
} catch (error) {
companiesLog.error('Failed to delete company:', error);
alert(`Failed to delete company: ${error.message}`);
Utils.showToast(`Failed to delete company: ${error.message}`, 'error');
}
},

View File

@@ -557,7 +557,8 @@ function adminComponents() {
Utils.showToast(messages[type] || messages.info, type);
} else {
componentsLog.error('Utils.showToast not available');
alert(messages[type] || messages.info); // Fallback to alert
// noqa: JS-009 - Fallback for component showcase when Utils not loaded
alert(messages[type] || messages.info);
}
},

View File

@@ -130,7 +130,7 @@ function contentPagesManager() {
} catch (err) {
contentPagesLog.error('Error deleting page:', err);
alert(`Failed to delete page: ${err.message}`);
Utils.showToast(`Failed to delete page: ${err.message}`, 'error');
}
},

View File

@@ -28,9 +28,11 @@ function data() {
// Default state: Platform Administration open, others closed
const defaultSections = {
platformAdmin: true,
productCatalog: false,
contentMgmt: false,
devTools: false,
monitoring: false
monitoring: false,
settingsSection: false
};
function getSidebarSectionsFromStorage() {
@@ -60,7 +62,10 @@ function data() {
vendors: 'platformAdmin',
users: 'platformAdmin',
customers: 'platformAdmin',
marketplace: 'platformAdmin',
// Product Catalog
'marketplace-products': 'productCatalog',
'vendor-products': 'productCatalog',
marketplace: 'productCatalog',
// Content Management
'platform-homepage': 'contentMgmt',
'content-pages': 'contentMgmt',
@@ -72,7 +77,12 @@ function data() {
'code-quality': 'devTools',
// Platform Monitoring
imports: 'monitoring',
logs: 'monitoring'
logs: 'monitoring',
// Settings
settings: 'settingsSection',
profile: 'settingsSection',
'api-keys': 'settingsSection',
'notifications-settings': 'settingsSection'
};
return {