Skip to content

Beta to main#42

Open
remko48 wants to merge 201 commits intomainfrom
beta
Open

Beta to main#42
remko48 wants to merge 201 commits intomainfrom
beta

Conversation

@remko48
Copy link
Copy Markdown
Member

@remko48 remko48 commented Mar 31, 2026

No description provided.

rubenvdlinde and others added 30 commits March 3, 2026 10:21
- docs/integrations/i18n.md — explains the library's prop-based
  translation strategy (i18n-agnostic, no internal l10n calls),
  covers @nextcloud/l10n setup, l10n JSON file format, recommended
  i18n.js composable pattern, and a full per-component translatable
  props reference table
- docs/architecture/customization.md — covers all slot-based
  extension points for CnIndexPage: row action menu (actions prop
  + #row-actions slot), Actions dropdown (#action-items), mass
  actions (#mass-actions), header buttons (#header-actions), custom
  cell renderers (#column-{key}), form field overrides
  (#field-{key} / #before-fields / #after-fields), dialog
  replacements (#form-dialog / #delete-dialog), and composing
  sub-components directly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add documentation for every undocumented or partially-documented
customisation point found in the component analysis:

- Props reference tables (page header, layout, mass actions, columns,
  form fields) — covers show-title, icon, description, row-key,
  row-class, inline-action-count, show-view-toggle, add-label,
  show-mass-*, mass-action-name-field, export-formats, import-options
- Events reference table listing all 17 emitted events
- Card view customisation — #card, #card-badges, #card-actions slots
  and view-mode / show-view-toggle props
- Dynamic row styling via row-class prop with CSS example
- Two-phase dialog pattern — explain confirm → async work → setResult
  flow; document all 7 setXResult() methods and setValidationErrors()
- Programmatic dialog control via openFormDialog(null|row)
- Import dialog #import-fields slot with file scope variable
- Sidebar #search-extra and #columns-extra slot examples
- Inline-action-count examples (controlling overflow behaviour)
- CnDataTable and CnPagination direct-composition props tables
  including scrollable, page-size-options, min-items-to-show,
  page-info-format, and row-class on CnDataTable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New prop `defaultTab` (default: 'search-tab') — sets the active tab
  when the sidebar first opens. Accepts any NcAppSidebarTab id, both
  built-in ('search-tab', 'columns-tab') and custom.
- New slot `#tabs` — consumers inject additional NcAppSidebarTab
  components; use order ≥ 3 to place them after the built-ins.
- New event `tab-change` — emitted with the tab id whenever the user
  switches tabs, allowing the parent to persist the choice.
- Binds NcAppSidebar's :active prop and @update:active to track the
  currently open tab internally.
- Update cn-index-sidebar.md props/events/slots tables.
- Update customization.md with sidebar tabs section (default-tab,
  custom tabs via #tabs slot, per-tab content via #search-extra /
  #columns-extra).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds css/index.css at the package root so consumers can import
'@conduction/nextcloud-vue/css/index.css' when installed via npm.
Previously only src/css/index.css existed, causing ESLint import/no-unresolved
failures in procest and pipelinq CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ore integration

Adds a new string-first API to both composables that connects directly to
useObjectStore, eliminating ~150 LOC of boilerplate from every list view
and ~80 LOC from every detail view.

useListView(objectType, options?):
- Accepts objectType string + options: { sidebarState, defaultPageSize,
  defaultSort, debounceMs }
- Returns schema, objects, loading, pagination as computed refs from the
  store, plus onSearch (debounced), onSort, onFilterChange, onPageChange,
  onPageSizeChange, refresh
- Handles fetchSchema, fetchCollection, sidebar wiring, and cleanup
  automatically in onMounted / onBeforeUnmount
- Backward compatible: existing useListView(options) calls unchanged

useDetailView(objectType, id, options?):
- Accepts objectType + id (string or Ref) + options: { router,
  listRouteName, detailRouteName }
- Returns object, isNew, loading, saving, editing, showDeleteDialog,
  error, validationErrors, onSave, confirmDelete
- Handles fetch on mount, id-change watcher, create/update/delete with
  optional router navigation and 422 validation error unpacking
- Backward compatible: existing useDetailView(options) calls unchanged

Also rewrites the composables documentation to reflect the new API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and-code

fixed store to use baseUrl + updated docs to show defaults
- fetch tags
- delete multiple objects by type and id
Add `userIsAdmin` prop to CnIndexSidebar and CnFacetSidebar, and extend
`filtersFromSchema()` with `isAdmin` and `filterFn` options. Schema
properties with `adminOnly: true` are now hidden from non-admin users,
enabling role-based filter visibility without consumer-side logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
I also added a extra slot to be able to more accurately reproduce the original page layout.
todo:
- add this as an "add" option in the CnIndexPage
- test test test
fixed issues with table not being scrollable
todo:
- add this as an "add" option in the CnIndexPage
- test test test
…CnWidgetWrapper, CnWidgetRenderer, CnTileWidget) + useDashboardView composable + simplify filtersFromSchema
remko48 and others added 30 commits April 1, 2026 09:50
…es-page' into feature/ui-cleanup

# Conflicts:
#	docs/components/cn-tabbed-form-dialog.md
#	src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue
#	src/components/index.js
#	src/index.js
…h URLs

The default useObjectStore singleton was created with a raw URL path
('/apps/openregister/api/objects') instead of wrapping it with prefixUrl().
Similarly, fetchSchema() and fetchRegister() hardcoded their URLs without
prefixUrl(). On Nextcloud instances served via /index.php/, all these API
calls would 404 because the /index.php prefix was missing.

- Default store now uses prefixUrl(DEFAULT_BASE_URL)
- fetchSchema() and fetchRegister() now wrap URLs with prefixUrl()
CnDetailPage had watchers and a syncSidebarState() method that referenced
props (sidebar, sidebarOpen, objectType, objectId, subtitle, sidebarProps)
which were never declared. These watchers watched undefined values and the
sidebar integration via objectSidebarState inject was completely non-functional.

Added all missing props with safe defaults so the external sidebar
integration works correctly.
The delete operator on Pinia reactive state objects does not trigger Vue 2
reactivity. registerObjectType correctly used spread reassignment, but
unregisterObjectType used delete which silently failed to update the UI.

Replaced all delete operations with a spread-and-destructure pattern that
creates new objects, ensuring Vue 2 reactivity is properly triggered.
buildHeaders() accessed the global OC.requestToken without checking if OC
exists, causing a ReferenceError in test environments, SSR contexts, or
any non-Nextcloud runtime.

Added a typeof guard so the function returns an empty token gracefully
when OC is not available.
The new API path of useDetailView always used the default useObjectStore()
singleton, ignoring apps that use createObjectStore with a custom store ID.
This made useDetailView unusable for apps with custom stores.

Added options.objectStore support matching the pattern already used by
useListView, so consumers can pass their custom store factory.
The registerMapping plugin hardcoded '/apps/openregister/api/registers'
URLs in fetchRegisters() and fetchSchemasForRegister() without wrapping
them with prefixUrl(). This caused 404 errors on Nextcloud instances
served via /index.php/.
toggleSelectAll() emitted an empty array when deselecting, which wiped out
selections made on other pages. When selecting all, it only emitted the
current page's IDs, losing any previous cross-page selections.

Now deselect removes only current-page IDs, and select-all merges current
page IDs with the existing selection set.
The v-for on the card slot element had no :key binding. The inner
CnObjectCard had a key, but when consumers override the card slot, Vue 2
falls back to index-based keying which causes incorrect rendering on
reorder or removal.
init() is async but was called without await inside onMounted, causing
errors to become unhandled promise rejections that were silently swallowed.
The lifecycle plugin mutated objects in-place with direct property
assignment (this.objects[type][data.id] = data), which Vue 2 cannot
detect. Changed to spread pattern matching the rest of the store.
CnActionsBar, CnIcon, CnPageHeader were exported from
src/components/index.js but not re-exported from src/index.js, making
them inaccessible to consumers importing from the package root.

CnNoteCard was missing from both barrel files despite having a component
directory. Added all four to the export chain.
- Moved the capitalize() function from useObjectStore.js and
  createSubResourcePlugin.js (where it was duplicated) to utils/headers.js
  as a shared export. Both files now import it.

- Fixed search plugin fallback URL: when _options.baseUrl is falsy, the
  fallback '/apps/openregister/api/objects' was not wrapped in prefixUrl(),
  causing 404 on index.php installs.
Fixed criticals and 1 high.
…eview

fix: Code review fixes for store, components, and utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants