Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ModernMantra created an issue. See original summary.

miro_dietiker’s picture

Title: Change style of error message » Follow core style of warnings

Those are warnings, not errors.

johnchque’s picture

I see that an image field adds warning messages on its parent form, I would vote to make them to be like those ones.

ModernMantra’s picture

So, here is the patch for new ui warning. IMHO, we should not have 'exactly' the same warning as core, can be confusing for users.

miro_dietiker’s picture

Status: Needs review » Needs work

The message "Warning: this content must be saved to reflect changes on this Paragraph item." seems overlengthy to me. Less text is more.
I would prefer a general statement "You have unsaved changes."
"Warning" is superfluous, it's a warning message.

In TMGMT we are using this in JobItemForm.php:

      $form['translation_changes'] = array(
        '#type' => 'container',
        '#markup' => $this->t('The translations below are in preliminary state and can not be changed.'),
        '#attributes' => array(
          'class' => array('messages', 'messages--warning'),
        ),
      );

This needs no custom CSS and triggers core warning appearance.

miro_dietiker’s picture

Testing alternative conversion.

Status: Needs review » Needs work

The last submitted patch, 6: paragraphs_2832049_warning_6.patch, failed testing.

The last submitted patch, 6: paragraphs_2832049_warning_6.patch, failed testing.

  • miro_dietiker committed 414a224 on 8.x-1.x
    Issue #2832049 by ModernMantra, miro_dietiker, yongt9412: Follow core...
miro_dietiker’s picture

Status: Needs work » Fixed

Committing, with the fixes in Drupal\paragraphs\Tests\ParagraphsWidgetButtonsTest

  • miro_dietiker committed 771ddfd on 8.x-1.x
    Issue #2832049 by ModernMantra, miro_dietiker, yongt9412: Follow core...
miro_dietiker’s picture

Status: Fixed » Needs work

This issue switched many plain informational messages into a warning display.

Currently, only the factual info that no paragraph was added yet appears as warning.
These should be degraded to an info and only use the warning level in case of severity.

ModernMantra’s picture

Checked in core, and it looks like there are only three types of messages status, error and warning. So proposed solution would be to revert to old color-warning message that is very often displayed and does not need core style warning level ('No paragraph added yet'). Rechecked other messages and seems ok to keep core style warning level.

johnchque’s picture

Do we really need to style a status message with a color-warning? It just says that there are no paragraphs added, that should be just normal text without any color.

ModernMantra’s picture

miro_dietiker’s picture

Status: Needs review » Fixed

OK committed to revert back how it looked before for the info message.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

frederickjh’s picture

Issue summary: View changes

Hi!
I think that this issue got side tracked and then derailed from the original posters request.

I think that we need to differentiate between Warning and Information messages.

Warning: this content must be saved to reflect changes on this Paragraph item.

is a Warning message and should use the Drupal Warning messages like this:

No Paragraph added yet.

(By the way, is not a correct english phrase. No paragraphs added yet. would be correct.) is a Information message and for that the <em> tag is enough.

Please reopen this issue. I am sure that without this change more than one end user will exit the page with unsaved work and most likely not be real happy with the developers.
Thanks!

Frederick

frederickjh’s picture

Sorry, just did a deeper dive into the code and I see that only one section of the code was pulled back out. Please do not reopen this issue.
Frederick