Skip to content

feat: 5308 add Rich Text field type for schema forms - #6777

Merged
Pyatakov merged 25 commits into
developfrom
feat/5308-enhance-guardian-UI-form-to-support-rich-text
Sep 11, 2026
Merged

feat: 5308 add Rich Text field type for schema forms#6777
Pyatakov merged 25 commits into
developfrom
feat/5308-enhance-guardian-UI-form-to-support-rich-text

Conversation

@ihar-tsykala

@ihar-tsykala ihar-tsykala commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description:

Every text field in a Guardian schema was plain text. An author writing instructions into a form had no way to mark a heading, emphasise a warning, or link to an external page: everything arrived as one flat paragraph, which readers misread.

Add a Rich Text field type. In the schema it is an ordinary string field carrying customType: 'richText', so the value stays a plain JSON string and nothing downstream needs a new data type. It is stored as Markdown, which travels safely to Hedera and stays readable on its own. A policy form shows a small editor instead of a textarea — bold, italic, both list kinds, H1–H3 and links — and the document viewer, the documents grid and the Indexer render that Markdown as formatted output, with links opening in a new tab. Pasted content is reduced to the same set, so a copy from a word processor cannot bring fonts, tables or images into a document. The type is registered in the field-type picker and the Excel dictionary, and preset values use the same editor.

Underline is deliberately absent: Markdown cannot store it, and raw HTML is not mixed into the value. Nothing changes for a field without that custom type, and stored values are never rewritten.

Fixes #5308

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@ihar-tsykala
ihar-tsykala requested a review from Pyatakov August 26, 2026 13:53
@ihar-tsykala ihar-tsykala self-assigned this Aug 26, 2026
@ihar-tsykala
ihar-tsykala requested review from a team as code owners August 26, 2026 13:53
@ihar-tsykala
ihar-tsykala marked this pull request as draft August 26, 2026 13:54
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

Test Results

 33 files  ±0   66 suites  ±0   4m 33s ⏱️ +23s
 35 tests ±0   35 ✅ ±0  0 💤 ±0  0 ❌ ±0 
173 runs  ±0  173 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 161602c. ± Comparison against base commit b398d6c.

♻️ This comment has been updated with latest results.

@ihar-tsykala
ihar-tsykala marked this pull request as ready for review August 28, 2026 09:20
…nd empty grid cells

Signed-off-by: Ihar Tsykala <ihar.tsykala@hashgraph.com>
@ihar-tsykala
ihar-tsykala marked this pull request as draft September 1, 2026 12:35
@ihar-tsykala
ihar-tsykala marked this pull request as ready for review September 9, 2026 22:38

@Pyatakov Pyatakov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, address the comments below (more details added inline).

  • frontend/src/app/modules/schema-engine/rich-text-editor/markdown.ts:7 – escapeHtml leaves " unescaped, so a markdown link URL can inject attributes into the generated <a>
  • indexer-frontend/src/app/components/schema-form-view/markdown-view.ts:7 – Same unescaped-quote attribute injection in the indexer copy of escapeHtml
  • frontend/src/app/modules/schema-engine/rich-text-editor/rich-text-editor.component.ts:474 – Plain-text paste collapses every line break into a single line
  • frontend/src/app/modules/policy-engine/policy-viewer/blocks/documents-source-block/documents-source-block.component.html:77 – getRichTextCellText parses a fresh HTMLDocument per rich-text cell on every change detection cycle
  • interfaces/src/helpers/schema-json.ts:187 – Redundant richText special case – the loop below already resolves it

Comment thread frontend/src/app/modules/schema-engine/rich-text-editor/markdown.ts Outdated
Comment thread indexer-frontend/src/app/components/schema-form-view/markdown-view.ts Outdated
Comment thread interfaces/src/helpers/schema-json.ts
@Pyatakov
Pyatakov merged commit 0387358 into develop Sep 11, 2026
21 checks passed
@Pyatakov
Pyatakov deleted the feat/5308-enhance-guardian-UI-form-to-support-rich-text branch September 11, 2026 16:45
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.

2 participants