Problem/Motivation

Found a small bug on admin/config/regional/translate. If i translate something, and I clicked somewhere the message is visible and looks bad (strange brown border, no left border, no margin between message and table, etc):

Proposed resolution

Make it appear as a proper message, as it was intended. It needs a wrapper div element, and the proper message subclass. The it appears properly:

Note that the message is still misaligned. That is already handled on a more general level in #2220905: Misaligned messages status.

Remaining tasks

Review. Commit.

User interface changes

Message looks like a standard message.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

csakiistvan’s picture

Title: Messega UI bug in translate page » Message UI bug in translate page
csakiistvan’s picture

FileSize
905 bytes

There is the patch

csakiistvan’s picture

Status: Active » Needs review
thamas’s picture

I reviewed the patch and made a couple of changes:

  • Removed the "localetranslate-changed-warning" class because nothing is styled using this class.
  • Found some missing margin settings in the different modifiers of the .message class in system.theme.css so added that.
  • Added a .console class because according to our CSS coding standards we should avoid using ID selectors as styling hooks. So I suppose that will be changed to a class in Seven (should be an other issue) and I did not want this message break again when this change happens.

The last submitted patch, 4: locale-message-styling-2318381-4.patch, failed testing.

The last submitted patch, 4: locale-message-styling-2318381-4.patch, failed testing.

csakiistvan’s picture

@thamas the messages alignement problem is in the other issue see that: https://www.drupal.org/node/2220905

So, i agree the localetranslate-changed-warning is deleted, but the others is not necessary

csakiistvan’s picture

Status: Needs review » Needs work
csakiistvan’s picture

Status: Needs work » Needs review
FileSize
873 bytes

There is a patch with new div see #2 and without "localetranslate-changed-warning" class #4

thamas’s picture

@csakiistvan you are right, thanks for pointing this out!

I checked up the #console question and it seems that it may be removed (see #2017257-50: Create generic layout classes) but I did not find any relavant work yet.

thamas’s picture

thamas’s picture

Gábor Hojtsy’s picture

Title: Message UI bug in translate page » Message not styled properly on interface translation page
Issue summary: View changes
Issue tags: +D8MI, +language-ui, +sprint, +frontend

Updating issue summary with embedded screenshot for easier review.

Gábor Hojtsy’s picture

Issue summary: View changes

I tested the patch manually and it works well. I'm not 100% sure its the best idea to add a console here, for example, if you already have strings saved from this screen, you have a id="console" on the page above the form, now you change something, you have two elements with id="console". Looks like all that console does is it adds some margins so the message will not run into the form table (in this case). The same margins may be applied without the risk of duplicating the console / message container. I'll ask a few frontend people to take a look.

Gábor Hojtsy’s picture

Issue summary: View changes
Gábor Hojtsy’s picture

What tabledrag does for example is the following:

    tableDragChangedWarning: function () {
      return '<div class="tabledrag-changed-warning messages messages--warning" role="alert">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t('You have unsaved changes.') + '</div>';
    }

The tabledrag-changed-warning class has a bottom margin set. That sounds more compatible with an existing #console on the page compared to adding a #console in the markup. Also less markup :)

thamas’s picture

Adding a class for setting margins seems to be a better way to me too. (We can add back the class I removed and than add that selector in the CSS near to the table-drag's… :) )

Using the "role=alert" is also a good practice in the table-drag example, that should be added too!

See also: #2321121: Remove #console

Gábor Hojtsy’s picture

The tabledrag class is system level, the locale class will be in locale's CSS I guess.

thamas’s picture

You're right I think because locale is not necessary switched on. Then we have to add a locale.admin.theme.css file.

Gábor Hojtsy’s picture

Status: Needs review » Postponed

So sounds like we should fix #2321121: Remove #console first and then come back here?

csakiistvan’s picture

Ok, if the Replace #console with .messages__container will fixed, I adapt it.

Gábor Hojtsy’s picture

Status: Postponed » Needs work

So we postponed this on #2321121: Remove #console but that was marked as dupilcate of #2213583: Misaligned Icons in Drupal 8.x. THAT one finally landed, so unpostponing this one. Looking forward to updates to this one so we can get it in :)

csakiistvan’s picture

So I update the patch, I removed #console div element, add the clearfix class to .messages div element.

localeTranslateChangedMarker_bug_after_25

herom’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me. Thanks!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed f4864ae on 8.0.x
    Issue #2318381 by csakiistvan, thamas: Fixed Message not styled properly...
Gábor Hojtsy’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

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