NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
27 Apr 2020

Pull Request for Issue # .

Summary of Changes

The core.js had a conditional for the alerts checking if the alerts custom element was present and having 2 different behaviours (for custom elements or Bootstrap). The problem is that the code would never work as intended, so it's better to leave only the code for the custom element there (the conditional will never work as the custom element is always loaded there from the messages layout).

Testing Instructions

Apply the patch and run npm ci, alerts should be ok

Expected result

Actual result

Documentation Changes Required

Nope

avatar dgrammatiko dgrammatiko - open - 27 Apr 2020
avatar dgrammatiko dgrammatiko - change - 27 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Apr 2020
Category Repository NPM Change
avatar dgrammatiko dgrammatiko - change - 27 Apr 2020
Labels Added: NPM Resource Changed ?
avatar dgrammatiko dgrammatiko - change - 27 Apr 2020
Title
Remove useless code for alerts
[4.0] Remove useless code for alerts
avatar dgrammatiko dgrammatiko - edited - 27 Apr 2020
7a2a44f 27 Apr 2020 avatar dgrammatiko oops
avatar jwaisner
jwaisner - comment - 27 Apr 2020

Something I noticed is the boarder around the alert when changing state of an article is missing on the right.

image

avatar dgrammatiko
dgrammatiko - comment - 27 Apr 2020

@jwaisner #28824 should solve that

avatar jwaisner
jwaisner - comment - 27 Apr 2020

After applying #28824 with this PR all alerts are looking correct.

avatar jwaisner
jwaisner - comment - 27 Apr 2020

I have tested this item successfully on 7a2a44f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28833.

avatar jwaisner jwaisner - test_item - 27 Apr 2020 - Tested successfully
avatar ciar4n
ciar4n - comment - 29 Apr 2020

I have tested this item successfully on 7a2a44f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28833.

avatar ciar4n ciar4n - test_item - 29 Apr 2020 - Tested successfully
avatar richard67 richard67 - change - 29 Apr 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 29 Apr 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28833.

avatar wilsonge
wilsonge - comment - 2 May 2020

The problem is that the code would never work as intended, so it's better to leave only the code for the custom element there (the conditional will never work as the custom element is always loaded there from the messages layout).

Can you explain why on this? I assumed this would use the bootstrap styles on people who upgrade from J3 and haven't updated a potential layout override

avatar dgrammatiko
dgrammatiko - comment - 2 May 2020

I assumed this would use the bootstrap styles on people who upgrade from J3 and haven't updated a potential layout override

That's not the case because the layout https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/system/message.php is automatically converted to Bootstrap 4 and also to the new alert system (the custom elements code)
The only break might happen if someone has a template with a custom override for the messages (the file in the link above) but in that case they have to override also the core.js to match their expectation (eg copy the code from the 3.x version of the core.js corresponding to renderMessages and removeMessages). Right now J4 is theoretically (in practice most probably won't work as it was never tested, eg the code was written with good intentions but without any tests is probably foobar) covering this edge case.

avatar wilsonge
wilsonge - comment - 2 May 2020

The only break might happen if someone has a template with a custom override for the messages (the file in the link above)

This was the scenario I had in mind with the above message (I don't actually care about people who directly edit core files).

avatar wilsonge wilsonge - change - 2 May 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-05-02 10:48:50
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 2 May 2020
avatar wilsonge wilsonge - merge - 2 May 2020
avatar wilsonge
wilsonge - comment - 2 May 2020

We can give it a go to reduce complexity but can always add it back if people have issues upgrading

avatar dgrammatiko
dgrammatiko - comment - 2 May 2020

but can always add it back if people have issues upgrading

One of the main objectives with the custom elements was to decouple from the Bootstrap (or any front end framework). If the upgrades fail then we totally missed the point. FWIW the custom elements repo iirc has examples for all the popular css frameworks just to validate our hypothesis that we're framework independent. But I guess time will tell.

Thanks

Add a Comment

Login with GitHub to post a comment