Open
Conversation
1 task
- Add /my_templates route and HAML mount point - Register MyTemplates React app in application.js - Add My Templates link in user dropdown (UserAuth.js) - Add My Templates button in custom toolbar popover
Added a new "Global Text Template Editor" permission that admins can toggle per user from the User Management page. When enabled, the user can edit predefined (global) text templates from their My Templates page. - Add global_text_template_editor flag to profile defaults - Expose the flag via user entity and admin profile API - Add toggle button and handler in UserManagement UI - Add global_text_template_editor method on User model
…th personal and predefined template options
…plate to own file
18a87d7 to
28228ca
Compare
LCOV of commit
|
LCOV of commit
|
…lete predefined templates
LCOV of commit
|
- Add uniqueness validation to PredefinedTextTemplate model
- Use save/update instead of save!/update! in personal and predefined
template endpoints to return JSON 422 on validation failure
- Handle res.error in frontend to show error banner without updating list
app/models/personal_text_template.rb
Outdated
| # frozen_string_literal: true | ||
|
|
||
| class PersonalTextTemplate < TextTemplate | ||
| validates :name, presence: true, uniqueness: { scope: :user_id, message: 'already exists in your personal templates' } |
There was a problem hiding this comment.
Rails/I18nLocaleTexts: Move locale texts to the locale files in the config/locales directory.
| class PredefinedTextTemplate < TextTemplate | ||
| # STI: this file is only here because of rails model autoloading. | ||
| # place all code in app/models/text_template.rb. | ||
| validates :name, presence: true, uniqueness: { message: 'already exists in global templates' } |
There was a problem hiding this comment.
Rails/I18nLocaleTexts: Move locale texts to the locale files in the config/locales directory.
LCOV of commit
|
LCOV of commit
|
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.
Personal templates are integrated directly into the Quill editor toolbar. Through the Custom toolbar popover, users can configure an MT dropdown with any combination of personal and global templates for quick one-click insertion while writing. Changes made on the My Templates page are reflected in the toolbar immediately without a page reload.
What's changed
Test instance: https://az-texttemp.deploy.chemdev.scc.kit.edu/
rather 1-story 1-commit than sub-atomic commits
commit title is meaningful => git history search
commit description is helpful => helps the reviewer to understand the changes
code is up-to-date with the latest developments of the target branch (rebased to it or whatever) => ⏩-merge for linear history is favoured
added code is linted
tests are passing (at least locally): we still have some random test failure on CI. thinking of asking spec/examples.txt to be commited
in case the changes are visible to the end-user, video or screenshots should be added to the PR => helps with user testing
testing coverage improvement is improved.
CHANGELOG : add a bullet point on top (optional: reference to github issue/PR )
parallele PR for documentation on docusaurus if the feature/fix is tagged for a release