joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.3] Replace dialog GIF loader with Custom Element

Open C-Lodder opened this issue 1 year ago • 9 comments

Summary of Changes

This PR replaces the GIF loading icon used within dialogs, with the Custom Element.

Testing Instructions

Note: This cannot be tested with Patch Tester!

  1. Go to edit any article.
  2. Click "Versions" in the toolbar.
  3. Before the list of versions are loaded, you should see a loading icon for a split second.

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

image

cc'ing @Fedik @dgrammatiko

C-Lodder avatar Oct 11 '24 12:10 C-Lodder

You could also use import maps here but this is also fine for me

dgrammatiko avatar Oct 11 '24 12:10 dgrammatiko

It was made with pure CSS with purpose to allow custom loaders. Your approach adding a hard dependency. I do not like it, sorry.

Fedik avatar Oct 11 '24 12:10 Fedik

@Fedik I changed the Custom Element to use SVG over CSS, cause resizing the CSS one was an absolute nightmare. Using custom loaders is still possible by overriding the JS file...isn't it?

Either way, this simply implements the loader that's used everywhere else in Joomla, rather than using the outdated GIF, that doesn't look great in dark mode.

C-Lodder avatar Oct 11 '24 18:10 C-Lodder

I have tested this item :white_check_mark: successfully on 47d29db191614aa680cda437338cb76a3daba7a8


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

ghost avatar Oct 12 '24 05:10 ghost

@C-Lodder Could you check the two linter errors reported here? https://ci.joomla.org/joomla/joomla-cms/79575/1/20

/drone/src/build/media_source/system/js/joomla-dialog.w-c.es6.js
  319:3  error  Expected 'this' to be used by class method 'renderLoader'  class-methods-use-this
  325:1  error  Trailing spaces not allowed                                no-trailing-spaces

Thanks in advance.

richard67 avatar Oct 13 '24 12:10 richard67

@C-Lodder I agree that the gif on black backround looks ugly, However, the loader hardcoded in to dialog I do not like even more :smiley:

Need to find a better solution. Until then, can just remove the loader CSS, no one will ever notice :smiley: Or just make 2 rotating dots with :before, :after animation (there many examples at loading.io/css/, cssload.net etc).

Fedik avatar Oct 13 '24 13:10 Fedik

Can you rebase this one to the 5.3-dev branch?

laoneo avatar Oct 14 '24 06:10 laoneo

@laoneo done.

@Fedik Whether the loader is instantiated via CSS class or Javascript, both are couple to something. With CSS, it's coupled to the template. With JS, it coupled to the dialog web component. Both can be overridden. I can't use the old Joomla CSS loader because it wasn't easily possible to change the size without destroying the layout. It's also unecessarily coupled to core, so I can't see how a loading icon makes much difference.

Either way, happy to close if anyone would like to provide an alternative, or keep the current icon.

C-Lodder avatar Oct 15 '24 07:10 C-Lodder

core is a different story (it requires only because of Text and HTML sanitisation), but I also was not very happy about that.

it wasn't easily possible to change the size without destroying the layout

I have a hint: width: 30px; height: 30px; background-position:center; :wink:

Either way, happy to close if anyone would like to provide an alternative, or keep the current icon.

Hold on for now, I will look what else can be, when will get some time.

Fedik avatar Oct 15 '24 15:10 Fedik

This pull request has been automatically rebased to 6.0-dev.

HLeithner avatar Mar 04 '25 17:03 HLeithner

@fedik - have you had a chance to think of a new/better solution/option?

exlemor avatar Mar 08 '25 01:03 exlemor

No, I forgot :smile: I will check

Fedik avatar Mar 08 '25 09:03 Fedik

There is https://github.com/joomla/joomla-cms/pull/45097

Fedik avatar Mar 08 '25 12:03 Fedik

Thanks @Fedik, I will go test it now...

exlemor avatar Mar 08 '25 16:03 exlemor

Okay, that PR was merged, I close this one. Thanks.

Fedik avatar Mar 11 '25 15:03 Fedik