Skip to content

feat(advanced-template-management): implement spec (#153)#186

Draft
rubenvdlinde wants to merge 4 commits into
developmentfrom
feature/153/advanced-template-management
Draft

feat(advanced-template-management): implement spec (#153)#186
rubenvdlinde wants to merge 4 commits into
developmentfrom
feature/153/advanced-template-management

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Closes #153

Summary

Auto-generated draft PR for OpenSpec change advanced-template-management.
The Hydra builder ran the spec but could not run gh pr create itself
(Phase D+E credential strip — Claude has no GH_TOKEN by design).
The entrypoint detected commits on the feature branch with no PR and
created this draft so the reviewer + security + applier can proceed.

Spec Reference

Commits on this branch

Files changed

  • lib/Settings/docudesk_register.json
  • openspec/changes/advanced-template-management/design.md
  • openspec/changes/advanced-template-management/tasks.md
  • src/dialogs/ConditionalSectionDialog.vue
  • src/dialogs/MergeFieldDialog.vue
  • src/views/templates/TemplateDetail.vue
  • src/views/templates/TemplateIndex.vue
  • task-audit.json
  • tests/bootstrap-standalone.php
  • tests/stubs/OpenRegisterStubs.php
  • tests/unit/Service/TemplatePreviewServiceTest.php
  • tests/unit/Service/TemplateVersionServiceTest.php

PR auto-created by Hydra builder entrypoint (hydra_ensure_pr_exists)
because Claude's session closed without running gh pr create.
Reviewer + applier follow as normal.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/docudesk @ 9008825

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 108/108
npm
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-18 19:16 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
Copy link
Copy Markdown
Contributor Author

Code Review — Juan Claude van Damme

Result: PASS (5 fixed, 0 blocking unfixed, 2 security advisories → Clyde)


Fixes applied

File Issue Fix
appinfo/info.xml Merge conflict (PR 0.0.34-unstable.8 vs origin/development 0.0.33) Kept PR version — feature branch version bump
src/dialogs/ConditionalSectionDialog.vue:10 vue/attribute-hyphenation:inputLabel must be :input-label ESLint auto-fix
src/views/templates/TemplateIndex.vue:14,106 vue/attribute-hyphenation + comma-dangle ESLint auto-fix
src/views/templates/TemplateDetail.vue:346,366,397 comma-dangle — missing trailing commas in multi-line function calls ESLint auto-fix
src/dialogs/MergeFieldDialog.vue:9 vue/no-parsing-error — Jinja2 {{ fieldName }} placeholder inside a Vue mustache expression {{ t(...) }} confused eslint-plugin-vue's template parser Moved string to computed property insertHint

Security advisories → Clyde

src/views/templates/TemplateDetail.vue:138,176vue/no-v-html (×2). The v-html directive is intentional here (template preview renders HTML content). Security reviewer to verify that previewHtml and editorHtml are sanitized before display.


Checks skipped (environment)

composer check:strict and composer test:unit — phpcs/psalm/phpstan/phpunit not installed in the reviewer container. Per CLAUDE.md, builder Rule 0b ran these in the authoritative environment before dispatch. All 14 hydra gates green.

npm test e2e suite — Playwright environment not configured in reviewer container (pre-existing); jest unit tests (navigation.spec.ts) pass 3/3.


Advisories

MCP coverage (advisory) — This app does not yet publish an IMcpToolProvider and has no opt-out recorded in openspec/project.md. Per ADR-035, consider whether this PR's new template management surface (TemplateDetail, TemplateIndex views) should be MCP-callable. If yes, file a follow-up issue. If the app should opt out, add an ## MCP coverage block to project.md in a follow-up PR.


🤖 Changes Juan Claude van Damme applied

View full diff · 8 files changed, 119 insertions(+), 7 deletions(-)

@rubenvdlinde
Copy link
Copy Markdown
Contributor Author

📍 appinfo/info.xml:32 (outside PR diff — line-comment API rejected, posted as issue comment)

[fixed: merge conflict resolved] Kept PR branch version 0.0.34-unstable.8 — this is the feature branch's intended version bump. origin/development had 0.0.33.

:placeholder="t('docudesk', 'e.g. zaaktype')" />
<NcSelect v-model="condOp"
:options="opOptions"
:input-label="t('docudesk', 'Operator')" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[fixed: vue/attribute-hyphenation] :inputLabel:input-label — Vue attribute binding names must be hyphenated per ESLint rule.

Comment thread src/dialogs/MergeFieldDialog.vue Outdated
:label="t('docudesk', 'Field name')"
:placeholder="t('docudesk', 'e.g. name, address, date')" />
<p class="merge-field-dialog__hint">
{{ insertHint }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[fixed: vue/no-parsing-error] The Jinja2 placeholder {{ fieldName }} inside a Vue template mustache expression {{ t(..., '… {{ fieldName }} …', ...) }} caused eslint-plugin-vue's parser to see a nested expression start. Moved the string-building to a computed property insertHint — template now reads {{ insertHint }} which is clean.

contenteditable="true"
:aria-label="t('docudesk', 'Template content')"
@input="syncFromEditor"
v-html="editorHtml" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[unfixed: SUGGESTION — security escalated to Clyde] vue/no-v-html: v-html on previewHtml can enable XSS if the content is not sanitized. Template preview rendering requires HTML output — security reviewer to confirm sanitization.

<!-- eslint-disable-next-line vue/no-v-html -->
<div v-else-if="previewHtml"
class="template-detail__preview-output"
v-html="previewHtml" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[unfixed: SUGGESTION — security escalated to Clyde] vue/no-v-html: v-html on editorHtml binding. Security reviewer to verify source and sanitization of this value.

try {
this.previewHtml = await this.templateStore.previewTemplate(
this.form.content,
sampleData,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[fixed: comma-dangle] Added missing trailing commas in multi-line function call arguments at lines 346, 366, and 397 per ESLint comma-dangle rule.

<NcSelect v-model="selectedCategory"
:options="categoryOptions"
:placeholder="t('docudesk', 'Filter by category')"
:input-label="t('docudesk', 'Category filter')"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[fixed: vue/attribute-hyphenation + comma-dangle] :inputLabel:input-label; added missing trailing comma at line 106.

Al Gorithm and others added 2 commits May 19, 2026 05:10
…gories, locking (#153)

Implements advanced template management features across backend (already implemented)
and frontend: full WYSIWYG editor, category/tag filtering, version history, conditional
section UI, edit locking, and preview. Adds templateVersion schema to register and
comprehensive unit tests for TemplateVersionService and TemplatePreviewService.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/docudesk @ 33fe648

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 108/108
npm ✅ 529/529
PHPUnit
Newman ⏭️
Playwright ⏭️

Coverage: 0% (0/10 statements)


Quality workflow — 2026-05-19 03:10 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
Copy link
Copy Markdown
Contributor Author

Security Review — Clyde Barcode

Result: PASS (1 fixed, 0 unfixed blocking)

  • Total findings: 1
  • Fixed: 1 (WARNING — DOM XSS via unescaped attribute values in insertConditionalSection)
  • Unfixed: 0
  • Verdict: pass

Fix applied

[fixed: HTML attribute escaping in insertConditionalSection] src/views/templates/TemplateDetail.vue:412 — user-controlled field, op, value were interpolated raw into an HTML string passed to execCommand('insertHTML'). Added inline esc() helper encoding &, ", <, >. Semgrep self-verify clean post-fix.

Out-of-scope inherited debt (informational, non-blocking)

npm audit: 59 CVEs (13 low, 37 moderate, 9 high) in Vue 2 ecosystem transitive deps (axios, fast-uri, fast-xml-builder, ajv). Not introduced by this PR — pre-existed on development. Recommend a dedicated dep-bump PR; fast-xml-builder has an npm audit fix available.

See inline comments for per-finding detail.


🤖 Changes Clyde Barcode applied

  • f4f6ccc — fix(security-review bounded): Clyde post-run mechanical commit

View full diff · 1 file changed, 4 insertions(+), 3 deletions(-)

document.execCommand('insertText', false, token)
this.syncFromEditor()
},
insertConditionalSection({ field, op, value }) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[fixed: HTML attribute escaping] Rule: OWASP A03:2021 / CWE-79 — user-controlled field, op, value were interpolated directly into HTML attribute strings passed to document.execCommand('insertHTML'). A value containing " breaks attribute context; event handlers inject DOM XSS persisted in the template content. Fixed by adding an inline esc() helper that encodes &, ", <, > before interpolation. Semgrep self-verify passed post-fix.

@rubenvdlinde rubenvdlinde force-pushed the feature/153/advanced-template-management branch from f4f6ccc to b292df4 Compare May 19, 2026 03:15
rubenvdlinde added a commit that referenced this pull request May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/docudesk @ 229fef8

Check PHP Vue Security License Tests
lint ⏭️
phpcs ⏭️
phpmd ⏭️
psalm ⏭️
phpstan ⏭️
phpmetrics ⏭️
eslint ⏭️
stylelint ⏭️
composer ⏭️ ⏭️
npm ⏭️ ⏭️
PHPUnit
Newman
Playwright

Quality workflow — 2026-05-19 03:19 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/docudesk @ a9c6c4f

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 108/108
npm ✅ 529/529
PHPUnit
Newman ⏭️
Playwright ⏭️

Coverage: 0% (0/10 statements)


Quality workflow — 2026-05-19 03:24 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/docudesk @ 7d6b7d5

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 108/108
npm ✅ 529/529
PHPUnit
Newman ⏭️
Playwright ⏭️

Coverage: 0% (0/10 statements)


Quality workflow — 2026-05-19 04:04 UTC

Download the full PDF report from the workflow artifacts.

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.

1 participant