Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] modify #31190 #31545

Merged
merged 15 commits into from
Jan 18, 2021
Merged

[4.0] modify #31190 #31545

merged 15 commits into from
Jan 18, 2021

Conversation

N6REJ
Copy link
Contributor

@N6REJ N6REJ commented Dec 1, 2020

Pull Request for Issue # .

Summary of Changes

addresses #31516
removes api and replaces it with overrideable call

Testing Instructions

apply pr
run npm ci
check logins via https and verify logo shows.

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

image

image

Documentation Changes Required

remove documentation documenting htmlhelper::icon.svg

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.0-dev labels Dec 1, 2020
@sandewt
Copy link
Contributor

sandewt commented Dec 1, 2020

I have tested this item 🔴 unsuccessfully on e2bc96c

Warning message: the path is not correct.

Warning: file_get_contents(C:\xampp\htdocs\bugtesting2\joomla/bugtesting2/joomla/media/plg_system_webauthn/images/webauthn.svg): ...


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

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.287 3.63a8.407 8.407 0 00-8.051 7.593h.55a7.805 7.805 0 012.24-4.713 5.825 5.825 0 00.924.695c-.608 1.177-.98 2.556-1.082 4.018h.135c.105-1.467.485-2.819 1.065-3.947.745.434 1.623.754 2.577.94a27.83 27.83 0 00-.25 3.763h-.847v.135h.847c.003 1.334.09 2.617.25 3.764-.954.185-1.832.506-2.577.94a9.997 9.997 0 01-.978-3.137h-.137c.164 1.16.502 2.25.997 3.208a5.825 5.825 0 00-.924.695 7.805 7.805 0 01-2.255-4.875H7.22A8.407 8.407 0 0024 12.034a8.398 8.398 0 00-.688-3.333 8.407 8.407 0 00-8.025-5.072zm.315.546c.155 0 .31.005.464.014.365.34.708 1.07.983 2.114a16.518 16.518 0 01.357 1.79 10.173 10.173 0 01-1.804.16 10.173 10.173 0 01-1.805-.16 16.519 16.519 0 01.357-1.79c.275-1.045.618-1.775.983-2.114a7.97 7.97 0 01.465-.014zm-.665.028c-.345.392-.658 1.093-.913 2.065a16.639 16.639 0 00-.36 1.8c-.939-.183-1.802-.498-2.533-.926.686-1.283 1.635-2.264 2.73-2.775a7.874 7.874 0 011.076-.164zm1.33 0a7.856 7.856 0 011.084.168c1.092.513 2.037 1.492 2.721 2.771-.73.428-1.594.743-2.533.927a16.64 16.64 0 00-.36-1.8c-.255-.972-.568-1.673-.912-2.066zm-2.972.314c-.655.407-1.257.989-1.776 1.73a8.166 8.166 0 00-.506.825 5.69 5.69 0 01-.891-.67 7.814 7.814 0 013.173-1.885zm4.624.006a7.862 7.862 0 013.164 1.877 5.692 5.692 0 01-.893.672 8.166 8.166 0 00-.506-.825c-.516-.738-1.115-1.318-1.765-1.724zm3.26 1.985a7.858 7.858 0 011.638 2.419 7.802 7.802 0 01.642 3.051h-2.095c-.01-1.74-.398-3.396-1.11-4.774a5.823 5.823 0 00.925-.696zm-1.044.767c.679 1.32 1.084 2.945 1.094 4.703h-3.42a27.863 27.863 0 00-.251-3.763c.954-.186 1.833-.506 2.577-.94zm-6.357.965a10.299 10.299 0 001.824.16 10.299 10.299 0 001.823-.16c.16 1.138.246 2.413.249 3.738h-1.178a1.03 1.03 0 01-.093.135h1.27a27.71 27.71 0 01-.248 3.739 10.397 10.397 0 00-3.647 0 27.733 27.733 0 01-.248-3.739h1.294a.99.99 0 01-.09-.135H13.53c.003-1.325.088-2.6.248-3.738zM2.558 9.37a2.585 2.585 0 00-2.547 2.35c-.142 1.541 1.064 2.842 2.566 2.842 1.26 0 2.312-.917 2.533-2.124h4.44v.972h.946v-.972h.837v1.431h.945v-2.376H5.11A2.586 2.586 0 002.558 9.37zm-.058.965a1.639 1.639 0 011.707 1.637 1.64 1.64 0 01-1.639 1.638 1.639 1.639 0 01-.068-3.275zm13.09.388a.75.75 0 00-.345 1.404l-.383 1.958h1.5l-.383-1.958a.75.75 0 00.384-.654.75.75 0 00-.773-.75zm2.218 1.391h3.421c-.01 1.758-.415 3.384-1.094 4.704-.744-.434-1.623-.755-2.577-.94a27.81 27.81 0 00.25-3.764zm3.556 0h2.095a7.805 7.805 0 01-2.281 5.47 5.825 5.825 0 00-.924-.696c.712-1.378 1.1-3.033 1.11-4.774zm-5.52 3.703a10.284 10.284 0 011.562.156 16.518 16.518 0 01-.357 1.791c-.275 1.045-.618 1.774-.982 2.114a7.972 7.972 0 01-.93 0c-.365-.34-.708-1.07-.983-2.114a16.519 16.519 0 01-.357-1.79 10.284 10.284 0 012.048-.157zm1.695.181c.94.184 1.803.5 2.533.926-.686 1.284-1.635 2.265-2.73 2.776a7.874 7.874 0 01-1.075.164c.344-.393.657-1.094.913-2.065a16.64 16.64 0 00.359-1.8zm-3.874 0a16.648 16.648 0 00.359 1.8c.255.973.568 1.674.913 2.066a7.873 7.873 0 01-1.075-.164c-1.096-.511-2.045-1.492-2.731-2.775.73-.428 1.594-.743 2.534-.927zm-2.652.997a8.16 8.16 0 00.506.825c.52.741 1.121 1.323 1.776 1.73a7.814 7.814 0 01-3.174-1.884 5.694 5.694 0 01.892-.67zm9.178 0a5.694 5.694 0 01.891.67 7.814 7.814 0 01-3.173 1.885c.654-.407 1.256-.989 1.775-1.73a8.16 8.16 0 00.507-.825z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="2.5em"><path fill="currentColor" d="M15.287 3.63a8.407 8.407 0 00-8.051 7.593h.55a7.805 7.805 0 012.24-4.713 5.825 5.825 0 00.924.695c-.608 1.177-.98 2.556-1.082 4.018h.135c.105-1.467.485-2.819 1.065-3.947.745.434 1.623.754 2.577.94a27.83 27.83 0 00-.25 3.763h-.847v.135h.847c.003 1.334.09 2.617.25 3.764-.954.185-1.832.506-2.577.94a9.997 9.997 0 01-.978-3.137h-.137c.164 1.16.502 2.25.997 3.208a5.825 5.825 0 00-.924.695 7.805 7.805 0 01-2.255-4.875H7.22A8.407 8.407 0 0024 12.034a8.398 8.398 0 00-.688-3.333 8.407 8.407 0 00-8.025-5.072zm.315.546c.155 0 .31.005.464.014.365.34.708 1.07.983 2.114a16.518 16.518 0 01.357 1.79 10.173 10.173 0 01-1.804.16 10.173 10.173 0 01-1.805-.16 16.519 16.519 0 01.357-1.79c.275-1.045.618-1.775.983-2.114a7.97 7.97 0 01.465-.014zm-.665.028c-.345.392-.658 1.093-.913 2.065a16.639 16.639 0 00-.36 1.8c-.939-.183-1.802-.498-2.533-.926.686-1.283 1.635-2.264 2.73-2.775a7.874 7.874 0 011.076-.164zm1.33 0a7.856 7.856 0 011.084.168c1.092.513 2.037 1.492 2.721 2.771-.73.428-1.594.743-2.533.927a16.64 16.64 0 00-.36-1.8c-.255-.972-.568-1.673-.912-2.066zm-2.972.314c-.655.407-1.257.989-1.776 1.73a8.166 8.166 0 00-.506.825 5.69 5.69 0 01-.891-.67 7.814 7.814 0 013.173-1.885zm4.624.006a7.862 7.862 0 013.164 1.877 5.692 5.692 0 01-.893.672 8.166 8.166 0 00-.506-.825c-.516-.738-1.115-1.318-1.765-1.724zm3.26 1.985a7.858 7.858 0 011.638 2.419 7.802 7.802 0 01.642 3.051h-2.095c-.01-1.74-.398-3.396-1.11-4.774a5.823 5.823 0 00.925-.696zm-1.044.767c.679 1.32 1.084 2.945 1.094 4.703h-3.42a27.863 27.863 0 00-.251-3.763c.954-.186 1.833-.506 2.577-.94zm-6.357.965a10.299 10.299 0 001.824.16 10.299 10.299 0 001.823-.16c.16 1.138.246 2.413.249 3.738h-1.178a1.03 1.03 0 01-.093.135h1.27a27.71 27.71 0 01-.248 3.739 10.397 10.397 0 00-3.647 0 27.733 27.733 0 01-.248-3.739h1.294a.99.99 0 01-.09-.135H13.53c.003-1.325.088-2.6.248-3.738zM2.558 9.37a2.585 2.585 0 00-2.547 2.35c-.142 1.541 1.064 2.842 2.566 2.842 1.26 0 2.312-.917 2.533-2.124h4.44v.972h.946v-.972h.837v1.431h.945v-2.376H5.11A2.586 2.586 0 002.558 9.37zm-.058.965a1.639 1.639 0 011.707 1.637 1.64 1.64 0 01-1.639 1.638 1.639 1.639 0 01-.068-3.275zm13.09.388a.75.75 0 00-.345 1.404l-.383 1.958h1.5l-.383-1.958a.75.75 0 00.384-.654.75.75 0 00-.773-.75zm2.218 1.391h3.421c-.01 1.758-.415 3.384-1.094 4.704-.744-.434-1.623-.755-2.577-.94a27.81 27.81 0 00.25-3.764zm3.556 0h2.095a7.805 7.805 0 01-2.281 5.47 5.825 5.825 0 00-.924-.696c.712-1.378 1.1-3.033 1.11-4.774zm-5.52 3.703a10.284 10.284 0 011.562.156 16.518 16.518 0 01-.357 1.791c-.275 1.045-.618 1.774-.982 2.114a7.972 7.972 0 01-.93 0c-.365-.34-.708-1.07-.983-2.114a16.519 16.519 0 01-.357-1.79 10.284 10.284 0 012.048-.157zm1.695.181c.94.184 1.803.5 2.533.926-.686 1.284-1.635 2.265-2.73 2.776a7.874 7.874 0 01-1.075.164c.344-.393.657-1.094.913-2.065a16.64 16.64 0 00.359-1.8zm-3.874 0a16.648 16.648 0 00.359 1.8c.255.973.568 1.674.913 2.066a7.873 7.873 0 01-1.075-.164c-1.096-.511-2.045-1.492-2.731-2.775.73-.428 1.594-.743 2.534-.927zm-2.652.997a8.16 8.16 0 00.506.825c.52.741 1.121 1.323 1.776 1.73a7.814 7.814 0 01-3.174-1.884 5.694 5.694 0 01.892-.67zm9.178 0a5.694 5.694 0 01.891.67 7.814 7.814 0 01-3.173 1.885c.654-.407 1.256-.989 1.775-1.73a8.16 8.16 0 00.507-.825z"></path></svg>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fill="currentColor" is not defined

Copy link
Contributor Author

@N6REJ N6REJ Dec 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That allows css to handle the color

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the color in eg fill="#ff0000" has no effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you applying the fill to the svg or the path? It makes a difference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

31545

When I change the current color in the code, for example to red, the icon color does not change in the browser. This remains white.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. The only way to change the color via css is to set to "currentColor" in the svg. And then style it in the css. This is what is occuring...
image

@sandewt
Copy link
Contributor

sandewt commented Dec 1, 2020

Try something like this:

<?php echo file_get_contents(JPATH_ROOT . substr(HTMLHelper::_('image', $button['image'], '', '', true, true), strlen(Uri::root(true)))); ?>

Build in a condition if the .svg does not exist.

@N6REJ
Copy link
Contributor Author

N6REJ commented Dec 2, 2020

@sandewt let me know if that solves your subfolder issue please.

@ceford
Copy link
Contributor

ceford commented Dec 2, 2020

I have tested this item ✅ successfully on e6e9b8d

Needs better testing instructions! I enabled Two-Factor Authentication but forgot I needed https to test. With that done I see the logo on both login locations but I get an extra box to enter Secret Key. I guess that is normal.


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

@ghost
Copy link

ghost commented Dec 2, 2020

I have tested this item ✅ successfully on e6e9b8d


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

@sandewt
Copy link
Contributor

sandewt commented Dec 2, 2020

Build in a condition if the .svg does not exist.

I do this kind of check at the Improvement Vote Plugin #31098, to avoid a warning message.

// Get the image
$image = HTMLHelper::_('image', 'plg_system_webauthn/webauthn.svg', '', '', true, true);

// If you can't find the image then skip it
if ($image === null)
{
	return;
}

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

@N6REJ N6REJ changed the title [4.0] [WIP] modify #31190 [4.0] modify #31190 Dec 3, 2020
@sandewt
Copy link
Contributor

sandewt commented Dec 3, 2020

The aria-hidden property tells screen-readers if they should ignore the icon.

Wouldn't it be better to add these here? @brianteeman

<svg aria-hidden="true" ...</svg>

@brianteeman
Copy link
Contributor

Best to ask the accessibility team @carcam

@N6REJ
Copy link
Contributor Author

N6REJ commented Dec 9, 2020

Build in a condition if the .svg does not exist.

I do this kind of check at the Improvement Vote Plugin #31098, to avoid a warning message.

// Get the image
$image = HTMLHelper::_('image', 'plg_system_webauthn/webauthn.svg', '', '', true, true);

// If you can't find the image then skip it
if ($image === null)
{
	return;
}

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

I don't believe you'll get a warning with my work?

@sandewt
Copy link
Contributor

sandewt commented Dec 11, 2020

I don't believe you'll get a warning with my work?

Normally not, but if the image does not load / exists, you will get a warning message.

The following code prevents that. Try it. Change webauthn.svg eg to test.svg.

$image = HTMLHelper::_('image', 'plg_system_webauthn/webauthn.svg', '', '', true, true);

if ($image === null)
{
	return []; // break in case the svg does not exist
}

$image = JPATH_ROOT . substr($image, strlen(Uri::root(true)));

@N6REJ
Copy link
Contributor Author

N6REJ commented Dec 11, 2020

Build in a condition if the .svg does not exist.

I do this kind of check at the Improvement Vote Plugin #31098, to avoid a warning message.

// Get the image
$image = HTMLHelper::_('image', 'plg_system_webauthn/webauthn.svg', '', '', true, true);

// If you can't find the image then skip it
if ($image === null)
{
	return;
}

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

idk how I missed it but your right it was broken. Fixed now.

@hans2103
Copy link
Contributor

I'm not in the habit of repeating myself so please search and you will find it

Both comments does not help to solve this issue Brian.

I've tried to search and came with this comment... did you mean this one and the couple of comments following upon it?

#31079 (comment)

@N6REJ
Copy link
Contributor Author

N6REJ commented Dec 31, 2020

@hans2103 storm says adding aria to the <svg is not permissible there. Should I chalk this up to a mess up on storms part and do it anyway?
https://youtrack.jetbrains.com/issue/WEB-36210?_ga=2.236984006.739645025.1609423177-179347667.1594201852

@hans2103
Copy link
Contributor

PHPStorm does not know if image is decorative or not. Might that be the trick?

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 2, 2021

@hans2103 after 2yrs you'd think storm would do a follow up on it all. I forget who our contact at storm is, i THINK its @joomla/marketing-communication-department

@brianteeman
Copy link
Contributor

Does phpstorm obhect when you have role="presentation" and aria-hidden="true"

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 2, 2021

YES, role= or aria- it throws an error

@sandewt
Copy link
Contributor

sandewt commented Jan 2, 2021

role="presentation" and aria-hidden="true"

YES, role= or aria- it throws an error

@N6REJ Do you mean the OR or an AND condition ?

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 2, 2021

PERIOD, it won't allow role or aria

@hvdmeer
Copy link

hvdmeer commented Jan 5, 2021

hans2103 after 2yrs you'd think storm would do a follow up on it all. I forget who our contact at storm is, i THINK its @joomla/marketing-communication-department

Try Roland Dalmulder, as far as I know he's the unofficial contact (or just has contact) with Jetbrains. Personally I don't think the Marketing department was involved with a developer tool.

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 5, 2021

@roland-d any help/input/feedback?

@roland-d
Copy link
Contributor

roland-d commented Jan 6, 2021

@N6REJ What is the "error"? Here is what I see:

image
image

Support for aria- looks just fine.

image

Support for role seems fine too.

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 7, 2021

it's not in html its only in <svg like <svg aria-hidden="true" it says aria is not supported here. Same thing for role=
It was first reported 2 years ago https://youtrack.jetbrains.com/issue/WEB-36210?_ga=2.236984006.739645025.1609423177-179347667.1594201852

@roland-d
Copy link
Contributor

roland-d commented Jan 7, 2021

@N6REJ Since it is confirmed by JB there is nothing else I can do at this point. Perhaps also link this issue in the JB issue?

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 8, 2021

I've decided to follow W3C and ignore storm till they get things sorted out, so lets get this tested and merged :D

@particthistle
Copy link
Member

particthistle commented Jan 13, 2021

Went to apply the patch on Joomla 4 Beta 7 today and it came up with:

The patch could not be applied because it conflicts with a previously applied patch: administrator/modules/mod_login/tmpl/default.php

So there's a clash with something recently merged.

@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 13, 2021

@particthistle I believe this means you already had a patch applied.
Git testing is not reporting an issue and everything was updated 5 days ago.

@particthistle
Copy link
Member

Resetting patch tester component data cleared the error I was having. However @sandewt's review suggestion needs to be committed before I can test again now.

@particthistle
Copy link
Member

I have tested this item ✅ successfully on 473cbb6

Tested successfully. Before and after applying the patch look identical on screen - it's the HTML that changes as well as the function changing to display the icon.

Icon now has aria-hidden="true" for both the front end and back end login buttons.


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

@ghost
Copy link

ghost commented Jan 15, 2021

I have tested this item ✅ successfully on 473cbb6


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

@HLeithner HLeithner merged commit aa05dd9 into joomla:4.0-dev Jan 18, 2021
@HLeithner
Copy link
Member

Thanks

@HLeithner HLeithner added this to the Joomla 4.0 milestone Jan 18, 2021
@N6REJ
Copy link
Contributor Author

N6REJ commented Jan 18, 2021

ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPM Resource Changed This Pull Request can't be tested by Patchtester Updates Requested Indicates that this pull request needs an update from the author and should not be tested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet