-
Notifications
You must be signed in to change notification settings - Fork 0
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
Created 'Create Section' page, hooked in with real data and added translations #216
base: development
Are you sure you want to change the base?
Conversation
…ith popover descriptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a few minor comments and one that probably requires some brief discussion on how we want the display order to work in the new tool.
introduction: sectionIntroductionContent, | ||
requirements: sectionRequirementsContent, | ||
guidance: sectionGuidanceContent, | ||
displayOrder: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want a way to determine the next number rather than hard coding a 1
here. When a user adds a section in the current tool, it's added at the end instead of the beginning of the list. I'm not sure if we want to continue that in the new tool, but if so we'll want a function to get that number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @briri. That's a good point. It should probably go to the bottom of the list rather than the top. I can make that update and bring it up at Tuesday's meeting to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@briri I updated the code to insert the new section with the max displayOrder + 1, so that it will be rendered at the bottom of the list of sections.
components/Editor/index.tsx
Outdated
const handleChange = (newState: EditorState) => { | ||
const html = prosemirrorNodeToHtml(newState.doc); | ||
const handleChange = ((newState: EditorState) => { | ||
//prosemirror was adding an empty <p></p> when no data was passed, so we need to remove it here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does Prosemirror handle adding blank lines to help separate content? I believe the TinyMCE editor uses empty paragraphs to accomplish this.
We might be better off replacing it only iy what is the entire content of the html.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@briri, good catch. Prosemirror also inserts <p></p>
for additional blank lines. I'll plan on only replacing <p></p>
when it is the only content in the field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@briri I updated the code to only filter out <p></p>
only when that is all that exists in the content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool thanks @jupiter007!
… updated html filter to filter out <p></p> if there is not text
…e will also need those same interfaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the delay LGTM
Description
Created the "Create Section" page, which will be different from "Edit Section" page, primarily because we won't be setting a Section ID until the user successfully creates a new section.
template/[templateId]/section/create
info
to be used next to thetags
components/Editor
-- updated
components/Editor
to use askeleton
to display until the editor loads. This became more of a problem as more instances of that DMPEditor were included in the same page.-- switched
components/Editor
to use css modules-- added two new props,
error
andid
to the componentAddSection
andTags
mutation and queryFixes # (187)
Type of change
How Has This Been Tested?
This was tested both manually and using unit tests.
Checklist:
Screenshots