This obviously should be using Drupal's messages styling:

Solution

You can invoke messages via JS

Ensure the core/drupal.message library is loaded

Do this:

const messenger = new Drupal.Message;
messenger.add('js status message', {type: 'status'});
messenger.add('js error message', {type: 'error'});
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mherchel created an issue. See original summary.

mherchel’s picture

Issue summary: View changes

adding solution

mherchel’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new319.02 KB

🙌 🙌 🙌

chrisfromredfin made their first commit to this issue’s fork.

marcoliver made their first commit to this issue’s fork.

marcoliver’s picture

Works fine for me. Needed another rebuild of the JS though.

Also, since the error message contains HTML markup, the placeholder used in Drupal.t should be prefixed with ! instead of @ so the markup does not get escaped.

marcoliver’s picture

Status: Needs review » Reviewed & tested by the community

Since I only changed the variable escaping in my previous commit and everything else looked fine, I'll mark this as RTBC.

chrisfromredfin’s picture

Issue tags: +core-mvp, +beta blocker
mherchel’s picture

Status: Reviewed & tested by the community » Needs work

Looks like tests not passing CS

chrisfromredfin’s picture

Status: Needs work » Needs review

Rebased, which made the tests work except for some sporadic timing-based failures on occasion. Increased timeout of waitForElementVisible() calls that I've seen failing.

marcoliver’s picture

Status: Needs review » Reviewed & tested by the community

Updated the MR against 1.0.x again to make it fit to merge. Test failures seem unrelated, fine on second run.

Marking as RTBC again.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Needs work

MR !399 is the right one to use, but needs a rebase.

marcoliver’s picture

Status: Needs work » Needs review

MR is up-to-date again

chrisfromredfin’s picture

Status: Needs review » Needs work

Given this error:

There was 1 error:
    
    1)
    Drupal\Tests\project_browser\FunctionalJavascript\ProjectBrowserPluginTest::testPaging
    Behat\Mink\Exception\ExpectationException: 2 elements matching css
    ".pager__item--next" found on the page, but should be 1.

I think the rebase might be a little bad. We did merge a fix last week to remove the top pager, but it seems like the test is now checking for one pager, but there are still two pagers being displayed.

(Wow, thanks automated tests!)

marcoliver’s picture

Status: Needs work » Needs review

Oops, my bad, should have waited for the pipeline!

Removed the offending pager, pipeline's green now!

jasonfelix made their first commit to this issue’s fork.

marcoliver’s picture

Updated against 1.0.x, MR is mergeable again.

bernardm28 made their first commit to this issue’s fork.

bernardm28’s picture

StatusFileSize
new117.15 KB

Seems to be working as expected.
comparison image

The easiest way to test is to paste the javascript code above on the console.

bernardm28’s picture

Status: Needs review » Reviewed & tested by the community
chrisfromredfin’s picture

Status: Reviewed & tested by the community » Needs work

ESLint and PHPStan are failing. The PHPStan failures should be solved with a rebase, based on a commit I made yesterday (h/t James Shields).

The ESLint errors I'm less sure about, but they certainly need to be fixed regardless.

bernardm28’s picture

Status: Needs work » Needs review

The test failure with the phpunit functional test is weird on this one.
Not sure that error is related to the changes here.

chrisfromredfin’s picture

Status: Needs review » Needs work

I think as the result of a bad rebase, this re-introduces a pager at the top of the Project Browser; there should only be one pager at the bottom. The test caught exactly this situation.

Needs to be rebased / re-applied clean to latest 1.0.x.

chrisfromredfin’s picture

bernardm28 changed the visibility of the branch 1.0.x to hidden.

chrisfromredfin’s picture

Status: Needs work » Fixed

beta blocker DOWN! Thanks so much everyone! big news. :)

bernardm28’s picture

Issue tags: +FLDC2024

Status: Fixed » Closed (fixed)

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