myCRM/assets/js/router.js
olli 77ce2c3043 refactor: Move billing module assets to vendor package
BREAKING CHANGE: All billing-related frontend code moved to billing module

Changes:
- Remove billing Vue components from core (InvoiceForm, InvoiceManagement, etc.)
- Remove billing config from core (billing_module.yaml)
- Update router.js to dynamically load billing routes from module
- Update Dashboard.vue to dynamically load InvoicesDashboardWidget
- Add webpack alias '@billing-module' pointing to vendor/mycrm/billing-module
- Billing module is now fully self-contained

The billing module now exports:
- routes.js: Route definitions for /billing/* paths
- components.js: Reusable components (InvoicesDashboardWidget)
- index.js: Main module exports

Frontend assets are loaded via '@billing-module' alias in webpack.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 15:13:30 +01:00

39 lines
1.7 KiB
JavaScript

import { createRouter, createWebHistory } from 'vue-router';
import Dashboard from './views/Dashboard.vue';
import ContactManagement from './views/ContactManagement.vue';
import ProjectManagement from './views/ProjectManagement.vue';
import ProjectTaskManagement from './views/ProjectTaskManagement.vue';
import ProjectStatusManagement from './views/ProjectStatusManagement.vue';
import UserManagement from './views/UserManagement.vue';
import RoleManagement from './views/RoleManagement.vue';
import SettingsManagement from './views/SettingsManagement.vue';
// Import Billing Module Routes
let billingRoutes = [];
try {
const billingModule = require('@billing-module/assets/js/routes.js');
billingRoutes = billingModule.default || [];
} catch (e) {
console.warn('Billing module not available:', e.message);
}
const routes = [
{ path: '/', name: 'dashboard', component: Dashboard },
{ path: '/contacts', name: 'contacts', component: ContactManagement },
{ path: '/projects', name: 'projects', component: ProjectManagement },
{ path: '/project-tasks', name: 'project-tasks', component: ProjectTaskManagement },
{ path: '/project-statuses', name: 'project-statuses', component: ProjectStatusManagement, meta: { requiresAdmin: true } },
{ path: '/users', name: 'users', component: UserManagement, meta: { requiresAdmin: true } },
{ path: '/roles', name: 'roles', component: RoleManagement, meta: { requiresAdmin: true } },
{ path: '/settings', name: 'settings', component: SettingsManagement, meta: { requiresAdmin: true } },
// Dynamically loaded module routes
...billingRoutes,
];
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;