Template settings ILLDEV-457 - #27
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Message templates settings area (CRUD for broker templates, including HTML vs plain-text handling) and updates Scheduled Actions → Email pull slips to reference a stored message template via templateLabel instead of embedding subject/body directly.
Changes:
- Added templates settings UI: list, create, edit, view, delete, plus mapping/helpers and test coverage.
- Updated scheduled-action “batch action presets” wording and refactored the preset picker naming/translation keys.
- Updated Email Pullslips scheduled-action params to select a message template label from broker templates.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ui-rs/translations/ui-rs/en.json | Adds/renames i18n keys for templates UI and scheduled-action preset/template-label UI. |
| ui-rs/src/test/okapiKyMock.js | Adds a delete mock to support new delete flows in tests. |
| ui-rs/src/test/editorMock.js | Introduces an Editor stub so jsdom tests can mount HTML template forms. |
| ui-rs/src/settings/templates/ViewTemplate.js | Adds a template “view” pane with delete confirmation and HTML/plain rendering paths. |
| ui-rs/src/settings/templates/ViewTemplate.css | Styles plain-text body rendering to preserve line breaks while wrapping. |
| ui-rs/src/settings/templates/Templates.test.js | Adds end-to-end tests for listing/creating/editing/deleting templates. |
| ui-rs/src/settings/templates/Templates.js | Adds templates routing and the templates list UI. |
| ui-rs/src/settings/templates/TemplateForm.test.js | Adds focused tests for the template form UX (HTML mode, source toggle, labels, presets). |
| ui-rs/src/settings/templates/TemplateForm.js | Implements the template form, including HTML escaping, source mode, and label suggestions. |
| ui-rs/src/settings/templates/TemplateForm.css | Adds help-text styling used by the template form. |
| ui-rs/src/settings/templates/mapping.test.js | Adds unit tests for form/API mapping helpers and template-label option building. |
| ui-rs/src/settings/templates/mapping.js | Adds mapping helpers for create/update bodies and template label option generation. |
| ui-rs/src/settings/templates/index.js | Exports the Templates settings module entrypoint. |
| ui-rs/src/settings/templates/EditTemplate.js | Adds edit screen wiring (fetch → form → PUT). |
| ui-rs/src/settings/templates/CreateTemplate.js | Adds create screen wiring (form → POST). |
| ui-rs/src/settings/scheduledActions/ScheduledActionForm.test.js | Updates scheduled-action tests for “preset” naming and templateLabel-based email params. |
| ui-rs/src/settings/scheduledActions/ScheduledActionForm.js | Renames “template picker” to “preset picker” and updates translation keys. |
| ui-rs/src/settings/scheduledActions/actions/EmailPullslipsParams.js | Replaces inline email subject/body/isHtml params with a required templateLabel selector sourced from broker templates. |
| ui-rs/src/settings/index.js | Adds the new “Message templates” route into the Settings sections list. |
Suppressed comments (1)
ui-rs/src/settings/templates/mapping.js:43
buildUpdateTemplateBodyhas the same title-trimming issue as create: titles with leading/trailing whitespace pass validation but will be persisted with the whitespace intact.
export function buildUpdateTemplateBody(values = {}) {
const updated = {
title: values.title,
body: values.body,
contentType: values.contentType,
labels: cleanLabels(values.labels),
subject: (values.subject ?? '').trim(),
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.