Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ See `examples/manifest-demo/manifest.json` for a fuller reference and `docs/migr
5. **Run `npm test` before submitting changes**
6. **CSS class prefix**: All classes use `cn-` prefix to avoid collisions
7. **Theming**: Use Nextcloud CSS variables only (`var(--color-primary-element)`, `var(--color-border)`, etc.). Do NOT reference `--nldesign-*` variables — the nldesign app overrides Nextcloud's own variables, so theming works automatically.
8. **Always update docs when you add, rename, or remove a prop, event, or slot** — edit `docs/components/cn-<component>.md` in the same change. The CI `check:docs` step (run via `npm run check:docs`) verifies both that a doc file exists AND that every SFC prop and named slot appears in it. Run it locally before committing to catch gaps.

## Adding New Components

Expand Down
14 changes: 3 additions & 11 deletions docs/components/cn-configuration-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,16 @@ Configuration card with title, actions, and status indicator. Used for feature t
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `title` | String | `''` | Card title |
| `description` | String | `''` | Card description |
| `status` | String | `null` | `'active'`, `'inactive'`, `'error'`, `'warning'` |
| `statusLabel` | String | `''` | Override status display text |
| `loading` | Boolean | `false` | Loading state |

## Events

| Event | Payload | Description |
|-------|---------|-------------|
| `action` | `actionName` | Action button clicked |

## Slots

| Slot | Description |
|------|-------------|
| `default` | Card content |
| `#actions` | Action buttons |
| `#icon` | Icon displayed in the card header |
| `#actions` | Action buttons in the card header |
| `#status` | Custom status indicator |
| `#footer` | Footer content below the card body |

## Usage

Expand Down
5 changes: 5 additions & 0 deletions docs/components/cn-detail-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ A generic detail/overview page component. The simpler counterpart to CnIndexPage
| `iconSize` | Number | `28` | Icon size in pixels |
| `loading` | Boolean | `false` | Loading state |
| `loadingLabel` | String | `'Loading...'` | Message shown during loading |
| `sidebar` | Boolean | `false` | Whether to activate the external `CnObjectSidebar` via the `objectSidebarState` inject |
| `sidebarOpen` | Boolean | `true` | Whether the sidebar starts open (only relevant when `sidebar` is `true`) |
| `objectType` | String | `''` | Object type slug passed to the sidebar (e.g. `'pipelinq_lead'`) |
| `objectId` | String\|Number | `''` | Object ID passed to the sidebar |
| `sidebarProps` | Object | `{}` | Extra sidebar configuration forwarded to `CnObjectSidebar` (`register`, `schema`, `hiddenTabs`, `title`, `subtitle`) |
| `error` | Boolean | `false` | Error state |
| `errorMessage` | String | `'An error occurred'` | Message shown in error state |
| `onRetry` | Function | `null` | Callback for retry button in error state. If null, no retry button shown. |
Expand Down
1 change: 1 addition & 0 deletions docs/components/cn-facet-sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Auto-generated faceted search sidebar from schema. Renders filter controls for p
| `loading` | Boolean | `false` | Loading state |
| `title` | String | `'Filters'` | Sidebar title |
| `clearLabel` | String | `'Clear all'` | Clear all button label |
| `userIsAdmin` | Boolean | `true` | Whether the current user is an admin. When `false`, schema properties with `adminOnly: true` are hidden from the filter list. |

## Events

Expand Down
2 changes: 2 additions & 0 deletions docs/components/cn-index-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The main list page component. Combines a data table (or card grid), filter bar,
|------|------|---------|-------------|
| `title` | String | *(required)* | Page title |
| `description` | String | `''` | Optional subtitle |
| `showTitle` | Boolean | `false` | Show the page header (icon, title, description) inline above the table. When `false` (default), the title is shown in the sidebar header instead. |
| `icon` | String | `''` | MDI icon name for the page header. Defaults to `schema.icon` when a schema is provided. |
| `schema` | Object | `null` | OpenRegister schema for auto-generating columns, filters, and form fields |
| `objects` | Array | `[]` | Row data |
| `pagination` | Object | `null` | Pagination state (`\{ currentPage, totalPages, totalItems, pageSize \}`) |
Expand Down
1 change: 1 addition & 0 deletions docs/components/cn-index-sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ When using `CnIndexPage`, the sidebar is managed internally — you do not need
| `filtersLabel` | String | `'Filters'` | Heading above the filter controls |
| `columnsHeading` | String | `'Column Visibility'` | Heading inside the Columns tab |
| `columnsDescription` | String | `'Select which columns to display in the table'` | Subtitle inside the Columns tab |
| `userIsAdmin` | Boolean | `true` | Whether the current user is an admin. When `false`, schema properties with `adminOnly: true` are hidden from the filter list in the Search tab. |

### Events

Expand Down
6 changes: 5 additions & 1 deletion docs/components/cn-mass-copy-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ Two-phase mass copy dialog with naming pattern. Allows users to define a naming
| `dialogTitle` | String | `'Copy items'` | |
| `patternLabel` | String | `'Naming pattern'` | |
| `patternPlaceholder` | String | `'\{name\} (copy)'` | |
| `confirmLabel` | String | `'Copy'` | |
| `emptyText` | String | `'No items selected for copying.'` | Message shown when all items have been removed from the list |
| `successText` | String | `'Items successfully copied.'` | Message shown in the result phase on success |
| `cancelLabel` | String | `'Cancel'` | |
| `closeLabel` | String | `'Close'` | Label for the close button shown in the result phase |
| `confirmLabel` | String | `'Copy'` | |
| `removeLabel` | String | `'Remove from list'` | Tooltip/label for the per-item remove button |

## Events

Expand Down
8 changes: 6 additions & 2 deletions docs/components/cn-mass-delete-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ Two-phase mass delete confirmation dialog. Shows list of items to delete, requir
| `nameField` | String | `'title'` | Field to display as item name |
| `nameFormatter` | Function | `null` | Optional function `(item) => string` to format item names. Overrides `nameField` when provided. |
| `dialogTitle` | String | `'Delete items'` | |
| `warningText` | String | `''` | Warning message |
| `confirmLabel` | String | `'Delete'` | |
| `warningText` | String | `''` | Warning text shown above the item list |
| `emptyText` | String | `'No items selected for deletion.'` | Message shown when all items have been removed from the list |
| `successText` | String | `'Items successfully deleted.'` | Message shown in the result phase on success |
| `cancelLabel` | String | `'Cancel'` | |
| `closeLabel` | String | `'Close'` | Label for the close button shown in the result phase |
| `confirmLabel` | String | `'Delete'` | |
| `removeLabel` | String | `'Remove from list'` | Tooltip/label for the per-item remove button |

## Events

Expand Down
12 changes: 8 additions & 4 deletions docs/components/cn-mass-export-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ Export format selection dialog. Lets users pick a format and triggers export for

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `items` | Array | `[]` | Items to export |
| `formats` | Array | `['json', 'csv']` | Available export formats |
| `dialogTitle` | String | `'Export items'` | |
| `confirmLabel` | String | `'Export'` | |
| `dialogTitle` | String | `'Export objects'` | |
| `description` | String | `''` | Optional description text shown above the format selector |
| `formats` | Array | `[{ id: 'excel', label: 'Excel (.xlsx)' }, { id: 'csv', label: 'CSV (.csv)' }]` | Available export formats as `[{ id, label }]` objects |
| `defaultFormat` | String | `'excel'` | ID of the format selected by default |
| `successText` | String | `'Export completed successfully.'` | Message shown in the result phase on success |
| `formatLabel` | String | `'Export format'` | Label above the format selector |
| `cancelLabel` | String | `'Cancel'` | |
| `closeLabel` | String | `'Close'` | Label for the close button shown in the result phase |
| `confirmLabel` | String | `'Export'` | |

## Events

Expand Down
24 changes: 19 additions & 5 deletions docs/components/cn-mass-import-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,26 @@ File upload dialog with options and results summary. Supports importing data fro

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `dialogTitle` | String | `'Import items'` | |
| `acceptedTypes` | String | `'.json,.csv'` | Accepted file types |
| `options` | Array | `[]` | Additional import options |
| `confirmLabel` | String | `'Import'` | |
| `dialogTitle` | String | `'Import data'` | |
| `acceptedTypes` | String | `'.json,.xlsx,.xls,.csv'` | Accepted file types (input `accept` attribute) |
| `options` | Array | `[]` | Additional import option definitions |
| `fileTypeHelp` | Array | `[{ label, description }]` | Help entries shown in the "Supported file types" list; defaults to JSON, Excel, and CSV entries |
| `canSubmit` | Boolean | `true` | Whether the form is ready to submit. The parent can set this to `false` (via a slot) while required options are incomplete. |
| `successText` | String | `'Import completed successfully!'` | Message shown in the result phase when all rows imported without errors |
| `partialSuccessText` | String | `'Import completed with errors. Check the details below.'` | Message shown when the import finished but with some errors |
| `loadingText` | String | `'Importing data — this may take a moment for large files...'` | Text shown while the import is running |
| `summaryTitle` | String | `'Import summary'` | Heading above the result summary table |
| `supportedFormatsLabel` | String | `'Supported file types:'` | Label above the file type help list |
| `selectFileLabel` | String | `'Select file'` | Label for the file-picker button |
| `cancelLabel` | String | `'Cancel'` | |
| `maxFileSize` | Number | `10485760` | Max file size in bytes (10MB default) |
| `closeLabel` | String | `'Close'` | Label for the close button shown in the result phase |
| `confirmLabel` | String | `'Import'` | |
| `sheetLabel` | String | `'Sheet'` | Column header for the sheet name in the summary table |
| `foundLabel` | String | `'Found'` | Column header for the found-rows count |
| `createdLabel` | String | `'Created'` | Column header for the created-rows count |
| `updatedLabel` | String | `'Updated'` | Column header for the updated-rows count |
| `unchangedLabel` | String | `'Unchanged'` | Column header for the unchanged-rows count |
| `errorsLabel` | String | `'Errors'` | Column header for the error count |

## Events

Expand Down
1 change: 1 addition & 0 deletions docs/components/cn-object-sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Right sidebar for entity detail pages. Provides standardized tabs — Files, Not
| `open` | Boolean | | `true` | Whether the sidebar is visible |
| `title` | String | | `''` | Sidebar title (defaults to `objectType`) |
| `subtitle` | String | | `''` | Sidebar subtitle |
| `subtitleProp` | String | | `''` | **Deprecated** — use `subtitle` instead |
| `apiBase` | String | | `'/apps/openregister/api'` | Base URL for OpenRegister API calls |
| `filesLabel` | String | | `'Files'` | Files tab label |
| `notesLabel` | String | | `'Notes'` | Notes tab label |
Expand Down
61 changes: 40 additions & 21 deletions docs/components/cn-register-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,64 @@ sidebar_position: 27

# CnRegisterMapping

OpenRegister register/schema configuration panel. Allows admin users to map app object types to OpenRegister registers and schemas.
OpenRegister register/schema configuration panel. Lets admin users map app object types to OpenRegister registers and schemas. Groups related object types together, shows a register dropdown (with auto-schema-matching), and a save/reimport action area.

**Wraps**: NcSelect, NcNoteCard, NcButton, NcLoadingIcon
**Wraps**: NcSelect, NcNoteCard, NcButton, NcLoadingIcon (via CnSettingsSection)

![CnRegisterMapping showing register and schema dropdowns for each entity type](/img/screenshots/cn-register-mapping.png)

![CnRegisterMapping showing source, register, and schema dropdowns for each entity type](/img/screenshots/cn-register-mapping.png)

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `objectTypes` | Object | `\{\}` | Map of `\{ typeSlug: \{ source, register, schema \} \}` |
| `registers` | Array | `[]` | Available registers |
| `schemas` | Array | `[]` | Available schemas |
| `sources` | Array | `[]` | Available sources |
| `loading` | Boolean | `false` | Loading state |
| `saving` | Boolean | `false` | Save in progress |
| `groups` | Array | *(required)* | Groups of object types that share a register. Each group: `{ name, description?, registerConfigKey?, types: [{ slug, label, description?, configKey? }] }` |
| `name` | String | `'Register configuration'` | Section title |
| `description` | String | `'Configure OpenRegister schema mappings for your object types'` | Section description |
| `docUrl` | String | `''` | Documentation URL — shows an info icon next to the title |
| `configuration` | Object | `{}` | Current configuration values keyed by config key: `{ register: '5', client_schema: '28', ... }` |
| `showSaveButton` | Boolean | `true` | Whether to show the Save button |
| `saving` | Boolean | `false` | Whether a save is in progress |
| `showReimportButton` | Boolean | `false` | Whether to show the Re-import button |
| `reimporting` | Boolean | `false` | Whether a reimport is in progress |
| `saveButtonText` | String | `'Save configuration'` | Save button label |
| `reimportButtonText` | String | `'Re-import configuration'` | Re-import button label |
| `autoMatch` | Boolean | `true` | When a register is selected, automatically match schema titles to object type slugs |
| `labels` | Object | `{ register, schema, configured, notConfigured, noSchemas, selectRegister, selectSchema, allConfigured, partiallyConfigured }` | Override UI strings (all default to translated English) |

## Events

| Event | Payload | Description |
|-------|---------|-------------|
| `save` | `mappings` | Save mappings object |
| `refresh` | — | Refresh registers/schemas list |
| `auto-detect` | — | Auto-detect schemas from register |
| `update:configuration` | `configuration` | Emitted when any register or schema selection changes (use with `.sync` or `v-model`) |
| `save` | — | Save button clicked |
| `reimport` | — | Re-import button clicked |

## Slots

| Slot | Description |
|------|-------------|
| `#actions` | Extra action buttons rendered alongside Save/Re-import |
| `#group-header` | Custom header content for each group (scoped: `{ group }`) |
| `#footer` | Footer content below the configuration section |

## Usage

```vue
<CnRegisterMapping
:object-types="settings.objectTypes"
:registers="registers"
:schemas="schemas"
:sources="sources"
:loading="loading"
:groups="[
{
name: 'Client management',
registerConfigKey: 'client_register',
types: [
{ slug: 'client', label: 'Clients', configKey: 'client_schema' },
{ slug: 'contact', label: 'Contacts', configKey: 'contact_schema' },
],
},
]"
:configuration="settings"
:saving="saving"
@save="onSaveMappings"
@refresh="fetchRegisters" />
@update:configuration="settings = $event"
@save="onSave" />
```

This component is typically used in the admin settings page of an app to let administrators configure which OpenRegister registers and schemas map to each entity type in the app.
This component is typically used in the admin settings page of an app to let administrators configure which OpenRegister registers and schemas map to each entity type.
1 change: 1 addition & 0 deletions docs/components/cn-schema-form-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ These props feed external data into the form. The component never fetches data o
| `userGroups` | `Array` | `[]` | User groups for the Security (RBAC) tab. Each entry should have `{ id, displayname }`. The groups `admin` and `public` are automatically filtered out from this list since they have dedicated rows. Groups are sorted alphabetically by display name. When empty, only the built-in `public`, `user`, and `admin` rows are shown. |
| `availableTags` | `Array` | `[]` | Tags available for the file property tag configuration. Array of strings (e.g. `['image', 'document', 'audio']`). Used in the property detail panel when a property has `type: 'file'` to configure allowed file tags. When empty, the tag selector shows no options. |
| `loadingGroups` | `Boolean` | `false` | Whether user groups are still being loaded by the parent. When `true`, the Security tab shows a loading indicator instead of the RBAC table. Set this to `true` while fetching groups, then `false` once `userGroups` is populated. |
| `inheritedProperties` | `Object` | `{}` | Properties inherited from parent schemas (allOf). Displayed as locked, non-editable rows in the Properties tab so the user can see the full property surface including inherited fields. |
| `objectCount` | `Number` | `0` | Number of objects currently attached to this schema. Used for two purposes: (1) the "Delete Objects" and "Publish Objects" buttons are disabled when `objectCount === 0` (nothing to act on), and (2) the "Delete" (schema) button is disabled when `objectCount > 0` (cannot delete a schema with attached objects). |

### Action button visibility props
Expand Down
6 changes: 3 additions & 3 deletions docs/components/cn-settings-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Collapsible card for organizing settings into sections. Used in admin settings p
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `title` | String | `''` | Card title |
| `description` | String | `''` | Card description |
| `collapsed` | Boolean | `false` | Initial collapsed state |
| `collapsible` | Boolean | `true` | Allow collapsing |
| `icon` | String | `''` | Emoji or text icon displayed before the title |
| `collapsible` | Boolean | `false` | Allow collapsing the card |
| `defaultCollapsed` | Boolean | `false` | Whether the card starts in a collapsed state (only relevant when `collapsible` is `true`) |

## Events

Expand Down
38 changes: 20 additions & 18 deletions docs/components/cn-settings-section.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,39 @@ Admin settings section with loading and error states. Wraps NcSettingsSection wi

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `title` | String | `''` | Section title |
| `description` | String | `''` | Section description |
| `loading` | Boolean | `false` | Loading state |
| `error` | String | `null` | Error message to display |
| `saveLabel` | String | `'Save'` | Save button label |
| `saving` | Boolean | `false` | Save in progress |

## Events

| Event | Payload | Description |
|-------|---------|-------------|
| `save` | — | Save button clicked |
| `retry` | — | Retry button clicked (on error) |
| `name` | String | *(required)* | Section title (passed to `NcSettingsSection`) |
| `description` | String | `''` | Brief section description shown under the title |
| `detailedDescription` | String | `''` | Longer description rendered in a separate block below the title |
| `docUrl` | String | `''` | Documentation URL — shows an info icon link next to the title |
| `loading` | Boolean | `false` | Loading state — shows a loading indicator instead of content |
| `loadingMessage` | String | `'Loading...'` | Message shown during loading |
| `error` | Boolean | `false` | Error state — shows an error card with optional retry button |
| `errorMessage` | String | `'An error occurred'` | Message shown in error state |
| `onRetry` | Function | `null` | Callback for the retry button. When `null`, no retry button is shown. |
| `retryButtonText` | String | `'Retry'` | Label for the retry button |
| `empty` | Boolean | `false` | Empty state — shows an empty message instead of content |
| `emptyMessage` | String | `'No data available'` | Message shown when the section has no data |

## Slots

| Slot | Description |
|------|-------------|
| `default` | Section content |
| `#actions` | Extra action buttons |
| `#description` | Custom description content (replaces `description` prop) |
| `#footer` | Footer content rendered below the section body |
| `#empty` | Custom empty state (replaces the default empty message) |

## Usage

```vue
<CnSettingsSection
title="API Configuration"
name="API Configuration"
description="Configure the external API connection"
:loading="loading"
:error="error"
:saving="saving"
@save="onSave"
@retry="fetchSettings">
:error="hasError"
error-message="Could not load settings"
:on-retry="fetchSettings">
<NcTextField label="API URL" v-model="apiUrl" />
<NcTextField label="API Key" v-model="apiKey" type="password" />
</CnSettingsSection>
Expand Down
Loading
Loading