Commit possible fixes for build
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# Issue #124: Nav sidebar clicks don't navigate between views
|
||||
|
||||
## Summary
|
||||
|
||||
The `NcAppNavigationItem` components in `App.vue` use `@click` handlers to call `router.push()`,
|
||||
but the component internally renders an `<a href="#">` that intercepts the click event, navigating
|
||||
to `#` (root hash) before the Vue click handler fires. The fix is to use `NcAppNavigationItem`'s
|
||||
built-in `:to` prop which renders the element as a `<router-link>`, handling navigation natively.
|
||||
|
||||
## Plan
|
||||
|
||||
### Step 1: Modify `src/App.vue` navigation items
|
||||
|
||||
For each `NcAppNavigationItem`:
|
||||
1. Replace `@click="navigate('routeName')"` with `:to="{ name: 'routeName' }"`
|
||||
2. Remove the `:active` binding since `NcAppNavigationItem` auto-detects active state from `:to`
|
||||
3. Keep icon template slots unchanged
|
||||
|
||||
### Step 2: Remove the `navigate()` function and `useRouter` import
|
||||
|
||||
Since navigation is now handled by the `:to` prop:
|
||||
- Remove `const router = useRouter()`
|
||||
- Remove the `navigate()` function
|
||||
- Remove `useRouter` from the import (keep `useRoute` since `currentRoute` still needs it)
|
||||
|
||||
### Step 3: Keep `currentRoute` if needed, OR remove
|
||||
|
||||
Actually, with `:to` prop, `NcAppNavigationItem` automatically sets active state. But for routes
|
||||
like `member-detail` that should highlight "Mitglieder", we need the `:active` prop for parent
|
||||
route matching. The `:to` prop only auto-activates on exact route match.
|
||||
|
||||
**Decision**: Keep `:active` bindings for nav items that have sub-routes (Mitglieder, Familien, Lager)
|
||||
to handle parent-route highlighting. For items with no sub-routes (Beiträge, Berichte, Audit-Log,
|
||||
Einstellungen), `:to` auto-active is sufficient — but for consistency, keep all `:active` bindings.
|
||||
|
||||
Actually, let me reconsider: the `:to` prop with vue-router uses `router-link-active` class which
|
||||
matches prefix. So `/members/5` would still match `{ name: 'members' }` route... but only if
|
||||
the path matches. Since named routes have exact paths, it depends on `router-link` behavior.
|
||||
|
||||
**Safest approach**: Keep `:active` bindings for items with child routes, remove them for simple routes.
|
||||
No -- for consistency and zero regression risk, keep ALL `:active` bindings.
|
||||
|
||||
### Step 4: Verify build compiles
|
||||
|
||||
Run `npm run build` to ensure no errors.
|
||||
|
||||
## Acceptance Criteria Checklist
|
||||
|
||||
1. [ ] Each `NcAppNavigationItem` uses `:to` prop with the correct route object
|
||||
2. [ ] No `@click="navigate(...)"` handlers remain on navigation items
|
||||
3. [ ] The `navigate()` function is removed
|
||||
4. [ ] The `useRouter` import is removed (no longer needed)
|
||||
5. [ ] `:active` bindings are preserved for parent-route highlighting
|
||||
6. [ ] Build succeeds without errors
|
||||
7. [ ] All existing routes still work (no route names changed)
|
||||
@@ -0,0 +1,72 @@
|
||||
# Plan: Issue #18 — Set up DB migrations for members table
|
||||
|
||||
## Summary
|
||||
|
||||
Create a Nextcloud OCP migration class that sets up the `oc_mv_members` table with all columns specified in the issue and requirements section 5.2. The migration follows Nextcloud's migration framework using `\OCP\Migration\SimpleMigrationStep` and Doctrine DBAL schema. Foreign key columns for `stufe_id` and `family_id` are created as nullable integer columns (FK constraints will be added when those tables are created in issues #30 and #27 respectively).
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### Step 1: Create Migration Class
|
||||
|
||||
- File: `lib/Migration/Version000001Date20260407000000.php`
|
||||
- Namespace: `OCA\Mitgliederverwaltung\Migration`
|
||||
- Extends: `SimpleMigrationStep`
|
||||
- Method: `changeSchema(IOutput $output, Closure $schemaClosure, array $options)`
|
||||
|
||||
### Step 2: Define Table Schema — `oc_mv_members`
|
||||
|
||||
Columns (from issue #18 specification):
|
||||
|
||||
| Column | Type | Constraints |
|
||||
|--------|------|------------|
|
||||
| `id` | bigint | PK, autoincrement, unsigned |
|
||||
| `vorname` | string(255) | NOT NULL |
|
||||
| `nachname` | string(255) | NOT NULL |
|
||||
| `geburtsdatum` | date | NOT NULL |
|
||||
| `geschlecht` | string(20) | nullable |
|
||||
| `rolle` | string(30) | NOT NULL, default 'mitglied' |
|
||||
| `stufe_id` | bigint | nullable, unsigned (FK to oc_mv_stufen, added later) |
|
||||
| `eintritt` | date | NOT NULL |
|
||||
| `austritt` | date | nullable |
|
||||
| `status` | string(20) | NOT NULL, default 'aktiv' |
|
||||
| `allergien_encrypted` | text | nullable |
|
||||
| `notizen` | text | nullable |
|
||||
| `zusatz_notizen` | text | nullable |
|
||||
| `kv_typ` | string(20) | nullable |
|
||||
| `kv_name` | string(255) | nullable |
|
||||
| `family_id` | bigint | nullable, unsigned (FK to oc_mv_families, added later) |
|
||||
| `frozen_fee_rate` | decimal(10,2) | nullable |
|
||||
| `calendar_event_uri` | string(512) | nullable |
|
||||
| `contact_vcard_uri` | string(512) | nullable |
|
||||
| `created_at` | datetime | NOT NULL, default CURRENT_TIMESTAMP |
|
||||
| `updated_at` | datetime | NOT NULL, default CURRENT_TIMESTAMP |
|
||||
| `deleted_at` | datetime | nullable |
|
||||
|
||||
### Step 3: Add Indexes
|
||||
|
||||
- Index on `status` (frequent filtering)
|
||||
- Index on `family_id` (joins)
|
||||
- Index on `stufe_id` (joins)
|
||||
- Index on `nachname` (sorting/searching)
|
||||
- Index on `deleted_at` (soft-delete queries)
|
||||
- Composite index on `status, deleted_at` (common query pattern: active non-deleted members)
|
||||
|
||||
### Step 4: Verify Migration Structure
|
||||
|
||||
- Ensure the class is properly namespaced and autoloadable via PSR-4
|
||||
- Ensure the table name uses Nextcloud's table prefix convention (just use `mv_members` — Nextcloud adds `oc_` prefix)
|
||||
|
||||
## Acceptance Criteria Checklist
|
||||
|
||||
1. [ ] Migration file exists at `lib/Migration/Version000001Date20260407000000.php`
|
||||
2. [ ] Class extends `SimpleMigrationStep` and implements `changeSchema`
|
||||
3. [ ] Table `mv_members` is created with all 20 columns from the spec
|
||||
4. [ ] Column types match the specification (string for enums, bigint for FKs, decimal for fee rate, etc.)
|
||||
5. [ ] `id` is primary key, autoincrement, unsigned bigint
|
||||
6. [ ] NOT NULL constraints applied to: vorname, nachname, geburtsdatum, rolle, eintritt, status, created_at, updated_at
|
||||
7. [ ] Nullable columns: geschlecht, stufe_id, austritt, allergien_encrypted, notizen, zusatz_notizen, kv_typ, kv_name, family_id, frozen_fee_rate, calendar_event_uri, contact_vcard_uri, deleted_at
|
||||
8. [ ] Default values set for: rolle='mitglied', status='aktiv'
|
||||
9. [ ] Appropriate indexes are created
|
||||
10. [ ] PHP syntax is valid (no parse errors)
|
||||
11. [ ] File follows Nextcloud migration conventions (namespace, class name pattern)
|
||||
12. [ ] Migration is idempotent (checks if table exists before creating)
|
||||
Reference in New Issue
Block a user