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

yii\authclient\widgets\AuthChoice displays nothing by default #219

Open
lukos opened this issue May 22, 2018 · 10 comments
Open

yii\authclient\widgets\AuthChoice displays nothing by default #219

lukos opened this issue May 22, 2018 · 10 comments
Labels
status:ready for adoption Feel free to implement this issue. type:docs Documentation

Comments

@lukos
Copy link
Contributor

lukos commented May 22, 2018

Do: Use this widget to create a list of login links in the way it is displayed in the docs.

Expect: I would expect something that works out of the box and displays either a button or a link with the name of the provider.

Actual: What you get is an invisible link(s) with no text since the widget appears to put a blank string as the content of the span inside the link. The provider name does get added to the class of both the link and the inner span but surely, at least by default, should also be the inner text of the span?

This might be a documentation issue, maybe I should have added other properties to the widget?

What would possibly make more sense is that if there is no custom text set, it adds the name of the provider in the link. It should probably also allow custom "class" so that it can be e.g. a button or a link depending on what the user wants.

Again, happy to PR if I can have some direction on whether it is a docs issue, or whether some improvements could be made?

@samdark
Copy link
Member

samdark commented May 22, 2018

These links should be CSS-styled.

@lukos
Copy link
Contributor Author

lukos commented May 22, 2018

I will make a PR for the docs, although I don't see how to easily style them with css. It works if I used a.Provider:after { content: "Provider name"; } but that seems a bit weird - why use a span if you can write the text directly into the link?
Maybe it only really works properly when used in the custom style. I think we could maybe make this nicer but happy to park after making it clearer in the docs.

@samdark
Copy link
Member

samdark commented May 23, 2018

I mean they're styled out of the box. Widget should register CSS assets needed.

@lukos
Copy link
Contributor Author

lukos commented May 24, 2018

OK, I'll look. It might be because my site does not use Bootstrap.

@lukos
Copy link
Contributor Author

lukos commented May 24, 2018

It only styles the built-in clients using the icons from authchoice.png If you create a custom client based on e.g. OpenIdConnect, it displays a transparent icon and no text. Please let me know whether you think the instructions should be changed to tell the developer what to do or whether some code needs changing to make clients without the built-in names to display something.

@samdark
Copy link
Member

samdark commented May 24, 2018

Indeed it won't work for custom clients. Not sure what's the best way to solve it so it could be extended easily. Any idea?

@lukos
Copy link
Contributor Author

lukos commented May 25, 2018

What about extending the icon image to include the letters A-Z as well as Google, Twitter etc. so that a property on the config could be, say, iconLetter => 'P' which will set the correct css class to offset the image. Also, if the user wants their own image, then we could extend the instructions to say where to put the image and what css would be required to do the same thing as the plugin does for Google, Twitter etc.?

@samdark
Copy link
Member

samdark commented May 26, 2018

Yes, that sounds like a good option.

@machour
Copy link
Member

machour commented Mar 26, 2019

I feel that adding 26 tiles to our sprite is a bit "too much" for people using only Facebook or Twitter.

Documenting how to use your own images would be better.

@samdark samdark added status:ready for adoption Feel free to implement this issue. and removed status:under discussion labels Mar 26, 2019
@samdark
Copy link
Member

samdark commented Mar 26, 2019

Agree.

@samdark samdark added type:docs Documentation and removed type:enhancement Enhancement labels Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:docs Documentation
Projects
None yet
Development

No branches or pull requests

3 participants