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

Rich text editor templates #3176

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Commits on Jun 23, 2020

  1. #3081:Add template with readonly blocks to reportText

    This makes sure that when creating a report, the reportText field
    contains a template text. Some of the heading blocks in the template
    are readonly and can't be removed.
    Note: it only works now on add, after save, on edit, the headings
    are no longer readonly (still to be implemented).
    maradragan committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    06a38fc View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2020

  1. #3081: Update richTextEditor mandatory h1

    This makes sure that if the richTextEditor contains h1 tags marked
    with the mandatory class, they can be edited but the tags itself
    can not be deleted. Also, when the content is saved, the resulting
    html also still has the mandatory class for the h1 tag (this was not
    the case before).
    maradragan committed Jun 25, 2020
    Configuration menu
    Copy the full SHA
    b036bb8 View commit details
    Browse the repository at this point in the history
  2. #3081: Update HtmlPolicyBuilder, allow class for h1 and p

    In order to be able to save richText content containing also a class,
    we need to allow this in the HtmlPolicyBuilder, which is being used to
    sanitize the HTML before saving. We updated this one to allow the
    class attribute for h1 and p elements.
    maradragan committed Jun 25, 2020
    Configuration menu
    Copy the full SHA
    c167807 View commit details
    Browse the repository at this point in the history
  3. #3081: WIP: Replace mandatory elems with placeholder

    In the RichTextEditor, replace mandatory elements with a placeholder
    when all their text is being deleted.
    maradragan committed Jun 25, 2020
    Configuration menu
    Copy the full SHA
    bea58fa View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2020

  1. #3081: Replace mandatory elements with placeholder

    In the RichTextEditor, replace mandatory elements with a placeholder
    when trying to delete their last content character.
    maradragan committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    c429143 View commit details
    Browse the repository at this point in the history
  2. #3081: Update styling of mandatory elements in RichTextEditor

    Changed the style of the h1 mandatory element. Made sure the mandatory
    elements are only having a specific style when in the RichTextEditor.
    maradragan committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    a116a82 View commit details
    Browse the repository at this point in the history
  3. #3081: Make htmlTemplate for rickTextEditor configurable

    It is now possible to configure within the anet.yml, through
    report.reportText.placeholder the html template to be used per
    default for the report text.
    maradragan committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    a4ec1ac View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7807258 View commit details
    Browse the repository at this point in the history
  5. #3081: Save mandatory unstyled blocks as mandatory

    This makes sure that if an unstyled block has the mandatory class,
    it is also being saved as a html element with the mandatory class.
    maradragan committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    ca227c1 View commit details
    Browse the repository at this point in the history
  6. #3081: Make placeholder configurable for mandatory elements

    This makes sure that when specifying a default template for a
    richTextEditor type of field, we can also define a placeholder for
    the html elements having the class mandatory. This placeholder
    is being used to prefill the element if this one becomes empty.
    Both the class attribute and the placeholder attribute of an HTML
    tag of type h1, h2, h3 or p are being persisted in the database. This
    in order to be able to still know the mandatory elements and their
    eventual placeholders when editing an object with rich text content.
    maradragan committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    ef440b6 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2020

  1. Configuration menu
    Copy the full SHA
    435302b View commit details
    Browse the repository at this point in the history
  2. Merge branch 'GH-3081-richt-text-editor-templates' of github.com:NCI-…

    …Agency/anet into GH-3081-richt-text-editor-templates
    maradragan committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    e417c1b View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2020

  1. #3081: Make sure mandatory blocks remain mandatory

    Prevent return when:
    - at the beginning of a mandatory block => it would result in an empty
      mandatory block and a new non-mandatory block containing the text of
      the block which used to be mandatory.
    - the selection contains at least one mandatory block => it would result
      in deleting the selection including the mandatory block
    - exactly one whole mandatory block is selected, it would result in the
      contents of the mandatory block being deleted and the addition of a
      new empty block afterwards.
    
    Prevent delete or backspace when:
    - the selection contains several blocks and at least one of them is
    mandatory => we don't want to lose mandatory blocks
    
    Prevent delete when:
    - at the end of a block when the next block is => we don't want to merge
      a mandatory block into a previous one
    
    Prevent backspace when:
    - at the beginning of a mandatory block => we don't want to merge a
      mandatory block into a previous one
    
    The reason we don't want to merge a mandatory block B into a previous
    block A as:
    - if block A is not mandatory, block B would lose it's style and data
      (thus also the mandatory property)
    - if block A is also mandatory, we would end up with only one mandatory
      block instead of two.
    
    Prevent pasting on a selection when:
    - at least one of the selection blocks is mandatory. It would result in
      the removal of mandatory blocks.
    maradragan committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    54c7544 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2020

  1. Configuration menu
    Copy the full SHA
    5fe494d View commit details
    Browse the repository at this point in the history