Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#7771 & #7809] Add styling and rich text notes #8153

Merged
merged 7 commits into from
Apr 9, 2024

Conversation

gbp
Copy link
Member

@gbp gbp commented Mar 6, 2024

Relevant issue(s)

Fixes #7771
Fixes #7809

What does this do?

Add styling and rich text notes

Why was this needed?

Enable easier styling of note content.

Implementation notes

Have added an "original" style which renders notes as they are currently. Eventually we might choose to migrate current notes on WDTK and remove this style.

Screenshots

image image

@gbp gbp force-pushed the 7809-add-actiontext-to-notes branch 2 times, most recently from c27a1e6 to 3998b0b Compare March 6, 2024 15:22
Copy link
Member

@garethrees garethrees left a comment

Choose a reason for hiding this comment

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

All looks so good! Couple of minor tweaks suggested.

app/models/note.rb Show resolved Hide resolved
app/models/note.rb Outdated Show resolved Hide resolved
app/models/note.rb Show resolved Hide resolved
gbp added 7 commits April 9, 2024 12:56
- Better separation of layout and styling
- Made it easier to add different note style
This commit adds helpers to render notes either as text or sanitized
HTML.

This will allow us to easily update note rendering for rich text content
by changing these helpers,
This commit allows admins to create notes with different colour styles.
The default styles are just red, green, blue and yellow.

Additional styles can be added via the site theme.
Unable to use ActiveRecord ordering as we're dealing with both concert
and tagged notes.
Add JS/CSS to the admin layout only.

To prevent deprecation warnings we set the following as this will be the
default in Rails 7.1:
  `config.active_storage.replace_on_assign_to_many = true`
Use ActionText Trix editor to allow rich text notes. We render the rich
text body when the note isn't in the original style.

This commit also hides the image attachment button in the Trix editor
as we will need to store the files correctly which won't work currently
with the current ActiveStorage setup.
@gbp gbp force-pushed the 7809-add-actiontext-to-notes branch from a244cb1 to ddaff31 Compare April 9, 2024 11:56
@gbp gbp merged commit 61b02a6 into develop Apr 9, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ActionText to Notes Add Note#style
2 participants