This repository was archived by the owner on Aug 4, 2026. It is now read-only.
fix(part-2): wire register slug→id + auto-fetch index pages - #3
Merged
Conversation
Part 2 of the DeskDesk tutorial wires the empty Part 1 shell to real
data via OpenRegister + the @conduction/nextcloud-vue manifest renderer.
Schemas (lib/Settings/deskdesk_register.json):
- floor label + building + planImage
- desk label + floor (relation) + zone + equipment[] + capacity +
accessibility + photo + notes
- booking desk (relation) + user + start + end + purpose + status +
recurrence
Plus a components.registers.deskdesk block + 5 desk / 2 floor / 3
booking seed objects so the app is demoable on first install.
Manifest (src/manifest.json):
- Three top-level menu entries (Desks / Bookings / Floors), order 10/20/30
- Pages for index + detail of each schema, dispatched by CnPageRenderer
by matching $route.name === page.id
- dependencies: ['openregister'] so CnAppRoot's dependency-check phase
fires when OpenRegister is missing
Frontend:
- src/App.vue is now ~10 lines: <CnAppRoot :app-id :manifest />
- src/router/index.js generates routes from manifest.pages, all pointing
at CnPageRenderer. No hand-rolled views.
- Deleted: navigation/MainMenu.vue, views/Dashboard.vue, views/items/*,
views/settings/UserSettings.vue, views/settings/Settings.vue. Replaced
by the manifest renderer.
- src/store/store.js registers all three schemas with the shared object
store on boot.
Backend:
- SettingsService::loadConfiguration() now uses
ConfigurationService::importFromFilePath() with the path resolved
relative to /var/www/html (\OC::$SERVERROOT). The previous call was
using the wrong importFromApp() signature.
Known follow-ups (not blockers for the tutorial):
- The settings API still returns the register *slug* in `register`;
CnIndexPage's store needs the numeric id. Wire that resolution in a
follow-up so the index pages list seed data without a manual step.
- Translation keys (deskdesk.menu.desks etc.) need l10n entries; for
now they render as raw keys.
Closes the Part 2 known follow-up: CnIndexPage now lists the seed
data without manual intervention.
Three changes, in order of dependency:
1. SettingsService::resolveRegisterIds() resolves the deskdesk register
slug and the floor / desk / booking schema slugs to numeric ids via
the OpenRegister mappers, exposing them on /api/settings as
`registerId`, `registerSlug`, and `schemaIds`. The frontend store
now uses `config.registerId` instead of the slug fallback.
2. New IndexPageWrapper.vue: a thin manifest-aware wrapper that uses
useListView() against the configured schema and triggers refresh()
in mounted(). Registered as the `index` pageType in App.vue via
the cnPageTypes inject, so every manifest page with
`type: "index"` auto-fetches. The wrapper imports useObjectStore
from src/store/store.js (our local store with id 'object') rather
than the library's default — the library's useObjectStore returns
a separate Pinia instance with id 'conduction-objects' which has
no registered types.
3. main.js now awaits initializeStores() before $mount('#content'),
so the manifest-driven IndexPageWrapper finds the object-store
types registered when its mounted() hook fires. Without this, the
wrapper races initializeStores and CnIndexPage shows "No items
found" on first paint.
Verified locally:
- /api/settings returns { registerId: 925, schemaIds: { floor: 1629,
desk: 1630, booking: 1631 }, ... }
- /apps/deskdesk/ shows all 4 seed desks in the index table with
schema-driven columns (label / floor / zone / equipment / capacity
/ accessibility) — confirmed via Playwright (page text:
"Showing 4 of 4 ... 2-West-04 west ... 3-Central-Meeting central
... 3-East-12 east ... 3-East-13 east").
Contributor
Quality Report — ConductionNL/deskdesk @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ❌ | ❌ | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-05-10 21:22 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the known follow-up from #2: CnIndexPage now lists the seed data without manual intervention. Three coordinated changes:
1. Backend resolves slug→id
`SettingsService::resolveRegisterIds()` looks up the deskdesk register slug and the floor/desk/booking schema slugs via OpenRegister's RegisterMapper / SchemaMapper, exposing them on `/api/settings` as `registerId`, `registerSlug`, and `schemaIds`. Frontend can register object types with the real numeric id.
2. New IndexPageWrapper for the index pageType
Library default `index` pageType maps straight to CnIndexPage which doesn't fetch. The wrapper:
Wired in App.vue:
```js
const pageTypes = { ...defaultPageTypes, index: IndexPageWrapper }
```
3. Bootstrap order in main.js
`initializeStores()` now resolves before `$mount('#content')`. Without this, IndexPageWrapper races the store init and CnIndexPage shows "No items found" on first paint.
Verified
```
registerId: 925, schemaIds: { floor: 1629, desk: 1630, booking: 1631 }
```
```
Showing 4 of 4
2-West-04 west
3-Central-Meeting central
3-East-12 east
3-East-13 east
```
Note on the wrapper
This wrapper is intentionally tiny. Once the library wires the auto-fetch into the default `index` pageType, this file can go away — the manifest is the single source of truth as it should be. The library issue is worth filing as a follow-up so consuming apps stop having to write the same wrapper.
Generated with Claude Code