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

Change help to rich text #3293

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

frankduncan
Copy link
Contributor

Fixes #3288

Changes the help field to rich text. Of note is that when you have current forms that used both the text and the link, the link is lost to the sands of time. Maybe we need a transition migration? But not sure how to do that when working with stream objects.

There's one test change (in its own commit) that I'm not sure on. Otherwise, everything looks good.

@frankduncan frankduncan changed the title Enhancement/gh 3288 change help to rich text Change help to rich text Mar 20, 2023
@frankduncan frankduncan force-pushed the enhancement/gh-3288-change-help-to-rich-text branch from 28c9bf0 to 939c3b4 Compare April 21, 2023 14:38
@frjo
Copy link
Contributor

frjo commented Jan 17, 2024

@wes-otf How does OTF feel about converting all help text in application forms to rich text fields?

Today we have a plain text field + a help link field.

@frjo
Copy link
Contributor

frjo commented Jan 17, 2024

@frankduncan A rebase would help with testing and we would need a migration to convert the current fields to the new one.

old help text + old help link = new help rich text

@frankduncan
Copy link
Contributor Author

@frjo Sounds great! I've added it to my list and I should have it to you sometime in the next week.

@wes-otf
Copy link
Contributor

wes-otf commented Jan 25, 2024

@frjo @frankduncan sorry for the delayed response but this would be fantastic! This week I've ironically talked with a few staff members at OTF about how it's be great to have some formatting in the help text so I'm certainly an advocate for this.

@frjo
Copy link
Contributor

frjo commented Jan 26, 2024

Sounds like we are adding this to Hypha core then.

But see comment above about the migration I belive is a requisite to get it in. I do not think OTF, or any other organisation, want to manually readd all the help text to every existing form.

@wes-otf @frankduncan Is there any chance we could make the help field use markdown with an editor instead of rich text?

With rich text field you allow staff to put in almost anything, e.g. paste in spagetti HTML from MS Word.

With markdown we can ensure clean input and still allow for both links and formatting, just as requested.

@frankduncan
Copy link
Contributor Author

frankduncan commented Jan 26, 2024

Looping in @jim-mcgowan

I lean toward rich text because thus far in my career, the target audience for things like hypha application configuration and target audience for markdown has little overlap. Furthermore, hypha already supports rich text for submissions, but maybe there's a good drop in wagtail field type that is wysiwyg->markdown. (If so, why not use that instead of rich text for submissions?)

@frjo
Copy link
Contributor

frjo commented Jan 26, 2024

There is a markdown editor in Hypha already, "pagedown" from the Stackoverflow people. It is e.g one of the field option on application forms.

The reason we have a rich text editor is that so applicants can paste in spagetti HTML from MS Word. Preserving tables etc.

We are planing to look in to the possibility of converting that to Markdown before saving it to the DB.

@frjo
Copy link
Contributor

frjo commented Jan 26, 2024

The comments tab on submission are using the Markdown editor/field as well.

@wes-otf
Copy link
Contributor

wes-otf commented Jan 26, 2024

+1 to everything @frjo said, I'm also an advocate for Markdown. As mentioned Pagedown has worked pretty well for us so far and has some nice customization options as well.

chriszs and others added 5 commits September 24, 2024 14:58
So ARDC can put hyperlinks in the text
This was failing because the rich text fields are not equal under the
strict equality of the StreamValue class, as they are each two different
equivalently instantiated objects.
Converts rich help text to string to avoid type error
Closes #114
@frankduncan
Copy link
Contributor Author

Finally looking at this again! I can attempt to change it to the markdown form, but I think that building a migration that will work is outside of my ability. Because of the use of streamfields, and the fact that that this is a change on the low level FormFieldBlock, the migration would have to dip into all instances of all users of that, which is... well, everything, right? Or am I missing something and this is much easier than it looks?

@frankduncan frankduncan force-pushed the enhancement/gh-3288-change-help-to-rich-text branch from 3e808a6 to c890a66 Compare September 24, 2024 20:59
@frankduncan
Copy link
Contributor Author

Took a stab at using markdown instead, and couldn't figure out a way for it to work. The pagedown widget didn't come up in editing, and even when using markdown and saving, the help text just displayed a <p></p>. I think that I could use some pointers or help, but otherwise we can just call this feature a deadend and we'll tackle it via an extension!

Did rebase and commit those changes though!

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.

Change Help documentation to rich text fields
4 participants