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

FAQ has capability to attach a file, but not ability to read it. Remove the capability. #5070

Open
2 tasks
cielf opened this issue Mar 5, 2025 · 9 comments · May be fixed by #5078
Open
2 tasks

FAQ has capability to attach a file, but not ability to read it. Remove the capability. #5070

cielf opened this issue Mar 5, 2025 · 9 comments · May be fixed by #5078
Assignees

Comments

@cielf
Copy link
Collaborator

cielf commented Mar 5, 2025

Summary

Remove the ability to attach a file in FAQs (as superadmin)

Why?

We don't use it and it doesn't work properly (banks can't open the files)

Details

To see this
sign in as [email protected]
click on FAQ
click on Write New Question and Answer
There is an "Attach Files" option on the answer field. Remove the option.

Criteria for completion

  • behaviour as described above
  • if there are any tests that require the attach files functionality on FAQ. remove them.
@emmet0r
Copy link

emmet0r commented Mar 6, 2025

I can work on this!

@cielf
Copy link
Collaborator Author

cielf commented Mar 6, 2025

Excellent! Thank you!

@emmet0r
Copy link

emmet0r commented Mar 6, 2025

Do you have any hints what file I should be looking in? A couple of us have been digging together, but are rusty working with Rails so we're going in circles 😅

@awwaiid
Copy link
Collaborator

awwaiid commented Mar 6, 2025

The live URL is https://humanessentials.app/admin/questions

Image

When you click edit or create, you see this:

Image

Which uses these files:

  • app/controllers/admin/questions_controller.rb
  • app/views/admin/questions/_question_form.html.erb

And then that thing has some weird f.rich_text_area .... I don't know what that thing is, but the hope in this ticket is that it can be configured to not allow attachments.

@awwaiid
Copy link
Collaborator

awwaiid commented Mar 6, 2025

@cielf
Copy link
Collaborator Author

cielf commented Mar 6, 2025

This may be more difficult than we thought!

@awwaiid
Copy link
Collaborator

awwaiid commented Mar 6, 2025

.... I found this, which would be acceptable but annoying! https://www.donnfelker.com/disable-attachments-in-the-trix-editor/ . I kinda just want the button to be hidden. Maybe with CSS?

@awwaiid
Copy link
Collaborator

awwaiid commented Mar 6, 2025

OK, another idea is to hide it with CSS. Here is the HTML, maybe somewhere we can put .trix-button--icon-attach { display: none }

Image

@emmet0r
Copy link

emmet0r commented Mar 7, 2025

Thank you so much! We reached the same conclusion about hiding it with CSS - I'll put in a PR as soon as I can in between conference things :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants